1 10-DayInLifeOfPacket


Previous: 08-Wireless.html

1.1 Review

1.2 A day in the life of a packet

1.3 Traffic example 1:

1.3.1 Step 1: The computer wants to send traffic

1.3.2 Step 2: DNS

This part is divided into numerous sub-steps

1.3.2.1 Step 2a: DNS cache

1.3.2.2 Step 2b: Putting a DNS query together

1.3.2.3 Step 2c: Check the ARP table for a valid MAC address

1.3.2.4 Step 2d: ARP request to the network

1.3.2.5 Step 2e: ARP reply from the router

1.3.2.6 Step 2f: Send off the DNS query

1.3.2.7 Step 2g: The home router checks its DNS cache

1.3.2.8 Step 2h: The home router prepares and sends away its DNS query

1.3.2.9 Step 2i: The DNS query is routed over the Internet

1.3.2.10 Step 2j: The DNS server responds

1.3.2.11 Step 2k: The home router can send a DNS reply to the computer

1.3.3 Step 3: The computer sets up a session to www.iis.se

1.3.3.1 Step 3a: The computer sends a TCP SYN message

1.3.3.2 Step 3b: The Web Server replies with TCP SYN-ACK

Here you can see the returning TCP SYN-ACK response from the Web Server to the computer:
“Okay, I’m good to set up a session and I confirm that I got your message”
10-DayInLifeOfPacket/tcp-syn-ack.jpg
The packet matches the NAT table entry on the router, so that the router can see which LAN computer it should forward the packet to and how it should perform NAT on the packet.

1.3.3.3 Step 3c: The computer sends a TCP ACK

Finally, a TCP ACK is sent from the computer to the Web Server
“Then I confirm that we have established a session!”
10-DayInLifeOfPacket/tcp-ack.jpg

1.3.4 Step 4: The web browser talks with the Web Server

10-DayInLifeOfPacket/http-session.jpg

1.4 Traffic example 2:

1.4.1 Getting Started: DHCP, UDP, IP, and Ethernet

  1. The operating system on Bob’s laptop creates a DHCP request message, and puts this message within a UDP segment, with destination port 67 (DHCP server) and source port 68 (DHCP client).
  2. The IP datagram containing the DHCP request message is then placed within an Ethernet frame.
  3. The broadcast Ethernet frame containing the DHCP request is the first frame sent by Bob’s laptop to the Ethernet switch.
  4. The router receives the broadcast Ethernet frame containing the DHCP request on its interface with MAC address 00:22:6B:45:IF:1B and the IP datagram is extracted from the Ethernet frame.
  5. Let’s suppose that the DHCP server running within the router can allocate IP addresses in the CIDR block 68.85.2.0/24.
  6. The Ethernet frame containing the DHCP ACK is sent (unicast) by the router to the switch.
  7. Bob’s laptop receives the Ethernet frame containing the DHCP ACK, extracts the IP datagram from the Ethernet frame, extracts the UDP segment from the IP datagram, and extracts the DHCP ACK message from the UDP segment.

1.4.2 Still Getting Started: DNS and ARP

  1. The operating system on Bob’s laptop thus creates a DNS query message, putting the string “www.google.com” in the question section of the DNS message.

  2. Bob’s laptop then places the datagram containing the DNS query message in an Ethernet frame.

  3. Bob’s laptop creates an ARP query message with a target IP address of 68.85.2.1 (the default gateway), places the ARP message within an Ethernet frame with a broadcast destination address (FF:FF:FF:FF:FF:FF) and sends the Ethernet frame to the switch, which delivers the frame to all connected devices, including the gateway router.

  4. The gateway router receives the frame containing the ARP query message on the interface to the school network, and finds that the target IP address of 68.85.2.1 in the ARP message matches the IP address of its interface.

  5. Bob’s laptop receives the frame containing the ARP reply message and extracts the MAC address of the gateway router (00:22:6B:45:1F:1B) from the ARP reply message.

  6. Bob’s laptop can now (finally!) address the Ethernet frame containing the DNS query to the gateway router’ s MAC address.

1.4.3 Still Getting Started: Intra-Domain Routing to the DNS Server

  1. The gateway router receives the frame and extracts the IP datagram containing the DNS query.

  2. The leftmost router in the Comcast network receives the frame, extracts the IP datagram, examines the datagram’s destination address (68.87.71.226) and determines the outgoing interface on which to forward the datagram toward the DNS server from its forwarding table, which has been filled in by Comcast’s intra-domain protocol (such as RIP, OSPF or IS-IS) as well as the Internet’s inter-domain protocol, BGP.

  3. Eventually the IP datagram containing the DNS query arrives at the DNS server.

  4. Bob’s laptop extracts the IP address of the server www.google.com from the DNS message.

1.4.4 Web Client-Server Interaction: TCP and HTTP

  1. Now that Bob’s laptop has the IP address of www.google.com, it can create the TCP socket that will be used to send the HTTP GET message to www.google.com.

  2. The routers in the school network, Comcast’s network, and Google’s network forward the datagram containing the TCP SYN toward www.google.com, using the forwarding table in each router, as in steps 14-16 above.

  3. Eventually, the datagram containing the TCP SYN arrives at www.google.com.

  4. The datagram containing the TCP SYN ACK segment is forwarded through the Google, Comcast, and school networks, eventually arriving at the Ethernet card in Bob’s laptop.

  5. With the socket on Bob’s laptop now (finally!) ready to send bytes to www.google.com, Bob’ s browser creates the HTTP GET message containing the URL to be fetched.

  6. The HTTP server at www.google.com reads the HTTP GET message from the TCP socket, creates an HTTP response message, places the requested Web page content in the body of the HTTP response message, and sends the message into the TCP socket.

  7. The datagram containing the HTTP reply message is forwarded through the Google, Comcast, and school networks, and arrives at Bob’s laptop.

1.4.5 Conclusions