idnits 2.17.1 draft-ietf-idr-error-handling-15.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document updates RFC4360, but the abstract doesn't seem to mention this, which it should. -- The draft header indicates that this document updates RFC4760, but the abstract doesn't seem to mention this, which it should. -- The draft header indicates that this document updates RFC1997, but the abstract doesn't seem to mention this, which it should. -- The draft header indicates that this document updates RFC4456, but the abstract doesn't seem to mention this, which it should. -- The draft header indicates that this document updates RFC4271, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC1997, updated by this document, for RFC5378 checks: 1996-04-10) -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 24, 2014) is 3471 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'OPT-TRANS-BGP' is mentioned on line 655, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'IANA-BGP-ATTRS' -- Obsolete informational reference (is this intentional?): RFC 5549 (Obsoleted by RFC 8950) Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 9 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force E. Chen, Ed. 3 Internet-Draft Cisco Systems, Inc. 4 Updates: 1997, 4271, 4360, 4456, 4760, J. Scudder, Ed. 5 5543, 5701, 6368 (if approved) Juniper Networks 6 Intended status: Standards Track P. Mohapatra 7 Expires: April 27, 2015 Sproute Networks 8 K. Patel 9 Cisco Systems, Inc. 10 October 24, 2014 12 Revised Error Handling for BGP UPDATE Messages 13 draft-ietf-idr-error-handling-15 15 Abstract 17 According to the base BGP specification, a BGP speaker that receives 18 an UPDATE message containing a malformed attribute is required to 19 reset the session over which the offending attribute was received. 20 This behavior is undesirable as a session reset would impact not only 21 routes with the offending attribute, but also other valid routes 22 exchanged over the session. This document partially revises the 23 error handling for UPDATE messages, and provides guidelines for the 24 authors of documents defining new attributes. Finally, it revises 25 the error handling procedures for a number of existing attributes. 27 This document updates error handling for RFCs 1997, 4271, 4360, 4456, 28 4760, 5543, 5701 and 6368. 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at http://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on April 27, 2015. 47 Copyright Notice 49 Copyright (c) 2014 IETF Trust and the persons identified as the 50 document authors. All rights reserved. 52 This document is subject to BCP 78 and the IETF Trust's Legal 53 Provisions Relating to IETF Documents 54 (http://trustee.ietf.org/license-info) in effect on the date of 55 publication of this document. Please review these documents 56 carefully, as they describe your rights and restrictions with respect 57 to this document. Code Components extracted from this document must 58 include Simplified BSD License text as described in Section 4.e of 59 the Trust Legal Provisions and are provided without warranty as 60 described in the Simplified BSD License. 62 This document may contain material from IETF Documents or IETF 63 Contributions published or made publicly available before November 64 10, 2008. The person(s) controlling the copyright in some of this 65 material may not have granted the IETF Trust the right to allow 66 modifications of such material outside the IETF Standards Process. 67 Without obtaining an adequate license from the person(s) controlling 68 the copyright in such materials, this document may not be modified 69 outside the IETF Standards Process, and derivative works of it may 70 not be created outside the IETF Standards Process, except to format 71 it for publication as an RFC or to translate it into languages other 72 than English. 74 Table of Contents 76 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 77 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 4 78 2. Error-Handling Approaches . . . . . . . . . . . . . . . . . . 4 79 3. Revision to BGP UPDATE Message Error Handling . . . . . . . . 4 80 4. Attribute Length Fields . . . . . . . . . . . . . . . . . . . 6 81 5. Parsing of NLRI Fields . . . . . . . . . . . . . . . . . . . 7 82 5.1. Encoding NLRI . . . . . . . . . . . . . . . . . . . . . . 7 83 5.2. Missing NLRI . . . . . . . . . . . . . . . . . . . . . . 7 84 5.3. Syntactic Correctness of NLRI Fields . . . . . . . . . . 8 85 5.4. Typed NLRI . . . . . . . . . . . . . . . . . . . . . . . 8 86 6. Operational Considerations . . . . . . . . . . . . . . . . . 9 87 7. Error Handling Procedures for Existing Attributes . . . . . . 10 88 7.1. ORIGIN . . . . . . . . . . . . . . . . . . . . . . . . . 10 89 7.2. AS_PATH . . . . . . . . . . . . . . . . . . . . . . . . . 10 90 7.3. NEXT_HOP . . . . . . . . . . . . . . . . . . . . . . . . 11 91 7.4. MULTI_EXIT_DISC . . . . . . . . . . . . . . . . . . . . . 11 92 7.5. LOCAL_PREF . . . . . . . . . . . . . . . . . . . . . . . 11 93 7.6. ATOMIC_AGGREGATE . . . . . . . . . . . . . . . . . . . . 11 94 7.7. AGGREGATOR . . . . . . . . . . . . . . . . . . . . . . . 12 95 7.8. Community . . . . . . . . . . . . . . . . . . . . . . . . 12 96 7.9. ORIGINATOR_ID . . . . . . . . . . . . . . . . . . . . . . 12 97 7.10. CLUSTER_LIST . . . . . . . . . . . . . . . . . . . . . . 12 98 7.11. MP_REACH_NLRI . . . . . . . . . . . . . . . . . . . . . . 13 99 7.12. MP_UNREACH_NLRI . . . . . . . . . . . . . . . . . . . . . 13 100 7.13. Traffic Engineering path attribute . . . . . . . . . . . 13 101 7.14. Extended Community . . . . . . . . . . . . . . . . . . . 13 102 7.15. IPv6 Address Specific BGP Extended Community Attribute . 14 103 7.16. ATTR_SET . . . . . . . . . . . . . . . . . . . . . . . . 14 104 8. Guidance for Authors of BGP Specifications . . . . . . . . . 14 105 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 106 10. Security Considerations . . . . . . . . . . . . . . . . . . . 15 107 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 15 108 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 15 109 12.1. Normative References . . . . . . . . . . . . . . . . . . 16 110 12.2. Informative References . . . . . . . . . . . . . . . . . 17 111 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17 113 1. Introduction 115 According to the base BGP specification [RFC4271], a BGP speaker that 116 receives an UPDATE message containing a malformed attribute is 117 required to reset the session over which the offending attribute was 118 received. This behavior is undesirable as a session reset would 119 impact not only routes with the offending attribute, but also other 120 valid routes exchanged over the session. In the case of optional 121 transitive attributes, the behavior is especially troublesome and may 122 present a potential security vulnerability. The reason is that such 123 attributes may have been propagated without being checked by 124 intermediate routers that do not recognize the attributes -- in 125 effect the attribute may have been tunneled, and when they do reach a 126 router that recognizes and checks them, the session that is reset may 127 not be associated with the router that is at fault. To make matters 128 worse, in such cases although the problematic attributes may have 129 originated with a single update transmitted by a single BGP speaker, 130 by the time they encounter a router that checks them they may have 131 been replicated many times, and thus may cause the reset of many 132 peering sessions. Thus the damage inflicted may be multiplied 133 manyfold. 135 The goal for revising the error handling for UPDATE messages is to 136 minimize the impact on routing by a malformed UPDATE message, while 137 maintaining protocol correctness to the extent possible. This can be 138 achieved largely by maintaining the established session and keeping 139 the valid routes exchanged, but removing the routes carried in the 140 malformed UPDATE from the routing system. 142 This document partially revises the error handling for UPDATE 143 messages, and provides guidelines for the authors of documents 144 defining new attributes. Finally, it revises the error handling 145 procedures for a number of existing attributes. Specifically, the 146 error handling procedures of [RFC1997], [RFC4271], [RFC4360], 147 [RFC4456], [RFC4760], [RFC5543], [RFC5701], and [RFC6368] are 148 revised. 150 1.1. Requirements Language 152 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 153 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 154 document are to be interpreted as described in RFC 2119 [RFC2119]. 156 2. Error-Handling Approaches 158 In this document we refer to four different approaches to handling 159 errors found in BGP path attributes. They are as follows (listed in 160 order, from the one with the "strongest" action to the one with the 161 "weakest" action): 163 o Session reset: This is the approach used throughout the base BGP 164 specification [RFC4271], where a NOTIFICATION is sent and the 165 session terminated. 167 o AFI/SAFI disable: [RFC4760] specifies a procedure for disabling a 168 particular AFI/SAFI. 170 o Treat-as-withdraw: In this approach, the UPDATE message containing 171 the path attribute in question MUST be treated as though all 172 contained routes had been withdrawn just as if they had been 173 listed in the WITHDRAWN ROUTES field (or in the MP_UNREACH_NLRI 174 attribute if appropriate) of the UPDATE message, thus causing them 175 to be removed from the Adj-RIB-In according to the procedures of 176 [RFC4271]. 178 o Attribute discard: In this approach the malformed attribute MUST 179 be discarded and the UPDATE message continues to be processed. 180 This approach must not be used except in the case of an attribute 181 that has no effect on route selection or installation. 183 3. Revision to BGP UPDATE Message Error Handling 185 This specification amends [RFC4271] Section 6.3 in a number of ways. 186 See also Section 7 for treatment of specific path attributes. 188 a. The first paragraph is revised as follows: 190 Old Text: 192 All errors detected while processing the UPDATE message 193 MUST be indicated by sending the NOTIFICATION message with 194 the Error Code UPDATE Message Error. The error subcode 195 elaborates on the specific nature of the error. 197 New Text: 199 An error detected while processing the UPDATE message for 200 which a session reset is specified MUST be indicated by 201 sending the NOTIFICATION message with the Error Code UPDATE 202 Message Error. The error subcode elaborates on the 203 specific nature of the error. 205 b. Error handling for the following case remains unchanged: 207 If the Withdrawn Routes Length or Total Attribute Length is 208 too large (i.e., if Withdrawn Routes Length + Total 209 Attribute Length + 23 exceeds the message Length), then the 210 Error Subcode MUST be set to Malformed Attribute List. 212 c. Attribute Flag error handling is revised as follows: 214 Old Text: 216 If any recognized attribute has Attribute Flags that 217 conflict with the Attribute Type Code, then the Error 218 Subcode MUST be set to Attribute Flags Error. The Data 219 field MUST contain the erroneous attribute (type, length, 220 and value). 222 New Text: 224 If the value of either the Optional or Transitive bits in 225 the Attribute Flags is in conflict with their specified 226 values, then the attribute MUST be treated as malformed and 227 the treat-as-withdraw approach used, unless the 228 specification for the attribute mandates different handling 229 for incorrect Attribute Flags. 231 d. If any of the well-known mandatory attributes are not present in 232 an UPDATE message, then "treat-as-withdraw" MUST be used. (Note 233 that [RFC4760] reclassifies NEXT_HOP as what is effectively 234 discretionary.) 236 e. "Treat-as-withdraw" MUST be used for the cases that specify a 237 session reset and involve any of the attributes ORIGIN, AS_PATH, 238 NEXT_HOP, MULTI_EXIT_DISC, or LOCAL_PREF. 240 f. "Attribute discard" MUST be used for any of the cases that 241 specify a session reset and involve ATOMIC_AGGREGATE or 242 AGGREGATOR. 244 g. If the MP_REACH_NLRI attribute or the MP_UNREACH_NLRI [RFC4760] 245 attribute appears more than once in the UPDATE message, then a 246 NOTIFICATION message MUST be sent with the Error Subcode 247 "Malformed Attribute List". If any other attribute (whether 248 recognized or unrecognized) appears more than once in an UPDATE 249 message, then all the occurrences of the attribute other than the 250 first one SHALL be discarded and the UPDATE message continue to 251 be processed. 253 h. When multiple attribute errors exist in an UPDATE message, if the 254 same approach (either "session reset", "treat-as-withdraw" or 255 "attribute discard") is specified for the handling of these 256 malformed attributes, then the specified approach MUST be used. 257 Otherwise the approach with the strongest action MUST be used. 259 i. The Withdrawn Routes field MUST be checked for syntactic 260 correctness in the same manner as the NLRI field. This is 261 discussed further below, and in Section 5.3. 263 j. Finally, we observe that in order to use the approach of "treat- 264 as-withdraw", the entire NLRI field and/or the MP_REACH_NLRI and 265 MP_UNREACH_NLRI attributes need to be successfully parsed -- what 266 this entails is discussed in more detail in Section 5. If this 267 is not possible, the procedures of [RFC4271] and/or [RFC4760] 268 continue to apply, meaning that the "session reset" approach (or 269 the "AFI/SAFI disable" approach) MUST be followed. 271 4. Attribute Length Fields 273 There are two error cases in which the Total Attribute Length value 274 can be in conflict with the enclosed path attributes, which 275 themselves carry length values. In the "overrun" case, as the 276 enclosed path attributes are parsed, the length of the last 277 encountered path attribute would cause the Total Attribute Length to 278 be exceeded. In the "underrun" case, as the enclosed path attributes 279 are parsed, after the last successfully-parsed attribute, fewer than 280 three octets remain, or fewer than four octets, if the Attribute 281 Flags field has the Extended Length bit set -- that is, there remains 282 unconsumed data in the path attributes but yet insufficient data to 283 encode a single minimum-sized path attribute. In either of these 284 cases an error condition exists and the treat-as-withdraw approach 285 MUST be used (unless some other, more severe error is encountered 286 dictating a stronger approach), and the Total Attribute Length MUST 287 be relied upon to enable the beginning of the NLRI field to be 288 located. 290 For all path attributes other than those specified as having an 291 attribute length that may be zero it SHALL be considered a syntax 292 error for the attribute to have a length of zero. (Of the path 293 attributes considered in this specification, only AS_PATH and 294 ATOMIC_AGGREGATE may validly have an attribute length of zero.) 296 5. Parsing of NLRI Fields 298 5.1. Encoding NLRI 300 To facilitate the determination of the NLRI field in an UPDATE with a 301 malformed attribute: 303 o The MP_REACH_NLRI or MP_UNREACH_NLRI attribute (if present) SHALL 304 be encoded as the very first path attribute in an UPDATE. 306 o An UPDATE message MUST NOT contain more than one of the following: 307 non-empty Withdrawn Routes field, non-empty Network Layer 308 Reachability Information field, MP_REACH_NLRI attribute, and 309 MP_UNREACH_NLRI attribute. 311 Since older BGP speakers may not implement these restrictions, an 312 implementation MUST still be prepared to receive these fields in any 313 position or combination. 315 If the encoding of [RFC4271] is used, the NLRI field for the IPv4 316 unicast address family is carried immediately following all the 317 attributes in an UPDATE. When such an UPDATE is received, we observe 318 that the NLRI field can be determined using the "Message Length", 319 "Withdrawn Route Length" and "Total Attribute Length" (when they are 320 consistent) carried in the message instead of relying on the length 321 of individual attributes in the message. 323 5.2. Missing NLRI 325 [RFC4724] specifies an End-of-RIB message ("EoR") that can be encoded 326 as an UPDATE message that contains only a MP_UNREACH_NLRI attribute 327 that encodes no NLRI (it can also be a completely empty UPDATE 328 message in the case of the "legacy" encoding). In all other well- 329 specified cases, an UPDATE either carries only withdrawn routes 330 (either in the Withdrawn Routes field, or the MP_UNREACH_NLRI 331 attribute), or it advertises reachable routes (either in the Network 332 Layer Reachability Information field, or the MP_REACH_NLRI 333 attribute). 335 Thus, if an UPDATE message is encountered that does contain path 336 attributes other than MP_UNREACH_NLRI and doesn't encode any 337 reachable NLRI, we cannot be confident that the NLRI have been 338 successfully parsed as Section 3 (j) requires. For this reason, if 339 any path attribute errors are encountered in such an UPDATE message, 340 and if any encountered error specifies an error-handling approach 341 other than "attribute discard", then the "session reset" approach 342 MUST be used. 344 5.3. Syntactic Correctness of NLRI Fields 346 The NLRI field or Withdrawn Routes field SHALL be considered 347 "syntactically incorrect" if either of the following are true: 349 o The length of any of the included NLRI is greater than 32, 351 o When parsing NLRI contained in the field, the length of the last 352 NLRI found exceeds the amount of unconsumed data remaining in the 353 field. 355 Similarly, the MP_REACH_NLRI or MP_UNREACH_NLRI attribute of an 356 update SHALL be considered to be incorrect if any of the following 357 are true: 359 o The length of any of the included NLRI is inconsistent with the 360 given AFI/SAFI (for example, if an IPv4 NLRI has a length greater 361 than 32 or an IPv6 NLRI has a length greater than 128), 363 o When parsing NLRI contained in the attribute, the length of the 364 last NLRI found exceeds the amount of unconsumed data remaining in 365 the attribute. 367 o The attribute flags of the attribute are inconsistent with those 368 specified in [RFC4760]. 370 o The length of the MP_UNREACH_NLRI attribute is less than 3, or the 371 length of the MP_REACH_NLRI attribute is less than 5. 373 5.4. Typed NLRI 375 Certain address families, for example MCAST-VPN [RFC6514], MCAST-VPLS 376 [RFC7117] and EVPN [I-D.ietf-l2vpn-evpn] have NLRI that are typed. 377 Since supported type values within the address family are not 378 expressed in the MP-BGP capability [RFC4760], it is possible for a 379 BGP speaker to advertise support for the given address family and 380 sub-address family while still not supporting a particular type of 381 NLRI within that AFI/SAFI. 383 A BGP speaker advertising support for such a typed address family 384 MUST handle routes with unrecognized NLRI types within that address 385 family by discarding them, unless the relevant specification for that 386 address family specifies otherwise. 388 6. Operational Considerations 390 Although the "treat-as-withdraw" error-handling behavior defined in 391 Section 2 makes every effort to preserve BGP's correctness, we note 392 that if an UPDATE received on an IBGP session is subjected to this 393 treatment, inconsistent routing within the affected Autonomous System 394 may result. The consequences of inconsistent routing can include 395 long-lived forwarding loops and black holes. While lamentable, this 396 issue is expected to be rare in practice, and more importantly is 397 seen as less problematic than the session-reset behavior it replaces. 399 When a malformed attribute is indeed detected over an IBGP session, 400 we RECOMMEND that routes with the malformed attribute be identified 401 and traced back to the ingress router in the network where the routes 402 were sourced or received externally, and then a filter be applied on 403 the ingress router to prevent the routes from being sourced or 404 received. This will help maintain routing consistency in the 405 network. 407 Even if inconsistent routing does not arise, the "treat-as-withdraw" 408 behavior can cause either complete unreachability or sub-optimal 409 routing for the destinations whose routes are carried in the affected 410 UPDATE message. 412 Note that "treat-as-withdraw" is different from discarding an UPDATE 413 message. The latter violates the basic BGP principle of incremental 414 update, and could cause invalid routes to be kept. 416 Because of these potential issues, a BGP speaker MUST provide 417 debugging facilities to permit issues caused by a malformed attribute 418 to be diagnosed. At a minimum, such facilities MUST include logging 419 an error listing the NLRI involved, and containing the entire 420 malformed UPDATE message when such an attribute is detected. The 421 malformed UPDATE message SHOULD be analyzed, and the root cause 422 SHOULD be investigated. 424 Section 8 mentions that attribute discard should not be used in cases 425 where "the attribute in question has or may have an effect on route 426 selection." Although all cases that specify attribute discard in 427 this document do not affect route selection by default, in principle 428 routing policies could be written that affect selection based on such 429 an attribute. Operators should take care when writing such policies 430 to consider the possible consequences of an attribute discard. (In 431 general, as long as such policies are only applied to external BGP 432 sessions, correctness issues are not expected to arise.) 434 7. Error Handling Procedures for Existing Attributes 436 In the following subsections, we elaborate on the conditions for 437 error-checking various path attributes, and specify what approach(es) 438 should be used to handle malformations. It is possible that 439 implementations may apply other error checks not contemplated here. 440 If so, the error handling approach given here should generally be 441 applied. 443 This section addresses all path attributes that are defined at the 444 time of this writing, that were not defined with error-handling 445 consistent with Section 8, and that are not marked as "deprecated" in 446 [IANA-BGP-ATTRS]. Attributes 17 (AS4_PATH), 18 (AS4_AGGREGATOR), 22 447 (PMSI_TUNNEL), 23 (Tunnel Encapsulation Attribute), 26 (AIGP), 27 (PE 448 Distinguisher Labels) and 29 (BGP-LS Attribute) do have error- 449 handling consistent with Section 8 and thus are not further discussed 450 herein. Attributes 11 (DPA), 12 (ADVERTISER), 13 (RCID_PATH / 451 CLUSTER_ID), 19 (SAFI Specific Attribute), 20 (Connector Attribute), 452 21 (AS_PATHLIMIT) and 28 (BGP Entropy Label Capability Attribute) are 453 deprecated and thus are not further discussed herein. 455 7.1. ORIGIN 457 The attribute is considered malformed if its length is not 1, or it 458 has an undefined value [RFC4271]. 460 An UPDATE message with a malformed ORIGIN attribute SHALL be handled 461 using the approach of "treat-as-withdraw". 463 7.2. AS_PATH 465 An AS_PATH is considered malformed if an unrecognized segment type is 466 encountered, or if it contains a malformed segment. A segment is 467 considered malformed if any of the following obtains: 469 o There is an overrun, where the path segment length field of the 470 last segment encountered would cause the Attribute Length to be 471 exceeded. 473 o There is an underrun, where after the last successfully-parsed 474 segment, there is only a single octet remaining (that is, there is 475 not enough unconsumed data to provide even an empty segment 476 header). 478 o It has a path segment length field of zero. 480 An UPDATE message with a malformed AS_PATH attribute SHALL be handled 481 using the approach of "treat-as-withdraw". 483 [RFC4271] also says that an implementation optionally "MAY check 484 whether the leftmost ... AS in the AS_PATH attribute is equal to the 485 autonomous system number of the peer that sent the message". A BGP 486 implementation SHOULD also handle routes that violate this check 487 using "treat-as-withdraw", but MAY follow the session reset behavior 488 if configured to do so. 490 7.3. NEXT_HOP 492 The attribute is considered malformed if its length is not 4 493 [RFC4271]. 495 An UPDATE message with a malformed NEXT_HOP attribute SHALL be 496 handled using the approach of "treat-as-withdraw". 498 7.4. MULTI_EXIT_DISC 500 The attribute is considered malformed if its length is not 4 501 [RFC4271]. 503 An UPDATE message with a malformed MULTI_EXIT_DISC attribute SHALL be 504 handled using the approach of "treat-as-withdraw". 506 7.5. LOCAL_PREF 508 The error handling of [RFC4271] is revised as follows. 510 o If the LOCAL_PREF attribute is received from an external neighbor, 511 it SHALL be discarded using the approach of "attribute discard", 512 or 514 o if received from an internal neighbor, it SHALL be considered 515 malformed if its length is not equal to 4. If malformed, the 516 UPDATE SHALL be handled using the approach of "treat-as-withdraw". 518 7.6. ATOMIC_AGGREGATE 520 The attribute SHALL be considered malformed if its length is not 0 521 [RFC4271]. 523 An UPDATE message with a malformed ATOMIC_AGGREGATE attribute SHALL 524 be handled using the approach of "attribute discard". 526 7.7. AGGREGATOR 528 The error conditions specified in [RFC4271] for the attribute are 529 revised as follows: 531 The AGGREGATOR attribute SHALL be considered malformed if any of the 532 following applies: 534 o Its length is not 6 (when the "4-octet AS number capability" is 535 not advertised to, or not received from the peer [RFC6793]). 537 o Its length is not 8 (when the "4-octet AS number capability" is 538 both advertised to, and received from the peer). 540 An UPDATE message with a malformed AGGREGATOR attribute SHALL be 541 handled using the approach of "attribute discard". 543 7.8. Community 545 The error handling of [RFC1997] is revised as follows: 547 The Community attribute SHALL be considered malformed if its length 548 is not a nonzero multiple of 4. 550 An UPDATE message with a malformed Community attribute SHALL be 551 handled using the approach of "treat-as-withdraw". 553 7.9. ORIGINATOR_ID 555 The error handling of [RFC4456] is revised as follows. 557 o If the ORIGINATOR_ID attribute is received from an external 558 neighbor, it SHALL be discarded using the approach of "attribute 559 discard", or 561 o if received from an internal neighbor, it SHALL be considered 562 malformed if its length is not equal to 4. If malformed, the 563 UPDATE SHALL be handled using the approach of "treat-as-withdraw". 565 7.10. CLUSTER_LIST 567 The error handling of [RFC4456] is revised as follows. 569 o If the CLUSTER_LIST attribute is received from an external 570 neighbor, it SHALL be discarded using the approach of "attribute 571 discard", or 573 o if received from an internal neighbor, it SHALL be considered 574 malformed if its length is not a nonzero multiple of 4. If 575 malformed, the UPDATE SHALL be handled using the approach of 576 "treat-as-withdraw". 578 7.11. MP_REACH_NLRI 580 If the Length of Next Hop Network Address field of the MP_REACH 581 attribute is inconsistent with that which was expected, the attribute 582 is considered malformed. Since the next hop precedes the NLRI field 583 in the attribute, in this case it will not be possible to reliably 584 locate the NLRI, and thus the "session reset" or "AFI/SAFI disable" 585 approach MUST be used. 587 "That which was expected", while somewhat vague, is intended to 588 encompass the next hop specified for the Address Family Identifier 589 and Subsequent Address Family Identifier fields and potentially 590 modified by any extensions in use. For example, if [RFC5549] is in 591 use then the next hop would have to have a length of 4 or 16. 593 Section 3 and Section 5 provide further discussion of the handling of 594 this attribute. 596 7.12. MP_UNREACH_NLRI 598 Section 3 and Section 5 discuss the handling of this attribute. 600 7.13. Traffic Engineering path attribute 602 We note that [RFC5543] does not detail what constitutes 603 "malformation" for the Traffic Engineering path attribute. A future 604 update to that specification may provide more guidance. In the 605 interim, an implementation that determines (for whatever reason) that 606 an UPDATE message contains a malformed Traffic Engineering path 607 attribute MUST handle it using the approach of "treat-as-withdraw". 609 7.14. Extended Community 611 The error handling of [RFC4360] is revised as follows: 613 The Extended Community attribute SHALL be considered malformed if its 614 length is not a nonzero multiple of 8. 616 An UPDATE message with a malformed Extended Community attribute SHALL 617 be handled using the approach of "treat-as-withdraw". 619 Note that a BGP speaker MUST NOT treat an unrecognized Extended 620 Community Type or Sub-Type as an error. 622 7.15. IPv6 Address Specific BGP Extended Community Attribute 624 The error handling of [RFC5701] is revised as follows: 626 The IPv6 Address Specific Extended Community attribute SHALL be 627 considered malformed if its length is not a nonzero multiple of 20. 629 An UPDATE message with a malformed IPv6 Address Specific Extended 630 Community attribute SHALL be handled using the approach of "treat-as- 631 withdraw". 633 Note that a BGP speaker MUST NOT treat an unrecognized IPv6 Address 634 Specific Extended Community Type or Sub-Type as an error. 636 7.16. ATTR_SET 638 The final paragraph of Section 5 of [RFC6368] is revised as follows: 640 Old Text: 642 An UPDATE message with a malformed ATTR_SET attribute SHALL be 643 handled as follows. If its Partial flag is set and its 644 Neighbor-Complete flag is clear, the UPDATE is treated as a 645 route withdraw as discussed in [OPT-TRANS-BGP]. Otherwise 646 (i.e., Partial flag is clear or Neighbor-Complete is set), the 647 procedures of the BGP-4 base specification [RFC4271] MUST be 648 followed with respect to an Optional Attribute Error. 650 New Text: 652 An UPDATE message with a malformed ATTR_SET attribute SHALL be 653 handled using the approach of "treat as withdraw". 655 Furthermore, the normative reference to [OPT-TRANS-BGP] in [RFC6368] 656 is removed. 658 8. Guidance for Authors of BGP Specifications 660 A document that specifies a new BGP attribute MUST provide specifics 661 regarding what constitutes an error for that attribute and how that 662 error is to be handled. Allowable error-handling approaches are 663 detailed in Section 2. The treat-as-withdraw approach is generally 664 preferred. The document SHOULD also provide consideration of what 665 debugging facilities may be required to permit issues caused by a 666 malformed attribute to be diagnosed. 668 For any malformed attribute that is handled by the "attribute 669 discard" instead of the "treat-as-withdraw" approach, it is critical 670 to consider the potential impact of doing so. In particular, if the 671 attribute in question has or may have an effect on route selection or 672 installation, the presumption is that discarding it is unsafe, unless 673 careful analysis proves otherwise. The analysis should take into 674 account the tradeoff between preserving connectivity and potential 675 side effects. 677 Authors can refer to Section 7 for examples. 679 9. IANA Considerations 681 This document makes no request of IANA. 683 10. Security Considerations 685 This specification addresses the vulnerability of a BGP speaker to a 686 potential attack whereby a distant attacker can generate a malformed 687 optional transitive attribute that is not recognized by intervening 688 routers (which thus propagate the attribute unchecked) but that 689 causes session resets when it reaches routers that do recognize the 690 given attribute type. 692 In other respects, this specification does not change BGP's security 693 characteristics. 695 11. Acknowledgements 697 The authors wish to thank Juan Alcaide, Deniz Bahadir, Ron Bonica, 698 Mach Chen, Andy Davidson, Bruno Decraene, Rex Fernando, Jeff Haas, 699 Chris Hall, Joel Halpern, Dong Jie, Akira Kato, Miya Kohno, Tony Li, 700 Alton Lo, Shin Miyakawa, Tamas Mondal, Jonathan Oddy, Tony 701 Przygienda, Robert Raszuk, Yakov Rekhter, Eric Rosen, Shyam Sethuram, 702 Rob Shakir, Naiming Shen, Adam Simpson, Ananth Suryanarayana, Kaliraj 703 Vairavakkalai, Lili Wang and Ondrej Zajicek for their observations 704 and discussion of this topic, and review of this document. 706 12. References 707 12.1. Normative References 709 [IANA-BGP-ATTRS] 710 "BGP Path Attributes", . 713 [RFC1997] Chandrasekeran, R., Traina, P., and T. Li, "BGP 714 Communities Attribute", RFC 1997, August 1996. 716 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 717 Requirement Levels", BCP 14, RFC 2119, March 1997. 719 [RFC4271] Rekhter, Y., Li, T., and S. Hares, "A Border Gateway 720 Protocol 4 (BGP-4)", RFC 4271, January 2006. 722 [RFC4360] Sangli, S., Tappan, D., and Y. Rekhter, "BGP Extended 723 Communities Attribute", RFC 4360, February 2006. 725 [RFC4456] Bates, T., Chen, E., and R. Chandra, "BGP Route 726 Reflection: An Alternative to Full Mesh Internal BGP 727 (IBGP)", RFC 4456, April 2006. 729 [RFC4724] Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. 730 Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, 731 January 2007. 733 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 734 "Multiprotocol Extensions for BGP-4", RFC 4760, January 735 2007. 737 [RFC5543] Ould-Brahim, H., Fedyk, D., and Y. Rekhter, "BGP Traffic 738 Engineering Attribute", RFC 5543, May 2009. 740 [RFC5701] Rekhter, Y., "IPv6 Address Specific BGP Extended Community 741 Attribute", RFC 5701, November 2009. 743 [RFC6368] Marques, P., Raszuk, R., Patel, K., Kumaki, K., and T. 744 Yamagata, "Internal BGP as the Provider/Customer Edge 745 Protocol for BGP/MPLS IP Virtual Private Networks (VPNs)", 746 RFC 6368, September 2011. 748 [RFC6793] Vohra, Q. and E. Chen, "BGP Support for Four-Octet 749 Autonomous System (AS) Number Space", RFC 6793, December 750 2012. 752 12.2. Informative References 754 [I-D.ietf-l2vpn-evpn] 755 Sajassi, A., Aggarwal, R., Bitar, N., Isaac, A., and J. 756 Uttaro, "BGP MPLS Based Ethernet VPN", draft-ietf-l2vpn- 757 evpn-11 (work in progress), October 2014. 759 [RFC5549] Le Faucheur, F. and E. Rosen, "Advertising IPv4 Network 760 Layer Reachability Information with an IPv6 Next Hop", RFC 761 5549, May 2009. 763 [RFC6514] Aggarwal, R., Rosen, E., Morin, T., and Y. Rekhter, "BGP 764 Encodings and Procedures for Multicast in MPLS/BGP IP 765 VPNs", RFC 6514, February 2012. 767 [RFC7117] Aggarwal, R., Kamite, Y., Fang, L., Rekhter, Y., and C. 768 Kodeboniya, "Multicast in Virtual Private LAN Service 769 (VPLS)", RFC 7117, February 2014. 771 Authors' Addresses 773 Enke Chen (editor) 774 Cisco Systems, Inc. 776 Email: enkechen@cisco.com 778 John G. Scudder (editor) 779 Juniper Networks 781 Email: jgs@juniper.net 783 Pradosh Mohapatra 784 Sproute Networks 786 Email: mpradosh@yahoo.com 788 Keyur Patel 789 Cisco Systems, Inc. 791 Email: keyupate@cisco.com