HTTP Basics and Status Codes
48 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

How many HTTP requests are involved when downloading two embedded images from the same web server using non-persistent TCP connections?

  • 2
  • 6
  • 4 (correct)
  • 8

What transport protocol is used for HTTP?

  • UDP
  • ICMP
  • TCP (correct)
  • SCTP

What is the size of the header in a DNS message?

  • 16 bytes
  • 8 bytes
  • 10 bytes
  • 12 bytes (correct)

Which command is used to fetch the IP address of www.school.edu?

<p>nslookup --Type=A <a href="http://www.school.edu">www.school.edu</a> (A)</p> Signup and view all the answers

In a DNS response message, which UDP port is used as the source port?

<p>53 (D)</p> Signup and view all the answers

Which of the following flags is set to 0 in a DNS query?

<p>Response flag (C)</p> Signup and view all the answers

What is the first segment sent by the client when requesting a webpage from a web server for the first time?

<p>DNS query in a UDP segment (C)</p> Signup and view all the answers

How is the length of a DNS message calculated?

<p>Length field in UDP minus 8 bytes (D)</p> Signup and view all the answers

What is the size of a TCP header?

<p>20 bytes (A)</p> Signup and view all the answers

During TCP connection establishment, which segment does the client send first?

<p>SYN segment (C)</p> Signup and view all the answers

What happens to the client's sequence number when the client downloads objects over a TCP connection?

<p>It stays constant. (A)</p> Signup and view all the answers

Which fields in the TCP segment are specifically used for flow control?

<p>Acknowledgement number and receive window (B)</p> Signup and view all the answers

What is the typical size of an IPv4 header?

<p>20 bytes (B)</p> Signup and view all the answers

Which flag is specifically activated for closing unused TCP ports?

<p>RST (D)</p> Signup and view all the answers

How does the acknowledgement number of the client change when the client uploads objects over a TCP connection?

<p>It stays constant. (A)</p> Signup and view all the answers

What is the total bit size of a TCP sequence number?

<p>32 bits (D)</p> Signup and view all the answers

What is the primary protocol used for dynamic addressing?

<p>DHCP (D)</p> Signup and view all the answers

How is the checksum calculated in the network layer?

<p>By summing 16 bit words and taking the one's complement of the final sum. (C)</p> Signup and view all the answers

What is the size of the Identification field in bits?

<p>16 (A)</p> Signup and view all the answers

What is the purpose of the Echo messages exchanged in a Ping operation?

<p>To determine node reachability. (D)</p> Signup and view all the answers

What command is used to send an echo message to the IP 192.168.1.10 from 192.168.1.1?

<p>ping 192.168.1.10 (A)</p> Signup and view all the answers

Which field is common in both TCP and IP headers and has the same size?

<p>Header Length (C), Checksum (D)</p> Signup and view all the answers

What statistics are expected when pinging a host?

<p>Round-Trip Time (RTT) and packet loss. (C)</p> Signup and view all the answers

What is one disadvantage of static routing compared to dynamic routing?

<p>It requires frequent updates by administrators. (A), It can lead to inefficient routing paths. (C)</p> Signup and view all the answers

What header line is included in a conditional GET message but not in a regular HTTP GET message?

<p>If-Modified-Since (D)</p> Signup and view all the answers

When comparing Date and Last Modified header lines in an HTTP response, what does the Last Modified header indicate?

<p>Creation or modification time of the object (B)</p> Signup and view all the answers

Which of the following HTTP status codes corresponds to a request for a resource that has been permanently moved?

<p>301 Moved Permanently (C)</p> Signup and view all the answers

In HTTP message format, what is the term used to refer to the entity that creates the client process?

<p>User-Agent (C)</p> Signup and view all the answers

What characterizes persistent TCP connections as opposed to non-persistent TCP connections in HTTP?

<p>Multiple objects are fetched over one TCP connection (D)</p> Signup and view all the answers

How many HTTP requests are involved when downloading a webpage with three embedded objects using a persistent TCP connection?

