idnits 2.17.1 draft-ietf-bgp-bgp4-03.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-25) 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 document type: Expected "INTERNET-DRAFT" in the upper left hand corner of the first page ** 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. ** Expected the document's filename to be given on the first page, but didn't find any ** 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 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 10 instances of too long lines in the document, the longest one being 4 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. Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 89 has weird spacing: '...speaker adver...' == Line 684 has weird spacing: '... Length are t...' == Line 1098 has weird spacing: '...is less than...' == Line 1573 has weird spacing: '...s whose desti...' == Line 1993 has weird spacing: '...nations of th...' == (2 more instances...) == Couldn't figure out when the document was first submitted -- there may comments or warnings related to the use of a disclaimer for pre-RFC5378 work that could not be issued because of this. Please check the Legal Provisions document at https://trustee.ietf.org/license-info to determine if you need the pre-RFC5378 disclaimer. -- The document date (August 1992) is 11576 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: '9' is mentioned on line 2405, but not defined ** 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) ** Obsolete normative reference: RFC 1268 (ref. '5') (Obsoleted by RFC 1655) -- Possible downref: Non-RFC (?) normative reference: ref. '7' -- Possible downref: Non-RFC (?) normative reference: ref. '8' Summary: 18 errors (**), 0 flaws (~~), 10 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Y. Rekhter 3 Request for Comments: DRAFT T.J. Watson Research Center, IBM Corp. 4 T.Li 5 cisco Systems 6 Editors 7 August 1992 9 A Border Gateway Protocol 4 (BGP-4) 11 Status of this Memo 13 This document, together with its companion document, "Application of 14 the Border Gateway Protocol in the Internet", define an inter- 15 autonomous system routing protocol for the Internet. This RFC 16 specifies an IAB standards track protocol for the Internet community, 17 and requests discussion and suggestions for improvements. Please 18 refer to the current edition of the "IAB Official Protocol Standards" 19 for the standardization state and status of this protocol. 20 Distribution of this document is unlimited. 22 This document is an Internet Draft. Internet Drafts are working 23 documents of the Internet Engineering Task Force (IETF), its Areas, 24 and its Working Groups. Note that other groups may also distribute 25 working documents as Internet Drafts. 27 Internet Drafts are draft documents valid for a maximum of six 28 months. Internet Drafts may be updated, replaced, or obsoleted by 29 other documents at any time. It is not appropriate to use Internet 30 Drafts as reference material or to cite them other than as a "working 31 draft" or "work in progress". 33 1. Acknowledgements 35 This document was originally published as RFC 1267 in October 1991, 36 jointly authored by Kirk Lougheed (cisco Systems) and Yakov Rekhter 37 (IBM). 39 We would like to express our thanks to Guy Almes (Rice University), 40 Len Bosack (cisco Systems), and Jeffrey C. Honig (Cornell University) 41 for their contributions to the earlier version of this document. 43 We like to explicitly thank Bob Braden (ISI) for the review of the 44 earlier version of this document as well as his constructive and 45 valuable comments. 47 RFC DRAFT August 1992 49 We would also like to thank Bob Hinden, Director for Routing of the 50 Internet Engineering Steering Group, and the team of reviewers he 51 assembled to review earlier versions of this document. This team, 52 consisting of Deborah Estrin, Milo Medin, John Moy, Radia Perlman, 53 Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted with a 54 strong combination of toughness, professionalism, and courtesy. 56 This updated version of the document is the product of the IETF BGP 57 Working Group with Yakov Rekhter and Tony Li as editors. Certain 58 sections of the document borrowed heavily from IDRP [7], which is the 59 OSI counterpart of BGP. For this credit should be given to the ANSI 60 X3S3.3 group chaired by Lyman Chapin (BBN) and to Charles Kunzinger 61 (IBM Corp.) who is the IDRP editor within that group. We would also 62 like to thank Mike Craren (Proteon, Inc.), Dimitry Haskin (BBN) and 63 Dennis Ferguson (University of Toronto) for their insightful 64 comments. 66 2. Introduction 68 The Border Gateway Protocol (BGP) is an inter-Autonomous System 69 routing protocol. It is built on experience gained with EGP as 70 defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as 71 described in RFC 1092 [2] and RFC 1093 [3]. 73 The primary function of a BGP speaking system is to exchange network 74 reachability information with other BGP systems. This network 75 reachability information includes information on the list of 76 Autonomous Systems (ASs) that reachability information traverses. 77 This information is sufficient to construct a graph of AS 78 connectivity from which routing loops may be pruned and some policy 79 decisions at the AS level may be enforced. 81 BGP-4 provides a new set of mechanisms for supporting classless 82 interdomain routing. These mechanisms include support for 83 advertising an IP prefix and eliminates the concept of network 84 "class" within BGP. BGP-4 also introduces mechanisms which allow 85 aggregation of routes, including aggregation of AS paths. These 86 changes provide support for the proposed supernetting scheme [8]. 88 To characterize the set of policy decisions that can be enforced 89 using BGP, one must focus on the rule that a BGP speaker advertise 90 to its peer in neighbor ASs only those routes that it itself uses. 91 This rule reflects the "hop-by-hop" routing paradigm generally used 92 throughout the current Internet. Note that some policies cannot be 93 supported by the "hop-by-hop" routing paradigm and thus require 94 techniques such as source routing to enforce. For example, BGP does 95 not enable one AS to send traffic to a neighboring AS intending that 97 RFC DRAFT August 1992 99 the traffic take a different route from that taken by traffic 100 originating in the neighboring AS. On the other hand, BGP can 101 support any policy conforming to the "hop-by-hop" routing paradigm. 102 Since the current Internet uses only the "hop-by-hop" routing 103 paradigm and since BGP can support any policy that conforms to that 104 paradigm, BGP is highly applicable as an inter-AS routing protocol 105 for the current Internet. 107 A more complete discussion of what policies can and cannot be 108 enforced with BGP is outside the scope of this document (but refer to 109 the companion document discussing BGP usage [5]). 111 BGP runs over a reliable transport protocol. This eliminates the 112 need to implement explicit update fragmentation, retransmission, 113 acknowledgement, and sequencing. Any authentication scheme used by 114 the transport protocol may be used in addition to BGP's own 115 authentication mechanisms. The error notification mechanism used in 116 BGP assumes that the transport protocol supports a "graceful" close, 117 i.e., that all outstanding data will be delivered before the 118 connection is closed. 120 BGP uses TCP [4] as its transport protocol. TCP meets BGP's 121 transport requirements and is present in virtually all commercial 122 routers and hosts. In the following descriptions the phrase 123 "transport protocol connection" can be understood to refer to a TCP 124 connection. BGP uses TCP port 179 for establishing its connections. 126 This memo uses the term `Autonomous System' (AS) throughout. The 127 classic definition of an Autonomous System is a set of routers under 128 a single technical administration, using an interior gateway protocol 129 and common metrics to route packets within the AS, and using an 130 exterior gateway protocol to route packets to other ASs. Since this 131 classic definition was developed, it has become common for a single 132 AS to use several interior gateway protocols and sometimes several 133 sets of metrics within an AS. The use of the term Autonomous System 134 here stresses the fact that, even when multiple IGPs and metrics are 135 used, the administration of an AS appears to other ASs to have a 136 single coherent interior routing plan and presents a consistent 137 picture of what networks are reachable through it. 139 The planned use of BGP in the Internet environment, including such 140 issues as topology, the interaction between BGP and IGPs, and the 141 enforcement of routing policy rules is presented in a companion 142 document [5]. This document is the first of a series of documents 143 planned to explore various aspects of BGP application. Please send 144 comments to the BGP mailing list (iwg@rice.edu). 146 RFC DRAFT August 1992 148 3. Summary of Operation 150 Two systems form a transport protocol connection between one another. 151 They exchange messages to open and confirm the connection parameters. 152 The initial data flow is the entire BGP routing table. Incremental 153 updates are sent as the routing tables change. BGP does not require 154 periodic refresh of the entire BGP routing table. Therefore, a BGP 155 speaker must retain the current version of the entire BGP routing 156 tables of all of its peers for the duration of the connection. 157 KeepAlive messages are sent periodically to ensure the liveness of 158 the connection. Notification messages are sent in response to errors 159 or special conditions. If a connection encounters an error 160 condition, a notification message is sent and the connection is 161 closed. 163 The hosts executing the Border Gateway Protocol need not be routers. 164 A non-routing host could exchange routing information with routers 165 via EGP or even an interior routing protocol. That non-routing host 166 could then use BGP to exchange routing information with a border 167 router in another Autonomous System. The implications and 168 applications of this architecture are for further study. 170 If a particular AS has multiple BGP speakers and is providing transit 171 service for other ASs, then care must be taken to ensure a consistent 172 view of routing within the AS. A consistent view of the interior 173 routes of the AS is provided by the interior routing protocol. A 174 consistent view of the routes exterior to the AS can be provided by 175 having all BGP speakers within the AS maintain direct BGP connections 176 with each other. Using a common set of policies, the BGP speakers 177 arrive at an agreement as to which border routers will serve as 178 exit/entry points for particular networks outside the AS. This 179 information is communicated to the AS's internal routers, possibly 180 via the interior routing protocol. Care must be taken to ensure that 181 the interior routers have all been updated with transit information 182 before the BGP speakers announce to other ASs that transit service is 183 being provided. 185 Connections between BGP speakers of different ASs are referred to as 186 "external" links. BGP connections between BGP speakers within the 187 same AS are referred to as "internal" links. 189 3.1 Routes: Advertisement and Storage 191 For purposes of this protocol a route is defined as a unit of 192 information that pairs a destination with the attributes of a path to 193 that destination: 195 - Routes are advertised between a pair of BGP speakers in UPDATE 197 RFC DRAFT August 1992 199 messages: the destination is the systems whose IP addresses are 200 reported in the Network Layer Reachability Information (NLRI) 201 field, and the the path is the information reported in the path 202 attributes fields of the same UPDATE message. 204 - Routes are stored in the Routing Information Bases (RIBs): 205 namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes 206 that will be advertised to other BGP speakers must be present in 207 the Adj-RIB-Out; routes that will be used by the local BGP speaker 208 must be present in the Loc-RIB, and the next hop for each of these 209 routes must be present in the local BGP speaker's forwarding 210 information base; and routes that are received from other BGP 211 speakers are present in the Adj-RIBs-In. 213 If a BGP speaker chooses to advertise the route, it may add to or 214 modify the path attributes of the route before advertising it to 215 adjacent BGP speaker. 217 BGP provides mechanisms by which a BGP speaker can inform its 218 neighbor that a previously advertised route is no longer available 219 for use. There are three methods by which a given BGP speaker can 220 indicate that a route has been withdrawn from service: 222 a) the IP prefix that expresses destinations for a previously 223 advertised route can be advertised in the WITHDRAWN ROUTES field 224 in the UPDATE message, thus marking the associated route as being 225 no longer available for use 227 b) a replacement route with the same Network Layer Reachability 228 Information can be advertised, or 230 c) the BGP speaker - BGP speaker connection can be closed, which 231 implicitly removes from service all routes which the pair of 232 speakers had advertised to each other. 234 3.2 Routing Information Bases 236 The Routing Information Base (RIB) within a BGP speaker consists of 237 three distinct parts: 239 a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has 240 been learned from inbound UPDATE messages. Their contents 241 represent routes that are available as an input to the Decision 242 Process. 244 RFC DRAFT August 1992 246 b) Loc-RIB: The Loc-RIB contains the local routing information 247 that the BGP speaker has selected by applying its local policies 248 to the routing information contained in its Adj-RIBs-In. 250 c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the 251 local BGP speaker has selected for advertisement to its neighbors. 252 The routing information stored in the Adj-RIBs-Out will be carried 253 in the local BGP speaker's UPDATE messages and advertised to its 254 neighbor BGP speakers. 256 In summary, the Adj-RIBs-In contain unprocessed routing information 257 that has been advertised to the local BGP speaker by its neighbors; 258 the Loc-RIB contains the routes that have been selected by the local 259 BGP speaker's Decision Process; and the Adj-RIBs-Out organize the 260 routes for advertisement to specific neighbor BGP speakers by means 261 of the local speaker's UPDATE messages. 263 Although the conceptual model distinguishes between Adj-RIBs-In, 264 Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an 265 implementation must maintain three separate copies of the routing 266 information. The choice of implementation (for example, 3 copies of 267 the information vs 1 copy with pointers) is not constrained by the 268 protocol. 270 4. Message Formats 272 This section describes message formats used by BGP. 274 Messages are sent over a reliable transport protocol connection. A 275 message is processed only after it is entirely received. The maximum 276 message size is 4096 octets. All implementations are required to 277 support this maximum message size. The smallest message that may be 278 sent consists of a BGP header without a data portion, or 19 octets. 280 4.1 Message Header Format 282 Each message has a fixed-size header. There may or may not be a data 283 portion following the header, depending on the message type. The 284 layout of these fields is shown below: 286 RFC DRAFT August 1992 288 0 1 2 3 289 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 290 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 291 | | 292 + + 293 | | 294 + + 295 | Marker | 296 + + 297 | | 298 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 299 | Length | Type | 300 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 302 Marker: 304 This 16-octet field contains a value that the receiver of the 305 message can predict. If the Type of the message is OPEN, or if 306 the Authentication Code used in the OPEN message of the 307 connection is zero, then the Marker must be all ones. 308 Otherwise, the value of the marker can be predicted by some a 309 computation specified as part of the authentication mechanism 310 used. The Marker can be used to detect loss of synchronization 311 between a pair of BGP peers, and to authenticate incoming BGP 312 messages. 314 Length: 316 This 2-octet unsigned integer indicates the total length of the 317 message, including the header, in octets. Thus, e.g., it 318 allows one to locate in the transport-level stream the (Marker 319 field of the) next message. The value of the Length field must 320 always be at least 19 and no greater than 4096, and may be 321 further constrained, depending on the message type. No 322 "padding" of extra data after the message is allowed, so the 323 Length field must have the smallest value required given the 324 rest of the message. 326 Type: 328 This 1-octet unsigned integer indicates the type code of the 329 message. The following type codes are defined: 331 1 - OPEN 332 2 - UPDATE 333 3 - NOTIFICATION 335 RFC DRAFT August 1992 337 4 - KEEPALIVE 339 4.2 OPEN Message Format 341 After a transport protocol connection is established, the first 342 message sent by each side is an OPEN message. If the OPEN message is 343 acceptable, a KEEPALIVE message confirming the OPEN is sent back. 344 Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION 345 messages may be exchanged. 347 In addition to the fixed-size BGP header, the OPEN message contains 348 the following fields: 350 0 1 2 3 351 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 352 +-+-+-+-+-+-+-+-+ 353 | Version | 354 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 355 | My Autonomous System | 356 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 357 | Hold Time | 358 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 359 | BGP Identifier | 360 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 361 | Auth. Code | 362 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 363 | | 364 | Authentication Data | 365 | | 366 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 368 Version: 370 This 1-octet unsigned integer indicates the protocol version 371 number of the message. The current BGP version number is 4. 373 My Autonomous System: 375 This 2-octet unsigned integer indicates the Autonomous System 376 number of the sender. 378 RFC DRAFT August 1992 380 Hold Time: 382 This 2-octet unsigned integer indicates the maximum number of 383 seconds that may elapse between the receipt of successive 384 KEEPALIVE and/or UPDATE and/or NOTIFICATION messages by the sender, 385 before the sender will declare the receiver as down. 387 BGP Identifier: 388 This 4-octet unsigned integer indicates the BGP Identifier of 389 the sender. A given BGP speaker sets the value of its BGP 390 Identifier to an IP address assigned to that BGP speaker. 391 The value of the BGP Identifier is determined on startup 392 and is the same for every local interface and every BGP peer. 394 Authentication Code: 396 This 1-octet unsigned integer indicates the authentication 397 mechanism being used. Whenever an authentication mechanism is 398 specified for use within BGP, three things must be included in the 399 specification: 400 - the value of the Authentication Code which indicates use of 401 the mechanism, 402 - the form and meaning of the Authentication Data, and 403 - the algorithm for computing values of Marker fields. 404 Only one authentication mechanism is specified as part of this 405 memo: 406 - its Authentication Code is zero, 407 - its Authentication Data must be empty (of zero length), and 408 - the Marker fields of all messages must be all ones. 409 The semantics of non-zero Authentication Codes lies outside the 410 scope of this memo. 412 Note that a separate authentication mechanism may be used in 413 establishing the transport level connection. 415 Authentication Data: 417 The form and meaning of this field is a variable-length field 418 depend on the Authentication Code. If the value of Authentication 419 Code field is zero, the Authentication Data field must have zero 420 length. The semantics of the non-zero length Authentication Data 421 field is outside the scope of this memo. 423 Note that the length of the Authentication Data field can be 424 determined from the message Length field by the formula: 426 Message Length = 29 + Authentication Data Length 428 RFC DRAFT August 1992 430 The minimum length of the OPEN message is 29 octets (including 431 message header). 433 4.3 UPDATE Message Format 435 UPDATE messages are used to transfer routing information between BGP 436 peers. The information in the UPDATE packet can be used to construct 437 a graph describing the relationships of the various Autonomous 438 Systems. By applying rules to be discussed, routing information 439 loops and some other anomalies may be detected and removed from 440 inter-AS routing. 442 An UPDATE message is used advertise a single feasible route to a 443 neighboring BGP speaker, or to withdraw multiple unfeasible routes 444 from service (see 3.1). An UPDATE message may simultaneously advertise 445 a feasible route and withdraw multiple unfeasible routes from service. 446 The UPDATE message always includes the fixed-size BGP header, 447 and can optionally include the other fields as shown below: 449 +-----------------------------------------------------+ 450 | Unfeasible Routes Length (2 octets) | 451 +-----------------------------------------------------+ 452 | Withdrawn Routes (variable) | 453 +-----------------------------------------------------+ 454 | Total Path Attribute Length (2 octets) | 455 +-----------------------------------------------------+ 456 | Path Attributes (variable) | 457 +-----------------------------------------------------+ 458 | Network Layer Reachability Information (variable) | 459 +-----------------------------------------------------+ 461 Unfeasible Routes Length: 463 This 2-octets unsigned integer indicates the total length of 464 the Withdrawn Routes field in octets. Its value must allow the 465 length of the Network Layer Reachability Information field to 466 be determined as specified below. 468 A value of 0 indicates that no routes are being withdrawn from 469 service, and that the WITHDRAWN ROUTES field is not present in 470 this UPDATE message. 472 Withdrawn Routes: 474 RFC DRAFT August 1992 476 This is a variable length field that contains a list of IP 477 address prefixes for the routes that are being withdrawn from 478 service. Each IP address prefix is encoded as a 2-tuple of the 479 form , whose fields are described below: 481 +---------------------------+ 482 | Length (1 octet) | 483 +---------------------------+ 484 | Prefix (variable) | 485 +---------------------------+ 487 The use and the meaning of these fields are as follows: 489 a) Length: 491 The Length field indicates the length in bits of the IP 492 address prefix. A length of zero indicates a prefix that 493 matches all IP addresses (with prefix, itself, of zero 494 octets). 496 b) Prefix: 498 The Prefix field contains IP address prefixes followed by 499 enough trailing bits to make the end of the field fall on an 500 octet boundary. Note that the value of trailing bits is 501 irrelevant. 503 Total Path Attribute Length: 505 This 2-octet unsigned integer indicates the total length of the 506 Path Attributes field in octets. Its value must allow the 507 length of the Network Layer Reachability field to be determined 508 as specified below. 510 A value of 0 indicates that no Network Layer Reachability 511 Information field is present in this UPDATE message. 513 Path Attributes: 515 A variable length sequence of path attributes is present in 516 every UPDATE. Each path attribute is a triple of variable length. 519 Attribute Type is a two-octet field that consists of the 520 Attribute Flags octet followed by the Attribute Type Code 521 octet. 523 RFC DRAFT August 1992 525 0 1 526 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 527 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 528 | Attr. Flags |Attr. Type Code| 529 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 531 The high-order bit (bit 0) of the Attribute Flags octet is the 532 Optional bit. It defines whether the attribute is optional (if 533 set to 1) or well-known (if set to 0). 535 The second high-order bit (bit 1) of the Attribute Flags octet 536 is the Transitive bit. It defines whether an optional 537 attribute is transitive (if set to 1) or non-transitive (if set 538 to 0). For well-known attributes, the Transitive bit must be 539 set to 1. (See Section 5 for a discussion of transitive 540 attributes.) 542 The third high-order bit (bit 2) of the Attribute Flags octet 543 is the Partial bit. It defines whether the information 544 contained in the optional transitive attribute is partial (if 545 set to 1) or complete (if set to 0). For well-known attributes 546 and for optional non-transitive attributes the Partial bit must 547 be set to 0. 549 The fourth high-order bit (bit 3) of the Attribute Flags octet 550 is the Extended Length bit. It defines whether the Attribute 551 Length is one octet (if set to 0) or two octets (if set to 1). 552 Extended Length may be used only if the length of the attribute 553 value is greater than 255 octets. 555 The lower-order four bits of the Attribute Flags octet are . 556 unused. They must be zero (and must be ignored when received). 558 The Attribute Type Code octet contains the Attribute Type Code. 559 Currently defined Attribute Type Codes are discussed in Section 560 5. 562 If the Extended Length bit of the Attribute Flags octet is set 563 to 0, the third octet of the Path Attribute contains the length 564 of the attribute data in octets. 566 If the Extended Length bit of the Attribute Flags octet is set 567 to 1, then the third and the fourth octets of the path 568 attribute contain the length of the attribute data in octets. 570 The remaining octets of the Path Attribute represent the 571 attribute value and are interpreted according to the Attribute 573 RFC DRAFT August 1992 575 Flags and the Attribute Type Code. The supported attribute 576 values and their uses are the following: 578 a) ORIGIN (Type Code 1): 580 ORIGIN is a well-known mandatory attribute that defines the 581 origin of the path information. The data octet can assume 582 the following values: 584 Value Meaning 586 0 IGP - Network Layer Reachability Information 587 is interior to the originating AS 589 1 EGP - Network Layer Reachability Information 590 learned via EGP 592 2 INCOMPLETE - Network Layer Reachability 593 Information learned by some other means 595 Its usage is defined in 5.1.1 597 b) AS_PATH (Type Code 2): 599 AS_PATH is a well-known mandatory attribute that is composed 600 of a sequence of AS path segments. Each AS path segment is 601 represented by a triple . 604 The path segment type is a 1-octet long field with the 605 following values defined: 607 Value Segment Type 609 1 AS_SET: unordered set of ASs a route in the 610 UPDATE message has traversed 612 2 AS_SEQUENCE: ordered set of ASs a route in 613 the UPDATE message has traversed 615 The path segment length is a 1-octet long field containing 616 the number of ASs in the path segment value field. 618 The path segment value field contains one or more AS 619 numbers, each encoded as a 2-octets long field. 621 Usage of this attribute is defined in 5.1.2. 623 RFC DRAFT August 1992 625 c) NEXT_HOP (Type Code 3): 627 This is a well-known mandatory attribute that defines the IP 628 address of the border router that should be used as the next 629 hop to the destinations listed in the Network Layer 630 Reachability field of the UPDATE message. 632 Usage of this attribute is defined in 5.1.3. 634 d) MULTI_EXIT_DISC (Type Code 4): 636 This is an optional non-transitive attribute that is a 1 637 octet non-negative integer. The value of this attribute may 638 be used by a BGP speaker's decision process to discriminate 639 between multiple exit points to an adjacent autonomous 640 system. 642 Its usage is defined in 5.1.4. 644 e) LOCAL_PREF (Type Code 5): 646 LOCAL_PREF is a well-known discretionary attribute that is a 647 1 octet non-negative integer. It is used by a BGP speaker to 648 inform other BGP speakers in its own autonomous system of 649 the originating speaker's degree of preference for an 650 advertised route. Usage of this attribute is described in 651 5.1.5. 653 f) ATOMIC_AGGREGATE (Type Code 6) 655 ATOMIC_AGGREGATE is a well-known discretionary attribute of 656 length 0. It is used by a BGP speaker to inform other BGP 657 speakers that the local system selected a less specific 658 route without selecting a more specific route which is 659 included in it. Usage of this attribute is described in 660 5.1.6. 662 g) AGGREGATOR (Type Code 7) 664 AGGREGATOR is an optional transitive attribute of length 2. 665 It is used by a BGP speaker to to indicate the AS number of 666 the last AS that formed the aggregate route. Usage of this 667 attribute is described in 5.1.7 669 Network Layer Reachability Information: 671 This variable length field contains a list of IP address 673 RFC DRAFT August 1992 675 prefixes. The length in octets of the Network Layer 676 Reachability Information is not encoded explicitly, but can be 677 calculated as: 679 UPDATE message Length - 23 - Total Path Attributes Length - 680 Unfeasible Routes Length 682 where UPDATE message Length is the value encoded in the fixed- 683 size BGP header, Total Path Attribute Length and Unfeasible 684 Routes Length are the values encoded in the variable part of 685 the UPDATE message, and 23 is a combined length of the fixed- 686 size BGP header, the Total Path Attribute Length field and the 687 Unfeasible Routes Length field. 689 Reachability information is encoded as one or more 2-tuples of 690 the form , whose fields are described below: 692 +---------------------------+ 693 | Length (1 octet) | 694 +---------------------------+ 695 | Prefix (variable) | 696 +---------------------------+ 698 The use and the meaning of these fields are as follows: 700 a) Length: 702 The Length field indicates the length in bits of the IP 703 address prefix. A length of zero indicates a prefix that 704 matches all IP addresses (with prefix, itself, of zero 705 octets). 707 b) Prefix: 709 The Prefix field contains IP address prefixes followed by 710 enough trailing bits to make the end of the field fall on an 711 octet boundary. Note that the value of the trailing bits is 712 irrelevant. 714 The minimum length of the UPDATE message is 33 octets (including 715 message header). 717 An UPDATE message can advertise at most one route, which may be 718 described by several path attributes. All path attributes contained 719 in a given UPDATE messages apply to the destinations carried in the 721 RFC DRAFT August 1992 723 Network Layer Reachability Information field of the UPDATE message. 725 An UPDATE message can list multiple routes to be withdrawn from 726 service. Each such route is identified by its destination (expressed 727 as an IP prefix), which unambiguously identifies the route in the 728 context of the BGP speaker - BGP speaker connection to which it has 729 been previously been advertised. 731 An UPDATE message may advertise only routes to be withdrawn from 732 service, in which case it will not include path attributes or Network 733 Layer Reachability Information. Conversely, it may advertise only a 734 feasible route, in which case the WITHDRAWN ROUTES field need not be 735 present. 737 4.4 KEEPALIVE Message Format 739 BGP does not use any transport protocol-based keep-alive mechanism to 740 determine if peers are reachable. Instead, KEEPALIVE messages are 741 exchanged between peers often enough as not to cause the hold time 742 (as advertised in the OPEN message) to expire. A reasonable maximum 743 time between KEEPALIVE messages would be one third of the Hold Time 744 interval. 746 KEEPALIVE message consists of only message header and has a length of 747 19 octets. 749 4.5 NOTIFICATION Message Format 751 A NOTIFICATION message is sent when an error condition is detected. 752 The BGP connection is closed immediately after sending it. 754 In addition to the fixed-size BGP header, the NOTIFICATION message 755 contains the following fields: 757 0 1 2 3 758 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 759 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 760 | Error code | Error subcode | Data | 761 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 762 | | 763 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 765 RFC DRAFT August 1992 767 Error Code: 769 This 1-octet unsigned integer indicates the type of 770 NOTIFICATION. The following Error Codes have been defined: 772 Error Code Symbolic Name Reference 774 1 Message Header Error Section 6.1 776 2 OPEN Message Error Section 6.2 778 3 UPDATE Message Error Section 6.3 780 4 Hold Timer Expired Section 6.5 782 5 Finite State Machine Error Section 6.6 784 6 Cease Section 6.7 786 Error subcode: 788 This 1-octet unsigned integer provides more specific 789 information about the nature of the reported error. Each Error 790 Code may have one or more Error Subcodes associated with it. 791 If no appropriate Error Subcode is defined, then a zero 792 (Unspecific) value is used for the Error Subcode field. 794 Message Header Error subcodes: 796 1 - Connection Not Synchronized. 797 2 - Bad Message Length. 798 3 - Bad Message Type. 800 OPEN Message Error subcodes: 802 1 - Unsupported Version Number. 803 2 - Bad Peer AS. 804 3 - Bad BGP Identifier. 805 4 - Unsupported Authentication Code. 806 5 - Authentication Failure. 808 UPDATE Message Error subcodes: 810 1 - Malformed Attribute List. 811 2 - Unrecognized Well-known Attribute. 812 3 - Missing Well-known Attribute. 813 4 - Attribute Flags Error. 815 RFC DRAFT August 1992 817 5 - Attribute Length Error. 818 6 - Invalid ORIGIN Attribute 819 7 - AS Routing Loop. 820 8 - Invalid NEXT_HOP Attribute. 821 9 - Optional Attribute Error. 822 10 - Invalid Network Field. 823 11 - Malformed AS_PATH. 825 Data: 827 This variable-length field is used to diagnose the reason for 828 the NOTIFICATION. The contents of the Data field depend upon 829 the Error Code and Error Subcode. See Section 6 below for more 830 details. 832 Note that the length of the Data field can be determined from 833 the message Length field by the formula: 835 Message Length = 21 + Data Length 837 The minimum length of the NOTIFICATION message is 21 octets 838 (including message header). 840 5. Path Attributes 842 This section discusses the path attributes of the UPDATE message. 844 Path attributes fall into four separate categories: 846 1. Well-known mandatory. 847 2. Well-known discretionary. 848 3. Optional transitive. 849 4. Optional non-transitive. 851 Well-known attributes must be recognized by all BGP implementations. 852 Some of these attributes are mandatory and must be included in every 853 UPDATE message. Others are discretionary and may or may not be sent 854 in a particular UPDATE message. Which well-known attributes are 855 mandatory or discretionary is noted in the table below. 857 All well-known attributes must be passed along (after proper 858 updating, if necessary) to other BGP peers. 860 In addition to well-known attributes, each path may contain one or 861 more optional attributes. It is not required or expected that all 863 RFC DRAFT August 1992 865 BGP implementations support all optional attributes. The handling of 866 an unrecognized optional attribute is determined by the setting of 867 the Transitive bit in the attribute flags octet. Paths with 868 unrecognized transitive optional attributes should be accepted. If a 869 path with unrecognized transitive optional attribute is accepted and 870 passed along to other BGP peers, then the unrecognized transitive 871 optional attribute of that path must be passed along with the path to 872 other BGP peers with the Partial bit in the Attribute Flags octet set 873 to 1. If a path with recognized transitive optional attribute is 874 accepted and passed along to other BGP peers and the Partial bit in 875 the Attribute Flags octet is set to 1 by some previous AS, it is not 876 set back to 0 by the current AS. Unrecognized non-transitive optional 877 attributes must be quietly ignored and not passed along to other BGP 878 peers. 880 New transitive optional attributes may be attached to the path by the 881 originator or by any other AS in the path. If they are not attached 882 by the originator, the Partial bit in the Attribute Flags octet is 883 set to 1. The rules for attaching new non-transitive optional 884 attributes will depend on the nature of the specific attribute. The 885 documentation of each new non-transitive optional attribute will be 886 expected to include such rules. (The description of the 887 MULTI_EXIT_DISC attribute gives an example.) All optional attributes 888 (both transitive and non-transitive) may be updated (if appropriate) 889 by ASs in the path. 891 The sender of an UPDATE message should order path attributes within 892 the UPDATE message in ascending order of attribute type. The 893 receiver of an UPDATE message must be prepared to handle path 894 attributes within the UPDATE message that are out of order. 896 The same attribute cannot appear more than once within the Path 897 Attributes field of a particular UPDATE message. 899 5.1 Path Attribute Usage 901 The usage of each BGP path attributes is described in the following 902 clauses. 904 5.1.1 ORIGIN 906 ORIGIN is a well-known mandatory attribute. It shall be recognized 908 RFC DRAFT August 1992 910 upon receipt by all BGP speakers. It shall be included in each UPDATE 911 message that includes Network Layer Reachability Information. 913 The ORIGIN attribute shall be generated by the autonomous system that 914 originates the associated routing information. It shall be included 915 in the UPDATE messages of all BGP speakers that choose to propagate 916 this information to other BGP speakers. 918 5.1.2 AS_PATH 920 AS_PATH is a well-known mandatory attribute. It shall be presented in 921 every UPDATE message and shall be recognized upon receipt by all BGP 922 speakers. This attribute identifies the autonomous systems through 923 which routing information carried in this UPDATE message has passed. 924 The components of this list can be AS_SETs or AS_SEQUENCEs. 926 When a BGP speaker propagates a route which it has learned from 927 another BGP speaker's UPDATE message, it shall modify the route's 928 AS_PATH attribute based on the location of the BGP speaker to which 929 the route will be sent: 931 a) When a given BGP speaker advertises the route to another BGP 932 speaker located in its own autonomous system, the advertising 933 speaker shall not modify the AS_PATH attribute associated with the 934 route. 936 b) When a given BGP speaker advertises the route to a BGP speaker 937 located in an adjacent autonomous system, then the advertising 938 speaker shall update the AS_PATH attribute as follows: 940 1) if the first path segment of the AS_PATH is of type 941 AS_SEQUENCE, the local system shall prepend its own AS number 942 as the last element of the sequence (put it in the leftmost 943 position) 945 2) if the first path segment of the AS_PATH is of type AS_SET, 946 the local system shall prepend a new path segment of type 947 AS_SEQUENCE to the AS_PATH, including its own AS number in that 948 segment. 950 When a BGP speaker originates a route then: 952 a) the originating speaker shall include its own AS number in 953 the AS_PATH attribute of all UPDATE messages sent to BGP 954 speakers located in adjacent autonomous systems. (In this case, 956 RFC DRAFT August 1992 958 the AS number of the originating speaker's autonomous system 959 will be the only entry in the AS_PATH attribute). 961 b) the originating speaker shall include an empty AS_PATH 962 attribute in all UPDATE messages sent to BGP speakers located 963 in its own autonomous system. (An empty AS_PATH attribute is 964 one whose length field contains the value zero). 966 5.1.3 NEXT_HOP 968 The NEXT_HOP path attribute defines the IP address of the border 969 router that should be used as the next hop to the networks listed in 970 the UPDATE message. If a border router belongs to the same AS as its 971 peer, then the peer is an internal border router. Otherwise, it is an 972 external border router. A BGP speaker can advertise any internal 973 border router as the next hop provided that the interface associated 974 with the IP address of this border router (as specified in the 975 NEXT_HOP path attribute) shares a common subnet with both the local 976 and remote BGP speakers. A BGP speaker can advertise any external 977 border router as the next hop, provided that the IP address of this 978 border router was learned from one of the BGP speaker's peers, and 979 the interface associated with the IP address of this border router 980 (as specified in the NEXT_HOP path attribute) shares a common subnet 981 with the local and remote BGP speakers. A BGP speaker needs to be 982 able to support disabling advertisement of external border routers. 984 A BGP speaker must never advertise an address of a neighbor to that 985 neighbor as a NEXT_HOP, for a route that the speaker is originating. 986 A BGP speaker must never install a route with itself as the next hop. 988 When a BGP speaker advertises the route to a BGP speaker located in 989 its own autonomous system, the advertising speaker shall not modify 990 the NEXT_HOP attribute associated with the route. When a BGP speaker 991 receives the route via an internal link, it may use that NEXT_HOP if 992 the address contained in the attribute is on a common subnet with the 993 local and remote BGP speakers. The BGP speaker may also use the 994 NEXT_HOP address if the IGP does not contain a route for the 995 destination. 997 5.1.4 MULTI_EXIT_DISC 999 The MULTI_EXIT_DISC attribute may be used on external (inter-AS) 1000 links to discriminate between multiple exit or entry points to the 1001 same neighboring AS. The value of the MULTI_EXIT_DISC attribute is a 1003 RFC DRAFT August 1992 1005 1-octet unsigned number which is called a metric. All other factors 1006 being equal, the exit or entry point with lower metric should be 1007 preferred. If received over external links, the MULTI_ EXIT_DISC 1008 attribute may be propagated over internal links to other BGP speakers 1009 within the same AS. The MULTI_EXIT_DISC attribute is never 1010 propagated to other BGP speakers in neighboring AS's. 1012 5.1.5 LOCAL_PREF 1014 LOCAL_PREF is a well-known discretionary attribute that shall be 1015 included in all UPDATE messages that a given BGP speaker sends to the 1016 other BGP speakers located in its own autonomous system. A BGP 1017 speaker shall calculate the degree of preference for each external 1018 route and include the degree of preference when advertising a route 1019 to its internal neighbors. The lower degree of preference should be 1020 preferred. A BGP speaker shall use the degree of preference learned 1021 via LOCAL_PREF in its decision process (see section 9.1.1). 1023 A BGP speaker shall not include this attribute in UPDATE messages 1024 that it sends to BGP speakers located in an adjacent autonomous 1025 system. It is contained in an UPDATE message that is received from a 1026 BGP speaker which is not located in the same autonomous system as the 1027 receiving speaker, then this attribute shall be ignored by the 1028 receiving speaker. 1030 5.1.6 ATOMIC_AGGREGATE 1032 ATOMIC_AGGREGATE is a well-known discretionary attribute. If a BGP 1033 speaker, when presented with a set of overlapping routes from one of 1034 its peers (see 9.1.4), selects the less specific route without 1035 selecting the more specific one, then the local system shall attach 1036 the ATOMIC_AGGREGATE attribute to the route when propagating it to 1037 other BGP speakers (if that attribute is not already present in the 1038 received less specific route). A BGP speaker that receives a route 1039 with the ATOMIC_AGGREGATE attribute shall not remove the attribute 1040 from the route when propagating it to other speakers. A BGP speaker 1041 that receives a route with the ATOMIC_AGGREGATE attribute shall not 1042 make any NLRI of that route more specific (as defined in 9.1.4) when 1043 advertising this route to other BGP speakers. A BGP speaker that 1044 receives a route with the ATOMIC_AGGREGATE attribute needs to be 1045 cognizant of the fact that the actual path to destinations, as 1046 specified in the NLRI of the route, while having the loop-free 1047 property, may traverse ASs that are not listed in the AS_PATH 1048 attribute. 1050 RFC DRAFT August 1992 1052 5.1.7 AGGREGATOR 1054 AGGREGATOR is an optional transitive attribute which may be included 1055 in updates which are formed by aggregation (see Section 9.2.4.2). A 1056 BGP speaker which performs route aggregation may add the AGGREGATOR 1057 attribute which shall contain its own AS number. 1059 6. BGP Error Handling. 1061 This section describes actions to be taken when errors are detected 1062 while processing BGP messages. 1064 When any of the conditions described here are detected, a 1065 NOTIFICATION message with the indicated Error Code, Error Subcode, 1066 and Data fields is sent, and the BGP connection is closed. If no 1067 Error Subcode is specified, then a zero must be used. 1069 The phrase "the BGP connection is closed" means that the transport 1070 protocol connection has been closed and that all resources for that 1071 BGP connection have been deallocated. Routing table entries 1072 associated with the remote peer are marked as invalid. The fact that 1073 the routes have become invalid is passed to other BGP peers before 1074 the routes are deleted from the system. 1076 Unless specified explicitly, the Data field of the NOTIFICATION 1077 message that is sent to indicate an error is empty. 1079 6.1 Message Header error handling. 1081 All errors detected while processing the Message Header are indicated 1082 by sending the NOTIFICATION message with Error Code Message Header 1083 Error. The Error Subcode elaborates on the specific nature of the 1084 error. 1086 The expected value of the Marker field of the message header is all 1087 ones if the message type is OPEN. The expected value of the Marker 1088 field for all other types of BGP messages determined based on the 1089 Authentication Code in the BGP OPEN message and the actual 1090 authentication mechanism (if the Authentication Code in the BGP OPEN 1091 message is non-zero). If the Marker field of the message header is 1092 not the expected one, then a synchronization error has occurred and 1093 the Error Subcode is set to Connection Not Synchronized. 1095 RFC DRAFT August 1992 1097 If the Length field of the message header is less than 19 or greater 1098 than 4096, or if the Length field of an OPEN message is less than 1099 the minimum length of the OPEN message, or if the Length field of an 1100 UPDATE message is less than the minimum length of the UPDATE message, 1101 or if the Length field of a KEEPALIVE message is not equal to 19, or 1102 if the Length field of a NOTIFICATION message is less than the 1103 minimum length of the NOTIFICATION message, then the Error Subcode is 1104 set to Bad Message Length. The Data field contains the erroneous 1105 Length field. 1107 If the Type field of the message header is not recognized, then the 1108 Error Subcode is set to Bad Message Type. The Data field contains 1109 the erroneous Type field. 1111 6.2 OPEN message error handling. 1113 All errors detected while processing the OPEN message are indicated 1114 by sending the NOTIFICATION message with Error Code OPEN Message 1115 Error. The Error Subcode elaborates on the specific nature of the 1116 error. 1118 If the version number contained in the Version field of the received 1119 OPEN message is not supported, then the Error Subcode is set to 1120 Unsupported Version Number. The Data field is a 2-octet unsigned 1121 integer, which indicates the largest locally supported version number 1122 less than the version the remote BGP peer bid (as indicated in the 1123 received OPEN message). 1125 If the Autonomous System field of the OPEN message is unacceptable, 1126 then the Error Subcode is set to Bad Peer AS. The determination of 1127 acceptable Autonomous System numbers is outside the scope of this 1128 protocol. 1130 If the BGP Identifier field of the OPEN message is syntactically 1131 incorrect, then the Error Subcode is set to Bad BGP Identifier. 1132 Syntactic correctness means that the BGP Identifier field represents 1133 a valid IP host address. 1135 If the Authentication Code of the OPEN message is not recognized, 1136 then the Error Subcode is set to Unsupported Authentication Code. If 1137 the Authentication Code is zero, then the Authentication Data must be 1138 of zero length. Otherwise, the Error Subcode is set to 1139 Authentication Failure. 1141 If the Authentication Code is non-zero, then the corresponding 1142 authentication procedure is invoked. If the authentication procedure 1144 RFC DRAFT August 1992 1146 (based on Authentication Code and Authentication Data) fails, then 1147 the Error Subcode is set to Authentication Failure. 1149 6.3 UPDATE message error handling. 1151 All errors detected while processing the UPDATE message are indicated 1152 by sending the NOTIFICATION message with Error Code UPDATE Message 1153 Error. The error subcode elaborates on the specific nature of the 1154 error. 1156 Error checking of an UPDATE message begins by examining the path 1157 attributes. If the Total Attribute Length is too large (i.e., if 1158 Total Attribute Length + 21 exceeds the message Length), or if the 1159 (non-negative integer) Number of Network fields cannot be computed as 1160 in Section 4.3, then the Error Subcode is set to Malformed Attribute 1161 List. 1163 If any recognized attribute has Attribute Flags that conflict with 1164 the Attribute Type Code, then the Error Subcode is set to Attribute 1165 Flags Error. The Data field contains the erroneous attribute (type, 1166 length and value). 1168 If any recognized attribute has Attribute Length that conflicts with 1169 the expected length (based on the attribute type code), then the 1170 Error Subcode is set to Attribute Length Error. The Data field 1171 contains the erroneous attribute (type, length and value). 1173 If any of the mandatory well-known attributes are not present, then 1174 the Error Subcode is set to Missing Well-known Attribute. The Data 1175 field contains the Attribute Type Code of the missing well-known 1176 attribute. 1178 If any of the mandatory well-known attributes are not recognized, 1179 then the Error Subcode is set to Unrecognized Well-known Attribute. 1180 The Data field contains the unrecognized attribute (type, length and 1181 value). 1183 If the ORIGIN attribute has an undefined value, then the Error 1184 Subcode is set to Invalid Origin Attribute. The Data field contains 1185 the unrecognized attribute (type, length and value). 1187 If the NEXT_HOP attribute field is syntactically or semantically 1188 incorrect, then the Error Subcode is set to Invalid NEXT_HOP 1189 Attribute. 1191 The Data field contains the incorrect attribute (type, length and 1193 RFC DRAFT August 1992 1195 value). Syntactic correctness means that the NEXT_HOP attribute 1196 represents a valid IP host address. Semantic correctness applies 1197 only to the external BGP links. It means that the interface 1198 associated with the IP address, as specified in the NEXT_HOP 1199 attribute, shares a common subnet with the receiving BGP speaker and 1200 is not the IP address of the receiving BGP speaker. 1202 The AS_PATH attribute is checked for syntactic correctness. If the 1203 path is syntactically incorrect, then the Error Subcode is set to 1204 Malformed AS_PATH. 1206 The AS route specified by the AS_PATH attribute is checked for AS 1207 loops. AS loop detection is done by scanning the full AS route (as 1208 specified in the AS_PATH attribute) and checking that each AS occurs 1209 at most once. If a loop is detected, then the Error Subcode is set 1210 to AS Routing Loop. The Data field contains the incorrect attribute 1211 (type, length and value). 1213 If an optional attribute is recognized, then the value of this 1214 attribute is checked. If an error is detected, the attribute is 1215 discarded, and the Error Subcode is set to Optional Attribute Error. 1216 The Data field contains the attribute (type, length and value). 1218 If any attribute appears more than once in the UPDATE message, then 1219 the Error Subcode is set to Malformed Attribute List. 1221 Each Network field in the UPDATE message is checked for syntactic 1222 validity. If the Network field is syntactically incorrect, or 1223 contains a subnet or a host address, then the Error Subcode is set to 1224 Invalid Network Field. 1226 6.4 NOTIFICATION message error handling. 1228 If a peer sends a NOTIFICATION message, and there is an error in that 1229 message, there is unfortunately no means of reporting this error via 1230 a subsequent NOTIFICATION message. Any such error, such as an 1231 unrecognized Error Code or Error Subcode, should be noticed, logged 1232 locally, and brought to the attention of the administration of the 1233 peer. The means to do this, however, lies outside the scope of this 1234 document. 1236 6.5 Hold Timer Expired error handling. 1238 If a system does not receive successive KEEPALIVE and/or UPDATE 1240 RFC DRAFT August 1992 1242 and/or NOTIFICATION messages within the period specified in the Hold 1243 Time field of the OPEN message, then the NOTIFICATION message with 1244 Hold Timer Expired Error Code must be sent and the BGP connection 1245 closed. 1247 6.6 Finite State Machine error handling. 1249 Any error detected by the BGP Finite State Machine (e.g., receipt of 1250 an unexpected event) is indicated by sending the NOTIFICATION message 1251 with Error Code Finite State Machine Error. 1253 6.7 Cease. 1255 In absence of any fatal errors (that are indicated in this section), 1256 a BGP peer may choose at any given time to close its BGP connection 1257 by sending the NOTIFICATION message with Error Code Cease. However, 1258 the Cease NOTIFICATION message must not be used when a fatal error 1259 indicated by this section does exist. 1261 6.8 Connection collision detection. 1263 If a pair of BGP speakers try simultaneously to establish a TCP 1264 connection to each other, then two parallel connections between this 1265 pair of speakers might well be formed. We refer to this situation as 1266 connection collision. Clearly, one of these connections must be 1267 closed. 1269 Based on the value of the BGP Identifier a convention is established 1270 for detecting which BGP connection is to be preserved when a 1271 collision does occur. The convention is to compare the BGP 1272 Identifiers of the peers involved in the collision and to retain only 1273 the connection initiated by the BGP speaker with the higher-valued 1274 BGP Identifier. 1276 Upon receipt of an OPEN message, the local system must examine all of 1277 its connections that are in the OpenConfirm state. A BGP speaker may 1278 also examine connections in an OpenSent state if it knows the BGP 1279 Identifier of the neighbor by means outside of the protocol. If 1280 among these connections there is a connection to a remote BGP speaker 1281 whose BGP Identifier equals the one in the OPEN message, then the 1282 local system performs the following collision resolution procedure: 1284 RFC DRAFT August 1992 1286 1. The BGP Identifier of the local system is compared to the BGP 1287 Identifier of the remote system (as specified in the OPEN 1288 message). 1290 2. If the value of the local BGP Identifier is less than the 1291 remote one, the local system closes BGP connection that already 1292 exists (the one that is already in the OpenConfirm state), and 1293 accepts BGP connection initiated by the remote system. 1295 3. Otherwise, the local system closes newly created BGP connection 1296 (the one associated with the newly received OPEN message), and 1297 continues to use the existing one (the one that is already in the 1298 OpenConfirm state). 1300 Comparing BGP Identifiers is done by treating them as (4-octet 1301 long) unsigned integers. 1303 A connection collision with an existing BGP connection that is in 1304 Established states causes unconditional closing of the newly 1305 created connection. Note that a connection collision cannot be 1306 detected with connections that are in Idle, or Connect, or Active 1307 states. 1309 Closing the BGP connection (that results from the collision 1310 resolution procedure) is accomplished by sending the NOTIFICATION 1311 message with the Error Code Cease. 1313 7. BGP Version Negotiation. 1315 BGP speakers may negotiate the version of the protocol by making 1316 multiple attempts to open a BGP connection, starting with the highest 1317 version number each supports. If an open attempt fails with an Error 1318 Code OPEN Message Error, and an Error Subcode Unsupported Version 1319 Number, then the BGP speaker has available the version number it 1320 tried, the version number its peer tried, the version number passed 1321 by its peer in the NOTIFICATION message, and the version numbers that 1322 it supports. If the two peers do support one or more common 1323 versions, then this will allow them to rapidly determine the highest 1324 common version. In order to support BGP version negotiation, future 1325 versions of BGP must retain the format of the OPEN and NOTIFICATION 1326 messages. 1328 RFC DRAFT August 1992 1330 8. BGP Finite State machine. 1332 This section specifies BGP operation in terms of a Finite State 1333 Machine (FSM). Following is a brief summary and overview of BGP 1334 operations by state as determined by this FSM. A condensed version 1335 of the BGP FSM is found in Appendix 1. 1337 Initially BGP is in the Idle state. 1339 Idle state: 1341 In this state BGP refuses all incoming BGP connections. No 1342 resources are allocated to the BGP neighbor. In response to 1343 the Start event (initiated by either system or operator) the 1344 local system initializes all BGP resources, starts the 1345 ConnectRetry timer, initiates a transport connection to other 1346 BGP peer, while listening for connection that may be initiated 1347 by the remote BGP peer, and changes its state to Connect. The 1348 exact value of the ConnectRetry timer is a local matter, but 1349 should be sufficiently large to allow TCP initialization. 1351 If a BGP speaker detects an error, it shuts down the connection 1352 and changes its state to Idle. Getting out of the Idle state 1353 requires generation of the Start event. If such an event is 1354 generated automatically, then persistent BGP errors may result 1355 in persistent flapping of the speaker. To avoid such a 1356 condition it is recommended that Start events should not be 1357 generated immediately for a peer that was previously 1358 transitioned to Idle due to an error. For a peer that was 1359 previously transitioned to Idle due to an error, the time 1360 between consecutive generation of Start events, if such events 1361 are generated automatically, shall exponentially increase. The 1362 value of the initial timer shall be 60 seconds. The time shall 1363 be doubled for each consecutive retry. 1365 Any other event received in the Idle state is ignored. 1367 Connect state: 1369 In this state BGP is waiting for the transport protocol 1370 connection to be completed. 1372 If the transport protocol connection succeeds, the local system 1373 clears the ConnectRetry timer, completes initialization, sends 1374 an OPEN message to its peer, and changes its state to OpenSent. 1376 If the transport protocol connect fails (e.g., retransmission 1378 RFC DRAFT August 1992 1380 timeout), the local system restarts the ConnectRetry timer, 1381 continues to listen for a connection that may be initiated by 1382 the remote BGP peer, and changes its state to Active state. 1384 In response to the ConnectRetry timer expired event, the local 1385 system restarts the ConnectRetry timer, initiates a transport 1386 connection to other BGP peer, continues to listen for a 1387 connection that may be initiated by the remote BGP peer, and 1388 stays in the Connect state. 1390 Start event is ignored in the Active state. 1392 In response to any other event (initiated by either system or 1393 operator), the local system releases all BGP resources 1394 associated with this connection and changes its state to Idle. 1396 Active state: 1398 In this state BGP is trying to acquire a BGP neighbor by 1399 initiating a transport protocol connection. 1401 If the transport protocol connection succeeds, the local system 1402 clears the ConnectRetry timer, completes initialization, sends 1403 an OPEN message to its peer, sets its hold timer to a large 1404 value, and changes its state to OpenSent. 1406 In response to the ConnectRetry timer expired event, the local 1407 system restarts the ConnectRetry timer, initiates a transport 1408 connection to other BGP peer, continues to listen for a 1409 connection that may be initiated by the remote BGP peer, and 1410 changes its state to Connect. 1412 If the local system detects that a remote peer is trying to 1413 establish BGP connection to it, and the IP address of the 1414 remote peer is not an expected one, the local system restarts 1415 the ConnectRetry timer, rejects the attempted connection, 1416 continues to listen for a connection that may be initiated by 1417 the remote BGP peer, and stays in the Active state. 1419 Start event is ignored in the Active state. 1421 In response to any other event (initiated by either system or 1422 operator), the local system releases all BGP resources 1423 associated with this connection and changes its state to Idle. 1425 OpenSent state: 1427 In this state BGP waits for an OPEN message from its peer. 1429 RFC DRAFT August 1992 1431 When an OPEN message is received, all fields are checked for 1432 correctness. If the BGP message header checking or OPEN 1433 message checking detects an error (see Section 6.2), or a 1434 connection collision (see Section 6.8) the local system sends a 1435 NOTIFICATION message and changes its state to Idle. 1437 If there are no errors in the OPEN message, BGP sends a 1438 KEEPALIVE message and sets a KeepAlive timer. The hold timer, 1439 which was originally set to an arbitrary large value (see 1440 above), is replaced with the value indicated in the OPEN 1441 message. If the value of the Autonomous System field is the 1442 same as our own, then the connection is "internal" connection; 1443 otherwise, it is "external". (This will effect UPDATE 1444 processing as described below.) Finally, the state is changed 1445 to OpenConfirm. 1447 If a disconnect notification is received from the underlying 1448 transport protocol, the local system closes the BGP connection, 1449 restarts the ConnectRetry timer, while continue listening for 1450 connection that may be initiated by the remote BGP peer, and 1451 goes into the Active state. 1453 If the hold time expires, the local system sends NOTIFICATION 1454 message with error code Hold Timer Expired and changes its 1455 state to Idle. 1457 In response to the Stop event (initiated by either system or 1458 operator) the local system sends NOTIFICATION message with 1459 Error Code Cease and changes its state to Idle. 1461 Start event is ignored in the OpenSent state. 1463 In response to any other event the local system sends 1464 NOTIFICATION message with Error Code Finite State Machine Error 1465 and changes its state to Idle. 1467 Whenever BGP changes its state from OpenSent to Idle, it closes 1468 the BGP (and transport-level) connection and releases all 1469 resources associated with that connection. 1471 OpenConfirm state: 1473 In this state BGP waits for a KEEPALIVE or NOTIFICATION 1474 message. 1476 If the local system receives a KEEPALIVE message, it changes 1477 its state to Established. 1479 RFC DRAFT August 1992 1481 If the hold timer expires before a KEEPALIVE message is 1482 received, the local system sends NOTIFICATION message with 1483 error code Hold Timer expired and changes its state to Idle. 1485 If the local system receives a NOTIFICATION message, it changes 1486 its state to Idle. 1488 If the KeepAlive timer expires, the local system sends a 1489 KEEPALIVE message and restarts its KeepAlive timer. 1491 If a disconnect notification is received from the underlying 1492 transport protocol, the local system changes its state to Idle. 1494 In response to the Stop event (initiated by either system or 1495 operator) the local system sends NOTIFICATION message with 1496 Error Code Cease and changes its state to Idle. 1498 Start event is ignored in the OpenConfirm state. 1500 In response to any other event the local system sends 1501 NOTIFICATION message with Error Code Finite State Machine Error 1502 and changes its state to Idle. 1504 Whenever BGP changes its state from OpenConfirm to Idle, it 1505 closes the BGP (and transport-level) connection and releases 1506 all resources associated with that connection. 1508 Established state: 1510 In the Established state BGP can exchange UPDATE, NOTIFICATION, 1511 and KEEPALIVE messages with its peer. 1513 If the local system receives an UPDATE or KEEPALIVE message, it 1514 restarts its Holdtime timer. 1516 If the local system receives a NOTIFICATION message, it changes 1517 its state to Idle. 1519 If the local system receives an UPDATE message and the UPDATE 1520 message error handling procedure (see Section 6.3) detects an 1521 error, the local system sends a NOTIFICATION message and 1522 changes its state to Idle. 1524 If a disconnect notification is received from the underlying 1525 transport protocol, the local system changes its state to Idle. 1527 If the Holdtime timer expires, the local system sends a 1528 NOTIFICATION message with Error Code Hold Timer Expired and 1530 RFC DRAFT August 1992 1532 changes its state to Idle. 1534 If the KeepAlive timer expires, the local system sends a 1535 KEEPALIVE message and restarts its KeepAlive timer. 1537 Each time the local system sends a KEEPALIVE or UPDATE message, 1538 it restarts its KeepAlive timer. 1540 In response to the Stop event (initiated by either system or 1541 operator), the local system sends a NOTIFICATION message with 1542 Error Code Cease and changes its state to Idle. 1544 Start event is ignored in the Established state. 1546 In response to any other event, the local system sends 1547 NOTIFICATION message with Error Code Finite State Machine Error 1548 and changes its state to Idle. 1550 Whenever BGP changes its state from Established to Idle, it 1551 closes the BGP (and transport-level) connection, releases all 1552 resources associated with that connection, and deletes all 1553 routes derived from that connection. 1555 9. UPDATE Message Handling 1557 An UPDATE message may be received only in the Established state. 1558 When an UPDATE message is received, each field is checked for 1559 validity as specified in Section 6.3. 1561 If an optional non-transitive attribute is unrecognized, it is 1562 quietly ignored. If an optional transitive attribute is 1563 unrecognized, the Partial bit (the third high-order bit) in the 1564 attribute flags octet is set to 1, and the attribute is retained for 1565 propagation to other BGP speakers. 1567 If an optional attribute is recognized, and has a valid value, then, 1568 depending on the type of the optional attribute, it is processed 1569 locally, retained, and updated, if necessary, for possible 1570 propagation to other BGP speakers. 1572 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 1573 the previously advertised routes whose destinations (expressed as IP 1574 prefixes) contained in this field shall be removed from the Adj-RIB- 1575 In. This BGP speaker shall run its Decision Process since the 1576 previously advertised route is not longer available for use. 1578 RFC DRAFT August 1992 1580 If the UPDATE message contains a feasible route, it shall be placed 1581 in the appropriate Adj-RIB-In, and the following additional actions 1582 shall be taken: 1584 i) If its Network Layer Reachability Information (NLRI) is identical 1585 to the one of a route currently stored in the Adj-RIB-In, then the 1586 new route shall replace the older route in the Adj-RIB-In, thus 1587 implicitly withdrawing the older route from service. The BGP speaker 1588 shall run its Decision Process since the older route is no longer 1589 available for use. 1591 ii) If the new route is an overlapping route that is included (see 1592 9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP 1593 speaker shall run its Decision Process since the more specific route 1594 has implicitly made a portion of the less specific route unavailable 1595 for use. 1597 iii) If the new route has identical path attributes to an earlier 1598 route contained in the Adj-RIB-In, and is more specific (see 9.1.4) 1599 than the earlier route, no further actions are necessary. 1601 iv) If the new route has NLRI that is not present in any of the 1602 routes currently stored in the Adj-RIB-In, then the new route shall 1603 be placed in the Adj-RIB-In. The BGP speaker shall run its Decision 1604 Process. 1606 v) If the new route is an overlapping route that is less specific 1607 (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the 1608 BGP speaker shall run its Decision Process on the set of destinations 1609 described only by the less specific route. 1611 9.1 Decision Process 1613 The Decision Process selects routes for subsequent advertisement by 1614 applying the policies in the local Policy Information Base (PIB) to 1615 the routes stored in its Adj-RIB-In. The output of the Decision 1616 Process is the set of routes that will be advertised to adjacent BGP 1617 speakers; the selected routes will be stored in the local speaker's 1618 Adj-RIB-Out. 1620 The selection process is formalized by defining a function that takes 1621 the attribute of a given route as an argument and returns a non- 1622 negative integer denoting the degree of preference for the route. 1623 The function that calculates the degree of preference for a given 1624 route shall not use as its inputs any of the following: the existence 1625 of other routes, the non-existence of other routes, or the path 1627 RFC DRAFT August 1992 1629 attributes of other routes. Route selection then consists of 1630 individual application of the degree of preference function to each 1631 feasible route, followed by the choice of the one with the highest 1632 degree of preference. 1634 The Decision Process operates on routes contained in each Adj-RIB-In, 1635 and is responsible for: 1637 - selection of routes to be advertised to BGP speakers located in 1638 the local speaker's autonomous system 1640 - selection of routes to be advertised to BGP speakers located in 1641 adjacent autonomous systems 1643 - route aggregation and route information reduction 1645 The Decision Process takes place in three distinct phases, each 1646 triggered by a different event: 1648 a) Phase 1 is responsible for calculating the degree of preference 1649 for each route received from a BGP speaker located in an adjacent 1650 autonomous system, and for advertising to the other BGP speakers 1651 in the local autonomous system the routes that have the highest 1652 degree of preference for each distinct destination. 1654 b) Phase 2 is invoked on completion of phase 1. It is responsible 1655 for choosing the best route out of all those available for each 1656 distinct destination, and for installing each chosen route into 1657 the appropriate Loc-RIB. 1659 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 1660 responsible for disseminating routes in the Loc-RIB to each 1661 adjacent BGP speaker located in an adjacent autonomous system, 1662 according to the policies contained in the PIB. Route aggregation 1663 and information reduction can optionally be performed within this 1664 phase. 1666 9.1.1 Phase 1: Calculation of Degree of Preference 1668 The Phase 1 decision function shall be invoked whenever the local BGP 1669 speaker receives an UPDATE message from a neighboring BGP speaker 1670 located in an adjacent autonomous system that advertises a new route, 1671 a replacement route, or a withdrawn route. 1673 The Phase 1 decision function is a separate process which completes 1674 when it has no further work to do. 1676 RFC DRAFT August 1992 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 compute a degree of preference. If the route is learned 1684 from a BGP speaker in the local autonomous system, the LOCAL_PREF 1685 value, if present, is taken as the degree of preference. If the 1686 route is learned from a BGP speaker in an adjacent autonomous system 1687 or if LOCAL_PREF is not present, then the degree of preference should 1688 be computed based on preconfigured policy information. The exact 1689 nature of this policy information and the computation involved is a 1690 local matter. The local speaker shall then run the internal update 1691 process 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 BGP speakers located in its own autonomous system and those 1700 received from BGP speakers located in adjacent autonomous systems. 1702 The Phase 2 decision function shall be blocked from running while the 1703 Phase 3 decision function is in process. The Phase 2 function shall 1704 lock all Adj-RIBs-In prior to commencing its function, and shall 1705 unlock them on completion. 1707 For each set of destinations for which a feasible route exists in the 1708 Adj-RIBs-In, the local BGP speaker shall identify the route that has: 1710 a) the highest degree of preference of any route to the same set 1711 of destinations, or 1713 b) is the only route to that destination, or 1715 c) is selected as a result of the Phase 2 tie breaking rules 1716 specified in 9.1.2.1. 1718 An alternative procedure for selecting a route may be realized if a 1719 BGP speaker can ascertain whether a particular route the speaker 1720 wants to select is also present in the interior routing protocol 1721 (IGP) of the autonomous system the speaker belongs to, and that the 1722 BGP speaker that injected the route into the IGP has this route 1724 RFC DRAFT August 1992 1726 installed in its Loc-RIB. A BGP speaker may select a route, provided 1727 that the following conditions are satisfied: 1729 a) the NLRI of the route is present in the IGP of the autonomous 1730 system the speaker belongs to 1732 b) the BGP speaker that injected the NLRI into the IGP has the 1733 route in its Loc-RIB 1735 c) the BGP speaker that injected the NLRI into the IGP will be 1736 used as an exit point by the IGP. 1738 The exact procedures for verifying the above conditions are specific 1739 to a particular IGP and are outside the scope of this document. 1741 The local speaker shall then install that route in the Loc-RIB, 1742 replacing any route to the same destination that is currently being 1743 held in the Loc-RIB. 1745 Unfeasible routes shall be removed from the Loc-RIB, and 1746 corresponding unfeasible routes shall then be removed from the Adj- 1747 RIBs-In. 1749 9.1.2.1 Breaking Ties (Phase 2) 1751 In its Adj-RIBs-In a BGP speaker may have several routes to the same 1752 destination that have the same degree of preference. The local 1753 speaker can select only one of these routes for inclusion in the 1754 associated Loc-RIB. The local speaker considers all equally 1755 preferable routes, both those received from BGP speakers located in 1756 adjacent autonomous systems, and those received from other BGP 1757 speakers located in the local speaker's autonomous system. 1759 Ties shall be broken according to the following rules: 1761 a) If the candidate routes have identical path attributes or 1762 differ only in the NEXT_HOP attribute, select the route that was 1763 advertised by the BGP speaker in an adjacent autonomous system 1764 whose BGP Identifier has the lowest value. If none of the 1765 candidate routes were received from a BGP speaker located in an 1766 adjacent autonomous system, select the route that was advertised 1767 by the BGP speaker in the local autonomous system whose BGP 1768 Identifier has the lowest value. 1770 b) If the candidate routes differ only in their NEXT_HOP and 1771 MULTI_EXIT_DISC attributes, and the local system is configured to 1773 RFC DRAFT August 1992 1775 take into account MULTI_EXIT_DISC, select the route that has the 1776 lowest value of the MULTI_EXIT_DISC attribute. 1778 If the local system is configured to ignore MULTI_EXIT_DISC, 1779 select the route advertised by the BGP speaker in an adjacent 1780 autonomous system whose BGP Identifier has the lowest value. If 1781 none of the candidate routes were received from a BGP speaker 1782 located in an adjacent autonomous system, select the route that 1783 was advertised by the BGP speaker in the local autonomous system 1784 whose BGP Identifier has the lowest value. 1786 c) If the candidate routes differ in any path attributes other 1787 than NEXT_HOP and MULTI_EXIT_DISC, and all of the candidate routes 1788 were advertised by the BGP speakers within the local autonomous 1789 system, select the route that was advertised by the BGP speaker 1790 whose BGP identifier has the lowest value. 1792 If the candidate routes differ in any path attributes other than 1793 NEXT_HOP and MULTI_EXIT_DISC, and all of the candidate routes were 1794 advertised by the BGP speakers in adjacent autonomous systems, 1795 select the route that was advertised by the BGP speaker whose BGP 1796 identifier has the lowest value. 1798 If the candidate routes differ in any path attributes other than 1799 NEXT_HOP and MULTI_EXIT_DISC, and some of the candidate routes 1800 were advertised by the BGP speakers in adjacent autonomous system, 1801 while others were advertised by the BGP speakers within the local 1802 autonomous system, the local system shall determine the BGP 1803 speaker within the local autonomous system whose BGP identifier 1804 has the lowest value and is advertising a candidate route 1805 (including itself). 1807 If this speaker is the local system, then select the route that 1808 was advertised by the BGP speaker in an adjacent autonomous system 1809 whose BGP identifier has the lowest value among all other BGP 1810 speakers in adjacent autonomous systems. 1812 Otherwise (if the BGP identifier of the local system is not the 1813 lowest among all BGP speakers within the local autonomous system 1814 advertising a candidate route), select the route that was 1815 advertised by the BGP speaker within the local autonomous system 1816 whose BGP identifier has the lowest value. 1818 9.1.3 Phase 3: Route Dissemination 1820 The Phase 3 decision function shall be invoked on completion of Phase 1822 RFC DRAFT August 1992 1824 2, or when any of the following events occur: 1826 a) when routes in a Loc-RIB to local destinations have changed 1828 b) when locally generated routes learned by means outside of BGP 1829 have changed 1831 c) when a new BGP speaker - BGP speaker connection has been 1832 established 1834 The Phase 3 function is a separate process which completes when it 1835 has no further work to do. The Phase 3 Routing Decision function 1836 shall be blocked from running while the Phase 2 decision function is 1837 in process. 1839 All routes in the Loc-RIB shall be processed into a corresponding 1840 entry in the associated Adj-RIBs-Out. Route aggregation and 1841 information reduction techniques (see 9.2.4.1) may optionally be 1842 applied. 1844 For the benefit of future support of inter-AS multicast capabilities, 1845 a BGP speaker that participates in the inter-AS multicast shall 1846 advertise a route it receives from one of its external peers and 1847 installs in its Loc-RIB back to the peer from which the route was 1848 received. For a BGP speaker that does not participate in the inter-AS 1849 multicast such an advertisement is optional. When doing such an 1850 advertisement, the NEXT_HOP attribute should be set to the address of 1851 the peer. An implementation may also optimize such an advertisement 1852 by truncating information in the AS_PATH attribute to include only 1853 its own AS number and that of the peer that advertised the route 1854 (such truncation requires the ORIGIN attribute to be set to 1855 INCOMPLETE). In addition an implementation is not required to pass 1856 optional or discretionary path attributes with such an advertisement. 1858 When the updating of the Adj-RIBs-Out and the Forwarding Information 1859 Base (FIB) is complete, the local BGP speaker shall run the external 1860 update process of 9.2.2. 1862 9.1.4 Overlapping Routes 1864 A BGP speaker may transmit routes with overlapping Network Layer 1865 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 1866 occurs when a set of destinations are identified in non-matching 1867 multiple routes. Since BGP encodes NLRI using IP prefixes, overlap 1868 will always exhibit subset relationships. A route describing a 1870 RFC DRAFT August 1992 1872 smaller set of destinations (a longer prefix) is said to be more 1873 specific than a route describing a larger set of destinations (a 1874 shorted prefix); similarly, a route describing a larger set of 1875 destinations (a shorter prefix) is said to be less specific than a 1876 route describing a smaller set of destinations (a longer prefix). 1878 The precedence relationship effectively decomposes less specific 1879 routes into two parts: 1881 - a set of destinations described only by the less specific 1882 route, and 1884 - a set of destinations described by the overlap of the less 1885 specific and the more specific routes 1887 When overlapping routes are present in the same Adj-RIB-In, the more 1888 specific route shall take precedence, in order from more specific to 1889 least specific. 1891 The set of destinations described by the overlap represents a portion 1892 of the less specific route that is feasible, but is not currently in 1893 use. If a more specific route is later withdrawn, the set of 1894 destinations described by the overlap will still be reachable using 1895 the less specific route. 1897 If a BGP speaker receives overlapping routes, the Decision Process 1898 shall take into account the semantics of the overlapping routes. In 1899 particular, if a BGP speaker accepts the less specific route while 1900 rejecting the more specific route from the same neighbor, then the 1901 destinations represented by the overlap may not forward along the ASs 1902 listed in the AS_PATH attribute of that route. Therefore, a BGP 1903 speaker has the following choices: 1905 a) Install both the less and the more specific routes 1907 b) Install the more specific route only 1909 c) Install the non-overlapping part of the less specific 1910 route only (that implies de-aggregation) 1912 d) Aggregate the two routes and install the aggregated route 1914 e) Install the less specific route only 1916 f) Install neither route 1918 If a BGP speaker chooses e), then it should add ATOMIC_AGGREGATE 1920 RFC DRAFT August 1992 1922 attribute to the route. A route that carries ATOMIC_AGGREGATE 1923 attribute can not be de-aggregated. That is, the NLRI of this route 1924 can not be made more specific. Forwarding along such a route does 1925 not guarantee that IP packets will actually traverse only ASs listed 1926 in the AS_PATH attribute of the route. If a BGP speaker chooses a), 1927 it must not advertise the more general route without the more 1928 specific route. 1930 9.2 Update-Send Process 1932 The Update-Send process is responsible for advertising UPDATE 1933 messages to adjacent BGP speakers. For example, it distributes the 1934 routes chosen by the Decision Process to other BGP speakers which may 1935 be located in either the same autonomous system or an adjacent 1936 autonomous system. Rules for information exchange between BGP 1937 speakers located in different autonomous systems are given in 9.2.2; 1938 rules for information exchange between BGP speakers located in the 1939 same autonomous system are given in 9.2.1. 1941 Distribution of routing information between a set of BGP speakers, 1942 all of which are located in the same autonomous system, is referred 1943 to as internal distribution. 1945 9.2.1 Internal Updates 1947 The Internal update process is concerned with the distribution of 1948 routing information to BGP speakers located in the local speaker's 1949 autonomous system. 1951 When a BGP speaker receives an UPDATE message from another BGP 1952 speaker located in its own autonomous system, the receiving BGP 1953 speaker shall not re-distribute the routing information contained in 1954 that UPDATE message to other BGP speakers located in its own 1955 autonomous system. 1957 When a BGP speaker receives a new route from a BGP speaker in an 1958 adjacent autonomous system, it shall advertise that route to all 1959 other BGP speakers in its autonomous system by means of an UPDATE 1960 message if any of the following conditions occur: 1962 1) the degree of preference assigned to the newly received route 1963 by the local BGP speaker is higher than the degree of preference 1964 that the local speaker has assigned to other routes that have been 1965 received from BGP speakers in adjacent autonomous systems, or 1967 RFC DRAFT August 1992 1969 2) there are no other routes that have been received from BGP 1970 speakers in adjacent autonomous systems, or 1972 3) the newly received route is selected as a result of breaking a 1973 tie between several routes which have the highest degree of 1974 preference, and the same destination. 1976 When a BGP speaker receives an UPDATE message with a non-empty 1977 WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all 1978 routes whose destinations was carried in this field (as IP prefixes). 1979 The speaker shall take the following additional steps: 1981 1) if the corresponding feasible route had not been previously 1982 advertised, then no further action is necessary 1984 2) if the corresponding feasible route had been previously 1985 advertised, then: 1987 i) if a new route is selected for advertisement that has the 1988 same Network Layer Reachability Information as the unfeasible 1989 routes, then the local BGP speaker shall advertise the 1990 replacement route 1992 ii) if a replacement route is not available for advertisement, 1993 then the BGP speaker shall include the destinations of the 1994 unfeasible route (in form of IP prefixes) in the WITHDRAWN 1995 ROUTES field of an UPDATE message, and shall send this message 1996 to each neighbor BGP speaker to whom it had previously 1997 advertised the corresponding feasible route. 1999 All feasible routes which are advertised shall be placed in the 2000 appropriate Adj-RIBs-Out, and all unfeasible routes which are 2001 advertised shall be removed from the Adj-RIBs-Out. 2003 9.2.1.1 Breaking Ties (Internal Updates) 2005 If a local BGP speaker has connections to several BGP speakers in 2006 adjacent autonomous systems, there will be multiple Adj-RIBs-In 2007 associated with these neighbors. These Adj-RIBs-In might contain 2008 several equally preferable routes to the same destination, all of 2009 which were advertised by BGP speakers located in adjacent autonomous 2010 systems. The local BGP speaker shall select one of these routes 2011 according to the following rules: 2013 a) If the candidate route differ only in their NEXT_HOP and 2015 RFC DRAFT August 1992 2017 MULTI_EXIT_DISC attributes, and the local system is configured to 2018 take into account MULTI_EXIT_DISC attribute, select the routes 2019 that has the lowest value of the MULTI_EXIT_DISC attribute. 2021 b) In all other cases, select the route that was advertised by the 2022 BGP speaker whose BGP Identifier has the lowest value. 2024 9.2.2 External Updates 2026 The external update process is concerned with the distribution of 2027 routing information to BGP speakers located in adjacent autonomous 2028 systems. As part of Phase 3 route selection process, the BGP speaker 2029 has updated its Adj-RIBs-Out and its Forwarding Table. All newly 2030 installed routes and all newly unfeasible routes for which there is 2031 no replacement route shall be advertised to BGP speakers located in 2032 adjacent autonomous systems by means of UPDATE message. 2034 Any routes in the Loc-RIB marked as unfeasible shall be removed. 2035 Changes to the reachable destinations within its own autonomous 2036 system shall also be advertised in an UPDATE message. 2038 9.2.3 Controlling Routing Traffic Overhead 2040 The BGP protocol constrains the amount of routing traffic (that is, 2041 UPDATE messages) in order to limit both the link bandwidth needed to 2042 advertise UPDATE messages and the processing power needed by the 2043 Decision Process to digest the information contained in the UPDATE 2044 messages. 2046 9.2.3.1 Frequency of Route Advertisement 2048 The parameter MinRouteAdvertisementInterval determines the minimum 2049 amount of time that must elapse between advertisement of routes to a 2050 particular destination from a single BGP speaker. This rate limiting 2051 procedure applies on a per-destination basis, although the value of 2052 MinRouteAdvertisementInterval is set on a per BGP peer basis. 2054 Two UPDATE messages sent from a single BGP speaker that advertise 2055 feasible routes to some common set of destinations received from BGP 2056 speakers in adjacent autonomous systems must be separated by at least 2057 MinRouteAdvertisementInterval. Clearly, this can only be achieved 2059 RFC DRAFT August 1992 2061 precisely by keeping a separate timer for each common set of 2062 destinations. This would be unwarranted overhead. Any technique which 2063 ensures that the interval between two UPDATE messages sent from a 2064 single BGP speaker that advertise feasible routes to some common set 2065 of destinations received from BGP speakers in adjacent autonomous 2066 systems will be at least MinRouteAdvertisementInterval, and will also 2067 ensure a constant upper bound on the interval is acceptable. 2069 Since fast convergence is needed within an autonomous system, this 2070 procedure does not apply for routes receives from other BGP speakers 2071 in the same autonomous system. To avoid long-lived black holes, the 2072 procedure does not apply to the explicit withdrawal of unfeasible 2073 routes (that is, routes whose destinations (expressed as IP prefixes) 2074 are listed in the WITHDRAWN ROUTES field of an UPDATE message). 2076 This procedure does not limit the rate of route selection, but only 2077 the rate of route advertisement. If new routes are selected multiple 2078 times while awaiting the expiration of MinRouteAdvertisementInterval, 2079 the last route selected shall be advertised at the end of 2080 MinRouteAdvertisementInterval. 2082 9.2.3.2 Frequency of Route Origination 2084 The parameter MinASOriginationInterval determines the minimum amount 2085 of time that must elapse between successive advertisements of UPDATE 2086 messages that report changes within the advertising BGP speaker's own 2087 autonomous systems. 2089 9.2.3.3 Jitter 2091 To minimize the likelihood that the distribution of BGP messages by a 2092 given BGP speaker will contain peaks, jitter should be applied to the 2093 timers associated with MinASOriginationInterval, Keepalive, and 2094 MinRouteAdvertisementInterval. A given BGP speaker shall apply the 2095 same jitter to each of these quantities regardless of the 2096 destinations to which the updates are being sent; that is, jitter 2097 will not be applied on a "per peer" basis. 2099 9.2.4 Efficient Organization of Routing Information 2101 Having selected the routing information which it will advertise, a 2103 RFC DRAFT August 1992 2105 BGP speaker may avail itself of several methods to organize this 2106 information in an efficient manner. 2108 9.2.4.1 Information Reduction 2110 Information reduction may imply a reduction in granularity of policy 2111 control - after information is collapsed, the same policies will 2112 apply to all destinations and paths in the equivalence class. 2114 The Decision Process may optionally reduce the amount of information 2115 that it will place in the Adj-RIBs-Out by any of the following 2116 methods: 2118 a) Network Layer Reachability Information (NLRI): 2120 Destination IP addresses can be represented as IP address 2121 prefixes. In cases where there is a correspondence between the 2122 address structure and the systems under control of an autonomous 2123 system administrator, it will be possible to reduce the size of 2124 the NLRI carried in the UPDATE messages. 2126 b) AS_PATHs: 2128 AS path information can be represented as ordered AS_SEQUENCEs or 2129 unordered AS_SETs. AS_SETs are used in the route aggregation 2130 algorithm described in 9.2.4.2. They reduce the size of the 2131 AS_PATH information by listing each AS number only once, 2132 regardless of how many times it may have appeared in multiple 2133 AS_PATHs that were aggregated. 2135 An AS_SET implies that the destinations listed in the NLRI can be 2136 reached through paths that traverse at least some of the 2137 constituent autonomous systems. AS_SETs provide sufficient 2138 information to avoid routing information looping; however their 2139 use may prune potentially feasible paths, since such paths are no 2140 longer listed individually as in the form of AS_SEQUENCEs. In 2141 practice this is not likely to be a problem, since once an IP 2142 packet arrives at the edge of a group of autonomous systems, the 2143 BGP speaker at that point is likely to have more detailed path 2144 information and can distinguish individual paths to destinations. 2146 9.2.4.2 Aggregating Routing Information 2148 Aggregation is the process of combining the characteristics of 2150 RFC DRAFT August 1992 2152 several different routes in such a way that a single route can be 2153 advertised. Aggregation can occur as part of the decision process 2154 to reduce the amount of routing information that will be placed in 2155 the Adj-RIBs-Out. 2157 Aggregation reduces the amount of information that a BGP speaker must 2158 store and exchange with other BGP speakers. Routes can be aggregated 2159 by applying the following procedure separately to path attributes of 2160 like type and to the Network Layer Reachability Information. 2162 Routes that have the following attributes shall not be aggregated 2163 unless the corresponding attributes of each route are identical: 2164 MULTI_EXIT_DISC, NEXT_HOP. 2166 Path attributes that have different type codes can not be aggregated 2167 together. Path of the same type code may be aggregated, according to 2168 the following rules: 2170 ORIGIN attribute: If at least one route among routes that are 2171 aggregated has ORIGIN with the value INCOMPLETE, then the 2172 aggregated route must have the ORIGIN attribute with the value 2173 INCOMPLETE. Otherwise, if at least one route among routes that are 2174 aggregated has ORIGIN with the value EGP, then the aggregated 2175 route must have the origin attribute with the value EGP. In all 2176 other case the value of the ORIGIN attribute of the aggregated 2177 route is INTERNAL. 2179 AS_PATH attribute: If routes to be aggregated have identical 2180 AS_PATH attributes, then the aggregated route has the same AS_PATH 2181 attribute as each individual route. 2183 For the purpose of aggregating AS_PATH attributes we model each AS 2184 within the AS_PATH attribute as a tuple , where 2185 "type" identifies a type of the path segment the AS belongs to 2186 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If the 2187 routes to be aggregated have different AS_PATH attributes, then 2188 the aggregated AS_PATH attribute shall satisfy all of the 2189 following conditions: 2191 - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH 2192 shall appear in all of the AS_PATH in the initial set of routes 2193 to be aggregated. 2195 - all tuples of the type AS_SET in the aggregated AS_PATH shall 2196 appear in at least one of the AS_PATH in the initial set (they 2197 may appear as either AS_SET or AS_SEQUENCE types). 2199 - for any tuple X of the type AS_SEQUENCE in the aggregated 2201 RFC DRAFT August 1992 2203 AS_PATH which precedes tuple Y in the aggregated AS_PATH, X 2204 precedes Y in each AS_PATH in the initial set which contains Y, 2205 regardless of the type of Y. 2207 - No tuple with the same value shall appear more than once in 2208 the aggregated AS_PATH, regardless of the tuple's type. 2210 An implementation may choose any algorithm which conforms to these 2211 rules. At a minimum a conformant implementation shall be able to 2212 perform the following algorithm that meets all of the above 2213 conditions: 2215 - determine the longest leading sequence of tuples (as defined 2216 above) common to all the AS_PATH attributes of the routes to be 2217 aggregated. Make this sequence the leading sequence of the 2218 aggregated AS_PATH attribute. 2220 - set the type of the rest of the tuples from the AS_PATH 2221 attributes of the routes to be aggregated to AS_SET, and append 2222 them to the aggregated AS_PATH attribute. 2224 - if the aggregated AS_PATH has more than one tuple with the 2225 same value (regardless of tuple's type), eliminate all, but one 2226 such tuple by deleting tuples of the type AS_SET from the 2227 aggregated AS_PATH attribute. 2229 Appendix 6, section 6.8 presents another algorithm that satisfies 2230 the conditions and allows for more complex policy configurations. 2232 ATOMIC_AGGREGATE: If at least one of the routes to be aggregated 2233 has ATOMIC_AGGREGATE path attribute, then the aggregated route 2234 shall have this attribute as well. 2236 AGGREGATOR: All AGGREGATOR attributes of all routes to be 2237 aggregated should be ignored. 2239 9.3.6 Route Selection Criteria 2241 Generally speaking, the rules for comparing routes among several 2242 alternatives are outside the scope of this document. There are two 2243 exceptions: 2245 - If the local AS appears in the AS path of the new route being 2246 considered, then that new route cannot be viewed as better than 2247 any other route. If such a route were ever used, a routing loop 2248 would result. 2250 RFC DRAFT August 1992 2252 - In order to achieve successful distributed operation, only 2253 routes with a likelihood of stability can be chosen. Thus, an AS 2254 must avoid using unstable routes, and it must not make rapid 2255 spontaneous changes to its choice of route. Quantifying the terms 2256 "unstable" and "rapid" in the previous sentence will require 2257 experience, but the principle is clear. 2259 Appendix 1. BGP FSM State Transitions and Actions. 2261 This Appendix discusses the transitions between states in the BGP FSM 2262 in response to BGP events. The following is the list of these states 2263 and events. 2265 BGP States: 2267 1 - Idle 2268 2 - Connect 2269 3 - Active 2270 4 - OpenSent 2271 5 - OpenConfirm 2272 6 - Established 2274 BGP Events: 2276 1 - BGP Start 2277 2 - BGP Stop 2278 3 - BGP Transport connection open 2279 4 - BGP Transport connection closed 2280 5 - BGP Transport connection open failed 2281 6 - BGP Transport fatal error 2282 7 - ConnectRetry timer expired 2283 8 - Holdtime timer expired 2284 9 - KeepAlive timer expired 2285 10 - Receive OPEN message 2286 11 - Receive KEEPALIVE message 2287 12 - Receive UPDATE messages 2288 13 - Receive NOTIFICATION message 2290 The following table describes the state transitions of the BGP FSM 2291 and the actions triggered by these transitions. 2293 RFC DRAFT August 1992 2295 Event Actions Message Sent Next State 2296 -------------------------------------------------------------------- 2297 Idle (1) 2298 1 Initialize resources none 2 2299 Start ConnectRetry timer 2300 Initiate a transport connection 2301 others none none 1 2303 Connect(2) 2304 1 none none 2 2305 3 Complete initialization OPEN 4 2306 Clear ConnectRetry timer 2307 5 Restart ConnectRetry timer none 3 2308 7 Restart ConnectRetry timer none 2 2309 Initiate a transport connection 2310 others Release resources none 1 2312 Active (3) 2313 1 none none 3 2314 3 Complete initialization OPEN 4 2315 Clear ConnectRetry timer 2316 5 Close connection 3 2317 Restart ConnectRetry timer 2318 7 Restart ConnectRetry timer none 2 2319 Initiate a transport connection 2320 others Release resources none 1 2322 OpenSent(4) 2323 1 none none 4 2324 4 Close transport connection none 3 2325 Restart ConnectRetry timer 2326 6 Release resources none 1 2327 10 Process OPEN is OK KEEPALIVE 5 2328 Process OPEN failed NOTIFICATION 1 2329 others Close transport connection NOTIFICATION 1 2330 Release resources 2332 OpenConfirm (5) 2333 1 none none 5 2334 4 Release resources none 1 2335 6 Release resources none 1 2336 9 Restart KeepAlive timer KEEPALIVE 5 2337 11 Complete initialization none 6 2338 Restart Holdtime timer 2339 13 Close transport connection 1 2340 Release resources 2341 others Close transport connection NOTIFICATION 1 2342 Release resources 2344 RFC DRAFT August 1992 2346 Established (6) 2347 1 none none 6 2348 4 Release resources none 1 2349 6 Release resources none 1 2350 9 Restart KeepAlive timer KEEPALIVE 6 2351 11 Restart Holdtime timer KEEPALIVE 6 2352 12 Process UPDATE is OK UPDATE 6 2353 Process UPDATE failed NOTIFICATION 1 2354 13 Close transport connection 1 2355 Release resources 2356 others Close transport connection NOTIFICATION 1 2357 Release resources 2358 --------------------------------------------------------------------- 2360 The following is a condensed version of the above state transition 2361 table. 2363 Events| Idle | Active | Connect | OpenSent | OpenConfirm | Estab 2364 | (1) | (2) | (3) | (4) | (5) | (6) 2365 |-------------------------------------------------------------- 2366 1 | 2 | 2 | 3 | 4 | 5 | 6 2367 | | | | | | 2368 2 | 1 | 1 | 1 | 1 | 1 | 1 2369 | | | | | | 2370 3 | 1 | 4 | 4 | 1 | 1 | 1 2371 | | | | | | 2372 4 | 1 | 1 | 1 | 3 | 1 | 1 2373 | | | | | | 2374 5 | 1 | 3 | 3 | 1 | 1 | 1 2375 | | | | | | 2376 6 | 1 | 1 | 1 | 1 | 1 | 1 2377 | | | | | | 2378 7 | 1 | 2 | 2 | 1 | 1 | 1 2379 | | | | | | 2380 8 | 1 | 1 | 1 | 1 | 1 | 1 2381 | | | | | | 2382 9 | 1 | 1 | 1 | 1 | 5 | 6 2383 | | | | | | 2384 10 | 1 | 1 | 1 | 1 or 5 | 1 | 1 2385 | | | | | | 2386 11 | 1 | 1 | 1 | 1 | 6 | 6 2387 | | | | | | 2388 12 | 1 | 1 | 1 | 1 | 1 | 1 or 6 2390 RFC DRAFT August 1992 2392 | | | | | | 2393 13 | 1 | 1 | 1 | 1 | 1 | 1 2394 | | | | | | 2395 --------------------------------------------------------------- 2397 Appendix 2. Comparison with RFC1267 2399 BGP-4 is capable of operating in an environment where a set of 2400 reachable destinations may be expressed via a single IP prefix. The 2401 concept of network classes, or subnetting is foreign to BGP-4. To 2402 accommodate these capabilities BGP-4 changes semantics and encoding 2403 associated with the AS_PATH attribute. New text has been added to 2404 define semantics associated with IP prefixes. These abilities allow 2405 BGP-4 to support the proposed supernetting scheme [9]. 2407 To simplify configuration this version introduces a new attribute, 2408 LOCAL_PREF, that facilitates route selection procedures. 2410 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 2411 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 2412 certain aggregates are not de-aggregated. Another new attribute, 2413 AGGREGATOR, can be added to aggregate routes in order to advertise 2414 which AS caused the aggregation. 2416 Appendix 3. Comparison with RFC 1163 2418 All of the changes listed in Appendix 2, plus the following. 2420 To detect and recover from BGP connection collision, a new field (BGP 2421 Identifier) has been added to the OPEN message. New text (Section 2422 6.8) has been added to specify the procedure for detecting and 2423 recovering from collision. 2425 The new document no longer restricts the border router that is passed 2426 in the NEXT_HOP path attribute to be part of the same Autonomous 2427 System as the BGP Speaker. 2429 New document optimizes and simplifies the exchange of the information 2430 about previously reachable routes. 2432 RFC DRAFT August 1992 2434 Appendix 4. Comparison with RFC 1105 2436 All of the changes listed in Appendices 2 and 3, plus the following. 2438 Minor changes to the RFC1105 Finite State Machine were necessary to 2439 accommodate the TCP user interface provided by 4.3 BSD. 2441 The notion of Up/Down/Horizontal relations present in RFC1105 has 2442 been removed from the protocol. 2444 The changes in the message format from RFC1105 are as follows: 2446 1. The Hold Time field has been removed from the BGP header and 2447 added to the OPEN message. 2449 2. The version field has been removed from the BGP header and 2450 added to the OPEN message. 2452 3. The Link Type field has been removed from the OPEN message. 2454 4. The OPEN CONFIRM message has been eliminated and replaced with 2455 implicit confirmation provided by the KEEPALIVE message. 2457 5. The format of the UPDATE message has been changed 2458 significantly. New fields were added to the UPDATE message to 2459 support multiple path attributes. 2461 6. The Marker field has been expanded and its role broadened to 2462 support authentication. 2464 Note that quite often BGP, as specified in RFC 1105, is referred 2465 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 2466 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 2467 BGP, as specified in this document is referred to as BGP-4. 2469 Appendix 5. TCP options that may be used with BGP 2471 If a local system TCP user interface supports TCP PUSH function, then 2472 each BGP message should be transmitted with PUSH flag set. Setting 2473 PUSH flag forces BGP messages to be transmitted promptly to the 2474 receiver. 2476 If a local system TCP user interface supports setting precedence for 2477 TCP connection, then the BGP transport connection should be opened 2478 with precedence set to Internetwork Control (110) value (see also 2480 RFC DRAFT August 1992 2482 [6]). 2484 Appendix 6. Implementation Recommendations 2486 This section presents some implementation recommendations. 2488 6.1 Multiple Networks Per Message 2490 The BGP protocol allows for multiple networks with the same AS path 2491 and next-hop gateway to be specified in one message. Making use of 2492 this capability is highly recommended. With one network per message 2493 there is a substantial increase in overhead in the receiver. Not only 2494 does the system overhead increase due to the reception of multiple 2495 messages, but the overhead of scanning the routing table for updates 2496 to BGP peers and other routing protocols (and sending the associated 2497 messages) is incurred multiple times as well. One method of building 2498 messages containing many networks per AS path and gateway from a 2499 routing table that is not organized per AS path is to build many 2500 messages as the routing table is scanned. As each network is 2501 processed, a message for the associated AS path and gateway is 2502 allocated, if it does not exist, and the new network is added to it. 2503 If such a message exists, the new network is just appended to it. If 2504 the message lacks the space to hold the new network, it is 2505 transmitted, a new message is allocated, and the new network is 2506 inserted into the new message. When the entire routing table has been 2507 scanned, all allocated messages are sent and their resources 2508 released. Maximum compression is achieved when all networks share a 2509 gateway and common path attributes, making it possible to send many 2510 networks in one 4096-byte message. 2512 When peering with a BGP implementation that does not compress 2513 multiple networks into one message, it may be necessary to take steps 2514 to reduce the overhead from the flood of data received when a peer is 2515 acquired or a significant network topology change occurs. One method 2516 of doing this is to limit the rate of updates. This will eliminate 2517 the redundant scanning of the routing table to provide flash updates 2518 for BGP peers and other routing protocols. A disadvantage of this 2519 approach is that it increases the propagation latency of routing 2520 information. By choosing a minimum flash update interval that is not 2521 much greater than the time it takes to process the multiple messages 2522 this latency should be minimized. A better method would be to read 2523 all received messages before sending updates. 2525 RFC DRAFT August 1992 2527 6.2 Processing Messages on a Stream Protocol 2529 BGP uses TCP as a transport mechanism. Due to the stream nature of 2530 TCP, all the data for received messages does not necessarily arrive 2531 at the same time. This can make it difficult to process the data as 2532 messages, especially on systems such as BSD Unix where it is not 2533 possible to determine how much data has been received but not yet 2534 processed. 2536 One method that can be used in this situation is to first try to read 2537 just the message header. For the KEEPALIVE message type, this is a 2538 complete message; for other message types, the header should first be 2539 verified, in particular the total length. If all checks are 2540 successful, the specified length, minus the size of the message 2541 header is the amount of data left to read. An implementation that 2542 would "hang" the routing information process while trying to read 2543 from a peer could set up a message buffer (4096 bytes) per peer and 2544 fill it with data as available until a complete message has been 2545 received. 2547 6.3 Reducing route flapping 2549 To avoid excessive route flapping a BGP speaker which needs to 2550 withdraw a destination and send an update about a more specific or 2551 less specific route shall combine them into the same UPDATE message. 2553 6.4 BGP Timers 2555 BGP employs five timers: ConnectRetry, Holdtime, KeepAlive, 2556 MinRouteOriginationInterval, and MinRouteAdvertisementInterval 2557 Suggested value for the ConnectRetry timer is 120 seconds. Suggested 2558 value for the Holdtime timer is 90 seconds. Suggested value for the 2559 KeepAlive timer is 30 seconds. Suggested value for the 2560 MinRouteOriginationInterval is 15 minutes. Suggested value for the 2561 MinRouteAdvertisementInterval is 30 seconds. 2563 An implementation of BGP shall allow any of these timers to be 2564 configurable. 2566 RFC DRAFT August 1992 2568 6.5 Path attribute ordering 2570 Implementations which combine update messages as described above in 2571 6.1 may prefer to see all path attributes presented in a known order. 2572 This permits them to quickly identify sets of attributes from 2573 different update messages which are semantically identical. To 2574 facilitate this, it is a useful optimization to order the path 2575 attributes according to type code. This optimization is entirely 2576 optional. 2578 6.6 AS_SET sorting 2580 Another useful optimization that can be done to simplify this 2581 situation is to sort the AS numbers found in an AS_SET. This 2582 optimization is entirely optional. 2584 6.7 Control over version negotiation 2586 Since BGP-4 is capable of carrying aggregated routes which cannot be 2587 properly represented in BGP-3, an implementation which supports BGP-4 2588 and another BGP version should provide the capability to only speak 2589 BGP-4 on a per-neighbor basis. 2591 6.8 Complex AS_PATH aggregation 2593 An implementation which chooses to provide a path aggregation 2594 algorithm which retains significant amounts of path information may 2595 wish to use the following procedure: 2597 For the purpose of aggregating AS_PATH attributes of two routes, 2598 we model each AS as a tuple , where "type" identifies 2599 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 2600 AS_SET), and "value" is the AS number. Two ASs are said to be the 2601 same if their corresponding tuples are the same. 2603 The algorithm to aggregate two AS_PATH attributes works as 2604 follows: 2606 a) Identify the same ASs (as defined above) within each AS_PATH 2607 attribute that are in the same relative order within both 2608 AS_PATH attributes. Two ASs, X and Y, are said to be in the 2610 RFC DRAFT August 1992 2612 same order if either: 2613 - X precedes Y in both AS_PATH attributes, or - Y precedes X 2614 in both AS_PATH attributes. 2616 b) The aggregated AS_PATH attribute consists of ASs identified 2617 in (a) in exactly the same order as they appear in the AS_PATH 2618 attributes to be aggregated. If two consecutive ASs identified 2619 in (a) do not immediately follow each other in both of the 2620 AS_PATH attributes to be aggregated, then the intervening ASs 2621 (ASs that are between the two consecutive ASs that are the 2622 same) in both attributes are combined into an AS_SET path 2623 segment that consists of the intervening ASs from both AS_PATH 2624 attributes; this segment is then placed in between the two 2625 consecutive ASs identified in (a) of the aggregated attribute. 2626 If two consecutive ASs identified in (a) immediately follow 2627 each other in one attribute, but do not follow in another, then 2628 the intervening ASs of the latter are combined into an AS_SET 2629 path segment; this segment is then placed in between the two 2630 consecutive ASs identified in (a) of the aggregated attribute. 2632 If as a result of the above procedure a given AS number appears 2633 more than once within the aggregated AS_PATH attribute, all, but 2634 the last instance (rightmost occurrence) of that AS number should 2635 be removed from the aggregated AS_PATH attribute. 2637 References 2639 [1] Mills, D., "Exterior Gateway Protocol Formal Specification", RFC 2640 904, BBN, April 1984. 2642 [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET 2643 Backbone", RFC 1092, T.J. Watson Research Center, February 1989. 2645 [3] Braun, H-W., "The NSFNET Routing Architecture", RFC 1093, 2646 MERIT/NSFNET Project, February 1989. 2648 [4] Postel, J., "Transmission Control Protocol - DARPA Internet 2649 Program Protocol Specification", RFC 793, DARPA, September 1981. 2651 [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway 2652 Protocol in the Internet", RFC 1268, T.J. Watson Research Center, IBM 2653 Corp., ANS, October 1991. 2655 [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol 2656 Specification", RFC 791, DARPA, September 1981. 2658 RFC DRAFT August 1992 2660 [7] "Information Processing Systems - Telecommunications and 2661 Information Exchange between Systems - Protocol for Exchange of 2662 Inter-domain Routeing Information among Intermediate Systems to 2663 Support Forwarding of ISO 8473 PDUs", ISO/IEC JTC 1/SC 6 N7196, March 2664 1992. 2666 [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., "Supernetting: an 2667 Address Assignment and Aggregation Strategy", Internet Draft, 1992. 2669 Security Considerations 2671 Security issues are not discussed in this memo. 2673 Editors' Addresses 2675 Yakov Rekhter 2676 T.J. Watson Research Center IBM Corporation 2677 P.O. Box 218 2678 Yorktown Heights, NY 10598 2679 Phone: (914) 945-3896 2680 email: yakov@watson.ibm.com 2682 Tony Li 2683 cisco Systems, Inc. 2684 1525 O'Brien Drive 2685 Menlo Park, CA 94025 2686 email: tli@cisco.com