OECG – Chapter 7 “IP Forwarding” – IP Forwarding


This chapter covers the basics of IP forwarding – what a router does when it gets a packet. How does the router make its fowarding decision?

“Forwarding” and “routing” are synonyms. Routers follow a generic logic flow to determine how to route a packet (assuming inbound on an ethernet interface):

  • The router receives an inbound frame and checks FCS. If FCS fails, the packets is chucked in the bit bucket.
  • If the frame is good, the ethernet Type field is checked, and the packet liberated from its frame. The layer 2 info (data link header and trailer) is trashed.
  • So now we have a packet. If the packet is an IP packet, the router performs a routing table lookup, seeking the most specific route (prefix) it can find matching the destination of the packet.
  • So now we found where the packet needs to go. The routing table entry includes the interface and next-hop this packet should use for egress. The router uses this information to throw new layer 2 back on the packet.
  • The router updates the time-to-live field (decrementing by one, prevents routing loops, remember?), and consequently recomputes the IP header checksum.
  • Finally, the router creates the new frame, specifically, the new Data Link layer information with the destination address, trailer and FCS.
By Ethan Banks

Ethan Banks is a podcaster and writer with a BSCS and 20+ years in enterprise IT. He's operated data centers with a special focus on infrastructure — especially networking. He's been a CNE, MCSE, CEH, CCNA, CCNP, CCSP, and CCIE R&S #20655. He's the co-founder of Packet Pushers Interactive, LLC where he creates content for humans in the hot aisle.