<p>4 HTTP requests (D)</p> Signup and view all the answers

Which of the following header lines would you typically find in an HTTP request but not in an HTTP reply?

<p>Host (D)</p> Signup and view all the answers

How is the total access delay calculated when multiple objects are fetched using persistent TCP?

<p>Connection time plus 5 RTT (B)</p> Signup and view all the answers

What field in TCP is used to negotiate the Maximum Segment Size (MSS) between sender and receiver?

<p>Options field (D)</p> Signup and view all the answers

Which of the following statements correctly distinguishes between TCP and UDP?

<p>TCP provides reliable data transfer, while UDP does not. (A)</p> Signup and view all the answers

What is the method for fragmenting messages under TCP?

<p>By dividing the message size by the MSS negotiated by both parties. (A)</p> Signup and view all the answers

Which routing protocol uses UDP?

<p>RIP (A)</p> Signup and view all the answers

What is the purpose of error detection in both the network and transport layers?

<p>To ensure the integrity and proper delivery of packets. (D)</p> Signup and view all the answers

Which command would you use to check the line statuses of all interfaces in a router?

<p>show ip interface brief (A)</p> Signup and view all the answers

Which of the following Python commands correctly opens a TCP connection to a server?

<p>socket.connect(('server_IP', server_port)) (B)</p> Signup and view all the answers

What is the valid range of usable IP addresses under the address space 192.168.1.128/28?

<p>192.168.1.129 – 192.168.1.142 (D)</p> Signup and view all the answers

Which command is used to exclude a specific IP address range from being assigned by the DHCP server?

<p>R1(dhcp-config)# ip dhcp excluded-address 10.0.1.10 10.0.1.20 (D)</p> Signup and view all the answers

What is the source IP address of the first message in the DHCP process?

<p>0.0.0.0 (D)</p> Signup and view all the answers

Which of the following messages is NOT part of the DHCP exchange process?

<p>Connection (D)</p> Signup and view all the answers

What does the command 'R1(dhcp-config)# network 10.0.1.0 /24' signify?

<p>Defines the range of IPs available for DHCP assignments (A)</p> Signup and view all the answers

Which command allows you to view the number of messages exchanged between the DHCP server and clients?

<p>show ip dhcp server statistics (D)</p> Signup and view all the answers

What is one disadvantage of using NAT (Network Address Translation)?

<p>It destroys the end-to-end principle in TCP connections. (C)</p> Signup and view all the answers

When configuring a DHCP server, which command specifies the DNS server address?

<p>R1(dhcp-config)# dns-server (C)</p> Signup and view all the answers

What is the purpose of the commands enabling static NAT mapping?

<p>To create a link between public and private IP addresses (A)</p> Signup and view all the answers

Flashcards

HTTP Reply Without Object Headers

When an HTTP response does not include an object, headers like "Last-Modified", "Content-Length", and "Content-Type" are missing.

Conditional GET vs. GET

A Conditional GET request includes an "If-Modified-Since" header, which is absent in a regular GET request. This allows the server to check if the resource has changed since a specific time.

Date vs. Last-Modified Header

"Date" in an HTTP response refers to the time the server sent the response. "Last-Modified" indicates the time the resource on the server was last modified.

HTTP Request Line (Example)

The line initiating a client request, e.g., "GET /homepage.html HTTP/1.1", specifying the action, resource, and protocol version.

Signup and view all the flashcards

Web Server Identification

In HTTP messages, the web server is identified by the "Host" header.

Signup and view all the flashcards

Persistent vs. Non-persistent TCP

Persistent TCP connections allow multiple objects to be retrieved over a single TCP connection, while non-persistent connections require a new connection for each object.

Signup and view all the flashcards

HTTP Header Location (Example)

"Host" and "Accept-Language" are in the request (GET message); "Server" and "Date" are in the response; "Connection" can be in both request and response.

Signup and view all the flashcards

Persistent TCP Connection Requests

