--- 1/draft-ietf-idr-error-handling-11.txt 2014-06-11 16:14:25.078768545 -0700 +++ 2/draft-ietf-idr-error-handling-12.txt 2014-06-11 16:14:25.114769424 -0700 @@ -1,23 +1,23 @@ Internet Engineering Task Force E. Chen, Ed. Internet-Draft Cisco Systems, Inc. Updates: 1997, 4271, 4360, 4456, 4760, J. Scudder, Ed. - 5701 (if approved) Juniper Networks -Intended status: Standards Track P. Mohapatra -Expires: December 5, 2014 Sproute Networks - K. Patel + 5543, 5701, 6368, 6790 (if Juniper Networks + approved) P. Mohapatra +Intended status: Standards Track Sproute Networks +Expires: December 13, 2014 K. Patel Cisco Systems, Inc. - June 3, 2014 + June 11, 2014 Revised Error Handling for BGP UPDATE Messages - draft-ietf-idr-error-handling-11 + draft-ietf-idr-error-handling-12 Abstract According to the base BGP specification, a BGP speaker that receives an UPDATE message containing a malformed attribute is required to reset the session over which the offending attribute was received. This behavior is undesirable as a session reset would impact not only routes with the offending attribute, but also other valid routes exchanged over the session. This document partially revises the error handling for UPDATE messages, and provides guidelines for the @@ -35,21 +35,21 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on December 5, 2014. + This Internet-Draft will expire on December 13, 2014. Copyright Notice Copyright (c) 2014 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 @@ -80,39 +80,43 @@ 4. Attribute Length Fields . . . . . . . . . . . . . . . . . . . 6 5. Parsing of NLRI Fields . . . . . . . . . . . . . . . . . . . 7 5.1. Encoding NLRI . . . . . . . . . . . . . . . . . . . . . . 7 5.2. Missing NLRI . . . . . . . . . . . . . . . . . . . . . . 7 5.3. Syntactic Correctness of NLRI Fields . . . . . . . . . . 8 5.4. Typed NLRI . . . . . . . . . . . . . . . . . . . . . . . 8 6. Operational Considerations . . . . . . . . . . . . . . . . . 9 7. Error Handling Procedures for Existing Attributes . . . . . . 9 7.1. ORIGIN . . . . . . . . . . . . . . . . . . . . . . . . . 10 7.2. AS_PATH . . . . . . . . . . . . . . . . . . . . . . . . . 10 - 7.3. NEXT_HOP . . . . . . . . . . . . . . . . . . . . . . . . 10 + 7.3. NEXT_HOP . . . . . . . . . . . . . . . . . . . . . . . . 11 7.4. MULTI_EXIT_DISC . . . . . . . . . . . . . . . . . . . . . 11 7.5. LOCAL_PREF . . . . . . . . . . . . . . . . . . . . . . . 11 7.6. ATOMIC_AGGREGATE . . . . . . . . . . . . . . . . . . . . 11 - 7.7. AGGREGATOR . . . . . . . . . . . . . . . . . . . . . . . 11 + 7.7. AGGREGATOR . . . . . . . . . . . . . . . . . . . . . . . 12 7.8. Community . . . . . . . . . . . . . . . . . . . . . . . . 12 - 7.9. Extended Community . . . . . . . . . . . . . . . . . . . 12 - 7.10. IPv6 Address Specific BGP Extended Community Attribute . 12 - 7.11. ORIGINATOR_ID . . . . . . . . . . . . . . . . . . . . . . 12 - 7.12. CLUSTER_LIST . . . . . . . . . . . . . . . . . . . . . . 13 - 7.13. MP_REACH_NLRI and MP_UNREACH_NLRI . . . . . . . . . . . . 13 - 8. Guidance for Authors of BGP Specifications . . . . . . . . . 13 - 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 - 10. Security Considerations . . . . . . . . . . . . . . . . . . . 13 - 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 14 - 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 14 - 12.1. Normative References . . . . . . . . . . . . . . . . . . 14 - 12.2. Informative References . . . . . . . . . . . . . . . . . 15 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 15 + 7.9. ORIGINATOR_ID . . . . . . . . . . . . . . . . . . . . . . 12 + 7.10. CLUSTER_LIST . . . . . . . . . . . . . . . . . . . . . . 12 + 7.11. MP_REACH_NLRI . . . . . . . . . . . . . . . . . . . . . . 13 + 7.12. MP_UNREACH_NLRI . . . . . . . . . . . . . . . . . . . . . 13 + 7.13. Traffic Engineering path attribute . . . . . . . . . . . 13 + 7.14. Extended Community . . . . . . . . . . . . . . . . . . . 14 + 7.15. IPv6 Address Specific BGP Extended Community Attribute . 14 + 7.16. BGP Entropy Label Capability Attribute . . . . . . . . . 14 + 7.17. ATTR_SET . . . . . . . . . . . . . . . . . . . . . . . . 14 + 8. Guidance for Authors of BGP Specifications . . . . . . . . . 15 + 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 + 10. Security Considerations . . . . . . . . . . . . . . . . . . . 15 + 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 16 + 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 + 12.1. Normative References . . . . . . . . . . . . . . . . . . 16 + 12.2. Informative References . . . . . . . . . . . . . . . . . 17 + Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17 1. Introduction According to the base BGP specification [RFC4271], a BGP speaker that receives an UPDATE message containing a malformed attribute is required to reset the session over which the offending attribute was received. This behavior is undesirable as a session reset would impact not only routes with the offending attribute, but also other valid routes exchanged over the session. In the case of optional transitive attributes, the behavior is especially troublesome and may @@ -183,21 +187,21 @@ a. The first paragraph is revised as follows: 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: + 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 the following case remains unchanged: If the Withdrawn Routes Length or Total Attribute Length is @@ -419,20 +423,32 @@ 7. Error Handling Procedures for Existing Attributes In the following subsections, we elaborate on the conditions for error-checking various path attributes, and specify what approach(es) should be used to handle malformations. It is possible that implementations may apply other error checks not contemplated here. If so, the error handling approach given here should generally be applied. + This section addresses all path attributes that are defined at the + time of this writing, that were not defined with error-handling + consistent with Section 8, and that are not marked as "deprecated" in + [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) do have error- + handling consistent with Section 8 and thus are not further discussed + herein. Attributes 11 (DPA), 12 (ADVERTISER), 13 (RCID_PATH / + CLUSTER_ID), 19 (SAFI Specific Attribute), 20 (Connector Attribute) + and 21 (AS_PATHLIMIT) are deprecated and thus are not further + discussed herein. + 7.1. ORIGIN The attribute is considered malformed if its length is not 1, or 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 @@ -456,22 +472,32 @@ [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 it is syntactically - incorrect according to [RFC4271]. + According to [RFC4271] the attribute is considered malformed if it is + syntactically incorrect. To quote from that document, "Syntactic + correctness means that the NEXT_HOP attribute represents a valid IP + host address", but it does not go on to define what it means to be a + "valid IP host address". Therefore: + + An IP host address SHOULD be considered invalid if it appears in the + "IANA IPv4 Special-Purpose Address Registry" [IANA-IPV4] and either + the "destination" or the "forwardable" boolean in that registry is + given as "false". An implementation MAY provide a means to modify + the list of invalid host addresses by configuration -- these are + sometimes referred to as "Martians". 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 @@ -517,96 +543,166 @@ 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 nonzero multiple of 4. An UPDATE message with a malformed Community attribute SHALL be handled using the approach of "treat-as-withdraw". -7.9. Extended Community +7.9. ORIGINATOR_ID + + The error handling of [RFC4456] is revised as follows. + + o If the ORIGINATOR_ID attribute is received from an external + neighbor, it SHALL be discarded using the approach of "attribute + discard", or + + o if received from an internal neighbor, it SHALL be considered + malformed if its length is not equal to 4. If malformed, the + UPDATE SHALL be handled using the approach of "treat-as-withdraw". + +7.10. CLUSTER_LIST + + The error handling of [RFC4456] is revised as follows. + + o If the CLUSTER_LIST attribute is received from an external + neighbor, it SHALL be discarded using the approach of "attribute + discard", or + + o if received from an internal neighbor, it SHALL be considered + malformed if its length is not a nonzero multiple of 4. If + malformed, the UPDATE SHALL be handled using the approach of + "treat-as-withdraw". + +7.11. MP_REACH_NLRI + + [RFC4760] references the error-handling of the base BGP specification + for validation of the next hop. ("The rules for the next hop + information are the same as the rules for the information carried in + the NEXT_HOP BGP attribute".) Thus just as in Section 7.3 we must + consider what it means for the Next Hop field of the MP_REACH + attribute to be a "valid host address": + + o If the Next Hop field is an IPv4 address, it SHOULD be considered + invalid if it appears in the "IANA IPv4 Special-Purpose Address + Registry" [IANA-IPV4] and either the "destination" or the + "forwardable" boolean in that registry is given as "false". + + o If the Next Hop field is an IPv6 address, it SHOULD be considered + invalid if it appears in the "IANA IPv6 Special-Purpose Address + Registry" [IANA-IPV6] and either the "destination" or the + "forwardable" boolean in that registry is given as "false". + + o If the Next Hop field is some other form of address, it should be + considered invalid in circumstances analogous to the above -- if + it is found in the relevant IANA special-purpose address registry + (if any) and its "destination" or "forwardable" boolean is given + as "false". + + o An implementation MAY provide a means to modify the list of + invalid host addresses by configuration -- these are sometimes + referred to as "Martians". + + Section 3 and Section 5 provide further discussion of the handling of + this attribute. + +7.12. MP_UNREACH_NLRI + + Section 3 and Section 5 discuss the handling of this attribute. + +7.13. Traffic Engineering path attribute + + The error handling of [RFC5543] is revised as follows. + + TBD + +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 nonzero 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. -7.10. IPv6 Address Specific BGP Extended Community Attribute +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 nonzero 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.11. ORIGINATOR_ID +7.16. BGP Entropy Label Capability Attribute - The error handling of [RFC4456] is revised as follows. + The error handling of [RFC6790] is revised as follows. - o If the ORIGINATOR_ID attribute is received from an external - neighbor, it SHALL be discarded using the approach of "attribute - discard", or + No syntax errors are defined for the Entropy Label Capability + attribute (ELCA). However, if any implementation does for some local + reason determine that a syntax error exists with the ELCA, the error + SHALL be handled using the approach of "attribute discard". - o if received from an internal neighbor, it SHALL be considered - malformed if its length is not equal to 4. If malformed, the - UPDATE SHALL be handled using the approach of "treat-as-withdraw". +7.17. ATTR_SET -7.12. CLUSTER_LIST + The final paragraph of Section 5 of [RFC6368] is revised as follows: - The error handling of [RFC4456] is revised as follows. + Old Text: - o If the CLUSTER_LIST attribute is received from an external - neighbor, it SHALL be discarded using the approach of "attribute - discard", or + 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 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. - o if received from an internal neighbor, it SHALL be considered - malformed if its length is not a nonzero multiple of 4. If - malformed, the UPDATE SHALL be handled using the approach of - "treat-as-withdraw". + New Text: -7.13. MP_REACH_NLRI and MP_UNREACH_NLRI + An UPDATE message with a malformed ATTR_SET attribute SHALL be + handled using the approach of "treat as withdraw". - The handling of these attributes is discussed in Section 3 and - Section 5. + Furthermore, the normative reference to [OPT-TRANS-BGP] in [RFC6368] + is removed. 8. Guidance for Authors of BGP Specifications A document that specifies a new BGP attribute MUST provide specifics regarding what constitutes an error for that attribute and how that error is to be handled. Allowable error-handling approaches are detailed in Section 2. The treat-as-withdraw approach is generally preferred. The document SHOULD also provide consideration of what debugging facilities may be required to permit issues caused by a malformed attribute to be diagnosed. For any malformed attribute that is handled by the "attribute discard" instead of the "treat-as-withdraw" approach, it is critical to consider the potential impact of doing so. In particular, if the attribute in question has or may have an effect on route selection or installation, the presumption is that discarding it is unsafe, unless careful analysis proves otherwise. The analysis should take into account the tradeoff between preserving connectivity and potential side effects. + Authors can refer to Section 7 for examples. + 9. IANA Considerations This document makes no request of IANA. 10. Security Considerations This specification addresses the vulnerability of a BGP speaker to a potential attack whereby a distant attacker can generate a malformed optional transitive attribute that is not recognized by intervening routers (which thus propagate the attribute unchecked) but that @@ -624,20 +720,34 @@ 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 and discussion of this topic, and review of this document. 12. References 12.1. Normative References + [IANA-BGP-ATTRS] + "BGP Path Attributes", . + + [IANA-IPV4] + "IANA IPv4 Special-Purpose Address Registry", + . + + [IANA-IPV6] + "IANA IPv4 Special-Purpose Address Registry", + . + [RFC1997] Chandrasekeran, R., Traina, P., and T. Li, "BGP Communities Attribute", RFC 1997, August 1996. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC4271] Rekhter, Y., Li, T., and S. Hares, "A Border Gateway Protocol 4 (BGP-4)", RFC 4271, January 2006. [RFC4360] Sangli, S., Tappan, D., and Y. Rekhter, "BGP Extended @@ -648,23 +758,35 @@ (IBGP)", RFC 4456, April 2006. [RFC4724] Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, January 2007. [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, "Multiprotocol Extensions for BGP-4", RFC 4760, January 2007. + [RFC5543] Ould-Brahim, H., Fedyk, D., and Y. Rekhter, "BGP Traffic + Engineering Attribute", RFC 5543, May 2009. + [RFC5701] Rekhter, Y., "IPv6 Address Specific BGP Extended Community Attribute", RFC 5701, November 2009. + [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, September 2011. + + [RFC6790] Kompella, K., Drake, J., Amante, S., Henderickx, W., and + L. Yong, "The Use of Entropy Labels in MPLS Forwarding", + RFC 6790, November 2012. + [RFC6793] Vohra, Q. and E. Chen, "BGP Support for Four-Octet Autonomous System (AS) Number Space", RFC 6793, December 2012. 12.2. Informative References [I-D.ietf-l2vpn-evpn] Sajassi, A., Aggarwal, R., Bitar, N., Isaac, A., and J. Uttaro, "BGP MPLS Based Ethernet VPN", draft-ietf-l2vpn- evpn-07 (work in progress), May 2014.