Subject: RFC2460bis hop limit text

From: [email-masked]
Date: Wed, 13 Jan 2016 22:01:19 +0100

After discussing a related issue with a forwarding implementation I'm working on, I think 2460bis hop limit text has an issue:

     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, or is received with a
                          zero Hop Limit.

According to RFC1812 receiving a packet with TTL = 0 is perfectly fine.

I suggest we instead say something like:

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

In addition add the note: (almost verbatim from 1812)
  Note: A node must not discard a datagram just because it was received
  with hop limit equal to zero or one; if it is to the node and otherwise
  valid, the node must attempt to receive it.

Ole

---

From: Bob Hinden <[email-masked]>
Date: Wed, 13 Jan 2016 13:25:24 -0800

Ole,

> On Jan 13, 2016, at 1:01 PM, [email-masked] wrote:
> 

I agree, the text could be clearer.

>  valid, the node must attempt to receive it.

This text is fine for me.  I will incorporate it in the next draft if there isn’t any push back on the list.

Thanks,
Bob

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

---

From: "Manfredi, Albert E" <[email-masked]>
Date: Wed, 13 Jan 2016 22:40:10 +0000

> -----Original Message-----
> From: ipv6 [mailto:[email-masked]] On Behalf Of Bob Hinden

> isn’t any push back on the list.

Isn't this still Hop Limit definition confusing? It sounds like a packet with TTL 0 is not valid. The "or decremented to zero" part, specifically, is confusing to me.

"The packet is discarded if Hop Limit is already zero or decremented to zero."

A packet whose TTL becomes decremented to 0 while traversing the router is not to be discarded. RFC 1812 says that a packet *is not forwarded* if the TTL value is zero upon arrival.

For example, a packet arriving with TTL 1 is decremented by the router to TTL 0, and forwarded to the next hop.

A packet arriving with TTL 0 is not forwarded *but* it is valid if addressed to the router itself, or addressed to any other host within the same IP subnet as that router interface.

How about:

Hop Limit     8-bit unsigned integer.  Decremented by 1 by
              each node that forwards the packet.  The
              packet is not forwarded if Hop Limit is
              already zero when the packet arrives at the
              router. If the packet with TTL 0 arrives
              addressed to the router, it must be
              received by the router. 

Bert

---

From: [email-masked]
Date: Thu, 14 Jan 2016 00:12:11 +0100

Bert,

> Isn't this still Hop Limit definition confusing? It sounds like a packet with TTL 0 is not valid. The "or decremented to zero" part, specifically, is confusing to me.

Any suggestion how we can make it clear that the whole paragraph only applies for nodes forwarding the packet?

> For example, a packet arriving with TTL 1 is decremented by the router to TTL 0, and forwarded to the next hop.

No, that packet is discarded.

>              addressed to the router, it must be

So, that's not quite right either, since a forwarding node is supposed to drop any packet with hop limit <= 1 (prior to decrementing).

Best regards,
Ole

---

From: Bob Hinden <[email-masked]>
Date: Wed, 13 Jan 2016 15:14:35 -0800

Bert,

> Isn't this still Hop Limit definition confusing? It sounds like a packet with TTL 0 is not valid. The "or decremented to zero" part, specifically, is confusing to me.

RFC2460 is clear that if the hop limit is decremented to zero, the packet should be discarded:

 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.

The issue here is what happens if it arrives with a hop limit of zero.  This is based on Errata 4279.

    http://www.rfc-editor.org/errata_search.php?rfc=2460

I believe if is is being forwarded it should be dropped, if it’s addressed to the node, it should be processed normally.

Bob

---

From: "Manfredi, Albert E" <[email-masked]>
Date: Wed, 13 Jan 2016 23:58:37 +0000

> From: Bob Hinden [mailto:[email-masked]]

> I believe if is is being forwarded it should be dropped, if it’s addressed to
> the node, it should be processed normally.

My bad. You and Ole are right. I went back to RFC 791, which says the same thing:

Time to Live:  8 bits

    This field indicates the maximum time the datagram is allowed to
    remain in the internet system.  If this field contains the value
    zero, then the datagram must be destroyed. ...

So RFC 1812 is trying to accommodate misbehavior, to some degree, when it says:

   TTL expiration is intended to cause datagrams to be discarded by
   routers, but not by the destination host.  Hosts that act as routers
   by forwarding datagrams must therefore follow the router's rules for
   TTL.

Seems to contradict RFC 791 and RFC 2460. Their instructions are not limited to routers. They're also telling hosts to destroy these packets. (RFC 1812 mentions special cases, e.g. used by diagnostic tools.) So evidently, there was a change of heart at the IETF, after RFC 791?

Okay, how about this:

Hop Limit     8-bit unsigned integer.  Decremented by 1 by
              each node that forwards the packet.  The
              packet is not forwarded if Hop Limit is
              already zero when the packet arrives at the
              router, or becomes decremented to zero when
              traversing the router. However destination
              hosts, including routers, must receive and
              process packets addressed to an IP interface
              even if TTL is zero, to accommodate
              misbehaving hosts.

Bert

---

From: Brian E Carpenter <[email-masked]>
Date: Thu, 14 Jan 2016 15:37:54 +1300

> I believe if is is being forwarded it should be dropped, if it’s addressed to the node, it should be processed normally.

That's a reasonable choice we can make, but it is a protocol change
compared to RFC 2460.

Looking at Erratum 4279, which doesn't resolve the dubious text at all,
I am troubled by these words
"Following the instructions in that case would result in decrementing the hop limit from 0 to -1 (so, 255)...".