Use "Connection: Keep-alive" in the header to establish persistent TCP connections, allowing multiple files to be retrieved over a single TCP connection.

Signup and view all the flashcards

TCP Header Size

A TCP header is 20 bytes in size.

Signup and view all the flashcards

TCP Connection Establishment

The client sends a SYN segment, the server responds with SYN-ACK, and the client sends an ACK segment to complete the connection.

Signup and view all the flashcards

Client TCP Connection Close

Client sends FIN, server responds with ACK and then sends FIN; the client responds with ACK, then waits 30 seconds before closing.

Signup and view all the flashcards

Sequence Number Change(Download)

Client sequence number remains constant; server sequence number increments by segment size.

Signup and view all the flashcards

Sequence Number Change(Upload)

Server sequence number remains constant; client sequence number increments by segment size.

Signup and view all the flashcards

Acknowledgement Number Change(Download)

Server acknowledgement number remains constant; client acknowledgement number increments by segment size.

Signup and view all the flashcards

Acknowledgement Number Change(Upload)

Client acknowledgement number remains constant; server acknowledgement number increments by segment size.

Signup and view all the flashcards

TCP Congestion/Flow Control Fields

Sequence number, acknowledgement number, ACK, and receive window are used for congestion and flow control.

Signup and view all the flashcards

HTTP Request for Embedded Images

When downloading multiple images from the same web server for the first time using a non-persistent TCP connection, each object is one Maximum Segment Size (MSS). A client needs to send multiple requests to initiate this.

Signup and view all the flashcards

DNS Port Numbers

DNS server port is 53, and the client port is a random 16-bit number (excluding well-defined server ports).

Signup and view all the flashcards

HTTP and DNS Transport Protocols

HTTP uses TCP, and DNS uses UDP.

Signup and view all the flashcards

DNS Message Structure

A DNS message has a header (identification, flags, counts) and a body (questions, answers, authoritative records, additional records).

Signup and view all the flashcards

DNS Header Length

The DNS header is 12 bytes.

Signup and view all the flashcards

DNS Message Length Calculation

To find the length, subtract 8 bytes from the UDP Length field.

Signup and view all the flashcards

Nslookup for Canonical Name

Use nslookup -type=CNAME www.school.edu in the command line.

Signup and view all the flashcards

Nslookup for IP Address

Use nslookup -type=A www.school.edu in the command line.

Signup and view all the flashcards

TCP MSS negotiation

A process where TCP sender and receiver agree on the Maximum Segment Size (MSS) to prevent packet fragmentation and improve efficiency.

Signup and view all the flashcards

TCP vs. UDP

TCP is connection-oriented and reliable, whereas UDP is connectionless and fast.

Signup and view all the flashcards

Message Fragmentation (TCP)

Dividing a large message into smaller segments to fit within the Maximum Segment Size (MSS).

Signup and view all the flashcards

UDP Socket Python

A Python socket command for creating a UDP socket connection with the parameters (AF_INET, SOCK_DGRAM).

Signup and view all the flashcards

TCP Socket Python

A Python socket command for creating a TCP socket connection with the parameters (AF_INET, SOCK_STREAM).

Signup and view all the flashcards

IP Address Range (192.168.1.128/28)

The network address space encompassing the usable IP addresses from 192.168.1.129 to 192.168.1.142.

Signup and view all the flashcards

IP Route Check

A network command used to check whether a network or router is correctly configured to route packets.

Signup and view all the flashcards

Show IP Interface Brief Command

A command used to display the status of all interfaces in a router (all network connections).

Signup and view all the flashcards

Static Addressing

Assigning fixed IP addresses to devices, suitable for small networks due to its simplicity.

Signup and view all the flashcards

Dynamic Addressing

Using a protocol like DHCP, devices get temporary IP addresses, ideal for large networks where managing individual addresses is impractical.

Signup and view all the flashcards

Checksum Calculation

Network layer error detection method where the header is split into 16-bit words, summed, and the complement of the sum is stored as the checksum.

