RFC 9013

OSPF Advertisement of Tunnel Encapsulations

๐Ÿ“… published April 2021, from ietf

RFC 9013: OSPF Advertisement of Tunnel Encapsulations ๐Ÿฆ‹

okay bestie, let's get into it. RFC 9013 is an IETF Standards Track document from April 2021, published as ISSN 2070-1721. The editors are X. Xu (Capitalonline) and B. Decraene (Orange), with R. Raszuk (NTT Network Innovations), L. Contreras (Telefonica I+D), and L. Jalil (Verizon). Its header doesn't list any Obsoletes or Updates entries, so it isn't replacing or amending anything else. ๐Ÿ’…

Abstract

Networks use tunnels for all kinds of reasons ๐ŸŒˆ and there are SO many tunnel types. So the tunnel encapsulator router has to pick a type that the tunnel decapsulator router actually supports. This document explains how to advertise that list of supported tunnel encapsulations in OSPF Router Information Link State Advertisements (LSAs) ๐Ÿงš

Status of This Memo

This is an Internet Standards Track document. โœจ

It's a product of the Internet Engineering Task Force (IETF), it represents the consensus of the IETF community, it got public review, and the Internet Engineering Steering Group (IESG) approved it for publication. If you want more on Internet Standards, check out Section 2 of RFC 7841. ๐Ÿ“š

For the current status, any errata, and how to send feedback, head to https://www.rfc-editor.org/info/rfc9013. ๐ŸŒธ

