idnits 2.17.1 draft-ietf-idr-error-handling-12.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 (June 11, 2014) is 3579 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 675, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'IANA-BGP-ATTRS' -- Possible downref: Non-RFC (?) normative reference: ref. 'IANA-IPV4' -- Possible downref: Non-RFC (?) normative reference: ref. 'IANA-IPV6' == Outdated reference: A later version (-11) exists of draft-ietf-l2vpn-evpn-07 Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 10 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, 6790 (if Juniper Networks 6 approved) P. Mohapatra 7 Intended status: Standards Track Sproute Networks 8 Expires: December 13, 2014 K. Patel 9 Cisco Systems, Inc. 10 June 11, 2014 12 Revised Error Handling for BGP UPDATE Messages 13 draft-ietf-idr-error-handling-12 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 and 5701. 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 December 13, 2014. 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 . . . . . . 9 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 . . . . . . . . . . . . . . . . . . . 14 102 7.15. IPv6 Address Specific BGP Extended Community Attribute . 14 103 7.16. BGP Entropy Label Capability Attribute . . . . . . . . . 14 104 7.17. ATTR_SET . . . . . . . . . . . . . . . . . . . . . . . . 14 105 8. Guidance for Authors of BGP Specifications . . . . . . . . . 15 106 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 107 10. Security Considerations . . . . . . . . . . . . . . . . . . . 15 108 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 16 109 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 110 12.1. Normative References . . . . . . . . . . . . . . . . . . 16 111 12.2. Informative References . . . . . . . . . . . . . . . . . 17 112 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17 114 1. Introduction 116 According to the base BGP specification [RFC4271], a BGP speaker that 117 receives an UPDATE message containing a malformed attribute is 118 required to reset the session over which the offending attribute was 119 received. This behavior is undesirable as a session reset would 120 impact not only routes with the offending attribute, but also other 121 valid routes exchanged over the session. In the case of optional 122 transitive attributes, the behavior is especially troublesome and may 123 present a potential security vulnerability. The reason is that such 124 attributes may have been propagated without being checked by 125 intermediate routers that do not recognize the attributes -- in 126 effect the attribute may have been tunneled, and when they do reach a 127 router that recognizes and checks them, the session that is reset may 128 not be associated with the router that is at fault. To make matters 129 worse, in such cases although the problematic attributes may have 130 originated with a single update transmitted by a single BGP speaker, 131 by the time they encounter a router that checks them they may have 132 been replicated many times, and thus may cause the reset of many 133 peering sessions. Thus the damage inflicted may be multiplied 134 manyfold. 136 The goal for revising the error handling for UPDATE messages is to 137 minimize the impact on routing by a malformed UPDATE message, while 138 maintaining protocol correctness to the extent possible. This can be 139 achieved largely by maintaining the established session and keeping 140 the valid routes exchanged, but removing the routes carried in the 141 malformed UPDATE from the routing system. 143 This document partially revises the error handling for UPDATE 144 messages, and provides guidelines for the authors of documents 145 defining new attributes. Finally, it revises the error handling 146 procedures for a number of existing attributes. Specifically, the 147 error handling procedures of [RFC1997], [RFC4271], [RFC4360], 148 [RFC4456], [RFC4760] and [RFC5701] are 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 MVPN [RFC7117] and EVPN 376 [I-D.ietf-l2vpn-evpn] have NLRI that are typed. Since supported type 377 values within the address family are not expressed in the MP-BGP 378 capability [RFC4760], it is possible for a BGP speaker to advertise 379 support for the given address family and sub-address family while 380 still not supporting a particular type of NLRI within that AFI/SAFI. 382 A BGP speaker advertising support for such a typed address family 383 MUST handle routes with unrecognized NLRI types within that address 384 family by discarding them, unless the relevant specification for that 385 address family specifies otherwise. 387 6. Operational Considerations 389 Although the "treat-as-withdraw" error-handling behavior defined in 390 Section 2 makes every effort to preserve BGP's correctness, we note 391 that if an UPDATE received on an IBGP session is subjected to this 392 treatment, inconsistent routing within the affected Autonomous System 393 may result. The consequences of inconsistent routing can include 394 long-lived forwarding loops and black holes. While lamentable, this 395 issue is expected to be rare in practice, and more importantly is 396 seen as less problematic than the session-reset behavior it replaces. 398 When a malformed attribute is indeed detected over an IBGP session, 399 we RECOMMEND that routes with the malformed attribute be identified 400 and traced back to the ingress router in the network where the routes 401 were sourced or received externally, and then a filter be applied on 402 the ingress router to prevent the routes from being sourced or 403 received. This will help maintain routing consistency in the 404 network. 406 Even if inconsistent routing does not arise, the "treat-as-withdraw" 407 behavior can cause either complete unreachability or sub-optimal 408 routing for the destinations whose routes are carried in the affected 409 UPDATE message. 411 Note that "treat-as-withdraw" is different from discarding an UPDATE 412 message. The latter violates the basic BGP principle of incremental 413 update, and could cause invalid routes to be kept. 415 Because of these potential issues, a BGP speaker MUST provide 416 debugging facilities to permit issues caused by a malformed attribute 417 to be diagnosed. At a minimum, such facilities MUST include logging 418 an error listing the NLRI involved, and containing the entire 419 malformed UPDATE message when such an attribute is detected. The 420 malformed UPDATE message SHOULD be analyzed, and the root cause 421 SHOULD be investigated. 423 7. Error Handling Procedures for Existing Attributes 425 In the following subsections, we elaborate on the conditions for 426 error-checking various path attributes, and specify what approach(es) 427 should be used to handle malformations. It is possible that 428 implementations may apply other error checks not contemplated here. 430 If so, the error handling approach given here should generally be 431 applied. 433 This section addresses all path attributes that are defined at the 434 time of this writing, that were not defined with error-handling 435 consistent with Section 8, and that are not marked as "deprecated" in 436 [IANA-BGP-ATTRS]. Attributes 17 (AS4_PATH), 18 (AS4_AGGREGATOR), 22 437 (PMSI_TUNNEL), 23 (Tunnel Encapsulation Attribute), 26 (AIGP), 27 (PE 438 Distinguisher Labels) and 29 (BGP-LS Attribute) do have error- 439 handling consistent with Section 8 and thus are not further discussed 440 herein. Attributes 11 (DPA), 12 (ADVERTISER), 13 (RCID_PATH / 441 CLUSTER_ID), 19 (SAFI Specific Attribute), 20 (Connector Attribute) 442 and 21 (AS_PATHLIMIT) are deprecated and thus are not further 443 discussed herein. 445 7.1. ORIGIN 447 The attribute is considered malformed if its length is not 1, or it 448 has an undefined value [RFC4271]. 450 An UPDATE message with a malformed ORIGIN attribute SHALL be handled 451 using the approach of "treat-as-withdraw". 453 7.2. AS_PATH 455 An AS_PATH is considered malformed if an unrecognized segment type is 456 encountered, or if it contains a malformed segment. A segment is 457 considered malformed if any of the following obtains: 459 o There is an overrun, where the path segment length field of the 460 last segment encountered would cause the Attribute Length to be 461 exceeded. 463 o There is an underrun, where after the last successfully-parsed 464 segment, there is only a single octet remaining (that is, there is 465 not enough unconsumed data to provide even an empty segment 466 header). 468 o It has a path segment length field of zero. 470 An UPDATE message with a malformed AS_PATH attribute SHALL be handled 471 using the approach of "treat-as-withdraw". 473 [RFC4271] also says that an implementation optionally "MAY check 474 whether the leftmost ... AS in the AS_PATH attribute is equal to the 475 autonomous system number of the peer that sent the message". A BGP 476 implementation SHOULD also handle routes that violate this check 477 using "treat-as-withdraw", but MAY follow the session reset behavior 478 if configured to do so. 480 7.3. NEXT_HOP 482 According to [RFC4271] the attribute is considered malformed if it is 483 syntactically incorrect. To quote from that document, "Syntactic 484 correctness means that the NEXT_HOP attribute represents a valid IP 485 host address", but it does not go on to define what it means to be a 486 "valid IP host address". Therefore: 488 An IP host address SHOULD be considered invalid if it appears in the 489 "IANA IPv4 Special-Purpose Address Registry" [IANA-IPV4] and either 490 the "destination" or the "forwardable" boolean in that registry is 491 given as "false". An implementation MAY provide a means to modify 492 the list of invalid host addresses by configuration -- these are 493 sometimes referred to as "Martians". 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 [RFC4760] references the error-handling of the base BGP specification 581 for validation of the next hop. ("The rules for the next hop 582 information are the same as the rules for the information carried in 583 the NEXT_HOP BGP attribute".) Thus just as in Section 7.3 we must 584 consider what it means for the Next Hop field of the MP_REACH 585 attribute to be a "valid host address": 587 o If the Next Hop field is an IPv4 address, it SHOULD be considered 588 invalid if it appears in the "IANA IPv4 Special-Purpose Address 589 Registry" [IANA-IPV4] and either the "destination" or the 590 "forwardable" boolean in that registry is given as "false". 592 o If the Next Hop field is an IPv6 address, it SHOULD be considered 593 invalid if it appears in the "IANA IPv6 Special-Purpose Address 594 Registry" [IANA-IPV6] and either the "destination" or the 595 "forwardable" boolean in that registry is given as "false". 597 o If the Next Hop field is some other form of address, it should be 598 considered invalid in circumstances analogous to the above -- if 599 it is found in the relevant IANA special-purpose address registry 600 (if any) and its "destination" or "forwardable" boolean is given 601 as "false". 603 o An implementation MAY provide a means to modify the list of 604 invalid host addresses by configuration -- these are sometimes 605 referred to as "Martians". 607 Section 3 and Section 5 provide further discussion of the handling of 608 this attribute. 610 7.12. MP_UNREACH_NLRI 612 Section 3 and Section 5 discuss the handling of this attribute. 614 7.13. Traffic Engineering path attribute 616 The error handling of [RFC5543] is revised as follows. 618 TBD 620 7.14. Extended Community 622 The error handling of [RFC4360] is revised as follows: 624 The Extended Community attribute SHALL be considered malformed if its 625 length is not a nonzero multiple of 8. 627 An UPDATE message with a malformed Extended Community attribute SHALL 628 be handled using the approach of "treat-as-withdraw". 630 Note that a BGP speaker MUST NOT treat an unrecognized Extended 631 Community Type or Sub-Type as an error. 633 7.15. IPv6 Address Specific BGP Extended Community Attribute 635 The error handling of [RFC5701] is revised as follows: 637 The IPv6 Address Specific Extended Community attribute SHALL be 638 considered malformed if its length is not a nonzero multiple of 20. 640 An UPDATE message with a malformed IPv6 Address Specific Extended 641 Community attribute SHALL be handled using the approach of "treat-as- 642 withdraw". 644 Note that a BGP speaker MUST NOT treat an unrecognized IPv6 Address 645 Specific Extended Community Type or Sub-Type as an error. 647 7.16. BGP Entropy Label Capability Attribute 649 The error handling of [RFC6790] is revised as follows. 651 No syntax errors are defined for the Entropy Label Capability 652 attribute (ELCA). However, if any implementation does for some local 653 reason determine that a syntax error exists with the ELCA, the error 654 SHALL be handled using the approach of "attribute discard". 656 7.17. ATTR_SET 658 The final paragraph of Section 5 of [RFC6368] is revised as follows: 660 Old Text: 662 An UPDATE message with a malformed ATTR_SET attribute SHALL be 663 handled as follows. If its Partial flag is set and its 664 Neighbor-Complete flag is clear, the UPDATE is treated as a 665 route withdraw as discussed in [OPT-TRANS-BGP]. Otherwise 666 (i.e., Partial flag is clear or Neighbor-Complete is set), the 667 procedures of the BGP-4 base specification [RFC4271] MUST be 668 followed with respect to an Optional Attribute Error. 670 New Text: 672 An UPDATE message with a malformed ATTR_SET attribute SHALL be 673 handled using the approach of "treat as withdraw". 675 Furthermore, the normative reference to [OPT-TRANS-BGP] in [RFC6368] 676 is removed. 678 8. Guidance for Authors of BGP Specifications 680 A document that specifies a new BGP attribute MUST provide specifics 681 regarding what constitutes an error for that attribute and how that 682 error is to be handled. Allowable error-handling approaches are 683 detailed in Section 2. The treat-as-withdraw approach is generally 684 preferred. The document SHOULD also provide consideration of what 685 debugging facilities may be required to permit issues caused by a 686 malformed attribute to be diagnosed. 688 For any malformed attribute that is handled by the "attribute 689 discard" instead of the "treat-as-withdraw" approach, it is critical 690 to consider the potential impact of doing so. In particular, if the 691 attribute in question has or may have an effect on route selection or 692 installation, the presumption is that discarding it is unsafe, unless 693 careful analysis proves otherwise. The analysis should take into 694 account the tradeoff between preserving connectivity and potential 695 side effects. 697 Authors can refer to Section 7 for examples. 699 9. IANA Considerations 701 This document makes no request of IANA. 703 10. Security Considerations 705 This specification addresses the vulnerability of a BGP speaker to a 706 potential attack whereby a distant attacker can generate a malformed 707 optional transitive attribute that is not recognized by intervening 708 routers (which thus propagate the attribute unchecked) but that 709 causes session resets when it reaches routers that do recognize the 710 given attribute type. 712 In other respects, this specification does not change BGP's security 713 characteristics. 715 11. Acknowledgements 717 The authors wish to thank Juan Alcaide, Deniz Bahadir, Ron Bonica, 718 Mach Chen, Andy Davidson, Bruno Decraene, Rex Fernando, Jeff Haas, 719 Chris Hall, Joel Halpern, Dong Jie, Akira Kato, Miya Kohno, Tony Li, 720 Alton Lo, Shin Miyakawa, Tamas Mondal, Jonathan Oddy, Tony 721 Przygienda, Robert Raszuk, Yakov Rekhter, Eric Rosen, Shyam Sethuram, 722 Rob Shakir, Naiming Shen, Adam Simpson, Ananth Suryanarayana, Kaliraj 723 Vairavakkalai, Lili Wang and Ondrej Zajicek for their observations 724 and discussion of this topic, and review of this document. 726 12. References 728 12.1. Normative References 730 [IANA-BGP-ATTRS] 731 "BGP Path Attributes", . 734 [IANA-IPV4] 735 "IANA IPv4 Special-Purpose Address Registry", 736 . 739 [IANA-IPV6] 740 "IANA IPv4 Special-Purpose Address Registry", 741 . 744 [RFC1997] Chandrasekeran, R., Traina, P., and T. Li, "BGP 745 Communities Attribute", RFC 1997, August 1996. 747 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 748 Requirement Levels", BCP 14, RFC 2119, March 1997. 750 [RFC4271] Rekhter, Y., Li, T., and S. Hares, "A Border Gateway 751 Protocol 4 (BGP-4)", RFC 4271, January 2006. 753 [RFC4360] Sangli, S., Tappan, D., and Y. Rekhter, "BGP Extended 754 Communities Attribute", RFC 4360, February 2006. 756 [RFC4456] Bates, T., Chen, E., and R. Chandra, "BGP Route 757 Reflection: An Alternative to Full Mesh Internal BGP 758 (IBGP)", RFC 4456, April 2006. 760 [RFC4724] Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. 761 Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, 762 January 2007. 764 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 765 "Multiprotocol Extensions for BGP-4", RFC 4760, January 766 2007. 768 [RFC5543] Ould-Brahim, H., Fedyk, D., and Y. Rekhter, "BGP Traffic 769 Engineering Attribute", RFC 5543, May 2009. 771 [RFC5701] Rekhter, Y., "IPv6 Address Specific BGP Extended Community 772 Attribute", RFC 5701, November 2009. 774 [RFC6368] Marques, P., Raszuk, R., Patel, K., Kumaki, K., and T. 775 Yamagata, "Internal BGP as the Provider/Customer Edge 776 Protocol for BGP/MPLS IP Virtual Private Networks (VPNs)", 777 RFC 6368, September 2011. 779 [RFC6790] Kompella, K., Drake, J., Amante, S., Henderickx, W., and 780 L. Yong, "The Use of Entropy Labels in MPLS Forwarding", 781 RFC 6790, November 2012. 783 [RFC6793] Vohra, Q. and E. Chen, "BGP Support for Four-Octet 784 Autonomous System (AS) Number Space", RFC 6793, December 785 2012. 787 12.2. Informative References 789 [I-D.ietf-l2vpn-evpn] 790 Sajassi, A., Aggarwal, R., Bitar, N., Isaac, A., and J. 791 Uttaro, "BGP MPLS Based Ethernet VPN", draft-ietf-l2vpn- 792 evpn-07 (work in progress), May 2014. 794 [RFC7117] Aggarwal, R., Kamite, Y., Fang, L., Rekhter, Y., and C. 795 Kodeboniya, "Multicast in Virtual Private LAN Service 796 (VPLS)", RFC 7117, February 2014. 798 Authors' Addresses 800 Enke Chen (editor) 801 Cisco Systems, Inc. 803 Email: enkechen@cisco.com 805 John G. Scudder (editor) 806 Juniper Networks 808 Email: jgs@juniper.net 809 Pradosh Mohapatra 810 Sproute Networks 812 Email: mpradosh@yahoo.com 814 Keyur Patel 815 Cisco Systems, Inc. 817 Email: keyupate@cisco.com