idnits 2.17.1 draft-ietf-idr-bgp4-16.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 407: '...sage, a BGP speaker MUST calculate the...' RFC 2119 keyword, line 410: '... Hold Time MUST be either zero o...' RFC 2119 keyword, line 800: '...er a BGP speaker MUST be able to proce...' RFC 2119 keyword, line 810: '... interval. KEEPALIVE messages MUST NOT...' RFC 2119 keyword, line 811: '... one per second. An implementation MAY...' (31 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 2598 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') -- Possible downref: Non-RFC (?) normative reference: 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. '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: 16 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, Russ White, Curtis Villamizar, and Alex Zinin for their 65 comments. 67 We would like to specially acknowledge numerous contributions by 68 Dennis Ferguson. 70 2. Introduction 72 The Border Gateway Protocol (BGP) is an inter-Autonomous System 73 routing protocol. It is built on experience gained with EGP as 74 defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as 75 described in RFC 1092 [2] and RFC 1093 [3]. 77 The primary function of a BGP speaking system is to exchange network 78 reachability information with other BGP systems. This network 79 reachability information includes information on the list of 80 Autonomous Systems (ASs) that reachability information traverses. 81 This information is sufficient to construct a graph of AS 82 connectivity from which routing loops may be pruned and some policy 83 decisions at the AS level may be enforced. 85 BGP-4 provides a new set of mechanisms for supporting Classless 86 Inter-Domain Routing (CIDR) [8, 9]. These mechanisms include support 87 for advertising an IP prefix and eliminates the concept of network 88 "class" within BGP. BGP-4 also introduces mechanisms which allow 89 aggregation of routes, including aggregation of AS paths. 91 To characterize the set of policy decisions that can be enforced 92 using BGP, one must focus on the rule that a BGP speaker advertises 93 to its peers (other BGP speakers which it communicates with) in 94 RFC DRAFT November 2001 96 neighboring ASs only those routes that it itself uses. This rule 97 reflects the "hop-by-hop" routing paradigm generally used throughout 98 the current Internet. Note that some policies cannot be supported by 99 the "hop-by-hop" routing paradigm and thus require techniques such as 100 source routing (aka explicit routing) to enforce. For example, BGP 101 does not enable one AS to send traffic to a neighboring AS intending 102 that the traffic take a different route from that taken by traffic 103 originating in the neighboring AS. On the other hand, BGP can support 104 any policy conforming to the "hop-by-hop" routing paradigm. Since the 105 current Internet uses only the "hop-by-hop" inter-AS routing paradigm 106 and since BGP can support any policy that conforms to that paradigm, 107 BGP is highly applicable as an inter-AS routing protocol for the 108 current Internet. 110 A more complete discussion of what policies can and cannot be 111 enforced with BGP is outside the scope of this document (but refer to 112 the companion document discussing BGP usage [5]). 114 BGP runs over a reliable transport protocol. This eliminates the need 115 to implement explicit update fragmentation, retransmission, 116 acknowledgment, and sequencing. Any authentication scheme used by the 117 transport protocol (e.g., RFC2385 [10]) may be used in addition to 118 BGP's own authentication mechanisms. The error notification mechanism 119 used in BGP assumes that the transport protocol supports a "graceful" 120 close, i.e., that all outstanding data will be delivered before the 121 connection is closed. 123 BGP uses TCP [4] as its transport protocol. TCP meets BGP's transport 124 requirements and is present in virtually all commercial routers and 125 hosts. In the following descriptions the phrase "transport protocol 126 connection" can be understood to refer to a TCP connection. BGP uses 127 TCP port 179 for establishing its connections. 129 This document uses the term `Autonomous System' (AS) throughout. The 130 classic definition of an Autonomous System is a set of routers under 131 a single technical administration, using an interior gateway protocol 132 and common metrics to determine how to route packets within the AS, 133 and using an exterior gateway protocol to determine how to route 134 packets to other ASs. Since this classic definition was developed, it 135 has become common for a single AS to use several interior gateway 136 protocols and sometimes several sets of metrics within an AS. The use 137 of the term Autonomous System here stresses the fact that, even when 138 multiple IGPs and metrics are used, the administration of an AS 139 appears to other ASs to have a single coherent interior routing plan 140 and presents a consistent picture of what destinations are reachable 141 through it. 143 The planned use of BGP in the Internet environment, including such 144 RFC DRAFT November 2001 146 issues as topology, the interaction between BGP and IGPs, and the 147 enforcement of routing policy rules is presented in a companion 148 document [5]. This document is the first of a series of documents 149 planned to explore various aspects of BGP application. 151 3. Summary of Operation 153 Two systems form a transport protocol connection between one another. 154 They exchange messages to open and confirm the connection parameters. 156 The initial data flow is the portion of the BGP routing table that is 157 allowed by the export policy, called the Adj-Ribs-Out (see 3.2). 158 Incremental updates are sent as the routing tables change. BGP does 159 not require periodic refresh of the routing table. Therefore, a BGP 160 speaker must retain the current version of the routes advertised by 161 all of its peers for the duration of the connection. If the 162 implementation decides to not store the routes that have been 163 received from a peer, but have been filtered out according to 164 configured local policy, the BGP Route Refresh extension [12] may be 165 used to request the full set of routes from a peer without resetting 166 the BGP session when the local policy configuration changes. 168 KEEPALIVE messages may be sent periodically to ensure the liveness of 169 the connection. NOTIFICATION messages are sent in response to errors 170 or special conditions. If a connection encounters an error condition, 171 a NOTIFICATION message is sent and the connection is closed. 173 The hosts executing the Border Gateway Protocol need not be routers. 174 A non-routing host could exchange routing information with routers 175 via EGP or even an interior routing protocol. That non-routing host 176 could then use BGP to exchange routing information with a border 177 router in another Autonomous System. The implications and 178 applications of this architecture are for further study. 180 Connections between BGP speakers of different ASs are referred to as 181 "external" links. BGP connections between BGP speakers within the 182 same AS are referred to as "internal" links. Similarly, a peer in a 183 different AS is referred to as an external peer, while a peer in the 184 same AS may be described as an internal peer. Internal BGP and 185 external BGP are commonly abbreviated IBGP and EBGP. 187 If a particular AS has multiple BGP speakers and is providing transit 188 service for other ASs, then care must be taken to ensure a consistent 189 view of routing within the AS. A consistent view of the interior 190 routes of the AS is provided by the interior routing protocol. A 191 consistent view of the routes exterior to the AS can be provided by 192 having all BGP speakers within the AS maintain direct IBGP 193 RFC DRAFT November 2001 195 connections with each other. Alternately the interior routing 196 protocol can pass BGP information among routers within an AS, taking 197 care not to lose BGP attributes that will be needed by EBGP speakers 198 if transit connectivity is being provided. For the purpose of 199 discussion, it is assumed that BGP information is passed within an AS 200 using IBGP. Care must be taken to ensure that the interior routers 201 have all been updated with transit information before the EBGP 202 speakers announce to other ASs that transit service is being 203 provided. 205 3.1 Routes: Advertisement and Storage 207 For the purpose of this protocol, a route is defined as a unit of 208 information that pairs a set of destinations with the attributes of a 209 path to those destinations. The set of destinations are the systems 210 whose IP addresses are reported in the Network Layer Reachability 211 Information (NLRI) field and the path is the information reported in 212 the path attributes field of the same UPDATE message. 214 Routes are advertised between BGP speakers in UPDATE messages. 216 Routes are stored in the Routing Information Bases (RIBs): namely, 217 the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes that will 218 be advertised to other BGP speakers must be present in the Adj-RIB- 219 Out. Routes that will be used by the local BGP speaker must be 220 present in the Loc-RIB, and the next hop for each of these routes 221 must be resolvable via the local BGP speaker's Routing Table. Routes 222 that are received from other BGP speakers are present in the Adj- 223 RIBs-In. 225 If a BGP speaker chooses to advertise the route, it may add to or 226 modify the path attributes of the route before advertising it to a 227 peer. 229 BGP provides mechanisms by which a BGP speaker can inform its peer 230 that a previously advertised route is no longer available for use. 231 There are three methods by which a given BGP speaker can indicate 232 that a route has been withdrawn from service: 234 a) the IP prefix that expresses the destination for a previously 235 advertised route can be advertised in the WITHDRAWN ROUTES field 236 in the UPDATE message, thus marking the associated route as being 237 no longer available for use 239 b) a replacement route with the same NLRI can be advertised, or 241 c) the BGP speaker - BGP speaker connection can be closed, which 242 RFC DRAFT November 2001 244 implicitly removes from service all routes which the pair of 245 speakers had advertised to each other. 247 3.2 Routing Information Bases 249 The Routing Information Base (RIB) within a BGP speaker consists of 250 three distinct parts: 252 a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has 253 been learned from inbound UPDATE messages. Their contents 254 represent routes that are available as an input to the Decision 255 Process. 257 b) Loc-RIB: The Loc-RIB contains the local routing information 258 that the BGP speaker has selected by applying its local policies 259 to the routing information contained in its Adj-RIBs-In. 261 c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the 262 local BGP speaker has selected for advertisement to its peers. The 263 routing information stored in the Adj-RIBs-Out will be carried in 264 the local BGP speaker's UPDATE messages and advertised to its 265 peers. 267 In summary, the Adj-RIBs-In contain unprocessed routing information 268 that has been advertised to the local BGP speaker by its peers; the 269 Loc-RIB contains the routes that have been selected by the local BGP 270 speaker's Decision Process; and the Adj-RIBs-Out organize the routes 271 for advertisement to specific peers by means of the local speaker's 272 UPDATE messages. 274 Although the conceptual model distinguishes between Adj-RIBs-In, Loc- 275 RIB, and Adj-RIBs-Out, this neither implies nor requires that an 276 implementation must maintain three separate copies of the routing 277 information. The choice of implementation (for example, 3 copies of 278 the information vs 1 copy with pointers) is not constrained by the 279 protocol. 281 Routing information that the router uses to forward packets (or to 282 construct the forwarding table that is used for packet forwarding) is 283 maintained in the Routing Table. The Routing Table accumulates routes 284 to directly connected networks, static routes, routes learned from 285 the IGP protocols, and routes learned from BGP. Whether or not a 286 specific BGP route should be installed in the Routing Table, and 287 whether a BGP route should override a route to the same destination 288 installed by another source is a local policy decision, not specified 289 in this document. Besides actual packet forwarding, the Routing Table 290 is used for resolution of the next-hop addresses specified in BGP 291 RFC DRAFT November 2001 293 updates (see Section 9.1.2). 295 4. Message Formats 297 This section describes message formats used by BGP. 299 Messages are sent over a reliable transport protocol connection. A 300 message is processed only after it is entirely received. The maximum 301 message size is 4096 octets. All implementations are required to 302 support this maximum message size. The smallest message that may be 303 sent consists of a BGP header without a data portion, or 19 octets. 305 4.1 Message Header Format 307 Each message has a fixed-size header. There may or may not be a data 308 portion following the header, depending on the message type. The 309 layout of these fields is shown below: 311 0 1 2 3 312 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 313 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 314 | | 315 + + 316 | | 317 + + 318 | Marker | 319 + + 320 | | 321 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 322 | Length | Type | 323 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 325 Marker: 327 This 16-octet field contains a value that the receiver of the 328 message can predict. If the Type of the message is OPEN, or if 329 the OPEN message carries no Authentication Information (as an 330 Optional Parameter), then the Marker must be all ones. 331 Otherwise, the value of the marker can be predicted by some a 332 computation specified as part of the authentication mechanism 333 (which is specified as part of the Authentication Information) 334 used. The Marker can be used to detect loss of synchronization 335 between a pair of BGP peers, and to authenticate incoming BGP 336 messages. 338 RFC DRAFT November 2001 340 Length: 342 This 2-octet unsigned integer indicates the total length of the 343 message, including the header, in octets. Thus, e.g., it allows 344 one to locate in the transport-level stream the (Marker field 345 of the) next message. The value of the Length field must always 346 be at least 19 and no greater than 4096, and may be further 347 constrained, depending on the message type. No "padding" of 348 extra data after the message is allowed, so the Length field 349 must have the smallest value required given the rest of the 350 message. 352 Type: 354 This 1-octet unsigned integer indicates the type code of the 355 message. The following type codes are defined: 357 1 - OPEN 358 2 - UPDATE 359 3 - NOTIFICATION 360 4 - KEEPALIVE 362 4.2 OPEN Message Format 364 After a transport protocol connection is established, the first 365 message sent by each side is an OPEN message. If the OPEN message is 366 acceptable, a KEEPALIVE message confirming the OPEN is sent back. 367 Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION 368 messages may be exchanged. 370 In addition to the fixed-size BGP header, the OPEN message contains 371 the following fields: 373 0 1 2 3 374 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 375 +-+-+-+-+-+-+-+-+ 376 | Version | 377 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 378 | My Autonomous System | 379 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 380 | Hold Time | 381 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 382 | BGP Identifier | 383 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 384 | Opt Parm Len | 385 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 386 | | 387 | Optional Parameters (variable) | 388 RFC DRAFT November 2001 390 | | 391 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 393 Version: 395 This 1-octet unsigned integer indicates the protocol version 396 number of the message. The current BGP version number is 4. 398 My Autonomous System: 400 This 2-octet unsigned integer indicates the Autonomous System 401 number of the sender. 403 Hold Time: 405 This 2-octet unsigned integer indicates the number of seconds 406 that the sender proposes for the value of the Hold Timer. Upon 407 receipt of an OPEN message, a BGP speaker MUST calculate the 408 value of the Hold Timer by using the smaller of its configured 409 Hold Time and the Hold Time received in the OPEN message. The 410 Hold Time MUST be either zero or at least three seconds. An 411 implementation may reject connections on the basis of the Hold 412 Time. The calculated value indicates the maximum number of 413 seconds that may elapse between the receipt of successive 414 KEEPALIVE, and/or UPDATE messages by the sender. 416 BGP Identifier: 418 This 4-octet unsigned integer indicates the BGP Identifier of 419 the sender. A given BGP speaker sets the value of its BGP 420 Identifier to an IP address assigned to that BGP speaker. The 421 value of the BGP Identifier is determined on startup and is the 422 same for every local interface and every BGP peer. 424 Optional Parameters Length: 426 This 1-octet unsigned integer indicates the total length of the 427 Optional Parameters field in octets. If the value of this field 428 is zero, no Optional Parameters are present. 430 Optional Parameters: 432 This field may contain a list of optional parameters, where 433 each parameter is encoded as a triplet. 436 0 1 437 RFC DRAFT November 2001 439 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 440 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 441 | Parm. Type | Parm. Length | Parameter Value (variable) 442 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 444 Parameter Type is a one octet field that unambiguously 445 identifies individual parameters. Parameter Length is a one 446 octet field that contains the length of the Parameter Value 447 field in octets. Parameter Value is a variable length field 448 that is interpreted according to the value of the Parameter 449 Type field. 451 This document defines the following Optional Parameters: 453 a) Authentication Information (Parameter Type 1): 455 This optional parameter may be used to authenticate a BGP 456 peer. The Parameter Value field contains a 1-octet 457 Authentication Code followed by a variable length 458 Authentication Data. 460 0 1 2 3 4 5 6 7 8 461 +-+-+-+-+-+-+-+-+ 462 | Auth. Code | 463 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 464 | | 465 | Authentication Data | 466 | | 467 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 469 Authentication Code: 471 This 1-octet unsigned integer indicates the 472 authentication mechanism being used. Whenever an 473 authentication mechanism is specified for use within 474 BGP, three things must be included in the 475 specification: 477 - the value of the Authentication Code which indicates 478 use of the mechanism, 479 - the form and meaning of the Authentication Data, and 480 - the algorithm for computing values of Marker fields. 482 Note that a separate authentication mechanism may be 483 used in establishing the transport level connection. 485 RFC DRAFT November 2001 487 Authentication Data: 489 Authentication Data is a variable length field that is 490 interpreted according to the value of the 491 Authentication Code field. 493 The minimum length of the OPEN message is 29 octets (including 494 message header). 496 4.3 UPDATE Message Format 498 UPDATE messages are used to transfer routing information between BGP 499 peers. The information in the UPDATE packet can be used to construct 500 a graph describing the relationships of the various Autonomous 501 Systems. By applying rules to be discussed, routing information loops 502 and some other anomalies may be detected and removed from inter-AS 503 routing. 505 An UPDATE message is used to advertise feasible routes sharing common 506 path attribute to a peer, or to withdraw multiple unfeasible routes 507 from service (see 3.1). An UPDATE message may simultaneously 508 advertise a feasible route and withdraw multiple unfeasible routes 509 from service. The UPDATE message always includes the fixed-size BGP 510 header, and also includes the other fields as shown below (note, some 511 of the shown fields may not be present in every UPDATE message): 513 +-----------------------------------------------------+ 514 | Withdrawn Routes Length (2 octets) | 515 +-----------------------------------------------------+ 516 | Withdrawn Routes (variable) | 517 +-----------------------------------------------------+ 518 | Total Path Attribute Length (2 octets) | 519 +-----------------------------------------------------+ 520 | Path Attributes (variable) | 521 +-----------------------------------------------------+ 522 | Network Layer Reachability Information (variable) | 523 +-----------------------------------------------------+ 525 Withdrawn Routes Length: 527 This 2-octets unsigned integer indicates the total length of 528 the Withdrawn Routes field in octets. Its value must allow the 529 RFC DRAFT November 2001 531 length of the Network Layer Reachability Information field to 532 be determined as specified below. 534 A value of 0 indicates that no routes are being withdrawn from 535 service, and that the WITHDRAWN ROUTES field is not present in 536 this UPDATE message. 538 Withdrawn Routes: 540 This is a variable length field that contains a list of IP 541 address prefixes for the routes that are being withdrawn from 542 service. Each IP address prefix is encoded as a 2-tuple of the 543 form , whose fields are described below: 545 +---------------------------+ 546 | Length (1 octet) | 547 +---------------------------+ 548 | Prefix (variable) | 549 +---------------------------+ 551 The use and the meaning of these fields are as follows: 553 a) Length: 555 The Length field indicates the length in bits of the IP 556 address prefix. A length of zero indicates a prefix that 557 matches all IP addresses (with prefix, itself, of zero 558 octets). 560 b) Prefix: 562 The Prefix field contains an IP address prefix followed by 563 enough trailing bits to make the end of the field fall on an 564 octet boundary. Note that the value of trailing bits is 565 irrelevant. 567 Total Path Attribute Length: 569 This 2-octet unsigned integer indicates the total length of the 570 Path Attributes field in octets. Its value must allow the 571 length of the Network Layer Reachability field to be determined 572 as specified below. 574 A value of 0 indicates that no Network Layer Reachability 575 Information field is present in this UPDATE message. 577 RFC DRAFT November 2001 579 Path Attributes: 581 A variable length sequence of path attributes is present in 582 every UPDATE. Each path attribute is a triple of variable length. 585 Attribute Type is a two-octet field that consists of the 586 Attribute Flags octet followed by the Attribute Type Code 587 octet. 589 0 1 590 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 591 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 592 | Attr. Flags |Attr. Type Code| 593 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 595 The high-order bit (bit 0) of the Attribute Flags octet is the 596 Optional bit. It defines whether the attribute is optional (if 597 set to 1) or well-known (if set to 0). 599 The second high-order bit (bit 1) of the Attribute Flags octet 600 is the Transitive bit. It defines whether an optional attribute 601 is transitive (if set to 1) or non-transitive (if set to 0). 602 For well-known attributes, the Transitive bit must be set to 1. 603 (See Section 5 for a discussion of transitive attributes.) 605 The third high-order bit (bit 2) of the Attribute Flags octet 606 is the Partial bit. It defines whether the information 607 contained in the optional transitive attribute is partial (if 608 set to 1) or complete (if set to 0). For well-known attributes 609 and for optional non-transitive attributes the Partial bit must 610 be set to 0. 612 The fourth high-order bit (bit 3) of the Attribute Flags octet 613 is the Extended Length bit. It defines whether the Attribute 614 Length is one octet (if set to 0) or two octets (if set to 1). 616 The lower-order four bits of the Attribute Flags octet are 617 unused. They must be zero when sent and must be ignored when 618 received. 620 The Attribute Type Code octet contains the Attribute Type Code. 621 Currently defined Attribute Type Codes are discussed in Section 622 5. 624 RFC DRAFT November 2001 626 If the Extended Length bit of the Attribute Flags octet is set 627 to 0, the third octet of the Path Attribute contains the length 628 of the attribute data in octets. 630 If the Extended Length bit of the Attribute Flags octet is set 631 to 1, then the third and the fourth octets of the path 632 attribute contain the length of the attribute data in octets. 634 The remaining octets of the Path Attribute represent the 635 attribute value and are interpreted according to the Attribute 636 Flags and the Attribute Type Code. The supported Attribute Type 637 Codes, their attribute values and uses are the following: 639 a) ORIGIN (Type Code 1): 641 ORIGIN is a well-known mandatory attribute that defines the 642 origin of the path information. The data octet can assume 643 the following values: 645 Value Meaning 647 0 IGP - Network Layer Reachability Information 648 is interior to the originating AS 650 1 EGP - Network Layer Reachability Information 651 learned via the EGP protocol 653 2 INCOMPLETE - Network Layer Reachability 654 Information learned by some other means 656 Its usage is defined in 5.1.1 658 b) AS_PATH (Type Code 2): 660 AS_PATH is a well-known mandatory attribute that is composed 661 of a sequence of AS path segments. Each AS path segment is 662 represented by a triple . 665 The path segment type is a 1-octet long field with the 666 following values defined: 668 Value Segment Type 670 1 AS_SET: unordered set of ASs a route in the 671 UPDATE message has traversed 673 2 AS_SEQUENCE: ordered set of ASs a route in 674 RFC DRAFT November 2001 676 the UPDATE message has traversed 678 The path segment length is a 1-octet long field containing 679 the number of ASs in the path segment value field. 681 The path segment value field contains one or more AS 682 numbers, each encoded as a 2-octets long field. 684 Usage of this attribute is defined in 5.1.2. 686 c) NEXT_HOP (Type Code 3): 688 This is a well-known mandatory attribute that defines the IP 689 address of the border router that should be used as the next 690 hop to the destinations listed in the Network Layer 691 Reachability Information field of the UPDATE message. 693 Usage of this attribute is defined in 5.1.3. 695 d) MULTI_EXIT_DISC (Type Code 4): 697 This is an optional non-transitive attribute that is a four 698 octet non-negative integer. The value of this attribute may 699 be used by a BGP speaker's decision process to discriminate 700 among multiple entry points to a neighboring autonomous 701 system. 703 Its usage is defined in 5.1.4. 705 e) LOCAL_PREF (Type Code 5): 707 LOCAL_PREF is a well-known attribute that is a four octet 708 non-negative integer. A BGP speaker uses it to inform other 709 internal peers of the advertising speaker's degree of 710 preference for an advertised route. Usage of this attribute 711 is described in 5.1.5. 713 f) ATOMIC_AGGREGATE (Type Code 6) 715 ATOMIC_AGGREGATE is a well-known discretionary attribute of 716 length 0. Usage of this attribute is described in 5.1.6. 718 g) AGGREGATOR (Type Code 7) 720 AGGREGATOR is an optional transitive attribute of length 6. 721 The attribute contains the last AS number that formed the 722 aggregate route (encoded as 2 octets), followed by the IP 723 RFC DRAFT November 2001 725 address of the BGP speaker that formed the aggregate route 726 (encoded as 4 octets). This should be the same address as 727 the one used for the BGP Identifier of the speaker. Usage 728 of this attribute is described in 5.1.7. 730 Network Layer Reachability Information: 732 This variable length field contains a list of IP address 733 prefixes. The length in octets of the Network Layer 734 Reachability Information is not encoded explicitly, but can be 735 calculated as: 737 UPDATE message Length - 23 - Total Path Attributes Length - 738 Withdrawn Routes Length 740 where UPDATE message Length is the value encoded in the fixed- 741 size BGP header, Total Path Attribute Length and Withdrawn 742 Routes Length are the values encoded in the variable part of 743 the UPDATE message, and 23 is a combined length of the fixed- 744 size BGP header, the Total Path Attribute Length field and the 745 Withdrawn Routes Length field. 747 Reachability information is encoded as one or more 2-tuples of 748 the form , whose fields are described below: 750 +---------------------------+ 751 | Length (1 octet) | 752 +---------------------------+ 753 | Prefix (variable) | 754 +---------------------------+ 756 The use and the meaning of these fields are as follows: 758 a) Length: 760 The Length field indicates the length in bits of the IP 761 address prefix. A length of zero indicates a prefix that 762 matches all IP addresses (with prefix, itself, of zero 763 octets). 765 b) Prefix: 767 The Prefix field contains IP address prefixes followed by 768 enough trailing bits to make the end of the field fall on an 769 octet boundary. Note that the value of the trailing bits is 770 irrelevant. 772 RFC DRAFT November 2001 774 The minimum length of the UPDATE message is 23 octets -- 19 octets 775 for the fixed header + 2 octets for the Withdrawn Routes Length + 2 776 octets for the Total Path Attribute Length (the value of Withdrawn 777 Routes Length is 0 and the value of Total Path Attribute Length is 778 0). 780 An UPDATE message can advertise at most one set of path attributes, 781 but multiple destinations, provided that the destinations share these 782 attributes. All path attributes contained in a given UPDATE message 783 apply to all destinations carried in the NLRI field of the UPDATE 784 message. 786 An UPDATE message can list multiple routes to be withdrawn from 787 service. Each such route is identified by its destination (expressed 788 as an IP prefix), which unambiguously identifies the route in the 789 context of the BGP speaker - BGP speaker connection to which it has 790 been previously advertised. 792 An UPDATE message might advertise only routes to be withdrawn from 793 service, in which case it will not include path attributes or Network 794 Layer Reachability Information. Conversely, it may advertise only a 795 feasible route, in which case the WITHDRAWN ROUTES field need not be 796 present. 798 An UPDATE message should not include the same address prefix in the 799 WITHDRAWN ROUTES and Network Layer Reachability Information fields, 800 however a BGP speaker MUST be able to process UPDATE messages in this 801 form. A BGP speaker should treat an UPDATE message of this form as if 802 the WITHDRAWN ROUTES doesn't contain the address prefix. 804 4.4 KEEPALIVE Message Format 806 BGP does not use any transport protocol-based keep-alive mechanism to 807 determine if peers are reachable. Instead, KEEPALIVE messages are 808 exchanged between peers often enough as not to cause the Hold Timer 809 to expire. A reasonable maximum time between KEEPALIVE messages would 810 be one third of the Hold Time interval. KEEPALIVE messages MUST NOT 811 be sent more frequently than one per second. An implementation MAY 812 adjust the rate at which it sends KEEPALIVE messages as a function of 813 the Hold Time interval. 815 If the negotiated Hold Time interval is zero, then periodic KEEPALIVE 816 messages MUST NOT be sent. 818 KEEPALIVE message consists of only message header and has a length of 819 19 octets. 821 RFC DRAFT November 2001 823 4.5 NOTIFICATION Message Format 825 A NOTIFICATION message is sent when an error condition is detected. 826 The BGP connection is closed immediately after sending it. 828 In addition to the fixed-size BGP header, the NOTIFICATION message 829 contains the following fields: 831 0 1 2 3 832 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 833 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 834 | Error code | Error subcode | Data (variable) | 835 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 837 Error Code: 839 This 1-octet unsigned integer indicates the type of 840 NOTIFICATION. The following Error Codes have been defined: 842 Error Code Symbolic Name Reference 844 1 Message Header Error Section 6.1 846 2 OPEN Message Error Section 6.2 848 3 UPDATE Message Error Section 6.3 850 4 Hold Timer Expired Section 6.5 852 5 Finite State Machine Error Section 6.6 854 6 Cease Section 6.7 856 Error subcode: 858 This 1-octet unsigned integer provides more specific 859 information about the nature of the reported error. Each Error 860 Code may have one or more Error Subcodes associated with it. If 861 no appropriate Error Subcode is defined, then a zero 862 (Unspecific) value is used for the Error Subcode field. 864 Message Header Error subcodes: 866 RFC DRAFT November 2001 868 1 - Connection Not Synchronized. 869 2 - Bad Message Length. 870 3 - Bad Message Type. 872 OPEN Message Error subcodes: 874 1 - Unsupported Version Number. 875 2 - Bad Peer AS. 876 3 - Bad BGP Identifier. 877 4 - Unsupported Optional Parameter. 878 5 - Authentication Failure. 879 6 - Unacceptable Hold Time. 881 UPDATE Message Error subcodes: 883 1 - Malformed Attribute List. 884 2 - Unrecognized Well-known Attribute. 885 3 - Missing Well-known Attribute. 886 4 - Attribute Flags Error. 887 5 - Attribute Length Error. 888 6 - Invalid ORIGIN Attribute 889 8 - Invalid NEXT_HOP Attribute. 890 9 - Optional Attribute Error. 891 10 - Invalid Network Field. 892 11 - Malformed AS_PATH. 894 Data: 896 This variable-length field is used to diagnose the reason for 897 the NOTIFICATION. The contents of the Data field depend upon 898 the Error Code and Error Subcode. See Section 6 below for more 899 details. 901 Note that the length of the Data field can be determined from 902 the message Length field by the formula: 904 Message Length = 21 + Data Length 906 The minimum length of the NOTIFICATION message is 21 octets 907 (including message header). 909 5. Path Attributes 911 This section discusses the path attributes of the UPDATE message. 913 RFC DRAFT November 2001 915 Path attributes fall into four separate categories: 917 1. Well-known mandatory. 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 RFC DRAFT November 2001 965 The same attribute cannot appear more than once within the Path 966 Attributes field of a particular UPDATE message. 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 RFC DRAFT November 2001 1006 another BGP speaker's UPDATE message, it shall modify the route's 1007 AS_PATH attribute based on the location of the BGP speaker to which 1008 the route will be sent: 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 RFC DRAFT November 2001 1053 5.1.3 NEXT_HOP 1055 The NEXT_HOP path attribute defines the IP address of the border 1056 router that should be used as the next hop to the destinations listed 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 RFC DRAFT November 2001 1101 attribute. In this case when advertising a route that the 1102 speaker learned from one of its peers, the NEXT_HOP attribute 1103 of the advertised route is exactly the same as the NEXT_HOP 1104 attribute of the learned route (the speaker just doesn't modify 1105 the NEXT_HOP attribute). 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 RFC DRAFT November 2001 1149 A BGP speaker MUST IMPLEMENT a mechanism based on local configuration 1150 which allows the MULTI_EXIT_DISC attribute to be removed from a 1151 route. This MAY be done prior to determining the degree of preference 1152 of the route and performing route selection (decision process phases 1153 1 and 2). 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 attribute that SHALL be included in all 1164 UPDATE messages that a given BGP speaker sends to the other internal 1165 peers. A BGP speaker SHALL calculate the degree of preference for 1166 each external route based on the locally configured policy, and 1167 include the degree of preference when advertising a route to its 1168 internal peers. The higher degree of preference MUST be preferred. A 1169 BGP speaker shall use the degree of preference learned via LOCAL_PREF 1170 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 RFC DRAFT November 2001 1195 attribute MUST NOT make any NLRI of that route more specific (as 1196 defined in 9.1.4) when advertising this route to other BGP speakers. 1198 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1199 attribute needs to be cognizant of the fact that the actual path to 1200 destinations, as specified in the NLRI of the route, while having the 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.2.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 RFC DRAFT November 2001 1239 Error. The Error Subcode elaborates on the specific nature of the 1240 error. 1242 The expected value of the Marker field of the message header is all 1243 ones if the message type is OPEN. The expected value of the Marker 1244 field for all other types of BGP messages determined based on the 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), or if the smallest locally supported version 1280 number is greater than the version the remote BGP peer bid, then the 1281 smallest locally supported version number. 1283 If the Autonomous System field of the OPEN message is unacceptable, 1284 then the Error Subcode is set to Bad Peer AS. The determination of 1285 RFC DRAFT November 2001 1287 acceptable Autonomous System numbers is outside the scope of this 1288 protocol. 1290 If the Hold Time field of the OPEN message is unacceptable, then the 1291 Error Subcode MUST be set to Unacceptable Hold Time. An 1292 implementation MUST reject Hold Time values of one or two seconds. 1293 An implementation MAY reject any proposed Hold Time. An 1294 implementation which accepts a Hold Time MUST use the negotiated 1295 value for the Hold Time. 1297 If the BGP Identifier field of the OPEN message is syntactically 1298 incorrect, then the Error Subcode is set to Bad BGP Identifier. 1299 Syntactic correctness means that the BGP Identifier field represents 1300 a valid IP host address. 1302 If one of the Optional Parameters in the OPEN message is not 1303 recognized, then the Error Subcode is set to Unsupported Optional 1304 Parameters. 1306 If one of the Optional Parameters in the OPEN message is recognized, 1307 but is malformed, then the Error Subcode is set to 0 (Unspecific). 1309 If the OPEN message carries Authentication Information (as an 1310 Optional Parameter), then the corresponding authentication procedure 1311 is invoked. If the authentication procedure (based on Authentication 1312 Code and Authentication Data) fails, then the Error Subcode is set to 1313 Authentication Failure. 1315 6.3 UPDATE message error handling. 1317 All errors detected while processing the UPDATE message are indicated 1318 by sending the NOTIFICATION message with Error Code UPDATE Message 1319 Error. The error subcode elaborates on the specific nature of the 1320 error. 1322 Error checking of an UPDATE message begins by examining the path 1323 attributes. If the Withdrawn Routes Length or Total Attribute Length 1324 is too large (i.e., if Withdrawn Routes Length + Total Attribute 1325 Length + 23 exceeds the message Length), then the Error Subcode is 1326 set to Malformed Attribute List. 1328 If any recognized attribute has Attribute Flags that conflict with 1329 the Attribute Type Code, then the Error Subcode is set to Attribute 1330 Flags Error. The Data field contains the erroneous attribute (type, 1331 RFC DRAFT November 2001 1333 length and value). 1335 If any recognized attribute has Attribute Length that conflicts with 1336 the expected length (based on the attribute type code), then the 1337 Error Subcode is set to Attribute Length Error. The Data field 1338 contains the erroneous attribute (type, length and value). 1340 If any of the mandatory well-known attributes are not present, then 1341 the Error Subcode is set to Missing Well-known Attribute. The Data 1342 field contains the Attribute Type Code of the missing well-known 1343 attribute. 1345 If any of the mandatory well-known attributes are not recognized, 1346 then the Error Subcode is set to Unrecognized Well-known Attribute. 1347 The Data field contains the unrecognized attribute (type, length and 1348 value). 1350 If the ORIGIN attribute has an undefined value, then the Error 1351 Subcode is set to Invalid Origin Attribute. The Data field contains 1352 the unrecognized attribute (type, length and value). 1354 If the NEXT_HOP attribute field is syntactically incorrect, then the 1355 Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field 1356 contains the incorrect attribute (type, length and value). Syntactic 1357 correctness means that the NEXT_HOP attribute represents a valid IP 1358 host address. Semantic correctness applies only to the external BGP 1359 links, and only when the sender and the receiving speaker are one IP 1360 hop away from each other. To be semantically correct, the IP address 1361 in the NEXT_HOP must not be the IP address of the receiving speaker, 1362 and the NEXT_HOP IP address must either be the sender's IP address 1363 (used to establish the BGP session), or the interface associated with 1364 the NEXT_HOP IP address must share a common subnet with the receiving 1365 BGP speaker. If the NEXT_HOP attribute is semantically incorrect, the 1366 error should be logged, and the route should be ignored. In this 1367 case, no NOTIFICATION message should be sent. 1369 The AS_PATH attribute is checked for syntactic correctness. If the 1370 path is syntactically incorrect, then the Error Subcode is set to 1371 Malformed AS_PATH. 1373 The information carried by the AS_PATH attribute is checked for AS 1374 loops. AS loop detection is done by scanning the full AS path (as 1375 specified in the AS_PATH attribute), and checking that the autonomous 1376 system number of the local system does not appear in the AS path. If 1377 the autonomous system number appears in the AS path the route may be 1378 stored in the Adj-RIB-In, but unless the router is configured to 1379 accept routes with its own autonomous system in the AS path, the 1380 RFC DRAFT November 2001 1382 route shall not be passed to the BGP Decision Process. Operations of 1383 a router that is configured to accept routes with its own autonomous 1384 system number in the AS path are outside the scope of this document. 1386 If an optional attribute is recognized, then the value of this 1387 attribute is checked. If an error is detected, the attribute is 1388 discarded, and the Error Subcode is set to Optional Attribute Error. 1389 The Data field contains the attribute (type, length and value). 1391 If any attribute appears more than once in the UPDATE message, then 1392 the Error Subcode is set to Malformed Attribute List. 1394 The NLRI field in the UPDATE message is checked for syntactic 1395 validity. If the field is syntactically incorrect, then the Error 1396 Subcode is set to Invalid Network Field. 1398 If a prefix in the NLRI field is semantically incorrect (e.g., an 1399 unexpected multicast IP address), an error should be logged locally, 1400 and the prefix should be ignored. 1402 An UPDATE message that contains correct path attributes, but no NLRI, 1403 shall be treated as a valid UPDATE message. 1405 6.4 NOTIFICATION message error handling. 1407 If a peer sends a NOTIFICATION message, and there is an error in that 1408 message, there is unfortunately no means of reporting this error via 1409 a subsequent NOTIFICATION message. Any such error, such as an 1410 unrecognized Error Code or Error Subcode, should be noticed, logged 1411 locally, and brought to the attention of the administration of the 1412 peer. The means to do this, however, lies outside the scope of this 1413 document. 1415 6.5 Hold Timer Expired error handling. 1417 If a system does not receive successive KEEPALIVE and/or UPDATE 1418 and/or NOTIFICATION messages within the period specified in the Hold 1419 Time field of the OPEN message, then the NOTIFICATION message with 1420 Hold Timer Expired Error Code must be sent and the BGP connection 1421 closed. 1423 RFC DRAFT November 2001 1425 6.6 Finite State Machine error handling. 1427 Any error detected by the BGP Finite State Machine (e.g., receipt of 1428 an unexpected event) is indicated by sending the NOTIFICATION message 1429 with Error Code Finite State Machine Error. 1431 6.7 Cease. 1433 In absence of any fatal errors (that are indicated in this section), 1434 a BGP peer may choose at any given time to close its BGP connection 1435 by sending the NOTIFICATION message with Error Code Cease. However, 1436 the Cease NOTIFICATION message must not be used when a fatal error 1437 indicated by this section does exist. 1439 A BGP speaker may support the ability to impose an (locally 1440 configured) upper bound on the number of address prefixes the speaker 1441 is willing to accept from a neighbor. When the upper bound is 1442 reached, the speaker (under control of local configuration) may 1443 either (a) discard new address prefixes from the neighbor, or (b) 1444 terminate the BGP peering with the neighbor. If the BGP speaker 1445 decides to terminate its peering with a neighbor because the number 1446 of address prefixes received from the neighbor exceeds the locally 1447 configured upper bound, then the speaker must send to the neighbor a 1448 NOTIFICATION message with the Error Code Cease. 1450 6.8 Connection collision detection. 1452 If a pair of BGP speakers try simultaneously to establish a BGP 1453 connection to each other, then two parallel connections between this 1454 pair of speakers might well be formed. If the source IP address used 1455 by one of these connections is the same as the destination IP address 1456 used by the other, and the destination IP address used by the first 1457 connection is the same as the source IP address used by the other, we 1458 refer to this situation as connection collision. Clearly in the 1459 presence of connection collision, one of these connections must be 1460 closed. 1462 Based on the value of the BGP Identifier a convention is established 1463 for detecting which BGP connection is to be preserved when a 1464 collision does occur. The convention is to compare the BGP 1465 Identifiers of the peers involved in the collision and to retain only 1466 the connection initiated by the BGP speaker with the higher-valued 1467 BGP Identifier. 1469 RFC DRAFT November 2001 1471 Upon receipt of an OPEN message, the local system must examine all of 1472 its connections that are in the OpenConfirm state. A BGP speaker may 1473 also examine connections in an OpenSent state if it knows the BGP 1474 Identifier of the peer by means outside of the protocol. If among 1475 these connections there is a connection to a remote BGP speaker whose 1476 BGP Identifier equals the one in the OPEN message, and this 1477 connection collides with the connection over which the OPEN message 1478 is received then the local system performs the following collision 1479 resolution procedure: 1481 1. The BGP Identifier of the local system is compared to the BGP 1482 Identifier of the remote system (as specified in the OPEN 1483 message). 1485 2. If the value of the local BGP Identifier is less than the 1486 remote one, the local system closes BGP connection that already 1487 exists (the one that is already in the OpenConfirm state), and 1488 accepts BGP connection initiated by the remote system. 1490 3. Otherwise, the local system closes newly created BGP connection 1491 (the one associated with the newly received OPEN message), and 1492 continues to use the existing one (the one that is already in the 1493 OpenConfirm state). 1495 Comparing BGP Identifiers is done by treating them as (4-octet 1496 long) unsigned integers. 1498 Unless allowed via configuration, a connection collision with an 1499 existing BGP connection that is in Established state causes 1500 closing of the newly created connection. 1502 Note that a connection collision cannot be detected with 1503 connections that are in Idle, or Connect, or Active states. 1505 Closing the BGP connection (that results from the collision 1506 resolution procedure) is accomplished by sending the NOTIFICATION 1507 message with the Error Code Cease. 1509 7. BGP Version Negotiation. 1511 BGP speakers may negotiate the version of the protocol by making 1512 multiple attempts to open a BGP connection, starting with the highest 1513 version number each supports. If an open attempt fails with an Error 1514 Code OPEN Message Error, and an Error Subcode Unsupported Version 1515 Number, then the BGP speaker has available the version number it 1516 RFC DRAFT November 2001 1518 tried, the version number its peer tried, the version number passed 1519 by its peer in the NOTIFICATION message, and the version numbers that 1520 it supports. If the two peers do support one or more common versions, 1521 then this will allow them to rapidly determine the highest common 1522 version. In order to support BGP version negotiation, future versions 1523 of BGP must retain the format of the OPEN and NOTIFICATION messages. 1525 8. BGP Finite State machine. 1527 This section specifies BGP operation in terms of a Finite State 1528 Machine (FSM). Following is a brief summary and overview of BGP 1529 operations by state as determined by this FSM. 1531 Initially BGP is in the Idle state. 1533 Idle state: 1535 In this state BGP refuses all incoming BGP connections. No 1536 resources are allocated to the peer. In response to the Start 1537 event (initiated by either system or operator) the local system 1538 initializes all BGP resources, starts the ConnectRetry timer, 1539 initiates a transport connection to other BGP peer, while 1540 listening for connection that may be initiated by the remote 1541 BGP peer, and changes its state to Connect. The exact value of 1542 the ConnectRetry timer is a local matter, but should be 1543 sufficiently large to allow TCP initialization. 1545 If a BGP speaker detects an error, it shuts down the connection 1546 and changes its state to Idle. Getting out of the Idle state 1547 requires generation of the Start event. If such an event is 1548 generated automatically, then persistent BGP errors may result 1549 in persistent flapping of the speaker. To avoid such a 1550 condition it is recommended that Start events should not be 1551 generated immediately for a peer that was previously 1552 transitioned to Idle due to an error. For a peer that was 1553 previously transitioned to Idle due to an error, the time 1554 between consecutive generation of Start events, if such events 1555 are generated automatically, shall exponentially increase. The 1556 value of the initial timer shall be 60 seconds. The time shall 1557 be doubled for each consecutive retry. An implementation MAY 1558 impose a configurable upper bound on that time. Once the upper 1559 bound is reached, the speaker shall no longer automatically 1560 generate the Start event for the peer. 1562 Any other event received in the Idle state is ignored. 1564 RFC DRAFT November 2001 1566 Connect state: 1568 In this state BGP is waiting for the transport protocol 1569 connection to be completed. 1571 If the transport protocol connection succeeds, the local system 1572 clears the ConnectRetry timer, completes initialization, sends 1573 an OPEN message to its peer, and changes its state to OpenSent. 1575 If the transport protocol connect fails (e.g., retransmission 1576 timeout), the local system restarts the ConnectRetry timer, 1577 continues to listen for a connection that may be initiated by 1578 the remote BGP peer, and changes its state to Active state. 1580 In response to the ConnectRetry timer expired event, the local 1581 system restarts the ConnectRetry timer, initiates a transport 1582 connection to other BGP peer, continues to listen for a 1583 connection that may be initiated by the remote BGP peer, and 1584 stays in the Connect state. 1586 The Start event is ignored in the Connect state. 1588 In response to any other event (initiated by either system or 1589 operator), the local system releases all BGP resources 1590 associated with this connection and changes its state to Idle. 1592 Active state: 1594 In this state BGP is trying to acquire a peer by listening for 1595 and accepting a transport protocol connection. 1597 If the transport protocol connection succeeds, the local system 1598 clears the ConnectRetry timer, completes initialization, sends 1599 an OPEN message to its peer, sets its Hold Timer to a large 1600 value, and changes its state to OpenSent. A Hold Timer value of 1601 4 minutes is suggested. 1603 In response to the ConnectRetry timer expired event, the local 1604 system restarts the ConnectRetry timer, initiates a transport 1605 connection to the other BGP peer, continues to listen for a 1606 connection that may be initiated by the remote BGP peer, and 1607 changes its state to Connect. 1609 If the local system allows BGP connections with unconfigured 1610 peers, then when the local system detects that a remote peer is 1611 trying to establish a BGP connection to it, and the IP address 1612 of the remote peer is not a configured one, the local system 1613 creates a temporary peer entry, completes initialization, sends 1614 RFC DRAFT November 2001 1616 an OPEN message to its peer, sets its Hold Timer to a large 1617 value, and changes its state to OpenSent. 1619 If the local system does not allow BGP connections with 1620 unconfigured peers, then the local system rejects connections 1621 from IP addresses that are not configured peers, and remains in 1622 the Active state. 1624 The Start event is ignored in the Active state. 1626 In response to any other event (initiated by either system or 1627 operator), the local system releases all BGP resources 1628 associated with this connection and changes its state to Idle. 1630 OpenSent state: 1632 In this state BGP waits for an OPEN message from its peer. 1633 When an OPEN message is received, all fields are checked for 1634 correctness. If the BGP message header checking or OPEN message 1635 checking detects an error (see Section 6.2), or a connection 1636 collision (see Section 6.8) the local system sends a 1637 NOTIFICATION message and changes its state to Idle. 1639 If there are no errors in the OPEN message, BGP sends a 1640 KEEPALIVE message and sets a KeepAlive timer. The Hold Timer, 1641 which was originally set to a large value (see above), is 1642 replaced with the negotiated Hold Time value (see section 4.2). 1643 If the negotiated Hold Time value is zero, then the Hold Time 1644 timer and KeepAlive timers are not started. If the value of the 1645 Autonomous System field is the same as the local Autonomous 1646 System number, then the connection is an "internal" connection; 1647 otherwise, it is "external". (This will affect UPDATE 1648 processing as described below.) Finally, the state is changed 1649 to OpenConfirm. 1651 If a disconnect notification is received from the underlying 1652 transport protocol, the local system closes the BGP connection, 1653 restarts the ConnectRetry timer, while continue listening for 1654 connection that may be initiated by the remote BGP peer, and 1655 goes into the Active state. 1657 If the Hold Timer expires, the local system sends NOTIFICATION 1658 message with error code Hold Timer Expired and changes its 1659 state to Idle. 1661 In response to the Stop event (initiated by either system or 1662 operator) the local system sends NOTIFICATION message with 1663 RFC DRAFT November 2001 1665 Error Code Cease and changes its state to Idle. 1667 The Start event is ignored in the OpenSent state. 1669 In response to any other event the local system sends 1670 NOTIFICATION message with Error Code Finite State Machine Error 1671 and changes its state to Idle. 1673 Whenever BGP changes its state from OpenSent to Idle, it closes 1674 the BGP (and transport-level) connection and releases all 1675 resources associated with that connection. 1677 OpenConfirm state: 1679 In this state BGP waits for a KEEPALIVE or NOTIFICATION 1680 message. 1682 If the local system receives a KEEPALIVE message, it changes 1683 its state to Established. 1685 If the Hold Timer expires before a KEEPALIVE message is 1686 received, the local system sends NOTIFICATION message with 1687 error code Hold Timer Expired and changes its state to Idle. 1689 If the local system receives a NOTIFICATION message, it changes 1690 its state to Idle. 1692 If the KeepAlive timer expires, the local system sends a 1693 KEEPALIVE message and restarts its KeepAlive timer. 1695 If a disconnect notification is received from the underlying 1696 transport protocol, the local system changes its state to Idle. 1698 In response to the Stop event (initiated by either system or 1699 operator) the local system sends NOTIFICATION message with 1700 Error Code Cease and changes its state to Idle. 1702 The Start event is ignored in the OpenConfirm state. 1704 In response to any other event the local system sends 1705 NOTIFICATION message with Error Code Finite State Machine Error 1706 and changes its state to Idle. 1708 Whenever BGP changes its state from OpenConfirm to Idle, it 1709 closes the BGP (and transport-level) connection and releases 1710 all resources associated with that connection. 1712 Established state: 1714 RFC DRAFT November 2001 1716 In the Established state BGP can exchange UPDATE, NOTIFICATION, 1717 and KEEPALIVE messages with its peer. 1719 If the local system receives an UPDATE or KEEPALIVE message, it 1720 restarts its Hold Timer, if the negotiated Hold Time value is 1721 non-zero. 1723 If the local system receives a NOTIFICATION message, it changes 1724 its state to Idle. 1726 If the local system receives an UPDATE message and the UPDATE 1727 message error handling procedure (see Section 6.3) detects an 1728 error, the local system sends a NOTIFICATION message and 1729 changes its state to Idle. 1731 If a disconnect notification is received from the underlying 1732 transport protocol, the local system changes its state to Idle. 1734 If the Hold Timer expires, the local system sends a 1735 NOTIFICATION message with Error Code Hold Timer Expired and 1736 changes its state to Idle. 1738 If the KeepAlive timer expires, the local system sends a 1739 KEEPALIVE message and restarts its KeepAlive timer. 1741 Each time the local system sends a KEEPALIVE or UPDATE message, 1742 it restarts its KeepAlive timer, unless the negotiated Hold 1743 Time value is zero. 1745 In response to the Stop event (initiated by either system or 1746 operator), the local system sends a NOTIFICATION message with 1747 Error Code Cease and changes its state to Idle. 1749 The Start event is ignored in the Established state. 1751 In response to any other event, the local system sends 1752 NOTIFICATION message with Error Code Finite State Machine Error 1753 and changes its state to Idle. 1755 Whenever BGP changes its state from Established to Idle, it 1756 closes the BGP (and transport-level) connection, releases all 1757 resources associated with that connection, and deletes all 1758 routes derived from that connection. 1760 RFC DRAFT November 2001 1762 9. UPDATE Message Handling 1764 An UPDATE message may be received only in the Established state. 1765 When an UPDATE message is received, each field is checked for 1766 validity as specified in Section 6.3. 1768 If an optional non-transitive attribute is unrecognized, it is 1769 quietly ignored. If an optional transitive attribute is unrecognized, 1770 the Partial bit (the third high-order bit) in the attribute flags 1771 octet is set to 1, and the attribute is retained for propagation to 1772 other BGP speakers. 1774 If an optional attribute is recognized, and has a valid value, then, 1775 depending on the type of the optional attribute, it is processed 1776 locally, retained, and updated, if necessary, for possible 1777 propagation to other BGP speakers. 1779 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 1780 the previously advertised routes whose destinations (expressed as IP 1781 prefixes) contained in this field shall be removed from the Adj-RIB- 1782 In. This BGP speaker shall run its Decision Process since the 1783 previously advertised route is no longer available for use. 1785 If the UPDATE message contains a feasible route, the Adj-RIB-In will 1786 be updated with this route as follows: if the NLRI of the new route 1787 is identical to the one of the route currently stored in the Adj-RIB- 1788 In, then the new route shall replace the older route in the Adj-RIB- 1789 In, thus implicitly withdrawing the older route from service. 1790 Otherwise, if the Adj-RIB-In has no route with NLRI identical to the 1791 new route, the new route shall be placed in the Adj-RIB-In. 1793 Once the BGP speaker updates the Adj-RIB-In, the speaker shall run 1794 its Decision Process. 1796 9.1 Decision Process 1798 The Decision Process selects routes for subsequent advertisement by 1799 applying the policies in the local Policy Information Base (PIB) to 1800 the routes stored in its Adj-RIBs-In. The output of the Decision 1801 Process is the set of routes that will be advertised to all peers; 1802 the selected routes will be stored in the local speaker's Adj-RIB- 1803 Out. 1805 The selection process is formalized by defining a function that takes 1806 the attribute of a given route as an argument and returns either (a) 1807 RFC DRAFT November 2001 1809 a non-negative integer denoting the degree of preference for the 1810 route, or (b) a value denoting that this route is ineligible to be 1811 installed in LocRib and will be excluded from the next phase of route 1812 selection. 1814 The function that calculates the degree of preference for a given 1815 route shall not use as its inputs any of the following: the existence 1816 of other routes, the non-existence of other routes, or the path 1817 attributes of other routes. Route selection then consists of 1818 individual application of the degree of preference function to each 1819 feasible route, followed by the choice of the one with the highest 1820 degree of preference. 1822 The Decision Process operates on routes contained in the Adj-RIB-In, 1823 and is responsible for: 1825 - selection of routes to be used locally by the speaker 1827 - selection of routes to be advertised to other BGP peers 1829 - route aggregation and route information reduction 1831 The Decision Process takes place in three distinct phases, each 1832 triggered by a different event: 1834 a) Phase 1 is responsible for calculating the degree of preference 1835 for each route received from a peer. 1837 b) Phase 2 is invoked on completion of phase 1. It is responsible 1838 for choosing the best route out of all those available for each 1839 distinct destination, and for installing each chosen route into 1840 the Loc-RIB. 1842 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 1843 responsible for disseminating routes in the Loc-RIB to each peer, 1844 according to the policies contained in the PIB. Route aggregation 1845 and information reduction can optionally be performed within this 1846 phase. 1848 9.1.1 Phase 1: Calculation of Degree of Preference 1850 The Phase 1 decision function shall be invoked whenever the local BGP 1851 speaker receives from a peer an UPDATE message that advertises a new 1852 route, a replacement route, or withdrawn routes. 1854 The Phase 1 decision function is a separate process which completes 1855 RFC DRAFT November 2001 1857 when it has no further work to do. 1859 The Phase 1 decision function shall lock an Adj-RIB-In prior to 1860 operating on any route contained within it, and shall unlock it after 1861 operating on all new or unfeasible routes contained within it. 1863 For each newly received or replacement feasible route, the local BGP 1864 speaker shall determine a degree of preference as follows: 1866 If the route is learned from an internal peer, either the value of 1867 the LOCAL_PREF attribute shall be taken as the degree of 1868 preference, or the local system may compute the degree of 1869 preference of the route based on preconfigured policy information. 1870 Note that the latter (computing the degree of preference based on 1871 preconfigured policy information) may result in formation of 1872 persistent routing loops. 1874 If the route is learned from an external peer, then the local BGP 1875 speaker computes the degree of preference based on preconfigured 1876 policy information. If the return value indicates that the route 1877 is ineligible, the route may not serve as an input to the next 1878 phase of route selection; otherwise the return value is used as 1879 the LOCAL_PREF value in any IBGP readvertisement. 1881 The exact nature of this policy information and the computation 1882 involved is a local matter. 1884 9.1.2 Phase 2: Route Selection 1886 The Phase 2 decision function shall be invoked on completion of Phase 1887 1. The Phase 2 function is a separate process which completes when it 1888 has no further work to do. The Phase 2 process shall consider all 1889 routes that are eligible in the Adj-RIBs-In. 1891 The Phase 2 decision function shall be blocked from running while the 1892 Phase 3 decision function is in process. The Phase 2 function shall 1893 lock all Adj-RIBs-In prior to commencing its function, and shall 1894 unlock them on completion. 1896 If the NEXT_HOP attribute of a BGP route depicts an address that is 1897 not resolvable, or it would become unresolvable if the route was 1898 installed in the routing table the BGP route should be excluded from 1899 the Phase 2 decision function. 1901 It is critical that routers within an AS do not make conflicting 1902 decisions regarding route selection that would cause forwarding loops 1903 RFC DRAFT November 2001 1905 to occur. 1907 For each set of destinations for which a feasible route exists in the 1908 Adj-RIBs-In, the local BGP speaker shall identify the route that has: 1910 a) the highest degree of preference of any route to the same set 1911 of destinations, or 1913 b) is the only route to that destination, or 1915 c) is selected as a result of the Phase 2 tie breaking rules 1916 specified in 9.1.2.2. 1918 The local speaker SHALL then install that route in the Loc-RIB, 1919 replacing any route to the same destination that is currently being 1920 held in the Loc-RIB. If the new BGP route is installed in the Routing 1921 Table (as a result of the local policy decision), care must be taken 1922 to ensure that invalid BGP routes to the same destination are removed 1923 from the Routing Table. Whether or not the new route replaces an 1924 already existing non-BGP route in the routing table depends on the 1925 policy configured on the BGP speaker. 1927 The local speaker MUST determine the immediate next hop to the 1928 address depicted by the NEXT_HOP attribute of the selected route by 1929 performing a best matching route lookup in the Routing Table and 1930 selecting one of the possible paths (if multiple best paths to the 1931 same prefix are available). If the route to the address depicted by 1932 the NEXT_HOP attribute changes such that the immediate next hop or 1933 the IGP cost to the NEXT_HOP (if the NEXT_HOP is resolved through an 1934 IGP route) changes, route selection should be recalculated as 1935 specified above. 1937 Notice that even though BGP routes do not have to be installed in the 1938 Routing Table with the immediate next hop(s), implementations must 1939 take care that before any packets are forwarded along a BGP route, 1940 its associated NEXT_HOP address is resolved to the immediate 1941 (directly connected) next-hop address and this address (or multiple 1942 addresses) is finally used for actual packet forwarding. 1944 Unresolvable routes SHALL be removed from the Loc-RIB and the routing 1945 table. However, corresponding unresolvable routes SHOULD be kept in 1946 the Adj-RIBs-In. 1948 9.1.2.1 Route Resolvability Condition 1950 As indicated in Section 9.1.2, BGP routers should exclude 1951 RFC DRAFT November 2001 1953 unresolvable routes from the Phase 2 decision. This ensures that only 1954 valid routes are installed in Loc-RIB and the Routing Table. 1956 The route resolvability condition is defined as follows. 1958 1. A route Rte1, referencing only the intermediate network 1959 address, is considered resolvable if the Routing Table contains at 1960 least one resolvable route Rte2 that matches Rte1's intermediate 1961 network address and is not recursively resolved (directly or 1962 indirectly) through Rte1. If multiple matching routes are 1963 available, only the longest matching route should be considered. 1965 2. Routes referencing interfaces (with or without intermediate 1966 addresses) are considered resolvable if the state of the 1967 referenced interface is up and IP processing is enabled on this 1968 interface. 1970 BGP routes do not refer to interfaces, but can be resolved through 1971 the routes in the Routing Table that can be of both types. IGP routes 1972 and routes to directly connected networks are expected to specify the 1973 outbound interface. 1975 Note that a BGP route is considered unresolvable not only in 1976 situations where the router's Routing Table contains no route 1977 matching the BGP route's NEXT_HOP. Mutually recursive routes (routes 1978 resolving each other or themselves), also fail the resolvability 1979 check. 1981 It is also important that implementations do not consider feasible 1982 routes that would become unresolvable if they were installed in the 1983 Routing Table even if their NEXT_HOPs are resolvable using the 1984 current contents of the Routing Table (an example of such routes 1985 would be mutually recursive routes). This check ensures that a BGP 1986 speaker does not install in the Routing Table routes that will be 1987 removed and not used by the speaker. Therefore, in addition to local 1988 Routing Table stability, this check also improves behavior of the 1989 protocol in the network. 1991 Whenever a BGP speaker identifies a route that fails the 1992 resolvability check because of mutual recursion, an error message 1993 should be logged. 1995 9.1.2.2 Breaking Ties (Phase 2) 1997 In its Adj-RIBs-In a BGP speaker may have several routes to the same 1998 destination that have the same degree of preference. The local 1999 RFC DRAFT November 2001 2001 speaker can select only one of these routes for inclusion in the 2002 associated Loc-RIB. The local speaker considers all routes with the 2003 same degrees of preference, both those received from internal peers, 2004 and those received from external peers. 2006 The following tie-breaking procedure assumes that for each candidate 2007 route all the BGP speakers within an autonomous system can ascertain 2008 the cost of a path (interior distance) to the address depicted by the 2009 NEXT_HOP attribute of the route, and follow the same route selection 2010 algorithm. 2012 The tie-breaking algorithm begins by considering all equally 2013 preferable routes to the same destination, and then selects routes to 2014 be removed from consideration. The algorithm terminates as soon as 2015 only one route remains in consideration. The criteria must be 2016 applied in the order specified. 2018 Several of the criteria are described using pseudo-code. Note that 2019 the pseudo-code shown was chosen for clarity, not efficiency. It is 2020 not intended to specify any particular implementation. BGP 2021 implementations MAY use any algorithm which produces the same results 2022 as those described here. 2024 a) Remove from consideration all routes which are not tied for 2025 having the smallest number of AS numbers present in their AS_PATH 2026 attributes. Note, that when counting this number, an AS_SET counts 2027 as 1, no matter how many ASs are in the set, and that, if the 2028 implementation supports [13], then AS numbers present in segments 2029 of type AS_CONFED_SEQUENCE or AS_CONFED_SET are not included in 2030 the count of AS numbers present in the AS_PATH. 2032 b) Remove from consideration all routes which are not tied for 2033 having the lowest Origin number in their Origin attribute. 2035 c) Remove from consideration routes with less-preferred 2036 MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable 2037 between routes learned from the same neighboring AS. Routes which 2038 do not have the MULTI_EXIT_DISC attribute are considered to have 2039 the lowest possible MULTI_EXIT_DISC value. 2041 This is also described in the following procedure: 2043 for m = all routes still under consideration 2044 for n = all routes still under consideration 2045 if (neighborAS(m) == neighborAS(n)) and (MED(n) < MED(m)) 2046 remove route m from consideration 2048 In the pseudo-code above, MED(n) is a function which returns the 2049 RFC DRAFT November 2001 2051 value of route n's MULTI_EXIT_DISC attribute. If route n has no 2052 MULTI_EXIT_DISC attribute, the function returns the lowest 2053 possible MULTI_EXIT_DISC value, i.e. 0. 2055 Similarly, neighborAS(n) is a function which returns the neighbor 2056 AS from which the route was received. 2058 d) If at least one of the candidate routes was received from an 2059 external peer in a neighboring autonomous system, remove from 2060 consideration all routes which were received from internal peers. 2062 e) Remove from consideration any routes with less-preferred 2063 interior cost. The interior cost of a route is determined by 2064 calculating the metric to the next hop for the route using the 2065 Routing Table. If the next hop for a route is reachable, but no 2066 cost can be determined, then this step should be skipped 2067 (equivalently, consider all routes to have equal costs). 2069 This is also described in the following procedure. 2071 for m = all routes still under consideration 2072 for n = all routes in still under consideration 2073 if (cost(n) is better than cost(m)) 2074 remove m from consideration 2076 In the pseudo-code above, cost(n) is a function which returns the 2077 cost of the path (interior distance) to the address given in the 2078 NEXT_HOP attribute of the route. 2080 f) Remove from consideration all routes other than the route that 2081 was advertised by the BGP speaker whose BGP Identifier has the 2082 lowest value. 2084 9.1.3 Phase 3: Route Dissemination 2086 The Phase 3 decision function shall be invoked on completion of Phase 2087 2, or when any of the following events occur: 2089 a) when routes in the Loc-RIB to local destinations have changed 2091 b) when locally generated routes learned by means outside of BGP 2092 have changed 2094 c) when a new BGP speaker - BGP speaker connection has been 2095 established 2096 RFC DRAFT November 2001 2098 The Phase 3 function is a separate process which completes when it 2099 has no further work to do. The Phase 3 Routing Decision function 2100 shall be blocked from running while the Phase 2 decision function is 2101 in process. 2103 All routes in the Loc-RIB shall be processed into Adj-RIBs-Out 2104 according to configured policy. This policy may exclude a route in 2105 the Loc-RIB from being installed in a particular Adj-RIB-Out. A 2106 route shall not be installed in the Adj-Rib-Out unless the 2107 destination and NEXT_HOP described by this route may be forwarded 2108 appropriately by the Routing Table. If a route in Loc-RIB is excluded 2109 from a particular Adj-RIB-Out the previously advertised route in that 2110 Adj-RIB-Out must be withdrawn from service by means of an UPDATE 2111 message (see 9.2). 2113 Route aggregation and information reduction techniques (see 9.2.2.1) 2114 may optionally be applied. 2116 When the updating of the Adj-RIBs-Out and the Routing Table is 2117 complete, the local BGP speaker shall run the Update-Send process of 2118 9.2. 2120 9.1.4 Overlapping Routes 2122 A BGP speaker may transmit routes with overlapping Network Layer 2123 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 2124 occurs when a set of destinations are identified in non-matching 2125 multiple routes. Since BGP encodes NLRI using IP prefixes, overlap 2126 will always exhibit subset relationships. A route describing a 2127 smaller set of destinations (a longer prefix) is said to be more 2128 specific than a route describing a larger set of destinations (a 2129 shorted prefix); similarly, a route describing a larger set of 2130 destinations (a shorter prefix) is said to be less specific than a 2131 route describing a smaller set of destinations (a longer prefix). 2133 The precedence relationship effectively decomposes less specific 2134 routes into two parts: 2136 - a set of destinations described only by the less specific route, 2137 and 2139 - a set of destinations described by the overlap of the less 2140 specific and the more specific routes 2142 When overlapping routes are present in the same Adj-RIB-In, the more 2143 RFC DRAFT November 2001 2145 specific route shall take precedence, in order from more specific to 2146 least specific. 2148 The set of destinations described by the overlap represents a portion 2149 of the less specific route that is feasible, but is not currently in 2150 use. If a more specific route is later withdrawn, the set of 2151 destinations described by the overlap will still be reachable using 2152 the less specific route. 2154 If a BGP speaker receives overlapping routes, the Decision Process 2155 MUST consider both routes based on the configured acceptance policy. 2156 If both a less and a more specific route are accepted, then the 2157 Decision Process MUST either install both the less and the more 2158 specific routes or it MUST aggregate the two routes and install the 2159 aggregated route, provided that both routes have the same value of 2160 the NEXT_HOP attribute. 2162 If a BGP speaker chooses to aggregate, then it MUST add 2163 ATOMIC_AGGREGATE attribute to the route. A route that carries 2164 ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the 2165 NLRI of this route can not be made more specific. Forwarding along 2166 such a route does not guarantee that IP packets will actually 2167 traverse only ASs listed in the AS_PATH attribute of the route. 2169 9.2 Update-Send Process 2171 The Update-Send process is responsible for advertising UPDATE 2172 messages to all peers. For example, it distributes the routes chosen 2173 by the Decision Process to other BGP speakers which may be located in 2174 either the same autonomous system or a neighboring autonomous system. 2176 When a BGP speaker receives an UPDATE message from an internal peer, 2177 the receiving BGP speaker shall not re-distribute the routing 2178 information contained in that UPDATE message to other internal peers, 2179 unless the speaker acts as a BGP Route Reflector [11]. 2181 As part of Phase 3 of the route selection process, the BGP speaker 2182 has updated its Adj-RIBs-Out. All newly installed routes and all 2183 newly unfeasible routes for which there is no replacement route shall 2184 be advertised to its peers by means of an UPDATE message. 2186 A BGP speaker should not advertise a given feasible BGP route from 2187 its Adj-RIB-Out if it would produce an UPDATE message containing the 2188 same BGP route as was previously advertised. 2190 Any routes in the Loc-RIB marked as unfeasible shall be removed. 2192 RFC DRAFT November 2001 2194 Changes to the reachable destinations within its own autonomous 2195 system shall also be advertised in an UPDATE message. 2197 9.2.1 Controlling Routing Traffic Overhead 2199 The BGP protocol constrains the amount of routing traffic (that is, 2200 UPDATE messages) in order to limit both the link bandwidth needed to 2201 advertise UPDATE messages and the processing power needed by the 2202 Decision Process to digest the information contained in the UPDATE 2203 messages. 2205 9.2.1.1 Frequency of Route Advertisement 2207 The parameter MinRouteAdvertisementInterval determines the minimum 2208 amount of time that must elapse between advertisement of routes to a 2209 particular destination from a single BGP speaker. This rate limiting 2210 procedure applies on a per-destination basis, although the value of 2211 MinRouteAdvertisementInterval is set on a per BGP peer basis. 2213 Two UPDATE messages sent from a single BGP speaker that advertise 2214 feasible routes to some common set of destinations received from 2215 external peers must be separated by at least 2216 MinRouteAdvertisementInterval. Clearly, this can only be achieved 2217 precisely by keeping a separate timer for each common set of 2218 destinations. This would be unwarranted overhead. Any technique which 2219 ensures that the interval between two UPDATE messages sent from a 2220 single BGP speaker that advertise feasible routes to some common set 2221 of destinations received from external peers will be at least 2222 MinRouteAdvertisementInterval, and will also ensure a constant upper 2223 bound on the interval is acceptable. 2225 Since fast convergence is needed within an autonomous system, this 2226 procedure does not apply for routes received from other internal 2227 peers. To avoid long-lived black holes, the procedure does not apply 2228 to the explicit withdrawal of unfeasible routes (that is, routes 2229 whose destinations (expressed as IP prefixes) are listed in the 2230 WITHDRAWN ROUTES field of an UPDATE message). 2232 This procedure does not limit the rate of route selection, but only 2233 the rate of route advertisement. If new routes are selected multiple 2234 times while awaiting the expiration of MinRouteAdvertisementInterval, 2235 the last route selected shall be advertised at the end of 2236 MinRouteAdvertisementInterval. 2238 RFC DRAFT November 2001 2240 9.2.1.2 Frequency of Route Origination 2242 The parameter MinASOriginationInterval determines the minimum amount 2243 of time that must elapse between successive advertisements of UPDATE 2244 messages that report changes within the advertising BGP speaker's own 2245 autonomous systems. 2247 9.2.1.3 Jitter 2249 To minimize the likelihood that the distribution of BGP messages by a 2250 given BGP speaker will contain peaks, jitter should be applied to the 2251 timers associated with MinASOriginationInterval, Keepalive, and 2252 MinRouteAdvertisementInterval. A given BGP speaker shall apply the 2253 same jitter to each of these quantities regardless of the 2254 destinations to which the updates are being sent; that is, jitter 2255 will not be applied on a "per peer" basis. 2257 The amount of jitter to be introduced shall be determined by 2258 multiplying the base value of the appropriate timer by a random 2259 factor which is uniformly distributed in the range from 0.75 to 1.0. 2261 9.2.2 Efficient Organization of Routing Information 2263 Having selected the routing information which it will advertise, a 2264 BGP speaker may avail itself of several methods to organize this 2265 information in an efficient manner. 2267 9.2.2.1 Information Reduction 2269 Information reduction may imply a reduction in granularity of policy 2270 control - after information is collapsed, the same policies will 2271 apply to all destinations and paths in the equivalence class. 2273 The Decision Process may optionally reduce the amount of information 2274 that it will place in the Adj-RIBs-Out by any of the following 2275 methods: 2277 a) Network Layer Reachability Information (NLRI): 2279 Destination IP addresses can be represented as IP address 2280 prefixes. In cases where there is a correspondence between the 2281 RFC DRAFT November 2001 2283 address structure and the systems under control of an autonomous 2284 system administrator, it will be possible to reduce the size of 2285 the NLRI carried in the UPDATE messages. 2287 b) AS_PATHs: 2289 AS path information can be represented as ordered AS_SEQUENCEs or 2290 unordered AS_SETs. AS_SETs are used in the route aggregation 2291 algorithm described in 9.2.2.2. They reduce the size of the 2292 AS_PATH information by listing each AS number only once, 2293 regardless of how many times it may have appeared in multiple 2294 AS_PATHs that were aggregated. 2296 An AS_SET implies that the destinations listed in the NLRI can be 2297 reached through paths that traverse at least some of the 2298 constituent autonomous systems. AS_SETs provide sufficient 2299 information to avoid routing information looping; however their 2300 use may prune potentially feasible paths, since such paths are no 2301 longer listed individually as in the form of AS_SEQUENCEs. In 2302 practice this is not likely to be a problem, since once an IP 2303 packet arrives at the edge of a group of autonomous systems, the 2304 BGP speaker at that point is likely to have more detailed path 2305 information and can distinguish individual paths to destinations. 2307 9.2.2.2 Aggregating Routing Information 2309 Aggregation is the process of combining the characteristics of 2310 several different routes in such a way that a single route can be 2311 advertised. Aggregation can occur as part of the decision process to 2312 reduce the amount of routing information that will be placed in the 2313 Adj-RIBs-Out. 2315 Aggregation reduces the amount of information that a BGP speaker must 2316 store and exchange with other BGP speakers. Routes can be aggregated 2317 by applying the following procedure separately to path attributes of 2318 like type and to the Network Layer Reachability Information. 2320 Routes that have the following attributes shall not be aggregated 2321 unless the corresponding attributes of each route are identical: 2322 MULTI_EXIT_DISC, NEXT_HOP. 2324 If the aggregation occurs as part of the update process, routes with 2325 different NEXT_HOP values can be aggregated when announced through an 2326 external BGP session. 2328 Path attributes that have different type codes can not be aggregated 2329 RFC DRAFT November 2001 2331 together. Path attributes of the same type code may be aggregated, 2332 according to the following rules: 2334 ORIGIN attribute: If at least one route among routes that are 2335 aggregated has ORIGIN with the value INCOMPLETE, then the 2336 aggregated route must have the ORIGIN attribute with the value 2337 INCOMPLETE. Otherwise, if at least one route among routes that 2338 are aggregated has ORIGIN with the value EGP, then the aggregated 2339 route must have the origin attribute with the value EGP. In all 2340 other case the value of the ORIGIN attribute of the aggregated 2341 route is IGP. 2343 AS_PATH attribute: If routes to be aggregated have identical 2344 AS_PATH attributes, then the aggregated route has the same AS_PATH 2345 attribute as each individual route. 2347 For the purpose of aggregating AS_PATH attributes we model each AS 2348 within the AS_PATH attribute as a tuple , where 2349 "type" identifies a type of the path segment the AS belongs to 2350 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If the 2351 routes to be aggregated have different AS_PATH attributes, then 2352 the aggregated AS_PATH attribute shall satisfy all of the 2353 following conditions: 2355 - all tuples of type AS_SEQUENCE in the aggregated AS_PATH 2356 shall appear in all of the AS_PATH in the initial set of routes 2357 to be aggregated. 2359 - all tuples of type AS_SET in the aggregated AS_PATH shall 2360 appear in at least one of the AS_PATH in the initial set (they 2361 may appear as either AS_SET or AS_SEQUENCE types). 2363 - for any tuple X of type AS_SEQUENCE in the aggregated AS_PATH 2364 which precedes tuple Y in the aggregated AS_PATH, X precedes Y 2365 in each AS_PATH in the initial set which contains Y, regardless 2366 of the type of Y. 2368 - No tuple of type AS_SET with the same value shall appear more 2369 than once in the aggregated AS_PATH. 2371 - Multiple tuples of type AS_SEQUENCE with the same value may 2372 appear in the aggregated AS_PATH only when adjacent to another 2373 tuple of the same type and value. 2375 An implementation may choose any algorithm which conforms to these 2376 rules. At a minimum a conformant implementation shall be able to 2377 perform the following algorithm that meets all of the above 2378 conditions: 2380 RFC DRAFT November 2001 2382 - determine the longest leading sequence of tuples (as defined 2383 above) common to all the AS_PATH attributes of the routes to be 2384 aggregated. Make this sequence the leading sequence of the 2385 aggregated AS_PATH attribute. 2387 - set the type of the rest of the tuples from the AS_PATH 2388 attributes of the routes to be aggregated to AS_SET, and append 2389 them to the aggregated AS_PATH attribute. 2391 - if the aggregated AS_PATH has more than one tuple with the 2392 same value (regardless of tuple's type), eliminate all, but one 2393 such tuple by deleting tuples of the type AS_SET from the 2394 aggregated AS_PATH attribute. 2396 Appendix 6, section 6.8 presents another algorithm that satisfies 2397 the conditions and allows for more complex policy configurations. 2399 ATOMIC_AGGREGATE: If at least one of the routes to be aggregated 2400 has ATOMIC_AGGREGATE path attribute, then the aggregated route 2401 shall have this attribute as well. 2403 AGGREGATOR: All AGGREGATOR attributes of all routes to be 2404 aggregated should be ignored. The BGP speaker performing the route 2405 aggregation may attach a new AGGREGATOR attribute (see Section 2406 5.1.7). 2408 9.3 Route Selection Criteria 2410 Generally speaking, additional rules for comparing routes among 2411 several alternatives are outside the scope of this document. There 2412 are two exceptions: 2414 - If the local AS appears in the AS path of the new route being 2415 considered, then that new route cannot be viewed as better than 2416 any other route (provided that the speaker is configured to accept 2417 such routes). If such a route were ever used, a routing loop could 2418 result (see Section 6.3). 2420 - In order to achieve successful distributed operation, only 2421 routes with a likelihood of stability can be chosen. Thus, an AS 2422 must avoid using unstable routes, and it must not make rapid 2423 spontaneous changes to its choice of route. Quantifying the terms 2424 "unstable" and "rapid" in the previous sentence will require 2425 experience, but the principle is clear. 2427 Care must be taken to ensure that BGP speakers in the same AS do 2428 RFC DRAFT November 2001 2430 not make inconsistent decisions. 2432 9.4 Originating BGP routes 2434 A BGP speaker may originate BGP routes by injecting routing 2435 information acquired by some other means (e.g. via an IGP) into BGP. 2436 A BGP speaker that originates BGP routes shall assign the degree of 2437 preference to these routes by passing them through the Decision 2438 Process (see Section 9.1). These routes may also be distributed to 2439 other BGP speakers within the local AS as part of the update process 2440 (see Section 9.2). The decision whether to distribute non-BGP 2441 acquired routes within an AS via BGP or not depends on the 2442 environment within the AS (e.g. type of IGP) and should be controlled 2443 via configuration. 2445 Appendix 1. Comparison with RFC1771 2447 There are numerous editorial changes (too many to list here). 2449 The following list the technical changes: 2451 Changes to reflect the usages of such features as TCP MD5 [10], 2452 BGP Route Reflectors [11], BGP Confederations [13], and BGP Route 2453 Refresh [12]. 2455 Clarification on the use of the BGP Identifier in the AGGREGATOR 2456 attribute. 2458 Procedures for imposing an upper bound on the number of prefixes 2459 that a BGP speaker would accept from a peer. 2461 The ability of a BGP speaker to include more than one instance of 2462 its own AS in the AS_PATH attribute for the purpose of inter-AS 2463 traffic engineering. 2465 Clarifications on the various types of NEXT_HOPs. 2467 Clarifications to the use of the ATOMIC_AGGREGATE attribute. 2469 The relationship between the immediate next hop, and the next hop 2470 as specified in the NEXT_HOP path attribute. 2472 RFC DRAFT November 2001 2474 Clarifications on the tie-breaking procedures. 2476 Appendix 2. Comparison with RFC1267 2478 All the changes listed in Appendix 1, plus the following. 2480 BGP-4 is capable of operating in an environment where a set of 2481 reachable destinations may be expressed via a single IP prefix. The 2482 concept of network classes, or subnetting is foreign to BGP-4. To 2483 accommodate these capabilities BGP-4 changes semantics and encoding 2484 associated with the AS_PATH attribute. New text has been added to 2485 define semantics associated with IP prefixes. These abilities allow 2486 BGP-4 to support the proposed supernetting scheme [9]. 2488 To simplify configuration this version introduces a new attribute, 2489 LOCAL_PREF, that facilitates route selection procedures. 2491 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 2492 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 2493 certain aggregates are not de-aggregated. Another new attribute, 2494 AGGREGATOR, can be added to aggregate routes in order to advertise 2495 which AS and which BGP speaker within that AS caused the aggregation. 2497 To insure that Hold Timers are symmetric, the Hold Time is now 2498 negotiated on a per-connection basis. Hold Times of zero are now 2499 supported. 2501 Appendix 3. Comparison with RFC 1163 2503 All of the changes listed in Appendices 1 and 2, plus the following. 2505 To detect and recover from BGP connection collision, a new field (BGP 2506 Identifier) has been added to the OPEN message. New text (Section 2507 6.8) has been added to specify the procedure for detecting and 2508 recovering from collision. 2510 The new document no longer restricts the border router that is passed 2511 in the NEXT_HOP path attribute to be part of the same Autonomous 2512 System as the BGP Speaker. 2514 New document optimizes and simplifies the exchange of the information 2515 about previously reachable routes. 2517 RFC DRAFT November 2001 2519 Appendix 4. Comparison with RFC 1105 2521 All of the changes listed in Appendices 1, 2 and 3, plus the 2522 following. 2524 Minor changes to the RFC1105 Finite State Machine were necessary to 2525 accommodate the TCP user interface provided by 4.3 BSD. 2527 The notion of Up/Down/Horizontal relations present in RFC1105 has 2528 been removed from the protocol. 2530 The changes in the message format from RFC1105 are as follows: 2532 1. The Hold Time field has been removed from the BGP header and 2533 added to the OPEN message. 2535 2. The version field has been removed from the BGP header and 2536 added to the OPEN message. 2538 3. The Link Type field has been removed from the OPEN message. 2540 4. The OPEN CONFIRM message has been eliminated and replaced with 2541 implicit confirmation provided by the KEEPALIVE message. 2543 5. The format of the UPDATE message has been changed 2544 significantly. New fields were added to the UPDATE message to 2545 support multiple path attributes. 2547 6. The Marker field has been expanded and its role broadened to 2548 support authentication. 2550 Note that quite often BGP, as specified in RFC 1105, is referred 2551 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 2552 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 2553 BGP, as specified in this document is referred to as BGP-4. 2555 Appendix 5. TCP options that may be used with BGP 2557 If a local system TCP user interface supports TCP PUSH function, then 2558 each BGP message should be transmitted with PUSH flag set. Setting 2559 PUSH flag forces BGP messages to be transmitted promptly to the 2560 receiver. 2562 If a local system TCP user interface supports setting precedence for 2563 TCP connection, then the BGP transport connection should be opened 2564 RFC DRAFT November 2001 2566 with precedence set to Internetwork Control (110) value (see also 2567 [6]). 2569 A local system may protect its BGP sessions by using the TCP MD5 2570 Signature Option [10]. 2572 Appendix 6. Implementation Recommendations 2574 This section presents some implementation recommendations. 2576 6.1 Multiple Networks Per Message 2578 The BGP protocol allows for multiple address prefixes with the same 2579 path attributes to be specified in one message. Making use of this 2580 capability is highly recommended. With one address prefix per message 2581 there is a substantial increase in overhead in the receiver. Not only 2582 does the system overhead increase due to the reception of multiple 2583 messages, but the overhead of scanning the routing table for updates 2584 to BGP peers and other routing protocols (and sending the associated 2585 messages) is incurred multiple times as well. 2587 One method of building messages containing many address prefixes per 2588 a path attribute set from a routing table that is not organized on a 2589 per path attribute set basis is to build many messages as the routing 2590 table is scanned. As each address prefix is processed, a message for 2591 the associated set of path attributes is allocated, if it does not 2592 exist, and the new address prefix is added to it. If such a message 2593 exists, the new address prefix is just appended to it. If the message 2594 lacks the space to hold the new address prefix, it is transmitted, a 2595 new message is allocated, and the new address prefix is inserted into 2596 the new message. When the entire routing table has been scanned, all 2597 allocated messages are sent and their resources released. Maximum 2598 compression is achieved when all the destinations covered by the 2599 address prefixes share a common set of path attributes making it 2600 possible to send many address prefixes in one 4096-byte message. 2602 When peering with a BGP implementation that does not compress 2603 multiple address prefixes into one message, it may be necessary to 2604 take steps to reduce the overhead from the flood of data received 2605 when a peer is acquired or a significant network topology change 2606 occurs. One method of doing this is to limit the rate of updates. 2607 This will eliminate the redundant scanning of the routing table to 2608 provide flash updates for BGP peers and other routing protocols. A 2609 disadvantage of this approach is that it increases the propagation 2610 RFC DRAFT November 2001 2612 latency of routing information. By choosing a minimum flash update 2613 interval that is not much greater than the time it takes to process 2614 the multiple messages this latency should be minimized. A better 2615 method would be to read all received messages before sending updates. 2617 6.2 Processing Messages on a Stream Protocol 2619 BGP uses TCP as a transport mechanism. Due to the stream nature of 2620 TCP, all the data for received messages does not necessarily arrive 2621 at the same time. This can make it difficult to process the data as 2622 messages, especially on systems such as BSD Unix where it is not 2623 possible to determine how much data has been received but not yet 2624 processed. 2626 One method that can be used in this situation is to first try to read 2627 just the message header. For the KEEPALIVE message type, this is a 2628 complete message; for other message types, the header should first be 2629 verified, in particular the total length. If all checks are 2630 successful, the specified length, minus the size of the message 2631 header is the amount of data left to read. An implementation that 2632 would "hang" the routing information process while trying to read 2633 from a peer could set up a message buffer (4096 bytes) per peer and 2634 fill it with data as available until a complete message has been 2635 received. 2637 6.3 Reducing route flapping 2639 To avoid excessive route flapping a BGP speaker which needs to 2640 withdraw a destination and send an update about a more specific or 2641 less specific route SHOULD combine them into the same UPDATE message. 2643 6.4 BGP Timers 2645 BGP employs five timers: ConnectRetry, Hold Time, KeepAlive, 2646 MinASOriginationInterval, and MinRouteAdvertisementInterval The 2647 suggested value for the ConnectRetry timer is 120 seconds. The 2648 suggested value for the Hold Time is 90 seconds. The suggested value 2649 for the KeepAlive timer is 1/3 of the Hold Time. The suggested value 2650 for the MinASOriginationInterval is 15 seconds. The suggested value 2651 for the MinRouteAdvertisementInterval is 30 seconds. 2653 An implementation of BGP MUST allow the Hold Time timer to be 2654 RFC DRAFT November 2001 2656 configurable, and MAY allow the other timers to be configurable. 2658 6.5 Path attribute ordering 2660 Implementations which combine update messages as described above in 2661 6.1 may prefer to see all path attributes presented in a known order. 2662 This permits them to quickly identify sets of attributes from 2663 different update messages which are semantically identical. To 2664 facilitate this, it is a useful optimization to order the path 2665 attributes according to type code. This optimization is entirely 2666 optional. 2668 6.6 AS_SET sorting 2670 Another useful optimization that can be done to simplify this 2671 situation is to sort the AS numbers found in an AS_SET. This 2672 optimization is entirely optional. 2674 6.7 Control over version negotiation 2676 Since BGP-4 is capable of carrying aggregated routes which cannot be 2677 properly represented in BGP-3, an implementation which supports BGP-4 2678 and another BGP version should provide the capability to only speak 2679 BGP-4 on a per-peer basis. 2681 6.8 Complex AS_PATH aggregation 2683 An implementation which chooses to provide a path aggregation 2684 algorithm which retains significant amounts of path information may 2685 wish to use the following procedure: 2687 For the purpose of aggregating AS_PATH attributes of two routes, 2688 we model each AS as a tuple , where "type" identifies 2689 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 2690 AS_SET), and "value" is the AS number. Two ASs are said to be the 2691 same if their corresponding tuples are the same. 2693 The algorithm to aggregate two AS_PATH attributes works as 2694 follows: 2696 RFC DRAFT November 2001 2698 a) Identify the same ASs (as defined above) within each AS_PATH 2699 attribute that are in the same relative order within both 2700 AS_PATH attributes. Two ASs, X and Y, are said to be in the 2701 same order if either: 2702 - X precedes Y in both AS_PATH attributes, or - Y precedes X 2703 in both AS_PATH attributes. 2705 b) The aggregated AS_PATH attribute consists of ASs identified 2706 in (a) in exactly the same order as they appear in the AS_PATH 2707 attributes to be aggregated. If two consecutive ASs identified 2708 in (a) do not immediately follow each other in both of the 2709 AS_PATH attributes to be aggregated, then the intervening ASs 2710 (ASs that are between the two consecutive ASs that are the 2711 same) in both attributes are combined into an AS_SET path 2712 segment that consists of the intervening ASs from both AS_PATH 2713 attributes; this segment is then placed in between the two 2714 consecutive ASs identified in (a) of the aggregated attribute. 2715 If two consecutive ASs identified in (a) immediately follow 2716 each other in one attribute, but do not follow in another, then 2717 the intervening ASs of the latter are combined into an AS_SET 2718 path segment; this segment is then placed in between the two 2719 consecutive ASs identified in (a) of the aggregated attribute. 2721 If as a result of the above procedure a given AS number appears 2722 more than once within the aggregated AS_PATH attribute, all, but 2723 the last instance (rightmost occurrence) of that AS number should 2724 be removed from the aggregated AS_PATH attribute. 2726 Security Considerations 2728 BGP supports the ability to authenticate BGP messages by using BGP 2729 authentication. The authentication could be done on a per peer basis. 2730 In addition, BGP supports the ability to authenticate its data stream 2731 by using [10]. This authentication could be done on a per peer basis. 2732 Finally, BGP could also use IPSec to authenticate its data stream. 2733 Among the mechanisms mentioned in this paragraph, [10] is the most 2734 widely deployed. 2736 References 2738 [1] Mills, D., "Exterior Gateway Protocol Formal Specification", 2739 RFC904, April 1984. 2741 [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET 2742 RFC DRAFT November 2001 2744 Backbone", RFC1092, February 1989. 2746 [3] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, February 2747 1989. 2749 [4] Postel, J., "Transmission Control Protocol - DARPA Internet 2750 Program Protocol Specification", RFC793, September 1981. 2752 [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway 2753 Protocol in the Internet", RFC1772, March 1995. 2755 [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol 2756 Specification", RFC791, September 1981. 2758 [7] "Information Processing Systems - Telecommunications and 2759 Information Exchange between Systems - Protocol for Exchange of 2760 Inter-domain Routeing Information among Intermediate Systems to 2761 Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 2763 [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter- 2764 Domain Routing (CIDR): an Address Assignment and Aggregation 2765 Strategy", RFC1519, September 1993. 2767 [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation 2768 with CIDR", RFC 1518, September 1993. 2770 [10] Heffernan, A., "Protection of BGP Sessions via the TCP MD5 2771 Signature Option", RFC2385, August 1998. 2773 [11] Bates, T., Chandra, R., Chen, E., "BGP Route Reflection - An 2774 Alternative to Full Mesh IBGP", RFC2796, April 2000. 2776 [12] Chen, E., "Route Refresh Capability for BGP-4", RFC2918, 2777 September 2000. 2779 [13] Traina, P, McPherson, D., Scudder, J., "Autonomous System 2780 Confederations for BGP", RFC3065, February 2001. 2782 Editors' Addresses 2784 Yakov Rekhter 2785 Juniper Networks 2786 1194 N. Mathilda Avenue 2787 Sunnyvale, CA 94089 2788 email: yakov@juniper.net 2790 Tony Li 2791 RFC DRAFT November 2001 2793 Procket Networks 2794 1100 Cadillac Ct. 2795 Milpitas, CA 95035 2796 Email: tli@procket.com