idnits 2.17.1 draft-ietf-idr-bgp4-08.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-23) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity. ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. ** 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 61 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 Introduction section. (A line matching the expected section header was found, but with an unexpected indentation: ' 2. Introduction' ) ** The document seems to lack a Security Considerations section. (A line matching the expected section header was found, but with an unexpected indentation: ' Security Considerations' ) ** 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.) ** There are 1306 instances of too long lines in the document, the longest one being 12 characters in excess of 72. ** 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 395: '...sage, a BGP speaker MUST calculate the...' RFC 2119 keyword, line 398: '... Hold Time MUST be either zero o...' RFC 2119 keyword, line 793: '... MUST NOT be sent more freque...' RFC 2119 keyword, line 794: '... implementation MAY adjust the rate a...' RFC 2119 keyword, line 798: '... messages MUST NOT be sent....' (29 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 731 has weird spacing: '... Length are t...' == Line 1175 has weird spacing: '...is less than...' == Line 1662 has weird spacing: '...s whose desti...' == Line 1736 has weird spacing: '...tise to all t...' == Line 2044 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.) -- The document date (August 1998) is 9383 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Missing reference section? '7' on line 2727 looks like a reference -- Missing reference section? '1' on line 2709 looks like a reference -- Missing reference section? '2' on line 2712 looks like a reference -- Missing reference section? '3' on line 2715 looks like a reference -- Missing reference section? '8' on line 2732 looks like a reference -- Missing reference section? '9' on line 2738 looks like a reference -- Missing reference section? '5' on line 2721 looks like a reference -- Missing reference section? '4' on line 2718 looks like a reference -- Missing reference section? '6' on line 2724 looks like a reference Summary: 13 errors (**), 0 flaws (~~), 8 warnings (==), 11 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Y. Rekhter 3 INTERNET DRAFT cisco Systems 4 T. Li 5 Juniper Networks 6 Editors 7 August 1998 9 A Border Gateway Protocol 4 (BGP-4) 11 Status of this Memo 13 This document, together with its companion document, "Application of 14 the Border Gateway Protocol in the Internet", define an inter- 15 autonomous system routing protocol for the Internet. This document 16 specifies an IAB standards track protocol for the Internet community, 17 and requests discussion and suggestions for improvements. Please 18 refer to the current edition of the "IAB Official Protocol Standards" 19 for the standardization state and status of this protocol. 20 Distribution of this document is unlimited. 22 This document is an Internet Draft. Internet Drafts are working 23 documents of the Internet Engineering Task Force (IETF), its Areas, 24 and its Working Groups. Note that other groups may also distribute 25 working documents as Internet Drafts. 27 Internet Drafts are draft documents valid for a maximum of six 28 months. Internet Drafts may be updated, replaced, or obsoleted by 29 other documents at any time. It is not appropriate to use Internet 30 Drafts as reference material or to cite them other than as a "working 31 draft" or "work in progress". 33 To view the entire list of current Internet-Drafts, please check the 34 "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow 35 Directories on ftp.is.co.za (Africa), ftp.nordu.net (Northern 36 Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au (Pacific 37 Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast). 39 1. Acknowledgments 41 This document was originally published as RFC 1267 in October 1991, 42 jointly authored by Kirk Lougheed and Yakov Rekhter. 44 RFC DRAFT August 1998 46 We would like to express our thanks to Guy Almes, Len Bosack, and 47 Jeffrey C. Honig for their contributions to the earlier version of 48 this document. 50 We like to explicitly thank Bob Braden for the review of the earlier 51 version of this document as well as his constructive and valuable 52 comments. 54 We would also like to thank Bob Hinden, Director for Routing of the 55 Internet Engineering Steering Group, and the team of reviewers he 56 assembled to review the previous version (BGP-2) of this document. 57 This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia 58 Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted 59 with a strong combination of toughness, professionalism, and 60 courtesy. 62 This updated version of the document is the product of the IETF IDR 63 Working Group with Yakov Rekhter and Tony Li as editors. Certain 64 sections of the document borrowed heavily from IDRP [7], which is the 65 OSI counterpart of BGP. For this credit should be given to the ANSI 66 X3S3.3 group chaired by Lyman Chapin and to Charles Kunzinger who was 67 the IDRP editor within that group. We would also like to thank Mike 68 Craren, Dimitry Haskin, John Krawczyk, David LeRoy, John Scudder, 69 John Stewart III, Paul Traina, and Curtis Villamizar for their 70 comments. 72 We would like to specially acknowledge numerous contributions by 73 Dennis Ferguson. 75 2. Introduction 77 The Border Gateway Protocol (BGP) is an inter-Autonomous System 78 routing protocol. It is built on experience gained with EGP as 79 defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as 80 described in RFC 1092 [2] and RFC 1093 [3]. 82 The primary function of a BGP speaking system is to exchange network 83 reachability information with other BGP systems. This network 84 reachability information includes information on the list of 85 Autonomous Systems (ASs) that reachability information traverses. 86 This information is sufficient to construct a graph of AS 87 connectivity from which routing loops may be pruned and some policy 88 decisions at the AS level may be enforced. 90 BGP-4 provides a new set of mechanisms for supporting classless 91 RFC DRAFT August 1998 93 interdomain routing. These mechanisms include support for 94 advertising an IP prefix and eliminates the concept of network 95 "class" within BGP. BGP-4 also introduces mechanisms which allow 96 aggregation of routes, including aggregation of AS paths. These 97 changes provide support for the proposed supernetting scheme [8, 9]. 99 To characterize the set of policy decisions that can be enforced 100 using BGP, one must focus on the rule that a BGP speaker advertise to 101 its peers (other BGP speakers which it communicates with) in 102 neighboring ASs only those routes that it itself uses. This rule 103 reflects the "hop-by-hop" routing paradigm generally used throughout 104 the current Internet. Note that some policies cannot be supported by 105 the "hop-by-hop" routing paradigm and thus require techniques such as 106 source routing to enforce. For example, BGP does not enable one AS 107 to send traffic to a neighboring AS intending that the traffic take a 108 different route from that taken by traffic originating in the 109 neighboring AS. On the other hand, BGP can support any policy 110 conforming to the "hop-by-hop" routing paradigm. Since the current 111 Internet uses only the "hop-by-hop" routing paradigm and since BGP 112 can support any policy that conforms to that paradigm, BGP is highly 113 applicable as an inter-AS routing protocol for the current Internet. 115 A more complete discussion of what policies can and cannot be 116 enforced with BGP is outside the scope of this document (but refer to 117 the companion document discussing BGP usage [5]). 119 BGP runs over a reliable transport protocol. This eliminates the 120 need to implement explicit update fragmentation, retransmission, 121 acknowledgment, and sequencing. Any authentication scheme used by 122 the transport protocol may be used in addition to BGP's own 123 authentication mechanisms. The error notification mechanism used in 124 BGP assumes that the transport protocol supports a "graceful" close, 125 i.e., that all outstanding data will be delivered before the 126 connection is closed. 128 BGP uses TCP [4] as its transport protocol. TCP meets BGP's 129 transport requirements and is present in virtually all commercial 130 routers and hosts. In the following descriptions the phrase 131 "transport protocol connection" can be understood to refer to a TCP 132 connection. BGP uses TCP port 179 for establishing its connections. 134 This document uses the term `Autonomous System' (AS) throughout. The 135 classic definition of an Autonomous System is a set of routers under 136 a single technical administration, using an interior gateway protocol 137 and common metrics to route packets within the AS, and using an 138 exterior gateway protocol to route packets to other ASs. Since this 139 RFC DRAFT August 1998 141 classic definition was developed, it has become common for a single 142 AS to use several interior gateway protocols and sometimes several 143 sets of metrics within an AS. The use of the term Autonomous System 144 here stresses the fact that, even when multiple IGPs and metrics are 145 used, the administration of an AS appears to other ASs to have a 146 single coherent interior routing plan and presents a consistent 147 picture of what destinations are reachable through it. 149 The planned use of BGP in the Internet environment, including such 150 issues as topology, the interaction between BGP and IGPs, and the 151 enforcement of routing policy rules is presented in a companion 152 document [5]. This document is the first of a series of documents 153 planned to explore various aspects of BGP application. Please send 154 comments to the BGP mailing list (bgp@ans.net). 156 3. Summary of Operation 158 Two systems form a transport protocol connection between one another. 159 They exchange messages to open and confirm the connection parameters. 160 The initial data flow is the entire BGP routing table. Incremental 161 updates are sent as the routing tables change. BGP does not require 162 periodic refresh of the entire BGP routing table. Therefore, a BGP 163 speaker must retain the current version of the entire BGP routing 164 tables of all of its peers for the duration of the connection. 165 KeepAlive messages are sent periodically to ensure the liveness of 166 the connection. Notification messages are sent in response to errors 167 or special conditions. If a connection encounters an error 168 condition, a notification message is sent and the connection is 169 closed. 171 The hosts executing the Border Gateway Protocol need not be routers. 172 A non-routing host could exchange routing information with routers 173 via EGP or even an interior routing protocol. That non-routing host 174 could then use BGP to exchange routing information with a border 175 router in another Autonomous System. The implications and 176 applications of this architecture are for further study. 178 Connections between BGP speakers of different ASs are referred to as 179 "external" links. BGP connections between BGP speakers within the 180 same AS are referred to as "internal" links. Similarly, a peer in a 181 different AS is referred to as an external peer, while a peer in the 182 same AS may be described as an internal peer. Internal BGP and 183 external BGP are commonly abbreviated IBGP and EBGP. 185 If a particular AS has multiple BGP speakers and is providing transit 186 RFC DRAFT August 1998 188 service for other ASs, then care must be taken to ensure a consistent 189 view of routing within the AS. A consistent view of the interior 190 routes of the AS is provided by the interior routing protocol. A 191 consistent view of the routes exterior to the AS can be provided by 192 having all BGP speakers within the AS maintain direct IBGP 193 connections with each other. Alternately the interior routing 194 protocol can pass BGP information among routers within an AS, taking 195 care not to lose BGP attributes that will be needed by EBGP speakers 196 if transit connectivity is being provided. For the purpose of 197 discussion, it is assumed that BGP information is passed within an AS 198 using IBGP. Care must be taken to ensure that the interior routers 199 have all been updated with transit information before the EBGP 200 speakers announce to other ASs that transit service is being 201 provided. 203 3.1 Routes: Advertisement and Storage 205 For purposes of this protocol a route is defined as a unit of 206 information that pairs a destination with the attributes of a path to 207 that destination: 209 - Routes are advertised between a pair of BGP speakers in UPDATE 210 messages: the destination is the systems whose IP addresses are 211 reported in the Network Layer Reachability Information (NLRI) 212 field, and the the path is the information reported in the path 213 attributes fields of the same UPDATE message. 215 - Routes are stored in the Routing Information Bases (RIBs): 216 namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes 217 that will be advertised to other BGP speakers must be present in 218 the Adj-RIB-Out; routes that will be used by the local BGP speaker 219 must be present in the Loc-RIB, and the next hop for each of these 220 routes must be present in the local BGP speaker's forwarding 221 information base; and routes that are received from other BGP 222 speakers are present in the Adj-RIBs-In. 224 If a BGP speaker chooses to advertise the route, it may add to or 225 modify the path attributes of the route before advertising it to a 226 peer. 228 BGP provides mechanisms by which a BGP speaker can inform its peer 229 that a previously advertised route is no longer available for use. 230 There are three methods by which a given BGP speaker can indicate 231 RFC DRAFT August 1998 233 that a route has been withdrawn from service: 235 a) the IP prefix that expresses destinations for a previously 236 advertised route can be advertised in the WITHDRAWN ROUTES field 237 in the UPDATE message, thus marking the associated route as being 238 no longer available for use 240 b) a replacement route with the same Network Layer Reachability 241 Information can be advertised, or 243 c) the BGP speaker - BGP speaker connection can be closed, which 244 implicitly removes from service all routes which the pair of 245 speakers had advertised to each other. 247 3.2 Routing Information Bases 249 The Routing Information Base (RIB) within a BGP speaker consists of 250 three distinct parts: 252 a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has 253 been learned from inbound UPDATE messages. Their contents 254 represent routes that are available as an input to the Decision 255 Process. 257 b) Loc-RIB: The Loc-RIB contains the local routing information 258 that the BGP speaker has selected by applying its local policies 259 to the routing information contained in its Adj-RIBs-In. 261 c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the 262 local BGP speaker has selected for advertisement to its peers. The 263 routing information stored in the Adj-RIBs-Out will be carried in 264 the local BGP speaker's UPDATE messages and advertised to its 265 peers. 267 In summary, the Adj-RIBs-In contain unprocessed routing information 268 that has been advertised to the local BGP speaker by its peers; the 269 Loc-RIB contains the routes that have been selected by the local BGP 270 speaker's Decision Process; and the Adj-RIBs-Out organize the routes 271 for advertisement to specific peers by means of the local speaker's 272 UPDATE messages. 274 Although the conceptual model distinguishes between Adj-RIBs-In, 275 Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an 276 RFC DRAFT August 1998 278 implementation must maintain three separate copies of the routing 279 information. The choice of implementation (for example, 3 copies of 280 the information vs 1 copy with pointers) is not constrained by the 281 protocol. 283 4. Message Formats 285 This section describes message formats used by BGP. 287 Messages are sent over a reliable transport protocol connection. A 288 message is processed only after it is entirely received. The maximum 289 message size is 4096 octets. All implementations are required to 290 support this maximum message size. The smallest message that may be 291 sent consists of a BGP header without a data portion, or 19 octets. 293 4.1 Message Header Format 295 Each message has a fixed-size header. There may or may not be a data 296 portion following the header, depending on the message type. The 297 layout of these fields is shown below: 299 0 1 2 3 300 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 301 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 302 | | 303 + + 304 | | 305 + + 306 | Marker | 307 + + 308 | | 309 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 310 | Length | Type | 311 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 313 Marker: 315 RFC DRAFT August 1998 317 This 16-octet field contains a value that the receiver of the 318 message can predict. If the Type of the message is OPEN, or if 319 the OPEN message carries no Authentication Information (as an 320 Optional Parameter), then the Marker must be all ones. 321 Otherwise, the value of the marker can be predicted by some a 322 computation specified as part of the authentication mechanism 323 (which is specified as part of the Authentication Information) 324 used. The Marker can be used to detect loss of synchronization 325 between a pair of BGP peers, and to authenticate incoming BGP 326 messages. 328 Length: 330 This 2-octet unsigned integer indicates the total length of the 331 message, including the header, in octets. Thus, e.g., it 332 allows one to locate in the transport-level stream the (Marker 333 field of the) next message. The value of the Length field must 334 always be at least 19 and no greater than 4096, and may be 335 further constrained, depending on the message type. No 336 "padding" of extra data after the message is allowed, so the 337 Length field must have the smallest value required given the 338 rest of the message. 340 Type: 342 This 1-octet unsigned integer indicates the type code of the 343 message. The following type codes are defined: 345 1 - OPEN 346 2 - UPDATE 347 3 - NOTIFICATION 348 4 - KEEPALIVE 350 4.2 OPEN Message Format 352 After a transport protocol connection is established, the first 353 message sent by each side is an OPEN message. If the OPEN message is 354 acceptable, a KEEPALIVE message confirming the OPEN is sent back. 355 Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION 356 messages may be exchanged. 358 In addition to the fixed-size BGP header, the OPEN message contains 359 the following fields: 361 RFC DRAFT August 1998 363 0 1 2 3 364 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 365 +-+-+-+-+-+-+-+-+ 366 | Version | 367 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 368 | My Autonomous System | 369 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 370 | Hold Time | 371 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 372 | BGP Identifier | 373 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 374 | Opt Parm Len | 375 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 376 | | 377 | Optional Parameters | 378 | | 379 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 381 Version: 383 This 1-octet unsigned integer indicates the protocol version 384 number of the message. The current BGP version number is 4. 386 My Autonomous System: 388 This 2-octet unsigned integer indicates the Autonomous System 389 number of the sender. 391 Hold Time: 393 This 2-octet unsigned integer indicates the number of seconds 394 that the sender proposes for the value of the Hold Timer. Upon 395 receipt of an OPEN message, a BGP speaker MUST calculate the 396 value of the Hold Timer by using the smaller of its configured 397 Hold Time and the Hold Time received in the OPEN message. The 398 Hold Time MUST be either zero or at least three seconds. An 399 implementation may reject connections on the basis of the Hold 400 Time. The calculated value indicates the maximum number of 401 seconds that may elapse between the receipt of successive 402 KEEPALIVE, and/or UPDATE messages by the sender. 404 BGP Identifier: 405 This 4-octet unsigned integer indicates the BGP Identifier of 406 the sender. A given BGP speaker sets the value of its BGP 407 RFC DRAFT August 1998 409 Identifier to an IP address assigned to that BGP speaker. The 410 value of the BGP Identifier is determined on startup and is the 411 same for every local interface and every BGP peer. 413 Optional Parameters Length: 415 This 1-octet unsigned integer indicates the total length of the 416 Optional Parameters field in octets. If the value of this field 417 is zero, no Optional Parameters are present. 419 Optional Parameters: 421 This field may contain a list of optional parameters, where 422 each parameter is encoded as a triplet. 425 0 1 426 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 427 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 428 | Parm. Type | Parm. Length | Parameter Value (variable) 429 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 431 Parameter Type is a one octet field that unambiguously 432 identifies individual parameters. Parameter Length is a one 433 octet field that contains the length of the Parameter Value 434 field in octets. Parameter Value is a variable length field 435 that is interpreted according to the value of the Parameter 436 Type field. 438 This document defines the following Optional Parameters: 440 a) Authentication Information (Parameter Type 1): 442 This optional parameter may be used to authenticate a BGP 443 peer. The Parameter Value field contains a 1-octet 444 Authentication Code followed by a variable length 445 Authentication Data. 447 0 1 2 3 4 5 6 7 8 448 RFC DRAFT August 1998 450 +-+-+-+-+-+-+-+-+ 451 | Auth. Code | 452 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 453 | | 454 | Authentication Data | 455 | | 456 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 458 Authentication Code: 460 This 1-octet unsigned integer indicates the 461 authentication mechanism being used. Whenever an 462 authentication mechanism is specified for use within 463 BGP, three things must be included in the 464 specification: 465 - the value of the Authentication Code which indicates 466 use of the mechanism, 467 - the form and meaning of the Authentication Data, and 468 - the algorithm for computing values of Marker fields. 470 Note that a separate authentication mechanism may be 471 used in establishing the transport level connection. 473 Authentication Data: 475 The form and meaning of this field is a variable- 476 length field depend on the Authentication Code. 478 The minimum length of the OPEN message is 29 octets (including 479 message header). 481 4.3 UPDATE Message Format 483 UPDATE messages are used to transfer routing information between BGP 484 peers. The information in the UPDATE packet can be used to construct 485 a graph describing the relationships of the various Autonomous 486 Systems. By applying rules to be discussed, routing information 487 loops and some other anomalies may be detected and removed from 488 inter-AS routing. 490 An UPDATE message is used to advertise a single feasible route to a 491 peer, or to withdraw multiple unfeasible routes from service (see 492 RFC DRAFT August 1998 494 3.1). An UPDATE message may simultaneously advertise a feasible route 495 and withdraw multiple unfeasible routes from service. The UPDATE 496 message always includes the fixed-size BGP header, and can optionally 497 include the other fields as shown below: 499 +-----------------------------------------------------+ 500 | Unfeasible Routes Length (2 octets) | 501 +-----------------------------------------------------+ 502 | Withdrawn Routes (variable) | 503 +-----------------------------------------------------+ 504 | Total Path Attribute Length (2 octets) | 505 +-----------------------------------------------------+ 506 | Path Attributes (variable) | 507 +-----------------------------------------------------+ 508 | Network Layer Reachability Information (variable) | 509 +-----------------------------------------------------+ 511 Unfeasible Routes Length: 513 This 2-octets unsigned integer indicates the total length of 514 the Withdrawn Routes field in octets. Its value must allow the 515 length of the Network Layer Reachability Information field to 516 be determined as specified below. 518 A value of 0 indicates that no routes are being withdrawn from 519 service, and that the WITHDRAWN ROUTES field is not present in 520 this UPDATE message. 522 Withdrawn Routes: 524 This is a variable length field that contains a list of IP 525 address prefixes for the routes that are being withdrawn from 526 service. Each IP address prefix is encoded as a 2-tuple of the 527 form , whose fields are described below: 529 +---------------------------+ 530 | Length (1 octet) | 531 +---------------------------+ 532 | Prefix (variable) | 533 +---------------------------+ 534 RFC DRAFT August 1998 536 The use and the meaning of these fields are as follows: 538 a) Length: 540 The Length field indicates the length in bits of the IP 541 address prefix. A length of zero indicates a prefix that 542 matches all IP addresses (with prefix, itself, of zero 543 octets). 545 b) Prefix: 547 The Prefix field contains IP address prefixes followed by 548 enough trailing bits to make the end of the field fall on an 549 octet boundary. Note that the value of trailing bits is 550 irrelevant. 552 Total Path Attribute Length: 554 This 2-octet unsigned integer indicates the total length of the 555 Path Attributes field in octets. Its value must allow the 556 length of the Network Layer Reachability field to be determined 557 as specified below. 559 A value of 0 indicates that no Network Layer Reachability 560 Information field is present in this UPDATE message. 562 Path Attributes: 564 A variable length sequence of path attributes is present in 565 every UPDATE. Each path attribute is a triple of variable length. 568 Attribute Type is a two-octet field that consists of the 569 Attribute Flags octet followed by the Attribute Type Code 570 octet. 572 0 1 573 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 574 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 575 | Attr. Flags |Attr. Type Code| 576 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 577 RFC DRAFT August 1998 579 The high-order bit (bit 0) of the Attribute Flags octet is the 580 Optional bit. It defines whether the attribute is optional (if 581 set to 1) or well-known (if set to 0). 583 The second high-order bit (bit 1) of the Attribute Flags octet 584 is the Transitive bit. It defines whether an optional 585 attribute is transitive (if set to 1) or non-transitive (if set 586 to 0). For well-known attributes, the Transitive bit must be 587 set to 1. (See Section 5 for a discussion of transitive 588 attributes.) 590 The third high-order bit (bit 2) of the Attribute Flags octet 591 is the Partial bit. It defines whether the information 592 contained in the optional transitive attribute is partial (if 593 set to 1) or complete (if set to 0). For well-known attributes 594 and for optional non-transitive attributes the Partial bit must 595 be set to 0. 597 The fourth high-order bit (bit 3) of the Attribute Flags octet 598 is the Extended Length bit. It defines whether the Attribute 599 Length is one octet (if set to 0) or two octets (if set to 1). 600 Extended Length may be used only if the length of the attribute 601 value is greater than 255 octets. 603 The lower-order four bits of the Attribute Flags octet are . 604 unused. They must be zero (and must be ignored when received). 606 The Attribute Type Code octet contains the Attribute Type Code. 607 Currently defined Attribute Type Codes are discussed in Section 608 5. 610 If the Extended Length bit of the Attribute Flags octet is set 611 to 0, the third octet of the Path Attribute contains the length 612 of the attribute data in octets. 614 If the Extended Length bit of the Attribute Flags octet is set 615 to 1, then the third and the fourth octets of the path 616 attribute contain the length of the attribute data in octets. 618 The remaining octets of the Path Attribute represent the 619 attribute value and are interpreted according to the Attribute 620 Flags and the Attribute Type Code. The supported Attribute Type 621 Codes, their attribute values and uses are the following: 623 a) ORIGIN (Type Code 1): 625 RFC DRAFT August 1998 627 ORIGIN is a well-known mandatory attribute that defines the 628 origin of the path information. The data octet can assume 629 the following values: 631 Value Meaning 633 0 IGP - Network Layer Reachability Information 634 is interior to the originating AS 636 1 EGP - Network Layer Reachability Information 637 learned via EGP 639 2 INCOMPLETE - Network Layer Reachability 640 Information learned by some other means 642 Its usage is defined in 5.1.1 644 b) AS_PATH (Type Code 2): 646 AS_PATH is a well-known mandatory attribute that is composed 647 of a sequence of AS path segments. Each AS path segment is 648 represented by a triple . 651 The path segment type is a 1-octet long field with the 652 following values defined: 654 Value Segment Type 656 1 AS_SET: unordered set of ASs a route in the 657 UPDATE message has traversed 659 2 AS_SEQUENCE: ordered set of ASs a route in 660 the UPDATE message has traversed 662 The path segment length is a 1-octet long field containing 663 the number of ASs in the path segment value field. 665 The path segment value field contains one or more AS 666 numbers, each encoded as a 2-octets long field. 668 Usage of this attribute is defined in 5.1.2. 670 c) NEXT_HOP (Type Code 3): 672 This is a well-known mandatory attribute that defines the IP 673 RFC DRAFT August 1998 675 address of the border router that should be used as the next 676 hop to the destinations listed in the Network Layer 677 Reachability field of the UPDATE message. 679 Usage of this attribute is defined in 5.1.3. 681 d) MULTI_EXIT_DISC (Type Code 4): 683 This is an optional non-transitive attribute that is a four 684 octet non-negative integer. The value of this attribute may 685 be used by a BGP speaker's decision process to discriminate 686 among multiple exit points to a neighboring autonomous 687 system. 689 Its usage is defined in 5.1.4. 691 e) LOCAL_PREF (Type Code 5): 693 LOCAL_PREF is a well-known mandatory attribute that is a 694 four octet non-negative integer. It is used by a BGP speaker 695 to inform other internal peers of the advertising speaker's 696 degree of preference for an advertised route. Usage of this 697 attribute is described in 5.1.5. 699 f) ATOMIC_AGGREGATE (Type Code 6) 701 ATOMIC_AGGREGATE is a well-known discretionary attribute of 702 length 0. It is used by a BGP speaker to inform other BGP 703 speakers that the local system selected a less specific 704 route without selecting a more specific route which is 705 included in it. Usage of this attribute is described in 706 5.1.6. 708 g) AGGREGATOR (Type Code 7) 710 AGGREGATOR is an optional transitive attribute of length 6. 711 The attribute contains the last AS number that formed the 712 aggregate route (encoded as 2 octets), followed by the IP 713 address of the BGP speaker that formed the aggregate route 714 (encoded as 4 octets). Usage of this attribute is described 715 in 5.1.7 717 Network Layer Reachability Information: 719 This variable length field contains a list of IP address 720 RFC DRAFT August 1998 722 prefixes. The length in octets of the Network Layer 723 Reachability Information is not encoded explicitly, but can be 724 calculated as: 726 UPDATE message Length - 23 - Total Path Attributes Length - 727 Unfeasible Routes Length 729 where UPDATE message Length is the value encoded in the fixed- 730 size BGP header, Total Path Attribute Length and Unfeasible 731 Routes Length are the values encoded in the variable part of 732 the UPDATE message, and 23 is a combined length of the fixed- 733 size BGP header, the Total Path Attribute Length field and the 734 Unfeasible Routes Length field. 736 Reachability information is encoded as one or more 2-tuples of 737 the form , whose fields are described below: 739 +---------------------------+ 740 | Length (1 octet) | 741 +---------------------------+ 742 | Prefix (variable) | 743 +---------------------------+ 745 The use and the meaning of these fields are as follows: 747 a) Length: 749 The Length field indicates the length in bits of the IP 750 address prefix. A length of zero indicates a prefix that 751 matches all IP addresses (with prefix, itself, of zero 752 octets). 754 b) Prefix: 756 The Prefix field contains IP address prefixes followed by 757 enough trailing bits to make the end of the field fall on an 758 octet boundary. Note that the value of the trailing bits is 759 irrelevant. 761 The minimum length of the UPDATE message is 23 octets -- 19 octets 762 for the fixed header + 2 octets for the Unfeasible Routes Length + 2 763 octets for the Total Path Attribute Length (the value of Unfeasible 764 Routes Length is 0 and the value of Total Path Attribute Length is 765 0). 767 RFC DRAFT August 1998 769 An UPDATE message can advertise at most one route, which may be 770 described by several path attributes. All path attributes contained 771 in a given UPDATE messages apply to the destinations carried in the 772 Network Layer Reachability Information field of the UPDATE message. 774 An UPDATE message can list multiple routes to be withdrawn from 775 service. Each such route is identified by its destination (expressed 776 as an IP prefix), which unambiguously identifies the route in the 777 context of the BGP speaker - BGP speaker connection to which it has 778 been previously been advertised. 780 An UPDATE message may advertise only routes to be withdrawn from 781 service, in which case it will not include path attributes or Network 782 Layer Reachability Information. Conversely, it may advertise only a 783 feasible route, in which case the WITHDRAWN ROUTES field need not be 784 present. 786 4.4 KEEPALIVE Message Format 788 BGP does not use any transport protocol-based keep-alive mechanism to 789 determine if peers are reachable. Instead, KEEPALIVE messages are 790 exchanged between peers often enough as not to cause the Hold Timer 791 to expire. A reasonable maximum time between KEEPALIVE messages 792 would be one third of the Hold Time interval. KEEPALIVE messages 793 MUST NOT be sent more frequently than one per second. An 794 implementation MAY adjust the rate at which it sends KEEPALIVE 795 messages as a function of the Hold Time interval. 797 If the negotiated Hold Time interval is zero, then periodic KEEPALIVE 798 messages MUST NOT be sent. 800 KEEPALIVE message consists of only message header and has a length of 801 19 octets. 803 4.5 NOTIFICATION Message Format 805 A NOTIFICATION message is sent when an error condition is detected. 806 The BGP connection is closed immediately after sending it. 808 In addition to the fixed-size BGP header, the NOTIFICATION message 809 contains the following fields: 811 RFC DRAFT August 1998 813 0 1 2 3 814 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 815 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 816 | Error code | Error subcode | Data | 817 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 818 | | 819 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 821 Error Code: 823 This 1-octet unsigned integer indicates the type of 824 NOTIFICATION. The following Error Codes have been defined: 826 Error Code Symbolic Name Reference 828 1 Message Header Error Section 6.1 830 2 OPEN Message Error Section 6.2 832 3 UPDATE Message Error Section 6.3 834 4 Hold Timer Expired Section 6.5 836 5 Finite State Machine Error Section 6.6 838 6 Cease Section 6.7 840 Error subcode: 842 This 1-octet unsigned integer provides more specific 843 information about the nature of the reported error. Each Error 844 Code may have one or more Error Subcodes associated with it. 845 If no appropriate Error Subcode is defined, then a zero 846 (Unspecific) value is used for the Error Subcode field. 848 Message Header Error subcodes: 850 1 - Connection Not Synchronized. 851 2 - Bad Message Length. 852 3 - Bad Message Type. 854 OPEN Message Error subcodes: 856 RFC DRAFT August 1998 858 1 - Unsupported Version Number. 859 2 - Bad Peer AS. 860 3 - Bad BGP Identifier. 861 4 - Unsupported Optional Parameter. 862 5 - Authentication Failure. 863 6 - Unacceptable Hold Time. 865 UPDATE Message Error subcodes: 867 1 - Malformed Attribute List. 868 2 - Unrecognized Well-known Attribute. 869 3 - Missing Well-known Attribute. 870 4 - Attribute Flags Error. 871 5 - Attribute Length Error. 872 6 - Invalid ORIGIN Attribute 873 8 - Invalid NEXT_HOP Attribute. 874 9 - Optional Attribute Error. 875 10 - Invalid Network Field. 876 11 - Malformed AS_PATH. 878 Data: 880 This variable-length field is used to diagnose the reason for 881 the NOTIFICATION. The contents of the Data field depend upon 882 the Error Code and Error Subcode. See Section 6 below for more 883 details. 885 Note that the length of the Data field can be determined from 886 the message Length field by the formula: 888 Message Length = 21 + Data Length 890 The minimum length of the NOTIFICATION message is 21 octets 891 (including message header). 893 5. Path Attributes 895 This section discusses the path attributes of the UPDATE message. 897 Path attributes fall into four separate categories: 899 1. Well-known mandatory. 900 2. Well-known discretionary. 902 RFC DRAFT August 1998 904 3. Optional transitive. 905 4. Optional non-transitive. 907 Well-known attributes must be recognized by all BGP implementations. 908 Some of these attributes are mandatory and must be included in every 909 UPDATE message that contains NLRI. Others are discretionary and may 910 or may not be sent in a particular UPDATE message. 912 All well-known attributes must be passed along (after proper 913 updating, if necessary) to other BGP peers. 915 In addition to well-known attributes, each path may contain one or 916 more optional attributes. It is not required or expected that all 917 BGP implementations support all optional attributes. The handling of 918 an unrecognized optional attribute is determined by the setting of 919 the Transitive bit in the attribute flags octet. Paths with 920 unrecognized transitive optional attributes should be accepted. If a 921 path with unrecognized transitive optional attribute is accepted and 922 passed along to other BGP peers, then the unrecognized transitive 923 optional attribute of that path must be passed along with the path to 924 other BGP peers with the Partial bit in the Attribute Flags octet set 925 to 1. If a path with recognized transitive optional attribute is 926 accepted and passed along to other BGP peers and the Partial bit in 927 the Attribute Flags octet is set to 1 by some previous AS, it is not 928 set back to 0 by the current AS. Unrecognized non-transitive optional 929 attributes must be quietly ignored and not passed along to other BGP 930 peers. 932 New transitive optional attributes may be attached to the path by the 933 originator or by any other AS in the path. If they are not attached 934 by the originator, the Partial bit in the Attribute Flags octet is 935 set to 1. The rules for attaching new non-transitive optional 936 attributes will depend on the nature of the specific attribute. The 937 documentation of each new non-transitive optional attribute will be 938 expected to include such rules. (The description of the 939 MULTI_EXIT_DISC attribute gives an example.) All optional attributes 940 (both transitive and non-transitive) may be updated (if appropriate) 941 by ASs in the path. 943 The sender of an UPDATE message should order path attributes within 944 the UPDATE message in ascending order of attribute type. The 945 receiver of an UPDATE message must be prepared to handle path 946 attributes within the UPDATE message that are out of order. 948 The same attribute cannot appear more than once within the Path 949 Attributes field of a particular UPDATE message. 951 RFC DRAFT August 1998 953 The mandatory category refers to an attribute which must be present 954 in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE 955 message. Attributes classified as optional for the purpose of the 956 protocol extension mechanism may be purely discretionary, or 957 discretionary, required, or disallowed in certain contexts. 959 attribute EBGP IBGP 960 ORIGIN mandatory mandatory 961 AS_PATH mandatory mandatory 962 NEXT_HOP mandatory mandatory 963 MULTI_EXIT_DISC discretionary discretionary 964 LOCAL_PREF disallowed required 965 ATOMIC_AGGREGATE see section 5.1.6 and 9.1.4 966 AGGREGATOR discretionary discretionary 968 5.1 Path Attribute Usage 970 The usage of each BGP path attributes is described in the following 971 clauses. 973 5.1.1 ORIGIN 975 ORIGIN is a well-known mandatory attribute. The ORIGIN attribute 976 shall be generated by the autonomous system that originates the 977 associated routing information. It shall be included in the UPDATE 978 messages of all BGP speakers that choose to propagate this 979 information to other BGP speakers. 981 5.1.2 AS_PATH 983 AS_PATH is a well-known mandatory attribute. This attribute 984 identifies the autonomous systems through which routing information 985 carried in this UPDATE message has passed. The components of this 986 list can be AS_SETs or AS_SEQUENCEs. 988 When a BGP speaker propagates a route which it has learned from 989 another BGP speaker's UPDATE message, it shall modify the route's 990 RFC DRAFT August 1998 992 AS_PATH attribute based on the location of the BGP speaker to which 993 the route will be sent: 995 a) When a given BGP speaker advertises the route to an internal 996 peer, the advertising speaker shall not modify the AS_PATH 997 attribute associated with the route. 999 b) When a given BGP speaker advertises the route to an external 1000 peer, then the advertising speaker shall update the AS_PATH 1001 attribute as follows: 1003 1) if the first path segment of the AS_PATH is of type 1004 AS_SEQUENCE, the local system shall prepend its own AS number 1005 as the last element of the sequence (put it in the leftmost 1006 position) 1008 2) if the first path segment of the AS_PATH is of type AS_SET, 1009 the local system shall prepend a new path segment of type 1010 AS_SEQUENCE to the AS_PATH, including its own AS number in that 1011 segment. 1013 When a BGP speaker originates a route then: 1015 a) the originating speaker shall include its own AS number in 1016 the AS_PATH attribute of all UPDATE messages sent to an 1017 external peer. (In this case, the AS number of the originating 1018 speaker's autonomous system will be the only entry in the 1019 AS_PATH attribute). 1021 b) the originating speaker shall include an empty AS_PATH 1022 attribute in all UPDATE messages sent to internal peers. (An 1023 empty AS_PATH attribute is one whose length field contains the 1024 value zero). 1026 5.1.3 NEXT_HOP 1028 The NEXT_HOP path attribute defines the IP address of the border 1029 router that should be used as the next hop to the destinations listed 1030 in the UPDATE message. When advertising a NEXT_HOP attribute to an 1031 external peer, a router may use one of its own interface addresses in 1032 the NEXT_HOP attribute provided the external peer to which the route 1033 is being advertised shares a common subnet with the NEXT_HOP address. 1034 This is known as a "first party" NEXT_HOP attribute. A BGP speaker 1035 RFC DRAFT August 1998 1037 can advertise to an external peer an interface of any internal peer 1038 router in the NEXT_HOP attribute provided the external peer to which 1039 the route is being advertised shares a common subnet with the 1040 NEXT_HOP address. This is known as a "third party" NEXT_HOP 1041 attribute. A BGP speaker can advertise any external peer router in 1042 the NEXT_HOP attribute provided that the IP address of this border 1043 router was learned from an external peer and the external peer to 1044 which the route is being advertised shares a common subnet with the 1045 NEXT_HOP address. This is a second form of "third party" NEXT_HOP 1046 attribute. 1048 Normally the NEXT_HOP attribute is chosen such that the shortest 1049 available path will be taken. A BGP speaker must be able to support 1050 disabling advertisement of third party NEXT_HOP attributes to handle 1051 imperfectly bridged media. 1053 A BGP speaker must never advertise an address of a peer to that peer 1054 as a NEXT_HOP, for a route that the speaker is originating. A BGP 1055 speaker must never install a route with itself as the next hop. 1057 When a BGP speaker advertises the route to an internal peer, the 1058 advertising speaker should not modify the NEXT_HOP attribute 1059 associated with the route. When a BGP speaker receives the route via 1060 an internal link, it may forward packets to the NEXT_HOP address if 1061 the address contained in the attribute is on a common subnet with the 1062 local and remote BGP speakers. 1064 5.1.4 MULTI_EXIT_DISC 1066 The MULTI_EXIT_DISC attribute may be used on external (inter-AS) 1067 links to discriminate among multiple exit or entry points to the same 1068 neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four 1069 octet unsigned number which is called a metric. All other factors 1070 being equal, the exit or entry point with lower metric should be 1071 preferred. If received over external links, the MULTI_EXIT_DISC 1072 attribute MAY be propagated over internal links to other BGP speakers 1073 within the same AS. The MULTI_EXIT_DISC attribute received from a 1074 neighboring AS MUST NOT be propagated to other neighboring ASs. 1076 A BGP speaker MUST IMPLEMENT a mechanism based on local configuration 1077 which allows the MULTI_EXIT_DISC attribute to be removed from a 1078 route. This MAY be done either prior to or after determining the 1079 degree of preference of the route and performing route selection 1080 (decision process phases 1 and 2). 1082 RFC DRAFT August 1998 1084 An implementation MAY also (based on local configuration) alter the 1085 value of the MULTI_EXIT_DISC attribute received over an external 1086 link. If it does so, it shall do so prior to determining the degree 1087 of preference of the route and performing route selection (decision 1088 process phases 1 and 2). 1090 5.1.5 LOCAL_PREF 1092 LOCAL_PREF is a well-known mandatory attribute that SHALL be included 1093 in all UPDATE messages that a given BGP speaker sends to the other 1094 internal peers. A BGP speaker SHALL calculate the degree of 1095 preference for each external route and include the degree of 1096 preference when advertising a route to its internal peers. The higher 1097 degree of preference MUST be preferred. A BGP speaker shall use the 1098 degree of preference learned via LOCAL_PREF in its decision process 1099 (see section 9.1.1). 1101 A BGP speaker MUST NOT include this attribute in UPDATE messages that 1102 it sends to external peers. If it is contained in an UPDATE message 1103 that is received from an external peer, then this attribute MUST be 1104 ignored by the receiving speaker. 1106 5.1.6 ATOMIC_AGGREGATE 1108 ATOMIC_AGGREGATE is a well-known discretionary attribute. If a BGP 1109 speaker, when presented with a set of overlapping routes from one of 1110 its peers (see 9.1.4), selects the less specific route without 1111 selecting the more specific one, then the local system MUST attach 1112 the ATOMIC_AGGREGATE attribute to the route when propagating it to 1113 other BGP speakers (if that attribute is not already present in the 1114 received less specific route). A BGP speaker that receives a route 1115 with the ATOMIC_AGGREGATE attribute MUST NOT remove the attribute 1116 from the route when propagating it to other speakers. A BGP speaker 1117 that receives a route with the ATOMIC_AGGREGATE attribute MUST NOT 1118 make any NLRI of that route more specific (as defined in 9.1.4) when 1119 advertising this route to other BGP speakers. A BGP speaker that 1120 receives a route with the ATOMIC_AGGREGATE attribute needs to be 1121 cognizant of the fact that the actual path to destinations, as 1122 specified in the NLRI of the route, while having the loop-free 1123 property, may traverse ASs that are not listed in the AS_PATH 1124 attribute. 1126 RFC DRAFT August 1998 1128 5.1.7 AGGREGATOR 1130 AGGREGATOR is an optional transitive attribute which may be included 1131 in updates which are formed by aggregation (see Section 9.2.4.2). A 1132 BGP speaker which performs route aggregation may add the AGGREGATOR 1133 attribute which shall contain its own AS number and IP address. 1135 6. BGP Error Handling. 1137 This section describes actions to be taken when errors are detected 1138 while processing BGP messages. 1140 When any of the conditions described here are detected, a 1141 NOTIFICATION message with the indicated Error Code, Error Subcode, 1142 and Data fields is sent, and the BGP connection is closed. If no 1143 Error Subcode is specified, then a zero must be used. 1145 The phrase "the BGP connection is closed" means that the transport 1146 protocol connection has been closed and that all resources for that 1147 BGP connection have been deallocated. Routing table entries 1148 associated with the remote peer are marked as invalid. The fact that 1149 the routes have become invalid is passed to other BGP peers before 1150 the routes are deleted from the system. 1152 Unless specified explicitly, the Data field of the NOTIFICATION 1153 message that is sent to indicate an error is empty. 1155 6.1 Message Header error handling. 1157 All errors detected while processing the Message Header are indicated 1158 by sending the NOTIFICATION message with Error Code Message Header 1159 Error. The Error Subcode elaborates on the specific nature of the 1160 error. 1162 The expected value of the Marker field of the message header is all 1163 ones if the message type is OPEN. The expected value of the Marker 1164 field for all other types of BGP messages determined based on the 1165 presence of the Authentication Information Optional Parameter in the 1166 BGP OPEN message and the actual authentication mechanism (if the 1167 Authentication Information in the BGP OPEN message is present). If 1168 the Marker field of the message header is not the expected one, then 1169 RFC DRAFT August 1998 1171 a synchronization error has occurred and the Error Subcode is set to 1172 Connection Not Synchronized. 1174 If the Length field of the message header is less than 19 or greater 1175 than 4096, or if the Length field of an OPEN message is less than 1176 the minimum length of the OPEN message, or if the Length field of an 1177 UPDATE message is less than the minimum length of the UPDATE message, 1178 or if the Length field of a KEEPALIVE message is not equal to 19, or 1179 if the Length field of a NOTIFICATION message is less than the 1180 minimum length of the NOTIFICATION message, then the Error Subcode is 1181 set to Bad Message Length. The Data field contains the erroneous 1182 Length field. 1184 If the Type field of the message header is not recognized, then the 1185 Error Subcode is set to Bad Message Type. The Data field contains 1186 the erroneous Type field. 1188 6.2 OPEN message error handling. 1190 All errors detected while processing the OPEN message are indicated 1191 by sending the NOTIFICATION message with Error Code OPEN Message 1192 Error. The Error Subcode elaborates on the specific nature of the 1193 error. 1195 If the version number contained in the Version field of the received 1196 OPEN message is not supported, then the Error Subcode is set to 1197 Unsupported Version Number. The Data field is a 2-octet unsigned 1198 integer, which indicates the largest locally supported version number 1199 less than the version the remote BGP peer bid (as indicated in the 1200 received OPEN message). 1202 If the Autonomous System field of the OPEN message is unacceptable, 1203 then the Error Subcode is set to Bad Peer AS. The determination of 1204 acceptable Autonomous System numbers is outside the scope of this 1205 protocol. 1207 If the Hold Time field of the OPEN message is unacceptable, then the 1208 Error Subcode MUST be set to Unacceptable Hold Time. An 1209 implementation MUST reject Hold Time values of one or two seconds. 1210 An implementation MAY reject any proposed Hold Time. An 1211 implementation which accepts a Hold Time MUST use the negotiated 1212 value for the Hold Time. 1214 If the BGP Identifier field of the OPEN message is syntactically 1215 RFC DRAFT August 1998 1217 incorrect, then the Error Subcode is set to Bad BGP Identifier. 1218 Syntactic correctness means that the BGP Identifier field represents 1219 a valid IP host address. 1221 If one of the Optional Parameters in the OPEN message is not 1222 recognized, then the Error Subcode is set to Unsupported Optional 1223 Parameters. 1225 If the OPEN message carries Authentication Information (as an 1226 Optional Parameter), then the corresponding authentication procedure 1227 is invoked. If the authentication procedure (based on Authentication 1228 Code and Authentication Data) fails, then the Error Subcode is set to 1229 Authentication Failure. 1231 6.3 UPDATE message error handling. 1233 All errors detected while processing the UPDATE message are indicated 1234 by sending the NOTIFICATION message with Error Code UPDATE Message 1235 Error. The error subcode elaborates on the specific nature of the 1236 error. 1238 Error checking of an UPDATE message begins by examining the path 1239 attributes. If the Unfeasible Routes Length or Total Attribute 1240 Length is too large (i.e., if Unfeasible Routes Length + Total 1241 Attribute Length + 23 exceeds the message Length), then the Error 1242 Subcode is set to Malformed Attribute List. 1244 If any recognized attribute has Attribute Flags that conflict with 1245 the Attribute Type Code, then the Error Subcode is set to Attribute 1246 Flags Error. The Data field contains the erroneous attribute (type, 1247 length and value). 1249 If any recognized attribute has Attribute Length that conflicts with 1250 the expected length (based on the attribute type code), then the 1251 Error Subcode is set to Attribute Length Error. The Data field 1252 contains the erroneous attribute (type, length and value). 1254 If any of the mandatory well-known attributes are not present, then 1255 the Error Subcode is set to Missing Well-known Attribute. The Data 1256 field contains the Attribute Type Code of the missing well-known 1257 attribute. 1259 RFC DRAFT August 1998 1261 If any of the mandatory well-known attributes are not recognized, 1262 then the Error Subcode is set to Unrecognized Well-known Attribute. 1263 The Data field contains the unrecognized attribute (type, length and 1264 value). 1266 If the ORIGIN attribute has an undefined value, then the Error 1267 Subcode is set to Invalid Origin Attribute. The Data field contains 1268 the unrecognized attribute (type, length and value). 1270 If the NEXT_HOP attribute field is syntactically incorrect, then the 1271 Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field 1272 contains the incorrect attribute (type, length and value). Syntactic 1273 correctness means that the NEXT_HOP attribute represents a valid IP 1274 host address. Semantic correctness applies only to the external BGP 1275 links. It means that the interface associated with the IP address, as 1276 specified in the NEXT_HOP attribute, shares a common subnet with the 1277 receiving BGP speaker and is not the IP address of the receiving BGP 1278 speaker. If the NEXT_HOP attribute is semantically incorrect, the 1279 error should be logged, and the the route should be ignored. In this 1280 case, no NOTIFICATION message should be sent. 1282 The AS_PATH attribute is checked for syntactic correctness. If the 1283 path is syntactically incorrect, then the Error Subcode is set to 1284 Malformed AS_PATH. 1286 The information carried by the AS_PATH attribute is checked for AS 1287 loops. AS loop detection is done by scanning the full AS path (as 1288 specified in the AS_PATH attribute), and checking that the autonomous 1289 system number of the local system does not appear in the AS path. If 1290 the autonomous system number appears in the AS path the route may be 1291 stored in the Adj-RIB-In, but unless the router is configured to 1292 accept routes with its own autonomous system in the AS path, the 1293 route shall not be passed to the BGP Decision Process. Operations of 1294 a router that is configured to accept routes with its own autonomous 1295 system number in the AS path are outside the scope of this document. 1297 If an optional attribute is recognized, then the value of this 1298 attribute is checked. If an error is detected, the attribute is 1299 discarded, and the Error Subcode is set to Optional Attribute Error. 1300 The Data field contains the attribute (type, length and value). 1302 If any attribute appears more than once in the UPDATE message, then 1303 the Error Subcode is set to Malformed Attribute List. 1305 The NLRI field in the UPDATE message is checked for syntactic 1306 RFC DRAFT August 1998 1308 validity. If the field is syntactically incorrect, then the Error 1309 Subcode is set to Invalid Network Field. 1311 An UPDATE message that contains correct path attributes, but no NLRI, 1312 shall be treated as a valid UPDATE message. 1314 6.4 NOTIFICATION message error handling. 1316 If a peer sends a NOTIFICATION message, and there is an error in that 1317 message, there is unfortunately no means of reporting this error via 1318 a subsequent NOTIFICATION message. Any such error, such as an 1319 unrecognized Error Code or Error Subcode, should be noticed, logged 1320 locally, and brought to the attention of the administration of the 1321 peer. The means to do this, however, lies outside the scope of this 1322 document. 1324 6.5 Hold Timer Expired error handling. 1326 If a system does not receive successive KEEPALIVE and/or UPDATE 1327 and/or NOTIFICATION messages within the period specified in the Hold 1328 Time field of the OPEN message, then the NOTIFICATION message with 1329 Hold Timer Expired Error Code must be sent and the BGP connection 1330 closed. 1332 6.6 Finite State Machine error handling. 1334 Any error detected by the BGP Finite State Machine (e.g., receipt of 1335 an unexpected event) is indicated by sending the NOTIFICATION message 1336 with Error Code Finite State Machine Error. 1338 6.7 Cease. 1340 In absence of any fatal errors (that are indicated in this section), 1341 a BGP peer may choose at any given time to close its BGP connection 1342 by sending the NOTIFICATION message with Error Code Cease. However, 1343 the Cease NOTIFICATION message must not be used when a fatal error 1344 indicated by this section does exist. 1346 RFC DRAFT August 1998 1348 6.8 Connection collision detection. 1350 If a pair of BGP speakers try simultaneously to establish a TCP 1351 connection to each other, then two parallel connections between this 1352 pair of speakers might well be formed. We refer to this situation as 1353 connection collision. Clearly, one of these connections must be 1354 closed. 1356 Based on the value of the BGP Identifier a convention is established 1357 for detecting which BGP connection is to be preserved when a 1358 collision does occur. The convention is to compare the BGP 1359 Identifiers of the peers involved in the collision and to retain only 1360 the connection initiated by the BGP speaker with the higher-valued 1361 BGP Identifier. 1363 Upon receipt of an OPEN message, the local system must examine all of 1364 its connections that are in the OpenConfirm state. A BGP speaker may 1365 also examine connections in an OpenSent state if it knows the BGP 1366 Identifier of the peer by means outside of the protocol. If among 1367 these connections there is a connection to a remote BGP speaker whose 1368 BGP Identifier equals the one in the OPEN message, then the local 1369 system performs the following collision resolution procedure: 1371 1. The BGP Identifier of the local system is compared to the BGP 1372 Identifier of the remote system (as specified in the OPEN 1373 message). 1375 2. If the value of the local BGP Identifier is less than the 1376 remote one, the local system closes BGP connection that already 1377 exists (the one that is already in the OpenConfirm state), and 1378 accepts BGP connection initiated by the remote system. 1380 3. Otherwise, the local system closes newly created BGP connection 1381 (the one associated with the newly received OPEN message), and 1382 continues to use the existing one (the one that is already in the 1383 OpenConfirm state). 1385 Comparing BGP Identifiers is done by treating them as (4-octet 1386 long) unsigned integers. 1388 A connection collision with an existing BGP connection that is in 1389 Established states causes unconditional closing of the newly 1390 created connection. Note that a connection collision cannot be 1391 detected with connections that are in Idle, or Connect, or Active 1392 RFC DRAFT August 1998 1394 states. 1396 Closing the BGP connection (that results from the collision 1397 resolution procedure) is accomplished by sending the NOTIFICATION 1398 message with the Error Code Cease. 1400 7. BGP Version Negotiation. 1402 BGP speakers may negotiate the version of the protocol by making 1403 multiple attempts to open a BGP connection, starting with the highest 1404 version number each supports. If an open attempt fails with an Error 1405 Code OPEN Message Error, and an Error Subcode Unsupported Version 1406 Number, then the BGP speaker has available the version number it 1407 tried, the version number its peer tried, the version number passed 1408 by its peer in the NOTIFICATION message, and the version numbers that 1409 it supports. If the two peers do support one or more common 1410 versions, then this will allow them to rapidly determine the highest 1411 common version. In order to support BGP version negotiation, future 1412 versions of BGP must retain the format of the OPEN and NOTIFICATION 1413 messages. 1415 8. BGP Finite State machine. 1417 This section specifies BGP operation in terms of a Finite State 1418 Machine (FSM). Following is a brief summary and overview of BGP 1419 operations by state as determined by this FSM. A condensed version 1420 of the BGP FSM is found in Appendix 1. 1422 Initially BGP is in the Idle state. 1424 Idle state: 1426 In this state BGP refuses all incoming BGP connections. No 1427 resources are allocated to the peer. In response to the Start 1428 event (initiated by either system or operator) the local system 1429 initializes all BGP resources, starts the ConnectRetry timer, 1430 initiates a transport connection to other BGP peer, while 1431 listening for connection that may be initiated by the remote 1432 BGP peer, and changes its state to Connect. The exact value of 1433 the ConnectRetry timer is a local matter, but should be 1434 sufficiently large to allow TCP initialization. 1436 RFC DRAFT August 1998 1438 If a BGP speaker detects an error, it shuts down the connection 1439 and changes its state to Idle. Getting out of the Idle state 1440 requires generation of the Start event. If such an event is 1441 generated automatically, then persistent BGP errors may result 1442 in persistent flapping of the speaker. To avoid such a 1443 condition it is recommended that Start events should not be 1444 generated immediately for a peer that was previously 1445 transitioned to Idle due to an error. For a peer that was 1446 previously transitioned to Idle due to an error, the time 1447 between consecutive generation of Start events, if such events 1448 are generated automatically, shall exponentially increase. The 1449 value of the initial timer shall be 60 seconds. The time shall 1450 be doubled for each consecutive retry. 1452 Any other event received in the Idle state is ignored. 1454 Connect state: 1456 In this state BGP is waiting for the transport protocol 1457 connection to be completed. 1459 If the transport protocol connection succeeds, the local system 1460 clears the ConnectRetry timer, completes initialization, sends 1461 an OPEN message to its peer, and changes its state to OpenSent. 1463 If the transport protocol connect fails (e.g., retransmission 1464 timeout), the local system restarts the ConnectRetry timer, 1465 continues to listen for a connection that may be initiated by 1466 the remote BGP peer, and changes its state to Active state. 1468 In response to the ConnectRetry timer expired event, the local 1469 system restarts the ConnectRetry timer, initiates a transport 1470 connection to other BGP peer, continues to listen for a 1471 connection that may be initiated by the remote BGP peer, and 1472 stays in the Connect state. 1474 Start event is ignored in the Connect state. 1476 In response to any other event (initiated by either system or 1477 operator), the local system releases all BGP resources 1478 associated with this connection and changes its state to Idle. 1480 Active state: 1482 In this state BGP is trying to acquire a peer by initiating a 1483 transport protocol connection. 1485 RFC DRAFT August 1998 1487 If the transport protocol connection succeeds, the local system 1488 clears the ConnectRetry timer, completes initialization, sends 1489 an OPEN message to its peer, sets its Hold Timer to a large 1490 value, and changes its state to OpenSent. A Hold Timer value 1491 of 4 minutes is suggested. 1493 In response to the ConnectRetry timer expired event, the local 1494 system restarts the ConnectRetry timer, initiates a transport 1495 connection to other BGP peer, continues to listen for a 1496 connection that may be initiated by the remote BGP peer, and 1497 changes its state to Connect. 1499 If the local system detects that a remote peer is trying to 1500 establish BGP connection to it, and the IP address of the 1501 remote peer is not an expected one, the local system restarts 1502 the ConnectRetry timer, rejects the attempted connection, 1503 continues to listen for a connection that may be initiated by 1504 the remote BGP peer, and stays in the Active state. 1506 Start event is ignored in the Active state. 1508 In response to any other event (initiated by either system or 1509 operator), the local system releases all BGP resources 1510 associated with this connection and changes its state to Idle. 1512 OpenSent state: 1514 In this state BGP waits for an OPEN message from its peer. 1515 When an OPEN message is received, all fields are checked for 1516 correctness. If the BGP message header checking or OPEN 1517 message checking detects an error (see Section 6.2), or a 1518 connection collision (see Section 6.8) the local system sends a 1519 NOTIFICATION message and changes its state to Idle. 1521 If there are no errors in the OPEN message, BGP sends a 1522 KEEPALIVE message and sets a KeepAlive timer. The Hold Timer, 1523 which was originally set to a large value (see above), is 1524 replaced with the negotiated Hold Time value (see section 4.2). 1525 If the negotiated Hold Time value is zero, then the Hold Time 1526 timer and KeepAlive timers are not started. If the value of 1527 the Autonomous System field is the same as the local Autonomous 1528 System number, then the connection is an "internal" connection; 1529 otherwise, it is "external". (This will effect UPDATE 1530 processing as described below.) Finally, the state is changed 1531 to OpenConfirm. 1533 RFC DRAFT August 1998 1535 If a disconnect notification is received from the underlying 1536 transport protocol, the local system closes the BGP connection, 1537 restarts the ConnectRetry timer, while continue listening for 1538 connection that may be initiated by the remote BGP peer, and 1539 goes into the Active state. 1541 If the Hold Timer expires, the local system sends NOTIFICATION 1542 message with error code Hold Timer Expired and changes its 1543 state to Idle. 1545 In response to the Stop event (initiated by either system or 1546 operator) the local system sends NOTIFICATION message with 1547 Error Code Cease and changes its state to Idle. 1549 Start event is ignored in the OpenSent state. 1551 In response to any other event the local system sends 1552 NOTIFICATION message with Error Code Finite State Machine Error 1553 and changes its state to Idle. 1555 Whenever BGP changes its state from OpenSent to Idle, it closes 1556 the BGP (and transport-level) connection and releases all 1557 resources associated with that connection. 1559 OpenConfirm state: 1561 In this state BGP waits for a KEEPALIVE or NOTIFICATION 1562 message. 1564 If the local system receives a KEEPALIVE message, it changes 1565 its state to Established. 1567 If the Hold Timer expires before a KEEPALIVE message is 1568 received, the local system sends NOTIFICATION message with 1569 error code Hold Timer Expired and changes its state to Idle. 1571 If the local system receives a NOTIFICATION message, it changes 1572 its state to Idle. 1574 If the KeepAlive timer expires, the local system sends a 1575 KEEPALIVE message and restarts its KeepAlive timer. 1577 If a disconnect notification is received from the underlying 1578 transport protocol, the local system changes its state to Idle. 1580 In response to the Stop event (initiated by either system or 1581 RFC DRAFT August 1998 1583 operator) the local system sends NOTIFICATION message with 1584 Error Code Cease and changes its state to Idle. 1586 Start event is ignored in the OpenConfirm state. 1588 In response to any other event the local system sends 1589 NOTIFICATION message with Error Code Finite State Machine Error 1590 and changes its state to Idle. 1592 Whenever BGP changes its state from OpenConfirm to Idle, it 1593 closes the BGP (and transport-level) connection and releases 1594 all resources associated with that connection. 1596 Established state: 1598 In the Established state BGP can exchange UPDATE, NOTIFICATION, 1599 and KEEPALIVE messages with its peer. 1601 If the local system receives an UPDATE or KEEPALIVE message, it 1602 restarts its Hold Timer, if the negotiated Hold Time value is 1603 non-zero. 1605 If the local system receives a NOTIFICATION message, it changes 1606 its state to Idle. 1608 If the local system receives an UPDATE message and the UPDATE 1609 message error handling procedure (see Section 6.3) detects an 1610 error, the local system sends a NOTIFICATION message and 1611 changes its state to Idle. 1613 If a disconnect notification is received from the underlying 1614 transport protocol, the local system changes its state to Idle. 1616 If the Hold Timer expires, the local system sends a 1617 NOTIFICATION message with Error Code Hold Timer Expired and 1618 changes its state to Idle. 1620 If the KeepAlive timer expires, the local system sends a 1621 KEEPALIVE message and restarts its KeepAlive timer. 1623 Each time the local system sends a KEEPALIVE or UPDATE message, 1624 it restarts its KeepAlive timer, unless the negotiated Hold 1625 Time value is zero. 1627 In response to the Stop event (initiated by either system or 1628 operator), the local system sends a NOTIFICATION message with 1629 RFC DRAFT August 1998 1631 Error Code Cease and changes its state to Idle. 1633 Start event is ignored in the Established state. 1635 In response to any other event, the local system sends 1636 NOTIFICATION message with Error Code Finite State Machine Error 1637 and changes its state to Idle. 1639 Whenever BGP changes its state from Established to Idle, it 1640 closes the BGP (and transport-level) connection, releases all 1641 resources associated with that connection, and deletes all 1642 routes derived from that connection. 1644 9. UPDATE Message Handling 1646 An UPDATE message may be received only in the Established state. 1647 When an UPDATE message is received, each field is checked for 1648 validity as specified in Section 6.3. 1650 If an optional non-transitive attribute is unrecognized, it is 1651 quietly ignored. If an optional transitive attribute is 1652 unrecognized, the Partial bit (the third high-order bit) in the 1653 attribute flags octet is set to 1, and the attribute is retained for 1654 propagation to other BGP speakers. 1656 If an optional attribute is recognized, and has a valid value, then, 1657 depending on the type of the optional attribute, it is processed 1658 locally, retained, and updated, if necessary, for possible 1659 propagation to other BGP speakers. 1661 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 1662 the previously advertised routes whose destinations (expressed as IP 1663 prefixes) contained in this field shall be removed from the Adj-RIB- 1664 In. This BGP speaker shall run its Decision Process since the 1665 previously advertised route is not longer available for use. 1667 If the UPDATE message contains a feasible route, it shall be placed 1668 in the appropriate Adj-RIB-In, and the following additional actions 1669 shall be taken: 1671 i) If its Network Layer Reachability Information (NLRI) is identical 1672 to the one of a route currently stored in the Adj-RIB-In, then the 1673 new route shall replace the older route in the Adj-RIB-In, thus 1674 RFC DRAFT August 1998 1676 implicitly withdrawing the older route from service. The BGP speaker 1677 shall run its Decision Process since the older route is no longer 1678 available for use. 1680 ii) If the new route is an overlapping route that is included (see 1681 9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP 1682 speaker shall run its Decision Process since the more specific route 1683 has implicitly made a portion of the less specific route unavailable 1684 for use. 1686 iii) If the new route has identical path attributes to an earlier 1687 route contained in the Adj-RIB-In, and is more specific (see 9.1.4) 1688 than the earlier route, no further actions are necessary. 1690 iv) If the new route has NLRI that is not present in any of the 1691 routes currently stored in the Adj-RIB-In, then the new route shall 1692 be placed in the Adj-RIB-In. The BGP speaker shall run its Decision 1693 Process. 1695 v) If the new route is an overlapping route that is less specific 1696 (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the 1697 BGP speaker shall run its Decision Process on the set of destinations 1698 described only by the less specific route. 1700 9.1 Decision Process 1702 The Decision Process selects routes for subsequent advertisement by 1703 applying the policies in the local Policy Information Base (PIB) to 1704 the routes stored in its Adj-RIB-In. The output of the Decision 1705 Process is the set of routes that will be advertised to all peers; 1706 the selected routes will be stored in the local speaker's Adj-RIB- 1707 Out. 1709 The selection process is formalized by defining a function that takes 1710 the attribute of a given route as an argument and returns a non- 1711 negative integer denoting the degree of preference for the route. 1712 The function that calculates the degree of preference for a given 1713 route shall not use as its inputs any of the following: the 1714 existence of other routes, the non-existence of other routes, or the 1715 path attributes of other routes. Route selection then consists of 1716 individual application of the degree of preference function to each 1717 feasible route, followed by the choice of the one with the highest 1718 degree of preference. 1720 RFC DRAFT August 1998 1722 The Decision Process operates on routes contained in each Adj-RIB-In, 1723 and is responsible for: 1725 - selection of routes to be advertised to internal peers 1727 - selection of routes to be advertised to external peers 1729 - route aggregation and route information reduction 1731 The Decision Process takes place in three distinct phases, each 1732 triggered by a different event: 1734 a) Phase 1 is responsible for calculating the degree of preference 1735 for each route received from an external peer, and MAY also 1736 advertise to all the internal peers the routes from external 1737 peers that have the highest degree of preference for each distinct 1738 destination. 1740 b) Phase 2 is invoked on completion of phase 1. It is responsible 1741 for choosing the best route out of all those available for each 1742 distinct destination, and for installing each chosen route into 1743 the appropriate Loc-RIB. 1745 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 1746 responsible for disseminating routes in the Loc-RIB to each 1747 external peer, according to the policies contained in the PIB. 1748 Route aggregation and information reduction can optionally be 1749 performed within this phase. 1751 9.1.1 Phase 1: Calculation of Degree of Preference 1753 The Phase 1 decision function shall be invoked whenever the local BGP 1754 speaker receives from a peer an UPDATE message that advertises a new 1755 route, a replacement route, or a withdrawn route. 1757 The Phase 1 decision function is a separate process which completes 1758 when it has no further work to do. 1760 The Phase 1 decision function shall lock an Adj-RIB-In prior to 1761 operating on any route contained within it, and shall unlock it after 1762 operating on all new or unfeasible routes contained within it. 1764 For each newly received or replacement feasible route, the local BGP 1765 speaker shall determine a degree of preference. If the route is 1766 RFC DRAFT August 1998 1768 learned from an internal peer, the value of the LOCAL_PREF attribute 1769 shall be taken as the degree of preference. If the route is learned 1770 from an external peer, then the degree of preference shall be 1771 computed based on preconfigured policy information and used as the 1772 LOCAL_PREF value in any IBGP readvertisement. The exact nature of 1773 this policy information and the computation involved is a local 1774 matter. The local speaker shall then run the internal update process 1775 of 9.2.1 to select and advertise the most preferable route. 1777 9.1.2 Phase 2: Route Selection 1779 The Phase 2 decision function shall be invoked on completion of Phase 1780 1. The Phase 2 function is a separate process which completes when 1781 it has no further work to do. The Phase 2 process shall consider all 1782 routes that are present in the Adj-RIBs-In, including those received 1783 from both internal and external peers. 1785 The Phase 2 decision function shall be blocked from running while the 1786 Phase 3 decision function is in process. The Phase 2 function shall 1787 lock all Adj-RIBs-In prior to commencing its function, and shall 1788 unlock them on completion. 1790 If the NEXT_HOP attribute of a BGP route depicts an address to which 1791 the local BGP speaker doesn't have a route in its Loc-RIB, the BGP 1792 route should be excluded from the Phase 2 decision function. 1794 It is critical that routers within an AS do not make conflicting 1795 decisions regarding route selection that would cause forwarding loops 1796 to occur. 1798 For each set of destinations for which a feasible route exists in the 1799 Adj-RIBs-In, the local BGP speaker shall identify the route that has: 1801 a) the highest degree of preference of any route to the same set 1802 of destinations, or 1804 b) is the only route to that destination, or 1806 c) is selected as a result of the Phase 2 tie breaking rules 1807 specified in 9.1.2.1. 1809 The local speaker SHALL then install that route in the Loc-RIB, 1810 replacing any route to the same destination that is currently being 1811 RFC DRAFT August 1998 1813 held in the Loc-RIB. The local speaker MUST determine the immediate 1814 next hop to the address depicted by the NEXT_HOP attribute of the 1815 selected route by performing a lookup in the IGP and selecting one of 1816 the possible paths in the IGP. This immediate next hop MUST be used 1817 when installing the selected route in the Loc-RIB. If the route to 1818 the address depicted by the NEXT_HOP attribute changes such that the 1819 immediate next hop changes, route selection should be recalculated as 1820 specified above. 1822 Unfeasible routes shall be removed from the Loc-RIB, and 1823 corresponding unfeasible routes shall then be removed from the Adj- 1824 RIBs-In. 1826 9.1.2.1 Breaking Ties (Phase 2) 1828 In its Adj-RIBs-In a BGP speaker may have several routes to the same 1829 destination that have the same degree of preference. The local 1830 speaker can select only one of these routes for inclusion in the 1831 associated Loc-RIB. The local speaker considers all routes with the 1832 same degrees of preference, both those received from internal peers, 1833 and those received from external peers. 1835 The following tie-breaking procedure assumes that for each candidate 1836 route all the BGP speakers within an autonomous system can ascertain 1837 the cost of a path (interior distance) to the address depicted by the 1838 NEXT_HOP attribute of the route. 1840 The tie-breaking algorithm begins by considering all equally 1841 preferable routes and then selects routes to be removed from 1842 consideration. The algorithm terminates as soon as only one route 1843 remains in consideration. The criteria must be applied in the order 1844 specified. 1846 Several of the criteria are described using pseudo-code. Note that 1847 the pseudo-code shown was chosen for clarity, not efficiency. It is 1848 not intended to specify any particular implementation. BGP 1849 implementations MAY use any algorithm which produces the same results 1850 as those described here. 1852 a) Remove from consideration routes with less-preferred 1853 MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable 1854 between routes learned from the same neighboring AS. Routes which 1855 do not have the MULTI_EXIT_DISC attribute are considered to have 1856 the highest possible MULTI_EXIT_DISC value. 1858 RFC DRAFT August 1998 1860 This is also described in the following procedure: 1862 for m = all routes still under consideration 1863 for n = all routes still under consideration 1864 if (neighborAS(m) == neighborAS(n)) and (MED(n) < MED(m)) 1865 remove route m from consideration 1867 In the pseudo-code above, MED(n) is a function which returns the 1868 value of route n's MULTI_EXIT_DISC attribute. If route n has no 1869 MULTI_EXIT_DISC attribute, the function returns the highest 1870 possible MULTI_EXIT_DISC value, i.e. 2^32-1. 1872 Similarly, neighborAS(n) is a function which returns the neighbor 1873 AS from which the route was received. 1875 b) Remove from consideration any routes with less-preferred 1876 interior cost. The interior cost of a route is determined by 1877 calculating the metric to the next hop for the route using the 1878 interior routing protocol(s). If the next hop for a route is 1879 reachable, but no cost can be determined, then this step should be 1880 should be skipped (equivalently, consider all routes to have equal 1881 costs). 1883 This is also described in the following procedure. 1885 for m = all routes still under consideration 1886 for n = all routes in still under consideration 1887 if (cost(n) is better than cost(m)) 1888 remove m from consideration 1890 In the pseudo-code above, cost(n) is a function which returns the 1891 cost of the path (interior distance) to the address given in the 1892 NEXT_HOP attribute of the route. 1894 c) If at least one of the candidate routes was received from an 1895 external peer in a neighboring autonomous system, remove from 1896 consideration all routes which were received from internal peers. 1898 d) Remove from consideration all routes other than the route that 1899 was advertised by the BGP speaker whose BGP Identifier has the 1900 lowest value. 1902 RFC DRAFT August 1998 1904 9.1.3 Phase 3: Route Dissemination 1906 The Phase 3 decision function shall be invoked on completion of Phase 1907 2, or when any of the following events occur: 1909 a) when routes in a Loc-RIB to local destinations have changed 1911 b) when locally generated routes learned by means outside of BGP 1912 have changed 1914 c) when a new BGP speaker - BGP speaker connection has been 1915 established 1917 The Phase 3 function is a separate process which completes when it 1918 has no further work to do. The Phase 3 Routing Decision function 1919 shall be blocked from running while the Phase 2 decision function is 1920 in process. 1922 All routes in the Loc-RIB shall be processed into a corresponding 1923 entry in the associated Adj-RIBs-Out. Route aggregation and 1924 information reduction techniques (see 9.2.4.1) may optionally be 1925 applied. 1927 For the benefit of future support of inter-AS multicast capabilities, 1928 a BGP speaker that participates in inter-AS multicast routing shall 1929 advertise a route it receives from one of its external peers and if 1930 it installs it in its Loc-RIB, it shall advertise it back to the peer 1931 from which the route was received. For a BGP speaker that does not 1932 participate in inter-AS multicast routing such an advertisement is 1933 optional. When doing such an advertisement, the NEXT_HOP attribute 1934 should be set to the address of the peer. An implementation may also 1935 optimize such an advertisement by truncating information in the 1936 AS_PATH attribute to include only its own AS number and that of the 1937 peer that advertised the route (such truncation requires the ORIGIN 1938 attribute to be set to INCOMPLETE). In addition an implementation is 1939 not required to pass optional or discretionary path attributes with 1940 such an advertisement. 1942 When the updating of the Adj-RIBs-Out and the Forwarding Information 1943 Base (FIB) is complete, the local BGP speaker shall run the external 1944 update process of 9.2.2. 1946 RFC DRAFT August 1998 1948 9.1.4 Overlapping Routes 1950 A BGP speaker may transmit routes with overlapping Network Layer 1951 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 1952 occurs when a set of destinations are identified in non-matching 1953 multiple routes. Since BGP encodes NLRI using IP prefixes, overlap 1954 will always exhibit subset relationships. A route describing a 1955 smaller set of destinations (a longer prefix) is said to be more 1956 specific than a route describing a larger set of destinations (a 1957 shorted prefix); similarly, a route describing a larger set of 1958 destinations (a shorter prefix) is said to be less specific than a 1959 route describing a smaller set of destinations (a longer prefix). 1961 The precedence relationship effectively decomposes less specific 1962 routes into two parts: 1964 - a set of destinations described only by the less specific 1965 route, and 1967 - a set of destinations described by the overlap of the less 1968 specific and the more specific routes 1970 When overlapping routes are present in the same Adj-RIB-In, the more 1971 specific route shall take precedence, in order from more specific to 1972 least specific. 1974 The set of destinations described by the overlap represents a portion 1975 of the less specific route that is feasible, but is not currently in 1976 use. If a more specific route is later withdrawn, the set of 1977 destinations described by the overlap will still be reachable using 1978 the less specific route. 1980 If a BGP speaker receives overlapping routes, the Decision Process 1981 MUST consider both routes based on the configured acceptance policy. 1982 If both a less and a more specific route are accepted, then the 1983 Decision Process MUST either install both the less and the more 1984 specific routes or it MUST aggregate the two routes and install the 1985 aggregated route. 1987 If a BGP speaker chooses to aggregate, then it MUST add 1988 ATOMIC_AGGREGATE attribute to the route. A route that carries 1989 ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the 1990 NLRI of this route can not be made more specific. Forwarding along 1991 such a route does not guarantee that IP packets will actually 1992 RFC DRAFT August 1998 1994 traverse only ASs listed in the AS_PATH attribute of the route. 1996 9.2 Update-Send Process 1998 The Update-Send process is responsible for advertising UPDATE 1999 messages to all peers. For example, it distributes the routes chosen 2000 by the Decision Process to other BGP speakers which may be located in 2001 either the same autonomous system or a neighboring autonomous system. 2002 Rules for information exchange between BGP speakers located in 2003 different autonomous systems are given in 9.2.2; rules for 2004 information exchange between BGP speakers located in the same 2005 autonomous system are given in 9.2.1. 2007 Distribution of routing information between a set of BGP speakers, 2008 all of which are located in the same autonomous system, is referred 2009 to as internal distribution. 2011 9.2.1 Internal Updates 2013 The Internal update process is concerned with the distribution of 2014 routing information to internal peers. 2016 When a BGP speaker receives an UPDATE message from an internal peer, 2017 the receiving BGP speaker shall not re-distribute the routing 2018 information contained in that UPDATE message to other internal peers. 2020 When a BGP speaker receives a new route from an external peer, it 2021 MUST advertise that route to all other internal peers by means of an 2022 UPDATE message if this routes has been installed in its Loc-RIB 2023 according to the route selection rules in 9.1.2. 2025 When a BGP speaker receives an UPDATE message with a non-empty 2026 WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all 2027 routes whose destinations was carried in this field (as IP prefixes). 2028 The speaker shall take the following additional steps: 2030 1) if the corresponding feasible route had not been previously 2031 advertised, then no further action is necessary 2033 2) if the corresponding feasible route had been previously 2034 advertised, then: 2036 RFC DRAFT August 1998 2038 i) if a new route is selected for advertisement that has the 2039 same Network Layer Reachability Information as the unfeasible 2040 routes, then the local BGP speaker shall advertise the 2041 replacement route 2043 ii) if a replacement route is not available for advertisement, 2044 then the BGP speaker shall include the destinations of the 2045 unfeasible route (in form of IP prefixes) in the WITHDRAWN 2046 ROUTES field of an UPDATE message, and shall send this message 2047 to each peer to whom it had previously advertised the 2048 corresponding feasible route. 2050 All feasible routes which are advertised shall be placed in the 2051 appropriate Adj-RIBs-Out, and all unfeasible routes which are 2052 advertised shall be removed from the Adj-RIBs-Out. 2054 9.2.1.1 Breaking Ties (Internal Updates) 2056 If a local BGP speaker has connections to several external peers, 2057 there will be multiple Adj-RIBs-In associated with these peers. These 2058 Adj-RIBs-In might contain several equally preferable routes to the 2059 same destination, all of which were advertised by external peers. 2060 The local BGP speaker shall select one of these routes according to 2061 the following rules: 2063 a) If the candidate routes differ only in their NEXT_HOP and 2064 MULTI_EXIT_DISC attributes, and the local system is configured to 2065 take into account the MULTI_EXIT_DISC attribute, select the route 2066 that has the lowest value of the MULTI_EXIT_DISC attribute. A 2067 route with the MULTI_EXIT_DISC attribute shall be preferred to a 2068 route without the MULTI_EXIT_DISC attribute. 2070 b) If the local system can ascertain the cost of a path to the 2071 entity depicted by the NEXT_HOP attribute of the candidate route, 2072 select the route with the lowest cost. 2074 c) In all other cases, select the route that was advertised by the 2075 BGP speaker whose BGP Identifier has the lowest value. 2077 RFC DRAFT August 1998 2079 9.2.2 External Updates 2081 The external update process is concerned with the distribution of 2082 routing information to external peers. As part of Phase 3 route 2083 selection process, the BGP speaker has updated its Adj-RIBs-Out and 2084 its Forwarding Table. All newly installed routes and all newly 2085 unfeasible routes for which there is no replacement route shall be 2086 advertised to external peers by means of UPDATE message. 2088 Any routes in the Loc-RIB marked as unfeasible shall be removed. 2089 Changes to the reachable destinations within its own autonomous 2090 system shall also be advertised in an UPDATE message. 2092 9.2.3 Controlling Routing Traffic Overhead 2094 The BGP protocol constrains the amount of routing traffic (that is, 2095 UPDATE messages) in order to limit both the link bandwidth needed to 2096 advertise UPDATE messages and the processing power needed by the 2097 Decision Process to digest the information contained in the UPDATE 2098 messages. 2100 9.2.3.1 Frequency of Route Advertisement 2102 The parameter MinRouteAdvertisementInterval determines the minimum 2103 amount of time that must elapse between advertisement of routes to a 2104 particular destination from a single BGP speaker. This rate limiting 2105 procedure applies on a per-destination basis, although the value of 2106 MinRouteAdvertisementInterval is set on a per BGP peer basis. 2108 Two UPDATE messages sent from a single BGP speaker that advertise 2109 feasible routes to some common set of destinations received from 2110 external peers must be separated by at least 2111 MinRouteAdvertisementInterval. Clearly, this can only be achieved 2112 precisely by keeping a separate timer for each common set of 2113 destinations. This would be unwarranted overhead. Any technique which 2114 ensures that the interval between two UPDATE messages sent from a 2115 single BGP speaker that advertise feasible routes to some common set 2116 of destinations received from external peers will be at least 2117 MinRouteAdvertisementInterval, and will also ensure a constant upper 2118 bound on the interval is acceptable. 2120 RFC DRAFT August 1998 2122 Since fast convergence is needed within an autonomous system, this 2123 procedure does not apply for routes received from other internal 2124 peers. To avoid long-lived black holes, the procedure does not apply 2125 to the explicit withdrawal of unfeasible routes (that is, routes 2126 whose destinations (expressed as IP prefixes) are listed in the 2127 WITHDRAWN ROUTES field of an UPDATE message). 2129 This procedure does not limit the rate of route selection, but only 2130 the rate of route advertisement. If new routes are selected multiple 2131 times while awaiting the expiration of MinRouteAdvertisementInterval, 2132 the last route selected shall be advertised at the end of 2133 MinRouteAdvertisementInterval. 2135 9.2.3.2 Frequency of Route Origination 2137 The parameter MinASOriginationInterval determines the minimum amount 2138 of time that must elapse between successive advertisements of UPDATE 2139 messages that report changes within the advertising BGP speaker's own 2140 autonomous systems. 2142 9.2.3.3 Jitter 2144 To minimize the likelihood that the distribution of BGP messages by a 2145 given BGP speaker will contain peaks, jitter should be applied to the 2146 timers associated with MinASOriginationInterval, Keepalive, and 2147 MinRouteAdvertisementInterval. A given BGP speaker shall apply the 2148 same jitter to each of these quantities regardless of the 2149 destinations to which the updates are being sent; that is, jitter 2150 will not be applied on a "per peer" basis. 2152 The amount of jitter to be introduced shall be determined by 2153 multiplying the base value of the appropriate timer by a random 2154 factor which is uniformly distributed in the range from 0.75 to 1.0. 2156 9.2.4 Efficient Organization of Routing Information 2158 Having selected the routing information which it will advertise, a 2159 BGP speaker may avail itself of several methods to organize this 2160 information in an efficient manner. 2162 RFC DRAFT August 1998 2164 9.2.4.1 Information Reduction 2166 Information reduction may imply a reduction in granularity of policy 2167 control - after information is collapsed, the same policies will 2168 apply to all destinations and paths in the equivalence class. 2170 The Decision Process may optionally reduce the amount of information 2171 that it will place in the Adj-RIBs-Out by any of the following 2172 methods: 2174 a) Network Layer Reachability Information (NLRI): 2176 Destination IP addresses can be represented as IP address 2177 prefixes. In cases where there is a correspondence between the 2178 address structure and the systems under control of an autonomous 2179 system administrator, it will be possible to reduce the size of 2180 the NLRI carried in the UPDATE messages. 2182 b) AS_PATHs: 2184 AS path information can be represented as ordered AS_SEQUENCEs or 2185 unordered AS_SETs. AS_SETs are used in the route aggregation 2186 algorithm described in 9.2.4.2. They reduce the size of the 2187 AS_PATH information by listing each AS number only once, 2188 regardless of how many times it may have appeared in multiple 2189 AS_PATHs that were aggregated. 2191 An AS_SET implies that the destinations listed in the NLRI can be 2192 reached through paths that traverse at least some of the 2193 constituent autonomous systems. AS_SETs provide sufficient 2194 information to avoid routing information looping; however their 2195 use may prune potentially feasible paths, since such paths are no 2196 longer listed individually as in the form of AS_SEQUENCEs. In 2197 practice this is not likely to be a problem, since once an IP 2198 packet arrives at the edge of a group of autonomous systems, the 2199 BGP speaker at that point is likely to have more detailed path 2200 information and can distinguish individual paths to destinations. 2202 9.2.4.2 Aggregating Routing Information 2204 Aggregation is the process of combining the characteristics of 2205 several different routes in such a way that a single route can be 2206 advertised. Aggregation can occur as part of the decision process 2207 RFC DRAFT August 1998 2209 to reduce the amount of routing information that will be placed in 2210 the Adj-RIBs-Out. 2212 Aggregation reduces the amount of information that a BGP speaker must 2213 store and exchange with other BGP speakers. Routes can be aggregated 2214 by applying the following procedure separately to path attributes of 2215 like type and to the Network Layer Reachability Information. 2217 Routes that have the following attributes shall not be aggregated 2218 unless the corresponding attributes of each route are identical: 2219 MULTI_EXIT_DISC, NEXT_HOP. 2221 Path attributes that have different type codes can not be aggregated 2222 together. Path of the same type code may be aggregated, according to 2223 the following rules: 2225 ORIGIN attribute: If at least one route among routes that are 2226 aggregated has ORIGIN with the value INCOMPLETE, then the 2227 aggregated route must have the ORIGIN attribute with the value 2228 INCOMPLETE. Otherwise, if at least one route among routes that are 2229 aggregated has ORIGIN with the value EGP, then the aggregated 2230 route must have the origin attribute with the value EGP. In all 2231 other case the value of the ORIGIN attribute of the aggregated 2232 route is INTERNAL. 2234 AS_PATH attribute: If routes to be aggregated have identical 2235 AS_PATH attributes, then the aggregated route has the same AS_PATH 2236 attribute as each individual route. 2238 For the purpose of aggregating AS_PATH attributes we model each AS 2239 within the AS_PATH attribute as a tuple , where 2240 "type" identifies a type of the path segment the AS belongs to 2241 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If the 2242 routes to be aggregated have different AS_PATH attributes, then 2243 the aggregated AS_PATH attribute shall satisfy all of the 2244 following conditions: 2246 - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH 2247 shall appear in all of the AS_PATH in the initial set of routes 2248 to be aggregated. 2250 - all tuples of the type AS_SET in the aggregated AS_PATH shall 2251 appear in at least one of the AS_PATH in the initial set (they 2252 may appear as either AS_SET or AS_SEQUENCE types). 2254 - for any tuple X of the type AS_SEQUENCE in the aggregated 2255 RFC DRAFT August 1998 2257 AS_PATH which precedes tuple Y in the aggregated AS_PATH, X 2258 precedes Y in each AS_PATH in the initial set which contains Y, 2259 regardless of the type of Y. 2261 - No tuple with the same value shall appear more than once in 2262 the aggregated AS_PATH, regardless of the tuple's type. 2264 An implementation may choose any algorithm which conforms to these 2265 rules. At a minimum a conformant implementation shall be able to 2266 perform the following algorithm that meets all of the above 2267 conditions: 2269 - determine the longest leading sequence of tuples (as defined 2270 above) common to all the AS_PATH attributes of the routes to be 2271 aggregated. Make this sequence the leading sequence of the 2272 aggregated AS_PATH attribute. 2274 - set the type of the rest of the tuples from the AS_PATH 2275 attributes of the routes to be aggregated to AS_SET, and append 2276 them to the aggregated AS_PATH attribute. 2278 - if the aggregated AS_PATH has more than one tuple with the 2279 same value (regardless of tuple's type), eliminate all, but one 2280 such tuple by deleting tuples of the type AS_SET from the 2281 aggregated AS_PATH attribute. 2283 Appendix 6, section 6.8 presents another algorithm that satisfies 2284 the conditions and allows for more complex policy configurations. 2286 ATOMIC_AGGREGATE: If at least one of the routes to be aggregated 2287 has ATOMIC_AGGREGATE path attribute, then the aggregated route 2288 shall have this attribute as well. 2290 AGGREGATOR: All AGGREGATOR attributes of all routes to be 2291 aggregated should be ignored. 2293 9.3 Route Selection Criteria 2295 Generally speaking, additional rules for comparing routes among 2296 several alternatives are outside the scope of this document. There 2297 are two exceptions: 2299 - If the local AS appears in the AS path of the new route being 2300 considered, then that new route cannot be viewed as better than 2301 RFC DRAFT August 1998 2303 any other route. If such a route were ever used, a routing loop 2304 could result (see Section 6.3). 2306 - In order to achieve successful distributed operation, only 2307 routes with a likelihood of stability can be chosen. Thus, an AS 2308 must avoid using unstable routes, and it must not make rapid 2309 spontaneous changes to its choice of route. Quantifying the terms 2310 "unstable" and "rapid" in the previous sentence will require 2311 experience, but the principle is clear. 2313 9.4 Originating BGP routes 2315 A BGP speaker may originate BGP routes by injecting routing 2316 information acquired by some other means (e.g. via an IGP) into BGP. 2317 A BGP speaker that originates BGP routes shall assign the degree of 2318 preference to these routes by passing them through the Decision 2319 Process (see Section 9.1). These routes may also be distributed to 2320 other BGP speakers within the local AS as part of the Internal update 2321 process (see Section 9.2.1). The decision whether to distribute non- 2322 BGP acquired routes within an AS via BGP or not depends on the 2323 environment within the AS (e.g. type of IGP) and should be controlled 2324 via configuration. 2326 Appendix 1. BGP FSM State Transitions and Actions. 2328 This Appendix discusses the transitions between states in the BGP FSM 2329 in response to BGP events. The following is the list of these states 2330 and events when the negotiated Hold Time value is non-zero. 2332 BGP States: 2334 1 - Idle 2335 2 - Connect 2336 3 - Active 2337 4 - OpenSent 2338 5 - OpenConfirm 2339 6 - Established 2341 BGP Events: 2343 RFC DRAFT August 1998 2345 1 - BGP Start 2346 2 - BGP Stop 2347 3 - BGP Transport connection open 2348 4 - BGP Transport connection closed 2349 5 - BGP Transport connection open failed 2350 6 - BGP Transport fatal error 2351 7 - ConnectRetry timer expired 2352 8 - Hold Timer expired 2353 9 - KeepAlive timer expired 2354 10 - Receive OPEN message 2355 11 - Receive KEEPALIVE message 2356 12 - Receive UPDATE messages 2357 13 - Receive NOTIFICATION message 2359 The following table describes the state transitions of the BGP FSM 2360 and the actions triggered by these transitions. 2362 Event Actions Message Sent Next State 2363 -------------------------------------------------------------------- 2364 Idle (1) 2365 1 Initialize resources none 2 2366 Start ConnectRetry timer 2367 Initiate a transport connection 2368 others none none 1 2370 Connect(2) 2371 1 none none 2 2372 3 Complete initialization OPEN 4 2373 Clear ConnectRetry timer 2374 5 Restart ConnectRetry timer none 3 2375 7 Restart ConnectRetry timer none 2 2376 Initiate a transport connection 2377 others Release resources none 1 2379 Active (3) 2380 1 none none 3 2381 3 Complete initialization OPEN 4 2382 Clear ConnectRetry timer 2383 5 Close connection 3 2384 Restart ConnectRetry timer 2385 7 Restart ConnectRetry timer none 2 2386 Initiate a transport connection 2387 RFC DRAFT August 1998 2389 others Release resources none 1 2391 OpenSent(4) 2392 1 none none 4 2393 4 Close transport connection none 3 2394 Restart ConnectRetry timer 2395 6 Release resources none 1 2396 10 Process OPEN is OK KEEPALIVE 5 2397 Process OPEN failed NOTIFICATION 1 2398 others Close transport connection NOTIFICATION 1 2399 Release resources 2401 OpenConfirm (5) 2402 1 none none 5 2403 4 Release resources none 1 2404 6 Release resources none 1 2405 9 Restart KeepAlive timer KEEPALIVE 5 2406 11 Complete initialization none 6 2407 Restart Hold Timer 2408 13 Close transport connection 1 2409 Release resources 2410 others Close transport connection NOTIFICATION 1 2411 Release resources 2413 Established (6) 2414 1 none none 6 2415 4 Release resources none 1 2416 6 Release resources none 1 2417 9 Restart KeepAlive timer KEEPALIVE 6 2418 11 Restart Hold Timer KEEPALIVE 6 2419 12 Process UPDATE is OK UPDATE 6 2420 Process UPDATE failed NOTIFICATION 1 2421 13 Close transport connection 1 2422 Release resources 2423 others Close transport connection NOTIFICATION 1 2424 Release resources 2425 --------------------------------------------------------------------- 2427 The following is a condensed version of the above state transition 2428 table. 2430 RFC DRAFT August 1998 2432 Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab 2433 | (1) | (2) | (3) | (4) | (5) | (6) 2434 |--------------------------------------------------------------- 2435 1 | 2 | 2 | 3 | 4 | 5 | 6 2436 | | | | | | 2437 2 | 1 | 1 | 1 | 1 | 1 | 1 2438 | | | | | | 2439 3 | 1 | 4 | 4 | 1 | 1 | 1 2440 | | | | | | 2441 4 | 1 | 1 | 1 | 3 | 1 | 1 2442 | | | | | | 2443 5 | 1 | 3 | 3 | 1 | 1 | 1 2444 | | | | | | 2445 6 | 1 | 1 | 1 | 1 | 1 | 1 2446 | | | | | | 2447 7 | 1 | 2 | 2 | 1 | 1 | 1 2448 | | | | | | 2449 8 | 1 | 1 | 1 | 1 | 1 | 1 2450 | | | | | | 2451 9 | 1 | 1 | 1 | 1 | 5 | 6 2452 | | | | | | 2453 10 | 1 | 1 | 1 | 1 or 5 | 1 | 1 2454 | | | | | | 2455 11 | 1 | 1 | 1 | 1 | 6 | 6 2456 | | | | | | 2457 12 | 1 | 1 | 1 | 1 | 1 | 1 or 6 2458 | | | | | | 2459 13 | 1 | 1 | 1 | 1 | 1 | 1 2460 | | | | | | 2461 --------------------------------------------------------------- 2463 Appendix 2. Comparison with RFC1267 2465 BGP-4 is capable of operating in an environment where a set of 2466 reachable destinations may be expressed via a single IP prefix. The 2467 concept of network classes, or subnetting is foreign to BGP-4. To 2468 accommodate these capabilities BGP-4 changes semantics and encoding 2469 associated with the AS_PATH attribute. New text has been added to 2470 define semantics associated with IP prefixes. These abilities allow 2471 BGP-4 to support the proposed supernetting scheme [9]. 2473 RFC DRAFT August 1998 2475 To simplify configuration this version introduces a new attribute, 2476 LOCAL_PREF, that facilitates route selection procedures. 2478 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 2479 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 2480 certain aggregates are not de-aggregated. Another new attribute, 2481 AGGREGATOR, can be added to aggregate routes in order to advertise 2482 which AS and which BGP speaker within that AS caused the aggregation. 2484 To insure that Hold Timers are symmetric, the Hold Time is now 2485 negotiated on a per-connection basis. Hold Times of zero are now 2486 supported. 2488 Appendix 3. Comparison with RFC 1163 2490 All of the changes listed in Appendix 2, plus the following. 2492 To detect and recover from BGP connection collision, a new field (BGP 2493 Identifier) has been added to the OPEN message. New text (Section 2494 6.8) has been added to specify the procedure for detecting and 2495 recovering from collision. 2497 The new document no longer restricts the border router that is passed 2498 in the NEXT_HOP path attribute to be part of the same Autonomous 2499 System as the BGP Speaker. 2501 New document optimizes and simplifies the exchange of the information 2502 about previously reachable routes. 2504 Appendix 4. Comparison with RFC 1105 2506 All of the changes listed in Appendices 2 and 3, plus the following. 2508 Minor changes to the RFC1105 Finite State Machine were necessary to 2509 accommodate the TCP user interface provided by 4.3 BSD. 2511 The notion of Up/Down/Horizontal relations present in RFC1105 has 2512 been removed from the protocol. 2514 The changes in the message format from RFC1105 are as follows: 2516 1. The Hold Time field has been removed from the BGP header and 2517 added to the OPEN message. 2519 RFC DRAFT August 1998 2521 2. The version field has been removed from the BGP header and 2522 added to the OPEN message. 2524 3. The Link Type field has been removed from the OPEN message. 2526 4. The OPEN CONFIRM message has been eliminated and replaced with 2527 implicit confirmation provided by the KEEPALIVE message. 2529 5. The format of the UPDATE message has been changed 2530 significantly. New fields were added to the UPDATE message to 2531 support multiple path attributes. 2533 6. The Marker field has been expanded and its role broadened to 2534 support authentication. 2536 Note that quite often BGP, as specified in RFC 1105, is referred 2537 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 2538 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 2539 BGP, as specified in this document is referred to as BGP-4. 2541 Appendix 5. TCP options that may be used with BGP 2543 If a local system TCP user interface supports TCP PUSH function, then 2544 each BGP message should be transmitted with PUSH flag set. Setting 2545 PUSH flag forces BGP messages to be transmitted promptly to the 2546 receiver. 2548 If a local system TCP user interface supports setting precedence for 2549 TCP connection, then the BGP transport connection should be opened 2550 with precedence set to Internetwork Control (110) value (see also 2551 [6]). 2553 Appendix 6. Implementation Recommendations 2555 This section presents some implementation recommendations. 2557 6.1 Multiple Networks Per Message 2559 The BGP protocol allows for multiple address prefixes with the same 2560 RFC DRAFT August 1998 2562 AS path and next-hop gateway to be specified in one message. Making 2563 use of this capability is highly recommended. With one address prefix 2564 per message there is a substantial increase in overhead in the 2565 receiver. Not only does the system overhead increase due to the 2566 reception of multiple messages, but the overhead of scanning the 2567 routing table for updates to BGP peers and other routing protocols 2568 (and sending the associated messages) is incurred multiple times as 2569 well. One method of building messages containing many address 2570 prefixes per AS path and gateway from a routing table that is not 2571 organized per AS path is to build many messages as the routing table 2572 is scanned. As each address prefix is processed, a message for the 2573 associated AS path and gateway is allocated, if it does not exist, 2574 and the new address prefix is added to it. If such a message exists, 2575 the new address prefix is just appended to it. If the message lacks 2576 the space to hold the new address prefix, it is transmitted, a new 2577 message is allocated, and the new address prefix is inserted into the 2578 new message. When the entire routing table has been scanned, all 2579 allocated messages are sent and their resources released. Maximum 2580 compression is achieved when all the destinations covered by the 2581 address prefixes share a gateway and common path attributes, making 2582 it possible to send many address prefixes in one 4096-byte message. 2584 When peering with a BGP implementation that does not compress 2585 multiple address prefixes into one message, it may be necessary to 2586 take steps to reduce the overhead from the flood of data received 2587 when a peer is acquired or a significant network topology change 2588 occurs. One method of doing this is to limit the rate of updates. 2589 This will eliminate the redundant scanning of the routing table to 2590 provide flash updates for BGP peers and other routing protocols. A 2591 disadvantage of this approach is that it increases the propagation 2592 latency of routing information. By choosing a minimum flash update 2593 interval that is not much greater than the time it takes to process 2594 the multiple messages this latency should be minimized. A better 2595 method would be to read all received messages before sending updates. 2597 6.2 Processing Messages on a Stream Protocol 2599 BGP uses TCP as a transport mechanism. Due to the stream nature of 2600 TCP, all the data for received messages does not necessarily arrive 2601 at the same time. This can make it difficult to process the data as 2602 messages, especially on systems such as BSD Unix where it is not 2603 possible to determine how much data has been received but not yet 2604 processed. 2606 RFC DRAFT August 1998 2608 One method that can be used in this situation is to first try to read 2609 just the message header. For the KEEPALIVE message type, this is a 2610 complete message; for other message types, the header should first be 2611 verified, in particular the total length. If all checks are 2612 successful, the specified length, minus the size of the message 2613 header is the amount of data left to read. An implementation that 2614 would "hang" the routing information process while trying to read 2615 from a peer could set up a message buffer (4096 bytes) per peer and 2616 fill it with data as available until a complete message has been 2617 received. 2619 6.3 Reducing route flapping 2621 To avoid excessive route flapping a BGP speaker which needs to 2622 withdraw a destination and send an update about a more specific or 2623 less specific route SHOULD combine them into the same UPDATE message. 2625 6.4 BGP Timers 2627 BGP employs five timers: ConnectRetry, Hold Time, KeepAlive, 2628 MinASOriginationInterval, and MinRouteAdvertisementInterval The 2629 suggested value for the ConnectRetry timer is 120 seconds. The 2630 suggested value for the Hold Time is 90 seconds. The suggested value 2631 for the KeepAlive timer is 30 seconds. The suggested value for the 2632 MinASOriginationInterval is 15 seconds. The suggested value for the 2633 MinRouteAdvertisementInterval is 30 seconds. 2635 An implementation of BGP MUST allow these timers to be configurable. 2637 6.5 Path attribute ordering 2639 Implementations which combine update messages as described above in 2640 6.1 may prefer to see all path attributes presented in a known order. 2641 This permits them to quickly identify sets of attributes from 2642 different update messages which are semantically identical. To 2643 facilitate this, it is a useful optimization to order the path 2644 attributes according to type code. This optimization is entirely 2645 optional. 2647 RFC DRAFT August 1998 2649 6.6 AS_SET sorting 2651 Another useful optimization that can be done to simplify this 2652 situation is to sort the AS numbers found in an AS_SET. This 2653 optimization is entirely optional. 2655 6.7 Control over version negotiation 2657 Since BGP-4 is capable of carrying aggregated routes which cannot be 2658 properly represented in BGP-3, an implementation which supports BGP-4 2659 and another BGP version should provide the capability to only speak 2660 BGP-4 on a per-peer basis. 2662 6.8 Complex AS_PATH aggregation 2664 An implementation which chooses to provide a path aggregation 2665 algorithm which retains significant amounts of path information may 2666 wish to use the following procedure: 2668 For the purpose of aggregating AS_PATH attributes of two routes, 2669 we model each AS as a tuple , where "type" identifies 2670 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 2671 AS_SET), and "value" is the AS number. Two ASs are said to be the 2672 same if their corresponding tuples are the same. 2674 The algorithm to aggregate two AS_PATH attributes works as 2675 follows: 2677 a) Identify the same ASs (as defined above) within each AS_PATH 2678 attribute that are in the same relative order within both 2679 AS_PATH attributes. Two ASs, X and Y, are said to be in the 2680 same order if either: 2681 - X precedes Y in both AS_PATH attributes, or - Y precedes X 2682 in both AS_PATH attributes. 2684 b) The aggregated AS_PATH attribute consists of ASs identified 2685 in (a) in exactly the same order as they appear in the AS_PATH 2686 attributes to be aggregated. If two consecutive ASs identified 2687 in (a) do not immediately follow each other in both of the 2688 AS_PATH attributes to be aggregated, then the intervening ASs 2689 (ASs that are between the two consecutive ASs that are the 2690 RFC DRAFT August 1998 2692 same) in both attributes are combined into an AS_SET path 2693 segment that consists of the intervening ASs from both AS_PATH 2694 attributes; this segment is then placed in between the two 2695 consecutive ASs identified in (a) of the aggregated attribute. 2696 If two consecutive ASs identified in (a) immediately follow 2697 each other in one attribute, but do not follow in another, then 2698 the intervening ASs of the latter are combined into an AS_SET 2699 path segment; this segment is then placed in between the two 2700 consecutive ASs identified in (a) of the aggregated attribute. 2702 If as a result of the above procedure a given AS number appears 2703 more than once within the aggregated AS_PATH attribute, all, but 2704 the last instance (rightmost occurrence) of that AS number should 2705 be removed from the aggregated AS_PATH attribute. 2707 References 2709 [1] Mills, D., "Exterior Gateway Protocol Formal Specification", 2710 RFC904, April 1984. 2712 [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET 2713 Backbone", RFC1092, February 1989. 2715 [3] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, February 2716 1989. 2718 [4] Postel, J., "Transmission Control Protocol - DARPA Internet 2719 Program Protocol Specification", RFC793, September 1981. 2721 [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway 2722 Protocol in the Internet", RFC1772, March 1995. 2724 [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol 2725 Specification", RFC791, September 1981. 2727 [7] "Information Processing Systems - Telecommunications and 2728 Information Exchange between Systems - Protocol for Exchange of 2729 Inter-domain Routeing Information among Intermediate Systems to 2730 Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 2732 [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter- 2733 Domain Routing (CIDR): an Address Assignment and Aggregation 2734 Strategy", RFC1519, September 1993. 2736 RFC DRAFT August 1998 2738 [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation 2739 with CIDR", RFC 1518, September 1993. 2741 Security Considerations 2743 Security issues are not discussed in this document. 2745 Editors' Addresses 2747 Yakov Rekhter 2748 cisco Systems, Inc. 2749 170 W. Tasman Dr. 2750 San Jose, CA 95134 2751 email: yakov@cisco.com 2753 Tony Li 2754 Juniper Networks, Inc. 2755 385 Ravendale Dr. 2756 Mountain View, CA 94043 2757 (650) 526-8006 2758 email: tli@juniper.net