idnits 2.17.1 draft-ietf-idr-bgp4-15.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document is more than 15 pages and seems to lack a Table of Contents. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 59 longer pages, the longest (page 2) being 61 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Abstract section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 2 instances of too long lines in the document, the longest one being 5 characters in excess of 72. == There are 4 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 405: '...sage, a BGP speaker MUST calculate the...' RFC 2119 keyword, line 408: '... Hold Time MUST be either zero o...' RFC 2119 keyword, line 798: '...er a BGP speaker MUST be able to proce...' RFC 2119 keyword, line 808: '... interval. KEEPALIVE messages MUST NOT...' RFC 2119 keyword, line 809: '... one per second. An implementation MAY...' (33 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 2645 has weird spacing: '...hen all the d...' -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- Couldn't find a document date in the document -- date freshness check skipped. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Historic RFC: RFC 904 (ref. '1') ** Downref: Normative reference to an Unknown state RFC: RFC 1092 (ref. '2') ** Downref: Normative reference to an Unknown state RFC: RFC 1093 (ref. '3') ** Obsolete normative reference: RFC 793 (ref. '4') (Obsoleted by RFC 9293) -- Possible downref: Non-RFC (?) normative reference: ref. '6' -- Possible downref: Non-RFC (?) normative reference: ref. '7' ** Obsolete normative reference: RFC 1519 (ref. '8') (Obsoleted by RFC 4632) ** Downref: Normative reference to an Historic RFC: RFC 1518 (ref. '9') ** Obsolete normative reference: RFC 2385 (ref. '10') (Obsoleted by RFC 5925) ** Obsolete normative reference: RFC 2796 (ref. '11') (Obsoleted by RFC 4456) ** Obsolete normative reference: RFC 3065 (ref. '13') (Obsoleted by RFC 5065) Summary: 17 errors (**), 0 flaws (~~), 4 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Y. Rekhter 3 INTERNET DRAFT Juniper Networks 4 T. Li 5 Procket Networks, Inc. 6 Editors 8 A Border Gateway Protocol 4 (BGP-4) 9 11 Status of this Memo 13 This document is an Internet-Draft and is in full conformance with 14 all provisions of Section 10 of RFC2026. 16 Internet-Drafts are working documents of the Internet Engineering 17 Task Force (IETF), its areas, and its working groups. Note that 18 other groups may also distribute working documents as Internet- 19 Drafts. 21 Internet-Drafts are draft documents valid for a maximum of six months 22 and may be updated, replaced, or obsoleted by other documents at any 23 time. It is inappropriate to use Internet-Drafts as reference 24 material or to cite them other than as ``work in progress.'' 26 The list of current Internet-Drafts can be accessed at 27 http://www.ietf.org/ietf/1id-abstracts.txt 29 The list of Internet-Draft Shadow Directories can be accessed at 30 http://www.ietf.org/shadow.html. 32 1. Acknowledgments 34 This document was originally published as RFC 1267 in October 1991, 35 jointly authored by Kirk Lougheed and Yakov Rekhter. 37 We would like to express our thanks to Guy Almes, Len Bosack, and 38 Jeffrey C. Honig for their contributions to the earlier version of 39 this document. 41 We like to explicitly thank Bob Braden for the review of the earlier 42 version of this document as well as his constructive and valuable 43 comments. 45 RFC DRAFT November 2001 47 We would also like to thank Bob Hinden, Director for Routing of the 48 Internet Engineering Steering Group, and the team of reviewers he 49 assembled to review the earlier version (BGP-2) of this document. 50 This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia 51 Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted 52 with a strong combination of toughness, professionalism, and 53 courtesy. 55 This updated version of the document is the product of the IETF IDR 56 Working Group with Yakov Rekhter and Tony Li as editors. Certain 57 sections of the document borrowed heavily from IDRP [7], which is the 58 OSI counterpart of BGP. For this credit should be given to the ANSI 59 X3S3.3 group chaired by Lyman Chapin and to Charles Kunzinger who was 60 the IDRP editor within that group. We would also like to thank Enke 61 Chen, Edward Crabbe, Mike Craren, Vincent Gillet, Eric Gray, Jeffrey 62 Haas, Dimitry Haskin, John Krawczyk, David LeRoy, Dan Massey, Dan 63 Pei, Mathew Richardson, John Scudder, John Stewart III, Dave Thaler, 64 Paul Traina, Curtis Villamizar, and Alex Zinin for their comments. 66 We would like to specially acknowledge numerous contributions by 67 Dennis Ferguson. 69 2. Introduction 71 The Border Gateway Protocol (BGP) is an inter-Autonomous System 72 routing protocol. It is built on experience gained with EGP as 73 defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as 74 described in RFC 1092 [2] and RFC 1093 [3]. 76 The primary function of a BGP speaking system is to exchange network 77 reachability information with other BGP systems. This network 78 reachability information includes information on the list of 79 Autonomous Systems (ASs) that reachability information traverses. 80 This information is sufficient to construct a graph of AS 81 connectivity from which routing loops may be pruned and some policy 82 decisions at the AS level may be enforced. 84 BGP-4 provides a new set of mechanisms for supporting Classless 85 Inter-Domain Routing (CIDR) [8, 9]. These mechanisms include support 86 for advertising an IP prefix and eliminates the concept of network 87 "class" within BGP. BGP-4 also introduces mechanisms which allow 88 aggregation of routes, including aggregation of AS paths. 90 To characterize the set of policy decisions that can be enforced 91 using BGP, one must focus on the rule that a BGP speaker advertises 92 to its peers (other BGP speakers which it communicates with) in 93 neighboring ASs only those routes that it itself uses. This rule 94 RFC DRAFT November 2001 96 reflects the "hop-by-hop" routing paradigm generally used throughout 97 the current Internet. Note that some policies cannot be supported by 98 the "hop-by-hop" routing paradigm and thus require techniques such as 99 source routing (aka explicit routing) to enforce. For example, BGP 100 does not enable one AS to send traffic to a neighboring AS intending 101 that the traffic take a different route from that taken by traffic 102 originating in the neighboring AS. On the other hand, BGP can support 103 any policy conforming to the "hop-by-hop" routing paradigm. Since the 104 current Internet uses only the "hop-by-hop" inter-AS routing paradigm 105 and since BGP can support any policy that conforms to that paradigm, 106 BGP is highly applicable as an inter-AS routing protocol for the 107 current Internet. 109 A more complete discussion of what policies can and cannot be 110 enforced with BGP is outside the scope of this document (but refer to 111 the companion document discussing BGP usage [5]). 113 BGP runs over a reliable transport protocol. This eliminates the need 114 to implement explicit update fragmentation, retransmission, 115 acknowledgment, and sequencing. Any authentication scheme used by the 116 transport protocol (e.g., RFC2385 [10]) may be used in addition to 117 BGP's own authentication mechanisms. The error notification mechanism 118 used in BGP assumes that the transport protocol supports a "graceful" 119 close, i.e., that all outstanding data will be delivered before the 120 connection is closed. 122 BGP uses TCP [4] as its transport protocol. TCP meets BGP's transport 123 requirements and is present in virtually all commercial routers and 124 hosts. In the following descriptions the phrase "transport protocol 125 connection" can be understood to refer to a TCP connection. BGP uses 126 TCP port 179 for establishing its connections. 128 This document uses the term `Autonomous System' (AS) throughout. The 129 classic definition of an Autonomous System is a set of routers under 130 a single technical administration, using an interior gateway protocol 131 and common metrics to determine how to route packets within the AS, 132 and using an exterior gateway protocol to determine how to route 133 packets to other ASs. Since this classic definition was developed, it 134 has become common for a single AS to use several interior gateway 135 protocols and sometimes several sets of metrics within an AS. The use 136 of the term Autonomous System here stresses the fact that, even when 137 multiple IGPs and metrics are used, the administration of an AS 138 appears to other ASs to have a single coherent interior routing plan 139 and presents a consistent picture of what destinations are reachable 140 through it. 142 The planned use of BGP in the Internet environment, including such 143 issues as topology, the interaction between BGP and IGPs, and the 144 RFC DRAFT November 2001 146 enforcement of routing policy rules is presented in a companion 147 document [5]. This document is the first of a series of documents 148 planned to explore various aspects of BGP application. 150 3. Summary of Operation 152 Two systems form a transport protocol connection between one another. 153 They exchange messages to open and confirm the connection parameters. 155 The initial data flow is the portion of the BGP routing table that is 156 allowed by the export policy, called the Adj-Ribs-Out (see 3.2). 157 Incremental updates are sent as the routing tables change. BGP does 158 not require periodic refresh of the routing table. Therefore, A BGP 159 speaker must retain the current version of the routes advertised by 160 all of its peers for the duration of the connection. If the 161 implementation decides to not store the routes that have been 162 received from a peer, but have been filtered out according to 163 configured local policy, the BGP Route Refresh extension [12] may be 164 used to request the full set of routes from a peer without resetting 165 the BGP session when the local policy configuration changes. 167 KEEPALIVE messages are sent periodically to ensure the liveness of 168 the connection. NOTIFICATION messages are sent in response to errors 169 or special conditions. If a connection encounters an error condition, 170 a NOTIFICATION message is sent and the connection is closed. 172 The hosts executing the Border Gateway Protocol need not be routers. 173 A non-routing host could exchange routing information with routers 174 via EGP or even an interior routing protocol. That non-routing host 175 could then use BGP to exchange routing information with a border 176 router in another Autonomous System. The implications and 177 applications of this architecture are for further study. 179 Connections between BGP speakers of different ASs are referred to as 180 "external" links. BGP connections between BGP speakers within the 181 same AS are referred to as "internal" links. Similarly, a peer in a 182 different AS is referred to as an external peer, while a peer in the 183 same AS may be described as an internal peer. Internal BGP and 184 external BGP are commonly abbreviated IBGP and EBGP. 186 If a particular AS has multiple BGP speakers and is providing transit 187 service for other ASs, then care must be taken to ensure a consistent 188 view of routing within the AS. A consistent view of the interior 189 routes of the AS is provided by the interior routing protocol. A 190 consistent view of the routes exterior to the AS can be provided by 191 having all BGP speakers within the AS maintain direct IBGP 192 connections with each other. Alternately the interior routing 193 RFC DRAFT November 2001 195 protocol can pass BGP information among routers within an AS, taking 196 care not to lose BGP attributes that will be needed by EBGP speakers 197 if transit connectivity is being provided. For the purpose of 198 discussion, it is assumed that BGP information is passed within an AS 199 using IBGP. Care must be taken to ensure that the interior routers 200 have all been updated with transit information before the EBGP 201 speakers announce to other ASs that transit service is being 202 provided. 204 3.1 Routes: Advertisement and Storage 206 For purposes of this protocol a route is defined as a unit of 207 information that pairs a destination with the attributes of a path to 208 that destination, where the destination is the systems whose IP 209 addresses are reported in the Network Layer Reachability Information 210 (NLRI) field, and the path is the information reported in the path 211 attributes fields of the same UPDATE message. 213 Routes are advertised between BGP speakers in UPDATE messages. 215 Routes are stored in the Routing Information Bases (RIBs): namely, 216 the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes that will 217 be advertised to other BGP speakers must be present in the Adj-RIB- 218 Out. Routes that will be used by the local BGP speaker must be 219 present in the Loc-RIB, and the next hop for each of these routes 220 must be present in the local BGP speaker's Routing Table. Routes 221 that are received from other BGP speakers are present in the Adj- 222 RIBs-In. 224 If a BGP speaker chooses to advertise the route, it may add to or 225 modify the path attributes of the route before advertising it to a 226 peer. 228 BGP provides mechanisms by which a BGP speaker can inform its peer 229 that a previously advertised route is no longer available for use. 230 There are three methods by which a given BGP speaker can indicate 231 that a route has been withdrawn from service: 233 a) the IP prefix that expresses the destination for a previously 234 advertised route can be advertised in the WITHDRAWN ROUTES field 235 in the UPDATE message, thus marking the associated route as being 236 no longer available for use 238 b) a replacement route with the same NLRI can be advertised, or 240 c) the BGP speaker - BGP speaker connection can be closed, which 241 implicitly removes from service all routes which the pair of 242 RFC DRAFT November 2001 244 speakers had advertised to each other. 246 3.2 Routing Information Bases 248 The Routing Information Base (RIB) within a BGP speaker consists of 249 three distinct parts: 251 a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has 252 been learned from inbound UPDATE messages. Their contents 253 represent routes that are available as an input to the Decision 254 Process. 256 b) Loc-RIB: The Loc-RIB contains the local routing information 257 that the BGP speaker has selected by applying its local policies 258 to the routing information contained in its Adj-RIBs-In. 260 c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the 261 local BGP speaker has selected for advertisement to its peers. The 262 routing information stored in the Adj-RIBs-Out will be carried in 263 the local BGP speaker's UPDATE messages and advertised to its 264 peers. 266 In summary, the Adj-RIBs-In contain unprocessed routing information 267 that has been advertised to the local BGP speaker by its peers; the 268 Loc-RIB contains the routes that have been selected by the local BGP 269 speaker's Decision Process; and the Adj-RIBs-Out organize the routes 270 for advertisement to specific peers by means of the local speaker's 271 UPDATE messages. 273 Although the conceptual model distinguishes between Adj-RIBs-In, Loc- 274 RIB, and Adj-RIBs-Out, this neither implies nor requires that an 275 implementation must maintain three separate copies of the routing 276 information. The choice of implementation (for example, 3 copies of 277 the information vs 1 copy with pointers) is not constrained by the 278 protocol. 280 Routing information that the router uses to forward packets (or to 281 construct the forwarding table that is used for packet forwarding) is 282 maintained in the Routing Table. The Routing Table accumulates routes 283 to directly connected networks, static routes, routes learned from 284 the IGP protocols, and routes learned from BGP. Whether or not a 285 specific BGP route should be installed in the Routing Table, and 286 whether a BGP route should override a route to the same destination 287 installed by another source is a local policy decision, not specified 288 in this document. Besides actual packet forwarding, the Routing Table 289 is used for resolution of the next-hop addresses specified in BGP 290 updates (see Section 9.1.2). 292 RFC DRAFT November 2001 294 4. Message Formats 296 This section describes message formats used by BGP. 298 Messages are sent over a reliable transport protocol connection. A 299 message is processed only after it is entirely received. The maximum 300 message size is 4096 octets. All implementations are required to 301 support this maximum message size. The smallest message that may be 302 sent consists of a BGP header without a data portion, or 19 octets. 304 4.1 Message Header Format 306 Each message has a fixed-size header. There may or may not be a data 307 portion following the header, depending on the message type. The 308 layout of these fields is shown below: 310 0 1 2 3 311 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 312 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 313 | | 314 + + 315 | | 316 + + 317 | Marker | 318 + + 319 | | 320 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 321 | Length | Type | 322 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 324 Marker: 326 This 16-octet field contains a value that the receiver of the 327 message can predict. If the Type of the message is OPEN, or if 328 the OPEN message carries no Authentication Information (as an 329 Optional Parameter), then the Marker must be all ones. 330 Otherwise, the value of the marker can be predicted by some a 331 computation specified as part of the authentication mechanism 332 (which is specified as part of the Authentication Information) 333 used. The Marker can be used to detect loss of synchronization 334 between a pair of BGP peers, and to authenticate incoming BGP 335 messages. 337 Length: 339 RFC DRAFT November 2001 341 This 2-octet unsigned integer indicates the total length of the 342 message, including the header, in octets. Thus, e.g., it allows 343 one to locate in the transport-level stream the (Marker field 344 of the) next message. The value of the Length field must always 345 be at least 19 and no greater than 4096, and may be further 346 constrained, depending on the message type. No "padding" of 347 extra data after the message is allowed, so the Length field 348 must have the smallest value required given the rest of the 349 message. 351 Type: 353 This 1-octet unsigned integer indicates the type code of the 354 message. The following type codes are defined: 356 1 - OPEN 357 2 - UPDATE 358 3 - NOTIFICATION 359 4 - KEEPALIVE 361 4.2 OPEN Message Format 363 After a transport protocol connection is established, the first 364 message sent by each side is an OPEN message. If the OPEN message is 365 acceptable, a KEEPALIVE message confirming the OPEN is sent back. 366 Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION 367 messages may be exchanged. 369 In addition to the fixed-size BGP header, the OPEN message contains 370 the following fields: 372 0 1 2 3 373 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 374 +-+-+-+-+-+-+-+-+ 375 | Version | 376 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 377 | My Autonomous System | 378 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 379 | Hold Time | 380 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 381 | BGP Identifier | 382 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 383 | Opt Parm Len | 384 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 385 | | 386 | Optional Parameters | 387 | | 388 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 389 RFC DRAFT November 2001 391 Version: 393 This 1-octet unsigned integer indicates the protocol version 394 number of the message. The current BGP version number is 4. 396 My Autonomous System: 398 This 2-octet unsigned integer indicates the Autonomous System 399 number of the sender. 401 Hold Time: 403 This 2-octet unsigned integer indicates the number of seconds 404 that the sender proposes for the value of the Hold Timer. Upon 405 receipt of an OPEN message, a BGP speaker MUST calculate the 406 value of the Hold Timer by using the smaller of its configured 407 Hold Time and the Hold Time received in the OPEN message. The 408 Hold Time MUST be either zero or at least three seconds. An 409 implementation may reject connections on the basis of the Hold 410 Time. The calculated value indicates the maximum number of 411 seconds that may elapse between the receipt of successive 412 KEEPALIVE, and/or UPDATE messages by the sender. 414 BGP Identifier: 416 This 4-octet unsigned integer indicates the BGP Identifier of 417 the sender. A given BGP speaker sets the value of its BGP 418 Identifier to an IP address assigned to that BGP speaker. The 419 value of the BGP Identifier is determined on startup and is the 420 same for every local interface and every BGP peer. 422 Optional Parameters Length: 424 This 1-octet unsigned integer indicates the total length of the 425 Optional Parameters field in octets. If the value of this field 426 is zero, no Optional Parameters are present. 428 Optional Parameters: 430 This field may contain a list of optional parameters, where 431 each parameter is encoded as a triplet. 434 0 1 435 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 436 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 437 | Parm. Type | Parm. Length | Parameter Value (variable) 438 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 440 RFC DRAFT November 2001 442 Parameter Type is a one octet field that unambiguously 443 identifies individual parameters. Parameter Length is a one 444 octet field that contains the length of the Parameter Value 445 field in octets. Parameter Value is a variable length field 446 that is interpreted according to the value of the Parameter 447 Type field. 449 This document defines the following Optional Parameters: 451 a) Authentication Information (Parameter Type 1): 453 This optional parameter may be used to authenticate a BGP 454 peer. The Parameter Value field contains a 1-octet 455 Authentication Code followed by a variable length 456 Authentication Data. 458 0 1 2 3 4 5 6 7 8 459 +-+-+-+-+-+-+-+-+ 460 | Auth. Code | 461 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 462 | | 463 | Authentication Data | 464 | | 465 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 467 Authentication Code: 469 This 1-octet unsigned integer indicates the 470 authentication mechanism being used. Whenever an 471 authentication mechanism is specified for use within 472 BGP, three things must be included in the 473 specification: 475 - the value of the Authentication Code which indicates 476 use of the mechanism, 477 - the form and meaning of the Authentication Data, and 478 - the algorithm for computing values of Marker fields. 480 Note that a separate authentication mechanism may be 481 used in establishing the transport level connection. 483 Authentication Data: 485 Authentication Data is a variable length field that is 486 interpreted according to the value of the 487 Authentication Code field. 489 RFC DRAFT November 2001 491 The minimum length of the OPEN message is 29 octets (including 492 message header). 494 4.3 UPDATE Message Format 496 UPDATE messages are used to transfer routing information between BGP 497 peers. The information in the UPDATE packet can be used to construct 498 a graph describing the relationships of the various Autonomous 499 Systems. By applying rules to be discussed, routing information loops 500 and some other anomalies may be detected and removed from inter-AS 501 routing. 503 An UPDATE message is used to advertise a single feasible route to a 504 peer, or to withdraw multiple unfeasible routes from service (see 505 3.1). An UPDATE message may simultaneously advertise a feasible route 506 and withdraw multiple unfeasible routes from service. The UPDATE 507 message always includes the fixed-size BGP header, and also includes 508 the other fields as shown below (note, some of the shown fields may 509 not be present in every UPDATE message): 511 +-----------------------------------------------------+ 512 | Withdrawn Routes Length (2 octets) | 513 +-----------------------------------------------------+ 514 | Withdrawn Routes (variable) | 515 +-----------------------------------------------------+ 516 | Total Path Attribute Length (2 octets) | 517 +-----------------------------------------------------+ 518 | Path Attributes (variable) | 519 +-----------------------------------------------------+ 520 | Network Layer Reachability Information (variable) | 521 +-----------------------------------------------------+ 523 Withdrawn Routes Length: 525 This 2-octets unsigned integer indicates the total length of 526 the Withdrawn Routes field in octets. Its value must allow the 527 length of the Network Layer Reachability Information field to 528 be determined as specified below. 530 A value of 0 indicates that no routes are being withdrawn from 531 service, and that the WITHDRAWN ROUTES field is not present in 532 this UPDATE message. 534 RFC DRAFT November 2001 536 Withdrawn Routes: 538 This is a variable length field that contains a list of IP 539 address prefixes for the routes that are being withdrawn from 540 service. Each IP address prefix is encoded as a 2-tuple of the 541 form , whose fields are described below: 543 +---------------------------+ 544 | Length (1 octet) | 545 +---------------------------+ 546 | Prefix (variable) | 547 +---------------------------+ 549 The use and the meaning of these fields are as follows: 551 a) Length: 553 The Length field indicates the length in bits of the IP 554 address prefix. A length of zero indicates a prefix that 555 matches all IP addresses (with prefix, itself, of zero 556 octets). 558 b) Prefix: 560 The Prefix field contains an IP address prefix followed by 561 enough trailing bits to make the end of the field fall on an 562 octet boundary. Note that the value of trailing bits is 563 irrelevant. 565 Total Path Attribute Length: 567 This 2-octet unsigned integer indicates the total length of the 568 Path Attributes field in octets. Its value must allow the 569 length of the Network Layer Reachability field to be determined 570 as specified below. 572 A value of 0 indicates that no Network Layer Reachability 573 Information field is present in this UPDATE message. 575 Path Attributes: 577 A variable length sequence of path attributes is present in 578 every UPDATE. Each path attribute is a triple of variable length. 581 Attribute Type is a two-octet field that consists of the 582 RFC DRAFT November 2001 584 Attribute Flags octet followed by the Attribute Type Code 585 octet. 587 0 1 588 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 589 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 590 | Attr. Flags |Attr. Type Code| 591 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 593 The high-order bit (bit 0) of the Attribute Flags octet is the 594 Optional bit. It defines whether the attribute is optional (if 595 set to 1) or well-known (if set to 0). 597 The second high-order bit (bit 1) of the Attribute Flags octet 598 is the Transitive bit. It defines whether an optional attribute 599 is transitive (if set to 1) or non-transitive (if set to 0). 600 For well-known attributes, the Transitive bit must be set to 1. 601 (See Section 5 for a discussion of transitive attributes.) 603 The third high-order bit (bit 2) of the Attribute Flags octet 604 is the Partial bit. It defines whether the information 605 contained in the optional transitive attribute is partial (if 606 set to 1) or complete (if set to 0). For well-known attributes 607 and for optional non-transitive attributes the Partial bit must 608 be set to 0. 610 The fourth high-order bit (bit 3) of the Attribute Flags octet 611 is the Extended Length bit. It defines whether the Attribute 612 Length is one octet (if set to 0) or two octets (if set to 1). 614 The lower-order four bits of the Attribute Flags octet are 615 unused. They must be zero when sent and must be ignored when 616 received. 618 The Attribute Type Code octet contains the Attribute Type Code. 619 Currently defined Attribute Type Codes are discussed in Section 620 5. 622 If the Extended Length bit of the Attribute Flags octet is set 623 to 0, the third octet of the Path Attribute contains the length 624 of the attribute data in octets. 626 If the Extended Length bit of the Attribute Flags octet is set 627 to 1, then the third and the fourth octets of the path 628 RFC DRAFT November 2001 630 attribute contain the length of the attribute data in octets. 632 The remaining octets of the Path Attribute represent the 633 attribute value and are interpreted according to the Attribute 634 Flags and the Attribute Type Code. The supported Attribute Type 635 Codes, their attribute values and uses are the following: 637 a) ORIGIN (Type Code 1): 639 ORIGIN is a well-known mandatory attribute that defines the 640 origin of the path information. The data octet can assume 641 the following values: 643 Value Meaning 645 0 IGP - Network Layer Reachability Information 646 is interior to the originating AS 648 1 EGP - Network Layer Reachability Information 649 learned via the EGP protocol 651 2 INCOMPLETE - Network Layer Reachability 652 Information learned by some other means 654 Its usage is defined in 5.1.1 656 b) AS_PATH (Type Code 2): 658 AS_PATH is a well-known mandatory attribute that is composed 659 of a sequence of AS path segments. Each AS path segment is 660 represented by a triple . 663 The path segment type is a 1-octet long field with the 664 following values defined: 666 Value Segment Type 668 1 AS_SET: unordered set of ASs a route in the 669 UPDATE message has traversed 671 2 AS_SEQUENCE: ordered set of ASs a route in 672 the UPDATE message has traversed 674 The path segment length is a 1-octet long field containing 675 the number of ASs in the path segment value field. 677 The path segment value field contains one or more AS 678 RFC DRAFT November 2001 680 numbers, each encoded as a 2-octets long field. 682 Usage of this attribute is defined in 5.1.2. 684 c) NEXT_HOP (Type Code 3): 686 This is a well-known mandatory attribute that defines the IP 687 address of the border router that should be used as the next 688 hop to the destinations listed in the Network Layer 689 Reachability Information field of the UPDATE message. 691 Usage of this attribute is defined in 5.1.3. 693 d) MULTI_EXIT_DISC (Type Code 4): 695 This is an optional non-transitive attribute that is a four 696 octet non-negative integer. The value of this attribute may 697 be used by a BGP speaker's decision process to discriminate 698 among multiple entry points to a neighboring autonomous 699 system. 701 Its usage is defined in 5.1.4. 703 e) LOCAL_PREF (Type Code 5): 705 LOCAL_PREF is a well-known mandatory attribute that is a 706 four octet non-negative integer. A BGP speaker uses it to 707 inform other internal peers of the advertising speaker's 708 degree of preference for an advertised route. Usage of this 709 attribute is described in 5.1.5. 711 f) ATOMIC_AGGREGATE (Type Code 6) 713 ATOMIC_AGGREGATE is a well-known discretionary attribute of 714 length 0. Usage of this attribute is described in 5.1.6. 716 g) AGGREGATOR (Type Code 7) 718 AGGREGATOR is an optional transitive attribute of length 6. 719 The attribute contains the last AS number that formed the 720 aggregate route (encoded as 2 octets), followed by the IP 721 address of the BGP speaker that formed the aggregate route 722 (encoded as 4 octets). This should be the same address as 723 the one used for the BGP Identifier of the speaker. Usage 724 of this attribute is described in 5.1.7. 726 Network Layer Reachability Information: 728 RFC DRAFT November 2001 730 This variable length field contains a list of IP address 731 prefixes. The length in octets of the Network Layer 732 Reachability Information is not encoded explicitly, but can be 733 calculated as: 735 UPDATE message Length - 23 - Total Path Attributes Length - 736 Withdrawn Routes Length 738 where UPDATE message Length is the value encoded in the fixed- 739 size BGP header, Total Path Attribute Length and Withdrawn 740 Routes Length are the values encoded in the variable part of 741 the UPDATE message, and 23 is a combined length of the fixed- 742 size BGP header, the Total Path Attribute Length field and the 743 Withdrawn Routes Length field. 745 Reachability information is encoded as one or more 2-tuples of 746 the form , whose fields are described below: 748 +---------------------------+ 749 | Length (1 octet) | 750 +---------------------------+ 751 | Prefix (variable) | 752 +---------------------------+ 754 The use and the meaning of these fields are as follows: 756 a) Length: 758 The Length field indicates the length in bits of the IP 759 address prefix. A length of zero indicates a prefix that 760 matches all IP addresses (with prefix, itself, of zero 761 octets). 763 b) Prefix: 765 The Prefix field contains IP address prefixes followed by 766 enough trailing bits to make the end of the field fall on an 767 octet boundary. Note that the value of the trailing bits is 768 irrelevant. 770 The minimum length of the UPDATE message is 23 octets -- 19 octets 771 for the fixed header + 2 octets for the Withdrawn Routes Length + 2 772 octets for the Total Path Attribute Length (the value of Withdrawn 773 Routes Length is 0 and the value of Total Path Attribute Length is 774 0). 776 RFC DRAFT November 2001 778 An UPDATE message can advertise at most one set of path attributes, 779 but multiple destinations, provided that the destinations share these 780 attributes. All path attributes contained in a given UPDATE message 781 apply to all destinations carried in the NLRI field of the UPDATE 782 message. 784 An UPDATE message can list multiple routes to be withdrawn from 785 service. Each such route is identified by its destination (expressed 786 as an IP prefix), which unambiguously identifies the route in the 787 context of the BGP speaker - BGP speaker connection to which it has 788 been previously advertised. 790 An UPDATE message might advertise only routes to be withdrawn from 791 service, in which case it will not include path attributes or Network 792 Layer Reachability Information. Conversely, it may advertise only a 793 feasible route, in which case the WITHDRAWN ROUTES field need not be 794 present. 796 An UPDATE message should not include the same address prefix in the 797 WITHDRAWN ROUTES and Network Layer Reachability Information fields, 798 however a BGP speaker MUST be able to process UPDATE messages in this 799 form. A BGP speaker should treat an UPDATE message of this form as if 800 the WITHDRAWN ROUTES doesn't contain the address prefix. 802 4.4 KEEPALIVE Message Format 804 BGP does not use any transport protocol-based keep-alive mechanism to 805 determine if peers are reachable. Instead, KEEPALIVE messages are 806 exchanged between peers often enough as not to cause the Hold Timer 807 to expire. A reasonable maximum time between KEEPALIVE messages would 808 be one third of the Hold Time interval. KEEPALIVE messages MUST NOT 809 be sent more frequently than one per second. An implementation MAY 810 adjust the rate at which it sends KEEPALIVE messages as a function of 811 the Hold Time interval. 813 If the negotiated Hold Time interval is zero, then periodic KEEPALIVE 814 messages MUST NOT be sent. 816 KEEPALIVE message consists of only message header and has a length of 817 19 octets. 819 4.5 NOTIFICATION Message Format 821 A NOTIFICATION message is sent when an error condition is detected. 823 RFC DRAFT November 2001 825 The BGP connection is closed immediately after sending it. 827 In addition to the fixed-size BGP header, the NOTIFICATION message 828 contains the following fields: 830 0 1 2 3 831 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 832 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 833 | Error code | Error subcode | Data (variable) | 834 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 836 Error Code: 838 This 1-octet unsigned integer indicates the type of 839 NOTIFICATION. The following Error Codes have been defined: 841 Error Code Symbolic Name Reference 843 1 Message Header Error Section 6.1 845 2 OPEN Message Error Section 6.2 847 3 UPDATE Message Error Section 6.3 849 4 Hold Timer Expired Section 6.5 851 5 Finite State Machine Error Section 6.6 853 6 Cease Section 6.7 855 Error subcode: 857 This 1-octet unsigned integer provides more specific 858 information about the nature of the reported error. Each Error 859 Code may have one or more Error Subcodes associated with it. If 860 no appropriate Error Subcode is defined, then a zero 861 (Unspecific) value is used for the Error Subcode field. 863 Message Header Error subcodes: 865 1 - Connection Not Synchronized. 866 2 - Bad Message Length. 867 3 - Bad Message Type. 869 RFC DRAFT November 2001 871 OPEN Message Error subcodes: 873 1 - Unsupported Version Number. 874 2 - Bad Peer AS. 875 3 - Bad BGP Identifier. 876 4 - Unsupported Optional Parameter. 877 5 - Authentication Failure. 878 6 - Unacceptable Hold Time. 880 UPDATE Message Error subcodes: 882 1 - Malformed Attribute List. 883 2 - Unrecognized Well-known Attribute. 884 3 - Missing Well-known Attribute. 885 4 - Attribute Flags Error. 886 5 - Attribute Length Error. 887 6 - Invalid ORIGIN Attribute 888 8 - Invalid NEXT_HOP Attribute. 889 9 - Optional Attribute Error. 890 10 - Invalid Network Field. 891 11 - Malformed AS_PATH. 893 Data: 895 This variable-length field is used to diagnose the reason for 896 the NOTIFICATION. The contents of the Data field depend upon 897 the Error Code and Error Subcode. See Section 6 below for more 898 details. 900 Note that the length of the Data field can be determined from 901 the message Length field by the formula: 903 Message Length = 21 + Data Length 905 The minimum length of the NOTIFICATION message is 21 octets 906 (including message header). 908 5. Path Attributes 910 This section discusses the path attributes of the UPDATE message. 912 Path attributes fall into four separate categories: 914 1. Well-known mandatory. 916 RFC DRAFT November 2001 918 2. Well-known discretionary. 919 3. Optional transitive. 920 4. Optional non-transitive. 922 Well-known attributes must be recognized by all BGP implementations. 923 Some of these attributes are mandatory and must be included in every 924 UPDATE message that contains NLRI. Others are discretionary and may 925 or may not be sent in a particular UPDATE message. 927 All well-known attributes must be passed along (after proper 928 updating, if necessary) to other BGP peers. 930 In addition to well-known attributes, each path may contain one or 931 more optional attributes. It is not required or expected that all BGP 932 implementations support all optional attributes. The handling of an 933 unrecognized optional attribute is determined by the setting of the 934 Transitive bit in the attribute flags octet. Paths with unrecognized 935 transitive optional attributes should be accepted. If a path with 936 unrecognized transitive optional attribute is accepted and passed 937 along to other BGP peers, then the unrecognized transitive optional 938 attribute of that path must be passed along with the path to other 939 BGP peers with the Partial bit in the Attribute Flags octet set to 1. 940 If a path with recognized transitive optional attribute is accepted 941 and passed along to other BGP peers and the Partial bit in the 942 Attribute Flags octet is set to 1 by some previous AS, it is not set 943 back to 0 by the current AS. Unrecognized non-transitive optional 944 attributes must be quietly ignored and not passed along to other BGP 945 peers. 947 New transitive optional attributes may be attached to the path by the 948 originator or by any other BGP speaker in the path. If they are not 949 attached by the originator, the Partial bit in the Attribute Flags 950 octet is set to 1. The rules for attaching new non-transitive 951 optional attributes will depend on the nature of the specific 952 attribute. The documentation of each new non-transitive optional 953 attribute will be expected to include such rules. (The description of 954 the MULTI_EXIT_DISC attribute gives an example.) All optional 955 attributes (both transitive and non-transitive) may be updated (if 956 appropriate) by BGP speakers in the path. 958 The sender of an UPDATE message should order path attributes within 959 the UPDATE message in ascending order of attribute type. The receiver 960 of an UPDATE message must be prepared to handle path attributes 961 within the UPDATE message that are out of order. 963 The same attribute cannot appear more than once within the Path 964 Attributes field of a particular UPDATE message. 966 RFC DRAFT November 2001 968 The mandatory category refers to an attribute which must be present 969 in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE 970 message. Attributes classified as optional for the purpose of the 971 protocol extension mechanism may be purely discretionary, or 972 discretionary, required, or disallowed in certain contexts. 974 attribute EBGP IBGP 975 ORIGIN mandatory mandatory 976 AS_PATH mandatory mandatory 977 NEXT_HOP mandatory mandatory 978 MULTI_EXIT_DISC discretionary discretionary 979 LOCAL_PREF disallowed required 980 ATOMIC_AGGREGATE see section 5.1.6 and 9.1.4 981 AGGREGATOR discretionary discretionary 983 5.1 Path Attribute Usage 985 The usage of each BGP path attributes is described in the following 986 clauses. 988 5.1.1 ORIGIN 990 ORIGIN is a well-known mandatory attribute. The ORIGIN attribute 991 shall be generated by the autonomous system that originates the 992 associated routing information. It shall be included in the UPDATE 993 messages of all BGP speakers that choose to propagate this 994 information to other BGP speakers. 996 5.1.2 AS_PATH 998 AS_PATH is a well-known mandatory attribute. This attribute 999 identifies the autonomous systems through which routing information 1000 carried in this UPDATE message has passed. The components of this 1001 list can be AS_SETs or AS_SEQUENCEs. 1003 When a BGP speaker propagates a route which it has learned from 1004 another BGP speaker's UPDATE message, it shall modify the route's 1005 AS_PATH attribute based on the location of the BGP speaker to which 1006 the route will be sent: 1008 RFC DRAFT November 2001 1010 a) When a given BGP speaker advertises the route to an internal 1011 peer, the advertising speaker shall not modify the AS_PATH 1012 attribute associated with the route. 1014 b) When a given BGP speaker advertises the route to an external 1015 peer, then the advertising speaker shall update the AS_PATH 1016 attribute as follows: 1018 1) if the first path segment of the AS_PATH is of type 1019 AS_SEQUENCE, the local system shall prepend its own AS number 1020 as the last element of the sequence (put it in the leftmost 1021 position). If the act of prepending will cause an overflow in 1022 the AS_PATH segment, i.e. more than 255 elements, it shall be 1023 legal to prepend a new segment of type AS_SEQUENCE and prepend 1024 its own AS number to this new segment. 1026 2) if the first path segment of the AS_PATH is of type AS_SET, 1027 the local system shall prepend a new path segment of type 1028 AS_SEQUENCE to the AS_PATH, including its own AS number in that 1029 segment. 1031 When a BGP speaker originates a route then: 1033 a) the originating speaker shall include its own AS number in a 1034 path segment of type AS_SEQUENCE in the AS_PATH attribute of all 1035 UPDATE messages sent to an external peer. (In this case, the AS 1036 number of the originating speaker's autonomous system will be the 1037 only entry the path segment, and this path segment will be the 1038 only segment in the AS_PATH attribute). 1040 b) the originating speaker shall include an empty AS_PATH 1041 attribute in all UPDATE messages sent to internal peers. (An 1042 empty AS_PATH attribute is one whose length field contains the 1043 value zero). 1045 Whenever the modification of the AS_PATH attribute calls for 1046 including or prepending the AS number of the local system, the local 1047 system may include/prepend more than one instance of its own AS 1048 number in the AS_PATH attribute. This is controlled via local 1049 configuration. 1051 5.1.3 NEXT_HOP 1053 The NEXT_HOP path attribute defines the IP address of the border 1054 router that should be used as the next hop to the destinations listed 1055 RFC DRAFT November 2001 1057 in the UPDATE message. The NEXT_HOP attribute is calculated as 1058 follows. 1060 1) When sending a message to an internal peer, the BGP speaker 1061 should not modify the NEXT_HOP attribute, unless it has been 1062 explicitly configured to announce its own IP address as the 1063 NEXT_HOP. 1065 2) When sending a message to an external peer X, and the peer is 1066 one IP hop away from the speaker: 1068 - If the route being announced was learned from an internal 1069 peer or is locally originated, the BGP speaker can use for the 1070 NEXT_HOP attribute an interface address of the internal peer 1071 router (or the internal router) through which the announced 1072 network is reachable for the speaker, provided that peer X 1073 shares a common subnet with this address. This is a form of 1074 "third party" NEXT_HOP attribute. 1076 - If the route being announced was learned from an external 1077 peer, the speaker can use in the NEXT_HOP attribute an IP 1078 address of any adjacent router (known from the received 1079 NEXT_HOP attribute) that the speaker itself uses for local 1080 route calculation, provided that peer X shares a common subnet 1081 with this address. This is a second form of "third party" 1082 NEXT_HOP attribute. 1084 - If the external peer to which the route is being advertised 1085 shares a common subnet with one of the announcing router's own 1086 interfaces, the router may use the IP address associated with 1087 such an interface in the NEXT_HOP attribute. This is known as a 1088 "first party" NEXT_HOP attribute. 1090 - By default (if none of the above conditions apply), the BGP 1091 speaker should use in the NEXT_HOP attribute the IP address of 1092 the interface that the speaker uses to establish the BGP 1093 session to peer X. 1095 3) When sending a message to an external peer X, and the peer is 1096 multiple IP hops away from the speaker (aka "multihop EBGP"): 1098 - The speaker may be configured to propagate the NEXT_HOP 1099 attribute. In this case when advertising a route that the 1100 speaker learned from one of its peers, the NEXT_HOP attribute 1101 of the advertised route is exactly the same as the NEXT_HOP 1102 attribute of the learned route (the speaker just doesn't modify 1103 the NEXT_HOP attribute). 1105 RFC DRAFT November 2001 1107 - By default, the BGP speaker should use in the NEXT_HOP 1108 attribute the IP address of the interface that the speaker uses 1109 to establish the BGP session to peer X. 1111 Normally the NEXT_HOP attribute is chosen such that the shortest 1112 available path will be taken. A BGP speaker must be able to support 1113 disabling advertisement of third party NEXT_HOP attributes to handle 1114 imperfectly bridged media. 1116 A BGP speaker must never advertise an address of a peer to that peer 1117 as a NEXT_HOP, for a route that the speaker is originating. A BGP 1118 speaker must never install a route with itself as the next hop. 1120 The NEXT_HOP attribute is used by the BGP speaker to determine the 1121 actual outbound interface and immediate next-hop address that should 1122 be used to forward transit packets to the associated destinations. 1123 The immediate next-hop address is determined by performing a 1124 recursive route lookup operation for the IP address in the NEXT_HOP 1125 attribute using the contents of the Routing Table (see Section 1126 9.1.2.2). The resolving route will always specify the outbound 1127 interface. If the resolving route specifies the next-hop address, 1128 this address should be used as the immediate address for packet 1129 forwarding. If the address in the NEXT_HOP attribute is directly 1130 resolved through a route to an attached subnet (such a route will not 1131 specify the next-hop address), the outbound interface should be taken 1132 from the resolving route and the address in the NEXT_HOP attribute 1133 should be used as the immediate next-hop address. 1135 5.1.4 MULTI_EXIT_DISC 1137 The MULTI_EXIT_DISC attribute may be used on external (inter-AS) 1138 links to discriminate among multiple exit or entry points to the same 1139 neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four 1140 octet unsigned number which is called a metric. All other factors 1141 being equal, the exit point with lower metric should be preferred. If 1142 received over external links, the MULTI_EXIT_DISC attribute MAY be 1143 propagated over internal links to other BGP speakers within the same 1144 AS. The MULTI_EXIT_DISC attribute received from a neighboring AS MUST 1145 NOT be propagated to other neighboring ASs. 1147 A BGP speaker MUST IMPLEMENT a mechanism based on local configuration 1148 which allows the MULTI_EXIT_DISC attribute to be removed from a 1149 route. This MAY be done prior to determining the degree of preference 1150 of the route and performing route selection (decision process phases 1151 1 and 2). 1153 RFC DRAFT November 2001 1155 An implementation MAY also (based on local configuration) alter the 1156 value of the MULTI_EXIT_DISC attribute received over an external 1157 link. If it does so, it shall do so prior to determining the degree 1158 of preference of the route and performing route selection (decision 1159 process phases 1 and 2). 1161 5.1.5 LOCAL_PREF 1163 LOCAL_PREF is a well-known mandatory attribute that SHALL be included 1164 in all UPDATE messages that a given BGP speaker sends to the other 1165 internal peers. A BGP speaker SHALL calculate the degree of 1166 preference for each external route based on the locally configured 1167 policy, and include the degree of preference when advertising a route 1168 to its internal peers. The higher degree of preference MUST be 1169 preferred. A BGP speaker shall use the degree of preference learned 1170 via LOCAL_PREF in its decision process (see section 9.1.1). 1172 A BGP speaker MUST NOT include this attribute in UPDATE messages that 1173 it sends to external peers, except for the case of BGP Confederations 1174 [13]. If it is contained in an UPDATE message that is received from 1175 an external peer, then this attribute MUST be ignored by the 1176 receiving speaker, except for the case of BGP Confederations [13]. 1178 5.1.6 ATOMIC_AGGREGATE 1180 ATOMIC_AGGREGATE is a well-known discretionary attribute. 1182 When a router aggregates several routes for the purpose of 1183 advertisement to a particular peer, and the AS_PATH of the aggregated 1184 route excludes at least some of the AS numbers present in the AS_PATH 1185 of the routes that are aggregated, the aggregated route, when 1186 advertised to the peer, MUST include the ATOMIC_AGGREGATE attribute. 1188 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1189 attribute MUST NOT remove the attribute from the route when 1190 propagating it to other speakers. 1192 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1193 attribute MUST NOT make any NLRI of that route more specific (as 1194 defined in 9.1.4) when advertising this route to other BGP speakers. 1196 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1197 attribute needs to be cognizant of the fact that the actual path to 1198 destinations, as specified in the NLRI of the route, while having the 1199 RFC DRAFT November 2001 1201 loop-free property, may not be the path specified in the AS_PATH 1202 attribute of the route. 1204 5.1.7 AGGREGATOR 1206 AGGREGATOR is an optional transitive attribute which may be included 1207 in updates which are formed by aggregation (see Section 9.2.4.2). A 1208 BGP speaker which performs route aggregation may add the AGGREGATOR 1209 attribute which shall contain its own AS number and IP address. The 1210 IP address should be the same as the BGP Identifier of the speaker. 1212 6. BGP Error Handling. 1214 This section describes actions to be taken when errors are detected 1215 while processing BGP messages. 1217 When any of the conditions described here are detected, a 1218 NOTIFICATION message with the indicated Error Code, Error Subcode, 1219 and Data fields is sent, and the BGP connection is closed. If no 1220 Error Subcode is specified, then a zero must be used. 1222 The phrase "the BGP connection is closed" means that the transport 1223 protocol connection has been closed, the associated Adj-RIB-In has 1224 been cleared, and that all resources for that BGP connection have 1225 been deallocated. Entries in the Loc-RIB associated with the remote 1226 peer are marked as invalid. The fact that the routes have become 1227 invalid is passed to other BGP peers before the routes are deleted 1228 from the system. 1230 Unless specified explicitly, the Data field of the NOTIFICATION 1231 message that is sent to indicate an error is empty. 1233 6.1 Message Header error handling. 1235 All errors detected while processing the Message Header are indicated 1236 by sending the NOTIFICATION message with Error Code Message Header 1237 Error. The Error Subcode elaborates on the specific nature of the 1238 error. 1240 The expected value of the Marker field of the message header is all 1241 ones if the message type is OPEN. The expected value of the Marker 1242 field for all other types of BGP messages determined based on the 1243 RFC DRAFT November 2001 1245 presence of the Authentication Information Optional Parameter in the 1246 BGP OPEN message and the actual authentication mechanism (if the 1247 Authentication Information in the BGP OPEN message is present). The 1248 Marker field should be all ones if the OPEN message carried no 1249 authentication information. If the Marker field of the message header 1250 is not the expected one, then a synchronization error has occurred 1251 and the Error Subcode is set to Connection Not Synchronized. 1253 If the Length field of the message header is less than 19 or greater 1254 than 4096, or if the Length field of an OPEN message is less than the 1255 minimum length of the OPEN message, or if the Length field of an 1256 UPDATE message is less than the minimum length of the UPDATE message, 1257 or if the Length field of a KEEPALIVE message is not equal to 19, or 1258 if the Length field of a NOTIFICATION message is less than the 1259 minimum length of the NOTIFICATION message, then the Error Subcode is 1260 set to Bad Message Length. The Data field contains the erroneous 1261 Length field. 1263 If the Type field of the message header is not recognized, then the 1264 Error Subcode is set to Bad Message Type. The Data field contains the 1265 erroneous Type field. 1267 6.2 OPEN message error handling. 1269 All errors detected while processing the OPEN message are indicated 1270 by sending the NOTIFICATION message with Error Code OPEN Message 1271 Error. The Error Subcode elaborates on the specific nature of the 1272 error. 1274 If the version number contained in the Version field of the received 1275 OPEN message is not supported, then the Error Subcode is set to 1276 Unsupported Version Number. The Data field is a 2-octets unsigned 1277 integer, which indicates the largest locally supported version number 1278 less than the version the remote BGP peer bid (as indicated in the 1279 received OPEN message). 1281 If the Autonomous System field of the OPEN message is unacceptable, 1282 then the Error Subcode is set to Bad Peer AS. The determination of 1283 acceptable Autonomous System numbers is outside the scope of this 1284 protocol. 1286 If the Hold Time field of the OPEN message is unacceptable, then the 1287 Error Subcode MUST be set to Unacceptable Hold Time. An 1288 implementation MUST reject Hold Time values of one or two seconds. 1289 An implementation MAY reject any proposed Hold Time. An 1290 implementation which accepts a Hold Time MUST use the negotiated 1291 RFC DRAFT November 2001 1293 value for the Hold Time. 1295 If the BGP Identifier field of the OPEN message is syntactically 1296 incorrect, then the Error Subcode is set to Bad BGP Identifier. 1297 Syntactic correctness means that the BGP Identifier field represents 1298 a valid IP host address. 1300 If one of the Optional Parameters in the OPEN message is not 1301 recognized, then the Error Subcode is set to Unsupported Optional 1302 Parameters. 1304 If one of the Optional Parameters in the OPEN message is recognized, 1305 but is malformed, then the Error Subcode is set to 0 (Unspecific). 1307 If the OPEN message carries Authentication Information (as an 1308 Optional Parameter), then the corresponding authentication procedure 1309 is invoked. If the authentication procedure (based on Authentication 1310 Code and Authentication Data) fails, then the Error Subcode is set to 1311 Authentication Failure. 1313 6.3 UPDATE message error handling. 1315 All errors detected while processing the UPDATE message are indicated 1316 by sending the NOTIFICATION message with Error Code UPDATE Message 1317 Error. The error subcode elaborates on the specific nature of the 1318 error. 1320 Error checking of an UPDATE message begins by examining the path 1321 attributes. If the Withdrawn Routes Length or Total Attribute Length 1322 is too large (i.e., if Withdrawn Routes Length + Total Attribute 1323 Length + 23 exceeds the message Length), then the Error Subcode is 1324 set to Malformed Attribute List. 1326 If any recognized attribute has Attribute Flags that conflict with 1327 the Attribute Type Code, then the Error Subcode is set to Attribute 1328 Flags Error. The Data field contains the erroneous attribute (type, 1329 length and value). 1331 If any recognized attribute has Attribute Length that conflicts with 1332 the expected length (based on the attribute type code), then the 1333 Error Subcode is set to Attribute Length Error. The Data field 1334 contains the erroneous attribute (type, length and value). 1336 If any of the mandatory well-known attributes are not present, then 1337 RFC DRAFT November 2001 1339 the Error Subcode is set to Missing Well-known Attribute. The Data 1340 field contains the Attribute Type Code of the missing well-known 1341 attribute. 1343 If any of the mandatory well-known attributes are not recognized, 1344 then the Error Subcode is set to Unrecognized Well-known Attribute. 1345 The Data field contains the unrecognized attribute (type, length and 1346 value). 1348 If the ORIGIN attribute has an undefined value, then the Error 1349 Subcode is set to Invalid Origin Attribute. The Data field contains 1350 the unrecognized attribute (type, length and value). 1352 If the NEXT_HOP attribute field is syntactically incorrect, then the 1353 Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field 1354 contains the incorrect attribute (type, length and value). Syntactic 1355 correctness means that the NEXT_HOP attribute represents a valid IP 1356 host address. Semantic correctness applies only to the external BGP 1357 links, and only when the sender and the receiving speaker are one IP 1358 hop away from each other. To be semantically correct, the IP address 1359 in the NEXT_HOP must not be the IP address of the receiving speaker, 1360 and the NEXT_HOP IP address must either be the sender's IP address 1361 (used to establish the BGP session), or the interface associated with 1362 the NEXT_HOP IP address must share a common subnet with the receiving 1363 BGP speaker. If the NEXT_HOP attribute is semantically incorrect, the 1364 error should be logged, and the route should be ignored. In this 1365 case, no NOTIFICATION message should be sent. 1367 The AS_PATH attribute is checked for syntactic correctness. If the 1368 path is syntactically incorrect, then the Error Subcode is set to 1369 Malformed AS_PATH. 1371 The information carried by the AS_PATH attribute is checked for AS 1372 loops. AS loop detection is done by scanning the full AS path (as 1373 specified in the AS_PATH attribute), and checking that the autonomous 1374 system number of the local system does not appear in the AS path. If 1375 the autonomous system number appears in the AS path the route may be 1376 stored in the Adj-RIB-In, but unless the router is configured to 1377 accept routes with its own autonomous system in the AS path, the 1378 route shall not be passed to the BGP Decision Process. Operations of 1379 a router that is configured to accept routes with its own autonomous 1380 system number in the AS path are outside the scope of this document. 1382 If an optional attribute is recognized, then the value of this 1383 attribute is checked. If an error is detected, the attribute is 1384 discarded, and the Error Subcode is set to Optional Attribute Error. 1385 The Data field contains the attribute (type, length and value). 1387 RFC DRAFT November 2001 1389 If any attribute appears more than once in the UPDATE message, then 1390 the Error Subcode is set to Malformed Attribute List. 1392 The NLRI field in the UPDATE message is checked for syntactic 1393 validity. If the field is syntactically incorrect, then the Error 1394 Subcode is set to Invalid Network Field. 1396 If a prefix in the NLRI field is semantically incorrect (e.g., an 1397 unexpected multicast IP address), an error should be logged locally, 1398 and the prefix should be ignored. 1400 An UPDATE message that contains correct path attributes, but no NLRI, 1401 shall be treated as a valid UPDATE message. 1403 6.4 NOTIFICATION message error handling. 1405 If a peer sends a NOTIFICATION message, and there is an error in that 1406 message, there is unfortunately no means of reporting this error via 1407 a subsequent NOTIFICATION message. Any such error, such as an 1408 unrecognized Error Code or Error Subcode, should be noticed, logged 1409 locally, and brought to the attention of the administration of the 1410 peer. The means to do this, however, lies outside the scope of this 1411 document. 1413 6.5 Hold Timer Expired error handling. 1415 If a system does not receive successive KEEPALIVE and/or UPDATE 1416 and/or NOTIFICATION messages within the period specified in the Hold 1417 Time field of the OPEN message, then the NOTIFICATION message with 1418 Hold Timer Expired Error Code must be sent and the BGP connection 1419 closed. 1421 6.6 Finite State Machine error handling. 1423 Any error detected by the BGP Finite State Machine (e.g., receipt of 1424 an unexpected event) is indicated by sending the NOTIFICATION message 1425 with Error Code Finite State Machine Error. 1427 RFC DRAFT November 2001 1429 6.7 Cease. 1431 In absence of any fatal errors (that are indicated in this section), 1432 a BGP peer may choose at any given time to close its BGP connection 1433 by sending the NOTIFICATION message with Error Code Cease. However, 1434 the Cease NOTIFICATION message must not be used when a fatal error 1435 indicated by this section does exist. 1437 A BGP speaker may support the ability to impose an (locally 1438 configured) upper bound on the number of address prefixes the speaker 1439 is willing to accept from a neighbor. When the upper bound is 1440 reached, the speaker (under control of local configuration) may 1441 either (a) discard new address prefixes from the neighbor, or (b) 1442 terminate the BGP peering with the neighbor. If the BGP speaker 1443 decides to terminate its peering with a neighbor because the number 1444 of address prefixes received from the neighbor exceeds the locally 1445 configured upper bound, then the speaker must send to the neighbor a 1446 NOTIFICATION message with the Error Code Cease. 1448 6.8 Connection collision detection. 1450 If a pair of BGP speakers try simultaneously to establish a TCP 1451 connection to each other, then two parallel connections between this 1452 pair of speakers might well be formed. We refer to this situation as 1453 connection collision. Clearly, one of these connections must be 1454 closed. 1456 Based on the value of the BGP Identifier a convention is established 1457 for detecting which BGP connection is to be preserved when a 1458 collision does occur. The convention is to compare the BGP 1459 Identifiers of the peers involved in the collision and to retain only 1460 the connection initiated by the BGP speaker with the higher-valued 1461 BGP Identifier. 1463 Upon receipt of an OPEN message, the local system must examine all of 1464 its connections that are in the OpenConfirm state. A BGP speaker may 1465 also examine connections in an OpenSent state if it knows the BGP 1466 Identifier of the peer by means outside of the protocol. If among 1467 these connections there is a connection to a remote BGP speaker whose 1468 BGP Identifier equals the one in the OPEN message, then the local 1469 system performs the following collision resolution procedure: 1471 1. The BGP Identifier of the local system is compared to the BGP 1472 Identifier of the remote system (as specified in the OPEN 1473 RFC DRAFT November 2001 1475 message). 1477 2. If the value of the local BGP Identifier is less than the 1478 remote one, the local system closes BGP connection that already 1479 exists (the one that is already in the OpenConfirm state), and 1480 accepts BGP connection initiated by the remote system. 1482 3. Otherwise, the local system closes newly created BGP connection 1483 (the one associated with the newly received OPEN message), and 1484 continues to use the existing one (the one that is already in the 1485 OpenConfirm state). 1487 Comparing BGP Identifiers is done by treating them as (4-octet 1488 long) unsigned integers. 1490 Unless allowed via configuration, a connection collision with an 1491 existing BGP connection that is in Established state causes 1492 closing of the newly created connection. 1494 Note that a connection collision cannot be detected with 1495 connections that are in Idle, or Connect, or Active states. 1497 Closing the BGP connection (that results from the collision 1498 resolution procedure) is accomplished by sending the NOTIFICATION 1499 message with the Error Code Cease. 1501 7. BGP Version Negotiation. 1503 BGP speakers may negotiate the version of the protocol by making 1504 multiple attempts to open a BGP connection, starting with the highest 1505 version number each supports. If an open attempt fails with an Error 1506 Code OPEN Message Error, and an Error Subcode Unsupported Version 1507 Number, then the BGP speaker has available the version number it 1508 tried, the version number its peer tried, the version number passed 1509 by its peer in the NOTIFICATION message, and the version numbers that 1510 it supports. If the two peers do support one or more common versions, 1511 then this will allow them to rapidly determine the highest common 1512 version. In order to support BGP version negotiation, future versions 1513 of BGP must retain the format of the OPEN and NOTIFICATION messages. 1515 8. BGP Finite State machine. 1517 This section specifies BGP operation in terms of a Finite State 1518 Machine (FSM). Following is a brief summary and overview of BGP 1519 RFC DRAFT November 2001 1521 operations by state as determined by this FSM. 1523 Initially BGP is in the Idle state. 1525 Idle state: 1527 In this state BGP refuses all incoming BGP connections. No 1528 resources are allocated to the peer. In response to the Start 1529 event (initiated by either system or operator) the local system 1530 initializes all BGP resources, starts the ConnectRetry timer, 1531 initiates a transport connection to other BGP peer, while 1532 listening for connection that may be initiated by the remote 1533 BGP peer, and changes its state to Connect. The exact value of 1534 the ConnectRetry timer is a local matter, but should be 1535 sufficiently large to allow TCP initialization. 1537 If a BGP speaker detects an error, it shuts down the connection 1538 and changes its state to Idle. Getting out of the Idle state 1539 requires generation of the Start event. If such an event is 1540 generated automatically, then persistent BGP errors may result 1541 in persistent flapping of the speaker. To avoid such a 1542 condition it is recommended that Start events should not be 1543 generated immediately for a peer that was previously 1544 transitioned to Idle due to an error. For a peer that was 1545 previously transitioned to Idle due to an error, the time 1546 between consecutive generation of Start events, if such events 1547 are generated automatically, shall exponentially increase. The 1548 value of the initial timer shall be 60 seconds. The time shall 1549 be doubled for each consecutive retry. An implementation MAY 1550 impose a configurable upper bound on that time. Once the upper 1551 bound is reached, the speaker shall no longer automatically 1552 generate the Start event for the peer. 1554 Any other event received in the Idle state is ignored. 1556 Connect state: 1558 In this state BGP is waiting for the transport protocol 1559 connection to be completed. 1561 If the transport protocol connection succeeds, the local system 1562 clears the ConnectRetry timer, completes initialization, sends 1563 an OPEN message to its peer, and changes its state to OpenSent. 1565 If the transport protocol connect fails (e.g., retransmission 1566 timeout), the local system restarts the ConnectRetry timer, 1567 continues to listen for a connection that may be initiated by 1568 the remote BGP peer, and changes its state to Active state. 1570 RFC DRAFT November 2001 1572 In response to the ConnectRetry timer expired event, the local 1573 system restarts the ConnectRetry timer, initiates a transport 1574 connection to other BGP peer, continues to listen for a 1575 connection that may be initiated by the remote BGP peer, and 1576 stays in the Connect state. 1578 The Start event is ignored in the Connect state. 1580 In response to any other event (initiated by either system or 1581 operator), the local system releases all BGP resources 1582 associated with this connection and changes its state to Idle. 1584 Active state: 1586 In this state BGP is trying to acquire a peer by listening for 1587 and accepting a transport protocol connection. 1589 If the transport protocol connection succeeds, the local system 1590 clears the ConnectRetry timer, completes initialization, sends 1591 an OPEN message to its peer, sets its Hold Timer to a large 1592 value, and changes its state to OpenSent. A Hold Timer value of 1593 4 minutes is suggested. 1595 In response to the ConnectRetry timer expired event, the local 1596 system restarts the ConnectRetry timer, initiates a transport 1597 connection to the other BGP peer, continues to listen for a 1598 connection that may be initiated by the remote BGP peer, and 1599 changes its state to Connect. 1601 If the local system allows BGP connections with unconfigured 1602 peers, then when the local system detects that a remote peer is 1603 trying to establish a BGP connection to it, and the IP address 1604 of the remote peer is not a configured one, the local system 1605 creates a temporary peer entry, completes initialization, sends 1606 an OPEN message to its peer, sets its Hold Timer to a large 1607 value, and changes its state to OpenSent. 1609 If the local system does not allow BGP connections with 1610 unconfigured peers, then the local system rejects connections 1611 from IP addresses that are not configured peers, and remains in 1612 the Active state. 1614 The Start event is ignored in the Active state. 1616 In response to any other event (initiated by either system or 1617 operator), the local system releases all BGP resources 1618 associated with this connection and changes its state to Idle. 1620 RFC DRAFT November 2001 1622 OpenSent state: 1624 In this state BGP waits for an OPEN message from its peer. 1625 When an OPEN message is received, all fields are checked for 1626 correctness. If the BGP message header checking or OPEN message 1627 checking detects an error (see Section 6.2), or a connection 1628 collision (see Section 6.8) the local system sends a 1629 NOTIFICATION message and changes its state to Idle. 1631 If there are no errors in the OPEN message, BGP sends a 1632 KEEPALIVE message and sets a KeepAlive timer. The Hold Timer, 1633 which was originally set to a large value (see above), is 1634 replaced with the negotiated Hold Time value (see section 4.2). 1635 If the negotiated Hold Time value is zero, then the Hold Time 1636 timer and KeepAlive timers are not started. If the value of the 1637 Autonomous System field is the same as the local Autonomous 1638 System number, then the connection is an "internal" connection; 1639 otherwise, it is "external". (This will affect UPDATE 1640 processing as described below.) Finally, the state is changed 1641 to OpenConfirm. 1643 If a disconnect notification is received from the underlying 1644 transport protocol, the local system closes the BGP connection, 1645 restarts the ConnectRetry timer, while continue listening for 1646 connection that may be initiated by the remote BGP peer, and 1647 goes into the Active state. 1649 If the Hold Timer expires, the local system sends NOTIFICATION 1650 message with error code Hold Timer Expired and changes its 1651 state to Idle. 1653 In response to the Stop event (initiated by either system or 1654 operator) the local system sends NOTIFICATION message with 1655 Error Code Cease and changes its state to Idle. 1657 The Start event is ignored in the OpenSent state. 1659 In response to any other event the local system sends 1660 NOTIFICATION message with Error Code Finite State Machine Error 1661 and changes its state to Idle. 1663 Whenever BGP changes its state from OpenSent to Idle, it closes 1664 the BGP (and transport-level) connection and releases all 1665 resources associated with that connection. 1667 OpenConfirm state: 1669 In this state BGP waits for a KEEPALIVE or NOTIFICATION 1670 RFC DRAFT November 2001 1672 message. 1674 If the local system receives a KEEPALIVE message, it changes 1675 its state to Established. 1677 If the Hold Timer expires before a KEEPALIVE message is 1678 received, the local system sends NOTIFICATION message with 1679 error code Hold Timer Expired and changes its state to Idle. 1681 If the local system receives a NOTIFICATION message, it changes 1682 its state to Idle. 1684 If the KeepAlive timer expires, the local system sends a 1685 KEEPALIVE message and restarts its KeepAlive timer. 1687 If a disconnect notification is received from the underlying 1688 transport protocol, the local system changes its state to Idle. 1690 In response to the Stop event (initiated by either system or 1691 operator) the local system sends NOTIFICATION message with 1692 Error Code Cease and changes its state to Idle. 1694 The Start event is ignored in the OpenConfirm state. 1696 In response to any other event the local system sends 1697 NOTIFICATION message with Error Code Finite State Machine Error 1698 and changes its state to Idle. 1700 Whenever BGP changes its state from OpenConfirm to Idle, it 1701 closes the BGP (and transport-level) connection and releases 1702 all resources associated with that connection. 1704 Established state: 1706 In the Established state BGP can exchange UPDATE, NOTIFICATION, 1707 and KEEPALIVE messages with its peer. 1709 If the local system receives an UPDATE or KEEPALIVE message, it 1710 restarts its Hold Timer, if the negotiated Hold Time value is 1711 non-zero. 1713 If the local system receives a NOTIFICATION message, it changes 1714 its state to Idle. 1716 If the local system receives an UPDATE message and the UPDATE 1717 message error handling procedure (see Section 6.3) detects an 1718 error, the local system sends a NOTIFICATION message and 1719 changes its state to Idle. 1721 RFC DRAFT November 2001 1723 If a disconnect notification is received from the underlying 1724 transport protocol, the local system changes its state to Idle. 1726 If the Hold Timer expires, the local system sends a 1727 NOTIFICATION message with Error Code Hold Timer Expired and 1728 changes its state to Idle. 1730 If the KeepAlive timer expires, the local system sends a 1731 KEEPALIVE message and restarts its KeepAlive timer. 1733 Each time the local system sends a KEEPALIVE or UPDATE message, 1734 it restarts its KeepAlive timer, unless the negotiated Hold 1735 Time value is zero. 1737 In response to the Stop event (initiated by either system or 1738 operator), the local system sends a NOTIFICATION message with 1739 Error Code Cease and changes its state to Idle. 1741 The Start event is ignored in the Established state. 1743 In response to any other event, the local system sends 1744 NOTIFICATION message with Error Code Finite State Machine Error 1745 and changes its state to Idle. 1747 Whenever BGP changes its state from Established to Idle, it 1748 closes the BGP (and transport-level) connection, releases all 1749 resources associated with that connection, and deletes all 1750 routes derived from that connection. 1752 9. UPDATE Message Handling 1754 An UPDATE message may be received only in the Established state. 1755 When an UPDATE message is received, each field is checked for 1756 validity as specified in Section 6.3. 1758 If an optional non-transitive attribute is unrecognized, it is 1759 quietly ignored. If an optional transitive attribute is unrecognized, 1760 the Partial bit (the third high-order bit) in the attribute flags 1761 octet is set to 1, and the attribute is retained for propagation to 1762 other BGP speakers. 1764 If an optional attribute is recognized, and has a valid value, then, 1765 depending on the type of the optional attribute, it is processed 1766 locally, retained, and updated, if necessary, for possible 1767 propagation to other BGP speakers. 1769 RFC DRAFT November 2001 1771 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 1772 the previously advertised routes whose destinations (expressed as IP 1773 prefixes) contained in this field shall be removed from the Adj-RIB- 1774 In. This BGP speaker shall run its Decision Process since the 1775 previously advertised route is no longer available for use. 1777 If the UPDATE message contains a feasible route, it shall be placed 1778 in the appropriate Adj-RIB-In, and the following additional actions 1779 shall be taken: 1781 i) If its Network Layer Reachability Information (NLRI) is identical 1782 to the one of a route currently stored in the Adj-RIB-In, then the 1783 new route shall replace the older route in the Adj-RIB-In, thus 1784 implicitly withdrawing the older route from service. The BGP speaker 1785 shall run its Decision Process since the older route is no longer 1786 available for use. 1788 ii) If the new route is an overlapping route that is included (see 1789 9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP 1790 speaker shall run its Decision Process since the more specific route 1791 has implicitly made a portion of the less specific route unavailable 1792 for use. 1794 iii) If the new route has identical path attributes to an earlier 1795 route contained in the Adj-RIB-In, and is more specific (see 9.1.4) 1796 than the earlier route, no further actions are necessary. 1798 iv) If the new route has NLRI that is not present in any of the 1799 routes currently stored in the Adj-RIB-In, then the new route shall 1800 be placed in the Adj-RIB-In. The BGP speaker shall run its Decision 1801 Process. 1803 v) If the new route is an overlapping route that is less specific 1804 (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the 1805 BGP speaker shall run its Decision Process on the set of destinations 1806 described only by the less specific route. 1808 9.1 Decision Process 1810 The Decision Process selects routes for subsequent advertisement by 1811 applying the policies in the local Policy Information Base (PIB) to 1812 the routes stored in its Adj-RIBs-In. The output of the Decision 1813 Process is the set of routes that will be advertised to all peers; 1814 the selected routes will be stored in the local speaker's Adj-RIB- 1815 Out. 1817 RFC DRAFT November 2001 1819 The selection process is formalized by defining a function that takes 1820 the attribute of a given route as an argument and returns a non- 1821 negative integer denoting the degree of preference for the route. 1822 The function that calculates the degree of preference for a given 1823 route shall not use as its inputs any of the following: the existence 1824 of other routes, the non-existence of other routes, or the path 1825 attributes of other routes. Route selection then consists of 1826 individual application of the degree of preference function to each 1827 feasible route, followed by the choice of the one with the highest 1828 degree of preference. 1830 The Decision Process operates on routes contained in the Adj-RIB-In, 1831 and is responsible for: 1833 - selection of routes to be used locally by the speaker 1835 - selection of routes to be advertised to internal peers 1837 - selection of routes to be advertised to external peers 1839 - route aggregation and route information reduction 1841 The Decision Process takes place in three distinct phases, each 1842 triggered by a different event: 1844 a) Phase 1 is responsible for calculating the degree of preference 1845 for each route received from a peer, and MAY also advertise to all 1846 the internal peers the routes from external peers that have the 1847 highest degree of preference for each distinct destination. 1849 b) Phase 2 is invoked on completion of phase 1. It is responsible 1850 for choosing the best route out of all those available for each 1851 distinct destination, and for installing each chosen route into 1852 the Loc-RIB. 1854 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 1855 responsible for disseminating routes in the Loc-RIB to each 1856 external peer, according to the policies contained in the PIB. 1857 Route aggregation and information reduction can optionally be 1858 performed within this phase. 1860 9.1.1 Phase 1: Calculation of Degree of Preference 1862 The Phase 1 decision function shall be invoked whenever the local BGP 1863 speaker receives from a peer an UPDATE message that advertises a new 1864 route, a replacement route, or withdrawn routes. 1866 RFC DRAFT November 2001 1868 The Phase 1 decision function is a separate process which completes 1869 when it has no further work to do. 1871 The Phase 1 decision function shall lock an Adj-RIB-In prior to 1872 operating on any route contained within it, and shall unlock it after 1873 operating on all new or unfeasible routes contained within it. 1875 For each newly received or replacement feasible route, the local BGP 1876 speaker shall determine a degree of preference. If the route is 1877 learned from an internal peer, either the value of the LOCAL_PREF 1878 attribute shall be taken as the degree of preference, or the local 1879 system may compute the degree of preference of the route based on 1880 preconfigured policy information. Note that the latter (computing the 1881 degree of preference based on preconfigured policy information) may 1882 result in formation of persistent routing loops. If the route is 1883 learned from an external peer, then the local BGP speaker computes 1884 the degree of preference based on preconfigured policy information 1885 and uses it as the LOCAL_PREF value in any IBGP readvertisement. The 1886 exact nature of this policy information and the computation involved 1887 is a local matter. For a route learned from an external peer, the 1888 local speaker shall then run the internal update process of 9.2.1 to 1889 select and advertise the most preferable route. 1891 9.1.2 Phase 2: Route Selection 1893 The Phase 2 decision function shall be invoked on completion of Phase 1894 1. The Phase 2 function is a separate process which completes when 1895 it has no further work to do. The Phase 2 process shall consider all 1896 routes that are present in the Adj-RIBs-In, including those received 1897 from both internal and external peers. 1899 The Phase 2 decision function shall be blocked from running while the 1900 Phase 3 decision function is in process. The Phase 2 function shall 1901 lock all Adj-RIBs-In prior to commencing its function, and shall 1902 unlock them on completion. 1904 If the NEXT_HOP attribute of a BGP route depicts an address that is 1905 not resolvable, or it would become unresolvable if the route was 1906 installed in the routing table the BGP route should be excluded from 1907 the Phase 2 decision function. 1909 It is critical that routers within an AS do not make conflicting 1910 decisions regarding route selection that would cause forwarding loops 1911 to occur. 1913 For each set of destinations for which a feasible route exists in the 1914 RFC DRAFT November 2001 1916 Adj-RIBs-In, the local BGP speaker shall identify the route that has: 1918 a) the highest degree of preference of any route to the same set 1919 of destinations, or 1921 b) is the only route to that destination, or 1923 c) is selected as a result of the Phase 2 tie breaking rules 1924 specified in 9.1.2.2. 1926 The local speaker SHALL then install that route in the Loc-RIB, 1927 replacing any route to the same destination that is currently being 1928 held in the Loc-RIB. If the new BGP route is installed in the Routing 1929 Table (as a result of the local policy decision), care must be taken 1930 to ensure that invalid BGP routes to the same destination are removed 1931 from the Routing Table. Whether or not the new route replaces an 1932 already existing non-BGP route in the routing table depends on the 1933 policy configured on the BGP speaker. 1935 The local speaker MUST determine the immediate next hop to the 1936 address depicted by the NEXT_HOP attribute of the selected route by 1937 performing a best matching route lookup in the Routing Table and 1938 selecting one of the possible paths (if multiple best paths to the 1939 same prefix are available). If the route to the address depicted by 1940 the NEXT_HOP attribute changes such that the immediate next hop or 1941 the IGP cost to the NEXT_HOP (if the NEXT_HOP is resolved through an 1942 IGP route) changes, route selection should be recalculated as 1943 specified above. 1945 Notice that even though BGP routes do not have to be installed in the 1946 Routing Table with the immediate next hop(s), implementations must 1947 take care that before any packets are forwarded along a BGP route, 1948 its associated NEXT_HOP address is resolved to the immediate 1949 (directly connected) next-hop address and this address (or multiple 1950 addresses) is finally used for actual packet forwarding. 1952 Unresolvable routes SHALL be removed from the Loc-RIB and the routing 1953 table. However, corresponding unresolvable routes SHOULD be kept in 1954 the Adj-RIBs-In. 1956 9.1.2.1 Route Resolvability Condition 1958 As indicated in Section 9.1.2, BGP routers should exclude 1959 unresolvable routes from the Phase 2 decision. This ensures that only 1960 valid routes are installed in Loc-RIB and the Routing Table. 1962 RFC DRAFT November 2001 1964 The route resolvability condition is defined as follows. 1966 1. A route Rte1, referencing only the intermediate network 1967 address, is considered resolvable if the Routing Table contains at 1968 least one resolvable route Rte2 that matches Rte1's intermediate 1969 network address and is not recursively resolved (directly or 1970 indirectly) through Rte1. If multiple matching routes are 1971 available, only the longest matching route should be considered. 1973 2. Routes referencing interfaces (with or without intermediate 1974 addresses) are considered resolvable if the state of the 1975 referenced interface is up and IP processing is enabled on this 1976 interface. 1978 BGP routes do not refer to interfaces, but can be resolved through 1979 the routes in the Routing Table that can be of both types. IGP routes 1980 and routes to directly connected networks are expected to specify the 1981 outbound interface. 1983 Note that a BGP route is considered unresolvable not only in 1984 situations where the router's Routing Table contains no route 1985 matching the BGP route's NEXT_HOP. Mutually recursive routes (routes 1986 resolving each other or themselves), also fail the resolvability 1987 check. 1989 It is also important that implementations do not consider feasible 1990 routes that would become unresolvable if they were installed in the 1991 Routing Table even if their NEXT_HOPs are resolvable using the 1992 current contents of the Routing Table (an example of such routes 1993 would be mutually recursive routes). This check ensures that a BGP 1994 speaker does not install in the Routing Table routes that will be 1995 removed and not used by the speaker. Therefore, in addition to local 1996 Routing Table stability, this check also improves behavior of the 1997 protocol in the network. 1999 Whenever a BGP speaker identifies a route that fails the 2000 resolvability check because of mutual recursion, an error message 2001 should be logged. 2003 9.1.2.2 Breaking Ties (Phase 2) 2005 In its Adj-RIBs-In a BGP speaker may have several routes to the same 2006 destination that have the same degree of preference. The local 2007 speaker can select only one of these routes for inclusion in the 2008 associated Loc-RIB. The local speaker considers all routes with the 2009 same degrees of preference, both those received from internal peers, 2010 RFC DRAFT November 2001 2012 and those received from external peers. 2014 The following tie-breaking procedure assumes that for each candidate 2015 route all the BGP speakers within an autonomous system can ascertain 2016 the cost of a path (interior distance) to the address depicted by the 2017 NEXT_HOP attribute of the route, and follow the same route selection 2018 algorithm. 2020 The tie-breaking algorithm begins by considering all equally 2021 preferable routes to the same destination, and then selects routes to 2022 be removed from consideration. The algorithm terminates as soon as 2023 only one route remains in consideration. The criteria must be 2024 applied in the order specified. 2026 Several of the criteria are described using pseudo-code. Note that 2027 the pseudo-code shown was chosen for clarity, not efficiency. It is 2028 not intended to specify any particular implementation. BGP 2029 implementations MAY use any algorithm which produces the same results 2030 as those described here. 2032 a) Remove from consideration all routes which are not tied for 2033 having the smallest number of AS numbers present in their AS_PATH 2034 attributes. Note, that when counting this number, an AS_SET counts 2035 as 1, no matter how many ASs are in the set, and that, if the 2036 implementation supports [13], then AS numbers present in segments 2037 of type AS_CONFED_SEQUENCE or AS_CONFED_SET are not included in 2038 the count of AS numbers present in the AS_PATH. 2040 b) Remove from consideration all routes which are not tied for 2041 having the lowest Origin number in their Origin attribute. 2043 c) Remove from consideration routes with less-preferred 2044 MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable 2045 between routes learned from the same neighboring AS. Routes which 2046 do not have the MULTI_EXIT_DISC attribute are considered to have 2047 the lowest possible MULTI_EXIT_DISC value. 2049 This is also described in the following procedure: 2051 for m = all routes still under consideration 2052 for n = all routes still under consideration 2053 if (neighborAS(m) == neighborAS(n)) and (MED(n) < MED(m)) 2054 remove route m from consideration 2056 In the pseudo-code above, MED(n) is a function which returns the 2057 value of route n's MULTI_EXIT_DISC attribute. If route n has no 2058 MULTI_EXIT_DISC attribute, the function returns the lowest 2059 possible MULTI_EXIT_DISC value, i.e. 0. 2061 RFC DRAFT November 2001 2063 Similarly, neighborAS(n) is a function which returns the neighbor 2064 AS from which the route was received. 2066 d) If at least one of the candidate routes was received from an 2067 external peer in a neighboring autonomous system, remove from 2068 consideration all routes which were received from internal peers. 2070 e) Remove from consideration any routes with less-preferred 2071 interior cost. The interior cost of a route is determined by 2072 calculating the metric to the next hop for the route using the 2073 Routing Table. If the next hop for a route is reachable, but no 2074 cost can be determined, then this step should be skipped 2075 (equivalently, consider all routes to have equal costs). 2077 This is also described in the following procedure. 2079 for m = all routes still under consideration 2080 for n = all routes in still under consideration 2081 if (cost(n) is better than cost(m)) 2082 remove m from consideration 2084 In the pseudo-code above, cost(n) is a function which returns the 2085 cost of the path (interior distance) to the address given in the 2086 NEXT_HOP attribute of the route. 2088 f) Remove from consideration all routes other than the route that 2089 was advertised by the BGP speaker whose BGP Identifier has the 2090 lowest value. 2092 9.1.3 Phase 3: Route Dissemination 2094 The Phase 3 decision function shall be invoked on completion of Phase 2095 2, or when any of the following events occur: 2097 a) when routes in the Loc-RIB to local destinations have changed 2099 b) when locally generated routes learned by means outside of BGP 2100 have changed 2102 c) when a new BGP speaker - BGP speaker connection has been 2103 established 2105 The Phase 3 function is a separate process which completes when it 2106 has no further work to do. The Phase 3 Routing Decision function 2107 shall be blocked from running while the Phase 2 decision function is 2108 in process. 2110 RFC DRAFT November 2001 2112 All routes in the Loc-RIB shall be processed into a corresponding 2113 entry in the associated Adj-RIBs-Out. Route aggregation and 2114 information reduction techniques (see 9.2.4.1) may optionally be 2115 applied. 2117 When the updating of the Adj-RIBs-Out and the Routing Table is 2118 complete, the local BGP speaker shall run the external update process 2119 of 9.2.2. 2121 9.1.4 Overlapping Routes 2123 A BGP speaker may transmit routes with overlapping Network Layer 2124 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 2125 occurs when a set of destinations are identified in non-matching 2126 multiple routes. Since BGP encodes NLRI using IP prefixes, overlap 2127 will always exhibit subset relationships. A route describing a 2128 smaller set of destinations (a longer prefix) is said to be more 2129 specific than a route describing a larger set of destinations (a 2130 shorted prefix); similarly, a route describing a larger set of 2131 destinations (a shorter prefix) is said to be less specific than a 2132 route describing a smaller set of destinations (a longer prefix). 2134 The precedence relationship effectively decomposes less specific 2135 routes into two parts: 2137 - a set of destinations described only by the less specific route, 2138 and 2140 - a set of destinations described by the overlap of the less 2141 specific and the more specific routes 2143 When overlapping routes are present in the same Adj-RIB-In, the more 2144 specific route shall take precedence, in order from more specific to 2145 least specific. 2147 The set of destinations described by the overlap represents a portion 2148 of the less specific route that is feasible, but is not currently in 2149 use. If a more specific route is later withdrawn, the set of 2150 destinations described by the overlap will still be reachable using 2151 the less specific route. 2153 If a BGP speaker receives overlapping routes, the Decision Process 2154 MUST consider both routes based on the configured acceptance policy. 2155 If both a less and a more specific route are accepted, then the 2156 Decision Process MUST either install both the less and the more 2157 RFC DRAFT November 2001 2159 specific routes or it MUST aggregate the two routes and install the 2160 aggregated route, provided that both routes have the same value of 2161 the NEXT_HOP attribute. 2163 If a BGP speaker chooses to aggregate, then it MUST add 2164 ATOMIC_AGGREGATE attribute to the route. A route that carries 2165 ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the 2166 NLRI of this route can not be made more specific. Forwarding along 2167 such a route does not guarantee that IP packets will actually 2168 traverse only ASs listed in the AS_PATH attribute of the route. 2170 9.2 Update-Send Process 2172 The Update-Send process is responsible for advertising UPDATE 2173 messages to all peers. For example, it distributes the routes chosen 2174 by the Decision Process to other BGP speakers which may be located in 2175 either the same autonomous system or a neighboring autonomous system. 2176 Rules for information exchange between BGP speakers located in 2177 different autonomous systems are given in 9.2.2; rules for 2178 information exchange between BGP speakers located in the same 2179 autonomous system are given in 9.2.1. 2181 Distribution of routing information between a set of BGP speakers, 2182 all of which are located in the same autonomous system, is referred 2183 to as internal distribution. 2185 9.2.1 Internal Updates 2187 The Internal update process is concerned with the distribution of 2188 routing information to internal peers. 2190 When a BGP speaker receives an UPDATE message from an internal peer, 2191 the receiving BGP speaker shall not re-distribute the routing 2192 information contained in that UPDATE message to other internal peers, 2193 unless the speaker acts as a BGP Route Reflector [11]. 2195 When a BGP speaker receives a new route from an external peer, it 2196 MUST advertise that route to all other internal peers by means of an 2197 UPDATE message if this route will be installed in its Loc-RIB 2198 according to the route selection rules in 9.1.2. 2200 When a BGP speaker receives an UPDATE message with a non-empty 2201 WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all 2202 routes whose destinations were carried in this field (as IP 2203 RFC DRAFT November 2001 2205 prefixes). The speaker shall take the following additional steps: 2207 1) if the corresponding feasible route had not been previously 2208 advertised, then no further action is necessary 2210 2) if the corresponding feasible route had been previously 2211 advertised, then: 2213 i) If a new route for the same NLRI is selected for 2214 advertisement, then the BGP speaker shall advertise the 2215 replacement route 2217 ii) if a replacement route is not available for advertisement, 2218 then the BGP speaker shall include the destinations of the 2219 unfeasible route (in form of IP prefixes) in the WITHDRAWN 2220 ROUTES field of an UPDATE message, and shall send this message 2221 to each peer to whom it had previously advertised the 2222 corresponding feasible route. 2224 All feasible routes which are advertised shall be placed in the 2225 appropriate Adj-RIBs-Out, and all unfeasible routes which are 2226 advertised shall be removed from the Adj-RIBs-Out after the 2227 corresponding update messages have been sent. 2229 9.2.2 External Updates 2231 The external update process is concerned with the distribution of 2232 routing information to external peers. As part of Phase 3 route 2233 selection process, the BGP speaker has updated its Adj-RIBs-Out and 2234 its Routing Table. All newly installed routes and all newly 2235 unfeasible routes for which there is no replacement route shall be 2236 advertised to external peers by means of UPDATE message. 2238 Any routes in the Loc-RIB marked as unfeasible shall be removed. 2239 Changes to the reachable destinations within its own autonomous 2240 system shall also be advertised in an UPDATE message. 2242 9.2.3 Controlling Routing Traffic Overhead 2244 The BGP protocol constrains the amount of routing traffic (that is, 2245 UPDATE messages) in order to limit both the link bandwidth needed to 2246 advertise UPDATE messages and the processing power needed by the 2247 Decision Process to digest the information contained in the UPDATE 2248 messages. 2250 RFC DRAFT November 2001 2252 9.2.3.1 Frequency of Route Advertisement 2254 The parameter MinRouteAdvertisementInterval determines the minimum 2255 amount of time that must elapse between advertisement of routes to a 2256 particular destination from a single BGP speaker. This rate limiting 2257 procedure applies on a per-destination basis, although the value of 2258 MinRouteAdvertisementInterval is set on a per BGP peer basis. 2260 Two UPDATE messages sent from a single BGP speaker that advertise 2261 feasible routes to some common set of destinations received from 2262 external peers must be separated by at least 2263 MinRouteAdvertisementInterval. Clearly, this can only be achieved 2264 precisely by keeping a separate timer for each common set of 2265 destinations. This would be unwarranted overhead. Any technique which 2266 ensures that the interval between two UPDATE messages sent from a 2267 single BGP speaker that advertise feasible routes to some common set 2268 of destinations received from external peers will be at least 2269 MinRouteAdvertisementInterval, and will also ensure a constant upper 2270 bound on the interval is acceptable. 2272 Since fast convergence is needed within an autonomous system, this 2273 procedure does not apply for routes received from other internal 2274 peers. To avoid long-lived black holes, the procedure does not apply 2275 to the explicit withdrawal of unfeasible routes (that is, routes 2276 whose destinations (expressed as IP prefixes) are listed in the 2277 WITHDRAWN ROUTES field of an UPDATE message). 2279 This procedure does not limit the rate of route selection, but only 2280 the rate of route advertisement. If new routes are selected multiple 2281 times while awaiting the expiration of MinRouteAdvertisementInterval, 2282 the last route selected shall be advertised at the end of 2283 MinRouteAdvertisementInterval. 2285 9.2.3.2 Frequency of Route Origination 2287 The parameter MinASOriginationInterval determines the minimum amount 2288 of time that must elapse between successive advertisements of UPDATE 2289 messages that report changes within the advertising BGP speaker's own 2290 autonomous systems. 2292 9.2.3.3 Jitter 2294 To minimize the likelihood that the distribution of BGP messages by a 2295 RFC DRAFT November 2001 2297 given BGP speaker will contain peaks, jitter should be applied to the 2298 timers associated with MinASOriginationInterval, Keepalive, and 2299 MinRouteAdvertisementInterval. A given BGP speaker shall apply the 2300 same jitter to each of these quantities regardless of the 2301 destinations to which the updates are being sent; that is, jitter 2302 will not be applied on a "per peer" basis. 2304 The amount of jitter to be introduced shall be determined by 2305 multiplying the base value of the appropriate timer by a random 2306 factor which is uniformly distributed in the range from 0.75 to 1.0. 2308 9.2.4 Efficient Organization of Routing Information 2310 Having selected the routing information which it will advertise, a 2311 BGP speaker may avail itself of several methods to organize this 2312 information in an efficient manner. 2314 9.2.4.1 Information Reduction 2316 Information reduction may imply a reduction in granularity of policy 2317 control - after information is collapsed, the same policies will 2318 apply to all destinations and paths in the equivalence class. 2320 The Decision Process may optionally reduce the amount of information 2321 that it will place in the Adj-RIBs-Out by any of the following 2322 methods: 2324 a) Network Layer Reachability Information (NLRI): 2326 Destination IP addresses can be represented as IP address 2327 prefixes. In cases where there is a correspondence between the 2328 address structure and the systems under control of an autonomous 2329 system administrator, it will be possible to reduce the size of 2330 the NLRI carried in the UPDATE messages. 2332 b) AS_PATHs: 2334 AS path information can be represented as ordered AS_SEQUENCEs or 2335 unordered AS_SETs. AS_SETs are used in the route aggregation 2336 algorithm described in 9.2.4.2. They reduce the size of the 2337 AS_PATH information by listing each AS number only once, 2338 regardless of how many times it may have appeared in multiple 2339 AS_PATHs that were aggregated. 2341 RFC DRAFT November 2001 2343 An AS_SET implies that the destinations listed in the NLRI can be 2344 reached through paths that traverse at least some of the 2345 constituent autonomous systems. AS_SETs provide sufficient 2346 information to avoid routing information looping; however their 2347 use may prune potentially feasible paths, since such paths are no 2348 longer listed individually as in the form of AS_SEQUENCEs. In 2349 practice this is not likely to be a problem, since once an IP 2350 packet arrives at the edge of a group of autonomous systems, the 2351 BGP speaker at that point is likely to have more detailed path 2352 information and can distinguish individual paths to destinations. 2354 9.2.4.2 Aggregating Routing Information 2356 Aggregation is the process of combining the characteristics of 2357 several different routes in such a way that a single route can be 2358 advertised. Aggregation can occur as part of the decision process to 2359 reduce the amount of routing information that will be placed in the 2360 Adj-RIBs-Out. 2362 Aggregation reduces the amount of information that a BGP speaker must 2363 store and exchange with other BGP speakers. Routes can be aggregated 2364 by applying the following procedure separately to path attributes of 2365 like type and to the Network Layer Reachability Information. 2367 Routes that have the following attributes shall not be aggregated 2368 unless the corresponding attributes of each route are identical: 2369 MULTI_EXIT_DISC, NEXT_HOP. 2371 If the aggregation occurs as part of the update process, routes with 2372 different NEXT_HOP values can be aggregated when announced through an 2373 external BGP session. 2375 Path attributes that have different type codes can not be aggregated 2376 together. Path attributes of the same type code may be aggregated, 2377 according to the following rules: 2379 ORIGIN attribute: If at least one route among routes that are 2380 aggregated has ORIGIN with the value INCOMPLETE, then the 2381 aggregated route must have the ORIGIN attribute with the value 2382 INCOMPLETE. Otherwise, if at least one route among routes that are 2383 aggregated has ORIGIN with the value EGP, then the aggregated 2384 route must have the origin attribute with the value EGP. In all 2385 other case the value of the ORIGIN attribute of the aggregated 2386 route is IGP. 2388 AS_PATH attribute: If routes to be aggregated have identical 2389 RFC DRAFT November 2001 2391 AS_PATH attributes, then the aggregated route has the same AS_PATH 2392 attribute as each individual route. 2394 For the purpose of aggregating AS_PATH attributes we model each AS 2395 within the AS_PATH attribute as a tuple , where 2396 "type" identifies a type of the path segment the AS belongs to 2397 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If the 2398 routes to be aggregated have different AS_PATH attributes, then 2399 the aggregated AS_PATH attribute shall satisfy all of the 2400 following conditions: 2402 - all tuples of type AS_SEQUENCE in the aggregated AS_PATH 2403 shall appear in all of the AS_PATH in the initial set of routes 2404 to be aggregated. 2406 - all tuples of type AS_SET in the aggregated AS_PATH shall 2407 appear in at least one of the AS_PATH in the initial set (they 2408 may appear as either AS_SET or AS_SEQUENCE types). 2410 - for any tuple X of type AS_SEQUENCE in the aggregated AS_PATH 2411 which precedes tuple Y in the aggregated AS_PATH, X precedes Y 2412 in each AS_PATH in the initial set which contains Y, regardless 2413 of the type of Y. 2415 - No tuple of type AS_SET with the same value shall appear more 2416 than once in the aggregated AS_PATH. 2418 - Multiple tuples of type AS_SEQUENCE with the same value may 2419 appear in the aggregated AS_PATH only when adjacent to another 2420 tuple of the same type and value. 2422 An implementation may choose any algorithm which conforms to these 2423 rules. At a minimum a conformant implementation shall be able to 2424 perform the following algorithm that meets all of the above 2425 conditions: 2427 - determine the longest leading sequence of tuples (as defined 2428 above) common to all the AS_PATH attributes of the routes to be 2429 aggregated. Make this sequence the leading sequence of the 2430 aggregated AS_PATH attribute. 2432 - set the type of the rest of the tuples from the AS_PATH 2433 attributes of the routes to be aggregated to AS_SET, and append 2434 them to the aggregated AS_PATH attribute. 2436 - if the aggregated AS_PATH has more than one tuple with the 2437 same value (regardless of tuple's type), eliminate all, but one 2438 such tuple by deleting tuples of the type AS_SET from the 2439 RFC DRAFT November 2001 2441 aggregated AS_PATH attribute. 2443 Appendix 6, section 6.8 presents another algorithm that satisfies 2444 the conditions and allows for more complex policy configurations. 2446 ATOMIC_AGGREGATE: If at least one of the routes to be aggregated 2447 has ATOMIC_AGGREGATE path attribute, then the aggregated route 2448 shall have this attribute as well. 2450 AGGREGATOR: All AGGREGATOR attributes of all routes to be 2451 aggregated should be ignored. The BGP speaker performing the route 2452 aggregation may attach a new AGGREGATOR attribute (see Section 2453 5.1.7). 2455 9.3 Route Selection Criteria 2457 Generally speaking, additional rules for comparing routes among 2458 several alternatives are outside the scope of this document. There 2459 are two exceptions: 2461 - If the local AS appears in the AS path of the new route being 2462 considered, then that new route cannot be viewed as better than 2463 any other route (provided that the speaker is configured to accept 2464 such routes). If such a route were ever used, a routing loop could 2465 result (see Section 6.3). 2467 - In order to achieve successful distributed operation, only 2468 routes with a likelihood of stability can be chosen. Thus, an AS 2469 must avoid using unstable routes, and it must not make rapid 2470 spontaneous changes to its choice of route. Quantifying the terms 2471 "unstable" and "rapid" in the previous sentence will require 2472 experience, but the principle is clear. 2474 Care must be taken to ensure that BGP speakers in the same AS do 2475 not make inconsistent decisions. 2477 9.4 Originating BGP routes 2479 A BGP speaker may originate BGP routes by injecting routing 2480 information acquired by some other means (e.g. via an IGP) into BGP. 2481 A BGP speaker that originates BGP routes shall assign the degree of 2482 preference to these routes by passing them through the Decision 2483 Process (see Section 9.1). These routes may also be distributed to 2484 other BGP speakers within the local AS as part of the Internal update 2485 process (see Section 9.2.1). The decision whether to distribute non- 2486 RFC DRAFT November 2001 2488 BGP acquired routes within an AS via BGP or not depends on the 2489 environment within the AS (e.g. type of IGP) and should be controlled 2490 via configuration. 2492 Appendix 1. Comparison with RFC1771 2494 There are numerous editorial changes (too many to list here). 2496 The following list the technical changes: 2498 Changes to reflect the usages of such features as TCP MD5 [10], 2499 BGP Route Reflectors [11], BGP Confederations [13], and BGP Route 2500 Refresh [12]. 2502 Clarification on the use of the BGP Identifier in the AGGREGATOR 2503 attribute. 2505 Procedures for imposing an upper bound on the number of prefixes 2506 that a BGP speaker would accept from a peer. 2508 The ability of a BGP speaker to include more than one instance of 2509 its own AS in the AS_PATH attribute for the purpose of inter-AS 2510 traffic engineering. 2512 Clarifications on the various types of NEXT_HOPs. 2514 Clarifications to the use of the ATOMIC_AGGREGATE attribute. 2516 The relationship between the immediate next hop, and the next hop 2517 as specified in the NEXT_HOP path attribute. 2519 Clarifications on the tie-breaking procedures. 2521 Appendix 2. Comparison with RFC1267 2523 All the changes listed in Appendix 1, plus the following. 2525 BGP-4 is capable of operating in an environment where a set of 2526 reachable destinations may be expressed via a single IP prefix. The 2527 concept of network classes, or subnetting is foreign to BGP-4. To 2528 accommodate these capabilities BGP-4 changes semantics and encoding 2529 RFC DRAFT November 2001 2531 associated with the AS_PATH attribute. New text has been added to 2532 define semantics associated with IP prefixes. These abilities allow 2533 BGP-4 to support the proposed supernetting scheme [9]. 2535 To simplify configuration this version introduces a new attribute, 2536 LOCAL_PREF, that facilitates route selection procedures. 2538 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 2539 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 2540 certain aggregates are not de-aggregated. Another new attribute, 2541 AGGREGATOR, can be added to aggregate routes in order to advertise 2542 which AS and which BGP speaker within that AS caused the aggregation. 2544 To insure that Hold Timers are symmetric, the Hold Time is now 2545 negotiated on a per-connection basis. Hold Times of zero are now 2546 supported. 2548 Appendix 3. Comparison with RFC 1163 2550 All of the changes listed in Appendices 1 and 2, plus the following. 2552 To detect and recover from BGP connection collision, a new field (BGP 2553 Identifier) has been added to the OPEN message. New text (Section 2554 6.8) has been added to specify the procedure for detecting and 2555 recovering from collision. 2557 The new document no longer restricts the border router that is passed 2558 in the NEXT_HOP path attribute to be part of the same Autonomous 2559 System as the BGP Speaker. 2561 New document optimizes and simplifies the exchange of the information 2562 about previously reachable routes. 2564 Appendix 4. Comparison with RFC 1105 2566 All of the changes listed in Appendices 1, 2 and 3, plus the 2567 following. 2569 Minor changes to the RFC1105 Finite State Machine were necessary to 2570 accommodate the TCP user interface provided by 4.3 BSD. 2572 The notion of Up/Down/Horizontal relations present in RFC1105 has 2573 been removed from the protocol. 2575 The changes in the message format from RFC1105 are as follows: 2577 RFC DRAFT November 2001 2579 1. The Hold Time field has been removed from the BGP header and 2580 added to the OPEN message. 2582 2. The version field has been removed from the BGP header and 2583 added to the OPEN message. 2585 3. The Link Type field has been removed from the OPEN message. 2587 4. The OPEN CONFIRM message has been eliminated and replaced with 2588 implicit confirmation provided by the KEEPALIVE message. 2590 5. The format of the UPDATE message has been changed 2591 significantly. New fields were added to the UPDATE message to 2592 support multiple path attributes. 2594 6. The Marker field has been expanded and its role broadened to 2595 support authentication. 2597 Note that quite often BGP, as specified in RFC 1105, is referred 2598 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 2599 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 2600 BGP, as specified in this document is referred to as BGP-4. 2602 Appendix 5. TCP options that may be used with BGP 2604 If a local system TCP user interface supports TCP PUSH function, then 2605 each BGP message should be transmitted with PUSH flag set. Setting 2606 PUSH flag forces BGP messages to be transmitted promptly to the 2607 receiver. 2609 If a local system TCP user interface supports setting precedence for 2610 TCP connection, then the BGP transport connection should be opened 2611 with precedence set to Internetwork Control (110) value (see also 2612 [6]). 2614 A local system may protect its BGP sessions by using the TCP MD5 2615 Signature Option [10]. 2617 Appendix 6. Implementation Recommendations 2619 This section presents some implementation recommendations. 2621 RFC DRAFT November 2001 2623 6.1 Multiple Networks Per Message 2625 The BGP protocol allows for multiple address prefixes with the same 2626 path attributes to be specified in one message. Making use of this 2627 capability is highly recommended. With one address prefix per message 2628 there is a substantial increase in overhead in the receiver. Not only 2629 does the system overhead increase due to the reception of multiple 2630 messages, but the overhead of scanning the routing table for updates 2631 to BGP peers and other routing protocols (and sending the associated 2632 messages) is incurred multiple times as well. 2634 One method of building messages containing many address prefixes per 2635 a path attribute set from a routing table that is not organized on a 2636 per path attribute set basis is to build many messages as the routing 2637 table is scanned. As each address prefix is processed, a message for 2638 the associated set of path attributes is allocated, if it does not 2639 exist, and the new address prefix is added to it. If such a message 2640 exists, the new address prefix is just appended to it. If the message 2641 lacks the space to hold the new address prefix, it is transmitted, a 2642 new message is allocated, and the new address prefix is inserted into 2643 the new message. When the entire routing table has been scanned, all 2644 allocated messages are sent and their resources released. Maximum 2645 compression is achieved when all the destinations covered by the 2646 address prefixes share a common set of path attributes making it 2647 possible to send many address prefixes in one 4096-byte message. 2649 When peering with a BGP implementation that does not compress 2650 multiple address prefixes into one message, it may be necessary to 2651 take steps to reduce the overhead from the flood of data received 2652 when a peer is acquired or a significant network topology change 2653 occurs. One method of doing this is to limit the rate of updates. 2654 This will eliminate the redundant scanning of the routing table to 2655 provide flash updates for BGP peers and other routing protocols. A 2656 disadvantage of this approach is that it increases the propagation 2657 latency of routing information. By choosing a minimum flash update 2658 interval that is not much greater than the time it takes to process 2659 the multiple messages this latency should be minimized. A better 2660 method would be to read all received messages before sending updates. 2662 6.2 Processing Messages on a Stream Protocol 2664 BGP uses TCP as a transport mechanism. Due to the stream nature of 2665 TCP, all the data for received messages does not necessarily arrive 2666 at the same time. This can make it difficult to process the data as 2667 messages, especially on systems such as BSD Unix where it is not 2668 RFC DRAFT November 2001 2670 possible to determine how much data has been received but not yet 2671 processed. 2673 One method that can be used in this situation is to first try to read 2674 just the message header. For the KEEPALIVE message type, this is a 2675 complete message; for other message types, the header should first be 2676 verified, in particular the total length. If all checks are 2677 successful, the specified length, minus the size of the message 2678 header is the amount of data left to read. An implementation that 2679 would "hang" the routing information process while trying to read 2680 from a peer could set up a message buffer (4096 bytes) per peer and 2681 fill it with data as available until a complete message has been 2682 received. 2684 6.3 Reducing route flapping 2686 To avoid excessive route flapping a BGP speaker which needs to 2687 withdraw a destination and send an update about a more specific or 2688 less specific route SHOULD combine them into the same UPDATE message. 2690 6.4 BGP Timers 2692 BGP employs five timers: ConnectRetry, Hold Time, KeepAlive, 2693 MinASOriginationInterval, and MinRouteAdvertisementInterval The 2694 suggested value for the ConnectRetry timer is 120 seconds. The 2695 suggested value for the Hold Time is 90 seconds. The suggested value 2696 for the KeepAlive timer is 1/3 of the Hold Time. The suggested value 2697 for the MinASOriginationInterval is 15 seconds. The suggested value 2698 for the MinRouteAdvertisementInterval is 30 seconds. 2700 An implementation of BGP MUST allow the Hold Time timer to be 2701 configurable, and MAY allow the other timers to be configurable. 2703 6.5 Path attribute ordering 2705 Implementations which combine update messages as described above in 2706 6.1 may prefer to see all path attributes presented in a known order. 2707 This permits them to quickly identify sets of attributes from 2708 different update messages which are semantically identical. To 2709 facilitate this, it is a useful optimization to order the path 2710 attributes according to type code. This optimization is entirely 2711 RFC DRAFT November 2001 2713 optional. 2715 6.6 AS_SET sorting 2717 Another useful optimization that can be done to simplify this 2718 situation is to sort the AS numbers found in an AS_SET. This 2719 optimization is entirely optional. 2721 6.7 Control over version negotiation 2723 Since BGP-4 is capable of carrying aggregated routes which cannot be 2724 properly represented in BGP-3, an implementation which supports BGP-4 2725 and another BGP version should provide the capability to only speak 2726 BGP-4 on a per-peer basis. 2728 6.8 Complex AS_PATH aggregation 2730 An implementation which chooses to provide a path aggregation 2731 algorithm which retains significant amounts of path information may 2732 wish to use the following procedure: 2734 For the purpose of aggregating AS_PATH attributes of two routes, 2735 we model each AS as a tuple , where "type" identifies 2736 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 2737 AS_SET), and "value" is the AS number. Two ASs are said to be the 2738 same if their corresponding tuples are the same. 2740 The algorithm to aggregate two AS_PATH attributes works as 2741 follows: 2743 a) Identify the same ASs (as defined above) within each AS_PATH 2744 attribute that are in the same relative order within both 2745 AS_PATH attributes. Two ASs, X and Y, are said to be in the 2746 same order if either: 2747 - X precedes Y in both AS_PATH attributes, or - Y precedes X 2748 in both AS_PATH attributes. 2750 b) The aggregated AS_PATH attribute consists of ASs identified 2751 in (a) in exactly the same order as they appear in the AS_PATH 2752 attributes to be aggregated. If two consecutive ASs identified 2753 in (a) do not immediately follow each other in both of the 2754 AS_PATH attributes to be aggregated, then the intervening ASs 2755 RFC DRAFT November 2001 2757 (ASs that are between the two consecutive ASs that are the 2758 same) in both attributes are combined into an AS_SET path 2759 segment that consists of the intervening ASs from both AS_PATH 2760 attributes; this segment is then placed in between the two 2761 consecutive ASs identified in (a) of the aggregated attribute. 2762 If two consecutive ASs identified in (a) immediately follow 2763 each other in one attribute, but do not follow in another, then 2764 the intervening ASs of the latter are combined into an AS_SET 2765 path segment; this segment is then placed in between the two 2766 consecutive ASs identified in (a) of the aggregated attribute. 2768 If as a result of the above procedure a given AS number appears 2769 more than once within the aggregated AS_PATH attribute, all, but 2770 the last instance (rightmost occurrence) of that AS number should 2771 be removed from the aggregated AS_PATH attribute. 2773 Security Considerations 2775 BGP supports the ability to authenticate BGP messages by using BGP 2776 authentication. The authentication could be done on a per peer basis. 2777 In addition, BGP supports the ability to authenticate its data stream 2778 by using [10]. This authentication could be done on a per peer basis. 2779 Finally, BGP could also use IPSec to authenticate its data stream. 2780 Among the mechanisms mentioned in this paragraph, [10] is the most 2781 widely deployed. 2783 References 2785 [1] Mills, D., "Exterior Gateway Protocol Formal Specification", 2786 RFC904, April 1984. 2788 [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET 2789 Backbone", RFC1092, February 1989. 2791 [3] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, February 2792 1989. 2794 [4] Postel, J., "Transmission Control Protocol - DARPA Internet 2795 Program Protocol Specification", RFC793, September 1981. 2797 [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway 2798 Protocol in the Internet", RFC1772, March 1995. 2800 [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol 2801 RFC DRAFT November 2001 2803 Specification", RFC791, September 1981. 2805 [7] "Information Processing Systems - Telecommunications and 2806 Information Exchange between Systems - Protocol for Exchange of 2807 Inter-domain Routeing Information among Intermediate Systems to 2808 Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 2810 [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter- 2811 Domain Routing (CIDR): an Address Assignment and Aggregation 2812 Strategy", RFC1519, September 1993. 2814 [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation 2815 with CIDR", RFC 1518, September 1993. 2817 [10] Heffernan, A., "Protection of BGP Sessions via the TCP MD5 2818 Signature Option", RFC2385, August 1998. 2820 [11] Bates, T., Chandra, R., Chen, E., "BGP Route Reflection - An 2821 Alternative to Full Mesh IBGP", RFC2796, April 2000. 2823 [12] Chen, E., "Route Refresh Capability for BGP-4", RFC2918, 2824 September 2000. 2826 [13] Traina, P, McPherson, D., Scudder, J., "Autonomous System 2827 Confederations for BGP", RFC3065, February 2001. 2829 Editors' Addresses 2831 Yakov Rekhter 2832 Juniper Networks 2833 1194 N. Mathilda Avenue 2834 Sunnyvale, CA 94089 2835 email: yakov@juniper.net 2837 Tony Li 2838 Procket Networks 2839 1100 Cadillac Ct. 2840 Milpitas, CA 95035 2841 Email: tli@procket.com