cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
203
Views
0
Helpful
1
Replies

IPv4 forwarding

dvlp19001
Level 1
Level 1

In what order does an IPv4 router execute the following processes when it receives a packet (the others-- checking the IP version, QoS flags, optional fields are not relevant to this Q):

  • (A) looks up the destination address and acts accordingly (if it's itself, then no further ado, else longest prefix look-up at forwarding table and go from there, ...)
  • (B) checksums-- runs the checksum itself and compares with the one that came in on the packet
  • (C) decrements TTL and drops it if it hit 0

  • (D) fragments if necessary

the question is - in which order?

I'm guessing (C) - (B) - (A) - (D)

  • First, decrements TTL. If it hit 0, drops it right there and then. By this, it's dropping the packet at TTL=0 even if it itself is the destination of the packet.
  • Then, checksums. If there's an error, drops it as is.
  • Then looks up the destination address and goes from there.
    • If destination address is itself, sees whether the packets are fragmented and reassembles them if so.
    • If some other address, looks up the table for the longest prefix match.
      • If can't find any, drops the packet.
      • If found a match in the forwarding table, sees whether needs fragmenting and does so, prepares the IP header, and transmits it to the link.

Is this an accurate scenario?

or, maybe (B) - (C) - (A) - (D)

TIA

1 Accepted Solution

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

I believe that given the options, the process would be B - A - C - D.

  • First, you need to verify the checksum. If it's wrong then you're not going to spend your time with this packet at all.
  • Second, you need to find out where this packet is going, so you do the routing table lookup.
  • Third, if you find out that the packet is going to be routed out and not processed locally, you decrement the TTL (and recalculate the checksum again because you have changed the header contents).
  • Fourth, you attempt sending out the packet via the egress interface determined from the routing table lookup, and if its MTU is smaller, you attempt to fragment the packet.

I have to emphasize that this is only one particular possibility at achieving the same result as real routers do. Because of several optimizations and other operations that need to be performed, it is possible that some of these operations are done in parallel, or that their order is sligthly modified. Therefore, don't take the order of operations as suggested by me as an absolute, only as an order that makes the most sense under the given options.

Best regards,
Peter

View solution in original post

1 Reply 1

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

I believe that given the options, the process would be B - A - C - D.

  • First, you need to verify the checksum. If it's wrong then you're not going to spend your time with this packet at all.
  • Second, you need to find out where this packet is going, so you do the routing table lookup.
  • Third, if you find out that the packet is going to be routed out and not processed locally, you decrement the TTL (and recalculate the checksum again because you have changed the header contents).
  • Fourth, you attempt sending out the packet via the egress interface determined from the routing table lookup, and if its MTU is smaller, you attempt to fragment the packet.

I have to emphasize that this is only one particular possibility at achieving the same result as real routers do. Because of several optimizations and other operations that need to be performed, it is possible that some of these operations are done in parallel, or that their order is sligthly modified. Therefore, don't take the order of operations as suggested by me as an absolute, only as an order that makes the most sense under the given options.

Best regards,
Peter

Review Cisco Networking products for a $25 gift card