idnits 2.17.1 draft-ietf-idr-error-handling-13.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 13, 2014) is 3598 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 688, 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 15, 2014 K. Patel 9 Cisco Systems, Inc. 10 June 13, 2014 12 Revised Error Handling for BGP UPDATE Messages 13 draft-ietf-idr-error-handling-13 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, 6368 and 6790. 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 15, 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 . . . . . . 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 . . . . . . . . . . . . . . . . . . . . 12 94 7.7. AGGREGATOR . . . . . . . . . . . . . . . . . . . . . . . 12 95 7.8. Community . . . . . . . . . . . . . . . . . . . . . . . . 12 96 7.9. ORIGINATOR_ID . . . . . . . . . . . . . . . . . . . . . . 12 97 7.10. CLUSTER_LIST . . . . . . . . . . . . . . . . . . . . . . 13 98 7.11. MP_REACH_NLRI . . . . . . . . . . . . . . . . . . . . . . 13 99 7.12. MP_UNREACH_NLRI . . . . . . . . . . . . . . . . . . . . . 14 100 7.13. Traffic Engineering path attribute . . . . . . . . . . . 14 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 . . . . . . . . . 15 104 7.17. ATTR_SET . . . . . . . . . . . . . . . . . . . . . . . . 15 105 8. Guidance for Authors of BGP Specifications . . . . . . . . . 15 106 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 107 10. Security Considerations . . . . . . . . . . . . . . . . . . . 16 108 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 16 109 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 110 12.1. Normative References . . . . . . . . . . . . . . . . . . 16 111 12.2. Informative References . . . . . . . . . . . . . . . . . 18 112 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 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], [RFC5543], [RFC5701], [RFC6368] and [RFC6790] 149 are revised. 151 1.1. Requirements Language 153 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 154 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 155 document are to be interpreted as described in RFC 2119 [RFC2119]. 157 2. Error-Handling Approaches 159 In this document we refer to four different approaches to handling 160 errors found in BGP path attributes. They are as follows (listed in 161 order, from the one with the "strongest" action to the one with the 162 "weakest" action): 164 o Session reset: This is the approach used throughout the base BGP 165 specification [RFC4271], where a NOTIFICATION is sent and the 166 session terminated. 168 o AFI/SAFI disable: [RFC4760] specifies a procedure for disabling a 169 particular AFI/SAFI. 171 o Treat-as-withdraw: In this approach, the UPDATE message containing 172 the path attribute in question MUST be treated as though all 173 contained routes had been withdrawn just as if they had been 174 listed in the WITHDRAWN ROUTES field (or in the MP_UNREACH_NLRI 175 attribute if appropriate) of the UPDATE message, thus causing them 176 to be removed from the Adj-RIB-In according to the procedures of 177 [RFC4271]. 179 o Attribute discard: In this approach the malformed attribute MUST 180 be discarded and the UPDATE message continues to be processed. 181 This approach must not be used except in the case of an attribute 182 that has no effect on route selection or installation. 184 3. Revision to BGP UPDATE Message Error Handling 186 This specification amends [RFC4271] Section 6.3 in a number of ways. 187 See also Section 7 for treatment of specific path attributes. 189 a. The first paragraph is revised as follows: 191 Old Text: 193 All errors detected while processing the UPDATE message 194 MUST be indicated by sending the NOTIFICATION message with 195 the Error Code UPDATE Message Error. The error subcode 196 elaborates on the specific nature of the error. 198 New Text: 200 An error detected while processing the UPDATE message for 201 which a session reset is specified MUST be indicated by 202 sending the NOTIFICATION message with the Error Code UPDATE 203 Message Error. The error subcode elaborates on the 204 specific nature of the error. 206 b. Error handling for the following case remains unchanged: 208 If the Withdrawn Routes Length or Total Attribute Length is 209 too large (i.e., if Withdrawn Routes Length + Total 210 Attribute Length + 23 exceeds the message Length), then the 211 Error Subcode MUST be set to Malformed Attribute List. 213 c. Attribute Flag error handling is revised as follows: 215 Old Text: 217 If any recognized attribute has Attribute Flags that 218 conflict with the Attribute Type Code, then the Error 219 Subcode MUST be set to Attribute Flags Error. The Data 220 field MUST contain the erroneous attribute (type, length, 221 and value). 223 New Text: 225 If the value of either the Optional or Transitive bits in 226 the Attribute Flags is in conflict with their specified 227 values, then the attribute MUST be treated as malformed and 228 the treat-as-withdraw approach used, unless the 229 specification for the attribute mandates different handling 230 for incorrect Attribute Flags. 232 d. If any of the well-known mandatory attributes are not present in 233 an UPDATE message, then "treat-as-withdraw" MUST be used. (Note 234 that [RFC4760] reclassifies NEXT_HOP as what is effectively 235 discretionary.) 237 e. "Treat-as-withdraw" MUST be used for the cases that specify a 238 session reset and involve any of the attributes ORIGIN, AS_PATH, 239 NEXT_HOP, MULTI_EXIT_DISC, or LOCAL_PREF. 241 f. "Attribute discard" MUST be used for any of the cases that 242 specify a session reset and involve ATOMIC_AGGREGATE or 243 AGGREGATOR. 245 g. If the MP_REACH_NLRI attribute or the MP_UNREACH_NLRI [RFC4760] 246 attribute appears more than once in the UPDATE message, then a 247 NOTIFICATION message MUST be sent with the Error Subcode 248 "Malformed Attribute List". If any other attribute (whether 249 recognized or unrecognized) appears more than once in an UPDATE 250 message, then all the occurrences of the attribute other than the 251 first one SHALL be discarded and the UPDATE message continue to 252 be processed. 254 h. When multiple attribute errors exist in an UPDATE message, if the 255 same approach (either "session reset", "treat-as-withdraw" or 256 "attribute discard") is specified for the handling of these 257 malformed attributes, then the specified approach MUST be used. 258 Otherwise the approach with the strongest action MUST be used. 260 i. The Withdrawn Routes field MUST be checked for syntactic 261 correctness in the same manner as the NLRI field. This is 262 discussed further below, and in Section 5.3. 264 j. Finally, we observe that in order to use the approach of "treat- 265 as-withdraw", the entire NLRI field and/or the MP_REACH_NLRI and 266 MP_UNREACH_NLRI attributes need to be successfully parsed -- what 267 this entails is discussed in more detail in Section 5. If this 268 is not possible, the procedures of [RFC4271] and/or [RFC4760] 269 continue to apply, meaning that the "session reset" approach (or 270 the "AFI/SAFI disable" approach) MUST be followed. 272 4. Attribute Length Fields 274 There are two error cases in which the Total Attribute Length value 275 can be in conflict with the enclosed path attributes, which 276 themselves carry length values. In the "overrun" case, as the 277 enclosed path attributes are parsed, the length of the last 278 encountered path attribute would cause the Total Attribute Length to 279 be exceeded. In the "underrun" case, as the enclosed path attributes 280 are parsed, after the last successfully-parsed attribute, fewer than 281 three octets remain, or fewer than four octets, if the Attribute 282 Flags field has the Extended Length bit set -- that is, there remains 283 unconsumed data in the path attributes but yet insufficient data to 284 encode a single minimum-sized path attribute. In either of these 285 cases an error condition exists and the treat-as-withdraw approach 286 MUST be used (unless some other, more severe error is encountered 287 dictating a stronger approach), and the Total Attribute Length MUST 288 be relied upon to enable the beginning of the NLRI field to be 289 located. 291 For all path attributes other than those specified as having an 292 attribute length that may be zero it SHALL be considered a syntax 293 error for the attribute to have a length of zero. (Of the path 294 attributes considered in this specification, only AS_PATH and 295 ATOMIC_AGGREGATE may validly have an attribute length of zero.) 297 5. Parsing of NLRI Fields 299 5.1. Encoding NLRI 301 To facilitate the determination of the NLRI field in an UPDATE with a 302 malformed attribute: 304 o The MP_REACH_NLRI or MP_UNREACH_NLRI attribute (if present) SHALL 305 be encoded as the very first path attribute in an UPDATE. 307 o An UPDATE message MUST NOT contain more than one of the following: 308 non-empty Withdrawn Routes field, non-empty Network Layer 309 Reachability Information field, MP_REACH_NLRI attribute, and 310 MP_UNREACH_NLRI attribute. 312 Since older BGP speakers may not implement these restrictions, an 313 implementation MUST still be prepared to receive these fields in any 314 position or combination. 316 If the encoding of [RFC4271] is used, the NLRI field for the IPv4 317 unicast address family is carried immediately following all the 318 attributes in an UPDATE. When such an UPDATE is received, we observe 319 that the NLRI field can be determined using the "Message Length", 320 "Withdrawn Route Length" and "Total Attribute Length" (when they are 321 consistent) carried in the message instead of relying on the length 322 of individual attributes in the message. 324 5.2. Missing NLRI 326 [RFC4724] specifies an End-of-RIB message ("EoR") that can be encoded 327 as an UPDATE message that contains only a MP_UNREACH_NLRI attribute 328 that encodes no NLRI (it can also be a completely empty UPDATE 329 message in the case of the "legacy" encoding). In all other well- 330 specified cases, an UPDATE either carries only withdrawn routes 331 (either in the Withdrawn Routes field, or the MP_UNREACH_NLRI 332 attribute), or it advertises reachable routes (either in the Network 333 Layer Reachability Information field, or the MP_REACH_NLRI 334 attribute). 336 Thus, if an UPDATE message is encountered that does contain path 337 attributes other than MP_UNREACH_NLRI and doesn't encode any 338 reachable NLRI, we cannot be confident that the NLRI have been 339 successfully parsed as Section 3 (j) requires. For this reason, if 340 any path attribute errors are encountered in such an UPDATE message, 341 and if any encountered error specifies an error-handling approach 342 other than "attribute discard", then the "session reset" approach 343 MUST be used. 345 5.3. Syntactic Correctness of NLRI Fields 347 The NLRI field or Withdrawn Routes field SHALL be considered 348 "syntactically incorrect" if either of the following are true: 350 o The length of any of the included NLRI is greater than 32, 352 o When parsing NLRI contained in the field, the length of the last 353 NLRI found exceeds the amount of unconsumed data remaining in the 354 field. 356 Similarly, the MP_REACH_NLRI or MP_UNREACH_NLRI attribute of an 357 update SHALL be considered to be incorrect if any of the following 358 are true: 360 o The length of any of the included NLRI is inconsistent with the 361 given AFI/SAFI (for example, if an IPv4 NLRI has a length greater 362 than 32 or an IPv6 NLRI has a length greater than 128), 364 o When parsing NLRI contained in the attribute, the length of the 365 last NLRI found exceeds the amount of unconsumed data remaining in 366 the attribute. 368 o The attribute flags of the attribute are inconsistent with those 369 specified in [RFC4760]. 371 o The length of the MP_UNREACH_NLRI attribute is less than 3, or the 372 length of the MP_REACH_NLRI attribute is less than 5. 374 5.4. Typed NLRI 376 Certain address families, for example MCAST-VPN [RFC6514], MCAST-VPLS 377 [RFC7117] and EVPN [I-D.ietf-l2vpn-evpn] have NLRI that are typed. 378 Since supported type values within the address family are not 379 expressed in the MP-BGP capability [RFC4760], it is possible for a 380 BGP speaker to advertise support for the given address family and 381 sub-address family while still not supporting a particular type of 382 NLRI within that AFI/SAFI. 384 A BGP speaker advertising support for such a typed address family 385 MUST handle routes with unrecognized NLRI types within that address 386 family by discarding them, unless the relevant specification for that 387 address family specifies otherwise. 389 6. Operational Considerations 391 Although the "treat-as-withdraw" error-handling behavior defined in 392 Section 2 makes every effort to preserve BGP's correctness, we note 393 that if an UPDATE received on an IBGP session is subjected to this 394 treatment, inconsistent routing within the affected Autonomous System 395 may result. The consequences of inconsistent routing can include 396 long-lived forwarding loops and black holes. While lamentable, this 397 issue is expected to be rare in practice, and more importantly is 398 seen as less problematic than the session-reset behavior it replaces. 400 When a malformed attribute is indeed detected over an IBGP session, 401 we RECOMMEND that routes with the malformed attribute be identified 402 and traced back to the ingress router in the network where the routes 403 were sourced or received externally, and then a filter be applied on 404 the ingress router to prevent the routes from being sourced or 405 received. This will help maintain routing consistency in the 406 network. 408 Even if inconsistent routing does not arise, the "treat-as-withdraw" 409 behavior can cause either complete unreachability or sub-optimal 410 routing for the destinations whose routes are carried in the affected 411 UPDATE message. 413 Note that "treat-as-withdraw" is different from discarding an UPDATE 414 message. The latter violates the basic BGP principle of incremental 415 update, and could cause invalid routes to be kept. 417 Because of these potential issues, a BGP speaker MUST provide 418 debugging facilities to permit issues caused by a malformed attribute 419 to be diagnosed. At a minimum, such facilities MUST include logging 420 an error listing the NLRI involved, and containing the entire 421 malformed UPDATE message when such an attribute is detected. The 422 malformed UPDATE message SHOULD be analyzed, and the root cause 423 SHOULD be investigated. 425 7. Error Handling Procedures for Existing Attributes 427 In the following subsections, we elaborate on the conditions for 428 error-checking various path attributes, and specify what approach(es) 429 should be used to handle malformations. It is possible that 430 implementations may apply other error checks not contemplated here. 431 If so, the error handling approach given here should generally be 432 applied. 434 This section addresses all path attributes that are defined at the 435 time of this writing, that were not defined with error-handling 436 consistent with Section 8, and that are not marked as "deprecated" in 437 [IANA-BGP-ATTRS]. Attributes 17 (AS4_PATH), 18 (AS4_AGGREGATOR), 22 438 (PMSI_TUNNEL), 23 (Tunnel Encapsulation Attribute), 26 (AIGP), 27 (PE 439 Distinguisher Labels) and 29 (BGP-LS Attribute) do have error- 440 handling consistent with Section 8 and thus are not further discussed 441 herein. Attributes 11 (DPA), 12 (ADVERTISER), 13 (RCID_PATH / 442 CLUSTER_ID), 19 (SAFI Specific Attribute), 20 (Connector Attribute) 443 and 21 (AS_PATHLIMIT) are deprecated and thus are not further 444 discussed herein. 446 7.1. ORIGIN 448 The attribute is considered malformed if its length is not 1, or it 449 has an undefined value [RFC4271]. 451 An UPDATE message with a malformed ORIGIN attribute SHALL be handled 452 using the approach of "treat-as-withdraw". 454 7.2. AS_PATH 456 An AS_PATH is considered malformed if an unrecognized segment type is 457 encountered, or if it contains a malformed segment. A segment is 458 considered malformed if any of the following obtains: 460 o There is an overrun, where the path segment length field of the 461 last segment encountered would cause the Attribute Length to be 462 exceeded. 464 o There is an underrun, where after the last successfully-parsed 465 segment, there is only a single octet remaining (that is, there is 466 not enough unconsumed data to provide even an empty segment 467 header). 469 o It has a path segment length field of zero. 471 An UPDATE message with a malformed AS_PATH attribute SHALL be handled 472 using the approach of "treat-as-withdraw". 474 [RFC4271] also says that an implementation optionally "MAY check 475 whether the leftmost ... AS in the AS_PATH attribute is equal to the 476 autonomous system number of the peer that sent the message". A BGP 477 implementation SHOULD also handle routes that violate this check 478 using "treat-as-withdraw", but MAY follow the session reset behavior 479 if configured to do so. 481 7.3. NEXT_HOP 483 According to [RFC4271] the attribute is considered malformed if it is 484 syntactically incorrect. To quote from that document, "Syntactic 485 correctness means that the NEXT_HOP attribute represents a valid IP 486 host address", but it does not go on to define what it means to be a 487 "valid IP host address". Therefore: 489 An IP host address SHOULD be considered invalid if it appears in the 490 "IANA IPv4 Special-Purpose Address Registry" [IANA-IPV4] and either 491 the "destination" or the "forwardable" boolean in that registry is 492 given as "false". An implementation SHOULD provide a means to modify 493 the list of invalid host addresses by configuration -- these are 494 sometimes referred to as "Martians". 496 An UPDATE message with a malformed NEXT_HOP attribute SHALL be 497 handled using the approach of "treat-as-withdraw". 499 7.4. MULTI_EXIT_DISC 501 The attribute is considered malformed if its length is not 4 502 [RFC4271]. 504 An UPDATE message with a malformed MULTI_EXIT_DISC attribute SHALL be 505 handled using the approach of "treat-as-withdraw". 507 7.5. LOCAL_PREF 509 The error handling of [RFC4271] is revised as follows. 511 o If the LOCAL_PREF attribute is received from an external neighbor, 512 it SHALL be discarded using the approach of "attribute discard", 513 or 515 o if received from an internal neighbor, it SHALL be considered 516 malformed if its length is not equal to 4. If malformed, the 517 UPDATE SHALL be handled using the approach of "treat-as-withdraw". 519 7.6. ATOMIC_AGGREGATE 521 The attribute SHALL be considered malformed if its length is not 0 522 [RFC4271]. 524 An UPDATE message with a malformed ATOMIC_AGGREGATE attribute SHALL 525 be handled using the approach of "attribute discard". 527 7.7. AGGREGATOR 529 The error conditions specified in [RFC4271] for the attribute are 530 revised as follows: 532 The AGGREGATOR attribute SHALL be considered malformed if any of the 533 following applies: 535 o Its length is not 6 (when the "4-octet AS number capability" is 536 not advertised to, or not received from the peer [RFC6793]). 538 o Its length is not 8 (when the "4-octet AS number capability" is 539 both advertised to, and received from the peer). 541 An UPDATE message with a malformed AGGREGATOR attribute SHALL be 542 handled using the approach of "attribute discard". 544 7.8. Community 546 The error handling of [RFC1997] is revised as follows: 548 The Community attribute SHALL be considered malformed if its length 549 is not a nonzero multiple of 4. 551 An UPDATE message with a malformed Community attribute SHALL be 552 handled using the approach of "treat-as-withdraw". 554 7.9. ORIGINATOR_ID 556 The error handling of [RFC4456] is revised as follows. 558 o If the ORIGINATOR_ID attribute is received from an external 559 neighbor, it SHALL be discarded using the approach of "attribute 560 discard", or 562 o if received from an internal neighbor, it SHALL be considered 563 malformed if its length is not equal to 4. If malformed, the 564 UPDATE SHALL be handled using the approach of "treat-as-withdraw". 566 7.10. CLUSTER_LIST 568 The error handling of [RFC4456] is revised as follows. 570 o If the CLUSTER_LIST attribute is received from an external 571 neighbor, it SHALL be discarded using the approach of "attribute 572 discard", or 574 o if received from an internal neighbor, it SHALL be considered 575 malformed if its length is not a nonzero multiple of 4. If 576 malformed, the UPDATE SHALL be handled using the approach of 577 "treat-as-withdraw". 579 7.11. MP_REACH_NLRI 581 [RFC4760] references the error-handling of the base BGP specification 582 for validation of the next hop. ("The rules for the next hop 583 information are the same as the rules for the information carried in 584 the NEXT_HOP BGP attribute".) Thus just as in Section 7.3 we must 585 consider what it means for the Next Hop field of the MP_REACH 586 attribute to be a "valid host address": 588 o If the Next Hop field contains an IPv4 address (possibly as a sub- 589 field), the field SHOULD be considered invalid if the IPv4 address 590 appears in the ""IANA IPv4 Special-Purpose Address Registry" 591 [IANA-IPV4] and either the "destination" or the "forwardable" 592 boolean in that registry is given as "false". 594 o If the Next Hop field contains an IPv6 address (possibly as a sub- 595 field), the field SHOULD be considered invalid if the IPv6 address 596 appears in the "IANA IPv6 Special-Purpose Address Registry" 597 [IANA-IPV6], the address is not an IPv4-mapped IPv6 address, and 598 either the "destination" or the "forwardable" boolean in that 599 registry is given as "false". 601 o If the Next Hop field contains an IPv4-mapped IPv6 address 602 (possibly as a sub-field), the field SHOULD be considered invalid 603 unless the use of such addresses has been explicitly allowed for 604 the particular AFI/SAFI that occurs in this MP_REACH_NLRI 605 attribute. (E.g., see [RFC4659] and [RFC4798].) 607 o If the Next Hop field is some other form of address, it should be 608 considered invalid in circumstances analogous to the above -- if 609 it is found in the relevant IANA special-purpose address registry 610 (if any) and its "destination" or "forwardable" boolean is given 611 as "false". 613 o An implementation SHOULD provide a means to modify the list of 614 invalid host addresses by configuration -- these are sometimes 615 referred to as "Martians". 617 Section 3 and Section 5 provide further discussion of the handling of 618 this attribute. 620 7.12. MP_UNREACH_NLRI 622 Section 3 and Section 5 discuss the handling of this attribute. 624 7.13. Traffic Engineering path attribute 626 We note that [RFC5543] does not detail what constitutes 627 "malformation" for the Traffic Engineering path attribute. A future 628 update to that specification may provide more guidance. In the 629 interim, an implementation that determines (for whatever reason) that 630 an UPDATE message contains a malformed Traffic Engineering path 631 attribute MUST handle it using the approach of "treat-as-withdraw". 633 7.14. Extended Community 635 The error handling of [RFC4360] is revised as follows: 637 The Extended Community attribute SHALL be considered malformed if its 638 length is not a nonzero multiple of 8. 640 An UPDATE message with a malformed Extended Community attribute SHALL 641 be handled using the approach of "treat-as-withdraw". 643 Note that a BGP speaker MUST NOT treat an unrecognized Extended 644 Community Type or Sub-Type as an error. 646 7.15. IPv6 Address Specific BGP Extended Community Attribute 648 The error handling of [RFC5701] is revised as follows: 650 The IPv6 Address Specific Extended Community attribute SHALL be 651 considered malformed if its length is not a nonzero multiple of 20. 653 An UPDATE message with a malformed IPv6 Address Specific Extended 654 Community attribute SHALL be handled using the approach of "treat-as- 655 withdraw". 657 Note that a BGP speaker MUST NOT treat an unrecognized IPv6 Address 658 Specific Extended Community Type or Sub-Type as an error. 660 7.16. BGP Entropy Label Capability Attribute 662 The error handling of [RFC6790] is revised as follows. 664 No syntax errors are defined for the Entropy Label Capability 665 attribute (ELCA). However, if any implementation does for some local 666 reason determine that a syntax error exists with the ELCA, the error 667 SHALL be handled using the approach of "attribute discard". 669 7.17. ATTR_SET 671 The final paragraph of Section 5 of [RFC6368] is revised as follows: 673 Old Text: 675 An UPDATE message with a malformed ATTR_SET attribute SHALL be 676 handled as follows. If its Partial flag is set and its 677 Neighbor-Complete flag is clear, the UPDATE is treated as a 678 route withdraw as discussed in [OPT-TRANS-BGP]. Otherwise 679 (i.e., Partial flag is clear or Neighbor-Complete is set), the 680 procedures of the BGP-4 base specification [RFC4271] MUST be 681 followed with respect to an Optional Attribute Error. 683 New Text: 685 An UPDATE message with a malformed ATTR_SET attribute SHALL be 686 handled using the approach of "treat as withdraw". 688 Furthermore, the normative reference to [OPT-TRANS-BGP] in [RFC6368] 689 is removed. 691 8. Guidance for Authors of BGP Specifications 693 A document that specifies a new BGP attribute MUST provide specifics 694 regarding what constitutes an error for that attribute and how that 695 error is to be handled. Allowable error-handling approaches are 696 detailed in Section 2. The treat-as-withdraw approach is generally 697 preferred. The document SHOULD also provide consideration of what 698 debugging facilities may be required to permit issues caused by a 699 malformed attribute to be diagnosed. 701 For any malformed attribute that is handled by the "attribute 702 discard" instead of the "treat-as-withdraw" approach, it is critical 703 to consider the potential impact of doing so. In particular, if the 704 attribute in question has or may have an effect on route selection or 705 installation, the presumption is that discarding it is unsafe, unless 706 careful analysis proves otherwise. The analysis should take into 707 account the tradeoff between preserving connectivity and potential 708 side effects. 710 Authors can refer to Section 7 for examples. 712 9. IANA Considerations 714 This document makes no request of IANA. 716 10. Security Considerations 718 This specification addresses the vulnerability of a BGP speaker to a 719 potential attack whereby a distant attacker can generate a malformed 720 optional transitive attribute that is not recognized by intervening 721 routers (which thus propagate the attribute unchecked) but that 722 causes session resets when it reaches routers that do recognize the 723 given attribute type. 725 In other respects, this specification does not change BGP's security 726 characteristics. 728 11. Acknowledgements 730 The authors wish to thank Juan Alcaide, Deniz Bahadir, Ron Bonica, 731 Mach Chen, Andy Davidson, Bruno Decraene, Rex Fernando, Jeff Haas, 732 Chris Hall, Joel Halpern, Dong Jie, Akira Kato, Miya Kohno, Tony Li, 733 Alton Lo, Shin Miyakawa, Tamas Mondal, Jonathan Oddy, Tony 734 Przygienda, Robert Raszuk, Yakov Rekhter, Eric Rosen, Shyam Sethuram, 735 Rob Shakir, Naiming Shen, Adam Simpson, Ananth Suryanarayana, Kaliraj 736 Vairavakkalai, Lili Wang and Ondrej Zajicek for their observations 737 and discussion of this topic, and review of this document. 739 12. References 741 12.1. Normative References 743 [IANA-BGP-ATTRS] 744 "BGP Path Attributes", . 747 [IANA-IPV4] 748 "IANA IPv4 Special-Purpose Address Registry", 749 . 752 [IANA-IPV6] 753 "IANA IPv4 Special-Purpose Address Registry", 754 . 757 [RFC1997] Chandrasekeran, R., Traina, P., and T. Li, "BGP 758 Communities Attribute", RFC 1997, August 1996. 760 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 761 Requirement Levels", BCP 14, RFC 2119, March 1997. 763 [RFC4271] Rekhter, Y., Li, T., and S. Hares, "A Border Gateway 764 Protocol 4 (BGP-4)", RFC 4271, January 2006. 766 [RFC4360] Sangli, S., Tappan, D., and Y. Rekhter, "BGP Extended 767 Communities Attribute", RFC 4360, February 2006. 769 [RFC4456] Bates, T., Chen, E., and R. Chandra, "BGP Route 770 Reflection: An Alternative to Full Mesh Internal BGP 771 (IBGP)", RFC 4456, April 2006. 773 [RFC4724] Sangli, S., Chen, E., Fernando, R., Scudder, J., and Y. 774 Rekhter, "Graceful Restart Mechanism for BGP", RFC 4724, 775 January 2007. 777 [RFC4760] Bates, T., Chandra, R., Katz, D., and Y. Rekhter, 778 "Multiprotocol Extensions for BGP-4", RFC 4760, January 779 2007. 781 [RFC5543] Ould-Brahim, H., Fedyk, D., and Y. Rekhter, "BGP Traffic 782 Engineering Attribute", RFC 5543, May 2009. 784 [RFC5701] Rekhter, Y., "IPv6 Address Specific BGP Extended Community 785 Attribute", RFC 5701, November 2009. 787 [RFC6368] Marques, P., Raszuk, R., Patel, K., Kumaki, K., and T. 788 Yamagata, "Internal BGP as the Provider/Customer Edge 789 Protocol for BGP/MPLS IP Virtual Private Networks (VPNs)", 790 RFC 6368, September 2011. 792 [RFC6790] Kompella, K., Drake, J., Amante, S., Henderickx, W., and 793 L. Yong, "The Use of Entropy Labels in MPLS Forwarding", 794 RFC 6790, November 2012. 796 [RFC6793] Vohra, Q. and E. Chen, "BGP Support for Four-Octet 797 Autonomous System (AS) Number Space", RFC 6793, December 798 2012. 800 12.2. Informative References 802 [I-D.ietf-l2vpn-evpn] 803 Sajassi, A., Aggarwal, R., Bitar, N., Isaac, A., and J. 804 Uttaro, "BGP MPLS Based Ethernet VPN", draft-ietf-l2vpn- 805 evpn-07 (work in progress), May 2014. 807 [RFC4659] De Clercq, J., Ooms, D., Carugi, M., and F. Le Faucheur, 808 "BGP-MPLS IP Virtual Private Network (VPN) Extension for 809 IPv6 VPN", RFC 4659, September 2006. 811 [RFC4798] De Clercq, J., Ooms, D., Prevost, S., and F. Le Faucheur, 812 "Connecting IPv6 Islands over IPv4 MPLS Using IPv6 813 Provider Edge Routers (6PE)", RFC 4798, February 2007. 815 [RFC6514] Aggarwal, R., Rosen, E., Morin, T., and Y. Rekhter, "BGP 816 Encodings and Procedures for Multicast in MPLS/BGP IP 817 VPNs", RFC 6514, February 2012. 819 [RFC7117] Aggarwal, R., Kamite, Y., Fang, L., Rekhter, Y., and C. 820 Kodeboniya, "Multicast in Virtual Private LAN Service 821 (VPLS)", RFC 7117, February 2014. 823 Authors' Addresses 825 Enke Chen (editor) 826 Cisco Systems, Inc. 828 Email: enkechen@cisco.com 830 John G. Scudder (editor) 831 Juniper Networks 833 Email: jgs@juniper.net 835 Pradosh Mohapatra 836 Sproute Networks 838 Email: mpradosh@yahoo.com 840 Keyur Patel 841 Cisco Systems, Inc. 843 Email: keyupate@cisco.com