Signup and view all the flashcards

Identification Field

A 16-bit field in the IP header used to identify a specific datagram within a communication session.

Signup and view all the flashcards

TTL Field

A 16-bit field in the IP header representing the maximum number of hops a datagram can travel.

Signup and view all the flashcards

Fragmentation Offset

A 13-bit field in the IP header indicating the position of a fragment within the original datagram.

Signup and view all the flashcards

Datagram Length

A 16-bit field in the IP header specifying the total length of the datagram in bytes.

Signup and view all the flashcards

Dynamic Routing Advantages

Dynamic routing is more efficient, easier to configure, and automatically adapts to network changes by selecting the best path based on link metrics.

Signup and view all the flashcards

RIP Version 2

A version of the Routing Information Protocol (RIP) that supports VLSM (Variable Length Subnet Mask) and allows for larger networks.

Signup and view all the flashcards

Static Route Configuration

Manually configuring a route between routers, where the administrator specifies the network destination, next hop IP address, and subnet mask.

Signup and view all the flashcards

DHCP Discovery Message

The initial message sent by a DHCP client to request an IP address. It is broadcast to all devices on the network using a source IP address of 0.0.0.0 and a destination IP address of 255.255.255.255.

Signup and view all the flashcards

DHCP Excluded Address Range

A range of IP addresses that the DHCP server will not assign to clients. This can be used to reserve specific addresses for static configuration or for other purposes.

Signup and view all the flashcards

DHCP Server Configuration - Gateway and DNS

Configuring the DHCP server to provide clients with the gateway IP address and DNS server IP addresses, which are essential for communication with other networks and name resolution.

Signup and view all the flashcards

NAT Advantage: Address Space Expansion

Network Address Translation (NAT) allows a smaller number of public IP addresses to be used by multiple private devices, effectively expanding address space.

Signup and view all the flashcards

NAT Disadvantage: Complex TCP Connections

NAT can introduce complexities when establishing TCP connections to private hosts behind the NAT device, as IP addresses are translated.

Signup and view all the flashcards

NAT Static Mapping

A configuration where a specific public IP address is permanently associated with a private IP address, enabling direct access to a private device from the internet.

Signup and view all the flashcards

Study Notes

HTTP Reply without Object

  • Last modified, Content length, and Content type headers are absent
  • Reply does not carry an object

GET vs. Conditional GET

  • Conditional GET message includes If-Modified-Since header
  • GET message does not include this header

Date vs. Last Modified

  • Date: Time of web server reply
  • Last Modified: Time object was created/modified

HTTP Status Codes

  • Examples:
    • 301 Moved Permanently
    • 200 OK
    • 400 Bad Request
    • 404 Not Found
    • 302 Found
    • 502 Bad Gateway
    • 304 Not Modified

HTTP Request Line (Example)

  • GET /homepage.html HTTP/1.1

Web Server in HTTP

  • Web server is referred to as Host in HTTP message format
  • Client and server processes are referred to as User-agent and Server respectively

HTTP Header Locations

  • Host, Accept Language are in HTTP request
  • Server and Date are in HTTP reply
  • Connection is in both request and reply

Persistent vs. Non-Persistent TCP

  • Persistent TCP: Multiple objects over one TCP connection (Connection: Keep-alive)
  • Non-persistent TCP: Each object over a separate TCP connection (Connection: Close)

Webpage with Embedded Objects (Persistent TCP)

  • 4 HTTP requests
  • Total access delay: 5 Round Trip Times (RTTs)

Webpage with Embedded Objects (Non-Persistent TCP)

  • 4 HTTP requests
  • Total access delay: 8 RTTs

DNS Server and Client Ports

  • Server port: 53
  • Client port: Random 16-bit number (excluding server-defined ones)
  • HTTP: TCP
  • DNS: UDP

DNS Message Contents

  • DNS header (Identification, Flags, Question/Answer/Additional RR counts)
  • Body (Questions, Answers, Authoritative RRs, Additional RRs)

