IP Forwarding

IP Forwarding or IP routing is the function of a network device receiving an IP packet, making a decision of where to send the packet next, and then forwarding the packet.  Here is the internal forwarding logic used when an IP packet is received:

  1. Router receives a frame and checks the received FCS, if errors are found the frame is discarded.  The router does not try to recover the lost packet.
  2. If no errors are found, the the router checks the Type field and extracts the packet from the Frame.  The Data Link header and trailer are discarded.
  3. Assuming an IPv4 packet, the header checksum is verified, if the IP header checksum shows a mismatch the packet is discarded.  IPv6 packets skip this step as IPv6 headers do not contain a checksum.
  4. If the IP header checksum passed, the router checks the destination IP address to see if it is one of the locally configured networks on the router.  If the packet destination matches an IP on the router the packet has arrived at its destination.  The router analyzes the protocol field in the IP header, identifying the upper layer protocol and hands the packets data payload over to the relevant upper protocol driver.
  5. If the destination address DOES NOT match an IP configured on the router, the packet must continue to be routed to its destination.  The router verifies if the TTL is greater than 1, if not the packet is dropped and an ICMP Time Exceeded message is sent to the packet’s sender. (Source IP)
  6. The router checks its IP routing table for the most specific prefix match of the packets destination IP address.
  7. a matched entry includes the outgoing interfaces and next hop router, this information is used by the router to look up the next hop routers layer 2 address in the appropriate mapping table suc has ARP, IP/DLCI, dialer maps, etc…  This lookup is needed to build a new Data Link frame and optionally dial the proper number.
  8. Before creating a new frame, the router updates the IP header TTL or Hop Count field require a re-computation of the IPv4 header checksum
  9. The router encapsulates the IP packet in a new Data Link header and trailer to create a new frame.

This does not contain the logic used for Fast switching or CEF switching.

ipforwarding.PNG

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s