RFC 7557

Extension Mechanism for the Babel Routing Protocol

๐Ÿ“… published May 2015, from ietf

Extension Mechanism for the Babel Routing Protocol ๐Ÿฆ‹

Okay bestie, this is RFC 7557 ๐Ÿ’– It's an Independent Submission by J. Chroboczek from PPS, University of Paris-Diderot, dated May 2015. It's in the Experimental category (ISSN 2070-1721) and it updates RFC 6126. The whole point is explaining how you're allowed to extend the Babel routing protocol without breaking everyone else's implementation ๐Ÿซถ


Abstract โœจ

This doc defines how to encode extensions to the Babel routing protocol, as specified in RFC 6126. It's giving clean spec energy.

Status of This Memo ๐Ÿ“‹

This document is not an Internet Standards Track specification. It's published for examination, experimental implementation, and evaluation ๐Ÿงช

It defines an Experimental Protocol for the Internet community. It's a contribution to the RFC Series, independent of any other RFC stream. The RFC Editor chose to publish it at their discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not a candidate for any level of Internet Standard, see Section 2 of RFC 5741 ๐Ÿ’…

Info about the current status, any errata, and how to give feedback can be found at http://www.rfc-editor.org/info/rfc7557.

Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, because they describe your rights and restrictions with respect to this document ๐Ÿ“œ

Table of Contents ๐Ÿ—‚๏ธ

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
2.  Mechanisms for Extending the Babel Protocol . . . . . . . . .   3
  2.1.  New Versions of the Babel Protocol  . . . . . . . . . . .   3
  2.2.  New TLVs  . . . . . . . . . . . . . . . . . . . . . . . .   3
  2.3.  Sub-TLVs  . . . . . . . . . . . . . . . . . . . . . . . .   4
  2.4.  The Flags Field . . . . . . . . . . . . . . . . . . . . .   4
  2.5.  Packet Trailer  . . . . . . . . . . . . . . . . . . . . .   5
3.  Format of Sub-TLVs  . . . . . . . . . . . . . . . . . . . . .   5
  3.1.  Sub-TLVs Specified in This Document . . . . . . . . . . .   5
  3.2.  Unknown Sub-TLVs  . . . . . . . . . . . . . . . . . . . .   6
4.  Choosing between Extension Mechanisms . . . . . . . . . . . .   6
5.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   7
6.  Security Considerations . . . . . . . . . . . . . . . . . . .   9
7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  10
  7.1.  Normative References  . . . . . . . . . . . . . . . . . .  10
  7.2.  Informative References  . . . . . . . . . . . . . . . . .  10
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  10
Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  11

1. Introduction ๐ŸŒธ

Okay so a Babel packet [RFC6126] is giving header first, then a sequence of TLVs, and each TLV is a run of octets with an explicit type and length. The original Babel protocol has these provisions for extension data:

  • A Babel packet with a version number different from 2 MUST be silently ignored ([RFC6126], Section 4.2).
  • An unknown TLV MUST be silently ignored ([RFC6126], Section 4.3).
  • Except for Pad1 and PadN, all TLVs are self-terminating, and any extra data included in a TLV MUST be silently ignored ([RFC6126], Section 4.2).
  • The Flags field of the Update TLV has 6 undefined bits that MUST be silently ignored ([RFC6126], Section 4.4.9).
  • Any data following the last TLV of a Babel packet MUST be silently ignored ([RFC6126], Section 4.2).

Each of these gives extensions a place to stash their data ๐Ÿงš But without some ground rules, independently developed extensions could use the same space in conflicting ways, and then implementations would fail to interoperate ๐Ÿ˜ญ

This document writes down a set of rules for extending Babel so that these clashes don't happen, and a bunch of deployed extensions already follow them ๐Ÿ’œ

Throughout this doc, "original protocol" means the protocol defined in [RFC6126], and "extended protocol" means any extension of Babel that follows the rules in this document ๐ŸŽ€

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] ๐Ÿซถ

2. Mechanisms for Extending the Babel Protocol ๐Ÿฆ‹

This section walks through each of the mechanisms available for extending Babel. Let's go ๐Ÿ’…

2.1. New Versions of the Babel Protocol ๐Ÿ‘‘

The header of a Babel packet has an eight-bit protocol version. The current version of Babel is version 2, and any packets with a version number different from 2 MUST be silently ignored.

