Following one exchange
On this page
Between laptop and web stand a switch, a router, and another switch. The receiving frame has a link header, but does it match the one that left laptop? Compare one packet at four capture points instead of assuming every device handles it the same way.
By the end, you can identify what the router changes and explain why the switch does something different.
Before you start
Section titled “Before you start”Read Encapsulation and decapsulation. Use these supplied captures; a learner lab is not required yet. The lab has two networks, home and site, joined by router. No address sharing mode or fault is enabled.
Keep the machine destination in view
Section titled “Keep the machine destination in view”The author requested the same file from laptop, with captures listening simultaneously at laptop:eth0, router:eth0, router:eth1, and web:eth0. The router’s first interface belongs to home; its second belongs to site.
learner@laptop:~$ curl -sS http://10.77.20.80/hello.txtHello from web.learner@laptop:~$ Steps (3)
- Type
curl -sS http://10.77.20.80/hello.txt— Make the request while all four captures listen - Press Enter
- Output:
Hello from web.
The frames at laptop:eth0, router:eth0, router:eth1, web:eth0 are one packet: the same IP identification 58012 and TCP sequence number 3243797573. Those matching fields tie the four observations together; similar-looking addresses alone would not establish that they are the same packet. Times, TCP sequence numbers, and IP identification values vary between runs. Your numbers will differ if you repeat the capture later in the course.
Read the IP pair first. It keeps naming laptop as the source and web as the destination at every point. End to end means concerning the original sender and final receiver across the path. Here the machine addresses have that scope.
Pass through the first switch
Section titled “Pass through the first switch”The home frame names the router’s home interface as its link destination. It still contains a packet for web. Those are answers to different questions: which interface receives on this network, and which machine is the final destination.
sw-home reads the destination MAC address to forward the frame. It does not replace that address with its own. Compare the frame leaving laptop with the frame arriving at the router: the shown link and internet fields match.
The switch’s forwarding action is modeled from the observations on either side. These captures do not inspect its internal decision.
Cross the router
Section titled “Cross the router”The router accepts a frame addressed to its home interface and removes the incoming link header. It reads the destination IP address to decide where to forward the packet. The packet still names the original two machines.
To send onto site, the router builds a replacement link header. Its source names the router’s site interface; its destination names web’s interface. Hop by hop means handling delivery separately along the path. A hop here is a routed step from one network toward the next; passing through a switch does not lower the packet’s hop counter.
Predict: after this router, which addresses differ: the machine addresses, the link addresses, or both?
The request crosses the router
- laptopmachine
- sw-homeswitch
- routerrouter
- sw-siteswitch
- webserver
In the capture4 capture points
- laptop:eth0
06:55:36.115669 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1 - router:eth0
06:55:36.115671 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1 - router:eth1
06:55:36.115672 02:77:20:00:00:01 > 02:77:20:00:00:80, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1 - web:eth0
06:55:36.115673 02:77:20:00:00:01 > 02:77:20:00:00:80, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1
curl -sS http://10.77.20.80/hello.txt, on Ubuntu 24.04.5 LTS, netlab 1.0, tcpdump 4.99.4, curl 8.5.0. The values are the capture's; what each device reads is the model. Four observations follow one request through laptop, sw-home, router, sw-site, and web.Steps (6)
- laptop sends. laptop sends toward web, using the router's home interface as the next link destination.
06:55:36.115669 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1 - sw-home. The home switch reads the destination MAC address and forwards the frame unchanged. Its action is modeled from the capture after it. Read: Destination MAC address.
06:55:36.115671 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1 - router in. The router accepts the incoming frame and reads the packet's destination IP address. Read: Destination MAC address and Destination address.
06:55:36.115671 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1 - router out. The router replaces the link header for the site network and lowers the internet header's time-to-live counter. Rewritten: Source MAC address 02:77:10:00:00:10 to 02:77:20:00:00:01, Destination MAC address 02:77:10:00:00:01 to 02:77:20:00:00:80 and Time to live 64 to 63.
06:55:36.115672 02:77:20:00:00:01 > 02:77:20:00:00:80, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1 - sw-site. The site switch reads the destination MAC address and forwards the frame unchanged. Its action is modeled from the capture after it. Read: Destination MAC address.
06:55:36.115673 02:77:20:00:00:01 > 02:77:20:00:00:80, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1 - web receives. web accepts the frame addressed to its interface and the packet addressed to its machine. Read: Destination MAC address and Destination address.
06:55:36.115673 02:77:20:00:00:01 > 02:77:20:00:00:80, ethertype IPv4 (0x0800), length 149: 10.77.10.10.48862 > 10.77.20.80.80: Flags [P.], seq 1:84, ack 1, win 63, options [nop,nop,TS val 2568119165 ecr 13033857], length 83: HTTP: GET /hello.txt HTTP/1.1
Check your answer
The link addresses differ. The machine addresses stay the same in this lab state.
| Point | MACs | IPs | TTL |
|---|---|---|---|
laptop: |
02:77:10:02:77:10: |
10.77.10.77. |
64 |
router: |
02:77:10:02:77:10: |
10.77.10.77. |
64 |
router: |
02:77:20:02:77:20: |
10.77.10.77. |
63 |
web: |
02:77:20:02:77:20: |
10.77.10.77. |
63 |
Each address cell shows source above destination. The counter is time to live (TTL), a number in the internet header. It drops by one at the router. The router also updates that header’s check value as required; the internet header is not byte-for-byte unchanged. Calling the addresses end to end does not mean every internet-header field stays fixed.
Reach the second switch and web
Section titled “Reach the second switch and web”sw-site forwards the router’s outgoing frame without replacing its addresses. The observation at web matches the router’s site-side observation for the fields shown. The server’s interface accepts the frame, and the layers pass the request up to the application.
Mistakes to recognize
Section titled “Mistakes to recognize”“laptop puts web’s MAC on the first frame.” The home-side evidence names the router’s home interface. web is beyond that network.
“A switch rewrites the frame at each stop.” The paired observations show matching fields before and after each switch.
“IP addresses change at every router.” These captures retain the original IP pair. Some configurations can rewrite addresses; none is enabled here.
Try it yourself
Section titled “Try it yourself”Goal: Complete the reply’s link destinations and name who writes them.
The following table follows the response in its travel order, from web back to laptop. Each row comes from the same capture session as the request. Fill the lower line of each MAC cell before opening the solution.
| Point | MACs | IPs | TTL |
|---|---|---|---|
web:frame 6 |
02:77:20:? |
10.77.10.77. |
64 |
router:frame 6 |
02:77:20:? |
10.77.10.77. |
64 |
router:frame 6 |
02:77:10:? |
10.77.10.77. |
63 |
laptop:frame 6 |
02:77:10:? |
10.77.10.77. |
63 |
Expected: Four destinations and an explanation of which machine built each of the two link headers.
Hint
Use the source to identify the network. Decide which interface can receive the response on that network before thinking about its final machine destination.
Solution
| Point | MACs |
|---|---|
web:frame 6 |
02:77:20:02:77:20: |
router:frame 6 |
02:77:20:02:77:20: |
router:frame 6 |
02:77:10:02:77:10: |
laptop:frame 6 |
02:77:10:02:77:10: |
These response frames match by IP identification 23551 and TCP sequence number 1764072362; their application bytes also match.
web builds the site-side header. The router builds the home-side header. The switches forward those headers; they do not supply either source address.
Leave for later
Section titled “Leave for later”Reaching Another Device explains how laptop discovers the router’s MAC, how forwarding chooses a next link, and why TTL decreases. TCP, UDP, and Ports explains address sharing, where addresses can be rewritten.
- The request’s machine addresses survive this path.
- A switch forwards the frame without replacing its link addresses.
- The router replaces the link header and lowers TTL.
- A matching packet can appear inside different frames on different links.
Next, Practice: How Network Communication Is Organized checks your explanation against another client request.
Further reading
Section titled “Further reading”- RFC 1812, §5.2: IPv4 forwarding, for router forwarding and TTL handling.
- Linux bridge documentation, for the bridge implementation used by the lab’s switches.