Subject: [babel] Sub-TLVs, flags and Isolation in the IANA registry

From: David Schinazi <[email-masked]>
Date: Wed, 28 Jun 2017 18:44:27 -0700

Hi everyone,

Currently the Babel IANA registry contains one registry for sub-TLVs and one registry for flags.
https://www.iana.org/assignments/babel/babel.xhtml <https://www.iana.org/assignments/babel/babel.xhtml>
The RFC6126 flags are meant for the Update TLV.

The current work-in-progress version of the draft introduces Hello Flags and got me thinking:

1) Should we have two separate registries:
- Hello Flags (16 bits)
- Update Flags (8 bits)

2) Should we have one sub-TLV registry per TLV?
The majority of currently defined sub-TLVs only make sense for one TLV,
so I wonder if sharing the space will cause us to run out of sub-TLVs prematurely.

Thoughts?

Thanks,
David Schinazi

---

From: Juliusz Chroboczek <[email-masked]>
Date: Thu, 29 Jun 2017 19:58:49 +0200

Hi David,

> 1) Should we have two separate registries:

Yes.

> 2) Should we have one sub-TLV registry per TLV?

No.

> The majority of currently defined sub-TLVs only make sense for one TLV,

RFC 7557 Section 2.3 says:

   An extension MAY be assigned one or more sub-TLV types.  Sub-TLV
   types are assigned independently from TLV types: the same numeric
   type can be assigned to a TLV and a sub-TLV.  Sub-TLV types are
   assigned globally: once an extension is assigned a given sub-TLV
   number, it MAY use this number within any TLV.  However, the
   interpretation of a given sub-TLV type can depend on which particular
   TLV it is embedded within.

So if you define a new extension, you get a sub-TLV number.  It's your
own, no other extension will get the same number.  You can use it with
multiple TLVs, you can use it with just one TLV.  It's up to you, it's
your extension.

The advantage is that there is just one registry, and that when you see
a sub-TLV, you immediately know which extension it comes from.  Another
advantage is that sub-TLVs can be used with any TLV, even TLVs that were
not defined at the time the registry has been set up.

> so I wonder if sharing the space will cause us to run out of sub-TLVs prematurely.

I don't think even IS-IS has more than 220 extensions ;-)

If we ever run out of sub-TLV numbers, we'll switch to 16-bit sub-TLV numbers:

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |     Type      |    Length     |          Subtype              |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |       Body
  +-+-+-+-+-+-+-+-+-

Type is 127 or 255, depending on whether the mandatory bit is set.
Subtype is a 16-bit integer that defines the sub-TLV.

And by the time we run out of 16-bit sub-TLV numbers, I'll be dead, so
I won't care any more.  But somebody who's still alive will define
a format for 32-bit sub-TLV numbers:

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |     Type      |    Length     |         Subtype               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                     Sub-subtype                               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |       Body
  +-+-+-+-+-+-+-+-+-

-- Juliusz