Versions 0 and 1 were earlier experimental versions of Babel that got some modest deployment. These version numbers SHOULD NOT be reused by future versions of the Babel protocol. Version numbers larger than 2 might be used by a future incompatible protocol ๐Ÿ”ฎ

2.2. New TLVs ๐Ÿ“

An extension may carry its data in a new TLV type. These new TLVs will be silently ignored by implementations of the original Babel protocol, and by other extended implementations too, as long as the TLV types don't collide โœจ

All new TLVs MUST have the format defined in [RFC6126], Section 4.3. New TLVs SHOULD be self-terminating, in the sense defined in the next section, and any data found after the main data section of the TLV SHOULD be treated as a series of sub-TLVs.

TLV types 224 through 254 are reserved for Experimental Use [RFC3692]. TLV type 255 is reserved for expanding the TLV type space, in the unlikely event that eight bits turn out not to be enough ๐Ÿงช

2.3. Sub-TLVs ๐Ÿง

Every Babel TLV carries an explicit length, except for Pad1. Every TLV defined by the original protocol is self-terminating, except for Pad1 and PadN. That means the length of the meaningful data inside it (the "natural length") can be figured out without looking at the explicitly encoded length. Sometimes the natural length is super obvious: a HELLO TLV always has a natural length of 2 (4 including the Type and Length fields). Other times it's trickier, but an implementation that interprets the TLV has to work it out anyway. For example, the natural length of an Update TLV depends on both the prefix length and the amount of prefix compression being done ๐Ÿค“

If the explicit length of a TLV defined by the original protocol is larger than its natural length, the original protocol's implementations silently ignore the extra space. Extended implementations MAY use that space to store arbitrary data, and SHOULD structure the additional data as a sequence of sub-TLVs. Unlike TLVs, sub-TLVs don't need to be self-terminating ๐Ÿ™ˆ

An extension MAY be assigned one or more sub-TLV types. Sub-TLV types are assigned independently of TLV types, so the same numeric type can be assigned to both a TLV and a sub-TLV. Sub-TLV types are assigned globally: once an extension has been assigned a given sub-TLV number, it MAY use that number within any TLV. However, what a given sub-TLV type means can depend on which TLV it's embedded in ๐Ÿ’–

Sub-TLV types 224 through 254 are reserved for Experimental Use [RFC3692]. TLV type 255 is reserved for expanding the sub-TLV type space, in the unlikely event that eight bits turn out not to be enough. The format of sub-TLVs is defined in Section 3 below ๐ŸŒˆ

2.4. The Flags Field ๐Ÿšฉ

The Flags field is an eight-bit field in the Update TLV. Bits 0 and 1 (the bits with values 80 and 40 hexadecimal) are defined by the original protocol and MUST be recognised and used by every implementation. The other six bits aren't used right now, and the original protocol's implementations silently ignore them ๐ŸŒธ

The Flags field is so small that it is NOT RECOMMENDED to assign one or more bits to an extension. A sub-TLV SHOULD be assigned instead. An implementation MUST ignore any bits in the Flags field that it does not know about, and MUST send them as zero ๐Ÿซถ

2.5. Packet Trailer ๐ŸŽ€

A Babel packet carries an explicit length in its header. A Babel packet is carried by a UDP datagram, and that datagram also has an explicit length in its header. A UDP datagram carrying a Babel packet can be larger than the Babel packet itself. In that case, the extra space after the Babel packet, known as the packet trailer, is silently ignored by implementations of the original protocol ๐Ÿงš

The packet trailer was originally meant to be a cryptographic trailer. But the authentication extension to Babel [RFC7298] ended up using a pair of new TLVs instead, and no currently deployed Babel extension uses the packet trailer. So its format and purpose are currently left undefined ๐Ÿคทโ€โ™€๏ธ

3. Format of Sub-TLVs ๐Ÿ’…

A sub-TLV has exactly the same structure as a TLV. Except for Pad1 (Section 3.1.1), all sub-TLVs have the following structure:

    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     |     Body...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Fields:

  • Type: the type of the sub-TLV.
  • Length: the length of the body, in octets, not counting the Type and Length fields.
  • Body: the sub-TLV body. How it's interpreted depends on both the type of the sub-TLV and the type of the TLV it's embedded in ๐Ÿง

3.1. Sub-TLVs Specified in This Document ๐ŸŒท

