š Routers ā Part 2
How ARP + Routing Work Together
Series: Networking Fundamentals for Cloud & DevOps
This part mainly explains how ARP + routing work together when Host A sends data to Host C through R1 and R2.
Before following the journey, keep these two tables separate:
| Table | Layer | Main Question |
|---|---|---|
| Routing Table | L3 | Where should I send the packet next? |
| ARP Table | L2 | What MAC address do I need for the next hop? |
So:
Routing Table:
Destination IP/network ā where to send next
ARP Table:
IP address ā MAC address
This distinction is extremely important.
Example: A ā C
Consider this network:
10.0.44.0/24 10.0.55.0/24 10.0.66.0/24
A R1 R2 C
10.0.44.9 .1 .2 10.0.66.7
MAC a9a9 eee1 eee2 c7c7
āāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāā
ā ā
More simply:
A āāāāāāāāā R1 āāāāāāāāā R2 āāāāāāāāā C
With:
A:
IP = 10.0.44.9
MAC = a9a9
R1:
IP = 10.0.44.1
MAC = eee1
R2:
IP = 10.0.55.2
MAC = eee2
C:
IP = 10.0.66.7
MAC = c7c7
A wants to send data to C.
The destination is:
10.0.66.7
Step 1 ā A Creates the L3 Packet
The destination IP remains C's IP:
SRC IP = 10.0.44.9
DST IP = 10.0.66.7
A checks its routing information and realizes:
10.0.66.7 is outside my local network.
So A needs to send the packet to its default gateway, R1.
The important point is:
The final destination IP is C, but the next hop is R1.
Step 2 ā A Needs R1's MAC
A knows R1's IP:
R1 IP = 10.0.44.1
But A doesn't know R1's MAC yet:
10.0.44.1 ā ??? MAC
So A sends an ARP Request:
"Who has 10.0.44.1?"
R1 replies:
10.0.44.1 ā eee1
A stores this mapping in its ARP table.
ARP Table
10.0.44.1 ā eee1
Now A knows the Layer 2 destination needed for the first hop.
Step 3 ā A Sends the Frame to R1
A can now construct the Layer 2 frame.
L2
SRC MAC = a9a9
DST MAC = eee1
L3
SRC IP = 10.0.44.9
DST IP = 10.0.66.7
Notice the important thing:
MAC destination = R1
IP destination = C
So the frame goes:
A āāāāāāāāāāāāāāāāāā R1
while the IP packet still says:
10.0.44.9 ā 10.0.66.7
Step 4 ā R1 Receives It
R1 receives the frame because:
DST MAC = eee1
which is R1's MAC address.
R1 removes/discards the old Layer 2 header.
The IP information is still:
SRC IP = 10.0.44.9
DST IP = 10.0.66.7
R1 checks its routing table:
10.0.66.0/24 ā 10.0.55.2
The meaning is:
To reach C's network, send the packet to R2 at 10.0.55.2.
This is the Layer 3 routing decision.
Step 5 ā R1 Needs R2's MAC
R1 knows R2's IP:
10.0.55.2
but it needs R2's MAC:
10.0.55.2 ā ??? MAC
So R1 sends ARP:
"Who has 10.0.55.2?"
R2 replies:
10.0.55.2 ā eee2
R1 stores:
ARP Table
10.0.55.2 ā eee2
Now R1 knows the Layer 2 destination for the next hop.
Step 6 ā R1 Sends a NEW Layer 2 Frame
This is the most important concept in this entire example.
R1 creates a new Layer 2 header:
L2:
SRC MAC = eee1
DST MAC = eee2
But the Layer 3 addresses remain:
L3:
SRC IP = 10.0.44.9
DST IP = 10.0.66.7
Notice:
MAC addresses ā CHANGED
10.0.44.9 ā 10.0.66.7
IP addresses ā STAY THE SAME
The frame is now:
R1 āāāāāāāāāāāāāāāāāā R2
The IP packet is still ultimately going to C.
Step 7 ā R2 Receives It
R2 receives the frame because:
DST MAC = eee2
which is R2's MAC address.
R2 removes the Layer 2 header and checks the destination IP:
DST IP = 10.0.66.7
R2's routing table says:
10.0.66.0/24 ā Left interface
C is directly connected to R2.
So R2 now needs C's MAC address.
It sends ARP:
"Who has 10.0.66.7?"
C replies:
10.0.66.7 ā c7c7
R2 stores:
ARP Table
10.0.66.7 ā c7c7
Step 8 ā R2 Sends the Frame to C
R2 creates another new Layer 2 header:
L2:
SRC MAC = eee4
DST MAC = c7c7
The Layer 3 information remains:
L3:
SRC IP = 10.0.44.9
DST IP = 10.0.66.7
So:
R2 āāāāāāāāāāāāāāāāāā C
C receives the frame because:
DST MAC = c7c7
C checks the destination IP:
DST IP = 10.0.66.7
That's C's own IP.
Therefore:
C accepts the packet.
The Entire Journey
The complete journey can be visualized as:
A R1 R2 C
ā ā ā ā
āāā ARP R1 āāāāāāāāāāāāāāāā ā ā
āāā 10.0.44.1 / eee1 āāāāā ā ā
ā ā ā ā
āāā a9a9 ā eee1 āāāāāāāāāāā ā ā
ā IP: A ā C ā ā ā
ā ā ā ā
ā āāā ARP R2 āāāāāāāāāāāāāāāā ā
ā āāā 10.0.55.2 / eee2 āāāāāā ā
ā ā ā ā
ā āāā eee1 ā eee2 āāāāāāāāāāā ā
ā ā IP: A ā C ā ā
ā ā ā ā
ā ā āāā ARP C āāāāāāāāāāāāāāāāā
ā ā āāā 10.0.66.7 / c7c7 āāāāā
ā ā ā ā
ā ā āāā eee4 ā c7c7 āāāāāāāāāāā
ā ā ā IP: A ā C ā
The key pattern is:
At every router hop:
L2 / MAC header ā CHANGES
L3 / IP header ā STAYS THE SAME
Routing Table vs ARP Table
This is one of the most important distinctions to remember.
Routing Table
Answers:
"Where should I send this packet next?"
Example:
10.0.66.0/24 ā 10.0.55.2
The router uses this information to select the next hop/interface.
ARP Table
Answers:
"What MAC address do I need for that next hop?"
Example:
10.0.55.2 ā eee2
So the relationship is:
Destination network
ā
Routing Table
ā
Next-hop IP
ā
ARP Table
ā
Next-hop MAC
ā
Build Layer 2 frame
ā
Send
The One Thing to Remember
At every router hop:
L2 / MAC header ā CHANGES
L3 / IP header ā STAYS THE SAME
For this example:
| Hop | Source MAC | Destination MAC | Source IP | Destination IP |
|---|---|---|---|---|
| A ā R1 | a9a9 | eee1 | 10.0.44.9 | 10.0.66.7 |
| R1 ā R2 | eee1 | eee2 | 10.0.44.9 | 10.0.66.7 |
| R2 ā C | eee4 | c7c7 | 10.0.44.9 | 10.0.66.7 |
This table captures the whole concept:
Routing table tells the router WHERE to send the packet.
ARP table tells the router WHICH MAC address is needed for the next hop.
Final Mental Model
ROUTER
ā
āāā Routing Table
ā āāā Destination network ā Next hop / Interface
ā
āāā ARP Table
ā āāā Next-hop IP ā MAC address
ā
āāā Forwarding process
ā
āāā Check destination IP
ā
āāā Routing table decides next hop
ā
āāā ARP resolves next-hop MAC
ā
āāā Build a NEW L2 frame
ā
āāā Forward to next hop
And the simplest possible memory rule is:
Routing Table
ā Where should the packet go?
ARP Table
ā What MAC gets me to the next hop?
IP
ā Final destination
MAC
ā Current hop
This is the connection between everything we've learned so far:
IP + Routing
ā
Which network should the packet reach?
ARP
ā
Which MAC address gets the frame to the next hop?
Ethernet / Layer 2
ā
Move the frame across the current hop
For Cloud + DevOps, this mental model becomes especially useful when understanding VPC route tables, subnets, gateways, next hops, and connectivity troubleshooting.
Part 5 of 6 ā Networking Fundamentals for Cloud & DevOps
Next: deeper router behavior and how routing decisions are made.
Top comments (0)