idnits 2.17.1 draft-ietf-idr-bgp4-05.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-27) 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 1 longer page, the longest (page 1) being 2862 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Abstract section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 6 instances of too long lines in the document, the longest one being 5 characters in excess of 72. == There are 3 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 371: '...sage, a BGP speaker MUST calculate the...' RFC 2119 keyword, line 374: '... Hold Time MUST be either zero o...' RFC 2119 keyword, line 753: '... MUST NOT be sent more frequently th...' RFC 2119 keyword, line 754: '... implementation MAY adjust the rate a...' RFC 2119 keyword, line 758: '... messages MUST NOT be sent....' (28 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 693 has weird spacing: '... Length are t...' == Line 1117 has weird spacing: '...is less than...' == Line 1585 has weird spacing: '...s whose desti...' == Line 1950 has weird spacing: '...nations of th...' == Line 2106 has weird spacing: '...ecision proce...' == (2 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 (January 1997) is 9964 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) ** Downref: Normative reference to an Historic RFC: RFC 904 (ref. '1') ** Downref: Normative reference to an Unknown state RFC: RFC 1092 (ref. '2') ** Downref: Normative reference to an Unknown state RFC: RFC 1093 (ref. '3') ** Obsolete normative reference: RFC 793 (ref. '4') (Obsoleted by RFC 9293) -- Possible downref: Non-RFC (?) normative reference: ref. '5' -- Possible downref: Non-RFC (?) normative reference: ref. '7' ** Obsolete normative reference: RFC 1519 (ref. '8') (Obsoleted by RFC 4632) ** Downref: Normative reference to an Historic RFC: RFC 1518 (ref. '9') Summary: 18 errors (**), 0 flaws (~~), 9 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Network Working Group Y. Rekhter 2 INTERNET DRAFT cisco Systems 3 Expire in six months T. Li 4 Juniper Networks 5 Editors 6 January 1997 8 A Border Gateway Protocol 4 (BGP-4) 10 Status of this Memo 12 This document, together with its companion document, "Application of 13 the Border Gateway Protocol in the Internet", define an inter- 14 autonomous system routing protocol for the Internet. This document 15 specifies an IAB standards track protocol for the Internet community, 16 and requests discussion and suggestions for improvements. Please 17 refer to the current edition of the "IAB Official Protocol Standards" 18 for the standardization state and status of this protocol. 19 Distribution of this document is unlimited. 21 This document is an Internet Draft. Internet Drafts are working 22 documents of the Internet Engineering Task Force (IETF), its Areas, 23 and its Working Groups. Note that other groups may also distribute 24 working documents as Internet Drafts. 26 Internet Drafts are draft documents valid for a maximum of six 27 months. Internet Drafts may be updated, replaced, or obsoleted by 28 other documents at any time. It is not appropriate to use Internet 29 Drafts as reference material or to cite them other than as a "working 30 draft" or "work in progress". 32 1. Acknowledgments 34 This document was originally published as RFC 1267 in October 1991, 35 jointly authored by Kirk Lougheed and Yakov Rekhter. 37 We would like to express our thanks to Guy Almes, Len Bosack, and 38 Jeffrey C. Honig for their contributions to the earlier version of 39 this document. 41 We like to explicitly thank Bob Braden for the review of the earlier 42 version of this document as well as his constructive and valuable 43 comments. 45 We would also like to thank Bob Hinden, Director for Routing of the 46 Internet Engineering Steering Group, and the team of reviewers he 47 assembled to review the previous version (BGP-2) of this document. 48 This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia 49 Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted 50 with a strong combination of toughness, professionalism, and 51 courtesy. 53 This updated version of the document is the product of the IETF IDR 54 Working Group with Yakov Rekhter and Tony Li as editors. Certain 55 sections of the document borrowed heavily from IDRP [7], which is the 56 OSI counterpart of BGP. For this credit should be given to the ANSI 57 X3S3.3 group chaired by Lyman Chapin and to Charles Kunzinger who was 58 the IDRP editor within that group. We would also like to thank Mike 59 Craren, Dimitry Haskin, John Krawczyk, David LeRoy, John Scudder, 60 Paul Traina, and Curtis Villamizar for their comments. 62 We would like to specially acknowledge numerous contributions by 63 Dennis Ferguson. 65 2. Introduction 67 The Border Gateway Protocol (BGP) is an inter-Autonomous System 68 routing protocol. It is built on experience gained with EGP as 69 defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as 70 described in RFC 1092 [2] and RFC 1093 [3]. 72 The primary function of a BGP speaking system is to exchange network 73 reachability information with other BGP systems. This network 74 reachability information includes information on the list of 75 Autonomous Systems (ASs) that reachability information traverses. 76 This information is sufficient to construct a graph of AS 77 connectivity from which routing loops may be pruned and some policy 78 decisions at the AS level may be enforced. 80 BGP-4 provides a new set of mechanisms for supporting classless 81 interdomain routing. These mechanisms include support for 82 advertising an IP prefix and eliminates the concept of network 83 "class" within BGP. BGP-4 also introduces mechanisms which allow 84 aggregation of routes, including aggregation of AS paths. These 85 changes provide support for the proposed supernetting scheme [8, 9]. 87 To characterize the set of policy decisions that can be enforced 88 using BGP, one must focus on the rule that a BGP speaker advertise to 89 its peers (other BGP speakers which it communicates with) in 90 neighboring ASs only those routes that it itself uses. This rule 91 reflects the "hop-by-hop" routing paradigm generally used throughout 92 the current Internet. Note that some policies cannot be supported by 93 the "hop-by-hop" routing paradigm and thus require techniques such as 94 source routing to enforce. For example, BGP does not enable one AS 95 to send traffic to a neighboring AS intending that the traffic take a 96 different route from that taken by traffic originating in the 97 neighboring AS. On the other hand, BGP can support any policy 98 conforming to the "hop-by-hop" routing paradigm. Since the current 99 Internet uses only the "hop-by-hop" routing paradigm and since BGP 100 can support any policy that conforms to that paradigm, BGP is highly 101 applicable as an inter-AS routing protocol for the current Internet. 103 A more complete discussion of what policies can and cannot be 104 enforced with BGP is outside the scope of this document (but refer to 105 the companion document discussing BGP usage [5]). 107 BGP runs over a reliable transport protocol. This eliminates the 108 need to implement explicit update fragmentation, retransmission, 109 acknowledgment, and sequencing. Any authentication scheme used by 110 the transport protocol may be used in addition to BGP's own 111 authentication mechanisms. The error notification mechanism used in 112 BGP assumes that the transport protocol supports a "graceful" close, 113 i.e., that all outstanding data will be delivered before the 114 connection is closed. 116 BGP uses TCP [4] as its transport protocol. TCP meets BGP's 117 transport requirements and is present in virtually all commercial 118 routers and hosts. In the following descriptions the phrase 119 "transport protocol connection" can be understood to refer to a TCP 120 connection. BGP uses TCP port 179 for establishing its connections. 122 This document uses the term `Autonomous System' (AS) throughout. The 123 classic definition of an Autonomous System is a set of routers under 124 a single technical administration, using an interior gateway protocol 125 and common metrics to route packets within the AS, and using an 126 exterior gateway protocol to route packets to other ASs. Since this 127 classic definition was developed, it has become common for a single 128 AS to use several interior gateway protocols and sometimes several 129 sets of metrics within an AS. The use of the term Autonomous System 130 here stresses the fact that, even when multiple IGPs and metrics are 131 used, the administration of an AS appears to other ASs to have a 132 single coherent interior routing plan and presents a consistent 133 picture of what destinations are reachable through it. 135 The planned use of BGP in the Internet environment, including such 136 issues as topology, the interaction between BGP and IGPs, and the 137 enforcement of routing policy rules is presented in a companion 138 document [5]. This document is the first of a series of documents 139 planned to explore various aspects of BGP application. Please send 140 comments to the BGP mailing list (bgp@ans.net). 142 3. Summary of Operation 144 Two systems form a transport protocol connection between one another. 145 They exchange messages to open and confirm the connection parameters. 146 The initial data flow is the entire BGP routing table. Incremental 147 updates are sent as the routing tables change. BGP does not require 148 periodic refresh of the entire BGP routing table. Therefore, a BGP 149 speaker must retain the current version of the entire BGP routing 150 tables of all of its peers for the duration of the connection. 151 KeepAlive messages are sent periodically to ensure the liveness of 152 the connection. Notification messages are sent in response to errors 153 or special conditions. If a connection encounters an error 154 condition, a notification message is sent and the connection is 155 closed. 157 The hosts executing the Border Gateway Protocol need not be routers. 158 A non-routing host could exchange routing information with routers 159 via EGP or even an interior routing protocol. That non-routing host 160 could then use BGP to exchange routing information with a border 161 router in another Autonomous System. The implications and 162 applications of this architecture are for further study. 164 Connections between BGP speakers of different ASs are referred to as 165 "external" links. BGP connections between BGP speakers within the 166 same AS are referred to as "internal" links. Similarly, a peer in a 167 different AS is referred to as an external peer, while a peer in the 168 same AS may be described as an internal peer. Internal BGP and 169 external BGP are commonly abbreviated IBGP and EBGP. 171 If a particular AS has multiple BGP speakers and is providing transit 172 service for other ASs, then care must be taken to ensure a consistent 173 view of routing within the AS. A consistent view of the interior 174 routes of the AS is provided by the interior routing protocol. A 175 consistent view of the routes exterior to the AS can be provided by 176 having all BGP speakers within the AS maintain direct IBGP 177 connections with each other. Alternately the interior routing 178 protocol can pass BGP information among routers within an AS, taking 179 care not to lose BGP attributes that will be needed by EBGP speakers 180 if transit connectivity is being provided. For the purpose of 181 discussion, it is assumed that BGP information is passed within an AS 182 using IBGP. Care must be taken to ensure that the interior routers 183 have all been updated with transit information before the EBGP 184 speakers announce to other ASs that transit service is being 185 provided. 187 3.1 Routes: Advertisement and Storage 189 For purposes of this protocol a route is defined as a unit of 190 information that pairs a destination with the attributes of a path to 191 that destination: 193 - Routes are advertised between a pair of BGP speakers in UPDATE 194 messages: the destination is the systems whose IP addresses are 195 reported in the Network Layer Reachability Information (NLRI) 196 field, and the the path is the information reported in the path 197 attributes fields of the same UPDATE message. 199 - Routes are stored in the Routing Information Bases (RIBs): 200 namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes 201 that will be advertised to other BGP speakers must be present in 202 the Adj-RIB-Out; routes that will be used by the local BGP speaker 203 must be present in the Loc-RIB, and the next hop for each of these 204 routes must be present in the local BGP speaker's forwarding 205 information base; and routes that are received from other BGP 206 speakers are present in the Adj-RIBs-In. 208 If a BGP speaker chooses to advertise the route, it may add to or 209 modify the path attributes of the route before advertising it to a 210 peer. 212 BGP provides mechanisms by which a BGP speaker can inform its peer 213 that a previously advertised route is no longer available for use. 214 There are three methods by which a given BGP speaker can indicate 215 that a route has been withdrawn from service: 217 a) the IP prefix that expresses destinations for a previously 218 advertised route can be advertised in the WITHDRAWN ROUTES field 219 in the UPDATE message, thus marking the associated route as being 220 no longer available for use 222 b) a replacement route with the same Network Layer Reachability 223 Information can be advertised, or 225 c) the BGP speaker - BGP speaker connection can be closed, which 226 implicitly removes from service all routes which the pair of 227 speakers had advertised to each other. 229 3.2 Routing Information Bases 231 The Routing Information Base (RIB) within a BGP speaker consists of 232 three distinct parts: 234 a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has 235 been learned from inbound UPDATE messages. Their contents 236 represent routes that are available as an input to the Decision 237 Process. 239 b) Loc-RIB: The Loc-RIB contains the local routing information 240 that the BGP speaker has selected by applying its local policies 241 to the routing information contained in its Adj-RIBs-In. 243 c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the 244 local BGP speaker has selected for advertisement to its peers. The 245 routing information stored in the Adj-RIBs-Out will be carried in 246 the local BGP speaker's UPDATE messages and advertised to its 247 peers. 249 In summary, the Adj-RIBs-In contain unprocessed routing information 250 that has been advertised to the local BGP speaker by its peers; the 251 Loc-RIB contains the routes that have been selected by the local BGP 252 speaker's Decision Process; and the Adj-RIBs-Out organize the routes 253 for advertisement to specific peers by means of the local speaker's 254 UPDATE messages. 256 Although the conceptual model distinguishes between Adj-RIBs-In, 257 Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an 258 implementation must maintain three separate copies of the routing 259 information. The choice of implementation (for example, 3 copies of 260 the information vs 1 copy with pointers) is not constrained by the 261 protocol. 263 4. Message Formats 265 This section describes message formats used by BGP. 267 Messages are sent over a reliable transport protocol connection. A 268 message is processed only after it is entirely received. The maximum 269 message size is 4096 octets. All implementations are required to 270 support this maximum message size. The smallest message that may be 271 sent consists of a BGP header without a data portion, or 19 octets. 273 4.1 Message Header Format 275 Each message has a fixed-size header. There may or may not be a data 276 portion following the header, depending on the message type. The 277 layout of these fields is shown below: 279 0 1 2 3 280 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 281 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 282 | | 283 + + 284 | | 285 + + 286 | Marker | 287 + + 288 | | 289 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 290 | Length | Type | 291 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 293 Marker: 295 This 16-octet field contains a value that the receiver of the 296 message can predict. If the Type of the message is OPEN, or if 297 the OPEN message carries no Authentication Information (as an 298 Optional Parameter), then the Marker must be all ones. 299 Otherwise, the value of the marker can be predicted by some a 300 computation specified as part of the authentication mechanism 301 (which is specified as part of the Authentication Information) 302 used. The Marker can be used to detect loss of synchronization 303 between a pair of BGP peers, and to authenticate incoming BGP 304 messages. 306 Length: 308 This 2-octet unsigned integer indicates the total length of the 309 message, including the header, in octets. Thus, e.g., it 310 allows one to locate in the transport-level stream the (Marker 311 field of the) next message. The value of the Length field must 312 always be at least 19 and no greater than 4096, and may be 313 further constrained, depending on the message type. No 314 "padding" of extra data after the message is allowed, so the 315 Length field must have the smallest value required given the 316 rest of the message. 318 Type: 320 This 1-octet unsigned integer indicates the type code of the 321 message. The following type codes are defined: 323 1 - OPEN 324 2 - UPDATE 325 3 - NOTIFICATION 326 4 - KEEPALIVE 328 4.2 OPEN Message Format 330 After a transport protocol connection is established, the first 331 message sent by each side is an OPEN message. If the OPEN message is 332 acceptable, a KEEPALIVE message confirming the OPEN is sent back. 333 Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION 334 messages may be exchanged. 336 In addition to the fixed-size BGP header, the OPEN message contains 337 the following fields: 339 0 1 2 3 340 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 341 +-+-+-+-+-+-+-+-+ 342 | Version | 343 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 344 | My Autonomous System | 345 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 346 | Hold Time | 347 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 348 | BGP Identifier | 349 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 350 | Opt Parm Len | 351 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 352 | | 353 | Optional Parameters | 354 | | 355 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 357 Version: 359 This 1-octet unsigned integer indicates the protocol version 360 number of the message. The current BGP version number is 4. 362 My Autonomous System: 364 This 2-octet unsigned integer indicates the Autonomous System 365 number of the sender. 367 Hold Time: 369 This 2-octet unsigned integer indicates the number of seconds 370 that the sender proposes for the value of the Hold Timer. Upon 371 receipt of an OPEN message, a BGP speaker MUST calculate the 372 value of the Hold Timer by using the smaller of its configured 373 Hold Time and the Hold Time received in the OPEN message. The 374 Hold Time MUST be either zero or at least three seconds. An 375 implementation may reject connections on the basis of the Hold 376 Time. The calculated value indicates the maximum number of 377 seconds that may elapse between the receipt of successive 378 KEEPALIVE, and/or UPDATE messages by the sender. 380 BGP Identifier: 381 This 4-octet unsigned integer indicates the BGP Identifier of 382 the sender. A given BGP speaker sets the value of its BGP 383 Identifier to an IP address assigned to that BGP speaker. The 384 value of the BGP Identifier is determined on startup and is the 385 same for every local interface and every BGP peer. 387 Optional Parameters Length: 389 This 1-octet unsigned integer indicates the total length of the 390 Optional Parameters field in octets. If the value of this field 391 is zero, no Optional Parameters are present. 393 Optional Parameters: 395 This field may contain a list of optional parameters, where 396 each parameter is encoded as a triplet. 399 0 1 400 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 401 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 402 | Parm. Type | Parm. Length | Parameter Value (variable) 403 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 405 Parameter Type is a one octet field that unambiguously 406 identifies individual parameters. Parameter Length is a one 407 octet field that contains the length of the Parameter Value 408 field in octets. Parameter Value is a variable length field 409 that is interpreted according to the value of the Parameter 410 Type field. 412 This document defines the following Optional Parameters: 414 a) Authentication Information (Parameter Type 1): 416 This optional parameter may be used to authenticate a BGP 417 peer. The Parameter Value field contains a 1-octet 418 Authentication Code followed by a variable length 419 Authentication Data. 421 0 1 2 3 4 5 6 7 8 422 +-+-+-+-+-+-+-+-+ 423 | Auth. Code | 424 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 425 | | 426 | Authentication Data | 427 | | 428 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 430 Authentication Code: 432 This 1-octet unsigned integer indicates the 433 authentication mechanism being used. Whenever an 434 authentication mechanism is specified for use within 435 BGP, three things must be included in the 436 specification: 437 - the value of the Authentication Code which indicates 438 use of the mechanism, 439 - the form and meaning of the Authentication Data, and 440 - the algorithm for computing values of Marker fields. 442 Note that a separate authentication mechanism may be 443 used in establishing the transport level connection. 445 Authentication Data: 447 The form and meaning of this field is a variable- 448 length field depend on the Authentication Code. 450 The minimum length of the OPEN message is 29 octets (including 451 message header). 453 4.3 UPDATE Message Format 455 UPDATE messages are used to transfer routing information between BGP 456 peers. The information in the UPDATE packet can be used to construct 457 a graph describing the relationships of the various Autonomous 458 Systems. By applying rules to be discussed, routing information 459 loops and some other anomalies may be detected and removed from 460 inter-AS routing. 462 An UPDATE message is used to advertise a single feasible route to a 463 peer, or to withdraw multiple unfeasible routes from service (see 464 3.1). An UPDATE message may simultaneously advertise a feasible route 465 and withdraw multiple unfeasible routes from service. The UPDATE 466 message always includes the fixed-size BGP header, and can optionally 467 include the other fields as shown below: 469 +-----------------------------------------------------+ 470 | Unfeasible Routes Length (2 octets) | 471 +-----------------------------------------------------+ 472 | Withdrawn Routes (variable) | 473 +-----------------------------------------------------+ 474 | Total Path Attribute Length (2 octets) | 475 +-----------------------------------------------------+ 476 | Path Attributes (variable) | 477 +-----------------------------------------------------+ 478 | Network Layer Reachability Information (variable) | 479 +-----------------------------------------------------+ 481 Unfeasible Routes Length: 483 This 2-octets unsigned integer indicates the total length of 484 the Withdrawn Routes field in octets. Its value must allow the 485 length of the Network Layer Reachability Information field to 486 be determined as specified below. 488 A value of 0 indicates that no routes are being withdrawn from 489 service, and that the WITHDRAWN ROUTES field is not present in 490 this UPDATE message. 492 Withdrawn Routes: 494 This is a variable length field that contains a list of IP 495 address prefixes for the routes that are being withdrawn from 496 service. Each IP address prefix is encoded as a 2-tuple of the 497 form , whose fields are described below: 499 +---------------------------+ 500 | Length (1 octet) | 501 +---------------------------+ 502 | Prefix (variable) | 503 +---------------------------+ 505 The use and the meaning of these fields are as follows: 507 a) Length: 509 The Length field indicates the length in bits of the IP 510 address prefix. A length of zero indicates a prefix that 511 matches all IP addresses (with prefix, itself, of zero 512 octets). 514 b) Prefix: 516 The Prefix field contains IP address prefixes followed by 517 enough trailing bits to make the end of the field fall on an 518 octet boundary. Note that the value of trailing bits is 519 irrelevant. 521 Total Path Attribute Length: 523 This 2-octet unsigned integer indicates the total length of the 524 Path Attributes field in octets. Its value must allow the 525 length of the Network Layer Reachability field to be determined 526 as specified below. 528 A value of 0 indicates that no Network Layer Reachability 529 Information field is present in this UPDATE message. 531 Path Attributes: 533 A variable length sequence of path attributes is present in 534 every UPDATE. Each path attribute is a triple of variable length. 537 Attribute Type is a two-octet field that consists of the 538 Attribute Flags octet followed by the Attribute Type Code 539 octet. 541 0 1 542 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 543 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 544 | Attr. Flags |Attr. Type Code| 545 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 547 The high-order bit (bit 0) of the Attribute Flags octet is the 548 Optional bit. It defines whether the attribute is optional (if 549 set to 1) or well-known (if set to 0). 551 The second high-order bit (bit 1) of the Attribute Flags octet 552 is the Transitive bit. It defines whether an optional 553 attribute is transitive (if set to 1) or non-transitive (if set 554 to 0). For well-known attributes, the Transitive bit must be 555 set to 1. (See Section 5 for a discussion of transitive 556 attributes.) 558 The third high-order bit (bit 2) of the Attribute Flags octet 559 is the Partial bit. It defines whether the information 560 contained in the optional transitive attribute is partial (if 561 set to 1) or complete (if set to 0). For well-known attributes 562 and for optional non-transitive attributes the Partial bit must 563 be set to 0. 565 The fourth high-order bit (bit 3) of the Attribute Flags octet 566 is the Extended Length bit. It defines whether the Attribute 567 Length is one octet (if set to 0) or two octets (if set to 1). 568 Extended Length may be used only if the length of the attribute 569 value is greater than 255 octets. 571 The lower-order four bits of the Attribute Flags octet are . 572 unused. They must be zero (and must be ignored when received). 574 The Attribute Type Code octet contains the Attribute Type Code. 575 Currently defined Attribute Type Codes are discussed in Section 576 5. 578 If the Extended Length bit of the Attribute Flags octet is set 579 to 0, the third octet of the Path Attribute contains the length 580 of the attribute data in octets. 582 If the Extended Length bit of the Attribute Flags octet is set 583 to 1, then the third and the fourth octets of the path 584 attribute contain the length of the attribute data in octets. 586 The remaining octets of the Path Attribute represent the 587 attribute value and are interpreted according to the Attribute 588 Flags and the Attribute Type Code. The supported Attribute Type 589 Codes, their attribute values and uses are the following: 591 a) ORIGIN (Type Code 1): 593 ORIGIN is a well-known mandatory attribute that defines the 594 origin of the path information. The data octet can assume 595 the following values: 597 Value Meaning 599 0 IGP - Network Layer Reachability Information 600 is interior to the originating AS 602 1 EGP - Network Layer Reachability Information 603 learned via EGP 605 2 INCOMPLETE - Network Layer Reachability 606 Information learned by some other means 608 Its usage is defined in 5.1.1 610 b) AS_PATH (Type Code 2): 612 AS_PATH is a well-known mandatory attribute that is composed 613 of a sequence of AS path segments. Each AS path segment is 614 represented by a triple . 617 The path segment type is a 1-octet long field with the 618 following values defined: 620 Value Segment Type 622 1 AS_SET: unordered set of ASs a route in the 623 UPDATE message has traversed 625 2 AS_SEQUENCE: ordered set of ASs a route in 626 the UPDATE message has traversed 628 The path segment length is a 1-octet long field containing 629 the number of ASs in the path segment value field. 631 The path segment value field contains one or more AS 632 numbers, each encoded as a 2-octets long field. 634 Usage of this attribute is defined in 5.1.2. 636 c) NEXT_HOP (Type Code 3): 638 This is a well-known mandatory attribute that defines the IP 639 address of the border router that should be used as the next 640 hop to the destinations listed in the Network Layer 641 Reachability field of the UPDATE message. 643 Usage of this attribute is defined in 5.1.3. 645 d) MULTI_EXIT_DISC (Type Code 4): 647 This is an optional non-transitive attribute that is a four 648 octet non-negative integer. The value of this attribute may 649 be used by a BGP speaker's decision process to discriminate 650 among multiple exit points to a neighboring autonomous 651 system. 653 Its usage is defined in 5.1.4. 655 e) LOCAL_PREF (Type Code 5): 657 LOCAL_PREF is a well-known mandatory attribute that is a 658 four octet non-negative integer. It is used by a BGP speaker 659 to inform other internal peers of the originating speaker's 660 degree of preference for an advertised route. Usage of this 661 attribute is described in 5.1.5. 663 f) ATOMIC_AGGREGATE (Type Code 6) 665 ATOMIC_AGGREGATE is a well-known discretionary attribute of 666 length 0. It is used by a BGP speaker to inform other BGP 667 speakers that the local system selected a less specific 668 route without selecting a more specific route which is 669 included in it. Usage of this attribute is described in 670 5.1.6. 672 g) AGGREGATOR (Type Code 7) 674 AGGREGATOR is an optional transitive attribute of length 6. 675 The attribute contains the last AS number that formed the 676 aggregate route (encoded as 2 octets), followed by the IP 677 address of the BGP speaker that formed the aggregate route 678 (encoded as 4 octets). Usage of this attribute is described 679 in 5.1.7 681 Network Layer Reachability Information: 683 This variable length field contains a list of IP address 684 prefixes. The length in octets of the Network Layer 685 Reachability Information is not encoded explicitly, but can be 686 calculated as: 688 UPDATE message Length - 23 - Total Path Attributes Length - 689 Unfeasible Routes Length 691 where UPDATE message Length is the value encoded in the fixed- 692 size BGP header, Total Path Attribute Length and Unfeasible 693 Routes Length are the values encoded in the variable part of 694 the UPDATE message, and 23 is a combined length of the fixed- 695 size BGP header, the Total Path Attribute Length field and the 696 Unfeasible Routes Length field. 698 Reachability information is encoded as one or more 2-tuples of 699 the form , whose fields are described below: 701 +---------------------------+ 702 | Length (1 octet) | 703 +---------------------------+ 704 | Prefix (variable) | 705 +---------------------------+ 707 The use and the meaning of these fields are as follows: 709 a) Length: 711 The Length field indicates the length in bits of the IP 712 address prefix. A length of zero indicates a prefix that 713 matches all IP addresses (with prefix, itself, of zero 714 octets). 716 b) Prefix: 718 The Prefix field contains IP address prefixes followed by 719 enough trailing bits to make the end of the field fall on an 720 octet boundary. Note that the value of the trailing bits is 721 irrelevant. 723 The minimum length of the UPDATE message is 23 octets -- 19 octets 724 for the fixed header + 2 octets for the Unfeasible Routes Length + 2 725 octets for the Total Path Attribute Length (the value of Unfeasible 726 Routes Length is 0 and the value of Total Path Attribute Length is 727 0). 729 An UPDATE message can advertise at most one route, which may be 730 described by several path attributes. All path attributes contained 731 in a given UPDATE messages apply to the destinations carried in the 732 Network Layer Reachability Information field of the UPDATE message. 734 An UPDATE message can list multiple routes to be withdrawn from 735 service. Each such route is identified by its destination (expressed 736 as an IP prefix), which unambiguously identifies the route in the 737 context of the BGP speaker - BGP speaker connection to which it has 738 been previously been advertised. 740 An UPDATE message may advertise only routes to be withdrawn from 741 service, in which case it will not include path attributes or Network 742 Layer Reachability Information. Conversely, it may advertise only a 743 feasible route, in which case the WITHDRAWN ROUTES field need not be 744 present. 746 4.4 KEEPALIVE Message Format 748 BGP does not use any transport protocol-based keep-alive mechanism to 749 determine if peers are reachable. Instead, KEEPALIVE messages are 750 exchanged between peers often enough as not to cause the Hold Timer 751 to expire. A reasonable maximum time between KEEPALIVE messages 752 would be one third of the Hold Time interval. KEEPALIVE messages 753 MUST NOT be sent more frequently than one per second. An 754 implementation MAY adjust the rate at which it sends KEEPALIVE 755 messages as a function of the Hold Time interval. 757 If the negotiated Hold Time interval is zero, then periodic KEEPALIVE 758 messages MUST NOT be sent. 760 KEEPALIVE message consists of only message header and has a length of 761 19 octets. 763 4.5 NOTIFICATION Message Format 765 A NOTIFICATION message is sent when an error condition is detected. 766 The BGP connection is closed immediately after sending it. 768 In addition to the fixed-size BGP header, the NOTIFICATION message 769 contains the following fields: 771 0 1 2 3 772 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 773 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 774 | Error code | Error subcode | Data | 775 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 776 | | 777 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 779 Error Code: 781 This 1-octet unsigned integer indicates the type of 782 NOTIFICATION. The following Error Codes have been defined: 784 Error Code Symbolic Name Reference 786 1 Message Header Error Section 6.1 788 2 OPEN Message Error Section 6.2 790 3 UPDATE Message Error Section 6.3 792 4 Hold Timer Expired Section 6.5 794 5 Finite State Machine Error Section 6.6 796 6 Cease Section 6.7 798 Error subcode: 800 This 1-octet unsigned integer provides more specific 801 information about the nature of the reported error. Each Error 802 Code may have one or more Error Subcodes associated with it. 803 If no appropriate Error Subcode is defined, then a zero 804 (Unspecific) value is used for the Error Subcode field. 806 Message Header Error subcodes: 808 1 - Connection Not Synchronized. 809 2 - Bad Message Length. 810 3 - Bad Message Type. 812 OPEN Message Error subcodes: 814 1 - Unsupported Version Number. 815 2 - Bad Peer AS. 816 3 - Bad BGP Identifier. 817 4 - Unsupported Optional Parameter. 818 5 - Authentication Failure. 819 6 - Unacceptable Hold Time. 821 UPDATE Message Error subcodes: 823 1 - Malformed Attribute List. 824 2 - Unrecognized Well-known Attribute. 825 3 - Missing Well-known Attribute. 826 4 - Attribute Flags Error. 827 5 - Attribute Length Error. 828 6 - Invalid ORIGIN Attribute 829 7 - AS Routing Loop. 830 8 - Invalid NEXT_HOP Attribute. 831 9 - Optional Attribute Error. 832 10 - Invalid Network Field. 833 11 - Malformed AS_PATH. 835 Data: 837 This variable-length field is used to diagnose the reason for 838 the NOTIFICATION. The contents of the Data field depend upon 839 the Error Code and Error Subcode. See Section 6 below for more 840 details. 842 Note that the length of the Data field can be determined from 843 the message Length field by the formula: 845 Message Length = 21 + Data Length 847 The minimum length of the NOTIFICATION message is 21 octets 848 (including message header). 850 5. Path Attributes 852 This section discusses the path attributes of the UPDATE message. 854 Path attributes fall into four separate categories: 856 1. Well-known mandatory. 857 2. Well-known discretionary. 858 3. Optional transitive. 859 4. Optional non-transitive. 861 Well-known attributes must be recognized by all BGP implementations. 862 Some of these attributes are mandatory and must be included in every 863 UPDATE message that contains NLRI. Others are discretionary and may 864 or may not be sent in a particular UPDATE message. 866 All well-known attributes must be passed along (after proper 867 updating, if necessary) to other BGP peers. 869 In addition to well-known attributes, each path may contain one or 870 more optional attributes. It is not required or expected that all 871 BGP implementations support all optional attributes. The handling of 872 an unrecognized optional attribute is determined by the setting of 873 the Transitive bit in the attribute flags octet. Paths with 874 unrecognized transitive optional attributes should be accepted. If a 875 path with unrecognized transitive optional attribute is accepted and 876 passed along to other BGP peers, then the unrecognized transitive 877 optional attribute of that path must be passed along with the path to 878 other BGP peers with the Partial bit in the Attribute Flags octet set 879 to 1. If a path with recognized transitive optional attribute is 880 accepted and passed along to other BGP peers and the Partial bit in 881 the Attribute Flags octet is set to 1 by some previous AS, it is not 882 set back to 0 by the current AS. Unrecognized non-transitive optional 883 attributes must be quietly ignored and not passed along to other BGP 884 peers. 886 New transitive optional attributes may be attached to the path by the 887 originator or by any other AS in the path. If they are not attached 888 by the originator, the Partial bit in the Attribute Flags octet is 889 set to 1. The rules for attaching new non-transitive optional 890 attributes will depend on the nature of the specific attribute. The 891 documentation of each new non-transitive optional attribute will be 892 expected to include such rules. (The description of the 893 MULTI_EXIT_DISC attribute gives an example.) All optional attributes 894 (both transitive and non-transitive) may be updated (if appropriate) 895 by ASs in the path. 897 The sender of an UPDATE message should order path attributes within 898 the UPDATE message in ascending order of attribute type. The 899 receiver of an UPDATE message must be prepared to handle path 900 attributes within the UPDATE message that are out of order. 902 The same attribute cannot appear more than once within the Path 903 Attributes field of a particular UPDATE message. 905 The mandatory category refers to an attribute which must be present 906 in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE 907 message. Attributes classified as optional for the purpose of the 908 protocol extension mechanism may be purely discretionary, or 909 discretionary, required, or disallowed in certain contexts. 911 attribute EBGP IBGP 912 ORIGIN mandatory mandatory 913 AS_PATH mandatory mandatory 914 NEXT_HOP mandatory mandatory 915 MULTI_EXIT_DISC discretionary discretionary 916 LOCAL_PREF disallowed required 917 ATOMIC_AGGREGATE see section 5.1.6 and 9.1.4 918 AGGREGATOR discretionary discretionary 920 5.1 Path Attribute Usage 922 The usage of each BGP path attributes is described in the following 923 clauses. 925 5.1.1 ORIGIN 927 ORIGIN is a well-known mandatory attribute. The ORIGIN attribute 928 shall be generated by the autonomous system that originates the 929 associated routing information. It shall be included in the UPDATE 930 messages of all BGP speakers that choose to propagate this 931 information to other BGP speakers. 933 5.1.2 AS_PATH 935 AS_PATH is a well-known mandatory attribute. This attribute 936 identifies the autonomous systems through which routing information 937 carried in this UPDATE message has passed. The components of this 938 list can be AS_SETs or AS_SEQUENCEs. 940 When a BGP speaker propagates a route which it has learned from 941 another BGP speaker's UPDATE message, it shall modify the route's 942 AS_PATH attribute based on the location of the BGP speaker to which 943 the route will be sent: 945 a) When a given BGP speaker advertises the route to an internal 946 peer, the advertising speaker shall not modify the AS_PATH 947 attribute associated with the route. 949 b) When a given BGP speaker advertises the route to an external 950 peer, then the advertising speaker shall update the AS_PATH 951 attribute as follows: 953 1) if the first path segment of the AS_PATH is of type 954 AS_SEQUENCE, the local system shall prepend its own AS number 955 as the last element of the sequence (put it in the leftmost 956 position) 958 2) if the first path segment of the AS_PATH is of type AS_SET, 959 the local system shall prepend a new path segment of type 960 AS_SEQUENCE to the AS_PATH, including its own AS number in that 961 segment. 963 When a BGP speaker originates a route then: 965 a) the originating speaker shall include its own AS number in 966 the AS_PATH attribute of all UPDATE messages sent to an 967 external peer. (In this case, the AS number of the originating 968 speaker's autonomous system will be the only entry in the 969 AS_PATH attribute). 971 b) the originating speaker shall include an empty AS_PATH 972 attribute in all UPDATE messages sent to internal peers. (An 973 empty AS_PATH attribute is one whose length field contains the 974 value zero). 976 5.1.3 NEXT_HOP 978 The NEXT_HOP path attribute defines the IP address of the border 979 router that should be used as the next hop to the destinations listed 980 in the UPDATE message. When advertising a NEXT_HOP attribute to an 981 external peer, a router may use one of its own interface addresses in 982 the NEXT_HOP attribute provided the external peer to which the route 983 is being advertised shares a common subnet with the NEXT_HOP address. 984 This is known as a "first party" NEXT_HOP attribute. A BGP speaker 985 can advertise to an external peer an interface of any internal peer 986 router in the NEXT_HOP attribute provided the external peer to which 987 the route is being advertised shares a common subnet with the 988 NEXT_HOP address. This is known as a "third party" NEXT_HOP 989 attribute. A BGP speaker can advertise any external peer router in 990 the NEXT_HOP attribute provided that the IP address of this border 991 router was learned from an external peer and the external peer to 992 which the route is being advertised shares a common subnet with the 993 NEXT_HOP address. This is a second form of "third party" NEXT_HOP 994 attribute. 996 Normally the NEXT_HOP attribute is chosen such that the shortest 997 available path will be taken. A BGP speaker must be able to support 998 disabling advertisement of third party NEXT_HOP attributes to handle 999 imperfectly bridged media. 1001 A BGP speaker must never advertise an address of a peer to that peer 1002 as a NEXT_HOP, for a route that the speaker is originating. A BGP 1003 speaker must never install a route with itself as the next hop. 1005 When a BGP speaker advertises the route to an internal peer, the 1006 advertising speaker should not modify the NEXT_HOP attribute 1007 associated with the route. When a BGP speaker receives the route via 1008 an internal link, it may forward packets to the NEXT_HOP address if 1009 the address contained in the attribute is on a common subnet with the 1010 local and remote BGP speakers. 1012 5.1.4 MULTI_EXIT_DISC 1014 The MULTI_EXIT_DISC attribute may be used on external (inter-AS) 1015 links to discriminate among multiple exit or entry points to the same 1016 neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four 1017 octet unsigned number which is called a metric. All other factors 1018 being equal, the exit or entry point with lower metric should be 1019 preferred. If received over external links, the MULTI_EXIT_DISC 1020 attribute MAY be propagated over internal links to other BGP speakers 1021 within the same AS. The MULTI_EXIT_DISC attribute received from a 1022 neighboring AS MUST NOT be propagated to other neighboring ASs. 1024 A BGP speaker MUST IMPLEMENT a mechanism based on local configuration 1025 which allows the MULTI_EXIT_DISC attribute to be removed from a 1026 route. This MAY be done either prior to or after determining the 1027 degree of preference of the route and performing route selection 1028 (decision process phases 1 and 2). 1030 An implementation MAY also (based on local configuration) alter the 1031 value of the MULTI_EXIT_DISC attribute received over an external 1032 link. If it does so, it shall do so prior to determining the degree 1033 of preference of the route and performing route selection (decision 1034 process phases 1 and 2). 1036 5.1.5 LOCAL_PREF 1038 LOCAL_PREF is a well-known mandatory attribute that SHALL be included 1039 in all UPDATE messages that a given BGP speaker sends to the other 1040 internal peers. A BGP speaker SHALL calculate the degree of 1041 preference for each external route and include the degree of 1042 preference when advertising a route to its internal peers. The higher 1043 degree of preference MUST be preferred. A BGP speaker shall use the 1044 degree of preference learned via LOCAL_PREF in its decision process 1045 (see section 9.1.1). 1047 A BGP speaker MUST NOT include this attribute in UPDATE messages that 1048 it sends to external peers. If it is contained in an UPDATE message 1049 that is received from an external peer, then this attribute MUST be 1050 ignored by the receiving speaker. 1052 5.1.6 ATOMIC_AGGREGATE 1054 ATOMIC_AGGREGATE is a well-known discretionary attribute. If a BGP 1055 speaker, when presented with a set of overlapping routes from one of 1056 its peers (see 9.1.4), selects the less specific route without 1057 selecting the more specific one, then the local system MUST attach 1058 the ATOMIC_AGGREGATE attribute to the route when propagating it to 1059 other BGP speakers (if that attribute is not already present in the 1060 received less specific route). A BGP speaker that receives a route 1061 with the ATOMIC_AGGREGATE attribute MUST NOT remove the attribute 1062 from the route when propagating it to other speakers. A BGP speaker 1063 that receives a route with the ATOMIC_AGGREGATE attribute MUST NOT 1064 make any NLRI of that route more specific (as defined in 9.1.4) when 1065 advertising this route to other BGP speakers. A BGP speaker that 1066 receives a route with the ATOMIC_AGGREGATE attribute needs to be 1067 cognizant of the fact that the actual path to destinations, as 1068 specified in the NLRI of the route, while having the loop-free 1069 property, may traverse ASs that are not listed in the AS_PATH 1070 attribute. 1072 5.1.7 AGGREGATOR 1074 AGGREGATOR is an optional transitive attribute which may be included 1075 in updates which are formed by aggregation (see Section 9.2.4.2). A 1076 BGP speaker which performs route aggregation may add the AGGREGATOR 1077 attribute which shall contain its own AS number and IP address. 1079 6. BGP Error Handling. 1081 This section describes actions to be taken when errors are detected 1082 while processing BGP messages. 1084 When any of the conditions described here are detected, a 1085 NOTIFICATION message with the indicated Error Code, Error Subcode, 1086 and Data fields is sent, and the BGP connection is closed. If no 1087 Error Subcode is specified, then a zero must be used. 1089 The phrase "the BGP connection is closed" means that the transport 1090 protocol connection has been closed and that all resources for that 1091 BGP connection have been deallocated. Routing table entries 1092 associated with the remote peer are marked as invalid. The fact that 1093 the routes have become invalid is passed to other BGP peers before 1094 the routes are deleted from the system. 1096 Unless specified explicitly, the Data field of the NOTIFICATION 1097 message that is sent to indicate an error is empty. 1099 6.1 Message Header error handling. 1101 All errors detected while processing the Message Header are indicated 1102 by sending the NOTIFICATION message with Error Code Message Header 1103 Error. The Error Subcode elaborates on the specific nature of the 1104 error. 1106 The expected value of the Marker field of the message header is all 1107 ones if the message type is OPEN. The expected value of the Marker 1108 field for all other types of BGP messages determined based on the 1109 presence of the Authentication Information Optional Parameter in the 1110 BGP OPEN message and the actual authentication mechanism (if the 1111 Authentication Information in the BGP OPEN message is present). If 1112 the Marker field of the message header is not the expected one, then 1113 a synchronization error has occurred and the Error Subcode is set to 1114 Connection Not Synchronized. 1116 If the Length field of the message header is less than 19 or greater 1117 than 4096, or if the Length field of an OPEN message is less than 1118 the minimum length of the OPEN message, or if the Length field of an 1119 UPDATE message is less than the minimum length of the UPDATE message, 1120 or if the Length field of a KEEPALIVE message is not equal to 19, or 1121 if the Length field of a NOTIFICATION message is less than the 1122 minimum length of the NOTIFICATION message, then the Error Subcode is 1123 set to Bad Message Length. The Data field contains the erroneous 1124 Length field. 1126 If the Type field of the message header is not recognized, then the 1127 Error Subcode is set to Bad Message Type. The Data field contains 1128 the erroneous Type field. 1130 6.2 OPEN message error handling. 1132 All errors detected while processing the OPEN message are indicated 1133 by sending the NOTIFICATION message with Error Code OPEN Message 1134 Error. The Error Subcode elaborates on the specific nature of the 1135 error. 1137 If the version number contained in the Version field of the received 1138 OPEN message is not supported, then the Error Subcode is set to 1139 Unsupported Version Number. The Data field is a 2-octet unsigned 1140 integer, which indicates the largest locally supported version number 1141 less than the version the remote BGP peer bid (as indicated in the 1142 received OPEN message). 1144 If the Autonomous System field of the OPEN message is unacceptable, 1145 then the Error Subcode is set to Bad Peer AS. The determination of 1146 acceptable Autonomous System numbers is outside the scope of this 1147 protocol. 1149 If the Hold Time field of the OPEN message is unacceptable, then the 1150 Error Subcode MUST be set to Unacceptable Hold Time. An 1151 implementation MUST reject Hold Time values of one or two seconds. 1152 An implementation MAY reject any proposed Hold Time. An 1153 implementation which accepts a Hold Time MUST use the negotiated 1154 value for the Hold Time. 1156 If the BGP Identifier field of the OPEN message is syntactically 1157 incorrect, then the Error Subcode is set to Bad BGP Identifier. 1158 Syntactic correctness means that the BGP Identifier field represents 1159 a valid IP host address. 1161 If one of the Optional Parameters in the OPEN message is not 1162 recognized, then the Error Subcode is set to Unsupported Optional 1163 Parameters. 1165 If the OPEN message carries Authentication Information (as an 1166 Optional Parameter), then the corresponding authentication procedure 1167 is invoked. If the authentication procedure (based on Authentication 1168 Code and Authentication Data) fails, then the Error Subcode is set to 1169 Authentication Failure. 1171 If the OPEN message carries any other Optional Parameter (other than 1172 Authentication Information), and the local system doesn't recognize 1173 the Parameter, the Parameter shall be ignored. 1175 6.3 UPDATE message error handling. 1177 All errors detected while processing the UPDATE message are indicated 1178 by sending the NOTIFICATION message with Error Code UPDATE Message 1179 Error. The error subcode elaborates on the specific nature of the 1180 error. 1182 Error checking of an UPDATE message begins by examining the path 1183 attributes. If the Unfeasible Routes Length or Total Attribute 1184 Length is too large (i.e., if Unfeasible Routes Length + Total 1185 Attribute Length + 23 exceeds the message Length), then the Error 1186 Subcode is set to Malformed Attribute List. 1188 If any recognized attribute has Attribute Flags that conflict with 1189 the Attribute Type Code, then the Error Subcode is set to Attribute 1190 Flags Error. The Data field contains the erroneous attribute (type, 1191 length and value). 1193 If any recognized attribute has Attribute Length that conflicts with 1194 the expected length (based on the attribute type code), then the 1195 Error Subcode is set to Attribute Length Error. The Data field 1196 contains the erroneous attribute (type, length and value). 1198 If any of the mandatory well-known attributes are not present, then 1199 the Error Subcode is set to Missing Well-known Attribute. The Data 1200 field contains the Attribute Type Code of the missing well-known 1201 attribute. 1203 If any of the mandatory well-known attributes are not recognized, 1204 then the Error Subcode is set to Unrecognized Well-known Attribute. 1205 The Data field contains the unrecognized attribute (type, length and 1206 value). 1208 If the ORIGIN attribute has an undefined value, then the Error 1209 Subcode is set to Invalid Origin Attribute. The Data field contains 1210 the unrecognized attribute (type, length and value). 1212 If the NEXT_HOP attribute field is syntactically incorrect, then the 1213 Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field 1214 contains the incorrect attribute (type, length and value). Syntactic 1215 correctness means that the NEXT_HOP attribute represents a valid IP 1216 host address. Semantic correctness applies only to the external BGP 1217 links. It means that the interface associated with the IP address, as 1218 specified in the NEXT_HOP attribute, shares a common subnet with the 1219 receiving BGP speaker and is not the IP address of the receiving BGP 1220 speaker. If the NEXT_HOP attribute is semantically incorrect, the 1221 error should be logged, and the the route should be ignored. In this 1222 case, no NOTIFICATION message should be sent. 1224 The AS_PATH attribute is checked for syntactic correctness. If the 1225 path is syntactically incorrect, then the Error Subcode is set to 1226 Malformed AS_PATH. 1228 The information carried by the AS_PATH attribute is checked for AS 1229 loops. AS loop detection is done by scanning the full AS path (as 1230 specified in the AS_PATH attribute), and checking that the autonomous 1231 system number of the local system does not appear in the AS path. If 1232 the autonomous system number appears in the AS path the route may be 1233 stored in the Adj-RIB-In, but unless the router is configured to 1234 accept routes with its own autonomous system in the AS path, the 1235 route shall not be passed to the BGP Decision Process. Operations of 1236 a router that is configured to accept routes with its own autonomous 1237 system number in the AS path are outside the scope of this document. 1239 If an optional attribute is recognized, then the value of this 1240 attribute is checked. If an error is detected, the attribute is 1241 discarded, and the Error Subcode is set to Optional Attribute Error. 1242 The Data field contains the attribute (type, length and value). 1244 If any attribute appears more than once in the UPDATE message, then 1245 the Error Subcode is set to Malformed Attribute List. 1247 The NLRI field in the UPDATE message is checked for syntactic 1248 validity. If the field is syntactically incorrect, then the Error 1249 Subcode is set to Invalid Network Field. 1251 6.4 NOTIFICATION message error handling. 1253 If a peer sends a NOTIFICATION message, and there is an error in that 1254 message, there is unfortunately no means of reporting this error via 1255 a subsequent NOTIFICATION message. Any such error, such as an 1256 unrecognized Error Code or Error Subcode, should be noticed, logged 1257 locally, and brought to the attention of the administration of the 1258 peer. The means to do this, however, lies outside the scope of this 1259 document. 1261 6.5 Hold Timer Expired error handling. 1263 If a system does not receive successive KEEPALIVE and/or UPDATE 1264 and/or NOTIFICATION messages within the period specified in the Hold 1265 Time field of the OPEN message, then the NOTIFICATION message with 1266 Hold Timer Expired Error Code must be sent and the BGP connection 1267 closed. 1269 6.6 Finite State Machine error handling. 1271 Any error detected by the BGP Finite State Machine (e.g., receipt of 1272 an unexpected event) is indicated by sending the NOTIFICATION message 1273 with Error Code Finite State Machine Error. 1275 6.7 Cease. 1277 In absence of any fatal errors (that are indicated in this section), 1278 a BGP peer may choose at any given time to close its BGP connection 1279 by sending the NOTIFICATION message with Error Code Cease. However, 1280 the Cease NOTIFICATION message must not be used when a fatal error 1281 indicated by this section does exist. 1283 6.8 Connection collision detection. 1285 If a pair of BGP speakers try simultaneously to establish a TCP 1286 connection to each other, then two parallel connections between this 1287 pair of speakers might well be formed. We refer to this situation as 1288 connection collision. Clearly, one of these connections must be 1289 closed. 1291 Based on the value of the BGP Identifier a convention is established 1292 for detecting which BGP connection is to be preserved when a 1293 collision does occur. The convention is to compare the BGP 1294 Identifiers of the peers involved in the collision and to retain only 1295 the connection initiated by the BGP speaker with the higher-valued 1296 BGP Identifier. 1298 Upon receipt of an OPEN message, the local system must examine all of 1299 its connections that are in the OpenConfirm state. A BGP speaker may 1300 also examine connections in an OpenSent state if it knows the BGP 1301 Identifier of the peer by means outside of the protocol. If among 1302 these connections there is a connection to a remote BGP speaker whose 1303 BGP Identifier equals the one in the OPEN message, then the local 1304 system performs the following collision resolution procedure: 1306 1. The BGP Identifier of the local system is compared to the BGP 1307 Identifier of the remote system (as specified in the OPEN 1308 message). 1310 2. If the value of the local BGP Identifier is less than the 1311 remote one, the local system closes BGP connection that already 1312 exists (the one that is already in the OpenConfirm state), and 1313 accepts BGP connection initiated by the remote system. 1315 3. Otherwise, the local system closes newly created BGP connection 1316 (the one associated with the newly received OPEN message), and 1317 continues to use the existing one (the one that is already in the 1318 OpenConfirm state). 1320 Comparing BGP Identifiers is done by treating them as (4-octet 1321 long) unsigned integers. 1323 A connection collision with an existing BGP connection that is in 1324 Established states causes unconditional closing of the newly 1325 created connection. Note that a connection collision cannot be 1326 detected with connections that are in Idle, or Connect, or Active 1327 states. 1329 Closing the BGP connection (that results from the collision 1330 resolution procedure) is accomplished by sending the NOTIFICATION 1331 message with the Error Code Cease. 1333 7. BGP Version Negotiation. 1335 BGP speakers may negotiate the version of the protocol by making 1336 multiple attempts to open a BGP connection, starting with the highest 1337 version number each supports. If an open attempt fails with an Error 1338 Code OPEN Message Error, and an Error Subcode Unsupported Version 1339 Number, then the BGP speaker has available the version number it 1340 tried, the version number its peer tried, the version number passed 1341 by its peer in the NOTIFICATION message, and the version numbers that 1342 it supports. If the two peers do support one or more common 1343 versions, then this will allow them to rapidly determine the highest 1344 common version. In order to support BGP version negotiation, future 1345 versions of BGP must retain the format of the OPEN and NOTIFICATION 1346 messages. 1348 8. BGP Finite State machine. 1350 This section specifies BGP operation in terms of a Finite State 1351 Machine (FSM). Following is a brief summary and overview of BGP 1352 operations by state as determined by this FSM. A condensed version 1353 of the BGP FSM is found in Appendix 1. 1355 Initially BGP is in the Idle state. 1357 Idle state: 1359 In this state BGP refuses all incoming BGP connections. No 1360 resources are allocated to the peer. In response to the Start 1361 event (initiated by either system or operator) the local system 1362 initializes all BGP resources, starts the ConnectRetry timer, 1363 initiates a transport connection to other BGP peer, while 1364 listening for connection that may be initiated by the remote 1365 BGP peer, and changes its state to Connect. The exact value of 1366 the ConnectRetry timer is a local matter, but should be 1367 sufficiently large to allow TCP initialization. 1369 If a BGP speaker detects an error, it shuts down the connection 1370 and changes its state to Idle. Getting out of the Idle state 1371 requires generation of the Start event. If such an event is 1372 generated automatically, then persistent BGP errors may result 1373 in persistent flapping of the speaker. To avoid such a 1374 condition it is recommended that Start events should not be 1375 generated immediately for a peer that was previously 1376 transitioned to Idle due to an error. For a peer that was 1377 previously transitioned to Idle due to an error, the time 1378 between consecutive generation of Start events, if such events 1379 are generated automatically, shall exponentially increase. The 1380 value of the initial timer shall be 60 seconds. The time shall 1381 be doubled for each consecutive retry. 1383 Any other event received in the Idle state is ignored. 1385 Connect state: 1387 In this state BGP is waiting for the transport protocol 1388 connection to be completed. 1390 If the transport protocol connection succeeds, the local system 1391 clears the ConnectRetry timer, completes initialization, sends 1392 an OPEN message to its peer, and changes its state to OpenSent. 1394 If the transport protocol connect fails (e.g., retransmission 1395 timeout), the local system restarts the ConnectRetry timer, 1396 continues to listen for a connection that may be initiated by 1397 the remote BGP peer, and changes its state to Active state. 1399 In response to the ConnectRetry timer expired event, the local 1400 system restarts the ConnectRetry timer, initiates a transport 1401 connection to other BGP peer, continues to listen for a 1402 connection that may be initiated by the remote BGP peer, and 1403 stays in the Connect state. 1405 Start event is ignored in the Active state. 1407 In response to any other event (initiated by either system or 1408 operator), the local system releases all BGP resources 1409 associated with this connection and changes its state to Idle. 1411 Active state: 1413 In this state BGP is trying to acquire a peer by initiating a 1414 transport protocol connection. 1416 If the transport protocol connection succeeds, the local system 1417 clears the ConnectRetry timer, completes initialization, sends 1418 an OPEN message to its peer, sets its Hold Timer to a large 1419 value, and changes its state to OpenSent. A Hold Timer value 1420 of 4 minutes is suggested. 1422 In response to the ConnectRetry timer expired event, the local 1423 system restarts the ConnectRetry timer, initiates a transport 1424 connection to other BGP peer, continues to listen for a 1425 connection that may be initiated by the remote BGP peer, and 1426 changes its state to Connect. 1428 If the local system detects that a remote peer is trying to 1429 establish BGP connection to it, and the IP address of the 1430 remote peer is not an expected one, the local system restarts 1431 the ConnectRetry timer, rejects the attempted connection, 1432 continues to listen for a connection that may be initiated by 1433 the remote BGP peer, and stays in the Active state. 1435 Start event is ignored in the Active state. 1437 In response to any other event (initiated by either system or 1438 operator), the local system releases all BGP resources 1439 associated with this connection and changes its state to Idle. 1441 OpenSent state: 1443 In this state BGP waits for an OPEN message from its peer. 1444 When an OPEN message is received, all fields are checked for 1445 correctness. If the BGP message header checking or OPEN 1446 message checking detects an error (see Section 6.2), or a 1447 connection collision (see Section 6.8) the local system sends a 1448 NOTIFICATION message and changes its state to Idle. 1450 If there are no errors in the OPEN message, BGP sends a 1451 KEEPALIVE message and sets a KeepAlive timer. The Hold Timer, 1452 which was originally set to a large value (see above), is 1453 replaced with the negotiated Hold Time value (see section 4.2). 1454 If the negotiated Hold Time value is zero, then the Hold Time 1455 timer and KeepAlive timers are not started. If the value of 1456 the Autonomous System field is the same as the local Autonomous 1457 System number, then the connection is an "internal" connection; 1458 otherwise, it is "external". (This will effect UPDATE 1459 processing as described below.) Finally, the state is changed 1460 to OpenConfirm. 1462 If a disconnect notification is received from the underlying 1463 transport protocol, the local system closes the BGP connection, 1464 restarts the ConnectRetry timer, while continue listening for 1465 connection that may be initiated by the remote BGP peer, and 1466 goes into the Active state. 1468 If the Hold Timer expires, the local system sends NOTIFICATION 1469 message with error code Hold Timer Expired and changes its 1470 state to Idle. 1472 In response to the Stop event (initiated by either system or 1473 operator) the local system sends NOTIFICATION message with 1474 Error Code Cease and changes its state to Idle. 1476 Start event is ignored in the OpenSent state. 1478 In response to any other event the local system sends 1479 NOTIFICATION message with Error Code Finite State Machine Error 1480 and changes its state to Idle. 1482 Whenever BGP changes its state from OpenSent to Idle, it closes 1483 the BGP (and transport-level) connection and releases all 1484 resources associated with that connection. 1486 OpenConfirm state: 1488 In this state BGP waits for a KEEPALIVE or NOTIFICATION 1489 message. 1491 If the local system receives a KEEPALIVE message, it changes 1492 its state to Established. 1494 If the Hold Timer expires before a KEEPALIVE message is 1495 received, the local system sends NOTIFICATION message with 1496 error code Hold Timer Expired and changes its state to Idle. 1498 If the local system receives a NOTIFICATION message, it changes 1499 its state to Idle. 1501 If the KeepAlive timer expires, the local system sends a 1502 KEEPALIVE message and restarts its KeepAlive timer. 1504 If a disconnect notification is received from the underlying 1505 transport protocol, the local system changes its state to Idle. 1507 In response to the Stop event (initiated by either system or 1508 operator) the local system sends NOTIFICATION message with 1509 Error Code Cease and changes its state to Idle. 1511 Start event is ignored in the OpenConfirm state. 1513 In response to any other event the local system sends 1514 NOTIFICATION message with Error Code Finite State Machine Error 1515 and changes its state to Idle. 1517 Whenever BGP changes its state from OpenConfirm to Idle, it 1518 closes the BGP (and transport-level) connection and releases 1519 all resources associated with that connection. 1521 Established state: 1523 In the Established state BGP can exchange UPDATE, NOTIFICATION, 1524 and KEEPALIVE messages with its peer. 1526 If the local system receives an UPDATE or KEEPALIVE message, it 1527 restarts its Hold Timer, if the negotiated Hold Time value is 1528 non-zero. 1530 If the local system receives a NOTIFICATION message, it changes 1531 its state to Idle. 1533 If the local system receives an UPDATE message and the UPDATE 1534 message error handling procedure (see Section 6.3) detects an 1535 error, the local system sends a NOTIFICATION message and 1536 changes its state to Idle. 1538 If a disconnect notification is received from the underlying 1539 transport protocol, the local system changes its state to Idle. 1541 If the Hold Timer expires, the local system sends a 1542 NOTIFICATION message with Error Code Hold Timer Expired and 1543 changes its state to Idle. 1545 If the KeepAlive timer expires, the local system sends a 1546 KEEPALIVE message and restarts its KeepAlive timer. 1548 Each time the local system sends a KEEPALIVE or UPDATE message, 1549 it restarts its KeepAlive timer, unless the negotiated Hold 1550 Time value is zero. 1552 In response to the Stop event (initiated by either system or 1553 operator), the local system sends a NOTIFICATION message with 1554 Error Code Cease and changes its state to Idle. 1556 Start event is ignored in the Established state. 1558 In response to any other event, the local system sends 1559 NOTIFICATION message with Error Code Finite State Machine Error 1560 and changes its state to Idle. 1562 Whenever BGP changes its state from Established to Idle, it 1563 closes the BGP (and transport-level) connection, releases all 1564 resources associated with that connection, and deletes all 1565 routes derived from that connection. 1567 9. UPDATE Message Handling 1569 An UPDATE message may be received only in the Established state. 1570 When an UPDATE message is received, each field is checked for 1571 validity as specified in Section 6.3. 1573 If an optional non-transitive attribute is unrecognized, it is 1574 quietly ignored. If an optional transitive attribute is 1575 unrecognized, the Partial bit (the third high-order bit) in the 1576 attribute flags octet is set to 1, and the attribute is retained for 1577 propagation to other BGP speakers. 1579 If an optional attribute is recognized, and has a valid value, then, 1580 depending on the type of the optional attribute, it is processed 1581 locally, retained, and updated, if necessary, for possible 1582 propagation to other BGP speakers. 1584 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 1585 the previously advertised routes whose destinations (expressed as IP 1586 prefixes) contained in this field shall be removed from the Adj-RIB- 1587 In. This BGP speaker shall run its Decision Process since the 1588 previously advertised route is not longer available for use. 1590 If the UPDATE message contains a feasible route, it shall be placed 1591 in the appropriate Adj-RIB-In, and the following additional actions 1592 shall be taken: 1594 i) If its Network Layer Reachability Information (NLRI) is identical 1595 to the one of a route currently stored in the Adj-RIB-In, then the 1596 new route shall replace the older route in the Adj-RIB-In, thus 1597 implicitly withdrawing the older route from service. The BGP speaker 1598 shall run its Decision Process since the older route is no longer 1599 available for use. 1601 ii) If the new route is an overlapping route that is included (see 1602 9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP 1603 speaker shall run its Decision Process since the more specific route 1604 has implicitly made a portion of the less specific route unavailable 1605 for use. 1607 iii) If the new route has identical path attributes to an earlier 1608 route contained in the Adj-RIB-In, and is more specific (see 9.1.4) 1609 than the earlier route, no further actions are necessary. 1611 iv) If the new route has NLRI that is not present in any of the 1612 routes currently stored in the Adj-RIB-In, then the new route shall 1613 be placed in the Adj-RIB-In. The BGP speaker shall run its Decision 1614 Process. 1616 v) If the new route is an overlapping route that is less specific 1617 (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the 1618 BGP speaker shall run its Decision Process on the set of destinations 1619 described only by the less specific route. 1621 9.1 Decision Process 1623 The Decision Process selects routes for subsequent advertisement by 1624 applying the policies in the local Policy Information Base (PIB) to 1625 the routes stored in its Adj-RIB-In. The output of the Decision 1626 Process is the set of routes that will be advertised to all peers; 1627 the selected routes will be stored in the local speaker's Adj-RIB- 1628 Out. 1630 The selection process is formalized by defining a function that takes 1631 the attribute of a given route as an argument and returns a non- 1632 negative integer denoting the degree of preference for the route. 1633 The function that calculates the degree of preference for a given 1634 route shall not use as its inputs any of the following: the 1635 existence of other routes, the non-existence of other routes, or the 1636 path attributes of other routes. Route selection then consists of 1637 individual application of the degree of preference function to each 1638 feasible route, followed by the choice of the one with the highest 1639 degree of preference. 1641 The Decision Process operates on routes contained in each Adj-RIB-In, 1642 and is responsible for: 1644 - selection of routes to be advertised to internal peers 1646 - selection of routes to be advertised to external peers 1648 - route aggregation and route information reduction 1650 The Decision Process takes place in three distinct phases, each 1651 triggered by a different event: 1653 a) Phase 1 is responsible for calculating the degree of preference 1654 for each route received from an external peer, and for advertising 1655 to the other internal peers the routes that have the highest 1656 degree of preference for each distinct destination. 1658 b) Phase 2 is invoked on completion of phase 1. It is responsible 1659 for choosing the best route out of all those available for each 1660 distinct destination, and for installing each chosen route into 1661 the appropriate Loc-RIB. 1663 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 1664 responsible for disseminating routes in the Loc-RIB to each 1665 external peer, according to the policies contained in the PIB. 1666 Route aggregation and information reduction can optionally be 1667 performed within this phase. 1669 9.1.1 Phase 1: Calculation of Degree of Preference 1671 The Phase 1 decision function shall be invoked whenever the local BGP 1672 speaker receives from an external peer an UPDATE message that 1673 advertises a new route, a replacement route, or a withdrawn route. 1675 The Phase 1 decision function is a separate process which completes 1676 when it has no further work to do. 1678 The Phase 1 decision function shall lock an Adj-RIB-In prior to 1679 operating on any route contained within it, and shall unlock it after 1680 operating on all new or unfeasible routes contained within it. 1682 For each newly received or replacement feasible route, the local BGP 1683 speaker shall determine a degree of preference. If the route is 1684 learned from an internal peer, the value of the LOCAL_PREF attribute 1685 shall be taken as the degree of preference. If the route is learned 1686 from an external peer, then the degree of preference shall be 1687 computed based on preconfigured policy information and used as the 1688 LOCAL_PREF value in any IBGP readvertisement. The exact nature of 1689 this policy information and the computation involved is a local 1690 matter. The local speaker shall then run the internal update process 1691 of 9.2.1 to select and advertise the most preferable route. 1693 9.1.2 Phase 2: Route Selection 1695 The Phase 2 decision function shall be invoked on completion of Phase 1696 1. The Phase 2 function is a separate process which completes when 1697 it has no further work to do. The Phase 2 process shall consider all 1698 routes that are present in the Adj-RIBs-In, including those received 1699 from both internal and external peers. 1701 The Phase 2 decision function shall be blocked from running while the 1702 Phase 3 decision function is in process. The Phase 2 function shall 1703 lock all Adj-RIBs-In prior to commencing its function, and shall 1704 unlock them on completion. 1706 If the NEXT_HOP attribute of a BGP route depicts an address to which 1707 the local BGP speaker doesn't have a route in its Loc-RIB, the BGP 1708 route should be excluded from the Phase 2 decision function. 1710 It is critical that routers within an AS do not make conflicting 1711 decisions regarding route selection that would cause forwarding loops 1712 to occur. 1714 For each set of destinations for which a feasible route exists in the 1715 Adj-RIBs-In, the local BGP speaker shall identify the route that has: 1717 a) the highest degree of preference of any route to the same set 1718 of destinations, or 1720 b) is the only route to that destination, or 1722 c) is selected as a result of the Phase 2 tie breaking rules 1723 specified in 9.1.2.1. 1725 The local speaker SHALL then install that route in the Loc-RIB, 1726 replacing any route to the same destination that is currently being 1727 held in the Loc-RIB. The local speaker MUST determine the immediate 1728 next hop to the address depicted by the NEXT_HOP attribute of the 1729 selected route by performing a lookup in the IGP and selecting one of 1730 the possible paths in the IGP. This immediate next hop MUST be used 1731 when installing the selected route in the Loc-RIB. If the route to 1732 the address depicted by the NEXT_HOP attribute changes such that the 1733 immediate next hop changes, route selection should be recalculated as 1734 specified above. 1736 Unfeasible routes shall be removed from the Loc-RIB, and 1737 corresponding unfeasible routes shall then be removed from the Adj- 1738 RIBs-In. 1740 9.1.2.1 Breaking Ties (Phase 2) 1742 In its Adj-RIBs-In a BGP speaker may have several routes to the same 1743 destination that have the same degree of preference. The local 1744 speaker can select only one of these routes for inclusion in the 1745 associated Loc-RIB. The local speaker considers all routes with the 1746 same degrees of preference, both those received from internal peers, 1747 and those received from external peers. 1749 The following tie-breaking procedure assumes that for each candidate 1750 route all the BGP speakers within an autonomous system can ascertain 1751 the cost of a path (interior distance) to the address depicted by the 1752 NEXT_HOP attribute of the route. 1754 The tie-breaking algorithm begins by considering all equally 1755 preferable routes and then selects routes to be removed from 1756 consideration. The algorithm terminates as soon as only one route 1757 remains in consideration. The criteria must be applied in the order 1758 specified. 1760 Several of the criteria are described using pseudo-code. Note that 1761 the pseudo-code shown was chosen for clarity, not efficiency. It is 1762 not intended to specify any particular implementation. BGP 1763 implementations MAY use any algorithm which produces the same results 1764 as those described here. 1766 a) Remove from consideration routes with less-preferred 1767 MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable 1768 between routes learned from the same neighboring AS. Routes which 1769 do not have the MULTI_EXIT_DISC attribute are considered to have 1770 the highest possible MULTI_EXIT_DISC value. 1772 This is also described in the following procedure: 1774 for m = all routes still under consideration 1775 for n = all routes still under consideration 1776 if (neighborAS(m) == neighborAS(n)) and (MED(n) < MED(m)) 1777 remove route m from consideration 1779 In the pseudo-code above, MED(n) is a function which returns the 1780 value of route n's MULTI_EXIT_DISC attribute. If route n has no 1781 MULTI_EXIT_DISC attribute, the function returns the highest 1782 possible MULTI_EXIT_DISC value, i.e. 2^32-1. 1784 Similarly, neighborAS(n) is a function which returns the neighbor 1785 AS from which the route was received. 1787 b) Remove from consideration any routes with less-preferred 1788 interior cost. The interior cost of a route is determined by 1789 calculating the metric to the next hop for the route using the 1790 interior routing protocol(s). If the next hop for a route is 1791 reachable, but no cost can be determined, then this step should be 1792 should be skipped (equivalently, consider all routes to have equal 1793 costs). 1795 This is also described in the following procedure. 1797 for m = all routes still under consideration 1798 for n = all routes in still under consideration 1799 if (cost(n) is better than cost(m)) 1800 remove m from consideration 1802 In the pseudo-code above, cost(n) is a function which returns the 1803 cost of the path (interior distance) to the address given in the 1804 NEXT_HOP attribute of the route. 1806 c) If at least one of the candidate routes was received from an 1807 external peer in a neighboring autonomous system, remove from 1808 consideration all routes which were received from internal peers. 1810 d) Remove from consideration all routes other than the route that 1811 was advertised by the BGP speaker whose BGP Identifier has the 1812 lowest value. 1814 9.1.3 Phase 3: Route Dissemination 1816 The Phase 3 decision function shall be invoked on completion of Phase 1817 2, or when any of the following events occur: 1819 a) when routes in a Loc-RIB to local destinations have changed 1821 b) when locally generated routes learned by means outside of BGP 1822 have changed 1824 c) when a new BGP speaker - BGP speaker connection has been 1825 established 1827 The Phase 3 function is a separate process which completes when it 1828 has no further work to do. The Phase 3 Routing Decision function 1829 shall be blocked from running while the Phase 2 decision function is 1830 in process. 1832 All routes in the Loc-RIB shall be processed into a corresponding 1833 entry in the associated Adj-RIBs-Out. Route aggregation and 1834 information reduction techniques (see 9.2.4.1) may optionally be 1835 applied. 1837 For the benefit of future support of inter-AS multicast capabilities, 1838 a BGP speaker that participates in inter-AS multicast routing shall 1839 advertise a route it receives from one of its external peers and if 1840 it installs it in its Loc-RIB, it shall advertise it back to the peer 1841 from which the route was received. For a BGP speaker that does not 1842 participate in inter-AS multicast routing such an advertisement is 1843 optional. When doing such an advertisement, the NEXT_HOP attribute 1844 should be set to the address of the peer. An implementation may also 1845 optimize such an advertisement by truncating information in the 1846 AS_PATH attribute to include only its own AS number and that of the 1847 peer that advertised the route (such truncation requires the ORIGIN 1848 attribute to be set to INCOMPLETE). In addition an implementation is 1849 not required to pass optional or discretionary path attributes with 1850 such an advertisement. 1852 When the updating of the Adj-RIBs-Out and the Forwarding Information 1853 Base (FIB) is complete, the local BGP speaker shall run the external 1854 update process of 9.2.2. 1856 9.1.4 Overlapping Routes 1858 A BGP speaker may transmit routes with overlapping Network Layer 1859 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 1860 occurs when a set of destinations are identified in non-matching 1861 multiple routes. Since BGP encodes NLRI using IP prefixes, overlap 1862 will always exhibit subset relationships. A route describing a 1863 smaller set of destinations (a longer prefix) is said to be more 1864 specific than a route describing a larger set of destinations (a 1865 shorted prefix); similarly, a route describing a larger set of 1866 destinations (a shorter prefix) is said to be less specific than a 1867 route describing a smaller set of destinations (a longer prefix). 1869 The precedence relationship effectively decomposes less specific 1870 routes into two parts: 1872 - a set of destinations described only by the less specific 1873 route, and 1875 - a set of destinations described by the overlap of the less 1876 specific and the more specific routes 1878 When overlapping routes are present in the same Adj-RIB-In, the more 1879 specific route shall take precedence, in order from more specific to 1880 least specific. 1882 The set of destinations described by the overlap represents a portion 1883 of the less specific route that is feasible, but is not currently in 1884 use. If a more specific route is later withdrawn, the set of 1885 destinations described by the overlap will still be reachable using 1886 the less specific route. 1888 If a BGP speaker receives overlapping routes, the Decision Process 1889 MUST consider both routes based on the configured acceptance policy. 1890 If both a less and a more specific route are accepted, then the 1891 Decision Process MUST either install both the less and the more 1892 specific routes or it MUST aggregate the two routes and install the 1893 aggregated route. 1895 If a BGP speaker chooses to aggregate, then it MUST add 1896 ATOMIC_AGGREGATE attribute to the route. A route that carries 1897 ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the 1898 NLRI of this route can not be made more specific. Forwarding along 1899 such a route does not guarantee that IP packets will actually 1900 traverse only ASs listed in the AS_PATH attribute of the route. If a 1901 BGP speaker chooses a), it must not advertise the more general route 1902 without the more specific route. 1904 9.2 Update-Send Process 1906 The Update-Send process is responsible for advertising UPDATE 1907 messages to all peers. For example, it distributes the routes chosen 1908 by the Decision Process to other BGP speakers which may be located in 1909 either the same autonomous system or a neighboring autonomous system. 1910 Rules for information exchange between BGP speakers located in 1911 different autonomous systems are given in 9.2.2; rules for 1912 information exchange between BGP speakers located in the same 1913 autonomous system are given in 9.2.1. 1915 Distribution of routing information between a set of BGP speakers, 1916 all of which are located in the same autonomous system, is referred 1917 to as internal distribution. 1919 9.2.1 Internal Updates 1921 The Internal update process is concerned with the distribution of 1922 routing information to internal peers. 1924 When a BGP speaker receives an UPDATE message from an internal peer, 1925 the receiving BGP speaker shall not re-distribute the routing 1926 information contained in that UPDATE message to other internal peers. 1928 When a BGP speaker receives a new route from an external peer, it 1929 MUST advertise that route to all other internal peers by means of an 1930 UPDATE message if this routes has been installed in its Loc-RIB 1931 according to the route selection rules in 9.1.2. 1933 When a BGP speaker receives an UPDATE message with a non-empty 1934 WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all 1935 routes whose destinations was carried in this field (as IP prefixes). 1936 The speaker shall take the following additional steps: 1938 1) if the corresponding feasible route had not been previously 1939 advertised, then no further action is necessary 1941 2) if the corresponding feasible route had been previously 1942 advertised, then: 1944 i) if a new route is selected for advertisement that has the 1945 same Network Layer Reachability Information as the unfeasible 1946 routes, then the local BGP speaker shall advertise the 1947 replacement route 1949 ii) if a replacement route is not available for advertisement, 1950 then the BGP speaker shall include the destinations of the 1951 unfeasible route (in form of IP prefixes) in the WITHDRAWN 1952 ROUTES field of an UPDATE message, and shall send this message 1953 to each peer to whom it had previously advertised the 1954 corresponding feasible route. 1956 All feasible routes which are advertised shall be placed in the 1957 appropriate Adj-RIBs-Out, and all unfeasible routes which are 1958 advertised shall be removed from the Adj-RIBs-Out. 1960 9.2.1.1 Breaking Ties (Internal Updates) 1962 If a local BGP speaker has connections to several external peers, 1963 there will be multiple Adj-RIBs-In associated with these peers. These 1964 Adj-RIBs-In might contain several equally preferable routes to the 1965 same destination, all of which were advertised by external peers. 1966 The local BGP speaker shall select one of these routes according to 1967 the following rules: 1969 a) If the candidate routes differ only in their NEXT_HOP and 1970 MULTI_EXIT_DISC attributes, and the local system is configured to 1971 take into account the MULTI_EXIT_DISC attribute, select the route 1972 that has the lowest value of the MULTI_EXIT_DISC attribute. A 1973 route with the MULTI_EXIT_DISC attribute shall be preferred to a 1974 route without the MULTI_EXIT_DISC attribute. 1976 b) If the local system can ascertain the cost of a path to the 1977 entity depicted by the NEXT_HOP attribute of the candidate route, 1978 select the route with the lowest cost. 1980 c) In all other cases, select the route that was advertised by the 1981 BGP speaker whose BGP Identifier has the lowest value. 1983 9.2.2 External Updates 1985 The external update process is concerned with the distribution of 1986 routing information to external peers. As part of Phase 3 route 1987 selection process, the BGP speaker has updated its Adj-RIBs-Out and 1988 its Forwarding Table. All newly installed routes and all newly 1989 unfeasible routes for which there is no replacement route shall be 1990 advertised to external peers by means of UPDATE message. 1992 Any routes in the Loc-RIB marked as unfeasible shall be removed. 1993 Changes to the reachable destinations within its own autonomous 1994 system shall also be advertised in an UPDATE message. 1996 9.2.3 Controlling Routing Traffic Overhead 1998 The BGP protocol constrains the amount of routing traffic (that is, 1999 UPDATE messages) in order to limit both the link bandwidth needed to 2000 advertise UPDATE messages and the processing power needed by the 2001 Decision Process to digest the information contained in the UPDATE 2002 messages. 2004 9.2.3.1 Frequency of Route Advertisement 2006 The parameter MinRouteAdvertisementInterval determines the minimum 2007 amount of time that must elapse between advertisement of routes to a 2008 particular destination from a single BGP speaker. This rate limiting 2009 procedure applies on a per-destination basis, although the value of 2010 MinRouteAdvertisementInterval is set on a per BGP peer basis. 2012 Two UPDATE messages sent from a single BGP speaker that advertise 2013 feasible routes to some common set of destinations received from 2014 external peers must be separated by at least 2015 MinRouteAdvertisementInterval. Clearly, this can only be achieved 2016 precisely by keeping a separate timer for each common set of 2017 destinations. This would be unwarranted overhead. Any technique which 2018 ensures that the interval between two UPDATE messages sent from a 2019 single BGP speaker that advertise feasible routes to some common set 2020 of destinations received from external peers will be at least 2021 MinRouteAdvertisementInterval, and will also ensure a constant upper 2022 bound on the interval is acceptable. 2024 Since fast convergence is needed within an autonomous system, this 2025 procedure does not apply for routes receives from other internal 2026 peers. To avoid long-lived black holes, the procedure does not apply 2027 to the explicit withdrawal of unfeasible routes (that is, routes 2028 whose destinations (expressed as IP prefixes) are listed in the 2029 WITHDRAWN ROUTES field of an UPDATE message). 2031 This procedure does not limit the rate of route selection, but only 2032 the rate of route advertisement. If new routes are selected multiple 2033 times while awaiting the expiration of MinRouteAdvertisementInterval, 2034 the last route selected shall be advertised at the end of 2035 MinRouteAdvertisementInterval. 2037 9.2.3.2 Frequency of Route Origination 2039 The parameter MinASOriginationInterval determines the minimum amount 2040 of time that must elapse between successive advertisements of UPDATE 2041 messages that report changes within the advertising BGP speaker's own 2042 autonomous systems. 2044 9.2.3.3 Jitter 2046 To minimize the likelihood that the distribution of BGP messages by a 2047 given BGP speaker will contain peaks, jitter should be applied to the 2048 timers associated with MinASOriginationInterval, Keepalive, and 2049 MinRouteAdvertisementInterval. A given BGP speaker shall apply the 2050 same jitter to each of these quantities regardless of the 2051 destinations to which the updates are being sent; that is, jitter 2052 will not be applied on a "per peer" basis. 2054 The amount of jitter to be introduced shall be determined by 2055 multiplying the base value of the appropriate timer by a random 2056 factor which is uniformly distributed in the range from 0.75 to 1.0. 2058 9.2.4 Efficient Organization of Routing Information 2060 Having selected the routing information which it will advertise, a 2061 BGP speaker may avail itself of several methods to organize this 2062 information in an efficient manner. 2064 9.2.4.1 Information Reduction 2066 Information reduction may imply a reduction in granularity of policy 2067 control - after information is collapsed, the same policies will 2068 apply to all destinations and paths in the equivalence class. 2070 The Decision Process may optionally reduce the amount of information 2071 that it will place in the Adj-RIBs-Out by any of the following 2072 methods: 2074 a) Network Layer Reachability Information (NLRI): 2076 Destination IP addresses can be represented as IP address 2077 prefixes. In cases where there is a correspondence between the 2078 address structure and the systems under control of an autonomous 2079 system administrator, it will be possible to reduce the size of 2080 the NLRI carried in the UPDATE messages. 2082 b) AS_PATHs: 2084 AS path information can be represented as ordered AS_SEQUENCEs or 2085 unordered AS_SETs. AS_SETs are used in the route aggregation 2086 algorithm described in 9.2.4.2. They reduce the size of the 2087 AS_PATH information by listing each AS number only once, 2088 regardless of how many times it may have appeared in multiple 2089 AS_PATHs that were aggregated. 2091 An AS_SET implies that the destinations listed in the NLRI can be 2092 reached through paths that traverse at least some of the 2093 constituent autonomous systems. AS_SETs provide sufficient 2094 information to avoid routing information looping; however their 2095 use may prune potentially feasible paths, since such paths are no 2096 longer listed individually as in the form of AS_SEQUENCEs. In 2097 practice this is not likely to be a problem, since once an IP 2098 packet arrives at the edge of a group of autonomous systems, the 2099 BGP speaker at that point is likely to have more detailed path 2100 information and can distinguish individual paths to destinations. 2102 9.2.4.2 Aggregating Routing Information 2104 Aggregation is the process of combining the characteristics of 2105 several different routes in such a way that a single route can be 2106 advertised. Aggregation can occur as part of the decision process 2107 to reduce the amount of routing information that will be placed in 2108 the Adj-RIBs-Out. 2110 Aggregation reduces the amount of information that a BGP speaker must 2111 store and exchange with other BGP speakers. Routes can be aggregated 2112 by applying the following procedure separately to path attributes of 2113 like type and to the Network Layer Reachability Information. 2115 Routes that have the following attributes shall not be aggregated 2116 unless the corresponding attributes of each route are identical: 2117 MULTI_EXIT_DISC, NEXT_HOP. 2119 Path attributes that have different type codes can not be aggregated 2120 together. Path of the same type code may be aggregated, according to 2121 the following rules: 2123 ORIGIN attribute: If at least one route among routes that are 2124 aggregated has ORIGIN with the value INCOMPLETE, then the 2125 aggregated route must have the ORIGIN attribute with the value 2126 INCOMPLETE. Otherwise, if at least one route among routes that are 2127 aggregated has ORIGIN with the value EGP, then the aggregated 2128 route must have the origin attribute with the value EGP. In all 2129 other case the value of the ORIGIN attribute of the aggregated 2130 route is INTERNAL. 2132 AS_PATH attribute: If routes to be aggregated have identical 2133 AS_PATH attributes, then the aggregated route has the same AS_PATH 2134 attribute as each individual route. 2136 For the purpose of aggregating AS_PATH attributes we model each AS 2137 within the AS_PATH attribute as a tuple , where 2138 "type" identifies a type of the path segment the AS belongs to 2139 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If the 2140 routes to be aggregated have different AS_PATH attributes, then 2141 the aggregated AS_PATH attribute shall satisfy all of the 2142 following conditions: 2144 - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH 2145 shall appear in all of the AS_PATH in the initial set of routes 2146 to be aggregated. 2148 - all tuples of the type AS_SET in the aggregated AS_PATH shall 2149 appear in at least one of the AS_PATH in the initial set (they 2150 may appear as either AS_SET or AS_SEQUENCE types). 2152 - for any tuple X of the type AS_SEQUENCE in the aggregated 2153 AS_PATH which precedes tuple Y in the aggregated AS_PATH, X 2154 precedes Y in each AS_PATH in the initial set which contains Y, 2155 regardless of the type of Y. 2157 - No tuple with the same value shall appear more than once in 2158 the aggregated AS_PATH, regardless of the tuple's type. 2160 An implementation may choose any algorithm which conforms to these 2161 rules. At a minimum a conformant implementation shall be able to 2162 perform the following algorithm that meets all of the above 2163 conditions: 2165 - determine the longest leading sequence of tuples (as defined 2166 above) common to all the AS_PATH attributes of the routes to be 2167 aggregated. Make this sequence the leading sequence of the 2168 aggregated AS_PATH attribute. 2170 - set the type of the rest of the tuples from the AS_PATH 2171 attributes of the routes to be aggregated to AS_SET, and append 2172 them to the aggregated AS_PATH attribute. 2174 - if the aggregated AS_PATH has more than one tuple with the 2175 same value (regardless of tuple's type), eliminate all, but one 2176 such tuple by deleting tuples of the type AS_SET from the 2177 aggregated AS_PATH attribute. 2179 Appendix 6, section 6.8 presents another algorithm that satisfies 2180 the conditions and allows for more complex policy configurations. 2182 ATOMIC_AGGREGATE: If at least one of the routes to be aggregated 2183 has ATOMIC_AGGREGATE path attribute, then the aggregated route 2184 shall have this attribute as well. 2186 AGGREGATOR: All AGGREGATOR attributes of all routes to be 2187 aggregated should be ignored. 2189 9.3 Route Selection Criteria 2191 Generally speaking, additional rules for comparing routes among 2192 several alternatives are outside the scope of this document. There 2193 are two exceptions: 2195 - If the local AS appears in the AS path of the new route being 2196 considered, then that new route cannot be viewed as better than 2197 any other route. If such a route were ever used, a routing loop 2198 would result. 2200 - In order to achieve successful distributed operation, only 2201 routes with a likelihood of stability can be chosen. Thus, an AS 2202 must avoid using unstable routes, and it must not make rapid 2203 spontaneous changes to its choice of route. Quantifying the terms 2204 "unstable" and "rapid" in the previous sentence will require 2205 experience, but the principle is clear. 2207 9.4 Originating BGP routes 2209 A BGP speaker may originate BGP routes by injecting routing 2210 information acquired by some other means (e.g. via an IGP) into BGP. 2211 A BGP speaker that originates BGP routes shall assign the degree of 2212 preference to these routes by passing them through the Decision 2213 Process (see Section 9.1). These routes may also be distributed to 2214 other BGP speakers within the local AS as part of the Internal update 2215 process (see Section 9.2.1). The decision whether to distribute non- 2216 BGP acquired routes within an AS via BGP or not depends on the 2217 environment within the AS (e.g. type of IGP) and should be controlled 2218 via configuration. 2220 Appendix 1. BGP FSM State Transitions and Actions. 2222 This Appendix discusses the transitions between states in the BGP FSM 2223 in response to BGP events. The following is the list of these states 2224 and events when the negotiated Hold Time value is non-zero. 2226 BGP States: 2228 1 - Idle 2229 2 - Connect 2230 3 - Active 2231 4 - OpenSent 2232 5 - OpenConfirm 2233 6 - Established 2235 BGP Events: 2237 1 - BGP Start 2238 2 - BGP Stop 2239 3 - BGP Transport connection open 2240 4 - BGP Transport connection closed 2241 5 - BGP Transport connection open failed 2242 6 - BGP Transport fatal error 2243 7 - ConnectRetry timer expired 2244 8 - Hold Timer expired 2245 9 - KeepAlive timer expired 2246 10 - Receive OPEN message 2247 11 - Receive KEEPALIVE message 2248 12 - Receive UPDATE messages 2249 13 - Receive NOTIFICATION message 2251 The following table describes the state transitions of the BGP FSM 2252 and the actions triggered by these transitions. 2254 Event Actions Message Sent Next State 2255 -------------------------------------------------------------------- 2256 Idle (1) 2257 1 Initialize resources none 2 2258 Start ConnectRetry timer 2259 Initiate a transport connection 2260 others none none 1 2262 Connect(2) 2263 1 none none 2 2264 3 Complete initialization OPEN 4 2265 Clear ConnectRetry timer 2266 5 Restart ConnectRetry timer none 3 2267 7 Restart ConnectRetry timer none 2 2268 Initiate a transport connection 2269 others Release resources none 1 2271 Active (3) 2272 1 none none 3 2273 3 Complete initialization OPEN 4 2274 Clear ConnectRetry timer 2275 5 Close connection 3 2276 Restart ConnectRetry timer 2277 7 Restart ConnectRetry timer none 2 2278 Initiate a transport connection 2279 others Release resources none 1 2281 OpenSent(4) 2282 1 none none 4 2283 4 Close transport connection none 3 2284 Restart ConnectRetry timer 2285 6 Release resources none 1 2286 10 Process OPEN is OK KEEPALIVE 5 2287 Process OPEN failed NOTIFICATION 1 2288 others Close transport connection NOTIFICATION 1 2289 Release resources 2291 OpenConfirm (5) 2292 1 none none 5 2293 4 Release resources none 1 2294 6 Release resources none 1 2295 9 Restart KeepAlive timer KEEPALIVE 5 2296 11 Complete initialization none 6 2297 Restart Hold Timer 2298 13 Close transport connection 1 2299 Release resources 2300 others Close transport connection NOTIFICATION 1 2301 Release resources 2303 Established (6) 2304 1 none none 6 2305 4 Release resources none 1 2306 6 Release resources none 1 2307 9 Restart KeepAlive timer KEEPALIVE 6 2308 11 Restart Hold Timer KEEPALIVE 6 2309 12 Process UPDATE is OK UPDATE 6 2310 Process UPDATE failed NOTIFICATION 1 2311 13 Close transport connection 1 2312 Release resources 2313 others Close transport connection NOTIFICATION 1 2314 Release resources 2315 --------------------------------------------------------------------- 2317 The following is a condensed version of the above state transition 2318 table. 2320 Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab 2321 | (1) | (2) | (3) | (4) | (5) | (6) 2322 |--------------------------------------------------------------- 2323 1 | 2 | 2 | 3 | 4 | 5 | 6 2324 | | | | | | 2325 2 | 1 | 1 | 1 | 1 | 1 | 1 2326 | | | | | | 2327 3 | 1 | 4 | 4 | 1 | 1 | 1 2328 | | | | | | 2329 4 | 1 | 1 | 1 | 3 | 1 | 1 2330 | | | | | | 2331 5 | 1 | 3 | 3 | 1 | 1 | 1 2332 | | | | | | 2333 6 | 1 | 1 | 1 | 1 | 1 | 1 2334 | | | | | | 2335 7 | 1 | 2 | 2 | 1 | 1 | 1 2336 | | | | | | 2337 8 | 1 | 1 | 1 | 1 | 1 | 1 2338 | | | | | | 2339 9 | 1 | 1 | 1 | 1 | 5 | 6 2340 | | | | | | 2341 10 | 1 | 1 | 1 | 1 or 5 | 1 | 1 2342 | | | | | | 2343 11 | 1 | 1 | 1 | 1 | 6 | 6 2344 | | | | | | 2345 12 | 1 | 1 | 1 | 1 | 1 | 1 or 6 2346 | | | | | | 2347 13 | 1 | 1 | 1 | 1 | 1 | 1 2348 | | | | | | 2349 --------------------------------------------------------------- 2351 Appendix 2. Comparison with RFC1267 2353 BGP-4 is capable of operating in an environment where a set of 2354 reachable destinations may be expressed via a single IP prefix. The 2355 concept of network classes, or subnetting is foreign to BGP-4. To 2356 accommodate these capabilities BGP-4 changes semantics and encoding 2357 associated with the AS_PATH attribute. New text has been added to 2358 define semantics associated with IP prefixes. These abilities allow 2359 BGP-4 to support the proposed supernetting scheme [9]. 2361 To simplify configuration this version introduces a new attribute, 2362 LOCAL_PREF, that facilitates route selection procedures. 2364 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 2365 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 2366 certain aggregates are not de-aggregated. Another new attribute, 2367 AGGREGATOR, can be added to aggregate routes in order to advertise 2368 which AS and which BGP speaker within that AS caused the aggregation. 2370 To insure that Hold Timers are symmetric, the Hold Time is now 2371 negotiated on a per-connection basis. Hold Times of zero are now 2372 supported. 2374 Appendix 3. Comparison with RFC 1163 2376 All of the changes listed in Appendix 2, plus the following. 2378 To detect and recover from BGP connection collision, a new field (BGP 2379 Identifier) has been added to the OPEN message. New text (Section 2380 6.8) has been added to specify the procedure for detecting and 2381 recovering from collision. 2383 The new document no longer restricts the border router that is passed 2384 in the NEXT_HOP path attribute to be part of the same Autonomous 2385 System as the BGP Speaker. 2387 New document optimizes and simplifies the exchange of the information 2388 about previously reachable routes. 2390 Appendix 4. Comparison with RFC 1105 2392 All of the changes listed in Appendices 2 and 3, plus the following. 2394 Minor changes to the RFC1105 Finite State Machine were necessary to 2395 accommodate the TCP user interface provided by 4.3 BSD. 2397 The notion of Up/Down/Horizontal relations present in RFC1105 has 2398 been removed from the protocol. 2400 The changes in the message format from RFC1105 are as follows: 2402 1. The Hold Time field has been removed from the BGP header and 2403 added to the OPEN message. 2405 2. The version field has been removed from the BGP header and 2406 added to the OPEN message. 2408 3. The Link Type field has been removed from the OPEN message. 2410 4. The OPEN CONFIRM message has been eliminated and replaced with 2411 implicit confirmation provided by the KEEPALIVE message. 2413 5. The format of the UPDATE message has been changed 2414 significantly. New fields were added to the UPDATE message to 2415 support multiple path attributes. 2417 6. The Marker field has been expanded and its role broadened to 2418 support authentication. 2420 Note that quite often BGP, as specified in RFC 1105, is referred 2421 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 2422 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 2423 BGP, as specified in this document is referred to as BGP-4. 2425 Appendix 5. TCP options that may be used with BGP 2427 If a local system TCP user interface supports TCP PUSH function, then 2428 each BGP message should be transmitted with PUSH flag set. Setting 2429 PUSH flag forces BGP messages to be transmitted promptly to the 2430 receiver. 2432 If a local system TCP user interface supports setting precedence for 2433 TCP connection, then the BGP transport connection should be opened 2434 with precedence set to Internetwork Control (110) value (see also 2435 [6]). 2437 Appendix 6. Implementation Recommendations 2439 This section presents some implementation recommendations. 2441 6.1 Multiple Networks Per Message 2443 The BGP protocol allows for multiple address prefixes with the same 2444 AS path and next-hop gateway to be specified in one message. Making 2445 use of this capability is highly recommended. With one address prefix 2446 per message there is a substantial increase in overhead in the 2447 receiver. Not only does the system overhead increase due to the 2448 reception of multiple messages, but the overhead of scanning the 2449 routing table for updates to BGP peers and other routing protocols 2450 (and sending the associated messages) is incurred multiple times as 2451 well. One method of building messages containing many address 2452 prefixes per AS path and gateway from a routing table that is not 2453 organized per AS path is to build many messages as the routing table 2454 is scanned. As each address prefix is processed, a message for the 2455 associated AS path and gateway is allocated, if it does not exist, 2456 and the new address prefix is added to it. If such a message exists, 2457 the new address prefix is just appended to it. If the message lacks 2458 the space to hold the new address prefix, it is transmitted, a new 2459 message is allocated, and the new address prefix is inserted into the 2460 new message. When the entire routing table has been scanned, all 2461 allocated messages are sent and their resources released. Maximum 2462 compression is achieved when all the destinations covered by the 2463 address prefixes share a gateway and common path attributes, making 2464 it possible to send many address prefixes in one 4096-byte message. 2466 When peering with a BGP implementation that does not compress 2467 multiple address prefixes into one message, it may be necessary to 2468 take steps to reduce the overhead from the flood of data received 2469 when a peer is acquired or a significant network topology change 2470 occurs. One method of doing this is to limit the rate of updates. 2471 This will eliminate the redundant scanning of the routing table to 2472 provide flash updates for BGP peers and other routing protocols. A 2473 disadvantage of this approach is that it increases the propagation 2474 latency of routing information. By choosing a minimum flash update 2475 interval that is not much greater than the time it takes to process 2476 the multiple messages this latency should be minimized. A better 2477 method would be to read all received messages before sending updates. 2479 6.2 Processing Messages on a Stream Protocol 2481 BGP uses TCP as a transport mechanism. Due to the stream nature of 2482 TCP, all the data for received messages does not necessarily arrive 2483 at the same time. This can make it difficult to process the data as 2484 messages, especially on systems such as BSD Unix where it is not 2485 possible to determine how much data has been received but not yet 2486 processed. 2488 One method that can be used in this situation is to first try to read 2489 just the message header. For the KEEPALIVE message type, this is a 2490 complete message; for other message types, the header should first be 2491 verified, in particular the total length. If all checks are 2492 successful, the specified length, minus the size of the message 2493 header is the amount of data left to read. An implementation that 2494 would "hang" the routing information process while trying to read 2495 from a peer could set up a message buffer (4096 bytes) per peer and 2496 fill it with data as available until a complete message has been 2497 received. 2499 6.3 Reducing route flapping 2501 To avoid excessive route flapping a BGP speaker which needs to 2502 withdraw a destination and send an update about a more specific or 2503 less specific route SHOULD combine them into the same UPDATE message. 2505 6.4 BGP Timers 2507 BGP employs five timers: ConnectRetry, Hold Time, KeepAlive, 2508 MinASOriginationInterval, and MinRouteAdvertisementInterval The 2509 suggested value for the ConnectRetry timer is 120 seconds. The 2510 suggested value for the Hold Time is 90 seconds. The suggested value 2511 for the KeepAlive timer is 30 seconds. The suggested value for the 2512 MinASOriginationInterval is 15 seconds. The suggested value for the 2513 MinRouteAdvertisementInterval is 30 seconds. 2515 An implementation of BGP MUST allow these timers to be configurable. 2517 6.5 Path attribute ordering 2519 Implementations which combine update messages as described above in 2520 6.1 may prefer to see all path attributes presented in a known order. 2521 This permits them to quickly identify sets of attributes from 2522 different update messages which are semantically identical. To 2523 facilitate this, it is a useful optimization to order the path 2524 attributes according to type code. This optimization is entirely 2525 optional. 2527 6.6 AS_SET sorting 2529 Another useful optimization that can be done to simplify this 2530 situation is to sort the AS numbers found in an AS_SET. This 2531 optimization is entirely optional. 2533 6.7 Control over version negotiation 2535 Since BGP-4 is capable of carrying aggregated routes which cannot be 2536 properly represented in BGP-3, an implementation which supports BGP-4 2537 and another BGP version should provide the capability to only speak 2538 BGP-4 on a per-peer basis. 2540 6.8 Complex AS_PATH aggregation 2542 An implementation which chooses to provide a path aggregation 2543 algorithm which retains significant amounts of path information may 2544 wish to use the following procedure: 2546 For the purpose of aggregating AS_PATH attributes of two routes, 2547 we model each AS as a tuple , where "type" identifies 2548 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 2549 AS_SET), and "value" is the AS number. Two ASs are said to be the 2550 same if their corresponding tuples are the same. 2552 The algorithm to aggregate two AS_PATH attributes works as 2553 follows: 2555 a) Identify the same ASs (as defined above) within each AS_PATH 2556 attribute that are in the same relative order within both 2557 AS_PATH attributes. Two ASs, X and Y, are said to be in the 2558 same order if either: 2559 - X precedes Y in both AS_PATH attributes, or - Y precedes X 2560 in both AS_PATH attributes. 2562 b) The aggregated AS_PATH attribute consists of ASs identified 2563 in (a) in exactly the same order as they appear in the AS_PATH 2564 attributes to be aggregated. If two consecutive ASs identified 2565 in (a) do not immediately follow each other in both of the 2566 AS_PATH attributes to be aggregated, then the intervening ASs 2567 (ASs that are between the two consecutive ASs that are the 2568 same) in both attributes are combined into an AS_SET path 2569 segment that consists of the intervening ASs from both AS_PATH 2570 attributes; this segment is then placed in between the two 2571 consecutive ASs identified in (a) of the aggregated attribute. 2572 If two consecutive ASs identified in (a) immediately follow 2573 each other in one attribute, but do not follow in another, then 2574 the intervening ASs of the latter are combined into an AS_SET 2575 path segment; this segment is then placed in between the two 2576 consecutive ASs identified in (a) of the aggregated attribute. 2578 If as a result of the above procedure a given AS number appears 2579 more than once within the aggregated AS_PATH attribute, all, but 2580 the last instance (rightmost occurrence) of that AS number should 2581 be removed from the aggregated AS_PATH attribute. 2583 References 2585 [1] Mills, D., "Exterior Gateway Protocol Formal Specification", RFC 2586 904, BBN, April 1984. 2588 [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET 2589 Backbone", RFC 1092, T.J. Watson Research Center, February 1989. 2591 [3] Braun, H-W., "The NSFNET Routing Architecture", RFC 1093, 2592 MERIT/NSFNET Project, February 1989. 2594 [4] Postel, J., "Transmission Control Protocol - DARPA Internet 2595 Program Protocol Specification", RFC 793, DARPA, September 1981. 2597 [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway 2598 Protocol in the Internet", T.J. Watson Research Center, IBM Corp., 2599 MCI, Internet Draft. 2601 [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol 2602 Specification", RFC 791, DARPA, September 1981. 2604 [7] "Information Processing Systems - Telecommunications and 2605 Information Exchange between Systems - Protocol for Exchange of 2606 Inter-domain Routeing Information among Intermediate Systems to 2607 Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 2609 [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter- 2610 Domain Routing (CIDR): an Address Assignment and Aggregation 2611 Strategy", RFC 1519, BARRNet, cisco, MERIT, OARnet, September 1993 2613 [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation 2614 with CIDR", RFC 1518, T.J. Watson Research Center, cisco, September 2615 1993 2617 Security Considerations 2619 Security issues are not discussed in this document. 2621 Editors' Addresses 2623 Yakov Rekhter 2624 cisco Systems, Inc. 2625 170 W. Tasman Dr. 2626 San Jose, CA 95134 2627 email: yakov@cisco.com 2629 Tony Li 2630 Juniper Networks, Inc. 2631 3260 Jay St. 2632 Santa Clara, CA 95051 2633 (408) 327-1906 2634 email: tli@juniper.net