This document defines two types of sub-TLVs, Pad1 and PadN. Any extended implementation of Babel that uses sub-TLVs MUST parse these two sub-TLVs correctly and ignore them ๐Ÿ’–

3.1.1. Pad1 ๐ŸŒ™

    0
    0 1 2 3 4 5 6 7
   +-+-+-+-+-+-+-+-+
   |   Type = 0    |
   +-+-+-+-+-+-+-+-+

Fields:

  • Type: set to 0 to indicate a Pad1 sub-TLV.

This sub-TLV is silently ignored on reception ๐Ÿ™ˆ

3.1.2. PadN ๐Ÿงธ

    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 = 1   |    Length     |      MBZ...
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Fields:

  • Type: set to 1 to indicate a PadN sub-TLV.
  • Length: the length of the body, in octets, not counting the Type and Length fields.
  • MBZ: set to 0 on transmission.

This sub-TLV is silently ignored on reception โœจ

3.2. Unknown Sub-TLVs ๐Ÿซง

Any unknown sub-TLV MUST be silently ignored by an extended implementation that uses sub-TLVs. It's the vibe of being forgiving to whatever you don't understand yet ๐ŸŒˆ

4. Choosing between Extension Mechanisms โœจ

okay so bestie, a brand new version of Babel should only be a thing if it's not backwards compatible with the original protocol ๐Ÿซถ

In lots of cases, an extension could go either way: a brand new TLV, or a sub-TLV tucked inside an existing one. Say you want to attach extra data to route updates. You could make a shiny new "enriched" Update TLV, or you could just add a sub-TLV to the Update TLV you already have. Both are valid, and it's giving "pick your fighter" ๐Ÿ’…

Here's the tea: implementations that don't understand the extension treat these two differently. With a new TLV, an original-protocol implementation ignores the whole unknown TLV. With a new sub-TLV, the parent TLV still gets parsed and acted upon, and the unknown sub-TLV is just silently ignored. So a sub-TLV is the move for extensions that extend the Update in a compatible way (the extension data can be silently ignored ๐Ÿฆ‹). A new TLV is the move for extensions that change the meaning of the TLV in an incompatible way, because then the whole TLV has to be thrown away if the extension data isn't understood. no cap, that's iconic design thinking ๐Ÿ‘‘

Using a new bit in the Flags field is equivalent to defining a new sub-TLV, but it uses less space in the Babel packet โœจ BUT the Flags space is super limited and the space savings are kinda doubtful, so we do not recommend using bits in the Flags field. Use a new sub-TLV instead ๐ŸŒธ

We're also staying out of it when it comes to the packet trailer, because there isn't much implementation experience with it yet ๐Ÿงš


5. IANA Considerations ๐ŸŽ€

IANA has created three new registries, called "Babel TLV Types", "Babel Sub-TLV Types", and "Babel Flags Values". The allocation policy for each of these registries is Specification Required [RFC5226] ๐Ÿ“‹

The initial values in the "Babel TLV Types" registry are as follows:

+---------+-----------------------------------------+---------------+
| Type    | Name                                    | Reference     |
+---------+-----------------------------------------+---------------+
| 0       | Pad1                                    | [RFC6126]     |
|         |                                         |               |
| 1       | PadN                                    | [RFC6126]     |
|         |                                         |               |
| 2       | Acknowledgment Request                  | [RFC6126]     |
|         |                                         |               |
| 3       | Acknowledgment                          | [RFC6126]     |
|         |                                         |               |
| 4       | Hello                                   | [RFC6126]     |
|         |                                         |               |
| 5       | IHU                                     | [RFC6126]     |
|         |                                         |               |
| 6       | Router-Id                               | [RFC6126]     |
|         |                                         |               |
| 7       | Next Hop                                | [RFC6126]     |
|         |                                         |               |
| 8       | Update                                  | [RFC6126]     |
|         |                                         |               |
| 9       | Route Request                           | [RFC6126]     |
|         |                                         |               |
| 10      | Seqno Request                           | [RFC6126]     |
|         |                                         |               |
| 11      | TS/PC                                   | [RFC7298]     |
|         |                                         |               |
| 12      | HMAC                                    | [RFC7298]     |
|         |                                         |               |
| 13      | Source-specific Update                  | [BABEL-SS]    |
|         |                                         |               |
| 14      | Source-specific Request                 | [BABEL-SS]    |
|         |                                         |               |
| 15      | Source-specific Seqno Request           | [BABEL-SS]    |
|         |                                         |               |
| 224-254 | Reserved for Experimental Use           | this document |
|         |                                         |               |
| 255     | Reserved for expansion of the type      | this document |
|         | space                                   |               |
+---------+-----------------------------------------+---------------+

