Packet travel: different networks

Now Host A (192.168.1.10) sends to Host B (10.0.0.10) — a different subnet. That changes everything: the destination is not local, so the packet must be handed to a router. Watch how the IP packet stays the same while the MAC addresses change at every hop.

Frame in transit Router action Reply path Active link

Ready when you are

Press Play to follow the packet out of one network, across a router and a WAN link, and into another network. Notice what stays the same (the IP packet) and what changes (the frame, at every hop).

What's inside the PDU right now

Press Play to begin

The one idea to remember

IP addresses change never; MAC addresses change at every hop. The IP packet tells the network where the destination is (end to end). The frame is only a local delivery vehicle: each router strips the frame, decides where the packet goes next, and builds a new frame with new MAC addresses for the next hop. That's the difference between Layer 2 and Layer 3 in one sentence.

Real Cisco commands to try

On the router — the routing table
R1# show ip route
Codes: C - connected, S - static, O - OSPF
--------------------------------------
C   192.168.1.0/24 is directly connected, Gi0/0
S   10.0.0.0/24 [1/0] via 209.165.200.2
C   209.165.200.0/30 is directly connected, Gi0/1
On the host — what route do you use?
C:\> route print
Network Dest  Netmask       Gateway        Interface
0.0.0.0     0.0.0.0     192.168.1.1   192.168.1.10
192.168.1.0  255.255.255.0 On-link       192.168.1.10
Watch each hop
C:\> tracert 10.0.0.10
1   1ms  1ms  1ms  192.168.1.1     (R1)
2   2ms  2ms  2ms  209.165.200.2  (R2)
3   3ms  3ms  3ms  10.0.0.10     (Host B)
See what a router is doing
R1# debug ip packet
IP: s=192.168.1.10 (Gi0/0), d=10.0.0.10 (Gi0/1),
   len 48, TTL 63, forward
(Caution: only in a lab!)
How do routers learn routes?

Routers build the routing table from connected networks (their own interfaces), static routes (typed by an admin), and dynamic routing protocols — OSPF and EIGRP inside an enterprise, BGP between autonomous systems on the internet. In our example, R1 uses a static route to reach 10.0.0.0/24 via R2.