Subject: Hop Limit zero processing for a Router

From: Timothy Winters <[email-masked]>
Date: Wed, 3 Nov 2010 07:50:41 -0400

Hello,
	At the UNH-IOL we recently received a router implementation that discards a packet when it receives a packet with a hop limit of zero.  Based on the following quote from RFC 2460, "The packet is discarded if Hop Limit is decremented to zero."  If router is the end-node it should still process the the packet, as the hop-limit isn't decremented until the packet is forwarded.

	According to RFC 4443 Section 3.3 "If a router receives a packet with a Hop Limit of zero, or if a router decrements a packet's Hop Limit to zero, it MUST discard the packet and originate an ICMPv6 Time Exceeded message with Code 0 to
the source of the packet."   The UNH-IOL had interpreted router to be a device that is forwarding a packet, therefore the packet should still be processed when it's the end receiver.  The implementation viewed this quote as stating that a router should discard the packet regardless of being the end receiver.

	So I would like to ask the working group should a router always discard a packet with a hop limit of zero even when it's the end receiver of the packet?

Regards,
Tim

---

From: Thomas Narten <[email-masked]>
Date: Wed, 03 Nov 2010 05:00:36 -0700

Hi Tim

> At the UNH-IOL we recently received a router implementation that
>          discards a packet when it receives a packet with a hop
>          limit of zero.  Based on the following quote from RFC 2460,
>          "The packet is discarded if Hop Limit is decremented to
>          zero."  If router is the end-node it should still process
>          the the packet, as the hop-limit isn't decremented until
>          the packet is forwarded.

That is the intended behavior. You only discard a packet if you
decrement the TTL and it reaches zero.

> 	According to RFC 4443 Section 3.3 "If a router receives a
> packet with a Hop Limit of zero, or if a router decrements a
> packet's Hop Limit to zero, it MUST discard the packet and originate
> an ICMPv6 Time Exceeded message with Code 0 to the source of the
> packet."  The UNH-IOL had interpreted router to be a device that is
> forwarding a packet, therefore the packet should still be processed
> when it's the end receiver.  The implementation viewed this quote as
> stating that a router should discard the packet regardless of being
> the end receiver.

This section refers to the generation of a Time Exceeded Message. You
shouldn't be executing this section of the spec unless you had already
decided to generate such a message. (That said, the wording above
could be better.)

> So I would like to ask the working group should a router always
>          discard a packet with a hop limit of zero even when it's
>          the end receiver of the packet?

IMO, only if it decrements the TTL and it reaches zero.  One only
decrements if one is about to forward a packet...

Also, RFC 2460 says:

>    Hop Limit            8-bit unsigned integer.  Decremented by 1 by
>                         each node that forwards the packet. The packet
>                         is discarded if Hop Limit is decremented to
>                         zero.

Thomas

---

From: Brian Haberman <[email-masked]>
Date: Wed, 03 Nov 2010 08:34:01 -0400

Hi Tim,

> decrement the TTL and it reaches zero.

Correct.

> decided to generate such a message. (That said, the wording above

I agree the wording could be better.  I would also note that it is
possible that this particular router implementation may have a different
design than other routers.  Is it possible that the forwarding logic is
used generically to move locally destined traffic to the main processor?
 In this case, the forwarding ASIC still thinks it is routing the packet.

>>                         is discarded if Hop Limit is decremented to

Right.  So, is this router under test using a different design that
doesn't fit the generic router model used to develop this text?

Regards,
Brian

---

From: Timothy Winters <[email-masked]>
Date: Wed, 3 Nov 2010 10:19:17 -0400

Hi Thomas and Brian,
	Thanks for the help.  I will discuss the matter with the implementor.   My understanding is that this was a software decision based on there reading of 4443. 

Regards,
Tim

On Nov 3, 2010, at 8:34 AM, Brian Haberman wrote:

> --------------------------------------------------------------------
> IETF IPv6 working group mailing list
> [email-masked]
> Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
> --------------------------------------------------------------------

---

From: Fernando Gont <[email-masked]>
Date: Fri, 05 Nov 2010 10:57:28 -0300

Hi, Thomas,

> decrement the TTL and it reaches zero.

This is could lead to trouble. Following this reasoning, if a router
receives a packet with a Hop Limit of 0, and it needs to forward the
packet, it would first decrement the Hop Limit (possibly wrapping down
up to 255), and then forward the packet.

Those protocols that are meant to operate on a local link set the Hop
Limit to 1, not to 0.

So... is there any legitimate reason to honor incoming (i.e., not
discard) packets with a Hop Limit of 0??

Thanks,
-- 
Fernando Gont
e-mail: [email-masked] || [email-masked]
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1