Copyright (c) 2021 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 (https://trustee.ietf.org/license-info) as they stand on the publication date. Please actually read these, because they spell out your rights and restrictions for this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License. ๐Ÿ’œ


Table of Contents ๐Ÿ—‚๏ธ

1.  Introduction
2.  Terminology
3.  Tunnel Encapsulations TLV
4.  Tunnel Sub-TLV
5.  Tunnel Parameter Sub-TLVs
  5.1.  Encapsulation Sub-TLV
  5.2.  Protocol Type Sub-TLV
  5.3.  Tunnel Egress Endpoint Sub-TLV
  5.4.  Color Sub-TLV
  5.5.  Load-Balancing Block Sub-TLV
  5.6.  DS Field Sub-TLV
  5.7.  UDP Destination Port Sub-TLV
6.  Operation
7.  IANA Considerations
  7.1.  OSPF Router Information (RI) TLVs Registry
  7.2.  OSPF Tunnel Parameter Sub-TLVs Registry
8.  Security Considerations
9.  References
  9.1.  Normative References
  9.2.  Informative References
Acknowledgements
Contributors
Authors' Addresses

1. Introduction ๐ŸŒท

Okay so networks use tunnels for lots of reasons, like these two:

  • Partial IPv6 deployment in IPv4 networks (or the other way around), as described in [RFC5565]. IPvx tunnels run between IPvx-enabled routers so the traffic can get across routers that don't speak IPvx. ๐Ÿฆ‹
  • Remote Loop-Free Alternate (RLFA) repair tunnels, as described in [RFC7490]. These tunnels run between the Point of Local Repair and the selected PQ node. ๐Ÿ”ฅ

The tunnel encapsulator router has to pick a tunnel type the tunnel decapsulator router supports, and this doc is the how-to for advertising that list of supported encapsulations inside OSPF Router Information Link State Advertisements (LSAs) โœจ. Here, "OSPF" means both OSPFv2 [RFC2328] and OSPFv3 [RFC5340]. ๐Ÿ’–

2. Terminology ๐Ÿ“–

This memo uses the terms defined in [RFC7770]. ๐Ÿงš

Now the important bit ๐Ÿ‘‘: the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" are interpreted as described in BCP 14 [RFC2119] [RFC8174], but only when they show up in all capitals, like they do here. ๐Ÿ’…

3. Tunnel Encapsulations TLV ๐ŸŽ€

Routers advertise their supported tunnel encapsulation types by sending a new TLV inside the OSPF Router Information (RI) Opaque LSA [RFC7770]. This one's called the "Tunnel Encapsulations TLV", and it works for both OSPFv2 and OSPFv3. ๐ŸŒˆ

The Type code is 13. The Length is variable. The Value field holds one or more Tunnel Sub-TLVs (defined in Section 4), and each Tunnel Sub-TLV names a specific encapsulation format the advertising router supports, along with the parameters for that tunnel type. ๐Ÿซถ

The Tunnel Encapsulations TLV MAY show up more than once in the same OSPF Router Information (RI) Opaque LSA ๐ŸŒธ. If it does, you SHOULD consider the full set of Tunnel Sub-TLVs from all of those Tunnel Encapsulations TLVs together. How far the advertisement reaches depends on the application, but it's recommended that it SHOULD be domain wide ๐ŸŒ.

4. Tunnel Sub-TLV ๐Ÿง

Here's how the Tunnel Sub-TLV is laid out, shown in Figure 1 ๐Ÿ‘‡

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Tunnel Type (2 octets)     |        Length (2 octets)      |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |               Tunnel Parameter Sub-TLVs                       |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Figure 1: Tunnel Sub-TLV

Here's what each field does:

  • Tunnel Type (2 octets): This says which tunneling technology is being signaled. Tunnel types are shared with the BGP extension [RFC9012], so they live in the IANA registry "BGP Tunnel Encapsulation Attribute Tunnel Types". Unknown tunnel types are to be ignored when received. ๐Ÿ™ˆ
  • Length (2 octets): An unsigned 16-bit integer counting the total octets in the Tunnel Parameter Sub-TLVs field. ๐Ÿ”ข
  • Tunnel Parameter Sub-TLVs (variable): Zero or more Tunnel Parameter Sub-TLVs, defined in Section 5. โœจ

If a Tunnel Sub-TLV is invalid, it MUST be ignored and skipped. But the other Tunnel Sub-TLVs MUST still be considered. ๐Ÿ’€

5. Tunnel Parameter Sub-TLVs ๐ŸŒŸ

A Tunnel Parameter Sub-TLV is laid out as shown in Figure 2 ๐Ÿฆ‹

          +---------------------------------------------+
          |   Tunnel Parameter Sub-Type (2 octets)      |
          +---------------------------------------------+
          |   Tunnel Parameter Length (2 octets)        |
          +---------------------------------------------+
          |   Tunnel Parameter Value (variable)         |
          |                                             |
          +---------------------------------------------+

                 Figure 2: Tunnel Parameter Sub-TLV

Breaking it down:

  • Tunnel Parameter Sub-Type (2 octets): Each sub-type defines one parameter of the Tunnel Sub-TLV. They're registered in the IANA registry "OSPF Tunnel Parameter Sub-TLVs" (see Section 7.2). ๐Ÿ—๏ธ
  • Tunnel Parameter Length (2 octets): An unsigned 16-bit integer counting the total octets in the Tunnel Parameter Value field. ๐Ÿ”ข
  • Tunnel Parameter Value (variable): How the Value field is encoded depends on the sub-TLV type. The subsections below spell out each encoding. ๐Ÿ’œ

Now the rules for getting these right ๐Ÿ‘‘:

Any unknown Tunnel Parameter sub-type MUST be ignored and skipped when received. If a reserved value (see Section 7.2) shows up in an LSA, it MUST be treated as an invalid Tunnel Parameter Sub-TLV. If a Tunnel Parameter Value has incorrect syntax or semantics, it MUST be treated as an invalid Tunnel Parameter Sub-TLV. And if a Tunnel Parameter Sub-TLV is invalid, its Tunnel Sub-TLV MUST be ignored. Once again, the other Tunnel Sub-TLVs MUST still be considered. ๐Ÿซถ

5.1. Encapsulation Sub-TLV ๐ŸŽ€

This sub-TLV type is 1. Its Value field's syntax, semantics, and usage are defined in Section 3.2 ("Encapsulation Sub-TLVs for Particular Tunnel Types") of [RFC9012]. ๐ŸŒธ

5.2. Protocol Type Sub-TLV ๐Ÿงš

This sub-TLV type is 2. Its Value field's syntax, semantics, and usage are defined in Section 3.4.1 ("Protocol Type Sub-TLV") of [RFC9012]. ๐Ÿ’…

5.3. Tunnel Egress Endpoint Sub-TLV ๐ŸŒˆ

The Tunnel Egress Endpoint Sub-TLV tells you the address of the tunnel's egress endpoint, meaning the router that's going to decapsulate the payload. ๐Ÿ“

This sub-TLV type is 3. It MUST be present once and only once in a given Tunnel Sub-TLV. Its Value field has two subfields:

  • a two-octet Address Family subfield
  • an Address subfield, whose length depends on the Address Family

Here's the layout, shown in Figure 3 ๐Ÿ‘‡

     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |      Address Family           |           Address             ~
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
    ~                     (variable length)                         ~
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                Figure 3: Tunnel Egress Endpoint Sub-TLV

The Address Family subfield holds a value from IANA's "Address Family Numbers" registry. In this document we assume the Address Family is either IPv4 or IPv6, and any other address family is outside the scope of this doc. ๐ŸŒ

Here's where the details get real ๐Ÿ”:

If the Address Family subfield holds the IPv4 value, the Address subfield MUST contain an IPv4 address (a /32 IPv4 prefix). In that case, the Length field of the Tunnel Egress Endpoint Sub-TLV MUST contain the value 6. ๐ŸŒŸ

If the Address Family subfield holds the IPv6 value, the Address subfield MUST contain an IPv6 address (a /128 IPv6 prefix). In that case, the Length field of the Tunnel Egress Endpoint Sub-TLV MUST contain the value 18 (0x12). And IPv6 link-local addresses are not valid values for the IP address field. ๐Ÿšซ

5.4. Color Sub-TLV ๐ŸŽจ

This sub-TLV type is 4. It may appear zero or more times in a given Tunnel Sub-TLV. Its Value field is a 4-octet opaque unsigned integer. ๐Ÿ”ฎ

The color value is user-defined and configured locally on the advertising routers. Service providers can use it to define policies on the tunnel encapsulator routers, for example to control which tunnel gets picked. ๐Ÿ“

This color value can be referenced by BGP routes that carry the Color Extended Community [RFC9012]. If the tunnel is used to reach the BGP next hop of BGP routes, attaching a Color Extended Community to those routes says the BGP speaker is willing to use a tunnel of the same color. It's giving "we're on the same page" ๐Ÿ’œ

5.5. Load-Balancing Block Sub-TLV โš–๏ธ

This sub-TLV type is 5. Its Value field's syntax, semantics, and usage are defined in [RFC5640]. โœจ


Part 1 is done, bestie ๐Ÿซถ Part 2 is coming with the rest of the tunnel sub-TLVs, Operation, IANA, Security (very dramatic, very important), and References ๐ŸŒˆ๐Ÿ’–

5.6. DS Field Sub-TLV

bestie, this one's a little cameo ๐ŸŽ€ The sub-TLV type is 6 โœจ and the syntax, semantics, and usage of its Value field aren't in this doc at all. They're defined in Section 3.3.1 ("DS Field") of [RFC9012] ๐Ÿ’…

5.7. UDP Destination Port Sub-TLV

same energy ๐Ÿฆ‹ The type is 7 ๐Ÿ’– and the Value field lives in Section 3.3.2 ("UDP Destination Port") of [RFC9012] ๐ŸŒธ

6. Operation โœจ

okay this is the heart of it ๐Ÿ’œ Advertising a Tunnel Encapsulations Sub-TLV basically says "hey, I can do this tunnel decapsulation, and here are the params to use" ๐ŸŽ€ Whether anyone actually picks that tunnel is up to the tunnel encapsulator router. It has to be able to support the encapsulation type, and then its own policy gets a say ๐Ÿ‘‘ The Color Sub-TLV (see Section 5.4) can be an input to that policy, ooh ๐ŸŒˆ Also, heads up: some tunnel types need an explicit tunnel setup protocol before they can actually carry data ๐Ÿ˜ญ

A tunnel MUST NOT be used if there is no route toward the IP address specified in the Tunnel Egress Endpoint Sub-TLV (see Section 5.3) or if the route is not advertised in the same OSPF domain. ๐Ÿ™ˆ

7. IANA Considerations ๐ŸŽ€

7.1. OSPF Router Information (RI) TLVs Registry

IANA has allocated the following new code point in the "OSPF Router Information (RI) TLVs" registry ๐Ÿฆ‹

               +=======+=======================+===========+
               | Value | TLV Name              | Reference |
               +=======+=======================+===========+
               | 13    | Tunnel Encapsulations | RFC 9013  |
               +-------+-----------------------+-----------+

                      Table 1: Addition to OSPF Router
                       Information (RI) TLVs Registry

7.2. OSPF Tunnel Parameter Sub-TLVs Registry

IANA has created a new subregistry called the "OSPF Tunnel Parameter Sub-TLVs" registry under the "Open Shortest Path First (OSPF) Parameters" registry ๐ŸŒธ The registration procedures are as follows:

  • The values in the range 1-34999 are to be allocated using the "Standards Action" registration procedure defined in [RFC8126].
  • The values in the range 35000-65499 are to be allocated using the "First Come First Served" registration procedure.

The initial contents of the registry are as follows ๐Ÿ’œ

    +=============+======================+=====================+
    | Value       | TLV Name             | Reference           |
    +=============+======================+=====================+
    | 0           | Reserved             | RFC 9013            |
    +-------------+----------------------+---------------------+
    | 1           | Encapsulation        | RFC 9013 & RFC 9012 |
    +-------------+----------------------+---------------------+
    | 2           | Protocol Type        | RFC 9013 & RFC 9012 |
    +-------------+----------------------+---------------------+
    | 3           | Endpoint             | RFC 9013            |
    +-------------+----------------------+---------------------+
    | 4           | Color                | RFC 9013            |
    +-------------+----------------------+---------------------+
    | 5           | Load-Balancing Block | RFC 9013 & RFC 5640 |
    +-------------+----------------------+---------------------+
    | 6           | DS Field             | RFC 9013 & RFC 9012 |
    +-------------+----------------------+---------------------+
    | 7           | UDP Destination Port | RFC 9013 & RFC 9012 |
    +-------------+----------------------+---------------------+
    | 8-65499     | Unassigned           |                     |
    +-------------+----------------------+---------------------+
    | 65500-65534 | Experimental         | RFC 9013            |
    +-------------+----------------------+---------------------+
    | 65535       | Reserved             | RFC 9013            |
    +-------------+----------------------+---------------------+

      Table 2: Initial Contents of OSPF Tunnel Parameter Sub-
                           TLVs Registry

8. Security Considerations ๐Ÿ”ฅ

okay bestie, this section is SERIOUS ๐Ÿ˜ญ Security considerations applicable to softwires can be found in the mesh framework [RFC5565]. In general, security issues of the tunnel protocols signaled through this OSPF capability extension are inherited.

If a third party is able to modify any of the information that is used to form encapsulation headers, choose a tunnel type, or choose a particular tunnel for a particular payload type, user data packets may end up getting misrouted, misdelivered, and/or dropped. ๐Ÿ’€ However, since an OSPF routing domain is usually a well-controlled network under a single administrative domain, the possibility of the above attack is very low ๐Ÿซถ

We note that the last paragraph of Section 6 forbids the establishment of a tunnel toward arbitrary destinations. It prohibits a destination outside of the OSPF domain. This prevents a third party that has gained access to an OSPF router from being able to send the traffic to other destinations, e.g., for inspection purposes. ๐Ÿ‘‘ Lowkey the most important part of this whole doc, fr fr.

Security considerations for the base OSPF protocol are covered in [RFC2328] and [RFC5340].

9. References ๐Ÿ“š

9.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,
           <https://www.rfc-editor.org/info/rfc2119>.

[RFC5640]  Filsfils, C., Mohapatra, P., and C. Pignataro, "Load-
           Balancing for Mesh Softwires", RFC 5640,
           DOI 10.17487/RFC5640, August 2009,
           <https://www.rfc-editor.org/info/rfc5640>.

[RFC7770]  Lindem, A., Ed., Shen, N., Vasseur, JP., Aggarwal, R., and
           S. Shaffer, "Extensions to OSPF for Advertising Optional
           Router Capabilities", RFC 7770, DOI 10.17487/RFC7770,
           February 2016, <https://www.rfc-editor.org/info/rfc7770>.

[RFC8126]  Cotton, M., Leiba, B., and T. Narten, "Guidelines for
           Writing an IANA Considerations Section in RFCs", BCP 26,
           RFC 8126, DOI 10.17487/RFC8126, June 2017,
           <https://www.rfc-editor.org/info/rfc8126>.

[RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
           2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
           May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[RFC9012]  Patel, K., Van de Velde, G., Sangli, S., and J. Scudder,
           "The BGP Tunnel Encapsulation Attribute", RFC 9012,
           DOI 10.17487/RFC9012, April 2021,
           <https://www.rfc-editor.org/info/rfc9012>.

9.2. Informative References

[RFC2328]  Moy, J., "OSPF Version 2", STD 54, RFC 2328,
           DOI 10.17487/RFC2328, April 1998,
           <https://www.rfc-editor.org/info/rfc2328>.

[RFC5340]  Coltun, R., Ferguson, D., Moy, J., and A. Lindem, "OSPF
           for IPv6", RFC 5340, DOI 10.17487/RFC5340, July 2008,
           <https://www.rfc-editor.org/info/rfc5340>.

[RFC5512]  Mohapatra, P. and E. Rosen, "The BGP Encapsulation
           Subsequent Address Family Identifier (SAFI) and the BGP
           Tunnel Encapsulation Attribute", RFC 5512,
           DOI 10.17487/RFC5512, April 2009,
           <https://www.rfc-editor.org/info/rfc5512>.

[RFC5565]  Wu, J., Cui, Y., Metz, C., and E. Rosen, "Softwire Mesh
           Framework", RFC 5565, DOI 10.17487/RFC5565, June 2009,
           <https://www.rfc-editor.org/info/rfc5565>.

[RFC7490]  Bryant, S., Filsfils, C., Previdi, S., Shand, M., and N.
           So, "Remote Loop-Free Alternate (LFA) Fast Reroute (FRR)",
           RFC 7490, DOI 10.17487/RFC7490, April 2015,
           <https://www.rfc-editor.org/info/rfc7490>.

Acknowledgements ๐Ÿซถ

This document is partially inspired by [RFC5512] ๐ŸŒˆ

The authors would like to thank Greg Mirsky, John E. Drake, Carlos Pignataro, and Karsten Thomann for their valuable comments on this document. Special thanks should be given to Acee Lindem for his multiple detailed reviews of this document and help. The authors would like to thank Pete Resnick, Joe Touch, David Mandelberg, Sabrina Tanamal, Tim Wicinski, and Amanda Baber for their Last Call reviews. The authors also thank Spencer Dawkins, Mirja Kรผhlewind, Ben Campbell, Benoit Claise, Alvaro Retana, Adam Roach, and Suresh Krishnan for their AD reviews. ๐Ÿ’–

Contributors ๐Ÿงš

Uma Chunduri
Huawei

Email: uma.chunduri@gmail.com

Authors' Addresses ๐Ÿ“

Xiaohu Xu (editor)
Capitalonline

Email: xiaohu.xu@capitalonline.net


Bruno Decraene (editor)
Orange

Email: bruno.decraene@orange.com


Robert Raszuk
NTT Network Innovations
940 Stewart Dr
Sunnyvale, CA 94085
United States of America

Email: robert@raszuk.net


Luis M. Contreras
Telefonica I+D

Email: luismiguel.contrerasmurillo@telefonica.com


Luay Jalil
Verizon

Email: luay.jalil@verizon.com
๐Ÿ“ฆ where this page comes from