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></p> Signup and view all the answers

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

    <p>53</p> Signup and view all the answers

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

    <p>Response flag</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</p> Signup and view all the answers

    How is the length of a DNS message calculated?

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

    What is the size of a TCP header?

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

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

    <p>SYN segment</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.</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</p> Signup and view all the answers

    What is the typical size of an IPv4 header?

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

    Which flag is specifically activated for closing unused TCP ports?

    <p>RST</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.</p> Signup and view all the answers

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

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

    What is the primary protocol used for dynamic addressing?

    <p>DHCP</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.</p> Signup and view all the answers

    What is the size of the Identification field in bits?

    <p>16</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.</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</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</p> Signup and view all the answers

    What statistics are expected when pinging a host?

    <p>Round-Trip Time (RTT) and packet loss.</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.</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</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</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</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</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</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</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</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</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</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.</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.</p> Signup and view all the answers

    Which routing protocol uses UDP?

    <p>RIP</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.</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</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))</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</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</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</p> Signup and view all the answers

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

    <p>Connection</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</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</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.</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</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</p> Signup and view all the answers

    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 Servers and HTTP Communication
    18 questions
    Introducción al HTTP
    37 questions

    Introducción al HTTP

    ThrilledBauhaus avatar
    ThrilledBauhaus
    Understanding HTTP Protocols
    14 questions
    Use Quizgecko on...
    Browser
    Browser