idnits 2.17.1 draft-ietf-idr-bgp4-14.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 60 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...' (32 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 2666 has weird spacing: '...hen all the d...' -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- Couldn't find a document date in the document -- date freshness check skipped. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Historic RFC: RFC 904 (ref. '1') ** Downref: Normative reference to an Unknown state RFC: RFC 1092 (ref. '2') ** Downref: Normative reference to an Unknown state RFC: RFC 1093 (ref. '3') ** Obsolete normative reference: RFC 793 (ref. '4') (Obsoleted by RFC 9293) -- Possible downref: Non-RFC (?) normative reference: ref. '7' ** Obsolete normative reference: RFC 1519 (ref. '8') (Obsoleted by RFC 4632) ** Downref: Normative reference to an Historic RFC: RFC 1518 (ref. '9') ** Obsolete normative reference: RFC 2385 (ref. '10') (Obsoleted by RFC 5925) ** Obsolete normative reference: RFC 2796 (ref. '11') (Obsoleted by RFC 4456) ** Obsolete normative reference: RFC 3065 (ref. '13') (Obsoleted by RFC 5065) Summary: 17 errors (**), 0 flaws (~~), 4 warnings (==), 3 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 October 2001 47 We would also like to thank Bob Hinden, Director for Routing of the 48 Internet Engineering Steering Group, and the team of reviewers he 49 assembled to review the earlier version (BGP-2) of this document. 50 This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia 51 Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted 52 with a strong combination of toughness, professionalism, and 53 courtesy. 55 This updated version of the document is the product of the IETF IDR 56 Working Group with Yakov Rekhter and Tony Li as editors. Certain 57 sections of the document borrowed heavily from IDRP [7], which is the 58 OSI counterpart of BGP. For this credit should be given to the ANSI 59 X3S3.3 group chaired by Lyman Chapin and to Charles Kunzinger who was 60 the IDRP editor within that group. We would also like to thank Enke 61 Chen, Edward Crabbe, Mike Craren, Vincent Gillet, Eric Gray, Jeffrey 62 Haas, Dimitry Haskin, John Krawczyk, David LeRoy, Dan Massey, Dan 63 Pei, Mathew Richardson, John Scudder, John Stewart III, Dave Thaler, 64 Paul Traina, Curtis Villamizar, and Alex Zinin for their comments. 66 We would like to specially acknowledge numerous contributions by 67 Dennis Ferguson. 69 2. Introduction 71 The Border Gateway Protocol (BGP) is an inter-Autonomous System 72 routing protocol. It is built on experience gained with EGP as 73 defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as 74 described in RFC 1092 [2] and RFC 1093 [3]. 76 The primary function of a BGP speaking system is to exchange network 77 reachability information with other BGP systems. This network 78 reachability information includes information on the list of 79 Autonomous Systems (ASs) that reachability information traverses. 80 This information is sufficient to construct a graph of AS 81 connectivity from which routing loops may be pruned and some policy 82 decisions at the AS level may be enforced. 84 BGP-4 provides a new set of mechanisms for supporting Classless 85 Inter-Domain Routing (CIDR) [8, 9]. These mechanisms include support 86 for advertising an IP prefix and eliminates the concept of network 87 "class" within BGP. BGP-4 also introduces mechanisms which allow 88 aggregation of routes, including aggregation of AS paths. 90 To characterize the set of policy decisions that can be enforced 91 using BGP, one must focus on the rule that a BGP speaker advertises 92 to its peers (other BGP speakers which it communicates with) in 93 neighboring ASs only those routes that it itself uses. This rule 94 RFC DRAFT October 2001 96 reflects the "hop-by-hop" routing paradigm generally used throughout 97 the current Internet. Note that some policies cannot be supported by 98 the "hop-by-hop" routing paradigm and thus require techniques such as 99 source routing (aka explicit routing) to enforce. For example, BGP 100 does not enable one AS to send traffic to a neighboring AS intending 101 that the traffic take a different route from that taken by traffic 102 originating in the neighboring AS. On the other hand, BGP can support 103 any policy conforming to the "hop-by-hop" routing paradigm. Since the 104 current Internet uses only the "hop-by-hop" inter-AS routing paradigm 105 and since BGP can support any policy that conforms to that paradigm, 106 BGP is highly applicable as an inter-AS routing protocol for the 107 current Internet. 109 A more complete discussion of what policies can and cannot be 110 enforced with BGP is outside the scope of this document (but refer to 111 the companion document discussing BGP usage [5]). 113 BGP runs over a reliable transport protocol. This eliminates the need 114 to implement explicit update fragmentation, retransmission, 115 acknowledgment, and sequencing. Any authentication scheme used by the 116 transport protocol (e.g., RFC2385 [10]) may be used in addition to 117 BGP's own authentication mechanisms. The error notification mechanism 118 used in BGP assumes that the transport protocol supports a "graceful" 119 close, i.e., that all outstanding data will be delivered before the 120 connection is closed. 122 BGP uses TCP [4] as its transport protocol. TCP meets BGP's transport 123 requirements and is present in virtually all commercial routers and 124 hosts. In the following descriptions the phrase "transport protocol 125 connection" can be understood to refer to a TCP connection. BGP uses 126 TCP port 179 for establishing its connections. 128 This document uses the term `Autonomous System' (AS) throughout. The 129 classic definition of an Autonomous System is a set of routers under 130 a single technical administration, using an interior gateway protocol 131 and common metrics to determine how to route packets within the AS, 132 and using an exterior gateway protocol to determine how to route 133 packets to other ASs. Since this classic definition was developed, it 134 has become common for a single AS to use several interior gateway 135 protocols and sometimes several sets of metrics within an AS. The use 136 of the term Autonomous System here stresses the fact that, even when 137 multiple IGPs and metrics are used, the administration of an AS 138 appears to other ASs to have a single coherent interior routing plan 139 and presents a consistent picture of what destinations are reachable 140 through it. 142 The planned use of BGP in the Internet environment, including such 143 issues as topology, the interaction between BGP and IGPs, and the 144 RFC DRAFT October 2001 146 enforcement of routing policy rules is presented in a companion 147 document [5]. This document is the first of a series of documents 148 planned to explore various aspects of BGP application. 150 3. Summary of Operation 152 Two systems form a transport protocol connection between one another. 153 They exchange messages to open and confirm the connection parameters. 155 The initial data flow is the portion of the BGP routing table that is 156 allowed by the export policy, called the Adj-Ribs-Out (see 3.2). 157 Incremental updates are sent as the routing tables change. BGP does 158 not require periodic refresh of the routing table. Therefore, A BGP 159 speaker must retain the current version of the routes advertised by 160 all of its peers for the duration of the connection. If the 161 implementation decides to not store the routes that have been 162 received from a peer, but have been filtered out according to 163 configured local policy, the BGP Route Refresh option [12] may be 164 used to request the full set of routes from a peer without resetting 165 the BGP session when the local policy configuration changes. 167 KEEPALIVE messages are sent periodically to ensure the liveness of 168 the connection. NOTIFICATION messages are sent in response to errors 169 or special conditions. If a connection encounters an error condition, 170 a NOTIFICATION message is sent and the connection is closed. 172 The hosts executing the Border Gateway Protocol need not be routers. 173 A non-routing host could exchange routing information with routers 174 via EGP or even an interior routing protocol. That non-routing host 175 could then use BGP to exchange routing information with a border 176 router in another Autonomous System. The implications and 177 applications of this architecture are for further study. 179 Connections between BGP speakers of different ASs are referred to as 180 "external" links. BGP connections between BGP speakers within the 181 same AS are referred to as "internal" links. Similarly, a peer in a 182 different AS is referred to as an external peer, while a peer in the 183 same AS may be described as an internal peer. Internal BGP and 184 external BGP are commonly abbreviated IBGP and EBGP. 186 If a particular AS has multiple BGP speakers and is providing transit 187 service for other ASs, then care must be taken to ensure a consistent 188 view of routing within the AS. A consistent view of the interior 189 routes of the AS is provided by the interior routing protocol. A 190 consistent view of the routes exterior to the AS can be provided by 191 having all BGP speakers within the AS maintain direct IBGP 192 connections with each other. Alternately the interior routing 193 RFC DRAFT October 2001 195 protocol can pass BGP information among routers within an AS, taking 196 care not to lose BGP attributes that will be needed by EBGP speakers 197 if transit connectivity is being provided. For the purpose of 198 discussion, it is assumed that BGP information is passed within an AS 199 using IBGP. Care must be taken to ensure that the interior routers 200 have all been updated with transit information before the EBGP 201 speakers announce to other ASs that transit service is being 202 provided. 204 3.1 Routes: Advertisement and Storage 206 For purposes of this protocol a route is defined as a unit of 207 information that pairs a destination with the attributes of a path to 208 that destination: 210 - Routes are advertised between BGP speakers in UPDATE messages. 211 The destination is the systems whose IP addresses are reported in 212 the Network Layer Reachability Information (NLRI) field, and the 213 path is the information reported in the path attributes fields of 214 the same UPDATE message. 216 - Routes are stored in the Routing Information Bases (RIBs): 217 namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes 218 that will be advertised to other BGP speakers must be present in 219 the Adj-RIB-Out. Routes that will be used by the local BGP 220 speaker must be present in the Loc-RIB, and the next hop for each 221 of these routes must be present in the local BGP speaker's Routing 222 Table. Routes that are received from other BGP speakers are 223 present in the Adj-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 October 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 October 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 October 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 RFC DRAFT October 2001 387 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 388 | | 389 | Optional Parameters | 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 RFC DRAFT October 2001 435 each parameter is encoded as a triplet. 438 0 1 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 RFC DRAFT October 2001 484 Note that a separate authentication mechanism may be 485 used in establishing the transport level connection. 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 a single feasible route to a 506 peer, or to withdraw multiple unfeasible routes from service (see 507 3.1). An UPDATE message may simultaneously advertise a feasible route 508 and withdraw multiple unfeasible routes from service. The UPDATE 509 message always includes the fixed-size BGP header, and also includes 510 the other fields as shown below (note, some of the shown fields may 511 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 RFC DRAFT October 2001 529 This 2-octets unsigned integer indicates the total length of 530 the Withdrawn Routes field in octets. Its value must allow the 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 RFC DRAFT October 2001 577 Information field is present in this UPDATE message. 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. 622 RFC DRAFT October 2001 624 Currently defined Attribute Type Codes are discussed in Section 625 5. 627 If the Extended Length bit of the Attribute Flags octet is set 628 to 0, the third octet of the Path Attribute contains the length 629 of the attribute data in octets. 631 If the Extended Length bit of the Attribute Flags octet is set 632 to 1, then the third and the fourth octets of the path 633 attribute contain the length of the attribute data in octets. 635 The remaining octets of the Path Attribute represent the 636 attribute value and are interpreted according to the Attribute 637 Flags and the Attribute Type Code. The supported Attribute Type 638 Codes, their attribute values and uses are the following: 640 a) ORIGIN (Type Code 1): 642 ORIGIN is a well-known mandatory attribute that defines the 643 origin of the path information. The data octet can assume 644 the following values: 646 Value Meaning 648 0 IGP - Network Layer Reachability Information 649 is interior to the originating AS 651 1 EGP - Network Layer Reachability Information 652 learned via the EGP protocol 654 2 INCOMPLETE - Network Layer Reachability 655 Information learned by some other means 657 Its usage is defined in 5.1.1 659 b) AS_PATH (Type Code 2): 661 AS_PATH is a well-known mandatory attribute that is composed 662 of a sequence of AS path segments. Each AS path segment is 663 represented by a triple . 666 The path segment type is a 1-octet long field with the 667 following values defined: 669 Value Segment Type 671 1 AS_SET: unordered set of ASs a route in the 672 RFC DRAFT October 2001 674 UPDATE message has traversed 676 2 AS_SEQUENCE: ordered set of ASs a route in 677 the UPDATE message has traversed 679 The path segment length is a 1-octet long field containing 680 the number of ASs in the path segment value field. 682 The path segment value field contains one or more AS 683 numbers, each encoded as a 2-octets long field. 685 Usage of this attribute is defined in 5.1.2. 687 c) NEXT_HOP (Type Code 3): 689 This is a well-known mandatory attribute that defines the IP 690 address of the border router that should be used as the next 691 hop to the destinations listed in the Network Layer 692 Reachability Information field of the UPDATE message. 694 Usage of this attribute is defined in 5.1.3. 696 d) MULTI_EXIT_DISC (Type Code 4): 698 This is an optional non-transitive attribute that is a four 699 octet non-negative integer. The value of this attribute may 700 be used by a BGP speaker's decision process to discriminate 701 among multiple entry points to a neighboring autonomous 702 system. 704 Its usage is defined in 5.1.4. 706 e) LOCAL_PREF (Type Code 5): 708 LOCAL_PREF is a well-known mandatory attribute that is a 709 four octet non-negative integer. A BGP speaker uses it to 710 inform other internal peers of the advertising speaker's 711 degree of preference for an advertised route. Usage of this 712 attribute is described in 5.1.5. 714 f) ATOMIC_AGGREGATE (Type Code 6) 716 ATOMIC_AGGREGATE is a well-known discretionary attribute of 717 length 0. Usage of this attribute is described in 5.1.6. 719 g) AGGREGATOR (Type Code 7) 720 RFC DRAFT October 2001 722 AGGREGATOR is an optional transitive attribute of length 6. 723 The attribute contains the last AS number that formed the 724 aggregate route (encoded as 2 octets), followed by the IP 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 RFC DRAFT October 2001 770 enough trailing bits to make the end of the field fall on an 771 octet boundary. Note that the value of the trailing bits is 772 irrelevant. 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 RFC DRAFT October 2001 818 messages MUST NOT be sent. 820 KEEPALIVE message consists of only message header and has a length of 821 19 octets. 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 | 835 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 836 | (variable) | 837 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 839 Error Code: 841 This 1-octet unsigned integer indicates the type of 842 NOTIFICATION. The following Error Codes have been defined: 844 Error Code Symbolic Name Reference 846 1 Message Header Error Section 6.1 848 2 OPEN Message Error Section 6.2 850 3 UPDATE Message Error Section 6.3 852 4 Hold Timer Expired Section 6.5 854 5 Finite State Machine Error Section 6.6 856 6 Cease Section 6.7 858 Error subcode: 860 RFC DRAFT October 2001 862 This 1-octet unsigned integer provides more specific 863 information about the nature of the reported error. Each Error 864 Code may have one or more Error Subcodes associated with it. If 865 no appropriate Error Subcode is defined, then a zero 866 (Unspecific) value is used for the Error Subcode field. 868 Message Header Error subcodes: 870 1 - Connection Not Synchronized. 871 2 - Bad Message Length. 872 3 - Bad Message Type. 874 OPEN Message Error subcodes: 876 1 - Unsupported Version Number. 877 2 - Bad Peer AS. 878 3 - Bad BGP Identifier. 879 4 - Unsupported Optional Parameter. 880 5 - Authentication Failure. 881 6 - Unacceptable Hold Time. 883 UPDATE Message Error subcodes: 885 1 - Malformed Attribute List. 886 2 - Unrecognized Well-known Attribute. 887 3 - Missing Well-known Attribute. 888 4 - Attribute Flags Error. 889 5 - Attribute Length Error. 890 6 - Invalid ORIGIN Attribute 891 8 - Invalid NEXT_HOP Attribute. 892 9 - Optional Attribute Error. 893 10 - Invalid Network Field. 894 11 - Malformed AS_PATH. 896 Data: 898 This variable-length field is used to diagnose the reason for 899 the NOTIFICATION. The contents of the Data field depend upon 900 the Error Code and Error Subcode. See Section 6 below for more 901 details. 903 Note that the length of the Data field can be determined from 904 the message Length field by the formula: 906 Message Length = 21 + Data Length 907 RFC DRAFT October 2001 909 The minimum length of the NOTIFICATION message is 21 octets 910 (including message header). 912 5. Path Attributes 914 This section discusses the path attributes of the UPDATE message. 916 Path attributes fall into four separate categories: 918 1. Well-known mandatory. 919 2. Well-known discretionary. 920 3. Optional transitive. 921 4. Optional non-transitive. 923 Well-known attributes must be recognized by all BGP implementations. 924 Some of these attributes are mandatory and must be included in every 925 UPDATE message that contains NLRI. Others are discretionary and may 926 or may not be sent in a particular UPDATE message. 928 All well-known attributes must be passed along (after proper 929 updating, if necessary) to other BGP peers. 931 In addition to well-known attributes, each path may contain one or 932 more optional attributes. It is not required or expected that all BGP 933 implementations support all optional attributes. The handling of an 934 unrecognized optional attribute is determined by the setting of the 935 Transitive bit in the attribute flags octet. Paths with unrecognized 936 transitive optional attributes should be accepted. If a path with 937 unrecognized transitive optional attribute is accepted and passed 938 along to other BGP peers, then the unrecognized transitive optional 939 attribute of that path must be passed along with the path to other 940 BGP peers with the Partial bit in the Attribute Flags octet set to 1. 941 If a path with recognized transitive optional attribute is accepted 942 and passed along to other BGP peers and the Partial bit in the 943 Attribute Flags octet is set to 1 by some previous AS, it is not set 944 back to 0 by the current AS. Unrecognized non-transitive optional 945 attributes must be quietly ignored and not passed along to other BGP 946 peers. 948 New transitive optional attributes may be attached to the path by the 949 originator or by any other BGP speaker in the path. If they are not 950 attached by the originator, the Partial bit in the Attribute Flags 951 octet is set to 1. The rules for attaching new non-transitive 952 optional attributes will depend on the nature of the specific 953 attribute. The documentation of each new non-transitive optional 954 attribute will be expected to include such rules. (The description of 955 RFC DRAFT October 2001 957 the MULTI_EXIT_DISC attribute gives an example.) All optional 958 attributes (both transitive and non-transitive) may be updated (if 959 appropriate) by BGP speakers in the path. 961 The sender of an UPDATE message should order path attributes within 962 the UPDATE message in ascending order of attribute type. The receiver 963 of an UPDATE message must be prepared to handle path attributes 964 within the UPDATE message that are out of order. 966 The same attribute cannot appear more than once within the Path 967 Attributes field of a particular UPDATE message. 969 The mandatory category refers to an attribute which must be present 970 in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE 971 message. Attributes classified as optional for the purpose of the 972 protocol extension mechanism may be purely discretionary, or 973 discretionary, required, or disallowed in certain contexts. 975 attribute EBGP IBGP 976 ORIGIN mandatory mandatory 977 AS_PATH mandatory mandatory 978 NEXT_HOP mandatory mandatory 979 MULTI_EXIT_DISC discretionary discretionary 980 LOCAL_PREF disallowed required 981 ATOMIC_AGGREGATE see section 5.1.6 and 9.1.4 982 AGGREGATOR discretionary discretionary 984 5.1 Path Attribute Usage 986 The usage of each BGP path attributes is described in the following 987 clauses. 989 5.1.1 ORIGIN 991 ORIGIN is a well-known mandatory attribute. The ORIGIN attribute 992 shall be generated by the autonomous system that originates the 993 associated routing information. It shall be included in the UPDATE 994 messages of all BGP speakers that choose to propagate this 995 information to other BGP speakers. 997 RFC DRAFT October 2001 999 5.1.2 AS_PATH 1001 AS_PATH is a well-known mandatory attribute. This attribute 1002 identifies the autonomous systems through which routing information 1003 carried in this UPDATE message has passed. The components of this 1004 list can be AS_SETs or AS_SEQUENCEs. 1006 When a BGP speaker propagates a route which it has learned from 1007 another BGP speaker's UPDATE message, it shall modify the route's 1008 AS_PATH attribute based on the location of the BGP speaker to which 1009 the route will be sent: 1011 a) When a given BGP speaker advertises the route to an internal 1012 peer, the advertising speaker shall not modify the AS_PATH 1013 attribute associated with the route. 1015 b) When a given BGP speaker advertises the route to an external 1016 peer, then the advertising speaker shall update the AS_PATH 1017 attribute as follows: 1019 1) if the first path segment of the AS_PATH is of type 1020 AS_SEQUENCE, the local system shall prepend its own AS number 1021 as the last element of the sequence (put it in the leftmost 1022 position) 1024 2) if the first path segment of the AS_PATH is of type AS_SET, 1025 the local system shall prepend a new path segment of type 1026 AS_SEQUENCE to the AS_PATH, including its own AS number in that 1027 segment. 1029 When a BGP speaker originates a route then: 1031 a) the originating speaker shall include its own AS number in a 1032 path segment of type AS_SEQUENCE in the AS_PATH attribute of all 1033 UPDATE messages sent to an external peer. (In this case, the AS 1034 number of the originating speaker's autonomous system will be the 1035 only entry the path segment, and this path segment will be the 1036 only segment in the AS_PATH attribute). 1038 b) the originating speaker shall include an empty AS_PATH 1039 attribute in all UPDATE messages sent to internal peers. (An 1040 empty AS_PATH attribute is one whose length field contains the 1041 value zero). 1043 Whenever the modification of the AS_PATH attribute calls for 1044 including or prepending the AS number of the local system, the local 1045 system may include/prepend more than one instance of its own AS 1046 RFC DRAFT October 2001 1048 number in the AS_PATH attribute. This is controlled via local 1049 configuration. 1051 5.1.3 NEXT_HOP 1053 The NEXT_HOP path attribute defines the IP address of the border 1054 router that should be used as the next hop to the destinations listed 1055 in the UPDATE message. The NEXT_HOP attribute is calculated as 1056 follows. 1058 1) When sending a message to an internal peer, the BGP speaker 1059 should not modify the NEXT_HOP attribute, unless it has been 1060 explicitly configured to announce its own IP address as the 1061 NEXT_HOP. 1063 2) When sending a message to an external peer X, and the peer is 1064 one IP hop away from the speaker: 1066 - If the route being announced was learned from an internal 1067 peer or is locally originated, the BGP speaker can use for the 1068 NEXT_HOP attribute an interface address of the internal peer 1069 router through which the announced network is reachable for the 1070 speaker, provided that peer X shares a common subnet with this 1071 address. This is a form of "third party" NEXT_HOP attribute. 1073 - If the route being announced was learned from an external 1074 peer, the speaker can use in the NEXT_HOP attribute an IP 1075 address of any adjacent router (known from the received 1076 NEXT_HOP attribute) that the speaker itself uses for local 1077 route calculation, provided that peer X shares a common subnet 1078 with this address. This is a second form of "third party" 1079 NEXT_HOP attribute. 1081 - If the external peer to which the route is being advertised 1082 shares a common subnet with one of the announcing router's own 1083 interfaces, the router may use the IP address associated with 1084 such an interface in the NEXT_HOP attribute. This is known as a 1085 "first party" NEXT_HOP attribute. 1087 - By default (if none of the above conditions apply), the BGP 1088 speaker should use in the NEXT_HOP attribute the IP address of 1089 the interface that the speaker uses to establish the BGP 1090 session to peer X. 1092 3) When sending a message to an external peer X, and the peer is 1093 RFC DRAFT October 2001 1095 multiple IP hops away from the speaker (aka "multihop EBGP"): 1097 - The speaker may be configured to propagate the NEXT_HOP 1098 attribute. In this case when advertising a route that the 1099 speaker learned from one of its peers, the NEXT_HOP attribute 1100 of the advertised route is exactly the same as the NEXT_HOP 1101 attribute of the learned route (the speaker just doesn't modify 1102 the NEXT_HOP attribute). 1104 - By default, the BGP speaker should use in the NEXT_HOP 1105 attribute the IP address of the interface that the speaker uses 1106 to establish the BGP session to peer X. 1108 Normally the NEXT_HOP attribute is chosen such that the shortest 1109 available path will be taken. A BGP speaker must be able to support 1110 disabling advertisement of third party NEXT_HOP attributes to handle 1111 imperfectly bridged media. 1113 A BGP speaker must never advertise an address of a peer to that peer 1114 as a NEXT_HOP, for a route that the speaker is originating. A BGP 1115 speaker must never install a route with itself as the next hop. 1117 The NEXT_HOP attribute is used by the BGP speaker to determine the 1118 actual outbound interface and immediate next-hop address that should 1119 be used to forward transit packets to the associated destinations. 1120 The immediate next-hop address is determined by performing a 1121 recursive route lookup operation for the IP address in the NEXT_HOP 1122 attribute using the contents of the Routing Table (see Section 1123 9.1.2.2). The resolving route will always specify the outbound 1124 interface. If the resolving route specifies the next-hop address, 1125 this address should be used as the immediate address for packet 1126 forwarding. If the address in the NEXT_HOP attribute is directly 1127 resolved through a route to an attached subnet (such a route will not 1128 specify the next-hop address), the outbound interface should be taken 1129 from the resolving route and the address in the NEXT_HOP attribute 1130 should be used as the immediate next-hop address. 1132 5.1.4 MULTI_EXIT_DISC 1134 The MULTI_EXIT_DISC attribute may be used on external (inter-AS) 1135 links to discriminate among multiple exit or entry points to the same 1136 neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four 1137 octet unsigned number which is called a metric. All other factors 1138 being equal, the exit point with lower metric should be preferred. If 1139 received over external links, the MULTI_EXIT_DISC attribute MAY be 1140 propagated over internal links to other BGP speakers within the same 1141 RFC DRAFT October 2001 1143 AS. The MULTI_EXIT_DISC attribute received from a neighboring AS MUST 1144 NOT be propagated to other neighboring ASs. 1146 A BGP speaker MUST IMPLEMENT a mechanism based on local configuration 1147 which allows the MULTI_EXIT_DISC attribute to be removed from a 1148 route. This MAY be done prior to determining the degree of preference 1149 of the route and performing route selection (decision process phases 1150 1 and 2). 1152 An implementation MAY also (based on local configuration) alter the 1153 value of the MULTI_EXIT_DISC attribute received over an external 1154 link. If it does so, it shall do so prior to determining the degree 1155 of preference of the route and performing route selection (decision 1156 process phases 1 and 2). 1158 5.1.5 LOCAL_PREF 1160 LOCAL_PREF is a well-known mandatory attribute that SHALL be included 1161 in all UPDATE messages that a given BGP speaker sends to the other 1162 internal peers. A BGP speaker SHALL calculate the degree of 1163 preference for each external route based on the locally configured 1164 policy, and include the degree of preference when advertising a route 1165 to its internal peers. The higher degree of preference MUST be 1166 preferred. A BGP speaker shall use the degree of preference learned 1167 via LOCAL_PREF in its decision process (see section 9.1.1). 1169 A BGP speaker MUST NOT include this attribute in UPDATE messages that 1170 it sends to external peers, except for the case of BGP Confederations 1171 [13]. If it is contained in an UPDATE message that is received from 1172 an external peer, then this attribute MUST be ignored by the 1173 receiving speaker, except for the case of BGP Confederations [13]. 1175 5.1.6 ATOMIC_AGGREGATE 1177 ATOMIC_AGGREGATE is a well-known discretionary attribute. There are 1178 two cases where the ATOMIC_AGGREGATE attribute is used: 1180 - a speaker receives both more and less specific routes, these 1181 routes have the same NEXT_HOP, the AS_PATH attribute of the more 1182 specific route is different from the AS_PATH attribute of the less 1183 specific route, and the speaker installs in its Loc-RIB only the 1184 less specific route. In this case the speaker should advertise 1185 this route with the ATOMIC_AGGREGATE attribute to all neighbors 1186 (subject to the outbound route filtering). 1188 RFC DRAFT October 2001 1190 - a speaker receives both more and less specific routes the 1191 AS_PATH attribute of the more specific route is different from the 1192 AS_PATH attribute of the less specific route, the speaker installs 1193 in its Loc-RIB both routes, but the speaker advertises to a 1194 particular neighbor only the less specific route. In this case the 1195 advertisement MUST carry the ATOMIC_AGGREGATE attribute. 1197 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1198 attribute MUST NOT remove the attribute from the route when 1199 propagating it to other speakers. 1201 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1202 attribute MUST NOT make any NLRI of that route more specific (as 1203 defined in 9.1.4) when advertising this route to other BGP speakers. 1205 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1206 attribute needs to be cognizant of the fact that the actual path to 1207 destinations, as specified in the NLRI of the route, while having the 1208 loop-free property, may not be the path specified in the AS_PATH 1209 attribute of the route. 1211 5.1.7 AGGREGATOR 1213 AGGREGATOR is an optional transitive attribute which may be included 1214 in updates which are formed by aggregation (see Section 9.2.4.2). A 1215 BGP speaker which performs route aggregation may add the AGGREGATOR 1216 attribute which shall contain its own AS number and IP address. The 1217 IP address should be the same as the BGP Identifier of the speaker. 1219 6. BGP Error Handling. 1221 This section describes actions to be taken when errors are detected 1222 while processing BGP messages. 1224 When any of the conditions described here are detected, a 1225 NOTIFICATION message with the indicated Error Code, Error Subcode, 1226 and Data fields is sent, and the BGP connection is closed. If no 1227 Error Subcode is specified, then a zero must be used. 1229 The phrase "the BGP connection is closed" means that the transport 1230 protocol connection has been closed, the associated Adj-RIB-In has 1231 been cleared, and that all resources for that BGP connection have 1232 been deallocated. Entries in the Loc-RIB associated with the remote 1233 peer are marked as invalid. The fact that the routes have become 1234 RFC DRAFT October 2001 1236 invalid is passed to other BGP peers before the routes are deleted 1237 from the system. 1239 Unless specified explicitly, the Data field of the NOTIFICATION 1240 message that is sent to indicate an error is empty. 1242 6.1 Message Header error handling. 1244 All errors detected while processing the Message Header are indicated 1245 by sending the NOTIFICATION message with Error Code Message Header 1246 Error. The Error Subcode elaborates on the specific nature of the 1247 error. 1249 The expected value of the Marker field of the message header is all 1250 ones if the message type is OPEN. The expected value of the Marker 1251 field for all other types of BGP messages determined based on the 1252 presence of the Authentication Information Optional Parameter in the 1253 BGP OPEN message and the actual authentication mechanism (if the 1254 Authentication Information in the BGP OPEN message is present). If 1255 the Marker field of the message header is not the expected one, then 1256 a synchronization error has occurred and the Error Subcode is set to 1257 Connection Not Synchronized. 1259 If the Length field of the message header is less than 19 or greater 1260 than 4096, or if the Length field of an OPEN message is less than the 1261 minimum length of the OPEN message, or if the Length field of an 1262 UPDATE message is less than the minimum length of the UPDATE message, 1263 or if the Length field of a KEEPALIVE message is not equal to 19, or 1264 if the Length field of a NOTIFICATION message is less than the 1265 minimum length of the NOTIFICATION message, then the Error Subcode is 1266 set to Bad Message Length. The Data field contains the erroneous 1267 Length field. 1269 If the Type field of the message header is not recognized, then the 1270 Error Subcode is set to Bad Message Type. The Data field contains the 1271 erroneous Type field. 1273 6.2 OPEN message error handling. 1275 All errors detected while processing the OPEN message are indicated 1276 by sending the NOTIFICATION message with Error Code OPEN Message 1277 Error. The Error Subcode elaborates on the specific nature of the 1278 error. 1280 RFC DRAFT October 2001 1282 If the version number contained in the Version field of the received 1283 OPEN message is not supported, then the Error Subcode is set to 1284 Unsupported Version Number. The Data field is a 1-octet unsigned 1285 integer, which indicates the largest locally supported version number 1286 less than the version the remote BGP peer bid (as indicated in the 1287 received OPEN message). 1289 If the Autonomous System field of the OPEN message is unacceptable, 1290 then the Error Subcode is set to Bad Peer AS. The determination of 1291 acceptable Autonomous System numbers is outside the scope of this 1292 protocol. 1294 If the Hold Time field of the OPEN message is unacceptable, then the 1295 Error Subcode MUST be set to Unacceptable Hold Time. An 1296 implementation MUST reject Hold Time values of one or two seconds. An 1297 implementation MAY reject any proposed Hold Time. An implementation 1298 which accepts a Hold Time MUST use the negotiated value for the Hold 1299 Time. 1301 If the BGP Identifier field of the OPEN message is syntactically 1302 incorrect, then the Error Subcode is set to Bad BGP Identifier. 1303 Syntactic correctness means that the BGP Identifier field represents 1304 a valid IP host address. 1306 If one of the Optional Parameters in the OPEN message is not 1307 recognized, then the Error Subcode is set to Unsupported Optional 1308 Parameters. 1310 If the OPEN message carries Authentication Information (as an 1311 Optional Parameter), then the corresponding authentication procedure 1312 is invoked. If the authentication procedure (based on Authentication 1313 Code and Authentication Data) fails, then the Error Subcode is set to 1314 Authentication Failure. 1316 6.3 UPDATE message error handling. 1318 All errors detected while processing the UPDATE message are indicated 1319 by sending the NOTIFICATION message with Error Code UPDATE Message 1320 Error. The error subcode elaborates on the specific nature of the 1321 error. 1323 Error checking of an UPDATE message begins by examining the path 1324 attributes. If the Withdrawn Routes Length or Total Attribute Length 1325 is too large (i.e., if Withdrawn Routes Length + Total Attribute 1326 RFC DRAFT October 2001 1328 Length + 23 exceeds the message Length), then the Error Subcode is 1329 set to Malformed Attribute List. 1331 If any recognized attribute has Attribute Flags that conflict with 1332 the Attribute Type Code, then the Error Subcode is set to Attribute 1333 Flags Error. The Data field contains the erroneous attribute (type, 1334 length and value). 1336 If any recognized attribute has Attribute Length that conflicts with 1337 the expected length (based on the attribute type code), then the 1338 Error Subcode is set to Attribute Length Error. The Data field 1339 contains the erroneous attribute (type, length and value). 1341 If any of the mandatory well-known attributes are not present, then 1342 the Error Subcode is set to Missing Well-known Attribute. The Data 1343 field contains the Attribute Type Code of the missing well-known 1344 attribute. 1346 If any of the mandatory well-known attributes are not recognized, 1347 then the Error Subcode is set to Unrecognized Well-known Attribute. 1348 The Data field contains the unrecognized attribute (type, length and 1349 value). 1351 If the ORIGIN attribute has an undefined value, then the Error 1352 Subcode is set to Invalid Origin Attribute. The Data field contains 1353 the unrecognized attribute (type, length and value). 1355 If the NEXT_HOP attribute field is syntactically incorrect, then the 1356 Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field 1357 contains the incorrect attribute (type, length and value). Syntactic 1358 correctness means that the NEXT_HOP attribute represents a valid IP 1359 host address. Semantic correctness applies only to the external BGP 1360 links, and only when the sender and the receiving speaker are one IP 1361 hop away from each other. To be semantically correct, the IP address 1362 in the NEXT_HOP must not be the IP address of the receiving speaker, 1363 and the NEXT_HOP IP address must either be the sender's IP address 1364 (used to establish the BGP session), or the interface associated with 1365 the NEXT_HOP IP address must share a common subnet with the receiving 1366 BGP speaker. If the NEXT_HOP attribute is semantically incorrect, the 1367 error should be logged, and the route should be ignored. In this 1368 case, no NOTIFICATION message should be sent. 1370 The AS_PATH attribute is checked for syntactic correctness. If the 1371 path is syntactically incorrect, then the Error Subcode is set to 1372 Malformed AS_PATH. 1374 The information carried by the AS_PATH attribute is checked for AS 1375 RFC DRAFT October 2001 1377 loops. AS loop detection is done by scanning the full AS path (as 1378 specified in the AS_PATH attribute), and checking that the autonomous 1379 system number of the local system does not appear in the AS path. If 1380 the autonomous system number appears in the AS path the route may be 1381 stored in the Adj-RIB-In, but unless the router is configured to 1382 accept routes with its own autonomous system in the AS path, the 1383 route shall not be passed to the BGP Decision Process. Operations of 1384 a router that is configured to accept routes with its own autonomous 1385 system number in the AS path are outside the scope of this document. 1387 If an optional attribute is recognized, then the value of this 1388 attribute is checked. If an error is detected, the attribute is 1389 discarded, and the Error Subcode is set to Optional Attribute Error. 1390 The Data field contains the attribute (type, length and value). 1392 If any attribute appears more than once in the UPDATE message, then 1393 the Error Subcode is set to Malformed Attribute List. 1395 The NLRI field in the UPDATE message is checked for syntactic 1396 validity. If the field is syntactically incorrect, then the Error 1397 Subcode is set to Invalid Network Field. 1399 If a prefix in the NLRI field is semantically incorrect (e.g., an 1400 unexpected multicast IP address), an error should be logged locally, 1401 and the prefix should be ignored. 1403 An UPDATE message that contains correct path attributes, but no NLRI, 1404 shall be treated as a valid UPDATE message. 1406 6.4 NOTIFICATION message error handling. 1408 If a peer sends a NOTIFICATION message, and there is an error in that 1409 message, there is unfortunately no means of reporting this error via 1410 a subsequent NOTIFICATION message. Any such error, such as an 1411 unrecognized Error Code or Error Subcode, should be noticed, logged 1412 locally, and brought to the attention of the administration of the 1413 peer. The means to do this, however, lies outside the scope of this 1414 document. 1416 6.5 Hold Timer Expired error handling. 1418 If a system does not receive successive KEEPALIVE and/or UPDATE 1419 and/or NOTIFICATION messages within the period specified in the Hold 1420 Time field of the OPEN message, then the NOTIFICATION message with 1421 RFC DRAFT October 2001 1423 Hold Timer Expired Error Code must be sent and the BGP connection 1424 closed. 1426 6.6 Finite State Machine error handling. 1428 Any error detected by the BGP Finite State Machine (e.g., receipt of 1429 an unexpected event) is indicated by sending the NOTIFICATION message 1430 with Error Code Finite State Machine Error. 1432 6.7 Cease. 1434 In absence of any fatal errors (that are indicated in this section), 1435 a BGP peer may choose at any given time to close its BGP connection 1436 by sending the NOTIFICATION message with Error Code Cease. However, 1437 the Cease NOTIFICATION message must not be used when a fatal error 1438 indicated by this section does exist. 1440 A BGP speaker may support the ability to impose an (locally 1441 configured) upper bound on the number of address prefixes the speaker 1442 is willing to accept from a neighbor. When the upper bound is 1443 reached, the speaker (under control of local configuration) may 1444 either (a) stop accepting new address prefixes from the neighbor, or 1445 (b) terminate the BGP peering with the neighbor. If the BGP speaker 1446 decides to terminate its peering with a neighbor because the number 1447 of address prefixes received from the neighbor exceeds the locally 1448 configured upper bound, then the speaker must send to the neighbor a 1449 NOTIFICATION message with the Error Code Cease. 1451 6.8 Connection collision detection. 1453 If a pair of BGP speakers try simultaneously to establish a TCP 1454 connection to each other, then two parallel connections between this 1455 pair of speakers might well be formed. We refer to this situation as 1456 connection collision. Clearly, one of these connections must be 1457 closed. 1459 Based on the value of the BGP Identifier a convention is established 1460 for detecting which BGP connection is to be preserved when a 1461 collision does occur. The convention is to compare the BGP 1462 Identifiers of the peers involved in the collision and to retain only 1463 the connection initiated by the BGP speaker with the higher-valued 1464 BGP Identifier. 1466 RFC DRAFT October 2001 1468 Upon receipt of an OPEN message, the local system must examine all of 1469 its connections that are in the OpenConfirm state. A BGP speaker may 1470 also examine connections in an OpenSent state if it knows the BGP 1471 Identifier of the peer by means outside of the protocol. If among 1472 these connections there is a connection to a remote BGP speaker whose 1473 BGP Identifier equals the one in the OPEN message, then the local 1474 system performs the following collision resolution procedure: 1476 1. The BGP Identifier of the local system is compared to the BGP 1477 Identifier of the remote system (as specified in the OPEN 1478 message). 1480 2. If the value of the local BGP Identifier is less than the 1481 remote one, the local system closes BGP connection that already 1482 exists (the one that is already in the OpenConfirm state), and 1483 accepts BGP connection initiated by the remote system. 1485 3. Otherwise, the local system closes newly created BGP connection 1486 (the one associated with the newly received OPEN message), and 1487 continues to use the existing one (the one that is already in the 1488 OpenConfirm state). 1490 Comparing BGP Identifiers is done by treating them as (4-octet 1491 long) unsigned integers. 1493 Unless allowed via configuration, a connection collision with an 1494 existing BGP connection that is in Established state causes 1495 closing of the newly created connection. 1497 Note that a connection collision cannot be detected with 1498 connections that are in Idle, or Connect, or Active states. 1500 Closing the BGP connection (that results from the collision 1501 resolution procedure) is accomplished by sending the NOTIFICATION 1502 message with the Error Code Cease. 1504 7. BGP Version Negotiation. 1506 BGP speakers may negotiate the version of the protocol by making 1507 multiple attempts to open a BGP connection, starting with the highest 1508 version number each supports. If an open attempt fails with an Error 1509 Code OPEN Message Error, and an Error Subcode Unsupported Version 1510 Number, then the BGP speaker has available the version number it 1511 tried, the version number its peer tried, the version number passed 1512 by its peer in the NOTIFICATION message, and the version numbers that 1513 RFC DRAFT October 2001 1515 it supports. If the two peers do support one or more common versions, 1516 then this will allow them to rapidly determine the highest common 1517 version. In order to support BGP version negotiation, future versions 1518 of BGP must retain the format of the OPEN and NOTIFICATION messages. 1520 8. BGP Finite State machine. 1522 This section specifies BGP operation in terms of a Finite State 1523 Machine (FSM). Following is a brief summary and overview of BGP 1524 operations by state as determined by this FSM. 1526 Initially BGP is in the Idle state. 1528 Idle state: 1530 In this state BGP refuses all incoming BGP connections. No 1531 resources are allocated to the peer. In response to the Start 1532 event (initiated by either system or operator) the local system 1533 initializes all BGP resources, starts the ConnectRetry timer, 1534 initiates a transport connection to other BGP peer, while 1535 listening for connection that may be initiated by the remote 1536 BGP peer, and changes its state to Connect. The exact value of 1537 the ConnectRetry timer is a local matter, but should be 1538 sufficiently large to allow TCP initialization. 1540 If a BGP speaker detects an error, it shuts down the connection 1541 and changes its state to Idle. Getting out of the Idle state 1542 requires generation of the Start event. If such an event is 1543 generated automatically, then persistent BGP errors may result 1544 in persistent flapping of the speaker. To avoid such a 1545 condition it is recommended that Start events should not be 1546 generated immediately for a peer that was previously 1547 transitioned to Idle due to an error. For a peer that was 1548 previously transitioned to Idle due to an error, the time 1549 between consecutive generation of Start events, if such events 1550 are generated automatically, shall exponentially increase. The 1551 value of the initial timer shall be 60 seconds. The time shall 1552 be doubled for each consecutive retry. An implementation MAY 1553 impose a configurable upper bound on that time. Once the upper 1554 bound is reached, the speaker shall no longer automatically 1555 generate the Start event for the peer. 1557 Any other event received in the Idle state is ignored. 1559 Connect state: 1561 RFC DRAFT October 2001 1563 In this state BGP is waiting for the transport protocol 1564 connection to be completed. 1566 If the transport protocol connection succeeds, the local system 1567 clears the ConnectRetry timer, completes initialization, sends 1568 an OPEN message to its peer, and changes its state to OpenSent. 1570 If the transport protocol connect fails (e.g., retransmission 1571 timeout), the local system restarts the ConnectRetry timer, 1572 continues to listen for a connection that may be initiated by 1573 the remote BGP peer, and changes its state to Active state. 1575 In response to the ConnectRetry timer expired event, the local 1576 system restarts the ConnectRetry timer, initiates a transport 1577 connection to other BGP peer, continues to listen for a 1578 connection that may be initiated by the remote BGP peer, and 1579 stays in the Connect state. 1581 The Start event is ignored in the Connect state. 1583 In response to any other event (initiated by either system or 1584 operator), the local system releases all BGP resources 1585 associated with this connection and changes its state to Idle. 1587 Active state: 1589 In this state BGP is trying to acquire a peer by listening for 1590 and accepting a transport protocol connection. 1592 If the transport protocol connection succeeds, the local system 1593 clears the ConnectRetry timer, completes initialization, sends 1594 an OPEN message to its peer, sets its Hold Timer to a large 1595 value, and changes its state to OpenSent. A Hold Timer value of 1596 4 minutes is suggested. 1598 In response to the ConnectRetry timer expired event, the local 1599 system restarts the ConnectRetry timer, initiates a transport 1600 connection to the other BGP peer, continues to listen for a 1601 connection that may be initiated by the remote BGP peer, and 1602 changes its state to Connect. 1604 If the local system allows BGP connections with unconfigured 1605 peers, then when the local system detects that a remote peer is 1606 trying to establish a BGP connection to it, and the IP address 1607 of the remote peer is not a configured one, the local system 1608 creates a temporary peer entry, completes initialization, sends 1609 an OPEN message to its peer, sets its Hold Timer to a large 1610 value, and changes its state to OpenSent. 1612 RFC DRAFT October 2001 1614 If the local system does not allow BGP connections with 1615 unconfigured peers, then the local system rejects connections 1616 from IP addresses that are not configured peers, and remains in 1617 the Active state. 1619 The Start event is ignored in the Active state. 1621 In response to any other event (initiated by either system or 1622 operator), the local system releases all BGP resources 1623 associated with this connection and changes its state to Idle. 1625 OpenSent state: 1627 In this state BGP waits for an OPEN message from its peer. 1628 When an OPEN message is received, all fields are checked for 1629 correctness. If the BGP message header checking or OPEN message 1630 checking detects an error (see Section 6.2), or a connection 1631 collision (see Section 6.8) the local system sends a 1632 NOTIFICATION message and changes its state to Idle. 1634 If there are no errors in the OPEN message, BGP sends a 1635 KEEPALIVE message and sets a KeepAlive timer. The Hold Timer, 1636 which was originally set to a large value (see above), is 1637 replaced with the negotiated Hold Time value (see section 4.2). 1638 If the negotiated Hold Time value is zero, then the Hold Time 1639 timer and KeepAlive timers are not started. If the value of the 1640 Autonomous System field is the same as the local Autonomous 1641 System number, then the connection is an "internal" connection; 1642 otherwise, it is "external". (This will affect UPDATE 1643 processing as described below.) Finally, the state is changed 1644 to OpenConfirm. 1646 If a disconnect notification is received from the underlying 1647 transport protocol, the local system closes the BGP connection, 1648 restarts the ConnectRetry timer, while continue listening for 1649 connection that may be initiated by the remote BGP peer, and 1650 goes into the Active state. 1652 If the Hold Timer expires, the local system sends NOTIFICATION 1653 message with error code Hold Timer Expired and changes its 1654 state to Idle. 1656 In response to the Stop event (initiated by either system or 1657 operator) the local system sends NOTIFICATION message with 1658 Error Code Cease and changes its state to Idle. 1660 The Start event is ignored in the OpenSent state. 1662 RFC DRAFT October 2001 1664 In response to any other event the local system sends 1665 NOTIFICATION message with Error Code Finite State Machine Error 1666 and changes its state to Idle. 1668 Whenever BGP changes its state from OpenSent to Idle, it closes 1669 the BGP (and transport-level) connection and releases all 1670 resources associated with that connection. 1672 OpenConfirm state: 1674 In this state BGP waits for a KEEPALIVE or NOTIFICATION 1675 message. 1677 If the local system receives a KEEPALIVE message, it changes 1678 its state to Established. 1680 If the Hold Timer expires before a KEEPALIVE message is 1681 received, the local system sends NOTIFICATION message with 1682 error code Hold Timer Expired and changes its state to Idle. 1684 If the local system receives a NOTIFICATION message, it changes 1685 its state to Idle. 1687 If the KeepAlive timer expires, the local system sends a 1688 KEEPALIVE message and restarts its KeepAlive timer. 1690 If a disconnect notification is received from the underlying 1691 transport protocol, the local system changes its state to Idle. 1693 In response to the Stop event (initiated by either system or 1694 operator) the local system sends NOTIFICATION message with 1695 Error Code Cease and changes its state to Idle. 1697 The Start event is ignored in the OpenConfirm state. 1699 In response to any other event the local system sends 1700 NOTIFICATION message with Error Code Finite State Machine Error 1701 and changes its state to Idle. 1703 Whenever BGP changes its state from OpenConfirm to Idle, it 1704 closes the BGP (and transport-level) connection and releases 1705 all resources associated with that connection. 1707 Established state: 1709 In the Established state BGP can exchange UPDATE, NOTIFICATION, 1710 and KEEPALIVE messages with its peer. 1712 RFC DRAFT October 2001 1714 If the local system receives an UPDATE or KEEPALIVE message, it 1715 restarts its Hold Timer, if the negotiated Hold Time value is 1716 non-zero. 1718 If the local system receives a NOTIFICATION message, it changes 1719 its state to Idle. 1721 If the local system receives an UPDATE message and the UPDATE 1722 message error handling procedure (see Section 6.3) detects an 1723 error, the local system sends a NOTIFICATION message and 1724 changes its state to Idle. 1726 If a disconnect notification is received from the underlying 1727 transport protocol, the local system changes its state to Idle. 1729 If the Hold Timer expires, the local system sends a 1730 NOTIFICATION message with Error Code Hold Timer Expired and 1731 changes its state to Idle. 1733 If the KeepAlive timer expires, the local system sends a 1734 KEEPALIVE message and restarts its KeepAlive timer. 1736 Each time the local system sends a KEEPALIVE or UPDATE message, 1737 it restarts its KeepAlive timer, unless the negotiated Hold 1738 Time value is zero. 1740 In response to the Stop event (initiated by either system or 1741 operator), the local system sends a NOTIFICATION message with 1742 Error Code Cease and changes its state to Idle. 1744 The Start event is ignored in the Established state. 1746 In response to any other event, the local system sends 1747 NOTIFICATION message with Error Code Finite State Machine Error 1748 and changes its state to Idle. 1750 Whenever BGP changes its state from Established to Idle, it 1751 closes the BGP (and transport-level) connection, releases all 1752 resources associated with that connection, and deletes all 1753 routes derived from that connection. 1755 9. UPDATE Message Handling 1757 An UPDATE message may be received only in the Established state. 1758 When an UPDATE message is received, each field is checked for 1759 validity as specified in Section 6.3. 1761 RFC DRAFT October 2001 1763 If an optional non-transitive attribute is unrecognized, it is 1764 quietly ignored. If an optional transitive attribute is unrecognized, 1765 the Partial bit (the third high-order bit) in the attribute flags 1766 octet is set to 1, and the attribute is retained for propagation to 1767 other BGP speakers. 1769 If an optional attribute is recognized, and has a valid value, then, 1770 depending on the type of the optional attribute, it is processed 1771 locally, retained, and updated, if necessary, for possible 1772 propagation to other BGP speakers. 1774 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 1775 the previously advertised routes whose destinations (expressed as IP 1776 prefixes) contained in this field shall be removed from the Adj-RIB- 1777 In. This BGP speaker shall run its Decision Process since the 1778 previously advertised route is no longer available for use. 1780 If the UPDATE message contains a feasible route, it shall be placed 1781 in the appropriate Adj-RIB-In, and the following additional actions 1782 shall be taken: 1784 i) If its Network Layer Reachability Information (NLRI) is identical 1785 to the one of a route currently stored in the Adj-RIB-In, then the 1786 new route shall replace the older route in the Adj-RIB-In, thus 1787 implicitly withdrawing the older route from service. The BGP speaker 1788 shall run its Decision Process since the older route is no longer 1789 available for use. 1791 ii) If the new route is an overlapping route that is included (see 1792 9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP 1793 speaker shall run its Decision Process since the more specific route 1794 has implicitly made a portion of the less specific route unavailable 1795 for use. 1797 iii) If the new route has identical path attributes to an earlier 1798 route contained in the Adj-RIB-In, and is more specific (see 9.1.4) 1799 than the earlier route, no further actions are necessary. 1801 iv) If the new route has NLRI that is not present in any of the 1802 routes currently stored in the Adj-RIB-In, then the new route shall 1803 be placed in the Adj-RIB-In. The BGP speaker shall run its Decision 1804 Process. 1806 v) If the new route is an overlapping route that is less specific 1807 (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the 1808 BGP speaker shall run its Decision Process on the set of destinations 1809 described only by the less specific route. 1811 RFC DRAFT October 2001 1813 9.1 Decision Process 1815 The Decision Process selects routes for subsequent advertisement by 1816 applying the policies in the local Policy Information Base (PIB) to 1817 the routes stored in its Adj-RIBs-In. The output of the Decision 1818 Process is the set of routes that will be advertised to all peers; 1819 the selected routes will be stored in the local speaker's Adj-RIB- 1820 Out. 1822 The selection process is formalized by defining a function that takes 1823 the attribute of a given route as an argument and returns a non- 1824 negative integer denoting the degree of preference for the route. 1825 The function that calculates the degree of preference for a given 1826 route shall not use as its inputs any of the following: the existence 1827 of other routes, the non-existence of other routes, or the path 1828 attributes of other routes. Route selection then consists of 1829 individual application of the degree of preference function to each 1830 feasible route, followed by the choice of the one with the highest 1831 degree of preference. 1833 The Decision Process operates on routes contained in each Adj-RIB-In, 1834 and is responsible for: 1836 - selection of routes to be used locally by the speaker 1838 - selection of routes to be advertised to internal peers 1840 - selection of routes to be advertised to external peers 1842 - route aggregation and route information reduction 1844 The Decision Process takes place in three distinct phases, each 1845 triggered by a different event: 1847 a) Phase 1 is responsible for calculating the degree of preference 1848 for each route received from an external peer, and MAY also 1849 advertise to all the internal peers the routes from external peers 1850 that have the highest degree of preference for each distinct 1851 destination. 1853 b) Phase 2 is invoked on completion of phase 1. It is responsible 1854 for choosing the best route out of all those available for each 1855 distinct destination, and for installing each chosen route into 1856 the appropriate Loc-RIB. 1858 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 1859 responsible for disseminating routes in the Loc-RIB to each 1860 RFC DRAFT October 2001 1862 external peer, according to the policies contained in the PIB. 1863 Route aggregation and information reduction can optionally be 1864 performed within this phase. 1866 9.1.1 Phase 1: Calculation of Degree of Preference 1868 The Phase 1 decision function shall be invoked whenever the local BGP 1869 speaker receives from a peer an UPDATE message that advertises a new 1870 route, a replacement route, or withdrawn routes. 1872 The Phase 1 decision function is a separate process which completes 1873 when it has no further work to do. 1875 The Phase 1 decision function shall lock an Adj-RIB-In prior to 1876 operating on any route contained within it, and shall unlock it after 1877 operating on all new or unfeasible routes contained within it. 1879 For each newly received or replacement feasible route, the local BGP 1880 speaker shall determine a degree of preference. If the route is 1881 learned from an internal peer, either the value of the LOCAL_PREF 1882 attribute shall be taken as the degree of preference, or the local 1883 system may compute the degree of preference of the route based on 1884 preconfigured policy information. Note that the latter (computing the 1885 degree of preference based on preconfigured policy information) may 1886 result in formation of persistent routing loops. If the route is 1887 learned from an external peer, then the local BGP speaker computes 1888 the degree of preference based on preconfigured policy information 1889 and uses it as the LOCAL_PREF value in any IBGP readvertisement. The 1890 exact nature of this policy information and the computation involved 1891 is a local matter. For a route learned from an external peer, the 1892 local speaker shall then run the internal update process of 9.2.1 to 1893 select and advertise the most preferable route. 1895 9.1.2 Phase 2: Route Selection 1897 The Phase 2 decision function shall be invoked on completion of Phase 1898 1. The Phase 2 function is a separate process which completes when 1899 it has no further work to do. The Phase 2 process shall consider all 1900 routes that are present in the Adj-RIBs-In, including those received 1901 from both internal and external peers. 1903 The Phase 2 decision function shall be blocked from running while the 1904 Phase 3 decision function is in process. The Phase 2 function shall 1905 lock all Adj-RIBs-In prior to commencing its function, and shall 1906 RFC DRAFT October 2001 1908 unlock them on completion. 1910 If the NEXT_HOP attribute of a BGP route depicts an address that is 1911 not resolvable, or it would become unresolvable if the route was 1912 installed in the routing table the BGP route should be excluded from 1913 the Phase 2 decision function. 1915 It is critical that routers within an AS do not make conflicting 1916 decisions regarding route selection that would cause forwarding loops 1917 to occur. 1919 For each set of destinations for which a feasible route exists in the 1920 Adj-RIBs-In, the local BGP speaker shall identify the route that has: 1922 a) the highest degree of preference of any route to the same set 1923 of destinations, or 1925 b) is the only route to that destination, or 1927 c) is selected as a result of the Phase 2 tie breaking rules 1928 specified in 9.1.2.2. 1930 The local speaker SHALL then install that route in the Loc-RIB, 1931 replacing any route to the same destination that is currently being 1932 held in the Loc-RIB. If the new BGP route is installed in the Routing 1933 Table (as a result of the local policy decision), care must be taken 1934 to ensure that invalid BGP routes to the same destination are removed 1935 from the Routing Table. Whether or not the new route replaces an 1936 already existing non-BGP route in the routing table depends on the 1937 policy configured on the BGP speaker. 1939 The local speaker MUST determine the immediate next hop to the 1940 address depicted by the NEXT_HOP attribute of the selected route by 1941 performing a best matching route lookup in the Routing Table and 1942 selecting one of the possible paths (if multiple best paths to the 1943 same prefix are available). If the route to the address depicted by 1944 the NEXT_HOP attribute changes such that the immediate next hop or 1945 the IGP cost to the NEXT_HOP (if the NEXT_HOP is resolved through an 1946 IGP route) changes, route selection should be recalculated as 1947 specified above. 1949 Notice that even though BGP routes do not have to be installed in the 1950 Routing Table with the immediate next hop(s), implementations must 1951 take care that before any packets are forwarded along a BGP route, 1952 its associated NEXT_HOP address is resolved to the immediate 1953 (directly connected) next-hop address and this address (or multiple 1954 addresses) is finally used for actual packet forwarding. 1956 RFC DRAFT October 2001 1958 Unresolvable routes SHALL be removed from the Loc-RIB and the routing 1959 table. However, corresponding unresolvable routes SHOULD be kept in 1960 the Adj-RIBs-In. 1962 9.1.2.1 Route Resolvability Condition 1964 As indicated in Section 9.1.2, BGP routers should exclude 1965 unresolvable routes from the Phase 2 decision. This ensures that only 1966 valid routes are installed in Loc-RIB and the Routing Table. 1968 The route resolvability condition is defined as follows. 1970 1. A route Rte1, referencing only the intermediate network 1971 address, is considered resolvable if the Routing Table contains at 1972 least one resolvable route Rte2 that matches Rte1's intermediate 1973 network address and is not recursively resolved (directly or 1974 indirectly) through Rte1. If multiple matching routes are 1975 available, only the longest matching route should be considered. 1977 2. Routes referencing interfaces (with or without intermediate 1978 addresses) are considered resolvable if the state of the 1979 referenced interface is up and IP processing is enabled on this 1980 interface. 1982 BGP routes do not refer to interfaces, but can be resolved through 1983 the routes in the Routing Table that can be of both types. IGP routes 1984 and routes to directly connected networks are expected to specify the 1985 outbound interface. 1987 Note that a BGP route is considered unresolvable not only in 1988 situations where the router's Routing Table contains no route 1989 matching the BGP route's NEXT_HOP. Mutually recursive routes (routes 1990 resolving each other or themselves), also fail the resolvability 1991 check. 1993 It is also important that implementations do not consider feasible 1994 routes that would become unresolvable if they were installed in the 1995 Routing Table even if their NEXT_HOPs are resolvable using the 1996 current contents of the Routing Table. This check ensures that a BGP 1997 speaker does not install in the Routing Table routes that will be 1998 removed and not used by the speaker. Therefore, in addition to local 1999 Routing Table stability, this check also improves behavior of the 2000 protocol in the network. 2002 Whenever a BGP speaker identifies a route that fails the 2003 resolvability check because of mutual recursion, an error message 2004 RFC DRAFT October 2001 2006 should be logged. 2008 9.1.2.2 Breaking Ties (Phase 2) 2010 In its Adj-RIBs-In a BGP speaker may have several routes to the same 2011 destination that have the same degree of preference. The local 2012 speaker can select only one of these routes for inclusion in the 2013 associated Loc-RIB. The local speaker considers all routes with the 2014 same degrees of preference, both those received from internal peers, 2015 and those received from external peers. 2017 The following tie-breaking procedure assumes that for each candidate 2018 route all the BGP speakers within an autonomous system can ascertain 2019 the cost of a path (interior distance) to the address depicted by the 2020 NEXT_HOP attribute of the route, and follow the same route selection 2021 algorithm. 2023 The tie-breaking algorithm begins by considering all equally 2024 preferable routes to the same destination, and then selects routes to 2025 be removed from consideration. The algorithm terminates as soon as 2026 only one route remains in consideration. The criteria must be 2027 applied in the order specified. 2029 Several of the criteria are described using pseudo-code. Note that 2030 the pseudo-code shown was chosen for clarity, not efficiency. It is 2031 not intended to specify any particular implementation. BGP 2032 implementations MAY use any algorithm which produces the same results 2033 as those described here. 2035 a) Remove from consideration all routes which are not tied for 2036 having the smallest number of AS numbers present in their AS_PATH 2037 attributes. Note, that when counting this number, an AS_SET counts 2038 as 1, no matter how many ASs are in the set, and that, if the 2039 implementation supports [13], then AS numbers present in segments 2040 of type AS_CONFED_SEQUENCE or AS_CONFED_SET are not included in 2041 the count of AS numbers present in the AS_PATH. 2043 b) Remove from consideration all routes which are not tied for 2044 having the lowest Origin number in their Origin attribute. 2046 c) Remove from consideration routes with less-preferred 2047 MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable 2048 between routes learned from the same neighboring AS. Routes which 2049 do not have the MULTI_EXIT_DISC attribute are considered to have 2050 the lowest possible MULTI_EXIT_DISC value. 2052 RFC DRAFT October 2001 2054 This is also described in the following procedure: 2056 for m = all routes still under consideration 2057 for n = all routes still under consideration 2058 if (neighborAS(m) == neighborAS(n)) and (MED(n) < MED(m)) 2059 remove route m from consideration 2061 In the pseudo-code above, MED(n) is a function which returns the 2062 value of route n's MULTI_EXIT_DISC attribute. If route n has no 2063 MULTI_EXIT_DISC attribute, the function returns the lowest 2064 possible MULTI_EXIT_DISC value, i.e. 0. 2066 Similarly, neighborAS(n) is a function which returns the neighbor 2067 AS from which the route was received. 2069 d) If at least one of the candidate routes was received from an 2070 external peer in a neighboring autonomous system, remove from 2071 consideration all routes which were received from internal peers. 2073 e) Remove from consideration any routes with less-preferred 2074 interior cost. The interior cost of a route is determined by 2075 calculating the metric to the next hop for the route using the 2076 Routing Table. If the next hop for a route is reachable, but no 2077 cost can be determined, then this step should be skipped 2078 (equivalently, consider all routes to have equal costs). 2080 This is also described in the following procedure. 2082 for m = all routes still under consideration 2083 for n = all routes in still under consideration 2084 if (cost(n) is better than cost(m)) 2085 remove m from consideration 2087 In the pseudo-code above, cost(n) is a function which returns the 2088 cost of the path (interior distance) to the address given in the 2089 NEXT_HOP attribute of the route. 2091 f) Remove from consideration all routes other than the route that 2092 was advertised by the BGP speaker whose BGP Identifier has the 2093 lowest value. 2095 9.1.3 Phase 3: Route Dissemination 2097 The Phase 3 decision function shall be invoked on completion of Phase 2098 2, or when any of the following events occur: 2100 RFC DRAFT October 2001 2102 a) when routes in the Loc-RIB to local destinations have changed 2104 b) when locally generated routes learned by means outside of BGP 2105 have changed 2107 c) when a new BGP speaker - BGP speaker connection has been 2108 established 2110 The Phase 3 function is a separate process which completes when it 2111 has no further work to do. The Phase 3 Routing Decision function 2112 shall be blocked from running while the Phase 2 decision function is 2113 in process. 2115 All routes in the Loc-RIB shall be processed into a corresponding 2116 entry in the associated Adj-RIBs-Out. Route aggregation and 2117 information reduction techniques (see 9.2.4.1) may optionally be 2118 applied. 2120 When the updating of the Adj-RIBs-Out and the Routing Table is 2121 complete, the local BGP speaker shall run the external update process 2122 of 9.2.2. 2124 9.1.4 Overlapping Routes 2126 A BGP speaker may transmit routes with overlapping Network Layer 2127 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 2128 occurs when a set of destinations are identified in non-matching 2129 multiple routes. Since BGP encodes NLRI using IP prefixes, overlap 2130 will always exhibit subset relationships. A route describing a 2131 smaller set of destinations (a longer prefix) is said to be more 2132 specific than a route describing a larger set of destinations (a 2133 shorted prefix); similarly, a route describing a larger set of 2134 destinations (a shorter prefix) is said to be less specific than a 2135 route describing a smaller set of destinations (a longer prefix). 2137 The precedence relationship effectively decomposes less specific 2138 routes into two parts: 2140 - a set of destinations described only by the less specific route, 2141 and 2143 - a set of destinations described by the overlap of the less 2144 specific and the more specific routes 2146 When overlapping routes are present in the same Adj-RIB-In, the more 2147 RFC DRAFT October 2001 2149 specific route shall take precedence, in order from more specific to 2150 least specific. 2152 The set of destinations described by the overlap represents a portion 2153 of the less specific route that is feasible, but is not currently in 2154 use. If a more specific route is later withdrawn, the set of 2155 destinations described by the overlap will still be reachable using 2156 the less specific route. 2158 If a BGP speaker receives overlapping routes, the Decision Process 2159 MUST consider both routes based on the configured acceptance policy. 2160 If both a less and a more specific route are accepted, then the 2161 Decision Process MUST either install both the less and the more 2162 specific routes or it MUST aggregate the two routes and install the 2163 aggregated route, provided that both routes have the same value of 2164 the NEXT_HOP attribute. 2166 If a BGP speaker chooses to aggregate, then it MUST add 2167 ATOMIC_AGGREGATE attribute to the route. A route that carries 2168 ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the 2169 NLRI of this route can not be made more specific. Forwarding along 2170 such a route does not guarantee that IP packets will actually 2171 traverse only ASs listed in the AS_PATH attribute of the route. 2173 9.2 Update-Send Process 2175 The Update-Send process is responsible for advertising UPDATE 2176 messages to all peers. For example, it distributes the routes chosen 2177 by the Decision Process to other BGP speakers which may be located in 2178 either the same autonomous system or a neighboring autonomous system. 2179 Rules for information exchange between BGP speakers located in 2180 different autonomous systems are given in 9.2.2; rules for 2181 information exchange between BGP speakers located in the same 2182 autonomous system are given in 9.2.1. 2184 Distribution of routing information between a set of BGP speakers, 2185 all of which are located in the same autonomous system, is referred 2186 to as internal distribution. 2188 9.2.1 Internal Updates 2190 The Internal update process is concerned with the distribution of 2191 routing information to internal peers. 2193 RFC DRAFT October 2001 2195 When a BGP speaker receives an UPDATE message from an internal peer, 2196 the receiving BGP speaker shall not re-distribute the routing 2197 information contained in that UPDATE message to other internal peers, 2198 unless the speaker acts as a BGP Route Reflector [11]. 2200 When a BGP speaker receives a new route from an external peer, it 2201 MUST advertise that route to all other internal peers by means of an 2202 UPDATE message if this route will be installed in its Loc-RIB 2203 according to the route selection rules in 9.1.2. 2205 When a BGP speaker receives an UPDATE message with a non-empty 2206 WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all 2207 routes whose destinations were carried in this field (as IP 2208 prefixes). The speaker shall take the following additional steps: 2210 1) if the corresponding feasible route had not been previously 2211 advertised, then no further action is necessary 2213 2) if the corresponding feasible route had been previously 2214 advertised, then: 2216 i) If a new route for the same NLRI is selected for 2217 advertisement, then the BGP speaker shall advertise the 2218 replacement route 2220 ii) if a replacement route is not available for advertisement, 2221 then the BGP speaker shall include the destinations of the 2222 unfeasible route (in form of IP prefixes) in the WITHDRAWN 2223 ROUTES field of an UPDATE message, and shall send this message 2224 to each peer to whom it had previously advertised the 2225 corresponding feasible route. 2227 All feasible routes which are advertised shall be placed in the 2228 appropriate Adj-RIBs-Out, and all unfeasible routes which are 2229 advertised shall be removed from the Adj-RIBs-Out after the 2230 corresponding update messages have been sent. 2232 9.2.1.1 Breaking Ties (Internal Updates) 2234 If a local BGP speaker has connections to several external peers, 2235 there will be multiple Adj-RIBs-In associated with these peers. 2236 These Adj-RIBs-In might contain several equally preferable routes to 2237 the same destination, all of which were advertised by external peers. 2238 The local BGP speaker shall select one of these routes according to 2239 the following rules: 2241 RFC DRAFT October 2001 2243 a) If the candidate routes differ only in their NEXT_HOP and 2244 MULTI_EXIT_DISC attributes, and the local system is configured to 2245 take into account the MULTI_EXIT_DISC attribute, select the route 2246 that has the lowest value of the MULTI_EXIT_DISC attribute. A 2247 route with the MULTI_EXIT_DISC attribute shall be preferred to a 2248 route without the MULTI_EXIT_DISC attribute. 2250 b) If the local system can ascertain the cost of a path to the 2251 entity depicted by the NEXT_HOP attribute of the candidate route, 2252 select the route with the lowest cost. 2254 c) In all other cases, select the route that was advertised by the 2255 BGP speaker whose BGP Identifier has the lowest value. 2257 9.2.2 External Updates 2259 The external update process is concerned with the distribution of 2260 routing information to external peers. As part of Phase 3 route 2261 selection process, the BGP speaker has updated its Adj-RIBs-Out and 2262 its Routing Table. All newly installed routes and all newly 2263 unfeasible routes for which there is no replacement route shall be 2264 advertised to external peers by means of UPDATE message. 2266 Any routes in the Loc-RIB marked as unfeasible shall be removed. 2267 Changes to the reachable destinations within its own autonomous 2268 system shall also be advertised in an UPDATE message. 2270 9.2.3 Controlling Routing Traffic Overhead 2272 The BGP protocol constrains the amount of routing traffic (that is, 2273 UPDATE messages) in order to limit both the link bandwidth needed to 2274 advertise UPDATE messages and the processing power needed by the 2275 Decision Process to digest the information contained in the UPDATE 2276 messages. 2278 9.2.3.1 Frequency of Route Advertisement 2280 The parameter MinRouteAdvertisementInterval determines the minimum 2281 amount of time that must elapse between advertisement of routes to a 2282 particular destination from a single BGP speaker. This rate limiting 2283 procedure applies on a per-destination basis, although the value of 2284 MinRouteAdvertisementInterval is set on a per BGP peer basis. 2286 RFC DRAFT October 2001 2288 Two UPDATE messages sent from a single BGP speaker that advertise 2289 feasible routes to some common set of destinations received from 2290 external peers must be separated by at least 2291 MinRouteAdvertisementInterval. Clearly, this can only be achieved 2292 precisely by keeping a separate timer for each common set of 2293 destinations. This would be unwarranted overhead. Any technique which 2294 ensures that the interval between two UPDATE messages sent from a 2295 single BGP speaker that advertise feasible routes to some common set 2296 of destinations received from external peers will be at least 2297 MinRouteAdvertisementInterval, and will also ensure a constant upper 2298 bound on the interval is acceptable. 2300 Since fast convergence is needed within an autonomous system, this 2301 procedure does not apply for routes received from other internal 2302 peers. To avoid long-lived black holes, the procedure does not apply 2303 to the explicit withdrawal of unfeasible routes (that is, routes 2304 whose destinations (expressed as IP prefixes) are listed in the 2305 WITHDRAWN ROUTES field of an UPDATE message). 2307 This procedure does not limit the rate of route selection, but only 2308 the rate of route advertisement. If new routes are selected multiple 2309 times while awaiting the expiration of MinRouteAdvertisementInterval, 2310 the last route selected shall be advertised at the end of 2311 MinRouteAdvertisementInterval. 2313 9.2.3.2 Frequency of Route Origination 2315 The parameter MinASOriginationInterval determines the minimum amount 2316 of time that must elapse between successive advertisements of UPDATE 2317 messages that report changes within the advertising BGP speaker's own 2318 autonomous systems. 2320 9.2.3.3 Jitter 2322 To minimize the likelihood that the distribution of BGP messages by a 2323 given BGP speaker will contain peaks, jitter should be applied to the 2324 timers associated with MinASOriginationInterval, Keepalive, and 2325 MinRouteAdvertisementInterval. A given BGP speaker shall apply the 2326 same jitter to each of these quantities regardless of the 2327 destinations to which the updates are being sent; that is, jitter 2328 will not be applied on a "per peer" basis. 2330 The amount of jitter to be introduced shall be determined by 2331 multiplying the base value of the appropriate timer by a random 2332 RFC DRAFT October 2001 2334 factor which is uniformly distributed in the range from 0.75 to 1.0. 2336 9.2.4 Efficient Organization of Routing Information 2338 Having selected the routing information which it will advertise, a 2339 BGP speaker may avail itself of several methods to organize this 2340 information in an efficient manner. 2342 9.2.4.1 Information Reduction 2344 Information reduction may imply a reduction in granularity of policy 2345 control - after information is collapsed, the same policies will 2346 apply to all destinations and paths in the equivalence class. 2348 The Decision Process may optionally reduce the amount of information 2349 that it will place in the Adj-RIBs-Out by any of the following 2350 methods: 2352 a) Network Layer Reachability Information (NLRI): 2354 Destination IP addresses can be represented as IP address 2355 prefixes. In cases where there is a correspondence between the 2356 address structure and the systems under control of an autonomous 2357 system administrator, it will be possible to reduce the size of 2358 the NLRI carried in the UPDATE messages. 2360 b) AS_PATHs: 2362 AS path information can be represented as ordered AS_SEQUENCEs or 2363 unordered AS_SETs. AS_SETs are used in the route aggregation 2364 algorithm described in 9.2.4.2. They reduce the size of the 2365 AS_PATH information by listing each AS number only once, 2366 regardless of how many times it may have appeared in multiple 2367 AS_PATHs that were aggregated. 2369 An AS_SET implies that the destinations listed in the NLRI can be 2370 reached through paths that traverse at least some of the 2371 constituent autonomous systems. AS_SETs provide sufficient 2372 information to avoid routing information looping; however their 2373 use may prune potentially feasible paths, since such paths are no 2374 longer listed individually as in the form of AS_SEQUENCEs. In 2375 practice this is not likely to be a problem, since once an IP 2376 packet arrives at the edge of a group of autonomous systems, the 2377 BGP speaker at that point is likely to have more detailed path 2378 RFC DRAFT October 2001 2380 information and can distinguish individual paths to destinations. 2382 9.2.4.2 Aggregating Routing Information 2384 Aggregation is the process of combining the characteristics of 2385 several different routes in such a way that a single route can be 2386 advertised. Aggregation can occur as part of the decision process to 2387 reduce the amount of routing information that will be placed in the 2388 Adj-RIBs-Out. 2390 Aggregation reduces the amount of information that a BGP speaker must 2391 store and exchange with other BGP speakers. Routes can be aggregated 2392 by applying the following procedure separately to path attributes of 2393 like type and to the Network Layer Reachability Information. 2395 Routes that have the following attributes shall not be aggregated 2396 unless the corresponding attributes of each route are identical: 2397 MULTI_EXIT_DISC, NEXT_HOP. 2399 If the aggregation occurs as part of the update process, routes with 2400 different NEXT_HOP values can be aggregated when announced through an 2401 external BGP session. 2403 Path attributes that have different type codes can not be aggregated 2404 together. Path attributes of the same type code may be aggregated, 2405 according to the following rules: 2407 ORIGIN attribute: If at least one route among routes that are 2408 aggregated has ORIGIN with the value INCOMPLETE, then the 2409 aggregated route must have the ORIGIN attribute with the value 2410 INCOMPLETE. Otherwise, if at least one route among routes that are 2411 aggregated has ORIGIN with the value EGP, then the aggregated 2412 route must have the origin attribute with the value EGP. In all 2413 other case the value of the ORIGIN attribute of the aggregated 2414 route is INTERNAL. 2416 AS_PATH attribute: If routes to be aggregated have identical 2417 AS_PATH attributes, then the aggregated route has the same AS_PATH 2418 attribute as each individual route. 2420 For the purpose of aggregating AS_PATH attributes we model each AS 2421 within the AS_PATH attribute as a tuple , where 2422 "type" identifies a type of the path segment the AS belongs to 2423 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If the 2424 routes to be aggregated have different AS_PATH attributes, then 2425 the aggregated AS_PATH attribute shall satisfy all of the 2426 RFC DRAFT October 2001 2428 following conditions: 2430 - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH 2431 shall appear in all of the AS_PATH in the initial set of routes 2432 to be aggregated. 2434 - all tuples of the type AS_SET in the aggregated AS_PATH shall 2435 appear in at least one of the AS_PATH in the initial set (they 2436 may appear as either AS_SET or AS_SEQUENCE types). 2438 - for any tuple X of the type AS_SEQUENCE in the aggregated 2439 AS_PATH which precedes tuple Y in the aggregated AS_PATH, X 2440 precedes Y in each AS_PATH in the initial set which contains Y, 2441 regardless of the type of Y. 2443 - No tuple with the same value shall appear more than once in 2444 the aggregated AS_PATH, regardless of the tuple's type. 2446 An implementation may choose any algorithm which conforms to these 2447 rules. At a minimum a conformant implementation shall be able to 2448 perform the following algorithm that meets all of the above 2449 conditions: 2451 - determine the longest leading sequence of tuples (as defined 2452 above) common to all the AS_PATH attributes of the routes to be 2453 aggregated. Make this sequence the leading sequence of the 2454 aggregated AS_PATH attribute. 2456 - set the type of the rest of the tuples from the AS_PATH 2457 attributes of the routes to be aggregated to AS_SET, and append 2458 them to the aggregated AS_PATH attribute. 2460 - if the aggregated AS_PATH has more than one tuple with the 2461 same value (regardless of tuple's type), eliminate all, but one 2462 such tuple by deleting tuples of the type AS_SET from the 2463 aggregated AS_PATH attribute. 2465 Appendix 6, section 6.8 presents another algorithm that satisfies 2466 the conditions and allows for more complex policy configurations. 2468 ATOMIC_AGGREGATE: If at least one of the routes to be aggregated 2469 has ATOMIC_AGGREGATE path attribute, then the aggregated route 2470 shall have this attribute as well. 2472 AGGREGATOR: All AGGREGATOR attributes of all routes to be 2473 aggregated should be ignored. The BGP speaker performing the route 2474 aggregation may attach a new AGGREGATOR attribute (see Section 2475 5.1.7). 2477 RFC DRAFT October 2001 2479 9.3 Route Selection Criteria 2481 Generally speaking, additional rules for comparing routes among 2482 several alternatives are outside the scope of this document. There 2483 are two exceptions: 2485 - If the local AS appears in the AS path of the new route being 2486 considered, then that new route cannot be viewed as better than 2487 any other route (provided that the speaker is configured to accept 2488 such routes). If such a route were ever used, a routing loop could 2489 result (see Section 6.3). 2491 - In order to achieve successful distributed operation, only 2492 routes with a likelihood of stability can be chosen. Thus, an AS 2493 must avoid using unstable routes, and it must not make rapid 2494 spontaneous changes to its choice of route. Quantifying the terms 2495 "unstable" and "rapid" in the previous sentence will require 2496 experience, but the principle is clear. 2498 Care must be taken to ensure that BGP speakers in the same AS do 2499 not make inconsistent decisions. 2501 9.4 Originating BGP routes 2503 A BGP speaker may originate BGP routes by injecting routing 2504 information acquired by some other means (e.g. via an IGP) into BGP. 2505 A BGP speaker that originates BGP routes shall assign the degree of 2506 preference to these routes by passing them through the Decision 2507 Process (see Section 9.1). These routes may also be distributed to 2508 other BGP speakers within the local AS as part of the Internal update 2509 process (see Section 9.2.1). The decision whether to distribute non- 2510 BGP acquired routes within an AS via BGP or not depends on the 2511 environment within the AS (e.g. type of IGP) and should be controlled 2512 via configuration. 2514 Appendix 1. Comparison with RFC1771 2516 There are numerous editorial changes (too many to list here). 2518 The following list the technical changes: 2520 RFC DRAFT October 2001 2522 Changes to reflect the usages of such features as TCP MD5 [10], 2523 BGP Route Reflectors [11], BGP Confederations [13], and BGP Route 2524 Refresh [12]. 2526 Clarification on the use of the BGP Identifier in the AGGREGATOR 2527 attribute. 2529 Procedures for imposing an upper bound on the number of prefixes 2530 that a BGP speaker would accept from a peer. 2532 The ability of a BGP speaker to include more than one instance of 2533 its own AS in the AS_PATH attribute for the purpose of inter-AS 2534 traffic engineering. 2536 Clarifications on the various types of NEXT_HOPs. 2538 Clarifications to the use of the ATOMIC_AGGREGATE attribute. 2540 The relationship between the immediate next hop, and the next hop 2541 as specified in the NEXT_HOP path attribute. 2543 Clarifications on the tie-breaking procedures. 2545 Appendix 2. Comparison with RFC1267 2547 All the changes listed in Appendix 1, plus the following. 2549 BGP-4 is capable of operating in an environment where a set of 2550 reachable destinations may be expressed via a single IP prefix. The 2551 concept of network classes, or subnetting is foreign to BGP-4. To 2552 accommodate these capabilities BGP-4 changes semantics and encoding 2553 associated with the AS_PATH attribute. New text has been added to 2554 define semantics associated with IP prefixes. These abilities allow 2555 BGP-4 to support the proposed supernetting scheme [9]. 2557 To simplify configuration this version introduces a new attribute, 2558 LOCAL_PREF, that facilitates route selection procedures. 2560 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 2561 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 2562 certain aggregates are not de-aggregated. Another new attribute, 2563 AGGREGATOR, can be added to aggregate routes in order to advertise 2564 which AS and which BGP speaker within that AS caused the aggregation. 2566 To insure that Hold Timers are symmetric, the Hold Time is now 2567 negotiated on a per-connection basis. Hold Times of zero are now 2568 RFC DRAFT October 2001 2570 supported. 2572 Appendix 3. Comparison with RFC 1163 2574 All of the changes listed in Appendices 1 and 2, plus the following. 2576 To detect and recover from BGP connection collision, a new field (BGP 2577 Identifier) has been added to the OPEN message. New text (Section 2578 6.8) has been added to specify the procedure for detecting and 2579 recovering from collision. 2581 The new document no longer restricts the border router that is passed 2582 in the NEXT_HOP path attribute to be part of the same Autonomous 2583 System as the BGP Speaker. 2585 New document optimizes and simplifies the exchange of the information 2586 about previously reachable routes. 2588 Appendix 4. Comparison with RFC 1105 2590 All of the changes listed in Appendices 1, 2 and 3, plus the 2591 following. 2593 Minor changes to the RFC1105 Finite State Machine were necessary to 2594 accommodate the TCP user interface provided by 4.3 BSD. 2596 The notion of Up/Down/Horizontal relations present in RFC1105 has 2597 been removed from the protocol. 2599 The changes in the message format from RFC1105 are as follows: 2601 1. The Hold Time field has been removed from the BGP header and 2602 added to the OPEN message. 2604 2. The version field has been removed from the BGP header and 2605 added to the OPEN message. 2607 3. The Link Type field has been removed from the OPEN message. 2609 4. The OPEN CONFIRM message has been eliminated and replaced with 2610 implicit confirmation provided by the KEEPALIVE message. 2612 5. The format of the UPDATE message has been changed 2613 significantly. New fields were added to the UPDATE message to 2614 support multiple path attributes. 2616 RFC DRAFT October 2001 2618 6. The Marker field has been expanded and its role broadened to 2619 support authentication. 2621 Note that quite often BGP, as specified in RFC 1105, is referred 2622 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 2623 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 2624 BGP, as specified in this document is referred to as BGP-4. 2626 Appendix 5. TCP options that may be used with BGP 2628 If a local system TCP user interface supports TCP PUSH function, then 2629 each BGP message should be transmitted with PUSH flag set. Setting 2630 PUSH flag forces BGP messages to be transmitted promptly to the 2631 receiver. 2633 If a local system TCP user interface supports setting precedence for 2634 TCP connection, then the BGP transport connection should be opened 2635 with precedence set to Internetwork Control (110) value (see also 2636 [6]). 2638 Appendix 6. Implementation Recommendations 2640 This section presents some implementation recommendations. 2642 6.1 Multiple Networks Per Message 2644 The BGP protocol allows for multiple address prefixes with the same 2645 path attributes to be specified in one message. Making use of this 2646 capability is highly recommended. With one address prefix per message 2647 there is a substantial increase in overhead in the receiver. Not only 2648 does the system overhead increase due to the reception of multiple 2649 messages, but the overhead of scanning the routing table for updates 2650 to BGP peers and other routing protocols (and sending the associated 2651 messages) is incurred multiple times as well. 2653 One method of building messages containing many address prefixes per 2654 a path attribute set from a routing table that is not organized on a 2655 per path attribute set basis is to build many messages as the routing 2656 table is scanned. As each address prefix is processed, a message for 2657 the associated set of path attributes is allocated, if it does not 2658 exist, and the new address prefix is added to it. If such a message 2659 RFC DRAFT October 2001 2661 exists, the new address prefix is just appended to it. If the message 2662 lacks the space to hold the new address prefix, it is transmitted, a 2663 new message is allocated, and the new address prefix is inserted into 2664 the new message. When the entire routing table has been scanned, all 2665 allocated messages are sent and their resources released. Maximum 2666 compression is achieved when all the destinations covered by the 2667 address prefixes share a common set of path attributes making it 2668 possible to send many address prefixes in one 4096-byte message. 2670 When peering with a BGP implementation that does not compress 2671 multiple address prefixes into one message, it may be necessary to 2672 take steps to reduce the overhead from the flood of data received 2673 when a peer is acquired or a significant network topology change 2674 occurs. One method of doing this is to limit the rate of updates. 2675 This will eliminate the redundant scanning of the routing table to 2676 provide flash updates for BGP peers and other routing protocols. A 2677 disadvantage of this approach is that it increases the propagation 2678 latency of routing information. By choosing a minimum flash update 2679 interval that is not much greater than the time it takes to process 2680 the multiple messages this latency should be minimized. A better 2681 method would be to read all received messages before sending updates. 2683 6.2 Processing Messages on a Stream Protocol 2685 BGP uses TCP as a transport mechanism. Due to the stream nature of 2686 TCP, all the data for received messages does not necessarily arrive 2687 at the same time. This can make it difficult to process the data as 2688 messages, especially on systems such as BSD Unix where it is not 2689 possible to determine how much data has been received but not yet 2690 processed. 2692 One method that can be used in this situation is to first try to read 2693 just the message header. For the KEEPALIVE message type, this is a 2694 complete message; for other message types, the header should first be 2695 verified, in particular the total length. If all checks are 2696 successful, the specified length, minus the size of the message 2697 header is the amount of data left to read. An implementation that 2698 would "hang" the routing information process while trying to read 2699 from a peer could set up a message buffer (4096 bytes) per peer and 2700 fill it with data as available until a complete message has been 2701 received. 2703 RFC DRAFT October 2001 2705 6.3 Reducing route flapping 2707 To avoid excessive route flapping a BGP speaker which needs to 2708 withdraw a destination and send an update about a more specific or 2709 less specific route SHOULD combine them into the same UPDATE message. 2711 6.4 BGP Timers 2713 BGP employs five timers: ConnectRetry, Hold Time, KeepAlive, 2714 MinASOriginationInterval, and MinRouteAdvertisementInterval The 2715 suggested value for the ConnectRetry timer is 120 seconds. The 2716 suggested value for the Hold Time is 90 seconds. The suggested value 2717 for the KeepAlive timer is 30 seconds. The suggested value for the 2718 MinASOriginationInterval is 15 seconds. The suggested value for the 2719 MinRouteAdvertisementInterval is 30 seconds. 2721 An implementation of BGP MUST allow these timers to be configurable. 2723 6.5 Path attribute ordering 2725 Implementations which combine update messages as described above in 2726 6.1 may prefer to see all path attributes presented in a known order. 2727 This permits them to quickly identify sets of attributes from 2728 different update messages which are semantically identical. To 2729 facilitate this, it is a useful optimization to order the path 2730 attributes according to type code. This optimization is entirely 2731 optional. 2733 6.6 AS_SET sorting 2735 Another useful optimization that can be done to simplify this 2736 situation is to sort the AS numbers found in an AS_SET. This 2737 optimization is entirely optional. 2739 6.7 Control over version negotiation 2741 Since BGP-4 is capable of carrying aggregated routes which cannot be 2742 properly represented in BGP-3, an implementation which supports BGP-4 2743 and another BGP version should provide the capability to only speak 2744 RFC DRAFT October 2001 2746 BGP-4 on a per-peer basis. 2748 6.8 Complex AS_PATH aggregation 2750 An implementation which chooses to provide a path aggregation 2751 algorithm which retains significant amounts of path information may 2752 wish to use the following procedure: 2754 For the purpose of aggregating AS_PATH attributes of two routes, 2755 we model each AS as a tuple , where "type" identifies 2756 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 2757 AS_SET), and "value" is the AS number. Two ASs are said to be the 2758 same if their corresponding tuples are the same. 2760 The algorithm to aggregate two AS_PATH attributes works as 2761 follows: 2763 a) Identify the same ASs (as defined above) within each AS_PATH 2764 attribute that are in the same relative order within both 2765 AS_PATH attributes. Two ASs, X and Y, are said to be in the 2766 same order if either: 2767 - X precedes Y in both AS_PATH attributes, or - Y precedes X 2768 in both AS_PATH attributes. 2770 b) The aggregated AS_PATH attribute consists of ASs identified 2771 in (a) in exactly the same order as they appear in the AS_PATH 2772 attributes to be aggregated. If two consecutive ASs identified 2773 in (a) do not immediately follow each other in both of the 2774 AS_PATH attributes to be aggregated, then the intervening ASs 2775 (ASs that are between the two consecutive ASs that are the 2776 same) in both attributes are combined into an AS_SET path 2777 segment that consists of the intervening ASs from both AS_PATH 2778 attributes; this segment is then placed in between the two 2779 consecutive ASs identified in (a) of the aggregated attribute. 2780 If two consecutive ASs identified in (a) immediately follow 2781 each other in one attribute, but do not follow in another, then 2782 the intervening ASs of the latter are combined into an AS_SET 2783 path segment; this segment is then placed in between the two 2784 consecutive ASs identified in (a) of the aggregated attribute. 2786 If as a result of the above procedure a given AS number appears 2787 more than once within the aggregated AS_PATH attribute, all, but 2788 the last instance (rightmost occurrence) of that AS number should 2789 be removed from the aggregated AS_PATH attribute. 2791 RFC DRAFT October 2001 2793 Security Considerations 2795 BGP supports the ability to authenticate BGP messages by using BGP 2796 authentication. The authentication could be done on a per peer basis. 2797 In addition, BGP supports the ability to authenticate its data stream 2798 by using [10]. This authentication could be done on a per peer basis. 2799 Finally, BGP could also use IPSec to authenticate its data stream. 2800 Among the mechanisms mentioned in this paragraph, [10] is the most 2801 widely deployed. 2803 References 2805 [1] Mills, D., "Exterior Gateway Protocol Formal Specification", 2806 RFC904, April 1984. 2808 [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET 2809 Backbone", RFC1092, February 1989. 2811 [3] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, February 2812 1989. 2814 [4] Postel, J., "Transmission Control Protocol - DARPA Internet 2815 Program Protocol Specification", RFC793, September 1981. 2817 [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway 2818 Protocol in the Internet", RFC1772, March 1995. 2820 [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol 2821 Specification", RFC791, September 1981. 2823 [7] "Information Processing Systems - Telecommunications and 2824 Information Exchange between Systems - Protocol for Exchange of 2825 Inter-domain Routeing Information among Intermediate Systems to 2826 Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 2828 [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter- 2829 Domain Routing (CIDR): an Address Assignment and Aggregation 2830 Strategy", RFC1519, September 1993. 2832 [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation 2833 with CIDR", RFC 1518, September 1993. 2835 [10] Heffernan, A., "Protection of BGP Sessions via the TCP MD5 2836 Signature Option", RFC2385, August 1998. 2838 RFC DRAFT October 2001 2840 [11] Bates, T., Chandra, R., Chen, E., "BGP Route Reflection - An 2841 Alternative to Full Mesh IBGP", RFC2796, April 2000. 2843 [12] Chen, E., "Route Refresh Capability for BGP-4", RFC2918, 2844 September 2000. 2846 [13] Traina, P, McPherson, D., Scudder, J., "Autonomous System 2847 Confederations for BGP", RFC3065, February 2001. 2849 Editors' Addresses 2851 Yakov Rekhter 2852 Juniper Networks 2853 1194 N. Mathilda Avenue 2854 Sunnyvale, CA 94089 2855 email: yakov@juniper.net 2857 Tony Li 2858 Procket Networks 2859 1100 Cadillac Ct. 2860 Milpitas, CA 95035 2861 Email: tli@procket.com