Er, no. Properly written (micro)code asked to decrement an unsigned integer
will not change 0 to -1; it will throw an error. We should definitely make
this clear in the 2460bis text.

   Brian

---

From: Bob Hinden <[email-masked]>
Date: Thu, 14 Jan 2016 15:51:59 -0800

Bert,

> ..

s/TTL/Hop Limit/ :-)

How about:

      Hop Limit           8-bit unsigned integer.  Decremented by 1 by
                          each node that forwards the packet.  When
                          forwarding, the packet is discarded if Hop
                          Limit was zero when received or is decremented
                          to zero.  A node that is the destination of a
                          packet should not discard a packet with hop
                          limit equal to zero, it should process the
                          packet normally.

Accomplishes the same thing and matches the style of the document.

Thanks,
Bob

---

From: "Manfredi, Albert E" <[email-masked]>
Date: Thu, 14 Jan 2016 23:57:07 +0000

> Accomplishes the same thing and matches the style of the document.

It's a deal! Thanks.

Bert

---

From: Bob Hinden <[email-masked]>
Date: Thu, 14 Jan 2016 17:32:03 -0800

Bert,

> On Jan 14, 2016, at 3:57 PM, Manfredi, Albert E <[email-masked]> wrote:
> 

Thanks, will be in the next version.

Bob

---

From: t.petch <[email-masked]>
Date: Fri, 15 Jan 2016 11:56:31 +0000

----- Original Message -----
From: "Bob Hinden" <[email-masked]>
To: "Manfredi, Albert E" <[email-masked]>
Cc: "IPv6 List" <[email-masked]>; "Bob Hinden" <[email-masked]>
Sent: Friday, January 15, 2016 1:32 AM

Bert,

<tp>

One ambiguity that I have never resolved is whether the decrementing is
conceptually performed on the ingress or egress interface, or in a
process between the two.  I used to encounter, some time ago, routers
that, by design, performed it on the egress interface and so emitted
datagrams with a count of zero, and regarded themselves as conformant to
the IPv4 specifications.  I read the RFC and decided that I could not
tell, just that it was clear that hosts should expect and process
datagrams with a count of zero.

Reading this thread I am left wondering; I think that the ambiguity is
still there but that it probably does not matter.

Tom Petch

Bob

---

From: [email-masked]
Date: Fri, 15 Jan 2016 13:16:55 +0100

Tom,

> still there but that it probably does not matter.

do you still see ambiguity in the above text?
isn't "discarded if Hop Limit is decremented to zero" pretty clear?

hosts have always been expected to process datagrams with TTL/HLIM of zero, and routers have never been supposed to send them.

cheers,
Ole

---

From: "Pascal Thubert (pthubert)" <[email-masked]>
Date: Fri, 15 Jan 2016 12:27:39 +0000

Hello Ole:

Basically the text prevents a host to send a packet to another host on link with TTL == 0. 

Seems that with the new text, the zero value becomes totally non-sensical, a protocol error. I agree that's the best way to minimize the change to RFC 2460 but it still looks like we're losing something.

I'd have preferred a text that allows a router to route a packet only if it is received with a non-zero TTL and forces the router to decrement the TTL when doing so.  

The same text saying nothing about hosts so a node could send and receive packets with a 0 TTL, which is an alternate way to make sure that a packet does not leave the link even if you do not have the LLA of the destination.

Is that out of reach?

Pascal

> From: ipv6 [mailto:[email-masked]] On Behalf Of
> [email-masked]
> Sent: mercredi 13 janvier 2016 22:01
> To: 6man WG <[email-masked]>
> Subject: RFC2460bis hop limit text
> 
> After discussing a related issue with a forwarding implementation I'm working
> on, I think 2460bis hop limit text has an issue:
>

---

From: [email-masked]
Date: Fri, 15 Jan 2016 13:39:59 +0100

Pascal,

> The same text saying nothing about hosts so a node could send and receive packets with a 0 TTL, which is an alternate way to make sure that a packet does not leave the link even if you do not have…

sending with HLIM of 1 will also ensure that a packet does not leave the link.

cheers,
Ole

---

From: Bob Hinden <[email-masked]>
Date: Fri, 15 Jan 2016 14:50:32 -0800

Pascal,

> On Jan 15, 2016, at 4:27 AM, Pascal Thubert (pthubert) <[email-masked]> wrote:
> 
> Hello Ole:
> 

The current text does that:

            Decremented by 1 by
            traversing the router.

Note the field is called “Hop Limit” in IPv6.

> The same text saying nothing about hosts so a node could send and receive packets with a 0 TTL, which is an alternate way to make sure that a packet does not leave the link even if you do not have…

This isn’t prohibited, but I don’t see this spec would need to say anything about it.

Bob

---

From: Fernando Gont <[email-masked]>
Date: Sat, 16 Jan 2016 03:37:30 -0300

Hi, Ole,

>   valid, the node must attempt to receive it.

I agree the intent, but:

This text you suggest:

Seems to convey the same meaning. Maybe you mean something like:

   ....the packet is discarded if a packet must be forwarded
   and the forwarding node finds that the Hop Limit is 0 or
   is decremented to zero.

Thanks,
-- 
Fernando Gont
SI6 Networks
e-mail: [email-masked]
PGP Fingerprint: 6666 31C6 D484 63B2 8FB1 E3C4 AE25 0D55 1D4E 7492

---

From: Fernando Gont <[email-masked]>
Date: Sat, 16 Jan 2016 03:52:40 -0300

Hi, Bob,

> Accomplishes the same thing and matches the style of the document.

I'd probably s/it/but/ in "it should process the..."

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