The initial values in the "Babel Sub-TLV Types" registry are as follows:

+---------+-----------------------------------------+---------------+
| Type    | Name                                    | Reference     |
+---------+-----------------------------------------+---------------+
| 0       | Pad1                                    | this document |
|         |                                         |               |
| 1       | PadN                                    | this document |
|         |                                         |               |
| 2       | Diversity                               | [BABEL-DIV]   |
|         |                                         |               |
| 3       | Timestamp                               | [BABEL-RTT]   |
|         |                                         |               |
| 224-254 | Reserved for Experimental Use           | this document |
|         |                                         |               |
| 255     | Reserved for expansion of the type      | this document |
|         | space                                   |               |
+---------+-----------------------------------------+---------------+

The initial values in the "Babel Flags Values" registry are as follows:

              +-----+-------------------+-----------+
              | Bit | Name              | Reference |
              +-----+-------------------+-----------+
              | 0   | Default prefix    | [RFC6126] |
              |     |                   |           |
              | 1   | Default router-id | [RFC6126] |
              |     |                   |           |
              | 2-7 | Unassigned        |           |
              +-----+-------------------+-----------+

6. Security Considerations ๐Ÿ’€

okay this part is serious, bestie, so pay attention ๐Ÿ™ˆ

This document only specifies the structure of fields that are already in the original Babel protocol. By itself, it does not raise any new security considerations. BUT specific extensions can totally change the security properties of the protocol. For example, they might add security mechanisms [RFC7298], or they might open the door to new kinds of attack ๐Ÿ˜ญ so keep an eye on every extension you build!


7. References ๐Ÿ“š

7.1. Normative References

[RFC2119]   Bradner, S., "Key words for use in RFCs to Indicate
            Requirement Levels", BCP 14, RFC 2119,
            DOI 10.17487/RFC2119, March 1997,
            <http://www.rfc-editor.org/info/rfc2119>.

[RFC3692]   Narten, T., "Assigning Experimental and Testing Numbers
            Considered Useful", BCP 82, RFC 3692,
            DOI 10.17487/RFC3692, January 2004,
            <http://www.rfc-editor.org/info/rfc3692>.

[RFC5226]   Narten, T. and H. Alvestrand, "Guidelines for Writing an
            IANA Considerations Section in RFCs", BCP 26, RFC 5226,
            DOI 10.17487/RFC5226, May 2008,
            <http://www.rfc-editor.org/info/rfc5226>.

[RFC6126]   Chroboczek, J., "The Babel Routing Protocol", RFC 6126,
            DOI 10.17487/RFC6126, April 2011,
            <http://www.rfc-editor.org/info/rfc6126>.

7.2. Informative References

[BABEL-DIV] Chroboczek, J., "Diversity Routing for the Babel Routing
            Protocol", Work in Progress, draft-chroboczek-babel-
            diversity-routing-00, July 2014.

[BABEL-RTT] Jonglez, B. and J. Chroboczek, "Delay-based Metric
            Extension for the Babel Routing Protocol", Work in
            Progress, draft-jonglez-babel-rtt-extension-01, May 2015.

[BABEL-SS]  Boutier, M. and J. Chroboczek, "Source-Specific Routing
            in Babel", Work in Progress, draft-boutier-babel-
            source-specific-01, May 2015.

[RFC7298]   Ovsienko, D., "Babel Hashed Message Authentication Code
            (HMAC) Cryptographic Authentication", RFC 7298,
            DOI 10.17487/RFC7298, July 2014,
            <http://www.rfc-editor.org/info/rfc7298>.

Acknowledgments ๐Ÿซถ

I am grateful to Denis Ovsienko and Gabriel Kerneis for their feedback on previous draft versions of this document. ๐Ÿ’œ

Author's Address ๐Ÿฆ‹

Juliusz Chroboczek
PPS, University of Paris-Diderot
Case 7014
75205 Paris Cedex 13
France

EMail: jch@pps.univ-paris-diderot.fr
๐Ÿ“ฆ where this page comes from