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 Step 2a: DNS cache Step 2b: Putting a DNS query together Step 2c: Check the ARP table for a valid MAC address Step 2d: ARP request to the network Step 2e: ARP reply from the router Step 2f: Send off the DNS query Step 2g: The home router checks its DNS cache Step 2h: The home router prepares and sends away its DNS query Step 2i: The DNS query is routed over the Internet Step 2j: The DNS server responds 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 Step 3a: The computer sends a TCP SYN message 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”
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. 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!”
* As long as the computer and the server keep on communicating with each other, they will keep using the same session for the communication.
* This also includes using the same TCP ports, which lets all devices along the way keep track of the session, the address translation, and so on.
* The session could last just long enough to download the web page, or the web server and the computer could choose to keep the session alive for longer, in case the user wants to keep browsing around on that web page.

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

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
  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 (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 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 ( 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

Next: 11-OverlayMeshNetP2P.html