idnits 2.17.1 draft-ietf-idr-bgp4-12.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 785: '... MUST NOT be sent more frequently th...' RFC 2119 keyword, line 786: '... implementation MAY adjust the rate a...' RFC 2119 keyword, line 790: '... messages MUST NOT be sent....' (29 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 723 has weird spacing: '... Length are t...' == Line 1165 has weird spacing: '...is less than...' == Line 1659 has weird spacing: '...s whose desti...' == Line 1731 has weird spacing: '...tise to all t...' == Line 2040 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 Juniper Networks 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 January 2001 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 January 2001 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 January 2001 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 January 2001 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 January 2001 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, Loc- 267 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 January 2001 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 January 2001 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 January 2001 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 January 2001 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 January 2001 462 Note that a separate authentication mechanism may be 463 used in establishing the transport level connection. 465 Authentication Data: 467 Authentication Data is a variable length field that is 468 interpreted according to the value of the 469 Authentication Code field. 471 The minimum length of the OPEN message is 29 octets (including 472 message header). 474 4.3 UPDATE Message Format 476 UPDATE messages are used to transfer routing information between BGP 477 peers. The information in the UPDATE packet can be used to construct 478 a graph describing the relationships of the various Autonomous 479 Systems. By applying rules to be discussed, routing information 480 loops and some other anomalies may be detected and removed from 481 inter-AS routing. 483 An UPDATE message is used to advertise a single feasible route to a 484 peer, or to withdraw multiple unfeasible routes from service (see 485 3.1). An UPDATE message may simultaneously advertise a feasible route 486 and withdraw multiple unfeasible routes from service. The UPDATE 487 message always includes the fixed-size BGP header, and can optionally 488 include the other fields as shown below: 490 +-----------------------------------------------------+ 491 | Unfeasible Routes Length (2 octets) | 492 +-----------------------------------------------------+ 493 | Withdrawn Routes (variable) | 494 +-----------------------------------------------------+ 495 | Total Path Attribute Length (2 octets) | 496 +-----------------------------------------------------+ 497 | Path Attributes (variable) | 498 +-----------------------------------------------------+ 499 | Network Layer Reachability Information (variable) | 500 +-----------------------------------------------------+ 502 Unfeasible Routes Length: 504 RFC DRAFT January 2001 506 This 2-octets unsigned integer indicates the total length of 507 the Withdrawn Routes field in octets. Its value must allow the 508 length of the Network Layer Reachability Information field to 509 be determined as specified below. 511 A value of 0 indicates that no routes are being withdrawn from 512 service, and that the WITHDRAWN ROUTES field is not present in 513 this UPDATE message. 515 Withdrawn Routes: 517 This is a variable length field that contains a list of IP 518 address prefixes for the routes that are being withdrawn from 519 service. Each IP address prefix is encoded as a 2-tuple of the 520 form , whose fields are described below: 522 +---------------------------+ 523 | Length (1 octet) | 524 +---------------------------+ 525 | Prefix (variable) | 526 +---------------------------+ 528 The use and the meaning of these fields are as follows: 530 a) Length: 532 The Length field indicates the length in bits of the IP 533 address prefix. A length of zero indicates a prefix that 534 matches all IP addresses (with prefix, itself, of zero 535 octets). 537 b) Prefix: 539 The Prefix field contains an IP address prefix followed by 540 enough trailing bits to make the end of the field fall on an 541 octet boundary. Note that the value of trailing bits is 542 irrelevant. 544 Total Path Attribute Length: 546 This 2-octet unsigned integer indicates the total length of the 547 Path Attributes field in octets. Its value must allow the 548 length of the Network Layer Reachability field to be determined 549 as specified below. 551 A value of 0 indicates that no Network Layer Reachability 552 RFC DRAFT January 2001 554 Information field is present in this UPDATE message. 556 Path Attributes: 558 A variable length sequence of path attributes is present in 559 every UPDATE. Each path attribute is a triple of variable length. 562 Attribute Type is a two-octet field that consists of the 563 Attribute Flags octet followed by the Attribute Type Code 564 octet. 566 0 1 567 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 568 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 569 | Attr. Flags |Attr. Type Code| 570 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 572 The high-order bit (bit 0) of the Attribute Flags octet is the 573 Optional bit. It defines whether the attribute is optional (if 574 set to 1) or well-known (if set to 0). 576 The second high-order bit (bit 1) of the Attribute Flags octet 577 is the Transitive bit. It defines whether an optional 578 attribute is transitive (if set to 1) or non-transitive (if set 579 to 0). For well-known attributes, the Transitive bit must be 580 set to 1. (See Section 5 for a discussion of transitive 581 attributes.) 583 The third high-order bit (bit 2) of the Attribute Flags octet 584 is the Partial bit. It defines whether the information 585 contained in the optional transitive attribute is partial (if 586 set to 1) or complete (if set to 0). For well-known attributes 587 and for optional non-transitive attributes the Partial bit must 588 be set to 0. 590 The fourth high-order bit (bit 3) of the Attribute Flags octet 591 is the Extended Length bit. It defines whether the Attribute 592 Length is one octet (if set to 0) or two octets (if set to 1). 593 Extended Length may be used only if the length of the attribute 594 value is greater than 255 octets. 596 The lower-order four bits of the Attribute Flags octet are . 597 unused. They must be zero (and must be ignored when received). 599 RFC DRAFT January 2001 601 The Attribute Type Code octet contains the Attribute Type Code. 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 648 RFC DRAFT January 2001 650 1 AS_SET: unordered set of ASs a route in the 651 UPDATE message has traversed 653 2 AS_SEQUENCE: ordered set of ASs a route in 654 the UPDATE message has traversed 656 The path segment length is a 1-octet long field containing 657 the number of ASs in the path segment value field. 659 The path segment value field contains one or more AS 660 numbers, each encoded as a 2-octets long field. 662 Usage of this attribute is defined in 5.1.2. 664 c) NEXT_HOP (Type Code 3): 666 This is a well-known mandatory attribute that defines the IP 667 address of the border router that should be used as the next 668 hop to the destinations listed in the Network Layer 669 Reachability field of the UPDATE message. 671 Usage of this attribute is defined in 5.1.3. 673 d) MULTI_EXIT_DISC (Type Code 4): 675 This is an optional non-transitive attribute that is a four 676 octet non-negative integer. The value of this attribute may 677 be used by a BGP speaker's decision process to discriminate 678 among multiple exit points to a neighboring autonomous 679 system. 681 Its usage is defined in 5.1.4. 683 e) LOCAL_PREF (Type Code 5): 685 LOCAL_PREF is a well-known mandatory attribute that is a 686 four octet non-negative integer. It is used by a BGP speaker 687 to inform other internal peers of the advertising speaker's 688 degree of preference for an advertised route. Usage of this 689 attribute is described in 5.1.5. 691 f) ATOMIC_AGGREGATE (Type Code 6) 693 ATOMIC_AGGREGATE is a well-known discretionary attribute of 694 length 0. It is used by a BGP speaker to inform other BGP 695 speakers that the local system selected a less specific 696 route without selecting a more specific route which is 697 RFC DRAFT January 2001 699 included in it. Usage of this attribute is described in 700 5.1.6. 702 g) AGGREGATOR (Type Code 7) 704 AGGREGATOR is an optional transitive attribute of length 6. 705 The attribute contains the last AS number that formed the 706 aggregate route (encoded as 2 octets), followed by the IP 707 address of the BGP speaker that formed the aggregate route 708 (encoded as 4 octets). Usage of this attribute is described 709 in 5.1.7 711 Network Layer Reachability Information: 713 This variable length field contains a list of IP address 714 prefixes. The length in octets of the Network Layer 715 Reachability Information is not encoded explicitly, but can be 716 calculated as: 718 UPDATE message Length - 23 - Total Path Attributes Length - 719 Unfeasible Routes Length 721 where UPDATE message Length is the value encoded in the fixed- 722 size BGP header, Total Path Attribute Length and Unfeasible 723 Routes Length are the values encoded in the variable part of 724 the UPDATE message, and 23 is a combined length of the fixed- 725 size BGP header, the Total Path Attribute Length field and the 726 Unfeasible Routes Length field. 728 Reachability information is encoded as one or more 2-tuples of 729 the form , whose fields are described below: 731 +---------------------------+ 732 | Length (1 octet) | 733 +---------------------------+ 734 | Prefix (variable) | 735 +---------------------------+ 737 The use and the meaning of these fields are as follows: 739 a) Length: 741 The Length field indicates the length in bits of the IP 742 address prefix. A length of zero indicates a prefix that 743 matches all IP addresses (with prefix, itself, of zero 744 octets). 746 RFC DRAFT January 2001 748 b) Prefix: 750 The Prefix field contains IP address prefixes followed by 751 enough trailing bits to make the end of the field fall on an 752 octet boundary. Note that the value of the trailing bits is 753 irrelevant. 755 The minimum length of the UPDATE message is 23 octets -- 19 octets 756 for the fixed header + 2 octets for the Unfeasible Routes Length + 2 757 octets for the Total Path Attribute Length (the value of Unfeasible 758 Routes Length is 0 and the value of Total Path Attribute Length is 759 0). 761 An UPDATE message can advertise at most one route, which may be 762 described by several path attributes. All path attributes contained 763 in a given UPDATE messages apply to the destinations carried in the 764 Network Layer Reachability Information field of the UPDATE message. 766 An UPDATE message can list multiple routes to be withdrawn from 767 service. Each such route is identified by its destination (expressed 768 as an IP prefix), which unambiguously identifies the route in the 769 context of the BGP speaker - BGP speaker connection to which it has 770 been previously been advertised. 772 An UPDATE message may advertise only routes to be withdrawn from 773 service, in which case it will not include path attributes or Network 774 Layer Reachability Information. Conversely, it may advertise only a 775 feasible route, in which case the WITHDRAWN ROUTES field need not be 776 present. 778 4.4 KEEPALIVE Message Format 780 BGP does not use any transport protocol-based keep-alive mechanism to 781 determine if peers are reachable. Instead, KEEPALIVE messages are 782 exchanged between peers often enough as not to cause the Hold Timer 783 to expire. A reasonable maximum time between KEEPALIVE messages 784 would be one third of the Hold Time interval. KEEPALIVE messages 785 MUST NOT be sent more frequently than one per second. An 786 implementation MAY adjust the rate at which it sends KEEPALIVE 787 messages as a function of the Hold Time interval. 789 If the negotiated Hold Time interval is zero, then periodic KEEPALIVE 790 messages MUST NOT be sent. 792 KEEPALIVE message consists of only message header and has a length of 793 19 octets. 795 RFC DRAFT January 2001 797 4.5 NOTIFICATION Message Format 799 A NOTIFICATION message is sent when an error condition is detected. 800 The BGP connection is closed immediately after sending it. 802 In addition to the fixed-size BGP header, the NOTIFICATION message 803 contains the following fields: 805 0 1 2 3 806 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 807 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 808 | Error code | Error subcode | Data | 809 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 810 | | 811 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 813 Error Code: 815 This 1-octet unsigned integer indicates the type of 816 NOTIFICATION. The following Error Codes have been defined: 818 Error Code Symbolic Name Reference 820 1 Message Header Error Section 6.1 822 2 OPEN Message Error Section 6.2 824 3 UPDATE Message Error Section 6.3 826 4 Hold Timer Expired Section 6.5 828 5 Finite State Machine Error Section 6.6 830 6 Cease Section 6.7 832 Error subcode: 834 This 1-octet unsigned integer provides more specific 835 information about the nature of the reported error. Each Error 836 Code may have one or more Error Subcodes associated with it. 837 If no appropriate Error Subcode is defined, then a zero 838 (Unspecific) value is used for the Error Subcode field. 840 RFC DRAFT January 2001 842 Message Header Error subcodes: 844 1 - Connection Not Synchronized. 845 2 - Bad Message Length. 846 3 - Bad Message Type. 848 OPEN Message Error subcodes: 850 1 - Unsupported Version Number. 851 2 - Bad Peer AS. 852 3 - Bad BGP Identifier. 853 4 - Unsupported Optional Parameter. 854 5 - Authentication Failure. 855 6 - Unacceptable Hold Time. 857 UPDATE Message Error subcodes: 859 1 - Malformed Attribute List. 860 2 - Unrecognized Well-known Attribute. 861 3 - Missing Well-known Attribute. 862 4 - Attribute Flags Error. 863 5 - Attribute Length Error. 864 6 - Invalid ORIGIN Attribute 865 8 - Invalid NEXT_HOP Attribute. 866 9 - Optional Attribute Error. 867 10 - Invalid Network Field. 868 11 - Malformed AS_PATH. 870 Data: 872 This variable-length field is used to diagnose the reason for 873 the NOTIFICATION. The contents of the Data field depend upon 874 the Error Code and Error Subcode. See Section 6 below for more 875 details. 877 Note that the length of the Data field can be determined from 878 the message Length field by the formula: 880 Message Length = 21 + Data Length 882 The minimum length of the NOTIFICATION message is 21 octets 883 (including message header). 885 RFC DRAFT January 2001 887 5. Path Attributes 889 This section discusses the path attributes of the UPDATE message. 891 Path attributes fall into four separate categories: 893 1. Well-known mandatory. 894 2. Well-known discretionary. 895 3. Optional transitive. 896 4. Optional non-transitive. 898 Well-known attributes must be recognized by all BGP implementations. 899 Some of these attributes are mandatory and must be included in every 900 UPDATE message that contains NLRI. Others are discretionary and may 901 or may not be sent in a particular UPDATE message. 903 All well-known attributes must be passed along (after proper 904 updating, if necessary) to other BGP peers. 906 In addition to well-known attributes, each path may contain one or 907 more optional attributes. It is not required or expected that all 908 BGP implementations support all optional attributes. The handling of 909 an unrecognized optional attribute is determined by the setting of 910 the Transitive bit in the attribute flags octet. Paths with 911 unrecognized transitive optional attributes should be accepted. If a 912 path with unrecognized transitive optional attribute is accepted and 913 passed along to other BGP peers, then the unrecognized transitive 914 optional attribute of that path must be passed along with the path to 915 other BGP peers with the Partial bit in the Attribute Flags octet set 916 to 1. If a path with recognized transitive optional attribute is 917 accepted and passed along to other BGP peers and the Partial bit in 918 the Attribute Flags octet is set to 1 by some previous AS, it is not 919 set back to 0 by the current AS. Unrecognized non-transitive optional 920 attributes must be quietly ignored and not passed along to other BGP 921 peers. 923 New transitive optional attributes may be attached to the path by the 924 originator or by any other AS in the path. If they are not attached 925 by the originator, the Partial bit in the Attribute Flags octet is 926 set to 1. The rules for attaching new non-transitive optional 927 attributes will depend on the nature of the specific attribute. The 928 documentation of each new non-transitive optional attribute will be 929 expected to include such rules. (The description of the 930 MULTI_EXIT_DISC attribute gives an example.) All optional attributes 931 (both transitive and non-transitive) may be updated (if appropriate) 932 by ASs in the path. 934 RFC DRAFT January 2001 936 The sender of an UPDATE message should order path attributes within 937 the UPDATE message in ascending order of attribute type. The 938 receiver of an UPDATE message must be prepared to handle path 939 attributes within the UPDATE message that are out of order. 941 The same attribute cannot appear more than once within the Path 942 Attributes field of a particular UPDATE message. 944 The mandatory category refers to an attribute which must be present 945 in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE 946 message. Attributes classified as optional for the purpose of the 947 protocol extension mechanism may be purely discretionary, or 948 discretionary, required, or disallowed in certain contexts. 950 attribute EBGP IBGP 951 ORIGIN mandatory mandatory 952 AS_PATH mandatory mandatory 953 NEXT_HOP mandatory mandatory 954 MULTI_EXIT_DISC discretionary discretionary 955 LOCAL_PREF disallowed required 956 ATOMIC_AGGREGATE see section 5.1.6 and 9.1.4 957 AGGREGATOR discretionary discretionary 959 5.1 Path Attribute Usage 961 The usage of each BGP path attributes is described in the following 962 clauses. 964 5.1.1 ORIGIN 966 ORIGIN is a well-known mandatory attribute. The ORIGIN attribute 967 shall be generated by the autonomous system that originates the 968 associated routing information. It shall be included in the UPDATE 969 messages of all BGP speakers that choose to propagate this 970 information to other BGP speakers. 972 5.1.2 AS_PATH 974 AS_PATH is a well-known mandatory attribute. This attribute 975 RFC DRAFT January 2001 977 identifies the autonomous systems through which routing information 978 carried in this UPDATE message has passed. The components of this 979 list can be AS_SETs or AS_SEQUENCEs. 981 When a BGP speaker propagates a route which it has learned from 982 another BGP speaker's UPDATE message, it shall modify the route's 983 AS_PATH attribute based on the location of the BGP speaker to which 984 the route will be sent: 986 a) When a given BGP speaker advertises the route to an internal 987 peer, the advertising speaker shall not modify the AS_PATH 988 attribute associated with the route. 990 b) When a given BGP speaker advertises the route to an external 991 peer, then the advertising speaker shall update the AS_PATH 992 attribute as follows: 994 1) if the first path segment of the AS_PATH is of type 995 AS_SEQUENCE, the local system shall prepend its own AS number 996 as the last element of the sequence (put it in the leftmost 997 position) 999 2) if the first path segment of the AS_PATH is of type AS_SET, 1000 the local system shall prepend a new path segment of type 1001 AS_SEQUENCE to the AS_PATH, including its own AS number in that 1002 segment. 1004 When a BGP speaker originates a route then: 1006 a) the originating speaker shall include its own AS number in 1007 the AS_PATH attribute of all UPDATE messages sent to an 1008 external peer. (In this case, the AS number of the originating 1009 speaker's autonomous system will be the only entry in the 1010 AS_PATH attribute). 1012 b) the originating speaker shall include an empty AS_PATH 1013 attribute in all UPDATE messages sent to internal peers. (An 1014 empty AS_PATH attribute is one whose length field contains the 1015 value zero). 1017 5.1.3 NEXT_HOP 1019 The NEXT_HOP path attribute defines the IP address of the border 1020 router that should be used as the next hop to the destinations listed 1021 in the UPDATE message. When advertising a NEXT_HOP attribute to an 1022 RFC DRAFT January 2001 1024 external peer, a router may use one of its own interface addresses in 1025 the NEXT_HOP attribute provided the external peer to which the route 1026 is being advertised shares a common subnet with the NEXT_HOP address. 1027 This is known as a "first party" NEXT_HOP attribute. A BGP speaker 1028 can advertise to an external peer an interface of any internal peer 1029 router in the NEXT_HOP attribute provided the external peer to which 1030 the route is being advertised shares a common subnet with the 1031 NEXT_HOP address. This is known as a "third party" NEXT_HOP 1032 attribute. A BGP speaker can advertise any adjacent router in the 1033 NEXT_HOP attribute provided that the IP address of this router was 1034 learned from an external peer and the external peer to which the 1035 route is being advertised shares a common subnet with the NEXT_HOP 1036 address. This is a second form of "third party" NEXT_HOP attribute. 1038 Normally the NEXT_HOP attribute is chosen such that the shortest 1039 available path will be taken. A BGP speaker must be able to support 1040 disabling advertisement of third party NEXT_HOP attributes to handle 1041 imperfectly bridged media. 1043 A BGP speaker must never advertise an address of a peer to that peer 1044 as a NEXT_HOP, for a route that the speaker is originating. A BGP 1045 speaker must never install a route with itself as the next hop. 1047 When a BGP speaker advertises the route to an internal peer, the 1048 advertising speaker should not modify the NEXT_HOP attribute 1049 associated with the route. When a BGP speaker receives the route via 1050 an internal link, it may forward packets to the NEXT_HOP address if 1051 the address contained in the attribute is on a common subnet with the 1052 local and remote BGP speakers. 1054 5.1.4 MULTI_EXIT_DISC 1056 The MULTI_EXIT_DISC attribute may be used on external (inter-AS) 1057 links to discriminate among multiple exit or entry points to the same 1058 neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four 1059 octet unsigned number which is called a metric. All other factors 1060 being equal, the exit or entry point with lower metric should be 1061 preferred. If received over external links, the MULTI_EXIT_DISC 1062 attribute MAY be propagated over internal links to other BGP speakers 1063 within the same AS. The MULTI_EXIT_DISC attribute received from a 1064 neighboring AS MUST NOT be propagated to other neighboring ASs. 1066 A BGP speaker MUST IMPLEMENT a mechanism based on local configuration 1067 which allows the MULTI_EXIT_DISC attribute to be removed from a 1068 route. This MAY be done either prior to or after determining the 1069 degree of preference of the route and performing route selection 1070 RFC DRAFT January 2001 1072 (decision process phases 1 and 2). 1074 An implementation MAY also (based on local configuration) alter the 1075 value of the MULTI_EXIT_DISC attribute received over an external 1076 link. If it does so, it shall do so prior to determining the degree 1077 of preference of the route and performing route selection (decision 1078 process phases 1 and 2). 1080 5.1.5 LOCAL_PREF 1082 LOCAL_PREF is a well-known mandatory attribute that SHALL be included 1083 in all UPDATE messages that a given BGP speaker sends to the other 1084 internal peers. A BGP speaker SHALL calculate the degree of 1085 preference for each external route and include the degree of 1086 preference when advertising a route to its internal peers. The higher 1087 degree of preference MUST be preferred. A BGP speaker shall use the 1088 degree of preference learned via LOCAL_PREF in its decision process 1089 (see section 9.1.1). 1091 A BGP speaker MUST NOT include this attribute in UPDATE messages that 1092 it sends to external peers. If it is contained in an UPDATE message 1093 that is received from an external peer, then this attribute MUST be 1094 ignored by the receiving speaker. 1096 5.1.6 ATOMIC_AGGREGATE 1098 ATOMIC_AGGREGATE is a well-known discretionary attribute. If a BGP 1099 speaker, when presented with a set of overlapping routes from one of 1100 its peers (see 9.1.4), selects the less specific route without 1101 selecting the more specific one, then the local system MUST attach 1102 the ATOMIC_AGGREGATE attribute to the route when propagating it to 1103 other BGP speakers (if that attribute is not already present in the 1104 received less specific route). A BGP speaker that receives a route 1105 with the ATOMIC_AGGREGATE attribute MUST NOT remove the attribute 1106 from the route when propagating it to other speakers. A BGP speaker 1107 that receives a route with the ATOMIC_AGGREGATE attribute MUST NOT 1108 make any NLRI of that route more specific (as defined in 9.1.4) when 1109 advertising this route to other BGP speakers. A BGP speaker that 1110 receives a route with the ATOMIC_AGGREGATE attribute needs to be 1111 cognizant of the fact that the actual path to destinations, as 1112 specified in the NLRI of the route, while having the loop-free 1113 property, may traverse ASs that are not listed in the AS_PATH 1114 attribute. 1116 RFC DRAFT January 2001 1118 5.1.7 AGGREGATOR 1120 AGGREGATOR is an optional transitive attribute which may be included 1121 in updates which are formed by aggregation (see Section 9.2.4.2). A 1122 BGP speaker which performs route aggregation may add the AGGREGATOR 1123 attribute which shall contain its own AS number and IP address. 1125 6. BGP Error Handling. 1127 This section describes actions to be taken when errors are detected 1128 while processing BGP messages. 1130 When any of the conditions described here are detected, a 1131 NOTIFICATION message with the indicated Error Code, Error Subcode, 1132 and Data fields is sent, and the BGP connection is closed. If no 1133 Error Subcode is specified, then a zero must be used. 1135 The phrase "the BGP connection is closed" means that the transport 1136 protocol connection has been closed and that all resources for that 1137 BGP connection have been deallocated. Routing table entries 1138 associated with the remote peer are marked as invalid. The fact that 1139 the routes have become invalid is passed to other BGP peers before 1140 the routes are deleted from the system. 1142 Unless specified explicitly, the Data field of the NOTIFICATION 1143 message that is sent to indicate an error is empty. 1145 6.1 Message Header error handling. 1147 All errors detected while processing the Message Header are indicated 1148 by sending the NOTIFICATION message with Error Code Message Header 1149 Error. The Error Subcode elaborates on the specific nature of the 1150 error. 1152 The expected value of the Marker field of the message header is all 1153 ones if the message type is OPEN. The expected value of the Marker 1154 field for all other types of BGP messages determined based on the 1155 presence of the Authentication Information Optional Parameter in the 1156 BGP OPEN message and the actual authentication mechanism (if the 1157 Authentication Information in the BGP OPEN message is present). If 1158 the Marker field of the message header is not the expected one, then 1159 a synchronization error has occurred and the Error Subcode is set to 1160 Connection Not Synchronized. 1162 RFC DRAFT January 2001 1164 If the Length field of the message header is less than 19 or greater 1165 than 4096, or if the Length field of an OPEN message is less than 1166 the minimum length of the OPEN message, or if the Length field of an 1167 UPDATE message is less than the minimum length of the UPDATE message, 1168 or if the Length field of a KEEPALIVE message is not equal to 19, or 1169 if the Length field of a NOTIFICATION message is less than the 1170 minimum length of the NOTIFICATION message, then the Error Subcode is 1171 set to Bad Message Length. The Data field contains the erroneous 1172 Length field. 1174 If the Type field of the message header is not recognized, then the 1175 Error Subcode is set to Bad Message Type. The Data field contains 1176 the erroneous Type field. 1178 6.2 OPEN message error handling. 1180 All errors detected while processing the OPEN message are indicated 1181 by sending the NOTIFICATION message with Error Code OPEN Message 1182 Error. The Error Subcode elaborates on the specific nature of the 1183 error. 1185 If the version number contained in the Version field of the received 1186 OPEN message is not supported, then the Error Subcode is set to 1187 Unsupported Version Number. The Data field is a 1-octet unsigned 1188 integer, which indicates the largest locally supported version number 1189 less than the version the remote BGP peer bid (as indicated in the 1190 received OPEN message). 1192 If the Autonomous System field of the OPEN message is unacceptable, 1193 then the Error Subcode is set to Bad Peer AS. The determination of 1194 acceptable Autonomous System numbers is outside the scope of this 1195 protocol. 1197 If the Hold Time field of the OPEN message is unacceptable, then the 1198 Error Subcode MUST be set to Unacceptable Hold Time. An 1199 implementation MUST reject Hold Time values of one or two seconds. 1200 An implementation MAY reject any proposed Hold Time. An 1201 implementation which accepts a Hold Time MUST use the negotiated 1202 value for the Hold Time. 1204 If the BGP Identifier field of the OPEN message is syntactically 1205 incorrect, then the Error Subcode is set to Bad BGP Identifier. 1206 Syntactic correctness means that the BGP Identifier field represents 1207 a valid IP host address. 1209 If one of the Optional Parameters in the OPEN message is not 1210 RFC DRAFT January 2001 1212 recognized, then the Error Subcode is set to Unsupported Optional 1213 Parameters. 1215 If the OPEN message carries Authentication Information (as an 1216 Optional Parameter), then the corresponding authentication procedure 1217 is invoked. If the authentication procedure (based on Authentication 1218 Code and Authentication Data) fails, then the Error Subcode is set to 1219 Authentication Failure. 1221 6.3 UPDATE message error handling. 1223 All errors detected while processing the UPDATE message are indicated 1224 by sending the NOTIFICATION message with Error Code UPDATE Message 1225 Error. The error subcode elaborates on the specific nature of the 1226 error. 1228 Error checking of an UPDATE message begins by examining the path 1229 attributes. If the Unfeasible Routes Length or Total Attribute 1230 Length is too large (i.e., if Unfeasible Routes Length + Total 1231 Attribute Length + 23 exceeds the message Length), then the Error 1232 Subcode is set to Malformed Attribute List. 1234 If any recognized attribute has Attribute Flags that conflict with 1235 the Attribute Type Code, then the Error Subcode is set to Attribute 1236 Flags Error. The Data field contains the erroneous attribute (type, 1237 length and value). 1239 If any recognized attribute has Attribute Length that conflicts with 1240 the expected length (based on the attribute type code), then the 1241 Error Subcode is set to Attribute Length Error. The Data field 1242 contains the erroneous attribute (type, length and value). 1244 If any of the mandatory well-known attributes are not present, then 1245 the Error Subcode is set to Missing Well-known Attribute. The Data 1246 field contains the Attribute Type Code of the missing well-known 1247 attribute. 1249 If any of the mandatory well-known attributes are not recognized, 1250 then the Error Subcode is set to Unrecognized Well-known Attribute. 1251 The Data field contains the unrecognized attribute (type, length and 1252 value). 1254 If the ORIGIN attribute has an undefined value, then the Error 1255 Subcode is set to Invalid Origin Attribute. The Data field contains 1256 RFC DRAFT January 2001 1258 the unrecognized attribute (type, length and value). 1260 If the NEXT_HOP attribute field is syntactically incorrect, then the 1261 Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field 1262 contains the incorrect attribute (type, length and value). Syntactic 1263 correctness means that the NEXT_HOP attribute represents a valid IP 1264 host address. Semantic correctness applies only to the external BGP 1265 links. It means that the interface associated with the IP address, as 1266 specified in the NEXT_HOP attribute, shares a common subnet with the 1267 receiving BGP speaker and is not the IP address of the receiving BGP 1268 speaker. If the NEXT_HOP attribute is semantically incorrect, the 1269 error should be logged, and the the route should be ignored. In this 1270 case, no NOTIFICATION message should be sent. 1272 The AS_PATH attribute is checked for syntactic correctness. If the 1273 path is syntactically incorrect, then the Error Subcode is set to 1274 Malformed AS_PATH. 1276 The information carried by the AS_PATH attribute is checked for AS 1277 loops. AS loop detection is done by scanning the full AS path (as 1278 specified in the AS_PATH attribute), and checking that the autonomous 1279 system number of the local system does not appear in the AS path. If 1280 the autonomous system number appears in the AS path the route may be 1281 stored in the Adj-RIB-In, but unless the router is configured to 1282 accept routes with its own autonomous system in the AS path, the 1283 route shall not be passed to the BGP Decision Process. Operations of 1284 a router that is configured to accept routes with its own autonomous 1285 system number in the AS path are outside the scope of this document. 1287 If an optional attribute is recognized, then the value of this 1288 attribute is checked. If an error is detected, the attribute is 1289 discarded, and the Error Subcode is set to Optional Attribute Error. 1290 The Data field contains the attribute (type, length and value). 1292 If any attribute appears more than once in the UPDATE message, then 1293 the Error Subcode is set to Malformed Attribute List. 1295 The NLRI field in the UPDATE message is checked for syntactic 1296 validity. If the field is syntactically incorrect, then the Error 1297 Subcode is set to Invalid Network Field. 1299 An UPDATE message that contains correct path attributes, but no NLRI, 1300 shall be treated as a valid UPDATE message. 1302 RFC DRAFT January 2001 1304 6.4 NOTIFICATION message error handling. 1306 If a peer sends a NOTIFICATION message, and there is an error in that 1307 message, there is unfortunately no means of reporting this error via 1308 a subsequent NOTIFICATION message. Any such error, such as an 1309 unrecognized Error Code or Error Subcode, should be noticed, logged 1310 locally, and brought to the attention of the administration of the 1311 peer. The means to do this, however, lies outside the scope of this 1312 document. 1314 6.5 Hold Timer Expired error handling. 1316 If a system does not receive successive KEEPALIVE and/or UPDATE 1317 and/or NOTIFICATION messages within the period specified in the Hold 1318 Time field of the OPEN message, then the NOTIFICATION message with 1319 Hold Timer Expired Error Code must be sent and the BGP connection 1320 closed. 1322 6.6 Finite State Machine error handling. 1324 Any error detected by the BGP Finite State Machine (e.g., receipt of 1325 an unexpected event) is indicated by sending the NOTIFICATION message 1326 with Error Code Finite State Machine Error. 1328 6.7 Cease. 1330 In absence of any fatal errors (that are indicated in this section), 1331 a BGP peer may choose at any given time to close its BGP connection 1332 by sending the NOTIFICATION message with Error Code Cease. However, 1333 the Cease NOTIFICATION message must not be used when a fatal error 1334 indicated by this section does exist. 1336 6.8 Connection collision detection. 1338 If a pair of BGP speakers try simultaneously to establish a TCP 1339 connection to each other, then two parallel connections between this 1340 pair of speakers might well be formed. We refer to this situation as 1341 connection collision. Clearly, one of these connections must be 1342 closed. 1344 RFC DRAFT January 2001 1346 Based on the value of the BGP Identifier a convention is established 1347 for detecting which BGP connection is to be preserved when a 1348 collision does occur. The convention is to compare the BGP 1349 Identifiers of the peers involved in the collision and to retain only 1350 the connection initiated by the BGP speaker with the higher-valued 1351 BGP Identifier. 1353 Upon receipt of an OPEN message, the local system must examine all of 1354 its connections that are in the OpenConfirm state. A BGP speaker may 1355 also examine connections in an OpenSent state if it knows the BGP 1356 Identifier of the peer by means outside of the protocol. If among 1357 these connections there is a connection to a remote BGP speaker whose 1358 BGP Identifier equals the one in the OPEN message, then the local 1359 system performs the following collision resolution procedure: 1361 1. The BGP Identifier of the local system is compared to the BGP 1362 Identifier of the remote system (as specified in the OPEN 1363 message). 1365 2. If the value of the local BGP Identifier is less than the 1366 remote one, the local system closes BGP connection that already 1367 exists (the one that is already in the OpenConfirm state), and 1368 accepts BGP connection initiated by the remote system. 1370 3. Otherwise, the local system closes newly created BGP connection 1371 (the one associated with the newly received OPEN message), and 1372 continues to use the existing one (the one that is already in the 1373 OpenConfirm state). 1375 Comparing BGP Identifiers is done by treating them as (4-octet 1376 long) unsigned integers. 1378 Unless allowed via configuration, a connection collision with an 1379 existing BGP connection that is in Established state causes 1380 closing of the newly created connection. 1382 Note that a connection collision cannot be detected with 1383 connections that are in Idle, or Connect, or Active states. 1385 Closing the BGP connection (that results from the collision 1386 resolution procedure) is accomplished by sending the NOTIFICATION 1387 message with the Error Code Cease. 1389 RFC DRAFT January 2001 1391 7. BGP Version Negotiation. 1393 BGP speakers may negotiate the version of the protocol by making 1394 multiple attempts to open a BGP connection, starting with the highest 1395 version number each supports. If an open attempt fails with an Error 1396 Code OPEN Message Error, and an Error Subcode Unsupported Version 1397 Number, then the BGP speaker has available the version number it 1398 tried, the version number its peer tried, the version number passed 1399 by its peer in the NOTIFICATION message, and the version numbers that 1400 it supports. If the two peers do support one or more common 1401 versions, then this will allow them to rapidly determine the highest 1402 common version. In order to support BGP version negotiation, future 1403 versions of BGP must retain the format of the OPEN and NOTIFICATION 1404 messages. 1406 8. BGP Finite State machine. 1408 This section specifies BGP operation in terms of a Finite State 1409 Machine (FSM). Following is a brief summary and overview of BGP 1410 operations by state as determined by this FSM. A condensed version 1411 of the BGP FSM is found in Appendix 1. 1413 Initially BGP is in the Idle state. 1415 Idle state: 1417 In this state BGP refuses all incoming BGP connections. No 1418 resources are allocated to the peer. In response to the Start 1419 event (initiated by either system or operator) the local system 1420 initializes all BGP resources, starts the ConnectRetry timer, 1421 initiates a transport connection to other BGP peer, while 1422 listening for connection that may be initiated by the remote 1423 BGP peer, and changes its state to Connect. The exact value of 1424 the ConnectRetry timer is a local matter, but should be 1425 sufficiently large to allow TCP initialization. 1427 If a BGP speaker detects an error, it shuts down the connection 1428 and changes its state to Idle. Getting out of the Idle state 1429 requires generation of the Start event. If such an event is 1430 generated automatically, then persistent BGP errors may result 1431 in persistent flapping of the speaker. To avoid such a 1432 condition it is recommended that Start events should not be 1433 generated immediately for a peer that was previously 1434 transitioned to Idle due to an error. For a peer that was 1435 previously transitioned to Idle due to an error, the time 1436 RFC DRAFT January 2001 1438 between consecutive generation of Start events, if such events 1439 are generated automatically, shall exponentially increase. The 1440 value of the initial timer shall be 60 seconds. The time shall 1441 be doubled for each consecutive retry. 1443 Any other event received in the Idle state is ignored. 1445 Connect state: 1447 In this state BGP is waiting for the transport protocol 1448 connection to be completed. 1450 If the transport protocol connection succeeds, the local system 1451 clears the ConnectRetry timer, completes initialization, sends 1452 an OPEN message to its peer, and changes its state to OpenSent. 1454 If the transport protocol connect fails (e.g., retransmission 1455 timeout), the local system restarts the ConnectRetry timer, 1456 continues to listen for a connection that may be initiated by 1457 the remote BGP peer, and changes its state to Active state. 1459 In response to the ConnectRetry timer expired event, the local 1460 system restarts the ConnectRetry timer, initiates a transport 1461 connection to other BGP peer, continues to listen for a 1462 connection that may be initiated by the remote BGP peer, and 1463 stays in the Connect state. 1465 Start event is ignored in the Connect state. 1467 In response to any other event (initiated by either system or 1468 operator), the local system releases all BGP resources 1469 associated with this connection and changes its state to Idle. 1471 Active state: 1473 In this state BGP is trying to acquire a peer by listening for 1474 and accepting a transport protocol connection. 1476 If the transport protocol connection succeeds, the local system 1477 clears the ConnectRetry timer, completes initialization, sends 1478 an OPEN message to its peer, sets its Hold Timer to a large 1479 value, and changes its state to OpenSent. A Hold Timer value 1480 of 4 minutes is suggested. 1482 In response to the ConnectRetry timer expired event, the local 1483 system restarts the ConnectRetry timer, initiates a transport 1484 connection to other BGP peer, continues to listen for a 1485 connection that may be initiated by the remote BGP peer, and 1486 RFC DRAFT January 2001 1488 changes its state to Connect. 1490 If the local system allows BGP connections with unconfigured 1491 peers, then when the local system detects that a remote peer is 1492 trying to establish a BGP connection to it, and the IP address 1493 of the remote peer is not a configured one, the local system 1494 creates a temporary peer entry, completes initialization, sends 1495 an OPEN message to its peer, sets its Hold Timer to a large 1496 value, and changes its state to OpenSent. 1498 If the local system does not allow BGP connections with 1499 unconfigured peers, then the local system rejects connections 1500 from IP addresses that are not configured peers, and remains in 1501 the Active state. 1503 Start event is ignored in the Active state. 1505 In response to any other event (initiated by either system or 1506 operator), the local system releases all BGP resources 1507 associated with this connection and changes its state to Idle. 1509 OpenSent state: 1511 In this state BGP waits for an OPEN message from its peer. 1512 When an OPEN message is received, all fields are checked for 1513 correctness. If the BGP message header checking or OPEN 1514 message checking detects an error (see Section 6.2), or a 1515 connection collision (see Section 6.8) the local system sends a 1516 NOTIFICATION message and changes its state to Idle. 1518 If there are no errors in the OPEN message, BGP sends a 1519 KEEPALIVE message and sets a KeepAlive timer. The Hold Timer, 1520 which was originally set to a large value (see above), is 1521 replaced with the negotiated Hold Time value (see section 4.2). 1522 If the negotiated Hold Time value is zero, then the Hold Time 1523 timer and KeepAlive timers are not started. If the value of 1524 the Autonomous System field is the same as the local Autonomous 1525 System number, then the connection is an "internal" connection; 1526 otherwise, it is "external". (This will effect UPDATE 1527 processing as described below.) Finally, the state is changed 1528 to OpenConfirm. 1530 If a disconnect notification is received from the underlying 1531 transport protocol, the local system closes the BGP connection, 1532 restarts the ConnectRetry timer, while continue listening for 1533 connection that may be initiated by the remote BGP peer, and 1534 goes into the Active state. 1536 RFC DRAFT January 2001 1538 If the Hold Timer expires, the local system sends NOTIFICATION 1539 message with error code Hold Timer Expired and changes its 1540 state to Idle. 1542 In response to the Stop event (initiated by either system or 1543 operator) the local system sends NOTIFICATION message with 1544 Error Code Cease and changes its state to Idle. 1546 Start event is ignored in the OpenSent state. 1548 In response to any other event the local system sends 1549 NOTIFICATION message with Error Code Finite State Machine Error 1550 and changes its state to Idle. 1552 Whenever BGP changes its state from OpenSent to Idle, it closes 1553 the BGP (and transport-level) connection and releases all 1554 resources associated with that connection. 1556 OpenConfirm state: 1558 In this state BGP waits for a KEEPALIVE or NOTIFICATION 1559 message. 1561 If the local system receives a KEEPALIVE message, it changes 1562 its state to Established. 1564 If the Hold Timer expires before a KEEPALIVE message is 1565 received, the local system sends NOTIFICATION message with 1566 error code Hold Timer Expired and changes its state to Idle. 1568 If the local system receives a NOTIFICATION message, it changes 1569 its state to Idle. 1571 If the KeepAlive timer expires, the local system sends a 1572 KEEPALIVE message and restarts its KeepAlive timer. 1574 If a disconnect notification is received from the underlying 1575 transport protocol, the local system changes its state to Idle. 1577 In response to the Stop event (initiated by either system or 1578 operator) the local system sends NOTIFICATION message with 1579 Error Code Cease and changes its state to Idle. 1581 Start event is ignored in the OpenConfirm state. 1583 In response to any other event the local system sends 1584 NOTIFICATION message with Error Code Finite State Machine Error 1585 and changes its state to Idle. 1587 RFC DRAFT January 2001 1589 Whenever BGP changes its state from OpenConfirm to Idle, it 1590 closes the BGP (and transport-level) connection and releases 1591 all resources associated with that connection. 1593 Established state: 1595 In the Established state BGP can exchange UPDATE, NOTIFICATION, 1596 and KEEPALIVE messages with its peer. 1598 If the local system receives an UPDATE or KEEPALIVE message, it 1599 restarts its Hold Timer, if the negotiated Hold Time value is 1600 non-zero. 1602 If the local system receives a NOTIFICATION message, it changes 1603 its state to Idle. 1605 If the local system receives an UPDATE message and the UPDATE 1606 message error handling procedure (see Section 6.3) detects an 1607 error, the local system sends a NOTIFICATION message and 1608 changes its state to Idle. 1610 If a disconnect notification is received from the underlying 1611 transport protocol, the local system changes its state to Idle. 1613 If the Hold Timer expires, the local system sends a 1614 NOTIFICATION message with Error Code Hold Timer Expired and 1615 changes its state to Idle. 1617 If the KeepAlive timer expires, the local system sends a 1618 KEEPALIVE message and restarts its KeepAlive timer. 1620 Each time the local system sends a KEEPALIVE or UPDATE message, 1621 it restarts its KeepAlive timer, unless the negotiated Hold 1622 Time value is zero. 1624 In response to the Stop event (initiated by either system or 1625 operator), the local system sends a NOTIFICATION message with 1626 Error Code Cease and changes its state to Idle. 1628 Start event is ignored in the Established state. 1630 In response to any other event, the local system sends 1631 NOTIFICATION message with Error Code Finite State Machine Error 1632 and changes its state to Idle. 1634 Whenever BGP changes its state from Established to Idle, it 1635 closes the BGP (and transport-level) connection, releases all 1636 resources associated with that connection, and deletes all 1637 RFC DRAFT January 2001 1639 routes derived from that connection. 1641 9. UPDATE Message Handling 1643 An UPDATE message may be received only in the Established state. 1644 When an UPDATE message is received, each field is checked for 1645 validity as specified in Section 6.3. 1647 If an optional non-transitive attribute is unrecognized, it is 1648 quietly ignored. If an optional transitive attribute is 1649 unrecognized, the Partial bit (the third high-order bit) in the 1650 attribute flags octet is set to 1, and the attribute is retained for 1651 propagation to other BGP speakers. 1653 If an optional attribute is recognized, and has a valid value, then, 1654 depending on the type of the optional attribute, it is processed 1655 locally, retained, and updated, if necessary, for possible 1656 propagation to other BGP speakers. 1658 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 1659 the previously advertised routes whose destinations (expressed as IP 1660 prefixes) contained in this field shall be removed from the Adj-RIB- 1661 In. This BGP speaker shall run its Decision Process since the 1662 previously advertised route is not longer available for use. 1664 If the UPDATE message contains a feasible route, it shall be placed 1665 in the appropriate Adj-RIB-In, and the following additional actions 1666 shall be taken: 1668 i) If its Network Layer Reachability Information (NLRI) is identical 1669 to the one of a route currently stored in the Adj-RIB-In, then the 1670 new route shall replace the older route in the Adj-RIB-In, thus 1671 implicitly withdrawing the older route from service. The BGP speaker 1672 shall run its Decision Process since the older route is no longer 1673 available for use. 1675 ii) If the new route is an overlapping route that is included (see 1676 9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP 1677 speaker shall run its Decision Process since the more specific route 1678 has implicitly made a portion of the less specific route unavailable 1679 for use. 1681 iii) If the new route has identical path attributes to an earlier 1682 route contained in the Adj-RIB-In, and is more specific (see 9.1.4) 1683 than the earlier route, no further actions are necessary. 1685 RFC DRAFT January 2001 1687 iv) If the new route has NLRI that is not present in any of the 1688 routes currently stored in the Adj-RIB-In, then the new route shall 1689 be placed in the Adj-RIB-In. The BGP speaker shall run its Decision 1690 Process. 1692 v) If the new route is an overlapping route that is less specific 1693 (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the 1694 BGP speaker shall run its Decision Process on the set of destinations 1695 described only by the less specific route. 1697 9.1 Decision Process 1699 The Decision Process selects routes for subsequent advertisement by 1700 applying the policies in the local Policy Information Base (PIB) to 1701 the routes stored in its Adj-RIB-In. The output of the Decision 1702 Process is the set of routes that will be advertised to all peers; 1703 the selected routes will be stored in the local speaker's Adj-RIB- 1704 Out. 1706 The selection process is formalized by defining a function that takes 1707 the attribute of a given route as an argument and returns a non- 1708 negative integer denoting the degree of preference for the route. 1709 The function that calculates the degree of preference for a given 1710 route shall not use as its inputs any of the following: the existence 1711 of other routes, the non-existence of other routes, or the path 1712 attributes of other routes. Route selection then consists of 1713 individual application of the degree of preference function to each 1714 feasible route, followed by the choice of the one with the highest 1715 degree of preference. 1717 The Decision Process operates on routes contained in each Adj-RIB-In, 1718 and is responsible for: 1720 - selection of routes to be advertised to internal peers 1722 - selection of routes to be advertised to external peers 1724 - route aggregation and route information reduction 1726 The Decision Process takes place in three distinct phases, each 1727 triggered by a different event: 1729 a) Phase 1 is responsible for calculating the degree of preference 1730 for each route received from an external peer, and MAY also 1731 advertise to all the internal peers the routes from external 1732 peers that have the highest degree of preference for each distinct 1733 RFC DRAFT January 2001 1735 destination. 1737 b) Phase 2 is invoked on completion of phase 1. It is responsible 1738 for choosing the best route out of all those available for each 1739 distinct destination, and for installing each chosen route into 1740 the appropriate Loc-RIB. 1742 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 1743 responsible for disseminating routes in the Loc-RIB to each 1744 external peer, according to the policies contained in the PIB. 1745 Route aggregation and information reduction can optionally be 1746 performed within this phase. 1748 9.1.1 Phase 1: Calculation of Degree of Preference 1750 The Phase 1 decision function shall be invoked whenever the local BGP 1751 speaker receives from a peer an UPDATE message that advertises a new 1752 route, a replacement route, or withdrawn routes. 1754 The Phase 1 decision function is a separate process which completes 1755 when it has no further work to do. 1757 The Phase 1 decision function shall lock an Adj-RIB-In prior to 1758 operating on any route contained within it, and shall unlock it after 1759 operating on all new or unfeasible routes contained within it. 1761 For the newly received or replacement feasible route, the local BGP 1762 speaker shall determine a degree of preference. If the route is 1763 learned from an internal peer, the value of the LOCAL_PREF attribute 1764 shall be taken as the degree of preference. If the route is learned 1765 from an external peer, then the degree of preference shall be 1766 computed based on preconfigured policy information and used as the 1767 LOCAL_PREF value in any IBGP readvertisement. The exact nature of 1768 this policy information and the computation involved is a local 1769 matter. For a route learned from an external peer, the local speaker 1770 shall then run the internal update process of 9.2.1 to select and 1771 advertise the most preferable route. 1773 9.1.2 Phase 2: Route Selection 1775 The Phase 2 decision function shall be invoked on completion of Phase 1776 1. The Phase 2 function is a separate process which completes when 1777 it has no further work to do. The Phase 2 process shall consider all 1778 routes that are present in the Adj-RIBs-In, including those received 1779 RFC DRAFT January 2001 1781 from both internal and external peers. 1783 The Phase 2 decision function shall be blocked from running while the 1784 Phase 3 decision function is in process. The Phase 2 function shall 1785 lock all Adj-RIBs-In prior to commencing its function, and shall 1786 unlock them on completion. 1788 If the NEXT_HOP attribute of a BGP route depicts an address to which 1789 the local BGP speaker doesn't have a route in its Loc-RIB, the BGP 1790 route should be excluded from the Phase 2 decision function. 1792 It is critical that routers within an AS do not make conflicting 1793 decisions regarding route selection that would cause forwarding loops 1794 to occur. 1796 For each set of destinations for which a feasible route exists in the 1797 Adj-RIBs-In, the local BGP speaker shall identify the route that has: 1799 a) the highest degree of preference of any route to the same set 1800 of destinations, or 1802 b) is the only route to that destination, or 1804 c) is selected as a result of the Phase 2 tie breaking rules 1805 specified in 9.1.2.1. 1807 The local speaker SHALL then install that route in the Loc-RIB, 1808 replacing any route to the same destination that is currently being 1809 held in the Loc-RIB. The local speaker MUST determine the immediate 1810 next hop to the address depicted by the NEXT_HOP attribute of the 1811 selected route by performing a lookup in the IGP and selecting one of 1812 the possible paths in the IGP. This immediate next hop MUST be used 1813 when installing the selected route in the Loc-RIB. If the route to 1814 the address depicted by the NEXT_HOP attribute changes such that the 1815 immediate next hop changes, route selection should be recalculated as 1816 specified above. 1818 Unfeasible routes shall be removed from the Loc-RIB, and 1819 corresponding unfeasible routes shall then be removed from the Adj- 1820 RIBs-In. 1822 9.1.2.1 Breaking Ties (Phase 2) 1824 In its Adj-RIBs-In a BGP speaker may have several routes to the same 1825 destination that have the same degree of preference. The local 1826 RFC DRAFT January 2001 1828 speaker can select only one of these routes for inclusion in the 1829 associated Loc-RIB. The local speaker considers all routes with the 1830 same degrees of preference, both those received from internal peers, 1831 and those received from external peers. 1833 The following tie-breaking procedure assumes that for each candidate 1834 route all the BGP speakers within an autonomous system can ascertain 1835 the cost of a path (interior distance) to the address depicted by the 1836 NEXT_HOP attribute of the route. 1838 The tie-breaking algorithm begins by considering all equally 1839 preferable routes and then selects routes to be removed from 1840 consideration. The algorithm terminates as soon as only one route 1841 remains in consideration. The criteria must be applied in the order 1842 specified. 1844 Several of the criteria are described using pseudo-code. Note that 1845 the pseudo-code shown was chosen for clarity, not efficiency. It is 1846 not intended to specify any particular implementation. BGP 1847 implementations MAY use any algorithm which produces the same results 1848 as those described here. 1850 a) Remove from consideration routes with less-preferred 1851 MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable 1852 between routes learned from the same neighboring AS. Routes which 1853 do not have the MULTI_EXIT_DISC attribute are considered to have 1854 the highest possible MULTI_EXIT_DISC value. 1856 This is also described in the following procedure: 1858 for m = all routes still under consideration 1859 for n = all routes still under consideration 1860 if (neighborAS(m) == neighborAS(n)) and (MED(n) < MED(m)) 1861 remove route m from consideration 1863 In the pseudo-code above, MED(n) is a function which returns the 1864 value of route n's MULTI_EXIT_DISC attribute. If route n has no 1865 MULTI_EXIT_DISC attribute, the function returns the highest 1866 possible MULTI_EXIT_DISC value, i.e. 2^32-1. 1868 Similarly, neighborAS(n) is a function which returns the neighbor 1869 AS from which the route was received. 1871 b) Remove from consideration any routes with less-preferred 1872 interior cost. The interior cost of a route is determined by 1873 calculating the metric to the next hop for the route using the 1874 interior routing protocol(s). If the next hop for a route is 1875 reachable, but no cost can be determined, then this step should be 1876 RFC DRAFT January 2001 1878 should be skipped (equivalently, consider all routes to have equal 1879 costs). 1881 This is also described in the following procedure. 1883 for m = all routes still under consideration 1884 for n = all routes in still under consideration 1885 if (cost(n) is better than cost(m)) 1886 remove m from consideration 1888 In the pseudo-code above, cost(n) is a function which returns the 1889 cost of the path (interior distance) to the address given in the 1890 NEXT_HOP attribute of the route. 1892 c) If at least one of the candidate routes was received from an 1893 external peer in a neighboring autonomous system, remove from 1894 consideration all routes which were received from internal peers. 1896 d) Remove from consideration all routes other than the route that 1897 was advertised by the BGP speaker whose BGP Identifier has the 1898 lowest value. 1900 9.1.3 Phase 3: Route Dissemination 1902 The Phase 3 decision function shall be invoked on completion of Phase 1903 2, or when any of the following events occur: 1905 a) when routes in a Loc-RIB to local destinations have changed 1907 b) when locally generated routes learned by means outside of BGP 1908 have changed 1910 c) when a new BGP speaker - BGP speaker connection has been 1911 established 1913 The Phase 3 function is a separate process which completes when it 1914 has no further work to do. The Phase 3 Routing Decision function 1915 shall be blocked from running while the Phase 2 decision function is 1916 in process. 1918 All routes in the Loc-RIB shall be processed into a corresponding 1919 entry in the associated Adj-RIBs-Out. Route aggregation and 1920 information reduction techniques (see 9.2.4.1) may optionally be 1921 applied. 1923 For the benefit of future support of inter-AS multicast capabilities, 1924 RFC DRAFT January 2001 1926 a BGP speaker that participates in inter-AS multicast routing shall 1927 advertise a route it receives from one of its external peers and if 1928 it installs it in its Loc-RIB, it shall advertise it back to the peer 1929 from which the route was received. For a BGP speaker that does not 1930 participate in inter-AS multicast routing such an advertisement is 1931 optional. When doing such an advertisement, the NEXT_HOP attribute 1932 should be set to the address of the peer. An implementation may also 1933 optimize such an advertisement by truncating information in the 1934 AS_PATH attribute to include only its own AS number and that of the 1935 peer that advertised the route (such truncation requires the ORIGIN 1936 attribute to be set to INCOMPLETE). In addition an implementation is 1937 not required to pass optional or discretionary path attributes with 1938 such an advertisement. 1940 When the updating of the Adj-RIBs-Out and the Forwarding Information 1941 Base (FIB) is complete, the local BGP speaker shall run the external 1942 update process of 9.2.2. 1944 9.1.4 Overlapping Routes 1946 A BGP speaker may transmit routes with overlapping Network Layer 1947 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 1948 occurs when a set of destinations are identified in non-matching 1949 multiple routes. Since BGP encodes NLRI using IP prefixes, overlap 1950 will always exhibit subset relationships. A route describing a 1951 smaller set of destinations (a longer prefix) is said to be more 1952 specific than a route describing a larger set of destinations (a 1953 shorted prefix); similarly, a route describing a larger set of 1954 destinations (a shorter prefix) is said to be less specific than a 1955 route describing a smaller set of destinations (a longer prefix). 1957 The precedence relationship effectively decomposes less specific 1958 routes into two parts: 1960 - a set of destinations described only by the less specific 1961 route, and 1963 - a set of destinations described by the overlap of the less 1964 specific and the more specific routes 1966 When overlapping routes are present in the same Adj-RIB-In, the more 1967 specific route shall take precedence, in order from more specific to 1968 least specific. 1970 The set of destinations described by the overlap represents a portion 1971 RFC DRAFT January 2001 1973 of the less specific route that is feasible, but is not currently in 1974 use. If a more specific route is later withdrawn, the set of 1975 destinations described by the overlap will still be reachable using 1976 the less specific route. 1978 If a BGP speaker receives overlapping routes, the Decision Process 1979 MUST consider both routes based on the configured acceptance policy. 1980 If both a less and a more specific route are accepted, then the 1981 Decision Process MUST either install both the less and the more 1982 specific routes or it MUST aggregate the two routes and install the 1983 aggregated route. 1985 If a BGP speaker chooses to aggregate, then it MUST add 1986 ATOMIC_AGGREGATE attribute to the route. A route that carries 1987 ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the 1988 NLRI of this route can not be made more specific. Forwarding along 1989 such a route does not guarantee that IP packets will actually 1990 traverse only ASs listed in the AS_PATH attribute of the route. 1992 9.2 Update-Send Process 1994 The Update-Send process is responsible for advertising UPDATE 1995 messages to all peers. For example, it distributes the routes chosen 1996 by the Decision Process to other BGP speakers which may be located in 1997 either the same autonomous system or a neighboring autonomous system. 1998 Rules for information exchange between BGP speakers located in 1999 different autonomous systems are given in 9.2.2; rules for 2000 information exchange between BGP speakers located in the same 2001 autonomous system are given in 9.2.1. 2003 Distribution of routing information between a set of BGP speakers, 2004 all of which are located in the same autonomous system, is referred 2005 to as internal distribution. 2007 9.2.1 Internal Updates 2009 The Internal update process is concerned with the distribution of 2010 routing information to internal peers. 2012 When a BGP speaker receives an UPDATE message from an internal peer, 2013 the receiving BGP speaker shall not re-distribute the routing 2014 information contained in that UPDATE message to other internal peers. 2016 When a BGP speaker receives a new route from an external peer, it 2017 RFC DRAFT January 2001 2019 MUST advertise that route to all other internal peers by means of an 2020 UPDATE message if this route will be installed in its Loc-RIB 2021 according to the route selection rules in 9.1.2. 2023 When a BGP speaker receives an UPDATE message with a non-empty 2024 WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all 2025 routes whose destinations was carried in this field (as IP prefixes). 2026 The speaker shall take the following additional steps: 2028 1) if the corresponding feasible route had not been previously 2029 advertised, then no further action is necessary 2031 2) if the corresponding feasible route had been previously 2032 advertised, then: 2034 i) if a new route is selected for advertisement that has the 2035 same Network Layer Reachability Information as the unfeasible 2036 routes, then the local BGP speaker shall advertise the 2037 replacement route 2039 ii) if a replacement route is not available for advertisement, 2040 then the BGP speaker shall include the destinations of the 2041 unfeasible route (in form of IP prefixes) in the WITHDRAWN 2042 ROUTES field of an UPDATE message, and shall send this message 2043 to each peer to whom it had previously advertised the 2044 corresponding feasible route. 2046 All feasible routes which are advertised shall be placed in the 2047 appropriate Adj-RIBs-Out, and all unfeasible routes which are 2048 advertised shall be removed from the Adj-RIBs-Out. 2050 9.2.1.1 Breaking Ties (Internal Updates) 2052 If a local BGP speaker has connections to several external peers, 2053 there will be multiple Adj-RIBs-In associated with these peers. These 2054 Adj-RIBs-In might contain several equally preferable routes to the 2055 same destination, all of which were advertised by external peers. 2056 The local BGP speaker shall select one of these routes according to 2057 the following rules: 2059 a) If the candidate routes differ only in their NEXT_HOP and 2060 MULTI_EXIT_DISC attributes, and the local system is configured to 2061 take into account the MULTI_EXIT_DISC attribute, select the route 2062 that has the lowest value of the MULTI_EXIT_DISC attribute. A 2063 route with the MULTI_EXIT_DISC attribute shall be preferred to a 2064 RFC DRAFT January 2001 2066 route without the MULTI_EXIT_DISC attribute. 2068 b) If the local system can ascertain the cost of a path to the 2069 entity depicted by the NEXT_HOP attribute of the candidate route, 2070 select the route with the lowest cost. 2072 c) In all other cases, select the route that was advertised by the 2073 BGP speaker whose BGP Identifier has the lowest value. 2075 9.2.2 External Updates 2077 The external update process is concerned with the distribution of 2078 routing information to external peers. As part of Phase 3 route 2079 selection process, the BGP speaker has updated its Adj-RIBs-Out and 2080 its Forwarding Table. All newly installed routes and all newly 2081 unfeasible routes for which there is no replacement route shall be 2082 advertised to external peers by means of UPDATE message. 2084 Any routes in the Loc-RIB marked as unfeasible shall be removed. 2085 Changes to the reachable destinations within its own autonomous 2086 system shall also be advertised in an UPDATE message. 2088 9.2.3 Controlling Routing Traffic Overhead 2090 The BGP protocol constrains the amount of routing traffic (that is, 2091 UPDATE messages) in order to limit both the link bandwidth needed to 2092 advertise UPDATE messages and the processing power needed by the 2093 Decision Process to digest the information contained in the UPDATE 2094 messages. 2096 9.2.3.1 Frequency of Route Advertisement 2098 The parameter MinRouteAdvertisementInterval determines the minimum 2099 amount of time that must elapse between advertisement of routes to a 2100 particular destination from a single BGP speaker. This rate limiting 2101 procedure applies on a per-destination basis, although the value of 2102 MinRouteAdvertisementInterval is set on a per BGP peer basis. 2104 Two UPDATE messages sent from a single BGP speaker that advertise 2105 feasible routes to some common set of destinations received from 2106 external peers must be separated by at least 2107 RFC DRAFT January 2001 2109 MinRouteAdvertisementInterval. Clearly, this can only be achieved 2110 precisely by keeping a separate timer for each common set of 2111 destinations. This would be unwarranted overhead. Any technique which 2112 ensures that the interval between two UPDATE messages sent from a 2113 single BGP speaker that advertise feasible routes to some common set 2114 of destinations received from external peers will be at least 2115 MinRouteAdvertisementInterval, and will also ensure a constant upper 2116 bound on the interval is acceptable. 2118 Since fast convergence is needed within an autonomous system, this 2119 procedure does not apply for routes received from other internal 2120 peers. To avoid long-lived black holes, the procedure does not apply 2121 to the explicit withdrawal of unfeasible routes (that is, routes 2122 whose destinations (expressed as IP prefixes) are listed in the 2123 WITHDRAWN ROUTES field of an UPDATE message). 2125 This procedure does not limit the rate of route selection, but only 2126 the rate of route advertisement. If new routes are selected multiple 2127 times while awaiting the expiration of MinRouteAdvertisementInterval, 2128 the last route selected shall be advertised at the end of 2129 MinRouteAdvertisementInterval. 2131 9.2.3.2 Frequency of Route Origination 2133 The parameter MinASOriginationInterval determines the minimum amount 2134 of time that must elapse between successive advertisements of UPDATE 2135 messages that report changes within the advertising BGP speaker's own 2136 autonomous systems. 2138 9.2.3.3 Jitter 2140 To minimize the likelihood that the distribution of BGP messages by a 2141 given BGP speaker will contain peaks, jitter should be applied to the 2142 timers associated with MinASOriginationInterval, Keepalive, and 2143 MinRouteAdvertisementInterval. A given BGP speaker shall apply the 2144 same jitter to each of these quantities regardless of the 2145 destinations to which the updates are being sent; that is, jitter 2146 will not be applied on a "per peer" basis. 2148 The amount of jitter to be introduced shall be determined by 2149 multiplying the base value of the appropriate timer by a random 2150 factor which is uniformly distributed in the range from 0.75 to 1.0. 2152 RFC DRAFT January 2001 2154 9.2.4 Efficient Organization of Routing Information 2156 Having selected the routing information which it will advertise, a 2157 BGP speaker may avail itself of several methods to organize this 2158 information in an efficient manner. 2160 9.2.4.1 Information Reduction 2162 Information reduction may imply a reduction in granularity of policy 2163 control - after information is collapsed, the same policies will 2164 apply to all destinations and paths in the equivalence class. 2166 The Decision Process may optionally reduce the amount of information 2167 that it will place in the Adj-RIBs-Out by any of the following 2168 methods: 2170 a) Network Layer Reachability Information (NLRI): 2172 Destination IP addresses can be represented as IP address 2173 prefixes. In cases where there is a correspondence between the 2174 address structure and the systems under control of an autonomous 2175 system administrator, it will be possible to reduce the size of 2176 the NLRI carried in the UPDATE messages. 2178 b) AS_PATHs: 2180 AS path information can be represented as ordered AS_SEQUENCEs or 2181 unordered AS_SETs. AS_SETs are used in the route aggregation 2182 algorithm described in 9.2.4.2. They reduce the size of the 2183 AS_PATH information by listing each AS number only once, 2184 regardless of how many times it may have appeared in multiple 2185 AS_PATHs that were aggregated. 2187 An AS_SET implies that the destinations listed in the NLRI can be 2188 reached through paths that traverse at least some of the 2189 constituent autonomous systems. AS_SETs provide sufficient 2190 information to avoid routing information looping; however their 2191 use may prune potentially feasible paths, since such paths are no 2192 longer listed individually as in the form of AS_SEQUENCEs. In 2193 practice this is not likely to be a problem, since once an IP 2194 packet arrives at the edge of a group of autonomous systems, the 2195 BGP speaker at that point is likely to have more detailed path 2196 information and can distinguish individual paths to destinations. 2198 RFC DRAFT January 2001 2200 9.2.4.2 Aggregating Routing Information 2202 Aggregation is the process of combining the characteristics of 2203 several different routes in such a way that a single route can be 2204 advertised. Aggregation can occur as part of the decision process 2205 to reduce the amount of routing information that will be placed in 2206 the Adj-RIBs-Out. 2208 Aggregation reduces the amount of information that a BGP speaker must 2209 store and exchange with other BGP speakers. Routes can be aggregated 2210 by applying the following procedure separately to path attributes of 2211 like type and to the Network Layer Reachability Information. 2213 Routes that have the following attributes shall not be aggregated 2214 unless the corresponding attributes of each route are identical: 2215 MULTI_EXIT_DISC, NEXT_HOP. 2217 Path attributes that have different type codes can not be aggregated 2218 together. Path of the same type code may be aggregated, according to 2219 the following rules: 2221 ORIGIN attribute: If at least one route among routes that are 2222 aggregated has ORIGIN with the value INCOMPLETE, then the 2223 aggregated route must have the ORIGIN attribute with the value 2224 INCOMPLETE. Otherwise, if at least one route among routes that are 2225 aggregated has ORIGIN with the value EGP, then the aggregated 2226 route must have the origin attribute with the value EGP. In all 2227 other case the value of the ORIGIN attribute of the aggregated 2228 route is INTERNAL. 2230 AS_PATH attribute: If routes to be aggregated have identical 2231 AS_PATH attributes, then the aggregated route has the same AS_PATH 2232 attribute as each individual route. 2234 For the purpose of aggregating AS_PATH attributes we model each AS 2235 within the AS_PATH attribute as a tuple , where 2236 "type" identifies a type of the path segment the AS belongs to 2237 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If the 2238 routes to be aggregated have different AS_PATH attributes, then 2239 the aggregated AS_PATH attribute shall satisfy all of the 2240 following conditions: 2242 - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH 2243 shall appear in all of the AS_PATH in the initial set of routes 2244 to be aggregated. 2246 - all tuples of the type AS_SET in the aggregated AS_PATH shall 2247 RFC DRAFT January 2001 2249 appear in at least one of the AS_PATH in the initial set (they 2250 may appear as either AS_SET or AS_SEQUENCE types). 2252 - for any tuple X of the type AS_SEQUENCE in the aggregated 2253 AS_PATH which precedes tuple Y in the aggregated AS_PATH, X 2254 precedes Y in each AS_PATH in the initial set which contains Y, 2255 regardless of the type of Y. 2257 - No tuple with the same value shall appear more than once in 2258 the aggregated AS_PATH, regardless of the tuple's type. 2260 An implementation may choose any algorithm which conforms to these 2261 rules. At a minimum a conformant implementation shall be able to 2262 perform the following algorithm that meets all of the above 2263 conditions: 2265 - determine the longest leading sequence of tuples (as defined 2266 above) common to all the AS_PATH attributes of the routes to be 2267 aggregated. Make this sequence the leading sequence of the 2268 aggregated AS_PATH attribute. 2270 - set the type of the rest of the tuples from the AS_PATH 2271 attributes of the routes to be aggregated to AS_SET, and append 2272 them to the aggregated AS_PATH attribute. 2274 - if the aggregated AS_PATH has more than one tuple with the 2275 same value (regardless of tuple's type), eliminate all, but one 2276 such tuple by deleting tuples of the type AS_SET from the 2277 aggregated AS_PATH attribute. 2279 Appendix 6, section 6.8 presents another algorithm that satisfies 2280 the conditions and allows for more complex policy configurations. 2282 ATOMIC_AGGREGATE: If at least one of the routes to be aggregated 2283 has ATOMIC_AGGREGATE path attribute, then the aggregated route 2284 shall have this attribute as well. 2286 AGGREGATOR: All AGGREGATOR attributes of all routes to be 2287 aggregated should be ignored. 2289 9.3 Route Selection Criteria 2291 Generally speaking, additional rules for comparing routes among 2292 several alternatives are outside the scope of this document. There 2293 are two exceptions: 2295 RFC DRAFT January 2001 2297 - If the local AS appears in the AS path of the new route being 2298 considered, then that new route cannot be viewed as better than 2299 any other route. If such a route were ever used, a routing loop 2300 could result (see Section 6.3). 2302 - In order to achieve successful distributed operation, only 2303 routes with a likelihood of stability can be chosen. Thus, an AS 2304 must avoid using unstable routes, and it must not make rapid 2305 spontaneous changes to its choice of route. Quantifying the terms 2306 "unstable" and "rapid" in the previous sentence will require 2307 experience, but the principle is clear. 2309 9.4 Originating BGP routes 2311 A BGP speaker may originate BGP routes by injecting routing 2312 information acquired by some other means (e.g. via an IGP) into BGP. 2313 A BGP speaker that originates BGP routes shall assign the degree of 2314 preference to these routes by passing them through the Decision 2315 Process (see Section 9.1). These routes may also be distributed to 2316 other BGP speakers within the local AS as part of the Internal update 2317 process (see Section 9.2.1). The decision whether to distribute non- 2318 BGP acquired routes within an AS via BGP or not depends on the 2319 environment within the AS (e.g. type of IGP) and should be controlled 2320 via configuration. 2322 Appendix 1. BGP FSM State Transitions and Actions. 2324 This Appendix discusses the transitions between states in the BGP FSM 2325 in response to BGP events. The following is the list of these states 2326 and events when the negotiated Hold Time value is non-zero. 2328 BGP States: 2330 1 - Idle 2331 2 - Connect 2332 3 - Active 2333 4 - OpenSent 2334 5 - OpenConfirm 2335 6 - Established 2337 BGP Events: 2339 RFC DRAFT January 2001 2341 1 - BGP Start 2342 2 - BGP Stop 2343 3 - BGP Transport connection open 2344 4 - BGP Transport connection closed 2345 5 - BGP Transport connection open failed 2346 6 - BGP Transport fatal error 2347 7 - ConnectRetry timer expired 2348 8 - Hold Timer expired 2349 9 - KeepAlive timer expired 2350 10 - Receive OPEN message 2351 11 - Receive KEEPALIVE message 2352 12 - Receive UPDATE messages 2353 13 - Receive NOTIFICATION message 2355 The following table describes the state transitions of the BGP FSM 2356 and the actions triggered by these transitions. 2358 Event Actions Message Sent Next State 2359 -------------------------------------------------------------------- 2360 Idle (1) 2361 1 Initialize resources none 2 2362 Start ConnectRetry timer 2363 Initiate a transport connection 2364 others none none 1 2366 Connect(2) 2367 1 none none 2 2368 3 Complete initialization OPEN 4 2369 Clear ConnectRetry timer 2370 5 Restart ConnectRetry timer none 3 2371 7 Restart ConnectRetry timer none 2 2372 Initiate a transport connection 2373 others Release resources none 1 2375 Active (3) 2376 1 none none 3 2377 3 Complete initialization OPEN 4 2378 Clear ConnectRetry timer 2379 5 Close connection 3 2380 Restart ConnectRetry timer 2381 7 Restart ConnectRetry timer none 2 2382 Initiate a transport connection 2383 others Release resources none 1 2384 RFC DRAFT January 2001 2386 OpenSent(4) 2387 1 none none 4 2388 4 Close transport connection none 3 2389 Restart ConnectRetry timer 2390 6 Release resources none 1 2391 10 Process OPEN is OK KEEPALIVE 5 2392 Process OPEN failed NOTIFICATION 1 2393 others Close transport connection NOTIFICATION 1 2394 Release resources 2396 OpenConfirm (5) 2397 1 none none 5 2398 4 Release resources none 1 2399 6 Release resources none 1 2400 9 Restart KeepAlive timer KEEPALIVE 5 2401 11 Complete initialization none 6 2402 Restart Hold Timer 2403 13 Close transport connection 1 2404 Release resources 2405 others Close transport connection NOTIFICATION 1 2406 Release resources 2408 Established (6) 2409 1 none none 6 2410 4 Release resources none 1 2411 6 Release resources none 1 2412 9 Restart KeepAlive timer KEEPALIVE 6 2413 11 Restart Hold Timer KEEPALIVE 6 2414 12 Process UPDATE is OK UPDATE 6 2415 Process UPDATE failed NOTIFICATION 1 2416 13 Close transport connection 1 2417 Release resources 2418 others Close transport connection NOTIFICATION 1 2419 Release resources 2420 --------------------------------------------------------------------- 2422 The following is a condensed version of the above state transition 2423 table. 2425 Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab 2426 RFC DRAFT January 2001 2428 | (1) | (2) | (3) | (4) | (5) | (6) 2429 |--------------------------------------------------------------- 2430 1 | 2 | 2 | 3 | 4 | 5 | 6 2431 | | | | | | 2432 2 | 1 | 1 | 1 | 1 | 1 | 1 2433 | | | | | | 2434 3 | 1 | 4 | 4 | 1 | 1 | 1 2435 | | | | | | 2436 4 | 1 | 1 | 1 | 3 | 1 | 1 2437 | | | | | | 2438 5 | 1 | 3 | 3 | 1 | 1 | 1 2439 | | | | | | 2440 6 | 1 | 1 | 1 | 1 | 1 | 1 2441 | | | | | | 2442 7 | 1 | 2 | 2 | 1 | 1 | 1 2443 | | | | | | 2444 8 | 1 | 1 | 1 | 1 | 1 | 1 2445 | | | | | | 2446 9 | 1 | 1 | 1 | 1 | 5 | 6 2447 | | | | | | 2448 10 | 1 | 1 | 1 | 1 or 5 | 1 | 1 2449 | | | | | | 2450 11 | 1 | 1 | 1 | 1 | 6 | 6 2451 | | | | | | 2452 12 | 1 | 1 | 1 | 1 | 1 | 1 or 6 2453 | | | | | | 2454 13 | 1 | 1 | 1 | 1 | 1 | 1 2455 | | | | | | 2456 --------------------------------------------------------------- 2458 Appendix 2. Comparison with RFC1267 2460 BGP-4 is capable of operating in an environment where a set of 2461 reachable destinations may be expressed via a single IP prefix. The 2462 concept of network classes, or subnetting is foreign to BGP-4. To 2463 accommodate these capabilities BGP-4 changes semantics and encoding 2464 associated with the AS_PATH attribute. New text has been added to 2465 define semantics associated with IP prefixes. These abilities allow 2466 BGP-4 to support the proposed supernetting scheme [9]. 2468 To simplify configuration this version introduces a new attribute, 2469 LOCAL_PREF, that facilitates route selection procedures. 2471 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 2473 RFC DRAFT January 2001 2475 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 2476 certain aggregates are not de-aggregated. Another new attribute, 2477 AGGREGATOR, can be added to aggregate routes in order to advertise 2478 which AS and which BGP speaker within that AS caused the aggregation. 2480 To insure that Hold Timers are symmetric, the Hold Time is now 2481 negotiated on a per-connection basis. Hold Times of zero are now 2482 supported. 2484 Appendix 3. Comparison with RFC 1163 2486 All of the changes listed in Appendix 2, plus the following. 2488 To detect and recover from BGP connection collision, a new field (BGP 2489 Identifier) has been added to the OPEN message. New text (Section 2490 6.8) has been added to specify the procedure for detecting and 2491 recovering from collision. 2493 The new document no longer restricts the border router that is passed 2494 in the NEXT_HOP path attribute to be part of the same Autonomous 2495 System as the BGP Speaker. 2497 New document optimizes and simplifies the exchange of the information 2498 about previously reachable routes. 2500 Appendix 4. Comparison with RFC 1105 2502 All of the changes listed in Appendices 2 and 3, plus the following. 2504 Minor changes to the RFC1105 Finite State Machine were necessary to 2505 accommodate the TCP user interface provided by 4.3 BSD. 2507 The notion of Up/Down/Horizontal relations present in RFC1105 has 2508 been removed from the protocol. 2510 The changes in the message format from RFC1105 are as follows: 2512 1. The Hold Time field has been removed from the BGP header and 2513 added to the OPEN message. 2515 2. The version field has been removed from the BGP header and 2516 added to the OPEN message. 2518 3. The Link Type field has been removed from the OPEN message. 2520 RFC DRAFT January 2001 2522 4. The OPEN CONFIRM message has been eliminated and replaced with 2523 implicit confirmation provided by the KEEPALIVE message. 2525 5. The format of the UPDATE message has been changed 2526 significantly. New fields were added to the UPDATE message to 2527 support multiple path attributes. 2529 6. The Marker field has been expanded and its role broadened to 2530 support authentication. 2532 Note that quite often BGP, as specified in RFC 1105, is referred 2533 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 2534 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 2535 BGP, as specified in this document is referred to as BGP-4. 2537 Appendix 5. TCP options that may be used with BGP 2539 If a local system TCP user interface supports TCP PUSH function, then 2540 each BGP message should be transmitted with PUSH flag set. Setting 2541 PUSH flag forces BGP messages to be transmitted promptly to the 2542 receiver. 2544 If a local system TCP user interface supports setting precedence for 2545 TCP connection, then the BGP transport connection should be opened 2546 with precedence set to Internetwork Control (110) value (see also 2547 [6]). 2549 Appendix 6. Implementation Recommendations 2551 This section presents some implementation recommendations. 2553 6.1 Multiple Networks Per Message 2555 The BGP protocol allows for multiple address prefixes with the same 2556 AS path and next-hop gateway to be specified in one message. Making 2557 use of this capability is highly recommended. With one address prefix 2558 per message there is a substantial increase in overhead in the 2559 receiver. Not only does the system overhead increase due to the 2560 reception of multiple messages, but the overhead of scanning the 2561 routing table for updates to BGP peers and other routing protocols 2562 (and sending the associated messages) is incurred multiple times as 2563 RFC DRAFT January 2001 2565 well. One method of building messages containing many address 2566 prefixes per AS path and gateway from a routing table that is not 2567 organized per AS path is to build many messages as the routing table 2568 is scanned. As each address prefix is processed, a message for the 2569 associated AS path and gateway is allocated, if it does not exist, 2570 and the new address prefix is added to it. If such a message exists, 2571 the new address prefix is just appended to it. If the message lacks 2572 the space to hold the new address prefix, it is transmitted, a new 2573 message is allocated, and the new address prefix is inserted into the 2574 new message. When the entire routing table has been scanned, all 2575 allocated messages are sent and their resources released. Maximum 2576 compression is achieved when all the destinations covered by the 2577 address prefixes share a gateway and common path attributes, making 2578 it possible to send many address prefixes in one 4096-byte message. 2580 When peering with a BGP implementation that does not compress 2581 multiple address prefixes into one message, it may be necessary to 2582 take steps to reduce the overhead from the flood of data received 2583 when a peer is acquired or a significant network topology change 2584 occurs. One method of doing this is to limit the rate of updates. 2585 This will eliminate the redundant scanning of the routing table to 2586 provide flash updates for BGP peers and other routing protocols. A 2587 disadvantage of this approach is that it increases the propagation 2588 latency of routing information. By choosing a minimum flash update 2589 interval that is not much greater than the time it takes to process 2590 the multiple messages this latency should be minimized. A better 2591 method would be to read all received messages before sending updates. 2593 6.2 Processing Messages on a Stream Protocol 2595 BGP uses TCP as a transport mechanism. Due to the stream nature of 2596 TCP, all the data for received messages does not necessarily arrive 2597 at the same time. This can make it difficult to process the data as 2598 messages, especially on systems such as BSD Unix where it is not 2599 possible to determine how much data has been received but not yet 2600 processed. 2602 One method that can be used in this situation is to first try to read 2603 just the message header. For the KEEPALIVE message type, this is a 2604 complete message; for other message types, the header should first be 2605 verified, in particular the total length. If all checks are 2606 successful, the specified length, minus the size of the message 2607 header is the amount of data left to read. An implementation that 2608 would "hang" the routing information process while trying to read 2609 from a peer could set up a message buffer (4096 bytes) per peer and 2610 fill it with data as available until a complete message has been 2611 RFC DRAFT January 2001 2613 received. 2615 6.3 Reducing route flapping 2617 To avoid excessive route flapping a BGP speaker which needs to 2618 withdraw a destination and send an update about a more specific or 2619 less specific route SHOULD combine them into the same UPDATE message. 2621 6.4 BGP Timers 2623 BGP employs five timers: ConnectRetry, Hold Time, KeepAlive, 2624 MinASOriginationInterval, and MinRouteAdvertisementInterval The 2625 suggested value for the ConnectRetry timer is 120 seconds. The 2626 suggested value for the Hold Time is 90 seconds. The suggested value 2627 for the KeepAlive timer is 30 seconds. The suggested value for the 2628 MinASOriginationInterval is 15 seconds. The suggested value for the 2629 MinRouteAdvertisementInterval is 30 seconds. 2631 An implementation of BGP MUST allow these timers to be configurable. 2633 6.5 Path attribute ordering 2635 Implementations which combine update messages as described above in 2636 6.1 may prefer to see all path attributes presented in a known order. 2637 This permits them to quickly identify sets of attributes from 2638 different update messages which are semantically identical. To 2639 facilitate this, it is a useful optimization to order the path 2640 attributes according to type code. This optimization is entirely 2641 optional. 2643 6.6 AS_SET sorting 2645 Another useful optimization that can be done to simplify this 2646 situation is to sort the AS numbers found in an AS_SET. This 2647 optimization is entirely optional. 2649 RFC DRAFT January 2001 2651 6.7 Control over version negotiation 2653 Since BGP-4 is capable of carrying aggregated routes which cannot be 2654 properly represented in BGP-3, an implementation which supports BGP-4 2655 and another BGP version should provide the capability to only speak 2656 BGP-4 on a per-peer basis. 2658 6.8 Complex AS_PATH aggregation 2660 An implementation which chooses to provide a path aggregation 2661 algorithm which retains significant amounts of path information may 2662 wish to use the following procedure: 2664 For the purpose of aggregating AS_PATH attributes of two routes, 2665 we model each AS as a tuple , where "type" identifies 2666 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 2667 AS_SET), and "value" is the AS number. Two ASs are said to be the 2668 same if their corresponding tuples are the same. 2670 The algorithm to aggregate two AS_PATH attributes works as 2671 follows: 2673 a) Identify the same ASs (as defined above) within each AS_PATH 2674 attribute that are in the same relative order within both 2675 AS_PATH attributes. Two ASs, X and Y, are said to be in the 2676 same order if either: 2677 - X precedes Y in both AS_PATH attributes, or - Y precedes X 2678 in both AS_PATH attributes. 2680 b) The aggregated AS_PATH attribute consists of ASs identified 2681 in (a) in exactly the same order as they appear in the AS_PATH 2682 attributes to be aggregated. If two consecutive ASs identified 2683 in (a) do not immediately follow each other in both of the 2684 AS_PATH attributes to be aggregated, then the intervening ASs 2685 (ASs that are between the two consecutive ASs that are the 2686 same) in both attributes are combined into an AS_SET path 2687 segment that consists of the intervening ASs from both AS_PATH 2688 attributes; this segment is then placed in between the two 2689 consecutive ASs identified in (a) of the aggregated attribute. 2690 If two consecutive ASs identified in (a) immediately follow 2691 each other in one attribute, but do not follow in another, then 2692 the intervening ASs of the latter are combined into an AS_SET 2693 path segment; this segment is then placed in between the two 2694 consecutive ASs identified in (a) of the aggregated attribute. 2696 RFC DRAFT January 2001 2698 If as a result of the above procedure a given AS number appears 2699 more than once within the aggregated AS_PATH attribute, all, but 2700 the last instance (rightmost occurrence) of that AS number should 2701 be removed from the aggregated AS_PATH attribute. 2703 References 2705 [1] Mills, D., "Exterior Gateway Protocol Formal Specification", 2706 RFC904, April 1984. 2708 [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET 2709 Backbone", RFC1092, February 1989. 2711 [3] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, February 2712 1989. 2714 [4] Postel, J., "Transmission Control Protocol - DARPA Internet 2715 Program Protocol Specification", RFC793, September 1981. 2717 [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway 2718 Protocol in the Internet", RFC1772, March 1995. 2720 [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol 2721 Specification", RFC791, September 1981. 2723 [7] "Information Processing Systems - Telecommunications and 2724 Information Exchange between Systems - Protocol for Exchange of 2725 Inter-domain Routeing Information among Intermediate Systems to 2726 Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 2728 [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter- 2729 Domain Routing (CIDR): an Address Assignment and Aggregation 2730 Strategy", RFC1519, September 1993. 2732 [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation 2733 with CIDR", RFC 1518, September 1993. 2735 Security Considerations 2737 Security issues are not discussed in this document. 2739 Editors' Addresses 2741 Yakov Rekhter 2742 Juniper Networks 2743 RFC DRAFT January 2001 2745 1194 N. Mathilda Avenue 2746 Sunnyvale, CA 94089 2747 email: yakov@juniper.net 2749 Tony Li 2750 Procket Networks 2751 3910 Freedom Circle, Ste. 102A 2752 Santa Clara CA 95054 2753 Email: tli@procket.com