What happens to a packet when it gets routed?
Posted by jrensink78 on November 24, 2008
I was planning on writing up an overview on NTP, but I ran into some inconsistencies between what I was reading/watching and what I was able to reproduce in a lab. So I’m going to table that for now and talk about what happens to a packet as it goes through the routing process in and Ethernet network. This is a high-level overview included in the CCIE R&S Official Cert Guide from CIsco Press.
- When a router receives a frame, it checks the Frame Check Sequence (FCS) to see if the packet encountered any errors in its trip. If the FCS check fails, the packet is dropped. The router does not attempt to recover the packet.
- IF the FCS check passes, the router reads the Ethernet Type field and extracts the packet from the frame. The data link header and trailer is discarded
- The router looks at the destination address of the packet and finds the most specific match for it in its routing table
- The routing table entry will have the applicable information of the outgoing interface and next hop needed to build a new data link frame
- Before creating the frame, the router decrements the IP header TTL field and recomputes the IP header checksum field (as a result of the TTL field change)
- The router encapsulates the packet with a new data link header and trailer to create the new frame
- The frame is send out the appropriate interface on to the next hop.
Again, this is pretty high-level, but there are a couple of good points to remember.
- The data-link header and trailer only survive a single hop. Each router strips the old header/trailer and creates a new one. As a result, source and destination MAC addresses change per hop.
- The IP header checksum will change at each hop to compensate for the TTL field changing.
- The layer 4 headers (TCP, UDP, etc) and data payload remain unchanged throughout the process. So a checksum change for the whole IP packet is not needed.