idnits 2.17.1 draft-ietf-idr-bgp4-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document is more than 15 pages and seems to lack a Table of Contents. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 59 longer pages, the longest (page 2) being 61 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Abstract section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 6 instances of too long lines in the document, the longest one being 5 characters in excess of 72. == There are 3 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 387: '...sage, a BGP speaker MUST calculate the...' RFC 2119 keyword, line 390: '... Hold Time MUST be either zero o...' RFC 2119 keyword, line 786: '... MUST NOT be sent more frequently th...' RFC 2119 keyword, line 787: '... implementation MAY adjust the rate a...' RFC 2119 keyword, line 791: '... messages MUST NOT be sent....' (29 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 724 has weird spacing: '... Length are t...' == Line 1166 has weird spacing: '...is less than...' == Line 1660 has weird spacing: '...s whose desti...' == Line 1732 has weird spacing: '...tise to all t...' == Line 2041 has weird spacing: '...nations of th...' == (3 more instances...) -- 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') Summary: 14 errors (**), 0 flaws (~~), 9 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Network Working Group Y. Rekhter 2 INTERNET DRAFT cisco Systems 3 T. Li 4 Procket Networks, Inc. 5 Editors 7 A Border Gateway Protocol 4 (BGP-4) 8 10 Status of this Memo 12 This document is an Internet-Draft and is in full conformance with 13 all provisions of Section 10 of RFC2026. 15 Internet-Drafts are working documents of the Internet Engineering 16 Task Force (IETF), its areas, and its working groups. Note that 17 other groups may also distribute working documents as Internet- 18 Drafts. 20 Internet-Drafts are draft documents valid for a maximum of six months 21 and may be updated, replaced, or obsoleted by other documents at any 22 time. It is inappropriate to use Internet-Drafts as reference 23 material or to cite them other than as ``work in progress.'' 25 The list of current Internet-Drafts can be accessed at 26 http://www.ietf.org/ietf/1id-abstracts.txt 28 The list of Internet-Draft Shadow Directories can be accessed at 29 http://www.ietf.org/shadow.html. 31 1. Acknowledgments 33 This document was originally published as RFC 1267 in October 1991, 34 jointly authored by Kirk Lougheed and Yakov Rekhter. 36 We would like to express our thanks to Guy Almes, Len Bosack, and 37 Jeffrey C. Honig for their contributions to the earlier version of 38 this document. 40 We like to explicitly thank Bob Braden for the review of the earlier 41 version of this document as well as his constructive and valuable 42 comments. 44 RFC DRAFT April 2000 46 We would also like to thank Bob Hinden, Director for Routing of the 47 Internet Engineering Steering Group, and the team of reviewers he 48 assembled to review the previous version (BGP-2) of this document. 49 This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia 50 Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted 51 with a strong combination of toughness, professionalism, and 52 courtesy. 54 This updated version of the document is the product of the IETF IDR 55 Working Group with Yakov Rekhter and Tony Li as editors. Certain 56 sections of the document borrowed heavily from IDRP [7], which is the 57 OSI counterpart of BGP. For this credit should be given to the ANSI 58 X3S3.3 group chaired by Lyman Chapin and to Charles Kunzinger who was 59 the IDRP editor within that group. We would also like to thank Mike 60 Craren, Dimitry Haskin, John Krawczyk, David LeRoy, John Scudder, 61 John Stewart III, Dave Thaler, Paul Traina, and Curtis Villamizar for 62 their comments. 64 We would like to specially acknowledge numerous contributions by 65 Dennis Ferguson. 67 2. Introduction 69 The Border Gateway Protocol (BGP) is an inter-Autonomous System 70 routing protocol. It is built on experience gained with EGP as 71 defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as 72 described in RFC 1092 [2] and RFC 1093 [3]. 74 The primary function of a BGP speaking system is to exchange network 75 reachability information with other BGP systems. This network 76 reachability information includes information on the list of 77 Autonomous Systems (ASs) that reachability information traverses. 78 This information is sufficient to construct a graph of AS 79 connectivity from which routing loops may be pruned and some policy 80 decisions at the AS level may be enforced. 82 BGP-4 provides a new set of mechanisms for supporting classless 83 interdomain routing. These mechanisms include support for 84 advertising an IP prefix and eliminates the concept of network 85 "class" within BGP. BGP-4 also introduces mechanisms which allow 86 aggregation of routes, including aggregation of AS paths. These 87 changes provide support for the proposed supernetting scheme [8, 9]. 89 To characterize the set of policy decisions that can be enforced 90 using BGP, one must focus on the rule that a BGP speaker advertise to 91 its peers (other BGP speakers which it communicates with) in 92 neighboring ASs only those routes that it itself uses. This rule 93 RFC DRAFT April 2000 95 reflects the "hop-by-hop" routing paradigm generally used throughout 96 the current Internet. Note that some policies cannot be supported by 97 the "hop-by-hop" routing paradigm and thus require techniques such as 98 source routing to enforce. For example, BGP does not enable one AS 99 to send traffic to a neighboring AS intending that the traffic take a 100 different route from that taken by traffic originating in the 101 neighboring AS. On the other hand, BGP can support any policy 102 conforming to the "hop-by-hop" routing paradigm. Since the current 103 Internet uses only the "hop-by-hop" routing paradigm and since BGP 104 can support any policy that conforms to that paradigm, BGP is highly 105 applicable as an inter-AS routing protocol for the current Internet. 107 A more complete discussion of what policies can and cannot be 108 enforced with BGP is outside the scope of this document (but refer to 109 the companion document discussing BGP usage [5]). 111 BGP runs over a reliable transport protocol. This eliminates the 112 need to implement explicit update fragmentation, retransmission, 113 acknowledgment, and sequencing. Any authentication scheme used by 114 the transport protocol may be used in addition to BGP's own 115 authentication mechanisms. The error notification mechanism used in 116 BGP assumes that the transport protocol supports a "graceful" close, 117 i.e., that all outstanding data will be delivered before the 118 connection is closed. 120 BGP uses TCP [4] as its transport protocol. TCP meets BGP's 121 transport requirements and is present in virtually all commercial 122 routers and hosts. In the following descriptions the phrase 123 "transport protocol connection" can be understood to refer to a TCP 124 connection. BGP uses TCP port 179 for establishing its connections. 126 This document uses the term `Autonomous System' (AS) throughout. The 127 classic definition of an Autonomous System is a set of routers under 128 a single technical administration, using an interior gateway protocol 129 and common metrics to route packets within the AS, and using an 130 exterior gateway protocol to route packets to other ASs. Since this 131 classic definition was developed, it has become common for a single 132 AS to use several interior gateway protocols and sometimes several 133 sets of metrics within an AS. The use of the term Autonomous System 134 here stresses the fact that, even when multiple IGPs and metrics are 135 used, the administration of an AS appears to other ASs to have a 136 single coherent interior routing plan and presents a consistent 137 picture of what destinations are reachable through it. 139 The planned use of BGP in the Internet environment, including such 140 issues as topology, the interaction between BGP and IGPs, and the 141 enforcement of routing policy rules is presented in a companion 142 document [5]. This document is the first of a series of documents 143 RFC DRAFT April 2000 145 planned to explore various aspects of BGP application. Please send 146 comments to the BGP mailing list (bgp@ans.net). 148 3. Summary of Operation 150 Two systems form a transport protocol connection between one another. 151 They exchange messages to open and confirm the connection parameters. 152 The initial data flow is the entire BGP routing table. Incremental 153 updates are sent as the routing tables change. BGP does not require 154 periodic refresh of the entire BGP routing table. Therefore, a BGP 155 speaker must retain the current version of the entire BGP routing 156 tables of all of its peers for the duration of the connection. 157 KEEPALIVE messages are sent periodically to ensure the liveness of 158 the connection. NOTIFICATION messages are sent in response to errors 159 or special conditions. If a connection encounters an error 160 condition, a NOTIFICATION message is sent and the connection is 161 closed. 163 The hosts executing the Border Gateway Protocol need not be routers. 164 A non-routing host could exchange routing information with routers 165 via EGP or even an interior routing protocol. That non-routing host 166 could then use BGP to exchange routing information with a border 167 router in another Autonomous System. The implications and 168 applications of this architecture are for further study. 170 Connections between BGP speakers of different ASs are referred to as 171 "external" links. BGP connections between BGP speakers within the 172 same AS are referred to as "internal" links. Similarly, a peer in a 173 different AS is referred to as an external peer, while a peer in the 174 same AS may be described as an internal peer. Internal BGP and 175 external BGP are commonly abbreviated IBGP and EBGP. 177 If a particular AS has multiple BGP speakers and is providing transit 178 service for other ASs, then care must be taken to ensure a consistent 179 view of routing within the AS. A consistent view of the interior 180 routes of the AS is provided by the interior routing protocol. A 181 consistent view of the routes exterior to the AS can be provided by 182 having all BGP speakers within the AS maintain direct IBGP 183 connections with each other. Alternately the interior routing 184 protocol can pass BGP information among routers within an AS, taking 185 care not to lose BGP attributes that will be needed by EBGP speakers 186 if transit connectivity is being provided. For the purpose of 187 discussion, it is assumed that BGP information is passed within an AS 188 using IBGP. Care must be taken to ensure that the interior routers 189 have all been updated with transit information before the EBGP 190 speakers announce to other ASs that transit service is being 191 provided. 193 RFC DRAFT April 2000 195 3.1 Routes: Advertisement and Storage 197 For purposes of this protocol a route is defined as a unit of 198 information that pairs a destination with the attributes of a path to 199 that destination: 201 - Routes are advertised between a pair of BGP speakers in UPDATE 202 messages: the destination is the systems whose IP addresses are 203 reported in the Network Layer Reachability Information (NLRI) 204 field, and the the path is the information reported in the path 205 attributes fields of the same UPDATE message. 207 - Routes are stored in the Routing Information Bases (RIBs): 208 namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes 209 that will be advertised to other BGP speakers must be present in 210 the Adj-RIB-Out; routes that will be used by the local BGP speaker 211 must be present in the Loc-RIB, and the next hop for each of these 212 routes must be present in the local BGP speaker's forwarding 213 information base; and routes that are received from other BGP 214 speakers are present in the Adj-RIBs-In. 216 If a BGP speaker chooses to advertise the route, it may add to or 217 modify the path attributes of the route before advertising it to a 218 peer. 220 BGP provides mechanisms by which a BGP speaker can inform its peer 221 that a previously advertised route is no longer available for use. 222 There are three methods by which a given BGP speaker can indicate 223 that a route has been withdrawn from service: 225 a) the IP prefix that expresses destinations for a previously 226 advertised route can be advertised in the WITHDRAWN ROUTES field 227 in the UPDATE message, thus marking the associated route as being 228 no longer available for use 230 b) a replacement route with the same Network Layer Reachability 231 Information can be advertised, or 233 c) the BGP speaker - BGP speaker connection can be closed, which 234 implicitly removes from service all routes which the pair of 235 speakers had advertised to each other. 237 RFC DRAFT April 2000 239 3.2 Routing Information Bases 241 The Routing Information Base (RIB) within a BGP speaker consists of 242 three distinct parts: 244 a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has 245 been learned from inbound UPDATE messages. Their contents 246 represent routes that are available as an input to the Decision 247 Process. 249 b) Loc-RIB: The Loc-RIB contains the local routing information 250 that the BGP speaker has selected by applying its local policies 251 to the routing information contained in its Adj-RIBs-In. 253 c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the 254 local BGP speaker has selected for advertisement to its peers. The 255 routing information stored in the Adj-RIBs-Out will be carried in 256 the local BGP speaker's UPDATE messages and advertised to its 257 peers. 259 In summary, the Adj-RIBs-In contain unprocessed routing information 260 that has been advertised to the local BGP speaker by its peers; the 261 Loc-RIB contains the routes that have been selected by the local BGP 262 speaker's Decision Process; and the Adj-RIBs-Out organize the routes 263 for advertisement to specific peers by means of the local speaker's 264 UPDATE messages. 266 Although the conceptual model distinguishes between Adj-RIBs-In, 267 Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an 268 implementation must maintain three separate copies of the routing 269 information. The choice of implementation (for example, 3 copies of 270 the information vs 1 copy with pointers) is not constrained by the 271 protocol. 273 4. Message Formats 275 This section describes message formats used by BGP. 277 Messages are sent over a reliable transport protocol connection. A 278 message is processed only after it is entirely received. The maximum 279 message size is 4096 octets. All implementations are required to 280 support this maximum message size. The smallest message that may be 281 sent consists of a BGP header without a data portion, or 19 octets. 283 RFC DRAFT April 2000 285 4.1 Message Header Format 287 Each message has a fixed-size header. There may or may not be a data 288 portion following the header, depending on the message type. The 289 layout of these fields is shown below: 291 0 1 2 3 292 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 293 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 294 | | 295 + + 296 | | 297 + + 298 | Marker | 299 + + 300 | | 301 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 302 | Length | Type | 303 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 305 Marker: 307 This 16-octet field contains a value that the receiver of the 308 message can predict. If the Type of the message is OPEN, or if 309 the OPEN message carries no Authentication Information (as an 310 Optional Parameter), then the Marker must be all ones. 311 Otherwise, the value of the marker can be predicted by some a 312 computation specified as part of the authentication mechanism 313 (which is specified as part of the Authentication Information) 314 used. The Marker can be used to detect loss of synchronization 315 between a pair of BGP peers, and to authenticate incoming BGP 316 messages. 318 Length: 320 This 2-octet unsigned integer indicates the total length of the 321 message, including the header, in octets. Thus, e.g., it 322 allows one to locate in the transport-level stream the (Marker 323 field of the) next message. The value of the Length field must 324 RFC DRAFT April 2000 326 always be at least 19 and no greater than 4096, and may be 327 further constrained, depending on the message type. No 328 "padding" of extra data after the message is allowed, so the 329 Length field must have the smallest value required given the 330 rest of the message. 332 Type: 334 This 1-octet unsigned integer indicates the type code of the 335 message. The following type codes are defined: 337 1 - OPEN 338 2 - UPDATE 339 3 - NOTIFICATION 340 4 - KEEPALIVE 342 4.2 OPEN Message Format 344 After a transport protocol connection is established, the first 345 message sent by each side is an OPEN message. If the OPEN message is 346 acceptable, a KEEPALIVE message confirming the OPEN is sent back. 347 Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION 348 messages may be exchanged. 350 In addition to the fixed-size BGP header, the OPEN message contains 351 the following fields: 353 0 1 2 3 354 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 355 +-+-+-+-+-+-+-+-+ 356 | Version | 357 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 358 | My Autonomous System | 359 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 360 | Hold Time | 361 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 362 | BGP Identifier | 363 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 364 | Opt Parm Len | 365 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 366 | | 367 | Optional Parameters | 368 | | 369 RFC DRAFT April 2000 371 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 373 Version: 375 This 1-octet unsigned integer indicates the protocol version 376 number of the message. The current BGP version number is 4. 378 My Autonomous System: 380 This 2-octet unsigned integer indicates the Autonomous System 381 number of the sender. 383 Hold Time: 385 This 2-octet unsigned integer indicates the number of seconds 386 that the sender proposes for the value of the Hold Timer. Upon 387 receipt of an OPEN message, a BGP speaker MUST calculate the 388 value of the Hold Timer by using the smaller of its configured 389 Hold Time and the Hold Time received in the OPEN message. The 390 Hold Time MUST be either zero or at least three seconds. An 391 implementation may reject connections on the basis of the Hold 392 Time. The calculated value indicates the maximum number of 393 seconds that may elapse between the receipt of successive 394 KEEPALIVE, and/or UPDATE messages by the sender. 396 BGP Identifier: 397 This 4-octet unsigned integer indicates the BGP Identifier of 398 the sender. A given BGP speaker sets the value of its BGP 399 Identifier to an IP address assigned to that BGP speaker. The 400 value of the BGP Identifier is determined on startup and is the 401 same for every local interface and every BGP peer. 403 Optional Parameters Length: 405 This 1-octet unsigned integer indicates the total length of the 406 Optional Parameters field in octets. If the value of this field 407 is zero, no Optional Parameters are present. 409 Optional Parameters: 411 This field may contain a list of optional parameters, where 412 each parameter is encoded as a triplet. 415 RFC DRAFT April 2000 417 0 1 418 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 419 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 420 | Parm. Type | Parm. Length | Parameter Value (variable) 421 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 423 Parameter Type is a one octet field that unambiguously 424 identifies individual parameters. Parameter Length is a one 425 octet field that contains the length of the Parameter Value 426 field in octets. Parameter Value is a variable length field 427 that is interpreted according to the value of the Parameter 428 Type field. 430 This document defines the following Optional Parameters: 432 a) Authentication Information (Parameter Type 1): 434 This optional parameter may be used to authenticate a BGP 435 peer. The Parameter Value field contains a 1-octet 436 Authentication Code followed by a variable length 437 Authentication Data. 439 0 1 2 3 4 5 6 7 8 440 +-+-+-+-+-+-+-+-+ 441 | Auth. Code | 442 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 443 | | 444 | Authentication Data | 445 | | 446 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 448 Authentication Code: 450 This 1-octet unsigned integer indicates the 451 authentication mechanism being used. Whenever an 452 authentication mechanism is specified for use within 453 BGP, three things must be included in the 454 specification: 455 - the value of the Authentication Code which indicates 456 use of the mechanism, 457 - the form and meaning of the Authentication Data, and 458 - the algorithm for computing values of Marker fields. 460 RFC DRAFT April 2000 462 Note that a separate authentication mechanism may be 463 used in establishing the transport level connection. 465 Authentication Data: 467 The form and meaning of this field is a variable- 468 length field depend on the Authentication Code. 470 The minimum length of the OPEN message is 29 octets (including 471 message header). 473 4.3 UPDATE Message Format 475 UPDATE messages are used to transfer routing information between BGP 476 peers. The information in the UPDATE packet can be used to construct 477 a graph describing the relationships of the various Autonomous 478 Systems. By applying rules to be discussed, routing information 479 loops and some other anomalies may be detected and removed from 480 inter-AS routing. 482 An UPDATE message is used to advertise a single feasible route to a 483 peer, or to withdraw multiple unfeasible routes from service (see 484 3.1). An UPDATE message may simultaneously advertise a feasible route 485 and withdraw multiple unfeasible routes from service. The UPDATE 486 message always includes the fixed-size BGP header, and can optionally 487 include the other fields as shown below: 489 +-----------------------------------------------------+ 490 | Unfeasible Routes Length (2 octets) | 491 +-----------------------------------------------------+ 492 | Withdrawn Routes (variable) | 493 +-----------------------------------------------------+ 494 | Total Path Attribute Length (2 octets) | 495 +-----------------------------------------------------+ 496 | Path Attributes (variable) | 497 +-----------------------------------------------------+ 498 | Network Layer Reachability Information (variable) | 499 +-----------------------------------------------------+ 501 Unfeasible Routes Length: 503 This 2-octets unsigned integer indicates the total length of 504 the Withdrawn Routes field in octets. Its value must allow the 505 RFC DRAFT April 2000 507 length of the Network Layer Reachability Information field to 508 be determined as specified below. 510 A value of 0 indicates that no routes are being withdrawn from 511 service, and that the WITHDRAWN ROUTES field is not present in 512 this UPDATE message. 514 Withdrawn Routes: 516 This is a variable length field that contains a list of IP 517 address prefixes for the routes that are being withdrawn from 518 service. Each IP address prefix is encoded as a 2-tuple of the 519 form , whose fields are described below: 521 +---------------------------+ 522 | Length (1 octet) | 523 +---------------------------+ 524 | Prefix (variable) | 525 +---------------------------+ 527 The use and the meaning of these fields are as follows: 529 a) Length: 531 The Length field indicates the length in bits of the IP 532 address prefix. A length of zero indicates a prefix that 533 matches all IP addresses (with prefix, itself, of zero 534 octets). 536 b) Prefix: 538 The Prefix field contains an IP address prefix followed by 539 enough trailing bits to make the end of the field fall on an 540 octet boundary. Note that the value of trailing bits is 541 irrelevant. 543 Total Path Attribute Length: 545 This 2-octet unsigned integer indicates the total length of the 546 Path Attributes field in octets. Its value must allow the 547 length of the Network Layer Reachability field to be determined 548 as specified below. 550 A value of 0 indicates that no Network Layer Reachability 551 Information field is present in this UPDATE message. 553 RFC DRAFT April 2000 555 Path Attributes: 557 A variable length sequence of path attributes is present in 558 every UPDATE. Each path attribute is a triple of variable length. 561 Attribute Type is a two-octet field that consists of the 562 Attribute Flags octet followed by the Attribute Type Code 563 octet. 565 0 1 566 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 567 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 568 | Attr. Flags |Attr. Type Code| 569 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 571 The high-order bit (bit 0) of the Attribute Flags octet is the 572 Optional bit. It defines whether the attribute is optional (if 573 set to 1) or well-known (if set to 0). 575 The second high-order bit (bit 1) of the Attribute Flags octet 576 is the Transitive bit. It defines whether an optional 577 attribute is transitive (if set to 1) or non-transitive (if set 578 to 0). For well-known attributes, the Transitive bit must be 579 set to 1. (See Section 5 for a discussion of transitive 580 attributes.) 582 The third high-order bit (bit 2) of the Attribute Flags octet 583 is the Partial bit. It defines whether the information 584 contained in the optional transitive attribute is partial (if 585 set to 1) or complete (if set to 0). For well-known attributes 586 and for optional non-transitive attributes the Partial bit must 587 be set to 0. 589 The fourth high-order bit (bit 3) of the Attribute Flags octet 590 is the Extended Length bit. It defines whether the Attribute 591 Length is one octet (if set to 0) or two octets (if set to 1). 592 Extended Length may be used only if the length of the attribute 593 value is greater than 255 octets. 595 The lower-order four bits of the Attribute Flags octet are . 596 unused. They must be zero (and must be ignored when received). 598 The Attribute Type Code octet contains the Attribute Type Code. 600 RFC DRAFT April 2000 602 Currently defined Attribute Type Codes are discussed in Section 603 5. 605 If the Extended Length bit of the Attribute Flags octet is set 606 to 0, the third octet of the Path Attribute contains the length 607 of the attribute data in octets. 609 If the Extended Length bit of the Attribute Flags octet is set 610 to 1, then the third and the fourth octets of the path 611 attribute contain the length of the attribute data in octets. 613 The remaining octets of the Path Attribute represent the 614 attribute value and are interpreted according to the Attribute 615 Flags and the Attribute Type Code. The supported Attribute Type 616 Codes, their attribute values and uses are the following: 618 a) ORIGIN (Type Code 1): 620 ORIGIN is a well-known mandatory attribute that defines the 621 origin of the path information. The data octet can assume 622 the following values: 624 Value Meaning 626 0 IGP - Network Layer Reachability Information 627 is interior to the originating AS 629 1 EGP - Network Layer Reachability Information 630 learned via EGP 632 2 INCOMPLETE - Network Layer Reachability 633 Information learned by some other means 635 Its usage is defined in 5.1.1 637 b) AS_PATH (Type Code 2): 639 AS_PATH is a well-known mandatory attribute that is composed 640 of a sequence of AS path segments. Each AS path segment is 641 represented by a triple . 644 The path segment type is a 1-octet long field with the 645 following values defined: 647 Value Segment Type 649 1 AS_SET: unordered set of ASs a route in the 650 RFC DRAFT April 2000 652 UPDATE message has traversed 654 2 AS_SEQUENCE: ordered set of ASs a route in 655 the UPDATE message has traversed 657 The path segment length is a 1-octet long field containing 658 the number of ASs in the path segment value field. 660 The path segment value field contains one or more AS 661 numbers, each encoded as a 2-octets long field. 663 Usage of this attribute is defined in 5.1.2. 665 c) NEXT_HOP (Type Code 3): 667 This is a well-known mandatory attribute that defines the IP 668 address of the border router that should be used as the next 669 hop to the destinations listed in the Network Layer 670 Reachability field of the UPDATE message. 672 Usage of this attribute is defined in 5.1.3. 674 d) MULTI_EXIT_DISC (Type Code 4): 676 This is an optional non-transitive attribute that is a four 677 octet non-negative integer. The value of this attribute may 678 be used by a BGP speaker's decision process to discriminate 679 among multiple exit points to a neighboring autonomous 680 system. 682 Its usage is defined in 5.1.4. 684 e) LOCAL_PREF (Type Code 5): 686 LOCAL_PREF is a well-known mandatory attribute that is a 687 four octet non-negative integer. It is used by a BGP speaker 688 to inform other internal peers of the advertising speaker's 689 degree of preference for an advertised route. Usage of this 690 attribute is described in 5.1.5. 692 f) ATOMIC_AGGREGATE (Type Code 6) 694 ATOMIC_AGGREGATE is a well-known discretionary attribute of 695 length 0. It is used by a BGP speaker to inform other BGP 696 speakers that the local system selected a less specific 697 route without selecting a more specific route which is 698 included in it. Usage of this attribute is described in 699 RFC DRAFT April 2000 701 5.1.6. 703 g) AGGREGATOR (Type Code 7) 705 AGGREGATOR is an optional transitive attribute of length 6. 706 The attribute contains the last AS number that formed the 707 aggregate route (encoded as 2 octets), followed by the IP 708 address of the BGP speaker that formed the aggregate route 709 (encoded as 4 octets). Usage of this attribute is described 710 in 5.1.7 712 Network Layer Reachability Information: 714 This variable length field contains a list of IP address 715 prefixes. The length in octets of the Network Layer 716 Reachability Information is not encoded explicitly, but can be 717 calculated as: 719 UPDATE message Length - 23 - Total Path Attributes Length - 720 Unfeasible Routes Length 722 where UPDATE message Length is the value encoded in the fixed- 723 size BGP header, Total Path Attribute Length and Unfeasible 724 Routes Length are the values encoded in the variable part of 725 the UPDATE message, and 23 is a combined length of the fixed- 726 size BGP header, the Total Path Attribute Length field and the 727 Unfeasible Routes Length field. 729 Reachability information is encoded as one or more 2-tuples of 730 the form , whose fields are described below: 732 +---------------------------+ 733 | Length (1 octet) | 734 +---------------------------+ 735 | Prefix (variable) | 736 +---------------------------+ 738 The use and the meaning of these fields are as follows: 740 a) Length: 742 The Length field indicates the length in bits of the IP 743 address prefix. A length of zero indicates a prefix that 744 matches all IP addresses (with prefix, itself, of zero 745 octets). 747 RFC DRAFT April 2000 749 b) Prefix: 751 The Prefix field contains IP address prefixes followed by 752 enough trailing bits to make the end of the field fall on an 753 octet boundary. Note that the value of the trailing bits is 754 irrelevant. 756 The minimum length of the UPDATE message is 23 octets -- 19 octets 757 for the fixed header + 2 octets for the Unfeasible Routes Length + 2 758 octets for the Total Path Attribute Length (the value of Unfeasible 759 Routes Length is 0 and the value of Total Path Attribute Length is 760 0). 762 An UPDATE message can advertise at most one route, which may be 763 described by several path attributes. All path attributes contained 764 in a given UPDATE messages apply to the destinations carried in the 765 Network Layer Reachability Information field of the UPDATE message. 767 An UPDATE message can list multiple routes to be withdrawn from 768 service. Each such route is identified by its destination (expressed 769 as an IP prefix), which unambiguously identifies the route in the 770 context of the BGP speaker - BGP speaker connection to which it has 771 been previously been advertised. 773 An UPDATE message may advertise only routes to be withdrawn from 774 service, in which case it will not include path attributes or Network 775 Layer Reachability Information. Conversely, it may advertise only a 776 feasible route, in which case the WITHDRAWN ROUTES field need not be 777 present. 779 4.4 KEEPALIVE Message Format 781 BGP does not use any transport protocol-based keep-alive mechanism to 782 determine if peers are reachable. Instead, KEEPALIVE messages are 783 exchanged between peers often enough as not to cause the Hold Timer 784 to expire. A reasonable maximum time between KEEPALIVE messages 785 would be one third of the Hold Time interval. KEEPALIVE messages 786 MUST NOT be sent more frequently than one per second. An 787 implementation MAY adjust the rate at which it sends KEEPALIVE 788 messages as a function of the Hold Time interval. 790 If the negotiated Hold Time interval is zero, then periodic KEEPALIVE 791 messages MUST NOT be sent. 793 KEEPALIVE message consists of only message header and has a length of 794 19 octets. 796 RFC DRAFT April 2000 798 4.5 NOTIFICATION Message Format 800 A NOTIFICATION message is sent when an error condition is detected. 801 The BGP connection is closed immediately after sending it. 803 In addition to the fixed-size BGP header, the NOTIFICATION message 804 contains the following fields: 806 0 1 2 3 807 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 808 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 809 | Error code | Error subcode | Data | 810 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 811 | | 812 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 814 Error Code: 816 This 1-octet unsigned integer indicates the type of 817 NOTIFICATION. The following Error Codes have been defined: 819 Error Code Symbolic Name Reference 821 1 Message Header Error Section 6.1 823 2 OPEN Message Error Section 6.2 825 3 UPDATE Message Error Section 6.3 827 4 Hold Timer Expired Section 6.5 829 5 Finite State Machine Error Section 6.6 831 6 Cease Section 6.7 833 Error subcode: 835 This 1-octet unsigned integer provides more specific 836 information about the nature of the reported error. Each Error 837 Code may have one or more Error Subcodes associated with it. 838 If no appropriate Error Subcode is defined, then a zero 839 (Unspecific) value is used for the Error Subcode field. 841 RFC DRAFT April 2000 843 Message Header Error subcodes: 845 1 - Connection Not Synchronized. 846 2 - Bad Message Length. 847 3 - Bad Message Type. 849 OPEN Message Error subcodes: 851 1 - Unsupported Version Number. 852 2 - Bad Peer AS. 853 3 - Bad BGP Identifier. 854 4 - Unsupported Optional Parameter. 855 5 - Authentication Failure. 856 6 - Unacceptable Hold Time. 858 UPDATE Message Error subcodes: 860 1 - Malformed Attribute List. 861 2 - Unrecognized Well-known Attribute. 862 3 - Missing Well-known Attribute. 863 4 - Attribute Flags Error. 864 5 - Attribute Length Error. 865 6 - Invalid ORIGIN Attribute 866 8 - Invalid NEXT_HOP Attribute. 867 9 - Optional Attribute Error. 868 10 - Invalid Network Field. 869 11 - Malformed AS_PATH. 871 Data: 873 This variable-length field is used to diagnose the reason for 874 the NOTIFICATION. The contents of the Data field depend upon 875 the Error Code and Error Subcode. See Section 6 below for more 876 details. 878 Note that the length of the Data field can be determined from 879 the message Length field by the formula: 881 Message Length = 21 + Data Length 883 The minimum length of the NOTIFICATION message is 21 octets 884 (including message header). 886 RFC DRAFT April 2000 888 5. Path Attributes 890 This section discusses the path attributes of the UPDATE message. 892 Path attributes fall into four separate categories: 894 1. Well-known mandatory. 895 2. Well-known discretionary. 896 3. Optional transitive. 897 4. Optional non-transitive. 899 Well-known attributes must be recognized by all BGP implementations. 900 Some of these attributes are mandatory and must be included in every 901 UPDATE message that contains NLRI. Others are discretionary and may 902 or may not be sent in a particular UPDATE message. 904 All well-known attributes must be passed along (after proper 905 updating, if necessary) to other BGP peers. 907 In addition to well-known attributes, each path may contain one or 908 more optional attributes. It is not required or expected that all 909 BGP implementations support all optional attributes. The handling of 910 an unrecognized optional attribute is determined by the setting of 911 the Transitive bit in the attribute flags octet. Paths with 912 unrecognized transitive optional attributes should be accepted. If a 913 path with unrecognized transitive optional attribute is accepted and 914 passed along to other BGP peers, then the unrecognized transitive 915 optional attribute of that path must be passed along with the path to 916 other BGP peers with the Partial bit in the Attribute Flags octet set 917 to 1. If a path with recognized transitive optional attribute is 918 accepted and passed along to other BGP peers and the Partial bit in 919 the Attribute Flags octet is set to 1 by some previous AS, it is not 920 set back to 0 by the current AS. Unrecognized non-transitive optional 921 attributes must be quietly ignored and not passed along to other BGP 922 peers. 924 New transitive optional attributes may be attached to the path by the 925 originator or by any other AS in the path. If they are not attached 926 by the originator, the Partial bit in the Attribute Flags octet is 927 set to 1. The rules for attaching new non-transitive optional 928 attributes will depend on the nature of the specific attribute. The 929 documentation of each new non-transitive optional attribute will be 930 expected to include such rules. (The description of the 931 MULTI_EXIT_DISC attribute gives an example.) All optional attributes 932 (both transitive and non-transitive) may be updated (if appropriate) 933 by ASs in the path. 935 RFC DRAFT April 2000 937 The sender of an UPDATE message should order path attributes within 938 the UPDATE message in ascending order of attribute type. The 939 receiver of an UPDATE message must be prepared to handle path 940 attributes within the UPDATE message that are out of order. 942 The same attribute cannot appear more than once within the Path 943 Attributes field of a particular UPDATE message. 945 The mandatory category refers to an attribute which must be present 946 in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE 947 message. Attributes classified as optional for the purpose of the 948 protocol extension mechanism may be purely discretionary, or 949 discretionary, required, or disallowed in certain contexts. 951 attribute EBGP IBGP 952 ORIGIN mandatory mandatory 953 AS_PATH mandatory mandatory 954 NEXT_HOP mandatory mandatory 955 MULTI_EXIT_DISC discretionary discretionary 956 LOCAL_PREF disallowed required 957 ATOMIC_AGGREGATE see section 5.1.6 and 9.1.4 958 AGGREGATOR discretionary discretionary 960 5.1 Path Attribute Usage 962 The usage of each BGP path attributes is described in the following 963 clauses. 965 5.1.1 ORIGIN 967 ORIGIN is a well-known mandatory attribute. The ORIGIN attribute 968 shall be generated by the autonomous system that originates the 969 associated routing information. It shall be included in the UPDATE 970 messages of all BGP speakers that choose to propagate this 971 information to other BGP speakers. 973 5.1.2 AS_PATH 975 AS_PATH is a well-known mandatory attribute. This attribute 976 RFC DRAFT April 2000 978 identifies the autonomous systems through which routing information 979 carried in this UPDATE message has passed. The components of this 980 list can be AS_SETs or AS_SEQUENCEs. 982 When a BGP speaker propagates a route which it has learned from 983 another BGP speaker's UPDATE message, it shall modify the route's 984 AS_PATH attribute based on the location of the BGP speaker to which 985 the route will be sent: 987 a) When a given BGP speaker advertises the route to an internal 988 peer, the advertising speaker shall not modify the AS_PATH 989 attribute associated with the route. 991 b) When a given BGP speaker advertises the route to an external 992 peer, then the advertising speaker shall update the AS_PATH 993 attribute as follows: 995 1) if the first path segment of the AS_PATH is of type 996 AS_SEQUENCE, the local system shall prepend its own AS number 997 as the last element of the sequence (put it in the leftmost 998 position) 1000 2) if the first path segment of the AS_PATH is of type AS_SET, 1001 the local system shall prepend a new path segment of type 1002 AS_SEQUENCE to the AS_PATH, including its own AS number in that 1003 segment. 1005 When a BGP speaker originates a route then: 1007 a) the originating speaker shall include its own AS number in 1008 the AS_PATH attribute of all UPDATE messages sent to an 1009 external peer. (In this case, the AS number of the originating 1010 speaker's autonomous system will be the only entry in the 1011 AS_PATH attribute). 1013 b) the originating speaker shall include an empty AS_PATH 1014 attribute in all UPDATE messages sent to internal peers. (An 1015 empty AS_PATH attribute is one whose length field contains the 1016 value zero). 1018 5.1.3 NEXT_HOP 1020 The NEXT_HOP path attribute defines the IP address of the border 1021 router that should be used as the next hop to the destinations listed 1022 in the UPDATE message. When advertising a NEXT_HOP attribute to an 1023 RFC DRAFT April 2000 1025 external peer, a router may use one of its own interface addresses in 1026 the NEXT_HOP attribute provided the external peer to which the route 1027 is being advertised shares a common subnet with the NEXT_HOP address. 1028 This is known as a "first party" NEXT_HOP attribute. A BGP speaker 1029 can advertise to an external peer an interface of any internal peer 1030 router in the NEXT_HOP attribute provided the external peer to which 1031 the route is being advertised shares a common subnet with the 1032 NEXT_HOP address. This is known as a "third party" NEXT_HOP 1033 attribute. A BGP speaker can advertise any adjacent router in the 1034 NEXT_HOP attribute provided that the IP address of this router was 1035 learned from an external peer and the external peer to which the 1036 route is being advertised shares a common subnet with the NEXT_HOP 1037 address. This is a second form of "third party" NEXT_HOP attribute. 1039 Normally the NEXT_HOP attribute is chosen such that the shortest 1040 available path will be taken. A BGP speaker must be able to support 1041 disabling advertisement of third party NEXT_HOP attributes to handle 1042 imperfectly bridged media. 1044 A BGP speaker must never advertise an address of a peer to that peer 1045 as a NEXT_HOP, for a route that the speaker is originating. A BGP 1046 speaker must never install a route with itself as the next hop. 1048 When a BGP speaker advertises the route to an internal peer, the 1049 advertising speaker should not modify the NEXT_HOP attribute 1050 associated with the route. When a BGP speaker receives the route via 1051 an internal link, it may forward packets to the NEXT_HOP address if 1052 the address contained in the attribute is on a common subnet with the 1053 local and remote BGP speakers. 1055 5.1.4 MULTI_EXIT_DISC 1057 The MULTI_EXIT_DISC attribute may be used on external (inter-AS) 1058 links to discriminate among multiple exit or entry points to the same 1059 neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four 1060 octet unsigned number which is called a metric. All other factors 1061 being equal, the exit or entry point with lower metric should be 1062 preferred. If received over external links, the MULTI_EXIT_DISC 1063 attribute MAY be propagated over internal links to other BGP speakers 1064 within the same AS. The MULTI_EXIT_DISC attribute received from a 1065 neighboring AS MUST NOT be propagated to other neighboring ASs. 1067 A BGP speaker MUST IMPLEMENT a mechanism based on local configuration 1068 which allows the MULTI_EXIT_DISC attribute to be removed from a 1069 route. This MAY be done either prior to or after determining the 1070 degree of preference of the route and performing route selection 1071 RFC DRAFT April 2000 1073 (decision process phases 1 and 2). 1075 An implementation MAY also (based on local configuration) alter the 1076 value of the MULTI_EXIT_DISC attribute received over an external 1077 link. If it does so, it shall do so prior to determining the degree 1078 of preference of the route and performing route selection (decision 1079 process phases 1 and 2). 1081 5.1.5 LOCAL_PREF 1083 LOCAL_PREF is a well-known mandatory attribute that SHALL be included 1084 in all UPDATE messages that a given BGP speaker sends to the other 1085 internal peers. A BGP speaker SHALL calculate the degree of 1086 preference for each external route and include the degree of 1087 preference when advertising a route to its internal peers. The higher 1088 degree of preference MUST be preferred. A BGP speaker shall use the 1089 degree of preference learned via LOCAL_PREF in its decision process 1090 (see section 9.1.1). 1092 A BGP speaker MUST NOT include this attribute in UPDATE messages that 1093 it sends to external peers. If it is contained in an UPDATE message 1094 that is received from an external peer, then this attribute MUST be 1095 ignored by the receiving speaker. 1097 5.1.6 ATOMIC_AGGREGATE 1099 ATOMIC_AGGREGATE is a well-known discretionary attribute. If a BGP 1100 speaker, when presented with a set of overlapping routes from one of 1101 its peers (see 9.1.4), selects the less specific route without 1102 selecting the more specific one, then the local system MUST attach 1103 the ATOMIC_AGGREGATE attribute to the route when propagating it to 1104 other BGP speakers (if that attribute is not already present in the 1105 received less specific route). A BGP speaker that receives a route 1106 with the ATOMIC_AGGREGATE attribute MUST NOT remove the attribute 1107 from the route when propagating it to other speakers. A BGP speaker 1108 that receives a route with the ATOMIC_AGGREGATE attribute MUST NOT 1109 make any NLRI of that route more specific (as defined in 9.1.4) when 1110 advertising this route to other BGP speakers. A BGP speaker that 1111 receives a route with the ATOMIC_AGGREGATE attribute needs to be 1112 cognizant of the fact that the actual path to destinations, as 1113 specified in the NLRI of the route, while having the loop-free 1114 property, may traverse ASs that are not listed in the AS_PATH 1115 attribute. 1117 RFC DRAFT April 2000 1119 5.1.7 AGGREGATOR 1121 AGGREGATOR is an optional transitive attribute which may be included 1122 in updates which are formed by aggregation (see Section 9.2.4.2). A 1123 BGP speaker which performs route aggregation may add the AGGREGATOR 1124 attribute which shall contain its own AS number and IP address. 1126 6. BGP Error Handling. 1128 This section describes actions to be taken when errors are detected 1129 while processing BGP messages. 1131 When any of the conditions described here are detected, a 1132 NOTIFICATION message with the indicated Error Code, Error Subcode, 1133 and Data fields is sent, and the BGP connection is closed. If no 1134 Error Subcode is specified, then a zero must be used. 1136 The phrase "the BGP connection is closed" means that the transport 1137 protocol connection has been closed and that all resources for that 1138 BGP connection have been deallocated. Routing table entries 1139 associated with the remote peer are marked as invalid. The fact that 1140 the routes have become invalid is passed to other BGP peers before 1141 the routes are deleted from the system. 1143 Unless specified explicitly, the Data field of the NOTIFICATION 1144 message that is sent to indicate an error is empty. 1146 6.1 Message Header error handling. 1148 All errors detected while processing the Message Header are indicated 1149 by sending the NOTIFICATION message with Error Code Message Header 1150 Error. The Error Subcode elaborates on the specific nature of the 1151 error. 1153 The expected value of the Marker field of the message header is all 1154 ones if the message type is OPEN. The expected value of the Marker 1155 field for all other types of BGP messages determined based on the 1156 presence of the Authentication Information Optional Parameter in the 1157 BGP OPEN message and the actual authentication mechanism (if the 1158 Authentication Information in the BGP OPEN message is present). If 1159 the Marker field of the message header is not the expected one, then 1160 a synchronization error has occurred and the Error Subcode is set to 1161 Connection Not Synchronized. 1163 RFC DRAFT April 2000 1165 If the Length field of the message header is less than 19 or greater 1166 than 4096, or if the Length field of an OPEN message is less than 1167 the minimum length of the OPEN message, or if the Length field of an 1168 UPDATE message is less than the minimum length of the UPDATE message, 1169 or if the Length field of a KEEPALIVE message is not equal to 19, or 1170 if the Length field of a NOTIFICATION message is less than the 1171 minimum length of the NOTIFICATION message, then the Error Subcode is 1172 set to Bad Message Length. The Data field contains the erroneous 1173 Length field. 1175 If the Type field of the message header is not recognized, then the 1176 Error Subcode is set to Bad Message Type. The Data field contains 1177 the erroneous Type field. 1179 6.2 OPEN message error handling. 1181 All errors detected while processing the OPEN message are indicated 1182 by sending the NOTIFICATION message with Error Code OPEN Message 1183 Error. The Error Subcode elaborates on the specific nature of the 1184 error. 1186 If the version number contained in the Version field of the received 1187 OPEN message is not supported, then the Error Subcode is set to 1188 Unsupported Version Number. The Data field is a 1-octet unsigned 1189 integer, which indicates the largest locally supported version number 1190 less than the version the remote BGP peer bid (as indicated in the 1191 received OPEN message). 1193 If the Autonomous System field of the OPEN message is unacceptable, 1194 then the Error Subcode is set to Bad Peer AS. The determination of 1195 acceptable Autonomous System numbers is outside the scope of this 1196 protocol. 1198 If the Hold Time field of the OPEN message is unacceptable, then the 1199 Error Subcode MUST be set to Unacceptable Hold Time. An 1200 implementation MUST reject Hold Time values of one or two seconds. 1201 An implementation MAY reject any proposed Hold Time. An 1202 implementation which accepts a Hold Time MUST use the negotiated 1203 value for the Hold Time. 1205 If the BGP Identifier field of the OPEN message is syntactically 1206 incorrect, then the Error Subcode is set to Bad BGP Identifier. 1207 Syntactic correctness means that the BGP Identifier field represents 1208 a valid IP host address. 1210 If one of the Optional Parameters in the OPEN message is not 1211 RFC DRAFT April 2000 1213 recognized, then the Error Subcode is set to Unsupported Optional 1214 Parameters. 1216 If the OPEN message carries Authentication Information (as an 1217 Optional Parameter), then the corresponding authentication procedure 1218 is invoked. If the authentication procedure (based on Authentication 1219 Code and Authentication Data) fails, then the Error Subcode is set to 1220 Authentication Failure. 1222 6.3 UPDATE message error handling. 1224 All errors detected while processing the UPDATE message are indicated 1225 by sending the NOTIFICATION message with Error Code UPDATE Message 1226 Error. The error subcode elaborates on the specific nature of the 1227 error. 1229 Error checking of an UPDATE message begins by examining the path 1230 attributes. If the Unfeasible Routes Length or Total Attribute 1231 Length is too large (i.e., if Unfeasible Routes Length + Total 1232 Attribute Length + 23 exceeds the message Length), then the Error 1233 Subcode is set to Malformed Attribute List. 1235 If any recognized attribute has Attribute Flags that conflict with 1236 the Attribute Type Code, then the Error Subcode is set to Attribute 1237 Flags Error. The Data field contains the erroneous attribute (type, 1238 length and value). 1240 If any recognized attribute has Attribute Length that conflicts with 1241 the expected length (based on the attribute type code), then the 1242 Error Subcode is set to Attribute Length Error. The Data field 1243 contains the erroneous attribute (type, length and value). 1245 If any of the mandatory well-known attributes are not present, then 1246 the Error Subcode is set to Missing Well-known Attribute. The Data 1247 field contains the Attribute Type Code of the missing well-known 1248 attribute. 1250 If any of the mandatory well-known attributes are not recognized, 1251 then the Error Subcode is set to Unrecognized Well-known Attribute. 1252 The Data field contains the unrecognized attribute (type, length and 1253 value). 1255 If the ORIGIN attribute has an undefined value, then the Error 1256 Subcode is set to Invalid Origin Attribute. The Data field contains 1257 RFC DRAFT April 2000 1259 the unrecognized attribute (type, length and value). 1261 If the NEXT_HOP attribute field is syntactically incorrect, then the 1262 Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field 1263 contains the incorrect attribute (type, length and value). Syntactic 1264 correctness means that the NEXT_HOP attribute represents a valid IP 1265 host address. Semantic correctness applies only to the external BGP 1266 links. It means that the interface associated with the IP address, as 1267 specified in the NEXT_HOP attribute, shares a common subnet with the 1268 receiving BGP speaker and is not the IP address of the receiving BGP 1269 speaker. If the NEXT_HOP attribute is semantically incorrect, the 1270 error should be logged, and the the route should be ignored. In this 1271 case, no NOTIFICATION message should be sent. 1273 The AS_PATH attribute is checked for syntactic correctness. If the 1274 path is syntactically incorrect, then the Error Subcode is set to 1275 Malformed AS_PATH. 1277 The information carried by the AS_PATH attribute is checked for AS 1278 loops. AS loop detection is done by scanning the full AS path (as 1279 specified in the AS_PATH attribute), and checking that the autonomous 1280 system number of the local system does not appear in the AS path. If 1281 the autonomous system number appears in the AS path the route may be 1282 stored in the Adj-RIB-In, but unless the router is configured to 1283 accept routes with its own autonomous system in the AS path, the 1284 route shall not be passed to the BGP Decision Process. Operations of 1285 a router that is configured to accept routes with its own autonomous 1286 system number in the AS path are outside the scope of this document. 1288 If an optional attribute is recognized, then the value of this 1289 attribute is checked. If an error is detected, the attribute is 1290 discarded, and the Error Subcode is set to Optional Attribute Error. 1291 The Data field contains the attribute (type, length and value). 1293 If any attribute appears more than once in the UPDATE message, then 1294 the Error Subcode is set to Malformed Attribute List. 1296 The NLRI field in the UPDATE message is checked for syntactic 1297 validity. If the field is syntactically incorrect, then the Error 1298 Subcode is set to Invalid Network Field. 1300 An UPDATE message that contains correct path attributes, but no NLRI, 1301 shall be treated as a valid UPDATE message. 1303 RFC DRAFT April 2000 1305 6.4 NOTIFICATION message error handling. 1307 If a peer sends a NOTIFICATION message, and there is an error in that 1308 message, there is unfortunately no means of reporting this error via 1309 a subsequent NOTIFICATION message. Any such error, such as an 1310 unrecognized Error Code or Error Subcode, should be noticed, logged 1311 locally, and brought to the attention of the administration of the 1312 peer. The means to do this, however, lies outside the scope of this 1313 document. 1315 6.5 Hold Timer Expired error handling. 1317 If a system does not receive successive KEEPALIVE and/or UPDATE 1318 and/or NOTIFICATION messages within the period specified in the Hold 1319 Time field of the OPEN message, then the NOTIFICATION message with 1320 Hold Timer Expired Error Code must be sent and the BGP connection 1321 closed. 1323 6.6 Finite State Machine error handling. 1325 Any error detected by the BGP Finite State Machine (e.g., receipt of 1326 an unexpected event) is indicated by sending the NOTIFICATION message 1327 with Error Code Finite State Machine Error. 1329 6.7 Cease. 1331 In absence of any fatal errors (that are indicated in this section), 1332 a BGP peer may choose at any given time to close its BGP connection 1333 by sending the NOTIFICATION message with Error Code Cease. However, 1334 the Cease NOTIFICATION message must not be used when a fatal error 1335 indicated by this section does exist. 1337 6.8 Connection collision detection. 1339 If a pair of BGP speakers try simultaneously to establish a TCP 1340 connection to each other, then two parallel connections between this 1341 pair of speakers might well be formed. We refer to this situation as 1342 connection collision. Clearly, one of these connections must be 1343 closed. 1345 RFC DRAFT April 2000 1347 Based on the value of the BGP Identifier a convention is established 1348 for detecting which BGP connection is to be preserved when a 1349 collision does occur. The convention is to compare the BGP 1350 Identifiers of the peers involved in the collision and to retain only 1351 the connection initiated by the BGP speaker with the higher-valued 1352 BGP Identifier. 1354 Upon receipt of an OPEN message, the local system must examine all of 1355 its connections that are in the OpenConfirm state. A BGP speaker may 1356 also examine connections in an OpenSent state if it knows the BGP 1357 Identifier of the peer by means outside of the protocol. If among 1358 these connections there is a connection to a remote BGP speaker whose 1359 BGP Identifier equals the one in the OPEN message, then the local 1360 system performs the following collision resolution procedure: 1362 1. The BGP Identifier of the local system is compared to the BGP 1363 Identifier of the remote system (as specified in the OPEN 1364 message). 1366 2. If the value of the local BGP Identifier is less than the 1367 remote one, the local system closes BGP connection that already 1368 exists (the one that is already in the OpenConfirm state), and 1369 accepts BGP connection initiated by the remote system. 1371 3. Otherwise, the local system closes newly created BGP connection 1372 (the one associated with the newly received OPEN message), and 1373 continues to use the existing one (the one that is already in the 1374 OpenConfirm state). 1376 Comparing BGP Identifiers is done by treating them as (4-octet 1377 long) unsigned integers. 1379 Unless allowed via configuration, a connection collision with an 1380 existing BGP connection that is in Established state causes 1381 closing of the newly created connection. 1383 Note that a connection collision cannot be detected with 1384 connections that are in Idle, or Connect, or Active states. 1386 Closing the BGP connection (that results from the collision 1387 resolution procedure) is accomplished by sending the NOTIFICATION 1388 message with the Error Code Cease. 1390 RFC DRAFT April 2000 1392 7. BGP Version Negotiation. 1394 BGP speakers may negotiate the version of the protocol by making 1395 multiple attempts to open a BGP connection, starting with the highest 1396 version number each supports. If an open attempt fails with an Error 1397 Code OPEN Message Error, and an Error Subcode Unsupported Version 1398 Number, then the BGP speaker has available the version number it 1399 tried, the version number its peer tried, the version number passed 1400 by its peer in the NOTIFICATION message, and the version numbers that 1401 it supports. If the two peers do support one or more common 1402 versions, then this will allow them to rapidly determine the highest 1403 common version. In order to support BGP version negotiation, future 1404 versions of BGP must retain the format of the OPEN and NOTIFICATION 1405 messages. 1407 8. BGP Finite State machine. 1409 This section specifies BGP operation in terms of a Finite State 1410 Machine (FSM). Following is a brief summary and overview of BGP 1411 operations by state as determined by this FSM. A condensed version 1412 of the BGP FSM is found in Appendix 1. 1414 Initially BGP is in the Idle state. 1416 Idle state: 1418 In this state BGP refuses all incoming BGP connections. No 1419 resources are allocated to the peer. In response to the Start 1420 event (initiated by either system or operator) the local system 1421 initializes all BGP resources, starts the ConnectRetry timer, 1422 initiates a transport connection to other BGP peer, while 1423 listening for connection that may be initiated by the remote 1424 BGP peer, and changes its state to Connect. The exact value of 1425 the ConnectRetry timer is a local matter, but should be 1426 sufficiently large to allow TCP initialization. 1428 If a BGP speaker detects an error, it shuts down the connection 1429 and changes its state to Idle. Getting out of the Idle state 1430 requires generation of the Start event. If such an event is 1431 generated automatically, then persistent BGP errors may result 1432 in persistent flapping of the speaker. To avoid such a 1433 condition it is recommended that Start events should not be 1434 generated immediately for a peer that was previously 1435 transitioned to Idle due to an error. For a peer that was 1436 previously transitioned to Idle due to an error, the time 1437 RFC DRAFT April 2000 1439 between consecutive generation of Start events, if such events 1440 are generated automatically, shall exponentially increase. The 1441 value of the initial timer shall be 60 seconds. The time shall 1442 be doubled for each consecutive retry. 1444 Any other event received in the Idle state is ignored. 1446 Connect state: 1448 In this state BGP is waiting for the transport protocol 1449 connection to be completed. 1451 If the transport protocol connection succeeds, the local system 1452 clears the ConnectRetry timer, completes initialization, sends 1453 an OPEN message to its peer, and changes its state to OpenSent. 1455 If the transport protocol connect fails (e.g., retransmission 1456 timeout), the local system restarts the ConnectRetry timer, 1457 continues to listen for a connection that may be initiated by 1458 the remote BGP peer, and changes its state to Active state. 1460 In response to the ConnectRetry timer expired event, the local 1461 system restarts the ConnectRetry timer, initiates a transport 1462 connection to other BGP peer, continues to listen for a 1463 connection that may be initiated by the remote BGP peer, and 1464 stays in the Connect state. 1466 Start event is ignored in the Connect state. 1468 In response to any other event (initiated by either system or 1469 operator), the local system releases all BGP resources 1470 associated with this connection and changes its state to Idle. 1472 Active state: 1474 In this state BGP is trying to acquire a peer by listening for 1475 and accepting a transport protocol connection. 1477 If the transport protocol connection succeeds, the local system 1478 clears the ConnectRetry timer, completes initialization, sends 1479 an OPEN message to its peer, sets its Hold Timer to a large 1480 value, and changes its state to OpenSent. A Hold Timer value 1481 of 4 minutes is suggested. 1483 In response to the ConnectRetry timer expired event, the local 1484 system restarts the ConnectRetry timer, initiates a transport 1485 connection to other BGP peer, continues to listen for a 1486 connection that may be initiated by the remote BGP peer, and 1487 RFC DRAFT April 2000 1489 changes its state to Connect. 1491 If the local system allows BGP connections with unconfigured 1492 peers, then when the local system detects that a remote peer is 1493 trying to establish a BGP connection to it, and the IP address 1494 of the remote peer is not a configured one, the local system 1495 creates a temporary peer entry, completes initialization, sends 1496 an OPEN message to its peer, sets its Hold Timer to a large 1497 value, and changes its state to OpenSent. 1499 If the local system does not allow BGP connections with 1500 unconfigured peers, then the local system rejects connections 1501 from IP addresses that are not configured peers, and remains in 1502 the Active state. 1504 Start event is ignored in the Active state. 1506 In response to any other event (initiated by either system or 1507 operator), the local system releases all BGP resources 1508 associated with this connection and changes its state to Idle. 1510 OpenSent state: 1512 In this state BGP waits for an OPEN message from its peer. 1513 When an OPEN message is received, all fields are checked for 1514 correctness. If the BGP message header checking or OPEN 1515 message checking detects an error (see Section 6.2), or a 1516 connection collision (see Section 6.8) the local system sends a 1517 NOTIFICATION message and changes its state to Idle. 1519 If there are no errors in the OPEN message, BGP sends a 1520 KEEPALIVE message and sets a KeepAlive timer. The Hold Timer, 1521 which was originally set to a large value (see above), is 1522 replaced with the negotiated Hold Time value (see section 4.2). 1523 If the negotiated Hold Time value is zero, then the Hold Time 1524 timer and KeepAlive timers are not started. If the value of 1525 the Autonomous System field is the same as the local Autonomous 1526 System number, then the connection is an "internal" connection; 1527 otherwise, it is "external". (This will effect UPDATE 1528 processing as described below.) Finally, the state is changed 1529 to OpenConfirm. 1531 If a disconnect notification is received from the underlying 1532 transport protocol, the local system closes the BGP connection, 1533 restarts the ConnectRetry timer, while continue listening for 1534 connection that may be initiated by the remote BGP peer, and 1535 goes into the Active state. 1537 RFC DRAFT April 2000 1539 If the Hold Timer expires, the local system sends NOTIFICATION 1540 message with error code Hold Timer Expired and changes its 1541 state to Idle. 1543 In response to the Stop event (initiated by either system or 1544 operator) the local system sends NOTIFICATION message with 1545 Error Code Cease and changes its state to Idle. 1547 Start event is ignored in the OpenSent state. 1549 In response to any other event the local system sends 1550 NOTIFICATION message with Error Code Finite State Machine Error 1551 and changes its state to Idle. 1553 Whenever BGP changes its state from OpenSent to Idle, it closes 1554 the BGP (and transport-level) connection and releases all 1555 resources associated with that connection. 1557 OpenConfirm state: 1559 In this state BGP waits for a KEEPALIVE or NOTIFICATION 1560 message. 1562 If the local system receives a KEEPALIVE message, it changes 1563 its state to Established. 1565 If the Hold Timer expires before a KEEPALIVE message is 1566 received, the local system sends NOTIFICATION message with 1567 error code Hold Timer Expired and changes its state to Idle. 1569 If the local system receives a NOTIFICATION message, it changes 1570 its state to Idle. 1572 If the KeepAlive timer expires, the local system sends a 1573 KEEPALIVE message and restarts its KeepAlive timer. 1575 If a disconnect notification is received from the underlying 1576 transport protocol, the local system changes its state to Idle. 1578 In response to the Stop event (initiated by either system or 1579 operator) the local system sends NOTIFICATION message with 1580 Error Code Cease and changes its state to Idle. 1582 Start event is ignored in the OpenConfirm state. 1584 In response to any other event the local system sends 1585 NOTIFICATION message with Error Code Finite State Machine Error 1586 and changes its state to Idle. 1588 RFC DRAFT April 2000 1590 Whenever BGP changes its state from OpenConfirm to Idle, it 1591 closes the BGP (and transport-level) connection and releases 1592 all resources associated with that connection. 1594 Established state: 1596 In the Established state BGP can exchange UPDATE, NOTIFICATION, 1597 and KEEPALIVE messages with its peer. 1599 If the local system receives an UPDATE or KEEPALIVE message, it 1600 restarts its Hold Timer, if the negotiated Hold Time value is 1601 non-zero. 1603 If the local system receives a NOTIFICATION message, it changes 1604 its state to Idle. 1606 If the local system receives an UPDATE message and the UPDATE 1607 message error handling procedure (see Section 6.3) detects an 1608 error, the local system sends a NOTIFICATION message and 1609 changes its state to Idle. 1611 If a disconnect notification is received from the underlying 1612 transport protocol, the local system changes its state to Idle. 1614 If the Hold Timer expires, the local system sends a 1615 NOTIFICATION message with Error Code Hold Timer Expired and 1616 changes its state to Idle. 1618 If the KeepAlive timer expires, the local system sends a 1619 KEEPALIVE message and restarts its KeepAlive timer. 1621 Each time the local system sends a KEEPALIVE or UPDATE message, 1622 it restarts its KeepAlive timer, unless the negotiated Hold 1623 Time value is zero. 1625 In response to the Stop event (initiated by either system or 1626 operator), the local system sends a NOTIFICATION message with 1627 Error Code Cease and changes its state to Idle. 1629 Start event is ignored in the Established state. 1631 In response to any other event, the local system sends 1632 NOTIFICATION message with Error Code Finite State Machine Error 1633 and changes its state to Idle. 1635 Whenever BGP changes its state from Established to Idle, it 1636 closes the BGP (and transport-level) connection, releases all 1637 resources associated with that connection, and deletes all 1638 RFC DRAFT April 2000 1640 routes derived from that connection. 1642 9. UPDATE Message Handling 1644 An UPDATE message may be received only in the Established state. 1645 When an UPDATE message is received, each field is checked for 1646 validity as specified in Section 6.3. 1648 If an optional non-transitive attribute is unrecognized, it is 1649 quietly ignored. If an optional transitive attribute is 1650 unrecognized, the Partial bit (the third high-order bit) in the 1651 attribute flags octet is set to 1, and the attribute is retained for 1652 propagation to other BGP speakers. 1654 If an optional attribute is recognized, and has a valid value, then, 1655 depending on the type of the optional attribute, it is processed 1656 locally, retained, and updated, if necessary, for possible 1657 propagation to other BGP speakers. 1659 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 1660 the previously advertised routes whose destinations (expressed as IP 1661 prefixes) contained in this field shall be removed from the Adj-RIB- 1662 In. This BGP speaker shall run its Decision Process since the 1663 previously advertised route is not longer available for use. 1665 If the UPDATE message contains a feasible route, it shall be placed 1666 in the appropriate Adj-RIB-In, and the following additional actions 1667 shall be taken: 1669 i) If its Network Layer Reachability Information (NLRI) is identical 1670 to the one of a route currently stored in the Adj-RIB-In, then the 1671 new route shall replace the older route in the Adj-RIB-In, thus 1672 implicitly withdrawing the older route from service. The BGP speaker 1673 shall run its Decision Process since the older route is no longer 1674 available for use. 1676 ii) If the new route is an overlapping route that is included (see 1677 9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP 1678 speaker shall run its Decision Process since the more specific route 1679 has implicitly made a portion of the less specific route unavailable 1680 for use. 1682 iii) If the new route has identical path attributes to an earlier 1683 route contained in the Adj-RIB-In, and is more specific (see 9.1.4) 1684 than the earlier route, no further actions are necessary. 1686 RFC DRAFT April 2000 1688 iv) If the new route has NLRI that is not present in any of the 1689 routes currently stored in the Adj-RIB-In, then the new route shall 1690 be placed in the Adj-RIB-In. The BGP speaker shall run its Decision 1691 Process. 1693 v) If the new route is an overlapping route that is less specific 1694 (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the 1695 BGP speaker shall run its Decision Process on the set of destinations 1696 described only by the less specific route. 1698 9.1 Decision Process 1700 The Decision Process selects routes for subsequent advertisement by 1701 applying the policies in the local Policy Information Base (PIB) to 1702 the routes stored in its Adj-RIB-In. The output of the Decision 1703 Process is the set of routes that will be advertised to all peers; 1704 the selected routes will be stored in the local speaker's Adj-RIB- 1705 Out. 1707 The selection process is formalized by defining a function that takes 1708 the attribute of a given route as an argument and returns a non- 1709 negative integer denoting the degree of preference for the route. 1710 The function that calculates the degree of preference for a given 1711 route shall not use as its inputs any of the following: the 1712 existence of other routes, the non-existence of other routes, or the 1713 path attributes of other routes. Route selection then consists of 1714 individual application of the degree of preference function to each 1715 feasible route, followed by the choice of the one with the highest 1716 degree of preference. 1718 The Decision Process operates on routes contained in each Adj-RIB-In, 1719 and is responsible for: 1721 - selection of routes to be advertised to internal peers 1723 - selection of routes to be advertised to external peers 1725 - route aggregation and route information reduction 1727 The Decision Process takes place in three distinct phases, each 1728 triggered by a different event: 1730 a) Phase 1 is responsible for calculating the degree of preference 1731 for each route received from an external peer, and MAY also 1732 advertise to all the internal peers the routes from external 1733 peers that have the highest degree of preference for each distinct 1734 RFC DRAFT April 2000 1736 destination. 1738 b) Phase 2 is invoked on completion of phase 1. It is responsible 1739 for choosing the best route out of all those available for each 1740 distinct destination, and for installing each chosen route into 1741 the appropriate Loc-RIB. 1743 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 1744 responsible for disseminating routes in the Loc-RIB to each 1745 external peer, according to the policies contained in the PIB. 1746 Route aggregation and information reduction can optionally be 1747 performed within this phase. 1749 9.1.1 Phase 1: Calculation of Degree of Preference 1751 The Phase 1 decision function shall be invoked whenever the local BGP 1752 speaker receives from a peer an UPDATE message that advertises a new 1753 route, a replacement route, or withdrawn routes. 1755 The Phase 1 decision function is a separate process which completes 1756 when it has no further work to do. 1758 The Phase 1 decision function shall lock an Adj-RIB-In prior to 1759 operating on any route contained within it, and shall unlock it after 1760 operating on all new or unfeasible routes contained within it. 1762 For the newly received or replacement feasible route, the local BGP 1763 speaker shall determine a degree of preference. If the route is 1764 learned from an internal peer, the value of the LOCAL_PREF attribute 1765 shall be taken as the degree of preference. If the route is learned 1766 from an external peer, then the degree of preference shall be 1767 computed based on preconfigured policy information and used as the 1768 LOCAL_PREF value in any IBGP readvertisement. The exact nature of 1769 this policy information and the computation involved is a local 1770 matter. For a route learned from an external peer, the local speaker 1771 shall then run the internal update process of 9.2.1 to select and 1772 advertise the most preferable route. 1774 9.1.2 Phase 2: Route Selection 1776 The Phase 2 decision function shall be invoked on completion of Phase 1777 1. The Phase 2 function is a separate process which completes when 1778 it has no further work to do. The Phase 2 process shall consider all 1779 routes that are present in the Adj-RIBs-In, including those received 1780 RFC DRAFT April 2000 1782 from both internal and external peers. 1784 The Phase 2 decision function shall be blocked from running while the 1785 Phase 3 decision function is in process. The Phase 2 function shall 1786 lock all Adj-RIBs-In prior to commencing its function, and shall 1787 unlock them on completion. 1789 If the NEXT_HOP attribute of a BGP route depicts an address to which 1790 the local BGP speaker doesn't have a route in its Loc-RIB, the BGP 1791 route should be excluded from the Phase 2 decision function. 1793 It is critical that routers within an AS do not make conflicting 1794 decisions regarding route selection that would cause forwarding loops 1795 to occur. 1797 For each set of destinations for which a feasible route exists in the 1798 Adj-RIBs-In, the local BGP speaker shall identify the route that has: 1800 a) the highest degree of preference of any route to the same set 1801 of destinations, or 1803 b) is the only route to that destination, or 1805 c) is selected as a result of the Phase 2 tie breaking rules 1806 specified in 9.1.2.1. 1808 The local speaker SHALL then install that route in the Loc-RIB, 1809 replacing any route to the same destination that is currently being 1810 held in the Loc-RIB. The local speaker MUST determine the immediate 1811 next hop to the address depicted by the NEXT_HOP attribute of the 1812 selected route by performing a lookup in the IGP and selecting one of 1813 the possible paths in the IGP. This immediate next hop MUST be used 1814 when installing the selected route in the Loc-RIB. If the route to 1815 the address depicted by the NEXT_HOP attribute changes such that the 1816 immediate next hop changes, route selection should be recalculated as 1817 specified above. 1819 Unfeasible routes shall be removed from the Loc-RIB, and 1820 corresponding unfeasible routes shall then be removed from the Adj- 1821 RIBs-In. 1823 9.1.2.1 Breaking Ties (Phase 2) 1825 In its Adj-RIBs-In a BGP speaker may have several routes to the same 1826 destination that have the same degree of preference. The local 1827 RFC DRAFT April 2000 1829 speaker can select only one of these routes for inclusion in the 1830 associated Loc-RIB. The local speaker considers all routes with the 1831 same degrees of preference, both those received from internal peers, 1832 and those received from external peers. 1834 The following tie-breaking procedure assumes that for each candidate 1835 route all the BGP speakers within an autonomous system can ascertain 1836 the cost of a path (interior distance) to the address depicted by the 1837 NEXT_HOP attribute of the route. 1839 The tie-breaking algorithm begins by considering all equally 1840 preferable routes and then selects routes to be removed from 1841 consideration. The algorithm terminates as soon as only one route 1842 remains in consideration. The criteria must be applied in the order 1843 specified. 1845 Several of the criteria are described using pseudo-code. Note that 1846 the pseudo-code shown was chosen for clarity, not efficiency. It is 1847 not intended to specify any particular implementation. BGP 1848 implementations MAY use any algorithm which produces the same results 1849 as those described here. 1851 a) Remove from consideration routes with less-preferred 1852 MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable 1853 between routes learned from the same neighboring AS. Routes which 1854 do not have the MULTI_EXIT_DISC attribute are considered to have 1855 the highest possible MULTI_EXIT_DISC value. 1857 This is also described in the following procedure: 1859 for m = all routes still under consideration 1860 for n = all routes still under consideration 1861 if (neighborAS(m) == neighborAS(n)) and (MED(n) < MED(m)) 1862 remove route m from consideration 1864 In the pseudo-code above, MED(n) is a function which returns the 1865 value of route n's MULTI_EXIT_DISC attribute. If route n has no 1866 MULTI_EXIT_DISC attribute, the function returns the highest 1867 possible MULTI_EXIT_DISC value, i.e. 2^32-1. 1869 Similarly, neighborAS(n) is a function which returns the neighbor 1870 AS from which the route was received. 1872 b) Remove from consideration any routes with less-preferred 1873 interior cost. The interior cost of a route is determined by 1874 calculating the metric to the next hop for the route using the 1875 interior routing protocol(s). If the next hop for a route is 1876 reachable, but no cost can be determined, then this step should be 1877 RFC DRAFT April 2000 1879 should be skipped (equivalently, consider all routes to have equal 1880 costs). 1882 This is also described in the following procedure. 1884 for m = all routes still under consideration 1885 for n = all routes in still under consideration 1886 if (cost(n) is better than cost(m)) 1887 remove m from consideration 1889 In the pseudo-code above, cost(n) is a function which returns the 1890 cost of the path (interior distance) to the address given in the 1891 NEXT_HOP attribute of the route. 1893 c) If at least one of the candidate routes was received from an 1894 external peer in a neighboring autonomous system, remove from 1895 consideration all routes which were received from internal peers. 1897 d) Remove from consideration all routes other than the route that 1898 was advertised by the BGP speaker whose BGP Identifier has the 1899 lowest value. 1901 9.1.3 Phase 3: Route Dissemination 1903 The Phase 3 decision function shall be invoked on completion of Phase 1904 2, or when any of the following events occur: 1906 a) when routes in a Loc-RIB to local destinations have changed 1908 b) when locally generated routes learned by means outside of BGP 1909 have changed 1911 c) when a new BGP speaker - BGP speaker connection has been 1912 established 1914 The Phase 3 function is a separate process which completes when it 1915 has no further work to do. The Phase 3 Routing Decision function 1916 shall be blocked from running while the Phase 2 decision function is 1917 in process. 1919 All routes in the Loc-RIB shall be processed into a corresponding 1920 entry in the associated Adj-RIBs-Out. Route aggregation and 1921 information reduction techniques (see 9.2.4.1) may optionally be 1922 applied. 1924 For the benefit of future support of inter-AS multicast capabilities, 1925 RFC DRAFT April 2000 1927 a BGP speaker that participates in inter-AS multicast routing shall 1928 advertise a route it receives from one of its external peers and if 1929 it installs it in its Loc-RIB, it shall advertise it back to the peer 1930 from which the route was received. For a BGP speaker that does not 1931 participate in inter-AS multicast routing such an advertisement is 1932 optional. When doing such an advertisement, the NEXT_HOP attribute 1933 should be set to the address of the peer. An implementation may also 1934 optimize such an advertisement by truncating information in the 1935 AS_PATH attribute to include only its own AS number and that of the 1936 peer that advertised the route (such truncation requires the ORIGIN 1937 attribute to be set to INCOMPLETE). In addition an implementation is 1938 not required to pass optional or discretionary path attributes with 1939 such an advertisement. 1941 When the updating of the Adj-RIBs-Out and the Forwarding Information 1942 Base (FIB) is complete, the local BGP speaker shall run the external 1943 update process of 9.2.2. 1945 9.1.4 Overlapping Routes 1947 A BGP speaker may transmit routes with overlapping Network Layer 1948 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 1949 occurs when a set of destinations are identified in non-matching 1950 multiple routes. Since BGP encodes NLRI using IP prefixes, overlap 1951 will always exhibit subset relationships. A route describing a 1952 smaller set of destinations (a longer prefix) is said to be more 1953 specific than a route describing a larger set of destinations (a 1954 shorted prefix); similarly, a route describing a larger set of 1955 destinations (a shorter prefix) is said to be less specific than a 1956 route describing a smaller set of destinations (a longer prefix). 1958 The precedence relationship effectively decomposes less specific 1959 routes into two parts: 1961 - a set of destinations described only by the less specific 1962 route, and 1964 - a set of destinations described by the overlap of the less 1965 specific and the more specific routes 1967 When overlapping routes are present in the same Adj-RIB-In, the more 1968 specific route shall take precedence, in order from more specific to 1969 least specific. 1971 The set of destinations described by the overlap represents a portion 1972 RFC DRAFT April 2000 1974 of the less specific route that is feasible, but is not currently in 1975 use. If a more specific route is later withdrawn, the set of 1976 destinations described by the overlap will still be reachable using 1977 the less specific route. 1979 If a BGP speaker receives overlapping routes, the Decision Process 1980 MUST consider both routes based on the configured acceptance policy. 1981 If both a less and a more specific route are accepted, then the 1982 Decision Process MUST either install both the less and the more 1983 specific routes or it MUST aggregate the two routes and install the 1984 aggregated route. 1986 If a BGP speaker chooses to aggregate, then it MUST add 1987 ATOMIC_AGGREGATE attribute to the route. A route that carries 1988 ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the 1989 NLRI of this route can not be made more specific. Forwarding along 1990 such a route does not guarantee that IP packets will actually 1991 traverse only ASs listed in the AS_PATH attribute of the route. 1993 9.2 Update-Send Process 1995 The Update-Send process is responsible for advertising UPDATE 1996 messages to all peers. For example, it distributes the routes chosen 1997 by the Decision Process to other BGP speakers which may be located in 1998 either the same autonomous system or a neighboring autonomous system. 1999 Rules for information exchange between BGP speakers located in 2000 different autonomous systems are given in 9.2.2; rules for 2001 information exchange between BGP speakers located in the same 2002 autonomous system are given in 9.2.1. 2004 Distribution of routing information between a set of BGP speakers, 2005 all of which are located in the same autonomous system, is referred 2006 to as internal distribution. 2008 9.2.1 Internal Updates 2010 The Internal update process is concerned with the distribution of 2011 routing information to internal peers. 2013 When a BGP speaker receives an UPDATE message from an internal peer, 2014 the receiving BGP speaker shall not re-distribute the routing 2015 information contained in that UPDATE message to other internal peers. 2017 When a BGP speaker receives a new route from an external peer, it 2018 RFC DRAFT April 2000 2020 MUST advertise that route to all other internal peers by means of an 2021 UPDATE message if this route will be installed in its Loc-RIB 2022 according to the route selection rules in 9.1.2. 2024 When a BGP speaker receives an UPDATE message with a non-empty 2025 WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all 2026 routes whose destinations was carried in this field (as IP prefixes). 2027 The speaker shall take the following additional steps: 2029 1) if the corresponding feasible route had not been previously 2030 advertised, then no further action is necessary 2032 2) if the corresponding feasible route had been previously 2033 advertised, then: 2035 i) if a new route is selected for advertisement that has the 2036 same Network Layer Reachability Information as the unfeasible 2037 routes, then the local BGP speaker shall advertise the 2038 replacement route 2040 ii) if a replacement route is not available for advertisement, 2041 then the BGP speaker shall include the destinations of the 2042 unfeasible route (in form of IP prefixes) in the WITHDRAWN 2043 ROUTES field of an UPDATE message, and shall send this message 2044 to each peer to whom it had previously advertised the 2045 corresponding feasible route. 2047 All feasible routes which are advertised shall be placed in the 2048 appropriate Adj-RIBs-Out, and all unfeasible routes which are 2049 advertised shall be removed from the Adj-RIBs-Out. 2051 9.2.1.1 Breaking Ties (Internal Updates) 2053 If a local BGP speaker has connections to several external peers, 2054 there will be multiple Adj-RIBs-In associated with these peers. These 2055 Adj-RIBs-In might contain several equally preferable routes to the 2056 same destination, all of which were advertised by external peers. 2057 The local BGP speaker shall select one of these routes according to 2058 the following rules: 2060 a) If the candidate routes differ only in their NEXT_HOP and 2061 MULTI_EXIT_DISC attributes, and the local system is configured to 2062 take into account the MULTI_EXIT_DISC attribute, select the route 2063 that has the lowest value of the MULTI_EXIT_DISC attribute. A 2064 route with the MULTI_EXIT_DISC attribute shall be preferred to a 2065 RFC DRAFT April 2000 2067 route without the MULTI_EXIT_DISC attribute. 2069 b) If the local system can ascertain the cost of a path to the 2070 entity depicted by the NEXT_HOP attribute of the candidate route, 2071 select the route with the lowest cost. 2073 c) In all other cases, select the route that was advertised by the 2074 BGP speaker whose BGP Identifier has the lowest value. 2076 9.2.2 External Updates 2078 The external update process is concerned with the distribution of 2079 routing information to external peers. As part of Phase 3 route 2080 selection process, the BGP speaker has updated its Adj-RIBs-Out and 2081 its Forwarding Table. All newly installed routes and all newly 2082 unfeasible routes for which there is no replacement route shall be 2083 advertised to external peers by means of UPDATE message. 2085 Any routes in the Loc-RIB marked as unfeasible shall be removed. 2086 Changes to the reachable destinations within its own autonomous 2087 system shall also be advertised in an UPDATE message. 2089 9.2.3 Controlling Routing Traffic Overhead 2091 The BGP protocol constrains the amount of routing traffic (that is, 2092 UPDATE messages) in order to limit both the link bandwidth needed to 2093 advertise UPDATE messages and the processing power needed by the 2094 Decision Process to digest the information contained in the UPDATE 2095 messages. 2097 9.2.3.1 Frequency of Route Advertisement 2099 The parameter MinRouteAdvertisementInterval determines the minimum 2100 amount of time that must elapse between advertisement of routes to a 2101 particular destination from a single BGP speaker. This rate limiting 2102 procedure applies on a per-destination basis, although the value of 2103 MinRouteAdvertisementInterval is set on a per BGP peer basis. 2105 Two UPDATE messages sent from a single BGP speaker that advertise 2106 feasible routes to some common set of destinations received from 2107 external peers must be separated by at least 2108 RFC DRAFT April 2000 2110 MinRouteAdvertisementInterval. Clearly, this can only be achieved 2111 precisely by keeping a separate timer for each common set of 2112 destinations. This would be unwarranted overhead. Any technique which 2113 ensures that the interval between two UPDATE messages sent from a 2114 single BGP speaker that advertise feasible routes to some common set 2115 of destinations received from external peers will be at least 2116 MinRouteAdvertisementInterval, and will also ensure a constant upper 2117 bound on the interval is acceptable. 2119 Since fast convergence is needed within an autonomous system, this 2120 procedure does not apply for routes received from other internal 2121 peers. To avoid long-lived black holes, the procedure does not apply 2122 to the explicit withdrawal of unfeasible routes (that is, routes 2123 whose destinations (expressed as IP prefixes) are listed in the 2124 WITHDRAWN ROUTES field of an UPDATE message). 2126 This procedure does not limit the rate of route selection, but only 2127 the rate of route advertisement. If new routes are selected multiple 2128 times while awaiting the expiration of MinRouteAdvertisementInterval, 2129 the last route selected shall be advertised at the end of 2130 MinRouteAdvertisementInterval. 2132 9.2.3.2 Frequency of Route Origination 2134 The parameter MinASOriginationInterval determines the minimum amount 2135 of time that must elapse between successive advertisements of UPDATE 2136 messages that report changes within the advertising BGP speaker's own 2137 autonomous systems. 2139 9.2.3.3 Jitter 2141 To minimize the likelihood that the distribution of BGP messages by a 2142 given BGP speaker will contain peaks, jitter should be applied to the 2143 timers associated with MinASOriginationInterval, Keepalive, and 2144 MinRouteAdvertisementInterval. A given BGP speaker shall apply the 2145 same jitter to each of these quantities regardless of the 2146 destinations to which the updates are being sent; that is, jitter 2147 will not be applied on a "per peer" basis. 2149 The amount of jitter to be introduced shall be determined by 2150 multiplying the base value of the appropriate timer by a random 2151 factor which is uniformly distributed in the range from 0.75 to 1.0. 2153 RFC DRAFT April 2000 2155 9.2.4 Efficient Organization of Routing Information 2157 Having selected the routing information which it will advertise, a 2158 BGP speaker may avail itself of several methods to organize this 2159 information in an efficient manner. 2161 9.2.4.1 Information Reduction 2163 Information reduction may imply a reduction in granularity of policy 2164 control - after information is collapsed, the same policies will 2165 apply to all destinations and paths in the equivalence class. 2167 The Decision Process may optionally reduce the amount of information 2168 that it will place in the Adj-RIBs-Out by any of the following 2169 methods: 2171 a) Network Layer Reachability Information (NLRI): 2173 Destination IP addresses can be represented as IP address 2174 prefixes. In cases where there is a correspondence between the 2175 address structure and the systems under control of an autonomous 2176 system administrator, it will be possible to reduce the size of 2177 the NLRI carried in the UPDATE messages. 2179 b) AS_PATHs: 2181 AS path information can be represented as ordered AS_SEQUENCEs or 2182 unordered AS_SETs. AS_SETs are used in the route aggregation 2183 algorithm described in 9.2.4.2. They reduce the size of the 2184 AS_PATH information by listing each AS number only once, 2185 regardless of how many times it may have appeared in multiple 2186 AS_PATHs that were aggregated. 2188 An AS_SET implies that the destinations listed in the NLRI can be 2189 reached through paths that traverse at least some of the 2190 constituent autonomous systems. AS_SETs provide sufficient 2191 information to avoid routing information looping; however their 2192 use may prune potentially feasible paths, since such paths are no 2193 longer listed individually as in the form of AS_SEQUENCEs. In 2194 practice this is not likely to be a problem, since once an IP 2195 packet arrives at the edge of a group of autonomous systems, the 2196 BGP speaker at that point is likely to have more detailed path 2197 information and can distinguish individual paths to destinations. 2199 RFC DRAFT April 2000 2201 9.2.4.2 Aggregating Routing Information 2203 Aggregation is the process of combining the characteristics of 2204 several different routes in such a way that a single route can be 2205 advertised. Aggregation can occur as part of the decision process 2206 to reduce the amount of routing information that will be placed in 2207 the Adj-RIBs-Out. 2209 Aggregation reduces the amount of information that a BGP speaker must 2210 store and exchange with other BGP speakers. Routes can be aggregated 2211 by applying the following procedure separately to path attributes of 2212 like type and to the Network Layer Reachability Information. 2214 Routes that have the following attributes shall not be aggregated 2215 unless the corresponding attributes of each route are identical: 2216 MULTI_EXIT_DISC, NEXT_HOP. 2218 Path attributes that have different type codes can not be aggregated 2219 together. Path of the same type code may be aggregated, according to 2220 the following rules: 2222 ORIGIN attribute: If at least one route among routes that are 2223 aggregated has ORIGIN with the value INCOMPLETE, then the 2224 aggregated route must have the ORIGIN attribute with the value 2225 INCOMPLETE. Otherwise, if at least one route among routes that are 2226 aggregated has ORIGIN with the value EGP, then the aggregated 2227 route must have the origin attribute with the value EGP. In all 2228 other case the value of the ORIGIN attribute of the aggregated 2229 route is INTERNAL. 2231 AS_PATH attribute: If routes to be aggregated have identical 2232 AS_PATH attributes, then the aggregated route has the same AS_PATH 2233 attribute as each individual route. 2235 For the purpose of aggregating AS_PATH attributes we model each AS 2236 within the AS_PATH attribute as a tuple , where 2237 "type" identifies a type of the path segment the AS belongs to 2238 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If the 2239 routes to be aggregated have different AS_PATH attributes, then 2240 the aggregated AS_PATH attribute shall satisfy all of the 2241 following conditions: 2243 - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH 2244 shall appear in all of the AS_PATH in the initial set of routes 2245 to be aggregated. 2247 - all tuples of the type AS_SET in the aggregated AS_PATH shall 2248 RFC DRAFT April 2000 2250 appear in at least one of the AS_PATH in the initial set (they 2251 may appear as either AS_SET or AS_SEQUENCE types). 2253 - for any tuple X of the type AS_SEQUENCE in the aggregated 2254 AS_PATH which precedes tuple Y in the aggregated AS_PATH, X 2255 precedes Y in each AS_PATH in the initial set which contains Y, 2256 regardless of the type of Y. 2258 - No tuple with the same value shall appear more than once in 2259 the aggregated AS_PATH, regardless of the tuple's type. 2261 An implementation may choose any algorithm which conforms to these 2262 rules. At a minimum a conformant implementation shall be able to 2263 perform the following algorithm that meets all of the above 2264 conditions: 2266 - determine the longest leading sequence of tuples (as defined 2267 above) common to all the AS_PATH attributes of the routes to be 2268 aggregated. Make this sequence the leading sequence of the 2269 aggregated AS_PATH attribute. 2271 - set the type of the rest of the tuples from the AS_PATH 2272 attributes of the routes to be aggregated to AS_SET, and append 2273 them to the aggregated AS_PATH attribute. 2275 - if the aggregated AS_PATH has more than one tuple with the 2276 same value (regardless of tuple's type), eliminate all, but one 2277 such tuple by deleting tuples of the type AS_SET from the 2278 aggregated AS_PATH attribute. 2280 Appendix 6, section 6.8 presents another algorithm that satisfies 2281 the conditions and allows for more complex policy configurations. 2283 ATOMIC_AGGREGATE: If at least one of the routes to be aggregated 2284 has ATOMIC_AGGREGATE path attribute, then the aggregated route 2285 shall have this attribute as well. 2287 AGGREGATOR: All AGGREGATOR attributes of all routes to be 2288 aggregated should be ignored. 2290 9.3 Route Selection Criteria 2292 Generally speaking, additional rules for comparing routes among 2293 several alternatives are outside the scope of this document. There 2294 are two exceptions: 2296 RFC DRAFT April 2000 2298 - If the local AS appears in the AS path of the new route being 2299 considered, then that new route cannot be viewed as better than 2300 any other route. If such a route were ever used, a routing loop 2301 could result (see Section 6.3). 2303 - In order to achieve successful distributed operation, only 2304 routes with a likelihood of stability can be chosen. Thus, an AS 2305 must avoid using unstable routes, and it must not make rapid 2306 spontaneous changes to its choice of route. Quantifying the terms 2307 "unstable" and "rapid" in the previous sentence will require 2308 experience, but the principle is clear. 2310 9.4 Originating BGP routes 2312 A BGP speaker may originate BGP routes by injecting routing 2313 information acquired by some other means (e.g. via an IGP) into BGP. 2314 A BGP speaker that originates BGP routes shall assign the degree of 2315 preference to these routes by passing them through the Decision 2316 Process (see Section 9.1). These routes may also be distributed to 2317 other BGP speakers within the local AS as part of the Internal update 2318 process (see Section 9.2.1). The decision whether to distribute non- 2319 BGP acquired routes within an AS via BGP or not depends on the 2320 environment within the AS (e.g. type of IGP) and should be controlled 2321 via configuration. 2323 Appendix 1. BGP FSM State Transitions and Actions. 2325 This Appendix discusses the transitions between states in the BGP FSM 2326 in response to BGP events. The following is the list of these states 2327 and events when the negotiated Hold Time value is non-zero. 2329 BGP States: 2331 1 - Idle 2332 2 - Connect 2333 3 - Active 2334 4 - OpenSent 2335 5 - OpenConfirm 2336 6 - Established 2338 BGP Events: 2340 RFC DRAFT April 2000 2342 1 - BGP Start 2343 2 - BGP Stop 2344 3 - BGP Transport connection open 2345 4 - BGP Transport connection closed 2346 5 - BGP Transport connection open failed 2347 6 - BGP Transport fatal error 2348 7 - ConnectRetry timer expired 2349 8 - Hold Timer expired 2350 9 - KeepAlive timer expired 2351 10 - Receive OPEN message 2352 11 - Receive KEEPALIVE message 2353 12 - Receive UPDATE messages 2354 13 - Receive NOTIFICATION message 2356 The following table describes the state transitions of the BGP FSM 2357 and the actions triggered by these transitions. 2359 Event Actions Message Sent Next State 2360 -------------------------------------------------------------------- 2361 Idle (1) 2362 1 Initialize resources none 2 2363 Start ConnectRetry timer 2364 Initiate a transport connection 2365 others none none 1 2367 Connect(2) 2368 1 none none 2 2369 3 Complete initialization OPEN 4 2370 Clear ConnectRetry timer 2371 5 Restart ConnectRetry timer none 3 2372 7 Restart ConnectRetry timer none 2 2373 Initiate a transport connection 2374 others Release resources none 1 2376 Active (3) 2377 1 none none 3 2378 3 Complete initialization OPEN 4 2379 Clear ConnectRetry timer 2380 5 Close connection 3 2381 Restart ConnectRetry timer 2382 7 Restart ConnectRetry timer none 2 2383 Initiate a transport connection 2384 others Release resources none 1 2385 RFC DRAFT April 2000 2387 OpenSent(4) 2388 1 none none 4 2389 4 Close transport connection none 3 2390 Restart ConnectRetry timer 2391 6 Release resources none 1 2392 10 Process OPEN is OK KEEPALIVE 5 2393 Process OPEN failed NOTIFICATION 1 2394 others Close transport connection NOTIFICATION 1 2395 Release resources 2397 OpenConfirm (5) 2398 1 none none 5 2399 4 Release resources none 1 2400 6 Release resources none 1 2401 9 Restart KeepAlive timer KEEPALIVE 5 2402 11 Complete initialization none 6 2403 Restart Hold Timer 2404 13 Close transport connection 1 2405 Release resources 2406 others Close transport connection NOTIFICATION 1 2407 Release resources 2409 Established (6) 2410 1 none none 6 2411 4 Release resources none 1 2412 6 Release resources none 1 2413 9 Restart KeepAlive timer KEEPALIVE 6 2414 11 Restart Hold Timer KEEPALIVE 6 2415 12 Process UPDATE is OK UPDATE 6 2416 Process UPDATE failed NOTIFICATION 1 2417 13 Close transport connection 1 2418 Release resources 2419 others Close transport connection NOTIFICATION 1 2420 Release resources 2421 --------------------------------------------------------------------- 2423 The following is a condensed version of the above state transition 2424 table. 2426 Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab 2427 RFC DRAFT April 2000 2429 | (1) | (2) | (3) | (4) | (5) | (6) 2430 |--------------------------------------------------------------- 2431 1 | 2 | 2 | 3 | 4 | 5 | 6 2432 | | | | | | 2433 2 | 1 | 1 | 1 | 1 | 1 | 1 2434 | | | | | | 2435 3 | 1 | 4 | 4 | 1 | 1 | 1 2436 | | | | | | 2437 4 | 1 | 1 | 1 | 3 | 1 | 1 2438 | | | | | | 2439 5 | 1 | 3 | 3 | 1 | 1 | 1 2440 | | | | | | 2441 6 | 1 | 1 | 1 | 1 | 1 | 1 2442 | | | | | | 2443 7 | 1 | 2 | 2 | 1 | 1 | 1 2444 | | | | | | 2445 8 | 1 | 1 | 1 | 1 | 1 | 1 2446 | | | | | | 2447 9 | 1 | 1 | 1 | 1 | 5 | 6 2448 | | | | | | 2449 10 | 1 | 1 | 1 | 1 or 5 | 1 | 1 2450 | | | | | | 2451 11 | 1 | 1 | 1 | 1 | 6 | 6 2452 | | | | | | 2453 12 | 1 | 1 | 1 | 1 | 1 | 1 or 6 2454 | | | | | | 2455 13 | 1 | 1 | 1 | 1 | 1 | 1 2456 | | | | | | 2457 --------------------------------------------------------------- 2459 Appendix 2. Comparison with RFC1267 2461 BGP-4 is capable of operating in an environment where a set of 2462 reachable destinations may be expressed via a single IP prefix. The 2463 concept of network classes, or subnetting is foreign to BGP-4. To 2464 accommodate these capabilities BGP-4 changes semantics and encoding 2465 associated with the AS_PATH attribute. New text has been added to 2466 define semantics associated with IP prefixes. These abilities allow 2467 BGP-4 to support the proposed supernetting scheme [9]. 2469 To simplify configuration this version introduces a new attribute, 2470 LOCAL_PREF, that facilitates route selection procedures. 2472 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 2474 RFC DRAFT April 2000 2476 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 2477 certain aggregates are not de-aggregated. Another new attribute, 2478 AGGREGATOR, can be added to aggregate routes in order to advertise 2479 which AS and which BGP speaker within that AS caused the aggregation. 2481 To insure that Hold Timers are symmetric, the Hold Time is now 2482 negotiated on a per-connection basis. Hold Times of zero are now 2483 supported. 2485 Appendix 3. Comparison with RFC 1163 2487 All of the changes listed in Appendix 2, plus the following. 2489 To detect and recover from BGP connection collision, a new field (BGP 2490 Identifier) has been added to the OPEN message. New text (Section 2491 6.8) has been added to specify the procedure for detecting and 2492 recovering from collision. 2494 The new document no longer restricts the border router that is passed 2495 in the NEXT_HOP path attribute to be part of the same Autonomous 2496 System as the BGP Speaker. 2498 New document optimizes and simplifies the exchange of the information 2499 about previously reachable routes. 2501 Appendix 4. Comparison with RFC 1105 2503 All of the changes listed in Appendices 2 and 3, plus the following. 2505 Minor changes to the RFC1105 Finite State Machine were necessary to 2506 accommodate the TCP user interface provided by 4.3 BSD. 2508 The notion of Up/Down/Horizontal relations present in RFC1105 has 2509 been removed from the protocol. 2511 The changes in the message format from RFC1105 are as follows: 2513 1. The Hold Time field has been removed from the BGP header and 2514 added to the OPEN message. 2516 2. The version field has been removed from the BGP header and 2517 added to the OPEN message. 2519 3. The Link Type field has been removed from the OPEN message. 2521 RFC DRAFT April 2000 2523 4. The OPEN CONFIRM message has been eliminated and replaced with 2524 implicit confirmation provided by the KEEPALIVE message. 2526 5. The format of the UPDATE message has been changed 2527 significantly. New fields were added to the UPDATE message to 2528 support multiple path attributes. 2530 6. The Marker field has been expanded and its role broadened to 2531 support authentication. 2533 Note that quite often BGP, as specified in RFC 1105, is referred 2534 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 2535 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 2536 BGP, as specified in this document is referred to as BGP-4. 2538 Appendix 5. TCP options that may be used with BGP 2540 If a local system TCP user interface supports TCP PUSH function, then 2541 each BGP message should be transmitted with PUSH flag set. Setting 2542 PUSH flag forces BGP messages to be transmitted promptly to the 2543 receiver. 2545 If a local system TCP user interface supports setting precedence for 2546 TCP connection, then the BGP transport connection should be opened 2547 with precedence set to Internetwork Control (110) value (see also 2548 [6]). 2550 Appendix 6. Implementation Recommendations 2552 This section presents some implementation recommendations. 2554 6.1 Multiple Networks Per Message 2556 The BGP protocol allows for multiple address prefixes with the same 2557 AS path and next-hop gateway to be specified in one message. Making 2558 use of this capability is highly recommended. With one address prefix 2559 per message there is a substantial increase in overhead in the 2560 receiver. Not only does the system overhead increase due to the 2561 reception of multiple messages, but the overhead of scanning the 2562 routing table for updates to BGP peers and other routing protocols 2563 (and sending the associated messages) is incurred multiple times as 2564 RFC DRAFT April 2000 2566 well. One method of building messages containing many address 2567 prefixes per AS path and gateway from a routing table that is not 2568 organized per AS path is to build many messages as the routing table 2569 is scanned. As each address prefix is processed, a message for the 2570 associated AS path and gateway is allocated, if it does not exist, 2571 and the new address prefix is added to it. If such a message exists, 2572 the new address prefix is just appended to it. If the message lacks 2573 the space to hold the new address prefix, it is transmitted, a new 2574 message is allocated, and the new address prefix is inserted into the 2575 new message. When the entire routing table has been scanned, all 2576 allocated messages are sent and their resources released. Maximum 2577 compression is achieved when all the destinations covered by the 2578 address prefixes share a gateway and common path attributes, making 2579 it possible to send many address prefixes in one 4096-byte message. 2581 When peering with a BGP implementation that does not compress 2582 multiple address prefixes into one message, it may be necessary to 2583 take steps to reduce the overhead from the flood of data received 2584 when a peer is acquired or a significant network topology change 2585 occurs. One method of doing this is to limit the rate of updates. 2586 This will eliminate the redundant scanning of the routing table to 2587 provide flash updates for BGP peers and other routing protocols. A 2588 disadvantage of this approach is that it increases the propagation 2589 latency of routing information. By choosing a minimum flash update 2590 interval that is not much greater than the time it takes to process 2591 the multiple messages this latency should be minimized. A better 2592 method would be to read all received messages before sending updates. 2594 6.2 Processing Messages on a Stream Protocol 2596 BGP uses TCP as a transport mechanism. Due to the stream nature of 2597 TCP, all the data for received messages does not necessarily arrive 2598 at the same time. This can make it difficult to process the data as 2599 messages, especially on systems such as BSD Unix where it is not 2600 possible to determine how much data has been received but not yet 2601 processed. 2603 One method that can be used in this situation is to first try to read 2604 just the message header. For the KEEPALIVE message type, this is a 2605 complete message; for other message types, the header should first be 2606 verified, in particular the total length. If all checks are 2607 successful, the specified length, minus the size of the message 2608 header is the amount of data left to read. An implementation that 2609 would "hang" the routing information process while trying to read 2610 from a peer could set up a message buffer (4096 bytes) per peer and 2611 fill it with data as available until a complete message has been 2612 RFC DRAFT April 2000 2614 received. 2616 6.3 Reducing route flapping 2618 To avoid excessive route flapping a BGP speaker which needs to 2619 withdraw a destination and send an update about a more specific or 2620 less specific route SHOULD combine them into the same UPDATE message. 2622 6.4 BGP Timers 2624 BGP employs five timers: ConnectRetry, Hold Time, KeepAlive, 2625 MinASOriginationInterval, and MinRouteAdvertisementInterval The 2626 suggested value for the ConnectRetry timer is 120 seconds. The 2627 suggested value for the Hold Time is 90 seconds. The suggested value 2628 for the KeepAlive timer is 30 seconds. The suggested value for the 2629 MinASOriginationInterval is 15 seconds. The suggested value for the 2630 MinRouteAdvertisementInterval is 30 seconds. 2632 An implementation of BGP MUST allow these timers to be configurable. 2634 6.5 Path attribute ordering 2636 Implementations which combine update messages as described above in 2637 6.1 may prefer to see all path attributes presented in a known order. 2638 This permits them to quickly identify sets of attributes from 2639 different update messages which are semantically identical. To 2640 facilitate this, it is a useful optimization to order the path 2641 attributes according to type code. This optimization is entirely 2642 optional. 2644 6.6 AS_SET sorting 2646 Another useful optimization that can be done to simplify this 2647 situation is to sort the AS numbers found in an AS_SET. This 2648 optimization is entirely optional. 2650 RFC DRAFT April 2000 2652 6.7 Control over version negotiation 2654 Since BGP-4 is capable of carrying aggregated routes which cannot be 2655 properly represented in BGP-3, an implementation which supports BGP-4 2656 and another BGP version should provide the capability to only speak 2657 BGP-4 on a per-peer basis. 2659 6.8 Complex AS_PATH aggregation 2661 An implementation which chooses to provide a path aggregation 2662 algorithm which retains significant amounts of path information may 2663 wish to use the following procedure: 2665 For the purpose of aggregating AS_PATH attributes of two routes, 2666 we model each AS as a tuple , where "type" identifies 2667 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 2668 AS_SET), and "value" is the AS number. Two ASs are said to be the 2669 same if their corresponding tuples are the same. 2671 The algorithm to aggregate two AS_PATH attributes works as 2672 follows: 2674 a) Identify the same ASs (as defined above) within each AS_PATH 2675 attribute that are in the same relative order within both 2676 AS_PATH attributes. Two ASs, X and Y, are said to be in the 2677 same order if either: 2678 - X precedes Y in both AS_PATH attributes, or - Y precedes X 2679 in both AS_PATH attributes. 2681 b) The aggregated AS_PATH attribute consists of ASs identified 2682 in (a) in exactly the same order as they appear in the AS_PATH 2683 attributes to be aggregated. If two consecutive ASs identified 2684 in (a) do not immediately follow each other in both of the 2685 AS_PATH attributes to be aggregated, then the intervening ASs 2686 (ASs that are between the two consecutive ASs that are the 2687 same) in both attributes are combined into an AS_SET path 2688 segment that consists of the intervening ASs from both AS_PATH 2689 attributes; this segment is then placed in between the two 2690 consecutive ASs identified in (a) of the aggregated attribute. 2691 If two consecutive ASs identified in (a) immediately follow 2692 each other in one attribute, but do not follow in another, then 2693 the intervening ASs of the latter are combined into an AS_SET 2694 path segment; this segment is then placed in between the two 2695 consecutive ASs identified in (a) of the aggregated attribute. 2697 RFC DRAFT April 2000 2699 If as a result of the above procedure a given AS number appears 2700 more than once within the aggregated AS_PATH attribute, all, but 2701 the last instance (rightmost occurrence) of that AS number should 2702 be removed from the aggregated AS_PATH attribute. 2704 References 2706 [1] Mills, D., "Exterior Gateway Protocol Formal Specification", 2707 RFC904, April 1984. 2709 [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET 2710 Backbone", RFC1092, February 1989. 2712 [3] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, February 2713 1989. 2715 [4] Postel, J., "Transmission Control Protocol - DARPA Internet 2716 Program Protocol Specification", RFC793, September 1981. 2718 [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway 2719 Protocol in the Internet", RFC1772, March 1995. 2721 [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol 2722 Specification", RFC791, September 1981. 2724 [7] "Information Processing Systems - Telecommunications and 2725 Information Exchange between Systems - Protocol for Exchange of 2726 Inter-domain Routeing Information among Intermediate Systems to 2727 Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 2729 [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter- 2730 Domain Routing (CIDR): an Address Assignment and Aggregation 2731 Strategy", RFC1519, September 1993. 2733 [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation 2734 with CIDR", RFC 1518, September 1993. 2736 Security Considerations 2738 Security issues are not discussed in this document. 2740 Editors' Addresses 2742 Yakov Rekhter 2743 cisco Systems, Inc. 2745 RFC DRAFT April 2000 2747 170 W. Tasman Dr. 2748 San Jose, CA 95134 2749 email: yakov@cisco.com 2751 Tony Li 2752 Procket Networks 2753 3910 Freedom Circle, Ste. 102A 2754 Santa Clara CA 95054 2755 Email: tli@procket.com