RFC 7606
Revised Error Handling for BGP UPDATE Messages
RFC 7606: Revised Error Handling for BGP UPDATE Messages π
Okay bestie, this is RFC 7606 π¦. It's a Standards Track document, so it's the real deal, not an experiment. It came out of the Internet Engineering Task Force (IETF) in August 2015 β¨, and its ISSN is 2070-1721.
Four authors wrote it. E. Chen (editor) and K. Patel are from Cisco Systems, Inc. π J. Scudder (editor) is at Juniper Networks π, and P. Mohapatra is at Sproute Networks π§. It's Request for Comments: 7606.
It doesn't obsolete anything, but it does update the error handling in RFCs 1997, 4271, 4360, 4456, 4760, 5543, 5701, and 6368 π₯. That's a whole glow-up for a bunch of older specs.
Abstract
Okay so the base BGP spec says that if a BGP speaker gets an UPDATE message with a malformed attribute, it is required to reset the session that the attribute came in on π. That's so messy, because the reset doesn't just kill the bad route. It takes down the valid routes on that session too.
This doc partially revises error handling for UPDATE messages π. It also gives guidance for people writing docs that define new attributes, and it revises the error handling for a bunch of existing attributes. Iconic behavior, honestly.
This document updates error handling for RFCs 1997, 4271, 4360, 4456, 4760, 5543, 5701, and 6368.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). For more on Internet Standards, check out Section 2 of RFC 5741 πΈ.
Info about the current status of this document, any errata, and how to give feedback on it lives at http://www.rfc-editor.org/info/rfc7606 π.
Copyright Notice
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, which you can find at http://trustee.ietf.org/license-info, as they stand on the date this document was published. Please actually read these, because they spell out your rights and restrictions for this document. Any Code Components pulled out of this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, as described in the Simplified BSD License π.
This document may contain material from IETF Documents or IETF Contributions that were published or made publicly available before November 10, 2008. The people who control the copyright in some of that material may not have given the IETF Trust permission to allow modifications outside the IETF Standards Process. So unless you get an adequate license from whoever controls that copyright, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process. The exceptions are formatting it for publication as an RFC or translating it into languages other than English π.
Table of Contents πΈ
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. Requirements Language . . . . . . . . . . . . . . . . . . 4
2. Error-Handling Approaches . . . . . . . . . . . . . . . . . . 5
3. Revision to BGP UPDATE Message Error Handling . . . . . . . . 5
4. Attribute Length Fields . . . . . . . . . . . . . . . . . . . 7
5. Parsing of Network Layer Reachability Information (NLRI)
Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5.1. Encoding NLRI . . . . . . . . . . . . . . . . . . . . . . 8
5.2. Missing NLRI . . . . . . . . . . . . . . . . . . . . . . 8
5.3. Syntactic Correctness of NLRI Fields . . . . . . . . . . 9
5.4. Typed NLRI . . . . . . . . . . . . . . . . . . . . . . . 9
6. Operational Considerations . . . . . . . . . . . . . . . . . 10
7. Error-Handling Procedures for Existing Attributes . . . . . . 11
7.1. ORIGIN . . . . . . . . . . . . . . . . . . . . . . . . . 11
7.2. AS_PATH . . . . . . . . . . . . . . . . . . . . . . . . . 11
7.3. NEXT_HOP . . . . . . . . . . . . . . . . . . . . . . . . 12
7.4. MULTI_EXIT_DISC . . . . . . . . . . . . . . . . . . . . . 12
7.5. LOCAL_PREF . . . . . . . . . . . . . . . . . . . . . . . 12
7.6. ATOMIC_AGGREGATE . . . . . . . . . . . . . . . . . . . . 12
7.7. AGGREGATOR . . . . . . . . . . . . . . . . . . . . . . . 13
7.8. Community . . . . . . . . . . . . . . . . . . . . . . . . 13
7.9. ORIGINATOR_ID . . . . . . . . . . . . . . . . . . . . . . 13
7.10. CLUSTER_LIST . . . . . . . . . . . . . . . . . . . . . . 13
7.11. MP_REACH_NLRI . . . . . . . . . . . . . . . . . . . . . . 14
7.12. MP_UNREACH_NLRI . . . . . . . . . . . . . . . . . . . . . 14
7.13. Traffic Engineering Path Attribute . . . . . . . . . . . 14
7.14. Extended Community . . . . . . . . . . . . . . . . . . . 14
7.15. IPv6 Address Specific BGP Extended Community Attribute . 15
7.16. ATTR_SET . . . . . . . . . . . . . . . . . . . . . . . . 15
8. Guidance for Authors of BGP Specifications . . . . . . . . . 15
9. Security Considerations . . . . . . . . . . . . . . . . . . . 16
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 17
10.1. Normative References . . . . . . . . . . . . . . . . . . 17
10.2. Informative References . . . . . . . . . . . . . . . . . 18
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 19
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 19
1. Introduction β¨
Okay, so the base BGP spec [RFC4271] says that a BGP speaker that gets an UPDATE message with a malformed attribute is required to reset the session that attribute came in on. And bestie, this is giving chaos π. A session reset hits not just the routes with the bad attribute, but also all the other valid routes on that session.
It gets even worse with optional transitive attributes π. They can be a potential security vulnerability. Here's why: attributes can get passed along without being checked by routers in the middle that don't recognize them. So the attribute basically gets tunneled. By the time it reaches a router that does check it, the session that gets reset might not even belong to the router that's actually at fault π.
And it can snowball. The problematic attribute might have started in one single UPDATE from one single BGP speaker, but by the time it reaches a router that checks it, it could have been copied many times. So one bad attribute could reset a whole pile of peering sessions. The damage gets multiplied manyfold, no cap π .
So the goal of revising UPDATE error handling is to keep a malformed UPDATE message from messing up routing as little as possible, while still keeping protocol correctness as much as we can π¦. The main trick is to keep the session up, keep the valid routes flowing, and just remove the routes carried in the malformed UPDATE from the routing system β¨.
This document partially revises error handling for UPDATE messages. It also gives guidance for authors of documents that define new attributes, and it revises error handling for a number of existing attributes. Specifically, the error handling procedures of [RFC1997], [RFC4271], [RFC4360], [RFC4456], [RFC4760], [RFC5543], [RFC5701], and [RFC6368] are revised π.
1.1. Requirements Language
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 RFC 2119 [RFC2119] π.
2. Error-Handling Approaches β¨
Okay, so this doc talks about four different approaches for handling errors in a BGP UPDATE message π«Ά. They're listed from the one with the "strongest" action to the one with the "weakest" action:
- Session reset: This is the approach used all over the base BGP spec [RFC4271]. A NOTIFICATION gets sent and the session gets terminated π.
- AFI/SAFI disable: Section 7 of [RFC4760] lets a BGP speaker that detects an error in a message for a given AFI/SAFI optionally "ignore all the subsequent routes with that AFI/SAFI received over that session." We call this "disabling a particular AFI/SAFI" or "AFI/SAFI disable" π.
- Treat-as-withdraw: In this approach, the UPDATE message containing the path attribute in question MUST be treated as though all of its contained routes had been withdrawn. That's just as if they'd been listed in the
WITHDRAWN ROUTESfield (or in theMP_UNREACH_NLRIattribute, if that's the right fit) of the UPDATE message. So they get removed from the Adj-RIB-In, following the procedures of [RFC4271] π. - Attribute discard: In this approach, the malformed attribute MUST be discarded, and the UPDATE message keeps on getting processed π§. This approach MUST NOT be used unless the attribute has no effect on route selection or installation. Careful with this one, bestie! π
3. Revision to BGP UPDATE Message Error Handling β¨
okay so this section is where we amend Section 6.3 of [RFC4271] π we're tweaking the rules here, not rewriting the whole thing. Peep Section 7 for how specific path attributes get handled.
a. The first paragraph gets a glow-up πΈ
Old Text:
All errors detected while processing the UPDATE message MUST be indicated by sending the NOTIFICATION message with the Error Code UPDATE Message Error. The error subcode elaborates on the specific nature of the error.
New Text:
An error detected while processing the UPDATE message for which a session reset is specified MUST be indicated by sending the NOTIFICATION message with the Error Code UPDATE Message Error. The error subcode elaborates on the specific nature of the error.
b. Error handling for this case stays exactly the same, no changes π bestie, here's the rule:
If the Withdrawn Routes Length or Total Attribute Length is too large (i.e., if Withdrawn Routes Length + Total Attribute Length + 23 exceeds the message Length), then the Error Subcode MUST be set to Malformed Attribute List.
c. Attribute Flag error handling is getting revised π
Old Text:
If any recognized attribute has Attribute Flags that conflict with the Attribute Type Code, then the Error Subcode MUST be set to Attribute Flags Error. The Data field MUST contain the erroneous attribute (type, length, and value).
New Text:
If the value of either the Optional or Transitive bits in the Attribute Flags is in conflict with their specified values, then the attribute MUST be treated as malformed and the "treat-as-withdraw" approach used, unless the specification for the attribute mandates different handling for incorrect Attribute Flags.
d. If any of the well-known mandatory attributes are not present in an UPDATE message, then "treat-as-withdraw" MUST be used. (Note that [RFC4760] reclassifies NEXT_HOP as what is effectively discretionary.) π§
e. "Treat-as-withdraw" MUST be used for the cases that specify a session reset and involve any of the attributes ORIGIN, AS_PATH, NEXT_HOP, MULTI_EXIT_DISC, or LOCAL_PREF. no cap, this one is important π
f. "Attribute discard" MUST be used for any of the cases that specify a session reset and involve ATOMIC_AGGREGATE or AGGREGATOR. π
g. If the MP_REACH_NLRI attribute or the MP_UNREACH_NLRI [RFC4760] attribute appears more than once in the UPDATE message, then a NOTIFICATION message MUST be sent with the Error Subcode "Malformed Attribute List". If any other attribute (whether recognized or unrecognized) appears more than once in an UPDATE message, then all the occurrences of the attribute other than the first one SHALL be discarded and the UPDATE message will continue to be processed. β¨
h. When multiple attribute errors exist in an UPDATE message, if the same approach (as described in Section 2) is specified for the handling of these malformed attributes, then the specified approach MUST be used. Otherwise, the approach with the strongest action MUST be used. it's giving "most serious wins" π
i. The Withdrawn Routes field MUST be checked for syntactic correctness in the same manner as the NLRI field. This is discussed further below and in Section 5.3. π¦
j. Finally, we observe that in order to use the approach of "treat-as-withdraw", the entire NLRI field and/or the MP_REACH_NLRI and MP_UNREACH_NLRI attributes need to be successfully parsed. What this entails is discussed in more detail in Section 5. If this is not possible, the procedures of [RFC4271] and/or [RFC4760] continue to apply, meaning that the "session reset" approach (or the "AFI/SAFI disable" approach) MUST be followed. ngl this is the big one π
4. Attribute Length Fields
there are two error cases where the Total Attribute Length can clash with the enclosed path attributes, which carry their own length values π
- In the first case, the length of the last encountered path attribute would cause the Total Attribute Length to be exceeded when parsing the enclosed path attributes.
- In the second case, fewer than three octets remain (or fewer than four octets, if the Attribute Flags field has the Extended Length bit set) when beginning to parse the attribute. That is, this case exists if there remains unconsumed data in the path attributes but yet insufficient data to encode a single minimum-sized path attribute.
In either of these cases, an error condition exists and the "treat-as-withdraw" approach MUST be used (unless some other, more severe error is encountered dictating a stronger approach), and the Total Attribute Length MUST be relied upon to enable the beginning of the NLRI field to be located. π«Ά
For all path attributes other than those specified as having an attribute length that may be zero, it SHALL be considered a syntax error for the attribute to have a length of zero. Of the path attributes considered in this specification, only AS_PATH and ATOMIC_AGGREGATE may validly have an attribute length of zero. π
5. Parsing of Network Layer Reachability Information (NLRI) Fields
5.1. Encoding NLRI
so to make it easier to figure out where the NLRI field is when an UPDATE message has a malformed attribute:
- The
MP_REACH_NLRIorMP_UNREACH_NLRIattribute (if present) SHALL be encoded as the very first path attribute in an UPDATE message. - An UPDATE message MUST NOT contain more than one of the following: non-empty Withdrawn Routes field, non-empty Network Layer Reachability Information field,
MP_REACH_NLRIattribute, andMP_UNREACH_NLRIattribute.
Since older BGP speakers may not implement these restrictions, an implementation MUST still be prepared to receive these fields in any position or combination. π
If the encoding of [RFC4271] is used, the NLRI field for the IPv4 unicast address family is carried immediately following all the attributes in an UPDATE message. When such an UPDATE message is received, we observe that the NLRI field can be determined using the Message Length, Withdrawn Route Length, and Total Attribute Length (when they are consistent) carried in the message instead of relying on the length of individual attributes in the message. π¦
5.2. Missing NLRI
[RFC4724] specifies an End-of-RIB message (EoR) that can be encoded as an UPDATE message that contains only a MP_UNREACH_NLRI attribute that encodes no NLRI (it can also be a completely empty UPDATE message in the case of the "legacy" encoding). In all other well-specified cases, an UPDATE message either carries only withdrawn routes (either in the Withdrawn Routes field or the MP_UNREACH_NLRI attribute) or it advertises reachable routes (either in the Network Layer Reachability Information field or the MP_REACH_NLRI attribute). π
So, if an UPDATE message shows up with path attributes other than MP_UNREACH_NLRI and doesn't encode any reachable NLRI, we can't be confident that the NLRI got successfully parsed like Section 3 (j) requires. π For this reason, if any path attribute errors are encountered in such an UPDATE message and if any encountered error specifies an error-handling approach other than "attribute discard", then the "session reset" approach MUST be used. π₯
5.3. Syntactic Correctness of NLRI Fields
The NLRI field or Withdrawn Routes field SHALL be considered "syntactically incorrect" if either of the following are true:
- The length of any of the included NLRI is greater than 32.
- When parsing NLRI contained in the field, the length of the last NLRI found exceeds the amount of unconsumed data remaining in the field.
Similarly, the MP_REACH_NLRI or MP_UNREACH_NLRI attribute of an update SHALL be considered to be incorrect if any of the following are true:
- The length of any of the included NLRI is inconsistent with the given AFI/SAFI (for example, if an IPv4 NLRI has a length greater than 32 or an IPv6 NLRI has a length greater than 128).
- When parsing NLRI contained in the attribute, the length of the last NLRI found exceeds the amount of unconsumed data remaining in the attribute.
- The attribute flags of the attribute are inconsistent with those specified in [RFC4760].
- The length of the
MP_UNREACH_NLRIattribute is less than 3, or the length of theMP_REACH_NLRIattribute is less than 5. π
5.4. Typed NLRI
certain address families, like MCAST-VPN [RFC6514], MCAST-VPLS [RFC7117], and EVPN [RFC7432], have NLRI that are typed. Since supported type values within the address family aren't expressed in the Multiprotocol BGP (MP-BGP) capability [RFC4760], it's possible for a BGP speaker to advertise support for the given address family and subaddress family while still not supporting a particular type of NLRI within that AFI/SAFI. π
A BGP speaker advertising support for such a typed address family MUST handle routes with unrecognized NLRI types within that address family by discarding them, unless the relevant specification for that address family specifies otherwise. periodt π
6. Operational Considerations β¨
Okay, so the "treat-as-withdraw" error handling from Section 2 is super careful about keeping BGP correct π§ , but there's a catch. If an UPDATE message gets this treatment on an Internal BGP (IBGP) session, the routing inside the Autonomous System can end up inconsistent π¬. That can lead to long-lived forwarding loops and black holes. It's lowkey lamentable, but this is expected to be rare in practice πΈ. More importantly, it's still seen as less of a problem than the session-reset behavior it replaces π«Ά.
If a malformed attribute does show up over an IBGP session, we recommend a little detective work π΅οΈββοΈ. Find the routes with the malformed attribute, trace them back to the ingress router where they were sourced or received from outside, and then put a filter on that ingress router so those routes aren't sourced or received. This helps keep the network's routing consistent π.
Even when inconsistent routing doesn't happen, "treat-as-withdraw" can still cause complete unreachability or suboptimal routing for the destinations carried in the affected UPDATE message π.
Heads up: "treat-as-withdraw" is NOT the same thing as discarding an UPDATE message π ββοΈ. Discarding breaks the basic BGP principle of incremental updates and could leave invalid routes hanging around π.
Because of all these potential issues, a BGP speaker must provide debugging facilities so problems caused by a malformed attribute can be diagnosed π. At a minimum, those facilities must include logging an error that lists the NLRI involved and contains the entire malformed UPDATE message when such an attribute is detected π. The malformed UPDATE message should be analyzed, and the root cause should be investigated π.
Section 8 says that "attribute discard" should not be used in cases where "the attribute in question has or may have an effect on route selection." π€ Now, not every case in this document that specifies "attribute discard" affects route selection by default. But in principle, routing policies could be written that do affect selection based on such an attribute π. So operators should be careful when writing those policies and think through the possible consequences of an attribute discard π§. As long as these policies only get applied to external BGP sessions, correctness issues aren't expected to show up π¦.
7. Error-Handling Procedures for Existing Attributes π
In the subsections that follow, we dig into the conditions for error-checking the various path attributes and spell out which approach(es) should be used to handle malformations π . Implementations might apply other error checks that aren't covered here π€·ββοΈ. If they do, the error-handling approach given here should generally still be applied π«Ά.
This section covers every path attribute that's defined as of this writing, that wasn't defined with error handling consistent with Section 8, and that isn't marked as "deprecated" in the "BGP Path Attributes" registry [IANA-BGP-ATTRS] π. Attributes 17 (AS4_PATH), 18 (AS4_AGGREGATOR), 22 (PMSI_TUNNEL), 23 (Tunnel Encapsulation Attribute), 26 (AIGP), 27 (PE Distinguisher Labels), and 29 (BGP-LS Attribute) already have error handling consistent with Section 8, so we won't talk about them further here π. Attributes 11 (DPA), 12 (ADVERTISER), 13 (RCID_PATH / CLUSTER_ID), 19 (SAFI Specific Attribute), 20 (Connector Attribute), 21 (AS_PATHLIMIT), and 28 (BGP Entropy Label Capability Attribute) are deprecated, so they're also out of scope π₯.
7.1. ORIGIN π
The attribute is considered malformed if its length is not 1 or if it has an undefined value [RFC4271] π.
An UPDATE message with a malformed ORIGIN attribute SHALL be handled using the approach of "treat-as-withdraw" π.
7.2. AS_PATH π€οΈ
An AS_PATH is considered malformed if an unrecognized segment type is encountered or if it contains a malformed segment π«. A segment is considered malformed if any of the following are true:
- There is an overrun where the Path Segment Length field of the last segment encountered would cause the Attribute Length to be exceeded.
- There is an underrun where after the last successfully parsed segment there is only a single octet remaining (that is, there is not enough unconsumed data to provide even an empty segment header).
- It has a Path Segment Length field of zero.
An UPDATE message with a malformed AS_PATH attribute SHALL be handled using the approach of "treat-as-withdraw" π.
[RFC4271] also says that an implementation optionally "MAY check whether the leftmost ... AS in the AS_PATH attribute is equal to the autonomous system number of the peer that sent the message". π§ A BGP implementation SHOULD also handle routes that violate this check using "treat-as-withdraw", but MAY follow the "session reset" behavior if configured to do so βοΈ.
7.3. NEXT_HOP π
The attribute is considered malformed if its length is not 4 [RFC4271] π.
An UPDATE message with a malformed NEXT_HOP attribute SHALL be handled using the approach of "treat-as-withdraw" π.
7.4. MULTI_EXIT_DISC πͺ
The attribute is considered malformed if its length is not 4 [RFC4271] π.
An UPDATE message with a malformed MULTI_EXIT_DISC attribute SHALL be handled using the approach of "treat-as-withdraw" π.
7.5. LOCAL_PREF β
The error handling of [RFC4271] gets a glow-up here π . It's revised as follows:
- If the
LOCAL_PREFattribute is received from an external neighbor, it SHALL be discarded using the approach of "attribute discard"; or - If it's received from an internal neighbor, it SHALL be considered malformed if its length is not equal to 4. If malformed, the UPDATE message SHALL be handled using the approach of "treat-as-withdraw".
7.6. ATOMIC_AGGREGATE βοΈ
The attribute SHALL be considered malformed if its length is not 0 [RFC4271] π.
An UPDATE message with a malformed ATOMIC_AGGREGATE attribute SHALL be handled using the approach of "attribute discard" ποΈ.
7.7. AGGREGATOR π§Ί
The error conditions that [RFC4271] specifies for this attribute are revised as follows π:
The AGGREGATOR attribute SHALL be considered malformed if any of the following applies:
- Its length is not 6 (when the 4-octet AS number capability is not advertised to or not received from the peer [RFC6793]).
- Its length is not 8 (when the 4-octet AS number capability is both advertised to and received from the peer).
An UPDATE message with a malformed AGGREGATOR attribute SHALL be handled using the approach of "attribute discard" ποΈ.
7.8. Community π·οΈ
The error handling of [RFC1997] is revised as follows π:
- The Community attribute SHALL be considered malformed if its length is not a non-zero multiple of 4.
- An UPDATE message with a malformed Community attribute SHALL be handled using the approach of "treat-as-withdraw" π.
7.9. ORIGINATOR_ID π
The error handling of [RFC4456] is revised as follows πΈ:
- If the
ORIGINATOR_IDattribute is received from an external neighbor, it SHALL be discarded using the approach of "attribute discard"; or - If it's received from an internal neighbor, it SHALL be considered malformed if its length is not equal to 4. If malformed, the UPDATE message SHALL be handled using the approach of "treat-as-withdraw".
7.10. CLUSTER_LIST π
The error handling of [RFC4456] is revised as follows π«§:
- If the
CLUSTER_LISTattribute is received from an external neighbor, it SHALL be discarded using the approach of "attribute discard"; or - If it's received from an internal neighbor, it SHALL be considered malformed if its length is not a non-zero multiple of 4. If malformed, the UPDATE message SHALL be handled using the approach of "treat-as-withdraw".
7.11. MP_REACH_NLRI π
If the Length of Next Hop Network Address field of the MP_REACH attribute is inconsistent with what was expected, the attribute is considered malformed π¨. Since the next hop comes before the NLRI field in the attribute, in this case it won't be possible to reliably locate the NLRI π΅. So the "session reset" or "AFI/SAFI disable" approach MUST be used π₯.
"That which was expected" is a little vague, sure π. But it's meant to cover the next hop specified for the Address Family Identifier and Subsequent Address Family Identifier fields, and it can be modified by any extensions in use π§©. For example, if [RFC5549] is in use, then the next hop would have to have a length of 4 or 16 π.
Sections 3 and 5 give more discussion on how this attribute gets handled π.
7.12. MP_UNREACH_NLRI π
Sections 3 and 5 discuss how this attribute gets handled π.
7.13. Traffic Engineering Path Attribute π¦
Here's the tea β: [RFC5543] doesn't spell out what counts as "malformation" for the Traffic Engineering path attribute π« . A future update to that specification might give more guidance. Until then, an implementation that determines (for whatever reason) that an UPDATE message contains a malformed Traffic Engineering path attribute MUST handle it using the approach of "treat-as-withdraw" π.
7.14. Extended Community π
The error handling of [RFC4360] is revised as follows π :
- The Extended Community attribute SHALL be considered malformed if its length is not a non-zero multiple of 8.
- An UPDATE message with a malformed Extended Community attribute SHALL be handled using the approach of "treat-as-withdraw" π.
Note that a BGP speaker MUST NOT treat an unrecognized Extended Community Type or Sub-Type as an error π ββοΈ. Not an error, bestie π«Ά.
7.15. IPv6 Address Specific BGP Extended Community Attribute π¦
The error handling of [RFC5701] is revised as follows β¨:
- The IPv6 Address Specific Extended Community attribute SHALL be considered malformed if its length is not a non-zero multiple of 20.
- An UPDATE message with a malformed IPv6 Address Specific Extended Community attribute SHALL be handled using the approach of "treat-as-withdraw" π.
Note that a BGP speaker MUST NOT treat an unrecognized IPv6 Address Specific Extended Community Type or Sub-Type as an error π ββοΈ.
7.16. ATTR_SET π§
The final paragraph of Section 5 of [RFC6368] is revised as follows π. Here's the old text and the new text, side by side:
Old Text:
An UPDATE message with a malformed ATTR_SET attribute SHALL be
handled as follows. If its Partial flag is set and its
Neighbor-Complete flag is clear, the UPDATE message is treated
as a route withdraw as discussed in [OPT-TRANS-BGP]. Otherwise
(i.e., Partial flag is clear or Neighbor-Complete is set), the
procedures of the BGP-4 base specification [RFC4271] MUST be
followed with respect to an Optional Attribute Error.
New Text:
An UPDATE message with a malformed ATTR_SET attribute SHALL be
handled using the approach of "treat as withdraw".
Furthermore, the normative reference to [OPT-TRANS-BGP] in [RFC6368] is removed ποΈ. Bye bye, reference π.
8. Guidance for Authors of BGP Specifications β¨
okay bestie, listen up π«Ά if you're writing a brand new BGP attribute, you MUST spell out exactly what counts as an error for it and how that error gets handled π the allowed handling approaches are in Section 2, and honestly "treat-as-withdraw" is the vibe everyone should be going for, while "session reset" is a big no-no π ββοΈ also, authors please go back and reread the optional transitive attributes bit in the first paragraph of the Introduction π and your doc SHOULD consider what debugging tools might be needed so people can actually figure out problems caused by a malformed attribute π
now the tea β if a malformed attribute gets handled with "attribute discard" instead of "treat-as-withdraw", you have to think really hard about what that does π if the attribute affects route selection or installation, the default assumption is that discarding it is UNSAFE unless someone does careful analysis that proves otherwise π that analysis should weigh keeping connectivity alive against the possible side effects π§
Section 7 has examples if you need inspo πΈ
9. Security Considerations π
okay this part is SERIOUS bestie, no cap π€ this spec is about a sneaky attack where a faraway attacker creates a malformed optional transitive attribute π the routers in the middle don't recognize it, so they just pass it along without checking anything π then when it finally reaches a router that DOES recognize that attribute type, that router resets the session it came in on π± and since there can be a LOT of fan-out between the attacker and those routers, this attack could be seriously harmful π
the improved error handling here could, in theory, clash with some weaker crypto mechanisms if BGP ever gets secured with them in the future π§ͺ like, imagine a (fictional) mechanism with no data integrity π an attacker could mess with the ciphertext and watch how the receiver reacts, trying to change things or learn stuff ποΈ without this spec, the BGP session would've just been terminated, but with this spec the attacker could try potentially many times π¬ nobody is defining a confidentiality-only mechanism like that today, but we HAVE seen mechanism definitions with similar (though less obviously exploitable) problems [RFC7366] π« the move today is to prefer Authenticated Encryption with Additional Data (AEAD) ciphers [RFC5116] so that messages that don't verify get thrown out ποΈ
otherwise, this spec doesn't change BGP's security characteristics at all π¦
10. References π
10.1. Normative References π
[IANA-BGP-ATTRS]IANA, "BGP Path Attributes", <http://www.iana.org/assignments/bgp-parameters>.[RFC1997]Chandra, R., Traina, P., and T. Li, "BGP Communities Attribute", RFC 1997, DOI 10.17487/RFC1997, August 1996, <http://www.rfc-editor.org/info/rfc1997>.[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>.[RFC4271]Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A Border Gateway Protocol 4 (BGP-4)", RFC 4271, DOI 10.17487/RFC4271, January 2006, <http://www.rfc-editor.org/info/rfc4271>.[RFC4360]Sangli, S., Tappan, D., and Y. Rekhter, "BGP Extended Communities Attribute", RFC 4360, DOI 10.17487/RFC4360, February 2006, <http://www.rfc-editor.org/info/rfc4360>.[RFC4456]Bates, T., Chen, E., and R. Chandra, "BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP)", RFC 4456, DOI 10.17487/RFC4456, April 2006, <http://www.rfc-editor.org/info/rfc4456>.[RFC4724]Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, DOI 10.17487/RFC4724, January 2007, <http://www.rfc-editor.org/info/rfc4724>.[RFC4760]Bates, T., Chandra, R., Katz, D., and Y. Rekhter, "Multiprotocol Extensions for BGP-4", RFC 4760, DOI 10.17487/RFC4760, January 2007, <http://www.rfc-editor.org/info/rfc4760>.[RFC5543]Ould-Brahim, H., Fedyk, D., and Y. Rekhter, "BGP Traffic Engineering Attribute", RFC 5543, DOI 10.17487/RFC5543, May 2009, <http://www.rfc-editor.org/info/rfc5543>.[RFC5701]Rekhter, Y., "IPv6 Address Specific BGP Extended Community Attribute", RFC 5701, DOI 10.17487/RFC5701, November 2009, <http://www.rfc-editor.org/info/rfc5701>.[RFC6368]Marques, P., Raszuk, R., Patel, K., Kumaki, K., and T. Yamagata, "Internal BGP as the Provider/Customer Edge Protocol for BGP/MPLS IP Virtual Private Networks (VPNs)", RFC 6368, DOI 10.17487/RFC6368, September 2011, <http://www.rfc-editor.org/info/rfc6368>.[RFC6793]Vohra, Q. and E. Chen, "BGP Support for Four-Octet Autonomous System (AS) Number Space", RFC 6793, DOI 10.17487/RFC6793, December 2012, <http://www.rfc-editor.org/info/rfc6793>.
10.2. Informative References π¦
[RFC5116]McGrew, D., "An Interface and Algorithms for Authenticated Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, <http://www.rfc-editor.org/info/rfc5116>.[RFC5549]Le Faucheur, F. and E. Rosen, "Advertising IPv4 Network Layer Reachability Information with an IPv6 Next Hop", RFC 5549, DOI 10.17487/RFC5549, May 2009, <http://www.rfc-editor.org/info/rfc5549>.[RFC6514]Aggarwal, R., Rosen, E., Morin, T., and Y. Rekhter, "BGP Encodings and Procedures for Multicast in MPLS/BGP IP VPNs", RFC 6514, DOI 10.17487/RFC6514, February 2012, <http://www.rfc-editor.org/info/rfc6514>.[RFC7117]Aggarwal, R., Ed., Kamite, Y., Fang, L., Rekhter, Y., and C. Kodeboniya, "Multicast in Virtual Private LAN Service (VPLS)", RFC 7117, DOI 10.17487/RFC7117, February 2014, <http://www.rfc-editor.org/info/rfc7117>.[RFC7366]Gutmann, P., "Encrypt-then-MAC for Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)", RFC 7366, DOI 10.17487/RFC7366, September 2014, <http://www.rfc-editor.org/info/rfc7366>.[RFC7432]Sajassi, A., Ed., Aggarwal, R., Bitar, N., Isaac, A., Uttaro, J., Drake, J., and W. Henderickx, "BGP MPLS-Based Ethernet VPN", RFC 7432, DOI 10.17487/RFC7432, February 2015, <http://www.rfc-editor.org/info/rfc7432>.
Acknowledgements π«Ά
the authors want to thank Juan Alcaide, Deniz Bahadir, Ron Bonica, Mach Chen, Andy Davidson, Bruno Decraene, Stephen Farrell, Rex Fernando, Jeff Haas, Chris Hall, Joel Halpern, Dong Jie, Akira Kato, Miya Kohno, Warren Kumari, Tony Li, Alton Lo, Shin Miyakawa, Tamas Mondal, Jonathan Oddy, Tony Przygienda, Robert Raszuk, Yakov Rekhter, Eric Rosen, Shyam Sethuram, Rob Shakir, Naiming Shen, Adam Simpson, Ananth Suryanarayana, Kaliraj Vairavakkalai, Lili Wang, and Ondrej Zajicek for their observations, discussion, and review of this document πβ¨
Authors' Addresses π
Enke Chen (editor) Cisco Systems, Inc.
Email: enkechen@cisco.com
John G. Scudder (editor) Juniper Networks
Email: jgs@juniper.net
Pradosh Mohapatra Sproute Networks
Email: mpradosh@yahoo.com
Keyur Patel Cisco Systems, Inc.
Email: keyupate@cisco.com π
π¦ where this page comes from
- ietf: rfc7606 2015-08
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms