Addressing and Forwarding
Tags: #◇CSNETWK #◇Computer Science #◇Computer Networks #◇Networking Protocols #◇Graph Theory Basics
◇Overview
The Golden Rule of Forwarding
◇Key Concepts
IP Addresses (Network Layer) MAC Addresses (Link Layer) Sender Receiver Path
◇Details / Theory
◇1. Concept Overview: MAC vs. IP
The Golden Rule of Forwarding
IP Addresses (Network Layer): act like the "Final Destination" on a letter. They NEVER CHANGE from source to destination (ignoring NAT). MAC Addresses (Link Layer): act like the "Next Hop" ticket. They CHANGE at every router. The source MAC is always the device sending the frame onto the wire, and the destination MAC is the device receiving it on that specific wire.
The Journey
When a packet travels from Host A to Host B through a Router:
- Hop 1 (A Router): Src=MAC_A, Dest=MAC_Router.
- Hop 2 (Router B): Src=MAC_Router, Dest=MAC_B.
- IP Address: Always Src=IP_A, Dest=IP_B.
◇2. The Network Topology
Scenario Data
!◇Pasted image 20251121094215.png
Sender: Node C (128.119.156.36, MAC E3...) Receiver: Node A (128.119.184.242, MAC 35...) Path: C Router (Right) Router (Center) Router (Left) A.
◇3. Problem Analysis
Point 6 (Node C First Router)
Context: The packet is leaving the source computer (C) and heading to its default gateway (the router interface).
1/2. MAC Addresses (Link Layer)
Source MAC: The device sending the frame. Node C (E3-A8...) Destination MAC: The interface of the router receiving it. Router Interface 6 (81-D8...)
3/4. IP Addresses (Network Layer)
Source IP: The original sender. Node C (128.119.156.36) Destination IP: The final target. Node A (128.119.184.242)
Point 4 (Between Routers)
5. Do the source and destination MAC addresses change at point 4?
Analysis: Point 4 represents a new physical link (wire). The router at Point 6 stripped the old Link Layer header and built a new one to send to the next router. Correct Answer: Yes (The previous MACs were for the C-Router link; the new MACs are for the Router-Router link).
Point 2 (Last Router Node A)
Context: The final router is delivering the packet to the destination computer.
6. Do the source and destination MAC addresses change at point 2?
Analysis: Yes. The router is now the sender (Link Layer), and Node A is the receiver.
7/8. MAC Addresses
Source MAC: The router interface sending the frame. Router Interface 2 (52-19...) Destination MAC: The final computer's NIC. Node A (35-14...)
Point 1 (Node A's Network Card)
9. Do the source and destination MAC addresses change at point 1?
Analysis: Point 1 and Point 2 are on the same wire (the same subnet). A frame does not change mid-wire. Correct Answer: No
◇Summary of Logic (Cheat Sheet)
| Layer | Address Type | Behavior |
| Network | IP Address | Constant (Start to Finish) |
| Link | MAC Address | Changes Every Hop (Router to Router) |
◇Common Pitfalls
Thinking IP addresses change at each hop — IP stays constant end-to-end; only MAC addresses change per hop. Confusing the source/destination MAC at a given hop with the original sender/receiver. Forgetting that routers replace MAC headers at each hop using ARP to resolve the next-hop MAC.
◇Summary
TL;DR — The "golden rule": IP addresses remain constant from source to destination, while MAC addresses change at every router hop. Routers use ARP to find the next-hop MAC and rewrite the link-layer header accordingly.
◇Links
Related: - ◇Pasted image 20251121094215.png Source / Reference:
◇References & Navigation
- Previous Topic: ◇Link Layer
- Next Topic: ◇Learning Switches (Basic)
- Related Notes: ◇Internetworking
ACTIVE RECALL VERIFICATION
Select an answer to verify conceptual comprehension and reveal the technical rationale.
How do Layer-2 MAC (Link-Layer) addresses and Layer-3 IP (Network-Layer) addresses differ in structure, mutability, and purpose?
As an IP datagram travels from Host (on Subnet 1) through Router to Host (on Subnet 2), what happens to the Source/Destination IP addresses vs. the Source/Destination MAC addresses when the packet passes through Router (assuming no NAT)?
What is the role of the Address Resolution Protocol (ARP) when Host on a LAN knows the target IP address on the same subnet but does not know its Layer-2 MAC address?
When Host (192.168.1.10/24) wants to send an IP packet to a remote server (8.8.8.8) located on a different subnet, which IP address does Host query via ARP to put in the Ethernet frame's Destination MAC field?
Why are entries in a host's ARP Cache (ARP Table) assigned a Time-To-Live (typically ~20 minutes) rather than being stored permanently?