DNS Header Length

  • 12 bytes
  • DNS message length determined by UDP length field minus 8 bytes

Fetching Canonical Name and IP Address

Identifying Query and Response in Wireshark

  • Look for source/destination IPs
  • UDP port 53 in response, other port in query
  • Response flags, Recursion available flag

HTTP Request for Webpage (Client)

    1. DNS query (UDP) to DNS server
    1. SYN segment to web server
    1. ACK segment to web server
    1. HTTP request (combined with ACK)

TCP Header and IPv4 Header Sizes

  • TCP header: 20 bytes
  • Typical IPv4 header: 20 bytes

TCP Connection Establishment

  • Client sends SYN to server
  • Server replies with SYN-ACK
  • Client sends ACK
  • Connection established

TCP Connection Closing

  • Client sends FIN to server
  • Server replies with ACK
  • Server sends FIN to client
  • Client sends ACK

TCP Segment Header Fields (Congestion/Flow Control)

  • Sequence number
  • Acknowledgement number

TCP Segment Flags

  • SYN, ACK, FIN, PSH, URG, RST
  • PSH with ACK for in-line data
  • RST for closing unused ports

MSS Negotiation in TCP

  • Options field
  • Affects TCP header size

TCP vs. UDP

  • TCP: Connection-oriented, reliable, congestion control
  • UDP: Connectionless, unreliable (no congestion control, faster)

Routing Protocols (using TCP/UDP)

  • UDP: RIP
  • TCP: OSPF, BGP

DNS Message Fragmentation

  • Divided by MSS (estimated message size)
  • Client acknowledges received segments and client sends acknowledgment to the server when completes

Socket Library (Python)

  • Open/close TCP connection example
  • Examples for sending/receiving data using UDP/TCP sockets

Network Layer (GNS3)

  • Checking line statuses: show ip interface brief
  • Checking network reachability: show ip route

TCP Checksums

  • Transport Layer: Computed over entire message
  • Network Layer: Computed only over header portion of packets

Static vs. Dynamic Addressing

  • Static: Simple for a few devices, complex for many
  • Dynamic: DHCP, complex for many devices, works well for large networks

Network Layer Checksum Calculation

  • Split into 16-bit words and summed
  • Any carry added to the sum
  • Ones complement of the final sum

IP Address Ranges (e.g., 192.168.1.128/28)

  • Subnet mask: e.g., 255.255.255.240
  • Usable range: e.g., 192.168.1.129 - 192.168.1.142

DHCP Message Exchange

  • 4 messages (Discovery, Offer, Request, Acknowledgement)
  • Source IP: 0.0.0.0, Destination IP: 255.255.255.255

Excluding Address Ranges (DHCP)

  • Prevents IP assignment in that range
  • Command example: R1(dhcp-config)# ip dhcp excluded-address 10.0.1.10 10.0.1.20

Configuring Gateway and DNS in DHCP Server (R1)

  • R1(dhcp-config)# default-router <IP address of R1's interface>
  • R1(dhcp-config)# dns-server <IP address of DNS server>

DHCP Server Statistics

  • Use show ip dhcp server statistics command

Network Address Translation (NAT)

  • Advantages: Increased address space, simplifies network configuration
  • Disadvantages: Complicates address translation for private hosts

NAT Pool (Example)

  • Define public IP addresses to be used

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

CCN Lab Revision PDF

Description

Test your knowledge of HTTP protocols, including the differences between GET and Conditional GET requests. Explore the significance of HTTP status codes, header locations, and persistent TCP connections in web communications.

More Like This

Web
10 questions

Web

LionheartedSeattle avatar
LionheartedSeattle
HTTP Protocol Fundamentals
43 questions

HTTP Protocol Fundamentals

RosyHeliotrope5211 avatar
RosyHeliotrope5211
Web Communication Protocols Overview
48 questions
Use Quizgecko on...
Browser
Browser