idnits 2.17.1 draft-ietf-idr-bgp4-01.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 expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity. ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. ** The document is more than 15 pages and seems to lack a Table of Contents. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 58 longer pages, the longest (page 2) being 61 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Abstract section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 5 instances of too long lines in the document, the longest one being 4 characters in excess of 72. ** There is 1 instance of lines with control characters in the document. == There is 4 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 387: '...sage, a BGP speaker MUST calculate the...' RFC 2119 keyword, line 390: '... Hold Time MUST be either zero o...' RFC 2119 keyword, line 787: '... MUST NOT be sent more frequently th...' RFC 2119 keyword, line 788: '... implementation MAY adjust the rate a...' RFC 2119 keyword, line 792: '... messages MUST NOT be sent....' (9 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 725 has weird spacing: '... Length are t...' == Line 1137 has weird spacing: '...is less than...' == Line 1625 has weird spacing: '...s whose desti...' == Line 1997 has weird spacing: '...nations of th...' == Line 2161 has weird spacing: '...ecision proce...' == (2 more instances...) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (June 1995) is 10542 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Historic RFC: RFC 904 (ref. '1') ** Downref: Normative reference to an Unknown state RFC: RFC 1092 (ref. '2') ** Downref: Normative reference to an Unknown state RFC: RFC 1093 (ref. '3') ** Obsolete normative reference: RFC 793 (ref. '4') (Obsoleted by RFC 9293) -- Possible downref: Non-RFC (?) normative reference: ref. '5' -- Possible downref: Non-RFC (?) normative reference: ref. '7' ** Obsolete normative reference: RFC 1519 (ref. '8') (Obsoleted by RFC 4632) ** Downref: Normative reference to an Historic RFC: RFC 1518 (ref. '9') Summary: 19 errors (**), 0 flaws (~~), 9 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Network Working Group Y. Rekhter 2 INTERNET DRAFT cisco Systems 3 T.Li 4 cisco Systems 5 Editors 6 June 1995 8 A Border Gateway Protocol 4 (BGP-4) 10 Status of this Memo 12 This document, together with its companion document, "Application of 13 the Border Gateway Protocol in the Internet", define an inter- 14 autonomous system routing protocol for the Internet. This document 15 specifies an IAB standards track protocol for the Internet community, 16 and requests discussion and suggestions for improvements. Please 17 refer to the current edition of the "IAB Official Protocol Standards" 18 for the standardization state and status of this protocol. 19 Distribution of this document is unlimited. 21 This document is an Internet Draft. Internet Drafts are working 22 documents of the Internet Engineering Task Force (IETF), its Areas, 23 and its Working Groups. Note that other groups may also distribute 24 working documents as Internet Drafts. 26 Internet Drafts are draft documents valid for a maximum of six 27 months. Internet Drafts may be updated, replaced, or obsoleted by 28 other documents at any time. It is not appropriate to use Internet 29 Drafts as reference material or to cite them other than as a "working 30 draft" or "work in progress". 32 1. Acknowledgements 34 This document was originally published as RFC 1267 in October 1991, 35 jointly authored by Kirk Lougheed (cisco Systems) and Yakov Rekhter 36 (cisco Systems). 38 We would like to express our thanks to Guy Almes (ANS), Len Bosack 39 (XKL Systems), and Jeffrey C. Honig (Cornell University) for their 40 contributions to the earlier version of this document. 42 We like to explicitly thank Bob Braden (ISI) for the review of the 43 earlier version of this document as well as his constructive and 44 valuable comments. 46 RFC DRAFT June 1995 48 We would also like to thank Bob Hinden, Director for Routing of the 49 Internet Engineering Steering Group, and the team of reviewers he 50 assembled to review the previous version (BGP-2) of this document. 51 This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia 52 Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted 53 with a strong combination of toughness, professionalism, and 54 courtesy. 56 This updated version of the document is the product of the IETF IDR 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 was the IDRP editor within that group. We would also 62 like to thank Mike Craren (Proteon, Inc.), Dimitry Haskin (Bay 63 Networks, Inc.), John Krawczyk (Bay Networks, Inc.), and Paul Traina 64 (cisco Systems) for their insightful comments. 66 We would like to specially acknowledge numerous contributions by 67 Dennis Ferguson (MCI). 69 2. Introduction 71 The Border Gateway Protocol (BGP) is an inter-Autonomous System 72 routing protocol. It is built on experience gained with EGP as 73 defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as 74 described in RFC 1092 [2] and RFC 1093 [3]. 76 The primary function of a BGP speaking system is to exchange network 77 reachability information with other BGP systems. This network 78 reachability information includes information on the list of 79 Autonomous Systems (ASs) that reachability information traverses. 80 This information is sufficient to construct a graph of AS 81 connectivity from which routing loops may be pruned and some policy 82 decisions at the AS level may be enforced. 84 BGP-4 provides a new set of mechanisms for supporting classless 85 interdomain routing. These mechanisms include support for 86 advertising an IP prefix and eliminates the concept of network 87 "class" within BGP. BGP-4 also introduces mechanisms which allow 88 aggregation of routes, including aggregation of AS paths. These 89 changes provide support for the proposed supernetting scheme [8, 9]. 91 To characterize the set of policy decisions that can be enforced 92 using BGP, one must focus on the rule that a BGP speaker advertise to 93 its peers (other BGP speakers which it communicates with) in 94 neighboring ASs only those routes that it itself uses. This rule 95 RFC DRAFT June 1995 97 reflects the "hop-by-hop" routing paradigm generally used throughout 98 the current Internet. Note that some policies cannot be supported by 99 the "hop-by-hop" routing paradigm and thus require techniques such as 100 source routing to enforce. For example, BGP does not enable one AS 101 to send traffic to a neighboring AS intending that the traffic take a 102 different route from that taken by traffic originating in the 103 neighboring AS. On the other hand, BGP can support any policy 104 conforming to the "hop-by-hop" routing paradigm. Since the current 105 Internet uses only the "hop-by-hop" routing paradigm and since BGP 106 can support any policy that conforms to that paradigm, BGP is highly 107 applicable as an inter-AS routing protocol for the current Internet. 109 A more complete discussion of what policies can and cannot be 110 enforced with BGP is outside the scope of this document (but refer to 111 the companion document discussing BGP usage [5]). 113 BGP runs over a reliable transport protocol. This eliminates the 114 need to implement explicit update fragmentation, retransmission, 115 acknowledgement, and sequencing. Any authentication scheme used by 116 the transport protocol may be used in addition to BGP's own 117 authentication mechanisms. The error notification mechanism used in 118 BGP assumes that the transport protocol supports a "graceful" close, 119 i.e., that all outstanding data will be delivered before the 120 connection is closed. 122 BGP uses TCP [4] as its transport protocol. TCP meets BGP's 123 transport requirements and is present in virtually all commercial 124 routers and hosts. In the following descriptions the phrase 125 "transport protocol connection" can be understood to refer to a TCP 126 connection. BGP uses TCP port 179 for establishing its connections. 128 This document uses the term `Autonomous System' (AS) throughout. The 129 classic definition of an Autonomous System is a set of routers under 130 a single technical administration, using an interior gateway protocol 131 and common metrics to route packets within the AS, and using an 132 exterior gateway protocol to route packets to other ASs. Since this 133 classic definition was developed, it has become common for a single 134 AS to use several interior gateway protocols and sometimes several 135 sets of metrics within an AS. The use of the term Autonomous System 136 here stresses the fact that, even when multiple IGPs and metrics are 137 used, the administration of an AS appears to other ASs to have a 138 single coherent interior routing plan and presents a consistent 139 picture of what destinations are reachable through it. 141 The planned use of BGP in the Internet environment, including such 142 issues as topology, the interaction between BGP and IGPs, and the 143 enforcement of routing policy rules is presented in a companion 144 document [5]. This document is the first of a series of documents 145 RFC DRAFT June 1995 147 planned to explore various aspects of BGP application. Please send 148 comments to the BGP mailing list (bgp@ans.net). 150 3. Summary of Operation 152 Two systems form a transport protocol connection between one another. 153 They exchange messages to open and confirm the connection parameters. 154 The initial data flow is the entire BGP routing table. Incremental 155 updates are sent as the routing tables change. BGP does not require 156 periodic refresh of the entire BGP routing table. Therefore, a BGP 157 speaker must retain the current version of the entire BGP routing 158 tables of all of its peers for the duration of the connection. 159 KeepAlive messages are sent periodically to ensure the liveness of 160 the connection. Notification messages are sent in response to errors 161 or special conditions. If a connection encounters an error 162 condition, a notification message is sent and the connection is 163 closed. 165 The hosts executing the Border Gateway Protocol need not be routers. 166 A non-routing host could exchange routing information with routers 167 via EGP or even an interior routing protocol. That non-routing host 168 could then use BGP to exchange routing information with a border 169 router in another Autonomous System. The implications and 170 applications of this architecture are for further study. 172 If a particular AS has multiple BGP speakers and is providing transit 173 service for other ASs, then care must be taken to ensure a consistent 174 view of routing within the AS. A consistent view of the interior 175 routes of the AS is provided by the interior routing protocol. A 176 consistent view of the routes exterior to the AS can be provided by 177 having all BGP speakers within the AS maintain direct BGP connections 178 with each other. Using a common set of policies, the BGP speakers 179 arrive at an agreement as to which border routers will serve as 180 exit/entry points for particular destinations outside the AS. This 181 information is communicated to the AS's internal routers, possibly 182 via the interior routing protocol. Care must be taken to ensure that 183 the interior routers have all been updated with transit information 184 before the BGP speakers announce to other ASs that transit service is 185 being provided. 187 Connections between BGP speakers of different ASs are referred to as 188 "external" links. BGP connections between BGP speakers within the 189 same AS are referred to as "internal" links. Similarly, a peer in a 190 different AS is referred to as an external peer, while a peer in the 191 same AS may be described as an internal peer. 193 RFC DRAFT June 1995 195 3.1 Routes: Advertisement and Storage 197 For purposes of this protocol a route is defined as a unit of 198 information that pairs a destination with the attributes of a path to 199 that destination: 201 - Routes are advertised between a pair of BGP speakers in UPDATE 202 messages: the destination is the systems whose IP addresses are 203 reported in the Network Layer Reachability Information (NLRI) 204 field, and the the path is the information reported in the path 205 attributes fields of the same UPDATE message. 207 - Routes are stored in the Routing Information Bases (RIBs): 208 namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes 209 that will be advertised to other BGP speakers must be present in 210 the Adj-RIB-Out; routes that will be used by the local BGP speaker 211 must be present in the Loc-RIB, and the next hop for each of these 212 routes must be present in the local BGP speaker's forwarding 213 information base; and routes that are received from other BGP 214 speakers are present in the Adj-RIBs-In. 216 If a BGP speaker chooses to advertise the route, it may add to or 217 modify the path attributes of the route before advertising it to a 218 peer. 220 BGP provides mechanisms by which a BGP speaker can inform its peer 221 that a previously advertised route is no longer available for use. 222 There are three methods by which a given BGP speaker can indicate 223 that a route has been withdrawn from service: 225 a) the IP prefix that expresses destinations for a previously 226 advertised route can be advertised in the WITHDRAWN ROUTES field 227 in the UPDATE message, thus marking the associated route as being 228 no longer available for use 230 b) a replacement route with the same Network Layer Reachability 231 Information can be advertised, or 233 c) the BGP speaker - BGP speaker connection can be closed, which 234 implicitly removes from service all routes which the pair of 235 speakers had advertised to each other. 237 RFC DRAFT June 1995 239 3.2 Routing Information Bases 241 The Routing Information Base (RIB) within a BGP speaker consists of 242 three distinct parts: 244 a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has 245 been learned from inbound UPDATE messages. Their contents 246 represent routes that are available as an input to the Decision 247 Process. 249 b) Loc-RIB: The Loc-RIB contains the local routing information 250 that the BGP speaker has selected by applying its local policies 251 to the routing information contained in its Adj-RIBs-In. 253 c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the 254 local BGP speaker has selected for advertisement to its peers. The 255 routing information stored in the Adj-RIBs-Out will be carried in 256 the local BGP speaker's UPDATE messages and advertised to its 257 peers. 259 In summary, the Adj-RIBs-In contain unprocessed routing information 260 that has been advertised to the local BGP speaker by its peers; the 261 Loc-RIB contains the routes that have been selected by the local BGP 262 speaker's Decision Process; and the Adj-RIBs-Out organize the routes 263 for advertisement to specific peers by means of the local speaker's 264 UPDATE messages. 266 Although the conceptual model distinguishes between Adj-RIBs-In, 267 Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an 268 implementation must maintain three separate copies of the routing 269 information. The choice of implementation (for example, 3 copies of 270 the information vs 1 copy with pointers) is not constrained by the 271 protocol. 273 4. Message Formats 275 This section describes message formats used by BGP. 277 Messages are sent over a reliable transport protocol connection. A 278 message is processed only after it is entirely received. The maximum 279 message size is 4096 octets. All implementations are required to 280 support this maximum message size. The smallest message that may be 281 sent consists of a BGP header without a data portion, or 19 octets. 283 RFC DRAFT June 1995 285 4.1 Message Header Format 287 Each message has a fixed-size header. There may or may not be a data 288 portion following the header, depending on the message type. The 289 layout of these fields is shown below: 291 0 1 2 3 292 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 293 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 294 | | 295 + + 296 | | 297 + + 298 | Marker | 299 + + 300 | | 301 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 302 | Length | Type | 303 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 305 Marker: 307 This 16-octet field contains a value that the receiver of the 308 message can predict. If the Type of the message is OPEN, or if 309 the OPEN message carries no Authentication Information (as an 310 Optional Parameter), then the Marker must be all ones. 311 Otherwise, the value of the marker can be predicted by some a 312 computation specified as part of the authentication mechanism 313 (which is specified as part of the Authentication Information) 314 used. The Marker can be used to detect loss of synchronization 315 between a pair of BGP peers, and to authenticate incoming BGP 316 messages. 318 Length: 320 This 2-octet unsigned integer indicates the total length of the 321 message, including the header, in octets. Thus, e.g., it 322 allows one to locate in the transport-level stream the (Marker 323 field of the) next message. The value of the Length field must 324 RFC DRAFT June 1995 326 always be at least 19 and no greater than 4096, and may be 327 further constrained, depending on the message type. No 328 "padding" of extra data after the message is allowed, so the 329 Length field must have the smallest value required given the 330 rest of the message. 332 Type: 334 This 1-octet unsigned integer indicates the type code of the 335 message. The following type codes are defined: 337 1 - OPEN 338 2 - UPDATE 339 3 - NOTIFICATION 340 4 - KEEPALIVE 342 4.2 OPEN Message Format 344 After a transport protocol connection is established, the first 345 message sent by each side is an OPEN message. If the OPEN message is 346 acceptable, a KEEPALIVE message confirming the OPEN is sent back. 347 Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION 348 messages may be exchanged. 350 In addition to the fixed-size BGP header, the OPEN message contains 351 the following fields: 353 0 1 2 3 354 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 355 +-+-+-+-+-+-+-+-+ 356 | Version | 357 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 358 | My Autonomous System | 359 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 360 | Hold Time | 361 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 362 | BGP Identifier | 363 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 364 | Opt Parm Len | 365 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 366 | | 367 | Optional Parameters | 368 | | 369 RFC DRAFT June 1995 371 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 373 Version: 375 This 1-octet unsigned integer indicates the protocol version 376 number of the message. The current BGP version number is 4. 378 My Autonomous System: 380 This 2-octet unsigned integer indicates the Autonomous System 381 number of the sender. 383 Hold Time: 385 This 2-octet unsigned integer indicates the number of seconds 386 that the sender proposes for the value of the Hold Timer. Upon 387 receipt of an OPEN message, a BGP speaker MUST calculate the 388 value of the Hold Timer by using the smaller of its configured 389 Hold Time and the Hold Time received in the OPEN message. The 390 Hold Time MUST be either zero or at least three seconds. An 391 implementation may reject connections on the basis of the Hold 392 Time. The calculated value indicates the maximum number of 393 seconds that may elapse between the receipt of successive 394 KEEPALIVE, and/or UPDATE messages by the sender. 396 BGP Identifier: 397 This 4-octet unsigned integer indicates the BGP Identifier of 398 the sender. A given BGP speaker sets the value of its BGP 399 Identifier to an IP address assigned to that BGP speaker. The 400 value of the BGP Identifier is determined on startup and is the 401 same for every local interface and every BGP peer. 403 Optional Parameters Length: 405 This 1-octet unsigned integer indicates the total length of the 406 Optional Parameters field in octets. If the value of this field 407 is zero, no Optional Parameters are present. 409 Optional Parameters: 411 This field may contain a list of optional parameters, where 412 each parameter is encoded as a triplet. 415 RFC DRAFT June 1995 417 0 1 418 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 419 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 420 | Parm. Type | Parm. Length | Parameter Value (variable) 421 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 423 Parameter Type is a one octet field that unambiguously 424 identifies individual parameters. Parameter Length is a one 425 octet field that contains the length of the Parameter Value 426 field in octets. Parameter Value is a variable length field 427 that is interpreted according to the value of the Parameter 428 Type field. 430 This document defines the following Optional Parameters: 432 a) Authentication Information (Parameter Type 1): 434 This optional parameter may be used to authenticate a BGP 435 peer. The Parameter Value field contains a 1-octet 436 Authentication Code followed by a variable length 437 Authentication Data. 439 0 1 2 3 4 5 6 7 8 440 +-+-+-+-+-+-+-+-+ 441 | Auth. Code | 442 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 443 | | 444 | Authentication Data | 445 | | 446 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 448 Authentication Code: 450 This 1-octet unsigned integer indicates the 451 authentication mechanism being used. Whenever an 452 authentication mechanism is specified for use within 453 BGP, three things must be included in the 454 specification: 455 - the value of the Authentication Code which indicates 456 use of the mechanism, 457 - the form and meaning of the Authentication Data, and 458 - the algorithm for computing values of Marker fields. 460 RFC DRAFT June 1995 462 Note that a separate authentication mechanism may be 463 used in establishing the transport level connection. 465 Authentication Data: 467 The form and meaning of this field is a variable- 468 length field depend on the Authentication Code. 470 The minimum length of the OPEN message is 29 octets (including 471 message header). 473 4.3 UPDATE Message Format 475 UPDATE messages are used to transfer routing information between BGP 476 peers. The information in the UPDATE packet can be used to construct 477 a graph describing the relationships of the various Autonomous 478 Systems. By applying rules to be discussed, routing information 479 loops and some other anomalies may be detected and removed from 480 inter-AS routing. 482 An UPDATE message is used to advertise a single feasible route to a 483 peer, or to withdraw multiple unfeasible routes from service (see 484 3.1). An UPDATE message may simultaneously advertise a feasible route 485 and withdraw multiple unfeasible routes from service. The UPDATE 486 message always includes the fixed-size BGP header, and can optionally 487 include the other fields as shown below: 489 +-----------------------------------------------------+ 490 | Unfeasible Routes Length (2 octets) | 491 +-----------------------------------------------------+ 492 | Withdrawn Routes (variable) | 493 +-----------------------------------------------------+ 494 | Total Path Attribute Length (2 octets) | 495 +-----------------------------------------------------+ 496 | Path Attributes (variable) | 497 +-----------------------------------------------------+ 498 | Network Layer Reachability Information (variable) | 499 +-----------------------------------------------------+ 501 Unfeasible Routes Length: 503 This 2-octets unsigned integer indicates the total length of 504 the Withdrawn Routes field in octets. Its value must allow the 505 RFC DRAFT June 1995 507 length of the Network Layer Reachability Information field to 508 be determined as specified below. 510 A value of 0 indicates that no routes are being withdrawn from 511 service, and that the WITHDRAWN ROUTES field is not present in 512 this UPDATE message. 514 Withdrawn Routes: 516 This is a variable length field that contains a list of IP 517 address prefixes for the routes that are being withdrawn from 518 service. Each IP address prefix is encoded as a 2-tuple of the 519 form , whose fields are described below: 521 +---------------------------+ 522 | Length (1 octet) | 523 +---------------------------+ 524 | Prefix (variable) | 525 +---------------------------+ 527 The use and the meaning of these fields are as follows: 529 a) Length: 531 The Length field indicates the length in bits of the IP 532 address prefix. A length of zero indicates a prefix that 533 matches all IP addresses (with prefix, itself, of zero 534 octets). 536 b) Prefix: 538 The Prefix field contains IP address prefixes followed by 539 enough trailing bits to make the end of the field fall on an 540 octet boundary. Note that the value of trailing bits is 541 irrelevant. 543 Total Path Attribute Length: 545 This 2-octet unsigned integer indicates the total length of the 546 Path Attributes field in octets. Its value must allow the 547 length of the Network Layer Reachability field to be determined 548 as specified below. 550 A value of 0 indicates that no Network Layer Reachability 551 Information field is present in this UPDATE message. 553 RFC DRAFT June 1995 555 Path Attributes: 557 A variable length sequence of path attributes is present in 558 every UPDATE. Each path attribute is a triple of variable length. 561 Attribute Type is a two-octet field that consists of the 562 Attribute Flags octet followed by the Attribute Type Code 563 octet. 565 0 1 566 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 567 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 568 | Attr. Flags |Attr. Type Code| 569 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 571 The high-order bit (bit 0) of the Attribute Flags octet is the 572 Optional bit. It defines whether the attribute is optional (if 573 set to 1) or well-known (if set to 0). 575 The second high-order bit (bit 1) of the Attribute Flags octet 576 is the Transitive bit. It defines whether an optional 577 attribute is transitive (if set to 1) or non-transitive (if set 578 to 0). For well-known attributes, the Transitive bit must be 579 set to 1. (See Section 5 for a discussion of transitive 580 attributes.) 582 The third high-order bit (bit 2) of the Attribute Flags octet 583 is the Partial bit. It defines whether the information 584 contained in the optional transitive attribute is partial (if 585 set to 1) or complete (if set to 0). For well-known attributes 586 and for optional non-transitive attributes the Partial bit must 587 be set to 0. 589 The fourth high-order bit (bit 3) of the Attribute Flags octet 590 is the Extended Length bit. It defines whether the Attribute 591 Length is one octet (if set to 0) or two octets (if set to 1). 592 Extended Length may be used only if the length of the attribute 593 value is greater than 255 octets. 595 The lower-order four bits of the Attribute Flags octet are . 596 unused. They must be zero (and must be ignored when received). 598 The Attribute Type Code octet contains the Attribute Type Code. 600 RFC DRAFT June 1995 602 Currently defined Attribute Type Codes are discussed in Section 603 5. 605 If the Extended Length bit of the Attribute Flags octet is set 606 to 0, the third octet of the Path Attribute contains the length 607 of the attribute data in octets. 609 If the Extended Length bit of the Attribute Flags octet is set 610 to 1, then the third and the fourth octets of the path 611 attribute contain the length of the attribute data in octets. 613 The remaining octets of the Path Attribute represent the 614 attribute value and are interpreted according to the Attribute 615 Flags and the Attribute Type Code. The supported Attribute Type 616 Codes, their attribute values and uses are the following: 618 a) ORIGIN (Type Code 1): 620 ORIGIN is a well-known mandatory attribute that defines the 621 origin of the path information. The data octet can assume 622 the following values: 624 Value Meaning 626 0 IGP - Network Layer Reachability Information 627 is interior to the originating AS 629 1 EGP - Network Layer Reachability Information 630 learned via EGP 632 2 INCOMPLETE - Network Layer Reachability 633 Information learned by some other means 635 Its usage is defined in 5.1.1 637 b) AS_PATH (Type Code 2): 639 AS_PATH is a well-known mandatory attribute that is composed 640 of a sequence of AS path segments. Each AS path segment is 641 represented by a triple . 644 The path segment type is a 1-octet long field with the 645 following values defined: 647 Value Segment Type 649 1 AS_SET: unordered set of ASs a route in the 650 RFC DRAFT June 1995 652 UPDATE message has traversed 654 2 AS_SEQUENCE: ordered set of ASs a route in 655 the UPDATE message has traversed 657 The path segment length is a 1-octet long field containing 658 the number of ASs in the path segment value field. 660 The path segment value field contains one or more AS 661 numbers, each encoded as a 2-octets long field. 663 Usage of this attribute is defined in 5.1.2. 665 c) NEXT_HOP (Type Code 3): 667 This is a well-known mandatory attribute that defines the IP 668 address of the border router that should be used as the next 669 hop to the destinations listed in the Network Layer 670 Reachability field of the UPDATE message. 672 Usage of this attribute is defined in 5.1.3. 674 d) MULTI_EXIT_DISC (Type Code 4): 676 This is an optional non-transitive attribute that is a four 677 octet non-negative integer. The value of this attribute may 678 be used by a BGP speaker's decision process to discriminate 679 among multiple exit points to a neighboring autonomous 680 system. 682 Its usage is defined in 5.1.4. 684 e) LOCAL_PREF (Type Code 5): 686 LOCAL_PREF is a well-known discretionary attribute that is a 687 four octet non-negative integer. It is used by a BGP speaker 688 to inform other BGP speakers in its own autonomous system of 689 the originating speaker's degree of preference for an 690 advertised route. Usage of this attribute is described in 691 5.1.5. 693 f) ATOMIC_AGGREGATE (Type Code 6) 695 ATOMIC_AGGREGATE is a well-known discretionary attribute of 696 length 0. It is used by a BGP speaker to inform other BGP 697 speakers that the local system selected a less specific 698 route without selecting a more specific route which is 699 RFC DRAFT June 1995 701 included in it. Usage of this attribute is described in 702 5.1.6. 704 g) AGGREGATOR (Type Code 7) 706 AGGREGATOR is an optional transitive attribute of length 6. 707 The attribute contains the last AS number that formed the 708 aggregate route (encoded as 2 octets), followed by the IP 709 address of the BGP speaker that formed the aggregate route 710 (encoded as 4 octets). Usage of this attribute is described 711 in 5.1.7 713 Network Layer Reachability Information: 715 This variable length field contains a list of IP address 716 prefixes. The length in octets of the Network Layer 717 Reachability Information is not encoded explicitly, but can be 718 calculated as: 720 UPDATE message Length - 23 - Total Path Attributes Length - 721 Unfeasible Routes Length 723 where UPDATE message Length is the value encoded in the fixed- 724 size BGP header, Total Path Attribute Length and Unfeasible 725 Routes Length are the values encoded in the variable part of 726 the UPDATE message, and 23 is a combined length of the fixed- 727 size BGP header, the Total Path Attribute Length field and the 728 Unfeasible Routes Length field. 730 Reachability information is encoded as one or more 2-tuples of 731 the form , whose fields are described below: 733 +---------------------------+ 734 | Length (1 octet) | 735 +---------------------------+ 736 | Prefix (variable) | 737 +---------------------------+ 739 The use and the meaning of these fields are as follows: 741 a) Length: 743 The Length field indicates the length in bits of the IP 744 address prefix. A length of zero indicates a prefix that 745 matches all IP addresses (with prefix, itself, of zero 746 octets). 748 RFC DRAFT June 1995 750 b) Prefix: 752 The Prefix field contains IP address prefixes followed by 753 enough trailing bits to make the end of the field fall on an 754 octet boundary. Note that the value of the trailing bits is 755 irrelevant. 757 The minimum length of the UPDATE message is 23 octets -- 19 octets 758 for the fixed header + 2 octets for the Unfeasible Routes Length + 2 759 octets for the Total Path Attribute Length (the value of Unfeasible 760 Routes Length is 0 and the value of Total Path Attribute Length is 761 0). 763 An UPDATE message can advertise at most one route, which may be 764 described by several path attributes. All path attributes contained 765 in a given UPDATE messages apply to the destinations carried in the 766 Network Layer Reachability Information field of the UPDATE message. 768 An UPDATE message can list multiple routes to be withdrawn from 769 service. Each such route is identified by its destination (expressed 770 as an IP prefix), which unambiguously identifies the route in the 771 context of the BGP speaker - BGP speaker connection to which it has 772 been previously been advertised. 774 An UPDATE message may advertise only routes to be withdrawn from 775 service, in which case it will not include path attributes or Network 776 Layer Reachability Information. Conversely, it may advertise only a 777 feasible route, in which case the WITHDRAWN ROUTES field need not be 778 present. 780 4.4 KEEPALIVE Message Format 782 BGP does not use any transport protocol-based keep-alive mechanism to 783 determine if peers are reachable. Instead, KEEPALIVE messages are 784 exchanged between peers often enough as not to cause the Hold Timer 785 to expire. A reasonable maximum time between KEEPALIVE messages 786 would be one third of the Hold Time interval. KEEPALIVE messages 787 MUST NOT be sent more frequently than one per second. An 788 implementation MAY adjust the rate at which it sends KEEPALIVE 789 messages as a function of the Hold Time interval. 791 If the negotiated Hold Time interval is zero, then periodic KEEPALIVE 792 messages MUST NOT be sent. 794 KEEPALIVE message consists of only message header and has a length of 795 19 octets. 797 RFC DRAFT June 1995 799 4.5 NOTIFICATION Message Format 801 A NOTIFICATION message is sent when an error condition is detected. 802 The BGP connection is closed immediately after sending it. 804 In addition to the fixed-size BGP header, the NOTIFICATION message 805 contains the following fields: 807 0 1 2 3 808 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 809 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 810 | Error code | Error subcode | Data | 811 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 812 | | 813 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 815 Error Code: 817 This 1-octet unsigned integer indicates the type of 818 NOTIFICATION. The following Error Codes have been defined: 820 Error Code Symbolic Name Reference 822 1 Message Header Error Section 6.1 824 2 OPEN Message Error Section 6.2 826 3 UPDATE Message Error Section 6.3 828 4 Hold Timer Expired Section 6.5 830 5 Finite State Machine Error Section 6.6 832 6 Cease Section 6.7 834 Error subcode: 836 This 1-octet unsigned integer provides more specific 837 information about the nature of the reported error. Each Error 838 Code may have one or more Error Subcodes associated with it. 839 If no appropriate Error Subcode is defined, then a zero 840 (Unspecific) value is used for the Error Subcode field. 842 RFC DRAFT June 1995 844 Message Header Error subcodes: 846 1 - Connection Not Synchronized. 847 2 - Bad Message Length. 848 3 - Bad Message Type. 850 OPEN Message Error subcodes: 852 1 - Unsupported Version Number. 853 2 - Bad Peer AS. 854 3 - Bad BGP Identifier. ' 855 4 - Unsupported Optional Parameter. 856 5 - Authentication Failure. 857 6 - Unacceptable Hold Time. 859 UPDATE Message Error subcodes: 861 1 - Malformed Attribute List. 862 2 - Unrecognized Well-known Attribute. 863 3 - Missing Well-known Attribute. 864 4 - Attribute Flags Error. 865 5 - Attribute Length Error. 866 6 - Invalid ORIGIN Attribute 867 7 - AS Routing Loop. 868 8 - Invalid NEXT_HOP Attribute. 869 9 - Optional Attribute Error. 870 10 - Invalid Network Field. 871 11 - Malformed AS_PATH. 873 Data: 875 This variable-length field is used to diagnose the reason for 876 the NOTIFICATION. The contents of the Data field depend upon 877 the Error Code and Error Subcode. See Section 6 below for more 878 details. 880 Note that the length of the Data field can be determined from 881 the message Length field by the formula: 883 Message Length = 21 + Data Length 885 The minimum length of the NOTIFICATION message is 21 octets 886 (including message header). 888 RFC DRAFT June 1995 890 5. Path Attributes 892 This section discusses the path attributes of the UPDATE message. 894 Path attributes fall into four separate categories: 896 1. Well-known mandatory. 897 2. Well-known discretionary. 898 3. Optional transitive. 899 4. Optional non-transitive. 901 Well-known attributes must be recognized by all BGP implementations. 902 Some of these attributes are mandatory and must be included in every 903 UPDATE message. Others are discretionary and may or may not be sent 904 in a particular UPDATE message. 906 All well-known attributes must be passed along (after proper 907 updating, if necessary) to other BGP peers. 909 In addition to well-known attributes, each path may contain one or 910 more optional attributes. It is not required or expected that all 911 BGP implementations support all optional attributes. The handling of 912 an unrecognized optional attribute is determined by the setting of 913 the Transitive bit in the attribute flags octet. Paths with 914 unrecognized transitive optional attributes should be accepted. If a 915 path with unrecognized transitive optional attribute is accepted and 916 passed along to other BGP peers, then the unrecognized transitive 917 optional attribute of that path must be passed along with the path to 918 other BGP peers with the Partial bit in the Attribute Flags octet set 919 to 1. If a path with recognized transitive optional attribute is 920 accepted and passed along to other BGP peers and the Partial bit in 921 the Attribute Flags octet is set to 1 by some previous AS, it is not 922 set back to 0 by the current AS. Unrecognized non-transitive optional 923 attributes must be quietly ignored and not passed along to other BGP 924 peers. 926 New transitive optional attributes may be attached to the path by the 927 originator or by any other AS in the path. If they are not attached 928 by the originator, the Partial bit in the Attribute Flags octet is 929 set to 1. The rules for attaching new non-transitive optional 930 attributes will depend on the nature of the specific attribute. The 931 documentation of each new non-transitive optional attribute will be 932 expected to include such rules. (The description of the 933 MULTI_EXIT_DISC attribute gives an example.) All optional attributes 934 (both transitive and non-transitive) may be updated (if appropriate) 935 by ASs in the path. 937 RFC DRAFT June 1995 939 The sender of an UPDATE message should order path attributes within 940 the UPDATE message in ascending order of attribute type. The 941 receiver of an UPDATE message must be prepared to handle path 942 attributes within the UPDATE message that are out of order. 944 The same attribute cannot appear more than once within the Path 945 Attributes field of a particular UPDATE message. 947 5.1 Path Attribute Usage 949 The usage of each BGP path attributes is described in the following 950 clauses. 952 5.1.1 ORIGIN 954 ORIGIN is a well-known mandatory attribute. The ORIGIN attribute 955 shall be generated by the autonomous system that originates the 956 associated routing information. It shall be included in the UPDATE 957 messages of all BGP speakers that choose to propagate this 958 information to other BGP speakers. 960 5.1.2 AS_PATH 962 AS_PATH is a well-known mandatory attribute. This attribute 963 identifies the autonomous systems through which routing information 964 carried in this UPDATE message has passed. The components of this 965 list can be AS_SETs or AS_SEQUENCEs. 967 When a BGP speaker propagates a route which it has learned from 968 another BGP speaker's UPDATE message, it shall modify the route's 969 AS_PATH attribute based on the location of the BGP speaker to which 970 the route will be sent: 972 a) When a given BGP speaker advertises the route to another BGP 973 speaker located in its own autonomous system, the advertising 974 speaker shall not modify the AS_PATH attribute associated with the 975 route. 977 b) When a given BGP speaker advertises the route to a BGP speaker 978 located in a neighboring autonomous system, then the advertising 979 RFC DRAFT June 1995 981 speaker shall update the AS_PATH attribute as follows: 983 1) if the first path segment of the AS_PATH is of type 984 AS_SEQUENCE, the local system shall prepend its own AS number 985 as the last element of the sequence (put it in the leftmost 986 position) 988 2) if the first path segment of the AS_PATH is of type AS_SET, 989 the local system shall prepend a new path segment of type 990 AS_SEQUENCE to the AS_PATH, including its own AS number in that 991 segment. 993 When a BGP speaker originates a route then: 995 a) the originating speaker shall include its own AS number in 996 the AS_PATH attribute of all UPDATE messages sent to BGP 997 speakers located in neighboring autonomous systems. (In this 998 case, the AS number of the originating speaker's autonomous 999 system will be the only entry in the AS_PATH attribute). 1001 b) the originating speaker shall include an empty AS_PATH 1002 attribute in all UPDATE messages sent to BGP speakers located 1003 in its own autonomous system. (An empty AS_PATH attribute is 1004 one whose length field contains the value zero). 1006 5.1.3 NEXT_HOP 1008 The NEXT_HOP path attribute defines the IP address of the border 1009 router that should be used as the next hop to the destinations listed 1010 in the UPDATE message. If a border router belongs to the same AS as 1011 its peer, then the peer is an internal border router. Otherwise, it 1012 is an external border router. A BGP speaker can advertise any 1013 internal border router as the next hop provided that the interface 1014 associated with the IP address of this border router (as specified in 1015 the NEXT_HOP path attribute) shares a common subnet with both the 1016 local and remote BGP speakers. A BGP speaker can advertise any 1017 external border router as the next hop, provided that the IP address 1018 of this border router was learned from one of the BGP speaker's 1019 peers, and the interface associated with the IP address of this 1020 border router (as specified in the NEXT_HOP path attribute) shares a 1021 common subnet with the local and remote BGP speakers. A BGP speaker 1022 needs to be able to support disabling advertisement of external 1023 border routers. 1025 A BGP speaker must never advertise an address of a peer to that peer 1026 RFC DRAFT June 1995 1028 as a NEXT_HOP, for a route that the speaker is originating. A BGP 1029 speaker must never install a route with itself as the next hop. 1031 When a BGP speaker advertises the route to a BGP speaker located in 1032 its own autonomous system, the advertising speaker shall not modify 1033 the NEXT_HOP attribute associated with the route. When a BGP speaker 1034 receives the route via an internal link, it may forward packets to 1035 the NEXT_HOP address if the address contained in the attribute is on 1036 a common subnet with the local and remote BGP speakers. 1038 5.1.4 MULTI_EXIT_DISC 1040 The MULTI_EXIT_DISC attribute may be used on external (inter-AS) 1041 links to discriminate among multiple exit or entry points to the same 1042 neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four 1043 octet unsigned number which is called a metric. All other factors 1044 being equal, the exit or entry point with lower metric should be 1045 preferred. If received over external links, the MULTI_EXIT_DISC 1046 attribute may be propagated over internal links to other BGP speakers 1047 within the same AS. The MULTI_EXIT_DISC attribute is never 1048 propagated to other BGP speakers in neighboring AS's. 1050 5.1.5 LOCAL_PREF 1052 LOCAL_PREF is a well-known discretionary attribute that shall be 1053 included in all UPDATE messages that a given BGP speaker sends to the 1054 other BGP speakers located in its own autonomous system. A BGP 1055 speaker shall calculate the degree of preference for each external 1056 route and include the degree of preference when advertising a route 1057 to its internal peers. The higher degree of preference should be 1058 preferred. A BGP speaker shall use the degree of preference learned 1059 via LOCAL_PREF in its decision process (see section 9.1.1). 1061 A BGP speaker shall not include this attribute in UPDATE messages 1062 that it sends to BGP speakers located in a neighboring autonomous 1063 system. If it is contained in an UPDATE message that is received from 1064 a BGP speaker which is not located in the same autonomous system as 1065 the receiving speaker, then this attribute shall be ignored by the 1066 receiving speaker. 1068 RFC DRAFT June 1995 1070 5.1.6 ATOMIC_AGGREGATE 1072 ATOMIC_AGGREGATE is a well-known discretionary attribute. If a BGP 1073 speaker, when presented with a set of overlapping routes from one of 1074 its peers (see 9.1.4), selects the less specific route without 1075 selecting the more specific one, then the local system shall attach 1076 the ATOMIC_AGGREGATE attribute to the route when propagating it to 1077 other BGP speakers (if that attribute is not already present in the 1078 received less specific route). A BGP speaker that receives a route 1079 with the ATOMIC_AGGREGATE attribute shall not remove the attribute 1080 from the route when propagating it to other speakers. A BGP speaker 1081 that receives a route with the ATOMIC_AGGREGATE attribute shall not 1082 make any NLRI of that route more specific (as defined in 9.1.4) when 1083 advertising this route to other BGP speakers. A BGP speaker that 1084 receives a route with the ATOMIC_AGGREGATE attribute needs to be 1085 cognizant of the fact that the actual path to destinations, as 1086 specified in the NLRI of the route, while having the loop-free 1087 property, may traverse ASs that are not listed in the AS_PATH 1088 attribute. 1090 5.1.7 AGGREGATOR 1092 AGGREGATOR is an optional transitive attribute which may be included 1093 in updates which are formed by aggregation (see Section 9.2.4.2). A 1094 BGP speaker which performs route aggregation may add the AGGREGATOR 1095 attribute which shall contain its own AS number and IP address. 1097 6. BGP Error Handling. 1099 This section describes actions to be taken when errors are detected 1100 while processing BGP messages. 1102 When any of the conditions described here are detected, a 1103 NOTIFICATION message with the indicated Error Code, Error Subcode, 1104 and Data fields is sent, and the BGP connection is closed. If no 1105 Error Subcode is specified, then a zero must be used. 1107 The phrase "the BGP connection is closed" means that the transport 1108 protocol connection has been closed and that all resources for that 1109 BGP connection have been deallocated. Routing table entries 1110 associated with the remote peer are marked as invalid. The fact that 1111 the routes have become invalid is passed to other BGP peers before 1112 the routes are deleted from the system. 1114 RFC DRAFT June 1995 1116 Unless specified explicitly, the Data field of the NOTIFICATION 1117 message that is sent to indicate an error is empty. 1119 6.1 Message Header error handling. 1121 All errors detected while processing the Message Header are indicated 1122 by sending the NOTIFICATION message with Error Code Message Header 1123 Error. The Error Subcode elaborates on the specific nature of the 1124 error. 1126 The expected value of the Marker field of the message header is all 1127 ones if the message type is OPEN. The expected value of the Marker 1128 field for all other types of BGP messages determined based on the 1129 presence of the Authentication Information Optional Parameter in the 1130 BGP OPEN message and the actual authentication mechanism (if the 1131 Authentication Information in the BGP OPEN message is present). If 1132 the Marker field of the message header is not the expected one, then 1133 a synchronization error has occurred and the Error Subcode is set to 1134 Connection Not Synchronized. 1136 If the Length field of the message header is less than 19 or greater 1137 than 4096, or if the Length field of an OPEN message is less than 1138 the minimum length of the OPEN message, or if the Length field of an 1139 UPDATE message is less than the minimum length of the UPDATE message, 1140 or if the Length field of a KEEPALIVE message is not equal to 19, or 1141 if the Length field of a NOTIFICATION message is less than the 1142 minimum length of the NOTIFICATION message, then the Error Subcode is 1143 set to Bad Message Length. The Data field contains the erroneous 1144 Length field. 1146 If the Type field of the message header is not recognized, then the 1147 Error Subcode is set to Bad Message Type. The Data field contains 1148 the erroneous Type field. 1150 6.2 OPEN message error handling. 1152 All errors detected while processing the OPEN message are indicated 1153 by sending the NOTIFICATION message with Error Code OPEN Message 1154 Error. The Error Subcode elaborates on the specific nature of the 1155 error. 1157 If the version number contained in the Version field of the received 1158 OPEN message is not supported, then the Error Subcode is set to 1159 Unsupported Version Number. The Data field is a 2-octet unsigned 1160 RFC DRAFT June 1995 1162 integer, which indicates the largest locally supported version number 1163 less than the version the remote BGP peer bid (as indicated in the 1164 received OPEN message). 1166 If the Autonomous System field of the OPEN message is unacceptable, 1167 then the Error Subcode is set to Bad Peer AS. The determination of 1168 acceptable Autonomous System numbers is outside the scope of this 1169 protocol. 1171 If the Hold Time field of the OPEN message is unacceptable, then the 1172 Error Subcode MUST be set to Unacceptable Hold Time. An 1173 implementation MUST reject Hold Time values of one or two seconds. 1174 An implementation MAY reject any proposed Hold Time. An 1175 implementation which accepts a Hold Time MUST use the negotiated 1176 value for the Hold Time. 1178 If the BGP Identifier field of the OPEN message is syntactically 1179 incorrect, then the Error Subcode is set to Bad BGP Identifier. 1180 Syntactic correctness means that the BGP Identifier field represents 1181 a valid IP host address. 1183 If one of the Optional Parameters in the OPEN message is not 1184 recognized, then the Error Subcode is set to Unsupported Optional 1185 Parameters. 1187 If the OPEN message carries Authentication Information (as an 1188 Optional Parameter), then the corresponding authentication procedure 1189 is invoked. If the authentication procedure (based on Authentication 1190 Code and Authentication Data) fails, then the Error Subcode is set to 1191 Authentication Failure. 1193 If the OPEN message carries any other Optional Parameter (other than 1194 Authentication Information), and the local system doesn't recognize 1195 the Parameter, the Parameter shall be ignored. 1197 6.3 UPDATE message error handling. 1199 All errors detected while processing the UPDATE message are indicated 1200 by sending the NOTIFICATION message with Error Code UPDATE Message 1201 Error. The error subcode elaborates on the specific nature of the 1202 error. 1204 Error checking of an UPDATE message begins by examining the path 1205 attributes. If the Unfeasible Routes Length or Total Attribute 1206 Length is too large (i.e., if Unfeasible Routes Length + Total 1207 RFC DRAFT June 1995 1209 Attribute Length + 23 exceeds the message Length), then the Error 1210 Subcode is set to Malformed Attribute List. 1212 If any recognized attribute has Attribute Flags that conflict with 1213 the Attribute Type Code, then the Error Subcode is set to Attribute 1214 Flags Error. The Data field contains the erroneous attribute (type, 1215 length and value). 1217 If any recognized attribute has Attribute Length that conflicts with 1218 the expected length (based on the attribute type code), then the 1219 Error Subcode is set to Attribute Length Error. The Data field 1220 contains the erroneous attribute (type, length and value). 1222 If any of the mandatory well-known attributes are not present, then 1223 the Error Subcode is set to Missing Well-known Attribute. The Data 1224 field contains the Attribute Type Code of the missing well-known 1225 attribute. 1227 If any of the mandatory well-known attributes are not recognized, 1228 then the Error Subcode is set to Unrecognized Well-known Attribute. 1229 The Data field contains the unrecognized attribute (type, length and 1230 value). 1232 If the ORIGIN attribute has an undefined value, then the Error 1233 Subcode is set to Invalid Origin Attribute. The Data field contains 1234 the unrecognized attribute (type, length and value). 1236 If the NEXT_HOP attribute field is syntactically incorrect, then the 1237 Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field 1238 contains the incorrect attribute (type, length and value). Syntactic 1239 correctness means that the NEXT_HOP attribute represents a valid IP 1240 host address. Semantic correctness applies only to the external BGP 1241 links. It means that the interface associated with the IP address, as 1242 specified in the NEXT_HOP attribute, shares a common subnet with the 1243 receiving BGP speaker and is not the IP address of the receiving BGP 1244 speaker. If the NEXT_HOP attribute is semantically incorrect, the 1245 error should be logged, and the the route should be ignored. In this 1246 case, no NOTIFICATION message should be sent. 1248 The AS_PATH attribute is checked for syntactic correctness. If the 1249 path is syntactically incorrect, then the Error Subcode is set to 1250 Malformed AS_PATH. 1252 The information carried by the AS_PATH attribute is checked for AS 1253 loops. AS loop detection is done by scanning the full AS path (as 1254 specified in the AS_PATH attribute), and checking that the autonomous 1255 system number of the local system does not appear in the AS path. If 1256 RFC DRAFT June 1995 1258 the autonomous system number appears in the AS path the route may be 1259 stored in the Adj-RIB-In, but unless the router is configured to 1260 accept routes with its own autonomous system in the AS path, the 1261 route shall not be passed to the BGP Decision Process. Operations of 1262 a router that is configured to accept routes with its own autonomous 1263 system number in the AS path are outside the scope of this document. 1265 If an optional attribute is recognized, then the value of this 1266 attribute is checked. If an error is detected, the attribute is 1267 discarded, and the Error Subcode is set to Optional Attribute Error. 1268 The Data field contains the attribute (type, length and value). 1270 If any attribute appears more than once in the UPDATE message, then 1271 the Error Subcode is set to Malformed Attribute List. 1273 The NLRI field in the UPDATE message is checked for syntactic 1274 validity. If the field is syntactically incorrect, then the Error 1275 Subcode is set to Invalid Network Field. 1277 6.4 NOTIFICATION message error handling. 1279 If a peer sends a NOTIFICATION message, and there is an error in that 1280 message, there is unfortunately no means of reporting this error via 1281 a subsequent NOTIFICATION message. Any such error, such as an 1282 unrecognized Error Code or Error Subcode, should be noticed, logged 1283 locally, and brought to the attention of the administration of the 1284 peer. The means to do this, however, lies outside the scope of this 1285 document. 1287 6.5 Hold Timer Expired error handling. 1289 If a system does not receive successive KEEPALIVE and/or UPDATE 1290 and/or NOTIFICATION messages within the period specified in the Hold 1291 Time field of the OPEN message, then the NOTIFICATION message with 1292 Hold Timer Expired Error Code must be sent and the BGP connection 1293 closed. 1295 6.6 Finite State Machine error handling. 1297 Any error detected by the BGP Finite State Machine (e.g., receipt of 1298 an unexpected event) is indicated by sending the NOTIFICATION message 1299 with Error Code Finite State Machine Error. 1301 RFC DRAFT June 1995 1303 6.7 Cease. 1305 In absence of any fatal errors (that are indicated in this section), 1306 a BGP peer may choose at any given time to close its BGP connection 1307 by sending the NOTIFICATION message with Error Code Cease. However, 1308 the Cease NOTIFICATION message must not be used when a fatal error 1309 indicated by this section does exist. 1311 6.8 Connection collision detection. 1313 If a pair of BGP speakers try simultaneously to establish a TCP 1314 connection to each other, then two parallel connections between this 1315 pair of speakers might well be formed. We refer to this situation as 1316 connection collision. Clearly, one of these connections must be 1317 closed. 1319 Based on the value of the BGP Identifier a convention is established 1320 for detecting which BGP connection is to be preserved when a 1321 collision does occur. The convention is to compare the BGP 1322 Identifiers of the peers involved in the collision and to retain only 1323 the connection initiated by the BGP speaker with the higher-valued 1324 BGP Identifier. 1326 Upon receipt of an OPEN message, the local system must examine all of 1327 its connections that are in the OpenConfirm state. A BGP speaker may 1328 also examine connections in an OpenSent state if it knows the BGP 1329 Identifier of the peer by means outside of the protocol. If among 1330 these connections there is a connection to a remote BGP speaker whose 1331 BGP Identifier equals the one in the OPEN message, then the local 1332 system performs the following collision resolution procedure: 1334 1. The BGP Identifier of the local system is compared to the BGP 1335 Identifier of the remote system (as specified in the OPEN 1336 message). 1338 2. If the value of the local BGP Identifier is less than the 1339 remote one, the local system closes BGP connection that already 1340 exists (the one that is already in the OpenConfirm state), and 1341 accepts BGP connection initiated by the remote system. 1343 3. Otherwise, the local system closes newly created BGP connection 1344 (the one associated with the newly received OPEN message), and 1345 continues to use the existing one (the one that is already in the 1346 OpenConfirm state). 1348 RFC DRAFT June 1995 1350 Comparing BGP Identifiers is done by treating them as (4-octet 1351 long) unsigned integers. 1353 A connection collision with an existing BGP connection that is in 1354 Established states causes unconditional closing of the newly 1355 created connection. Note that a connection collision cannot be 1356 detected with connections that are in Idle, or Connect, or Active 1357 states. 1359 Closing the BGP connection (that results from the collision 1360 resolution procedure) is accomplished by sending the NOTIFICATION 1361 message with the Error Code Cease. 1363 7. BGP Version Negotiation. 1365 BGP speakers may negotiate the version of the protocol by making 1366 multiple attempts to open a BGP connection, starting with the highest 1367 version number each supports. If an open attempt fails with an Error 1368 Code OPEN Message Error, and an Error Subcode Unsupported Version 1369 Number, then the BGP speaker has available the version number it 1370 tried, the version number its peer tried, the version number passed 1371 by its peer in the NOTIFICATION message, and the version numbers that 1372 it supports. If the two peers do support one or more common 1373 versions, then this will allow them to rapidly determine the highest 1374 common version. In order to support BGP version negotiation, future 1375 versions of BGP must retain the format of the OPEN and NOTIFICATION 1376 messages. 1378 8. BGP Finite State machine. 1380 This section specifies BGP operation in terms of a Finite State 1381 Machine (FSM). Following is a brief summary and overview of BGP 1382 operations by state as determined by this FSM. A condensed version 1383 of the BGP FSM is found in Appendix 1. 1385 Initially BGP is in the Idle state. 1387 Idle state: 1389 In this state BGP refuses all incoming BGP connections. No 1390 resources are allocated to the peer. In response to the Start 1391 event (initiated by either system or operator) the local system 1392 initializes all BGP resources, starts the ConnectRetry timer, 1393 initiates a transport connection to other BGP peer, while 1394 RFC DRAFT June 1995 1396 listening for connection that may be initiated by the remote 1397 BGP peer, and changes its state to Connect. The exact value of 1398 the ConnectRetry timer is a local matter, but should be 1399 sufficiently large to allow TCP initialization. 1401 If a BGP speaker detects an error, it shuts down the connection 1402 and changes its state to Idle. Getting out of the Idle state 1403 requires generation of the Start event. If such an event is 1404 generated automatically, then persistent BGP errors may result 1405 in persistent flapping of the speaker. To avoid such a 1406 condition it is recommended that Start events should not be 1407 generated immediately for a peer that was previously 1408 transitioned to Idle due to an error. For a peer that was 1409 previously transitioned to Idle due to an error, the time 1410 between consecutive generation of Start events, if such events 1411 are generated automatically, shall exponentially increase. The 1412 value of the initial timer shall be 60 seconds. The time shall 1413 be doubled for each consecutive retry. 1415 Any other event received in the Idle state is ignored. 1417 Connect state: 1419 In this state BGP is waiting for the transport protocol 1420 connection to be completed. 1422 If the transport protocol connection succeeds, the local system 1423 clears the ConnectRetry timer, completes initialization, sends 1424 an OPEN message to its peer, and changes its state to OpenSent. 1426 If the transport protocol connect fails (e.g., retransmission 1427 timeout), the local system restarts the ConnectRetry timer, 1428 continues to listen for a connection that may be initiated by 1429 the remote BGP peer, and changes its state to Active state. 1431 In response to the ConnectRetry timer expired event, the local 1432 system restarts the ConnectRetry timer, initiates a transport 1433 connection to other BGP peer, continues to listen for a 1434 connection that may be initiated by the remote BGP peer, and 1435 stays in the Connect state. 1437 Start event is ignored in the Active state. 1439 In response to any other event (initiated by either system or 1440 operator), the local system releases all BGP resources 1441 associated with this connection and changes its state to Idle. 1443 Active state: 1445 RFC DRAFT June 1995 1447 In this state BGP is trying to acquire a peer by initiating a 1448 transport protocol connection. 1450 If the transport protocol connection succeeds, the local system 1451 clears the ConnectRetry timer, completes initialization, sends 1452 an OPEN message to its peer, sets its Hold Timer to a large 1453 value, and changes its state to OpenSent. A Hold Timer value 1454 of 4 minutes is suggested. 1456 In response to the ConnectRetry timer expired event, the local 1457 system restarts the ConnectRetry timer, initiates a transport 1458 connection to other BGP peer, continues to listen for a 1459 connection that may be initiated by the remote BGP peer, and 1460 changes its state to Connect. 1462 If the local system detects that a remote peer is trying to 1463 establish BGP connection to it, and the IP address of the 1464 remote peer is not an expected one, the local system restarts 1465 the ConnectRetry timer, rejects the attempted connection, 1466 continues to listen for a connection that may be initiated by 1467 the remote BGP peer, and stays in the Active state. 1469 Start event is ignored in the Active state. 1471 In response to any other event (initiated by either system or 1472 operator), the local system releases all BGP resources 1473 associated with this connection and changes its state to Idle. 1475 OpenSent state: 1477 In this state BGP waits for an OPEN message from its peer. 1478 When an OPEN message is received, all fields are checked for 1479 correctness. If the BGP message header checking or OPEN 1480 message checking detects an error (see Section 6.2), or a 1481 connection collision (see Section 6.8) the local system sends a 1482 NOTIFICATION message and changes its state to Idle. 1484 If there are no errors in the OPEN message, BGP sends a 1485 KEEPALIVE message and sets a KeepAlive timer. The Hold Timer, 1486 which was originally set to a large value (see above), is 1487 replaced with the negotiated Hold Time value (see section 4.2). 1488 If the negotiated Hold Time value is zero, then the Hold Time 1489 timer and KeepAlive timers are not started. If the value of 1490 the Autonomous System field is the same as the local Autonomous 1491 System number, then the connection is an "internal" connection; 1492 otherwise, it is "external". (This will effect UPDATE 1493 processing as described below.) Finally, the state is changed 1494 to OpenConfirm. 1496 RFC DRAFT June 1995 1498 If a disconnect notification is received from the underlying 1499 transport protocol, the local system closes the BGP connection, 1500 restarts the ConnectRetry timer, while continue listening for 1501 connection that may be initiated by the remote BGP peer, and 1502 goes into the Active state. 1504 If the Hold Timer expires, the local system sends NOTIFICATION 1505 message with error code Hold Timer Expired and changes its 1506 state to Idle. 1508 In response to the Stop event (initiated by either system or 1509 operator) the local system sends NOTIFICATION message with 1510 Error Code Cease and changes its state to Idle. 1512 Start event is ignored in the OpenSent state. 1514 In response to any other event the local system sends 1515 NOTIFICATION message with Error Code Finite State Machine Error 1516 and changes its state to Idle. 1518 Whenever BGP changes its state from OpenSent to Idle, it closes 1519 the BGP (and transport-level) connection and releases all 1520 resources associated with that connection. 1522 OpenConfirm state: 1524 In this state BGP waits for a KEEPALIVE or NOTIFICATION 1525 message. 1527 If the local system receives a KEEPALIVE message, it changes 1528 its state to Established. 1530 If the Hold Timer expires before a KEEPALIVE message is 1531 received, the local system sends NOTIFICATION message with 1532 error code Hold Timer Expired and changes its state to Idle. 1534 If the local system receives a NOTIFICATION message, it changes 1535 its state to Idle. 1537 If the KeepAlive timer expires, the local system sends a 1538 KEEPALIVE message and restarts its KeepAlive timer. 1540 If a disconnect notification is received from the underlying 1541 transport protocol, the local system changes its state to Idle. 1543 In response to the Stop event (initiated by either system or 1544 operator) the local system sends NOTIFICATION message with 1545 Error Code Cease and changes its state to Idle. 1547 RFC DRAFT June 1995 1549 Start event is ignored in the OpenConfirm state. 1551 In response to any other event the local system sends 1552 NOTIFICATION message with Error Code Finite State Machine Error 1553 and changes its state to Idle. 1555 Whenever BGP changes its state from OpenConfirm to Idle, it 1556 closes the BGP (and transport-level) connection and releases 1557 all resources associated with that connection. 1559 Established state: 1561 In the Established state BGP can exchange UPDATE, NOTIFICATION, 1562 and KEEPALIVE messages with its peer. 1564 If the local system receives an UPDATE or KEEPALIVE message, it 1565 restarts its Hold Timer, if the negotiated Hold Time value is 1566 non-zero. 1568 If the local system receives a NOTIFICATION message, it changes 1569 its state to Idle. 1571 If the local system receives an UPDATE message and the UPDATE 1572 message error handling procedure (see Section 6.3) detects an 1573 error, the local system sends a NOTIFICATION message and 1574 changes its state to Idle. 1576 If a disconnect notification is received from the underlying 1577 transport protocol, the local system changes its state to Idle. 1579 If the Hold Timer expires, the local system sends a 1580 NOTIFICATION message with Error Code Hold Timer Expired and 1581 changes its state to Idle. 1583 If the KeepAlive timer expires, the local system sends a 1584 KEEPALIVE message and restarts its KeepAlive timer. 1586 Each time the local system sends a KEEPALIVE or UPDATE message, 1587 it restarts its KeepAlive timer, unless the negotiated Hold 1588 Time value is zero. 1590 In response to the Stop event (initiated by either system or 1591 operator), the local system sends a NOTIFICATION message with 1592 Error Code Cease and changes its state to Idle. 1594 Start event is ignored in the Established state. 1596 In response to any other event, the local system sends 1597 RFC DRAFT June 1995 1599 NOTIFICATION message with Error Code Finite State Machine Error 1600 and changes its state to Idle. 1602 Whenever BGP changes its state from Established to Idle, it 1603 closes the BGP (and transport-level) connection, releases all 1604 resources associated with that connection, and deletes all 1605 routes derived from that connection. 1607 9. UPDATE Message Handling 1609 An UPDATE message may be received only in the Established state. 1610 When an UPDATE message is received, each field is checked for 1611 validity as specified in Section 6.3. 1613 If an optional non-transitive attribute is unrecognized, it is 1614 quietly ignored. If an optional transitive attribute is 1615 unrecognized, the Partial bit (the third high-order bit) in the 1616 attribute flags octet is set to 1, and the attribute is retained for 1617 propagation to other BGP speakers. 1619 If an optional attribute is recognized, and has a valid value, then, 1620 depending on the type of the optional attribute, it is processed 1621 locally, retained, and updated, if necessary, for possible 1622 propagation to other BGP speakers. 1624 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 1625 the previously advertised routes whose destinations (expressed as IP 1626 prefixes) contained in this field shall be removed from the Adj-RIB- 1627 In. This BGP speaker shall run its Decision Process since the 1628 previously advertised route is not longer available for use. 1630 If the UPDATE message contains a feasible route, it shall be placed 1631 in the appropriate Adj-RIB-In, and the following additional actions 1632 shall be taken: 1634 i) If its Network Layer Reachability Information (NLRI) is identical 1635 to the one of a route currently stored in the Adj-RIB-In, then the 1636 new route shall replace the older route in the Adj-RIB-In, thus 1637 implicitly withdrawing the older route from service. The BGP speaker 1638 shall run its Decision Process since the older route is no longer 1639 available for use. 1641 ii) If the new route is an overlapping route that is included (see 1642 9.1.4) in an earlier route contained in the Adj-RIB-In, the BGP 1643 speaker shall run its Decision Process since the more specific route 1644 RFC DRAFT June 1995 1646 has implicitly made a portion of the less specific route unavailable 1647 for use. 1649 iii) If the new route has identical path attributes to an earlier 1650 route contained in the Adj-RIB-In, and is more specific (see 9.1.4) 1651 than the earlier route, no further actions are necessary. 1653 iv) If the new route has NLRI that is not present in any of the 1654 routes currently stored in the Adj-RIB-In, then the new route shall 1655 be placed in the Adj-RIB-In. The BGP speaker shall run its Decision 1656 Process. 1658 v) If the new route is an overlapping route that is less specific 1659 (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the 1660 BGP speaker shall run its Decision Process on the set of destinations 1661 described only by the less specific route. 1663 9.1 Decision Process 1665 The Decision Process selects routes for subsequent advertisement by 1666 applying the policies in the local Policy Information Base (PIB) to 1667 the routes stored in its Adj-RIB-In. The output of the Decision 1668 Process is the set of routes that will be advertised to all peers; 1669 the selected routes will be stored in the local speaker's Adj-RIB- 1670 Out. 1672 The selection process is formalized by defining a function that takes 1673 the attribute of a given route as an argument and returns a non- 1674 negative integer denoting the degree of preference for the route. 1675 The function that calculates the degree of preference for a given 1676 route shall not use as its inputs any of the following: the existence 1677 of other routes, the non-existence of other routes, or the path 1678 attributes of other routes. Route selection then consists of 1679 individual application of the degree of preference function to each 1680 feasible route, followed by the choice of the one with the highest 1681 degree of preference. 1683 The Decision Process operates on routes contained in each Adj-RIB-In, 1684 and is responsible for: 1686 - selection of routes to be advertised to BGP speakers located in 1687 the local speaker's autonomous system 1689 - selection of routes to be advertised to BGP speakers located in 1690 neighboring autonomous systems 1691 RFC DRAFT June 1995 1693 - route aggregation and route information reduction 1695 The Decision Process takes place in three distinct phases, each 1696 triggered by a different event: 1698 a) Phase 1 is responsible for calculating the degree of preference 1699 for each route received from a BGP speaker located in a 1700 neighboring autonomous system, and for advertising to the other 1701 BGP speakers in the local autonomous system the routes that have 1702 the highest degree of preference for each distinct destination. 1704 b) Phase 2 is invoked on completion of phase 1. It is responsible 1705 for choosing the best route out of all those available for each 1706 distinct destination, and for installing each chosen route into 1707 the appropriate Loc-RIB. 1709 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 1710 responsible for disseminating routes in the Loc-RIB to each peer 1711 located in a neighboring autonomous system, according to the 1712 policies contained in the PIB. Route aggregation and information 1713 reduction can optionally be performed within this phase. 1715 9.1.1 Phase 1: Calculation of Degree of Preference 1717 The Phase 1 decision function shall be invoked whenever the local BGP 1718 speaker receives an UPDATE message from a peer located in a 1719 neighboring autonomous system that advertises a new route, a 1720 replacement route, or a withdrawn route. 1722 The Phase 1 decision function is a separate process which completes 1723 when it has no further work to do. 1725 The Phase 1 decision function shall lock an Adj-RIB-In prior to 1726 operating on any route contained within it, and shall unlock it after 1727 operating on all new or unfeasible routes contained within it. 1729 For each newly received or replacement feasible route, the local BGP 1730 speaker shall determine a degree of preference. If the route is 1731 learned from a BGP speaker in the local autonomous system, either the 1732 value of the LOCAL_PREF attribute shall be taken as the degree of 1733 preference, or the local system shall compute the degree of 1734 preference of the route based on preconfigured policy information. If 1735 the route is learned from a BGP speaker in a neighboring autonomous 1736 system, then the degree of preference shall be computed based on 1737 preconfigured policy information. The exact nature of this policy 1738 information and the computation involved is a local matter. The 1739 RFC DRAFT June 1995 1741 local speaker shall then run the internal update process of 9.2.1 to 1742 select and advertise the most preferable route. 1744 9.1.2 Phase 2: Route Selection 1746 The Phase 2 decision function shall be invoked on completion of Phase 1747 1. The Phase 2 function is a separate process which completes when 1748 it has no further work to do. The Phase 2 process shall consider all 1749 routes that are present in the Adj-RIBs-In, including those received 1750 from BGP speakers located in its own autonomous system and those 1751 received from BGP speakers located in neighboring autonomous systems. 1753 The Phase 2 decision function shall be blocked from running while the 1754 Phase 3 decision function is in process. The Phase 2 function shall 1755 lock all Adj-RIBs-In prior to commencing its function, and shall 1756 unlock them on completion. 1758 If the NEXT_HOP attribute of a BGP route depicts an address to which 1759 the local BGP speaker doesn't have a route in its Loc-RIB, the BGP 1760 route SHOULD be excluded from the Phase 2 decision function. 1762 For each set of destinations for which a feasible route exists in the 1763 Adj-RIBs-In, the local BGP speaker shall identify the route that has: 1765 a) the highest degree of preference of any route to the same set 1766 of destinations, or 1768 b) is the only route to that destination, or 1770 c) is selected as a result of the Phase 2 tie breaking rules 1771 specified in 9.1.2.1. 1773 The local speaker SHALL then install that route in the Loc-RIB, 1774 replacing any route to the same destination that is currently being 1775 held in the Loc-RIB. The local speaker MUST determine the immediate 1776 next hop to the address depicted by the NEXT_HOP attribute of the 1777 selected route by performing a lookup in the IGP and selecting one of 1778 the possible paths in the IGP. This immediate next hop MUST be used 1779 when installing the selected route in the Loc-RIB. If the route to 1780 the address depicted by the NEXT_HOP attribute changes such that the 1781 immediate next hop changes, route selection should be recalculated as 1782 specified above. 1784 Unfeasible routes shall be removed from the Loc-RIB, and 1785 corresponding unfeasible routes shall then be removed from the Adj- 1786 RFC DRAFT June 1995 1788 RIBs-In. 1790 9.1.2.1 Breaking Ties (Phase 2) 1792 In its Adj-RIBs-In a BGP speaker may have several routes to the same 1793 destination that have the same degree of preference. The local 1794 speaker can select only one of these routes for inclusion in the 1795 associated Loc-RIB. The local speaker considers all equally 1796 preferable routes, both those received from BGP speakers located in 1797 neighboring autonomous systems, and those received from other BGP 1798 speakers located in the local speaker's autonomous system. 1800 The following tie-breaking procedure assumes that for each candidate 1801 route all the BGP speakers within an autonomous system can ascertain 1802 the cost of a path (interior distance) to the address depicted by the 1803 NEXT_HOP attribute of the route. Ties shall be broken according to 1804 the following algorithm: 1806 a) If the local system is configured to take into account 1807 MULTI_EXIT_DISC, and the candidate routes differ in their 1808 MULTI_EXIT_DISC attribute, select the route that has the lowest 1809 value of the MULTI_EXIT_DISC attribute. 1811 b) Otherwise, select the route that has the lowest cost (interior 1812 distance) to the entity depicted by the NEXT_HOP attribute of the 1813 route. If there are several routes with the same cost, then the 1814 tie-breaking shall be broken as follows: 1816 - if at least one of the candidate routes was advertised by the 1817 BGP speaker in a neighboring autonomous system, select the 1818 route that was advertised by the BGP speaker in a neighboring 1819 autonomous system whose BGP Identifier has the lowest value 1820 among all other BGP speakers in neighboring autonomous systems; 1822 - otherwise, select the route that was advertised by the BGP 1823 speaker whose BGP Identifier has the lowest value. 1825 9.1.3 Phase 3: Route Dissemination 1827 The Phase 3 decision function shall be invoked on completion of Phase 1828 2, or when any of the following events occur: 1830 a) when routes in a Loc-RIB to local destinations have changed 1831 RFC DRAFT June 1995 1833 b) when locally generated routes learned by means outside of BGP 1834 have changed 1836 c) when a new BGP speaker - BGP speaker connection has been 1837 established 1839 The Phase 3 function is a separate process which completes when it 1840 has no further work to do. The Phase 3 Routing Decision function 1841 shall be blocked from running while the Phase 2 decision function is 1842 in process. 1844 All routes in the Loc-RIB shall be processed into a corresponding 1845 entry in the associated Adj-RIBs-Out. Route aggregation and 1846 information reduction techniques (see 9.2.4.1) may optionally be 1847 applied. 1849 For the benefit of future support of inter-AS multicast capabilities, 1850 a BGP speaker that participates in inter-AS multicast routing shall 1851 advertise a route it receives from one of its external peers and if 1852 it installs it in its Loc-RIB, it shall advertise it back to the peer 1853 from which the route was received. For a BGP speaker that does not 1854 participate in inter-AS multicast routing such an advertisement is 1855 optional. When doing such an advertisement, the NEXT_HOP attribute 1856 should be set to the address of the peer. An implementation may also 1857 optimize such an advertisement by truncating information in the 1858 AS_PATH attribute to include only its own AS number and that of the 1859 peer that advertised the route (such truncation requires the ORIGIN 1860 attribute to be set to INCOMPLETE). In addition an implementation is 1861 not required to pass optional or discretionary path attributes with 1862 such an advertisement. 1864 When the updating of the Adj-RIBs-Out and the Forwarding Information 1865 Base (FIB) is complete, the local BGP speaker shall run the external 1866 update process of 9.2.2. 1868 9.1.4 Overlapping Routes 1870 A BGP speaker may transmit routes with overlapping Network Layer 1871 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 1872 occurs when a set of destinations are identified in non-matching 1873 multiple routes. Since BGP encodes NLRI using IP prefixes, overlap 1874 will always exhibit subset relationships. A route describing a 1875 smaller set of destinations (a longer prefix) is said to be more 1876 specific than a route describing a larger set of destinations (a 1877 shorted prefix); similarly, a route describing a larger set of 1878 destinations (a shorter prefix) is said to be less specific than a 1879 RFC DRAFT June 1995 1881 route describing a smaller set of destinations (a longer prefix). 1883 The precedence relationship effectively decomposes less specific 1884 routes into two parts: 1886 - a set of destinations described only by the less specific 1887 route, and 1889 - a set of destinations described by the overlap of the less 1890 specific and the more specific routes 1892 When overlapping routes are present in the same Adj-RIB-In, the more 1893 specific route shall take precedence, in order from more specific to 1894 least specific. 1896 The set of destinations described by the overlap represents a portion 1897 of the less specific route that is feasible, but is not currently in 1898 use. If a more specific route is later withdrawn, the set of 1899 destinations described by the overlap will still be reachable using 1900 the less specific route. 1902 If a BGP speaker receives overlapping routes, the Decision Process 1903 shall take into account the semantics of the overlapping routes. In 1904 particular, if a BGP speaker accepts the less specific route while 1905 rejecting the more specific route from the same peer, then the 1906 destinations represented by the overlap may not forward along the ASs 1907 listed in the AS_PATH attribute of that route. Therefore, a BGP 1908 speaker has the following choices: 1910 a) Install both the less and the more specific routes 1912 b) Install the more specific route only 1914 c) Install the non-overlapping part of the less specific 1915 route only (that implies de-aggregation) 1917 d) Aggregate the two routes and install the aggregated route 1919 e) Install the less specific route only 1921 f) Install neither route 1923 If a BGP speaker chooses e), then it should add ATOMIC_AGGREGATE 1924 attribute to the route. A route that carries ATOMIC_AGGREGATE 1925 attribute can not be de-aggregated. That is, the NLRI of this route 1926 can not be made more specific. Forwarding along such a route does 1927 not guarantee that IP packets will actually traverse only ASs listed 1928 RFC DRAFT June 1995 1930 in the AS_PATH attribute of the route. If a BGP speaker chooses a), 1931 it must not advertise the more general route without the more 1932 specific route. 1934 9.2 Update-Send Process 1936 The Update-Send process is responsible for advertising UPDATE 1937 messages to all peers. For example, it distributes the routes chosen 1938 by the Decision Process to other BGP speakers which may be located in 1939 either the same autonomous system or a neighboring autonomous system. 1940 Rules for information exchange between BGP speakers located in 1941 different autonomous systems are given in 9.2.2; rules for 1942 information exchange between BGP speakers located in the same 1943 autonomous system are given in 9.2.1. 1945 Distribution of routing information between a set of BGP speakers, 1946 all of which are located in the same autonomous system, is referred 1947 to as internal distribution. 1949 9.2.1 Internal Updates 1951 The Internal update process is concerned with the distribution of 1952 routing information to BGP speakers located in the local speaker's 1953 autonomous system. 1955 When a BGP speaker receives an UPDATE message from another BGP 1956 speaker located in its own autonomous system, the receiving BGP 1957 speaker shall not re-distribute the routing information contained in 1958 that UPDATE message to other BGP speakers located in its own 1959 autonomous system. 1961 When a BGP speaker receives a new route from a BGP speaker in a 1962 neighboring autonomous system, it shall advertise that route to all 1963 other BGP speakers in its autonomous system by means of an UPDATE 1964 message if any of the following conditions occur: 1966 1) the degree of preference assigned to the newly received route 1967 by the local BGP speaker is higher than the degree of preference 1968 that the local speaker has assigned to other routes that have been 1969 received from BGP speakers in neighboring autonomous systems, or 1971 2) there are no other routes that have been received from BGP 1972 speakers in neighboring autonomous systems, or 1973 RFC DRAFT June 1995 1975 3) the newly received route is selected as a result of breaking a 1976 tie between several routes which have the highest degree of 1977 preference, and the same destination (the tie-breaking procedure 1978 is specified in 9.2.1.1). 1980 When a BGP speaker receives an UPDATE message with a non-empty 1981 WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all 1982 routes whose destinations was carried in this field (as IP prefixes). 1983 The speaker shall take the following additional steps: 1985 1) if the corresponding feasible route had not been previously 1986 advertised, then no further action is necessary 1988 2) if the corresponding feasible route had been previously 1989 advertised, then: 1991 i) if a new route is selected for advertisement that has the 1992 same Network Layer Reachability Information as the unfeasible 1993 routes, then the local BGP speaker shall advertise the 1994 replacement route 1996 ii) if a replacement route is not available for advertisement, 1997 then the BGP speaker shall include the destinations of the 1998 unfeasible route (in form of IP prefixes) in the WITHDRAWN 1999 ROUTES field of an UPDATE message, and shall send this message 2000 to each peer to whom it had previously advertised the 2001 corresponding feasible route. 2003 All feasible routes which are advertised shall be placed in the 2004 appropriate Adj-RIBs-Out, and all unfeasible routes which are 2005 advertised shall be removed from the Adj-RIBs-Out. 2007 9.2.1.1 Breaking Ties (Internal Updates) 2009 If a local BGP speaker has connections to several BGP speakers in 2010 neighboring autonomous systems, there will be multiple Adj-RIBs-In 2011 associated with these peers. These Adj-RIBs-In might contain several 2012 equally preferable routes to the same destination, all of which were 2013 advertised by BGP speakers located in neighboring autonomous systems. 2014 The local BGP speaker shall select one of these routes according to 2015 the following rules: 2017 a) If the candidate route differ only in their NEXT_HOP and 2018 MULTI_EXIT_DISC attributes, and the local system is configured to 2019 take into account MULTI_EXIT_DISC attribute, select the routes 2020 RFC DRAFT June 1995 2022 that has the lowest value of the MULTI_EXIT_DISC attribute. 2024 b) If the local system can ascertain the cost of a path to the 2025 entity depicted by the NEXT_HOP attribute of the candidate route, 2026 select the route with the lowest cost. 2028 c) In all other cases, select the route that was advertised by the 2029 BGP speaker whose BGP Identifier has the lowest value. 2031 9.2.2 External Updates 2033 The external update process is concerned with the distribution of 2034 routing information to BGP speakers located in neighboring autonomous 2035 systems. As part of Phase 3 route selection process, the BGP speaker 2036 has updated its Adj-RIBs-Out and its Forwarding Table. All newly 2037 installed routes and all newly unfeasible routes for which there is 2038 no replacement route shall be advertised to BGP speakers located in 2039 neighboring autonomous systems by means of UPDATE message. 2041 Any routes in the Loc-RIB marked as unfeasible shall be removed. 2042 Changes to the reachable destinations within its own autonomous 2043 system shall also be advertised in an UPDATE message. 2045 9.2.3 Controlling Routing Traffic Overhead 2047 The BGP protocol constrains the amount of routing traffic (that is, 2048 UPDATE messages) in order to limit both the link bandwidth needed to 2049 advertise UPDATE messages and the processing power needed by the 2050 Decision Process to digest the information contained in the UPDATE 2051 messages. 2053 9.2.3.1 Frequency of Route Advertisement 2055 The parameter MinRouteAdvertisementInterval determines the minimum 2056 amount of time that must elapse between advertisement of routes to a 2057 particular destination from a single BGP speaker. This rate limiting 2058 procedure applies on a per-destination basis, although the value of 2059 MinRouteAdvertisementInterval is set on a per BGP peer basis. 2061 Two UPDATE messages sent from a single BGP speaker that advertise 2062 feasible routes to some common set of destinations received from BGP 2063 RFC DRAFT June 1995 2065 speakers in neighboring autonomous systems must be separated by at 2066 least MinRouteAdvertisementInterval. Clearly, this can only be 2067 achieved precisely by keeping a separate timer for each common set of 2068 destinations. This would be unwarranted overhead. Any technique which 2069 ensures that the interval between two UPDATE messages sent from a 2070 single BGP speaker that advertise feasible routes to some common set 2071 of destinations received from BGP speakers in neighboring autonomous 2072 systems will be at least MinRouteAdvertisementInterval, and will also 2073 ensure a constant upper bound on the interval is acceptable. 2075 Since fast convergence is needed within an autonomous system, this 2076 procedure does not apply for routes receives from other BGP speakers 2077 in the same autonomous system. To avoid long-lived black holes, the 2078 procedure does not apply to the explicit withdrawal of unfeasible 2079 routes (that is, routes whose destinations (expressed as IP prefixes) 2080 are listed in the WITHDRAWN ROUTES field of an UPDATE message). 2082 This procedure does not limit the rate of route selection, but only 2083 the rate of route advertisement. If new routes are selected multiple 2084 times while awaiting the expiration of MinRouteAdvertisementInterval, 2085 the last route selected shall be advertised at the end of 2086 MinRouteAdvertisementInterval. 2088 9.2.3.2 Frequency of Route Origination 2090 The parameter MinASOriginationInterval determines the minimum amount 2091 of time that must elapse between successive advertisements of UPDATE 2092 messages that report changes within the advertising BGP speaker's own 2093 autonomous systems. 2095 9.2.3.3 Jitter 2097 To minimize the likelihood that the distribution of BGP messages by a 2098 given BGP speaker will contain peaks, jitter should be applied to the 2099 timers associated with MinASOriginationInterval, Keepalive, and 2100 MinRouteAdvertisementInterval. A given BGP speaker shall apply the 2101 same jitter to each of these quantities regardless of the 2102 destinations to which the updates are being sent; that is, jitter 2103 will not be applied on a "per peer" basis. 2105 The amount of jitter to be introduced shall be determined by 2106 multiplying the base value of the appropriate timer by a random 2107 factor which is uniformly distributed in the range from 0.75 to 1.0. 2109 RFC DRAFT June 1995 2111 9.2.4 Efficient Organization of Routing Information 2113 Having selected the routing information which it will advertise, a 2114 BGP speaker may avail itself of several methods to organize this 2115 information in an efficient manner. 2117 9.2.4.1 Information Reduction 2119 Information reduction may imply a reduction in granularity of policy 2120 control - after information is collapsed, the same policies will 2121 apply to all destinations and paths in the equivalence class. 2123 The Decision Process may optionally reduce the amount of information 2124 that it will place in the Adj-RIBs-Out by any of the following 2125 methods: 2127 a) Network Layer Reachability Information (NLRI): 2129 Destination IP addresses can be represented as IP address 2130 prefixes. In cases where there is a correspondence between the 2131 address structure and the systems under control of an autonomous 2132 system administrator, it will be possible to reduce the size of 2133 the NLRI carried in the UPDATE messages. 2135 b) AS_PATHs: 2137 AS path information can be represented as ordered AS_SEQUENCEs or 2138 unordered AS_SETs. AS_SETs are used in the route aggregation 2139 algorithm described in 9.2.4.2. They reduce the size of the 2140 AS_PATH information by listing each AS number only once, 2141 regardless of how many times it may have appeared in multiple 2142 AS_PATHs that were aggregated. 2144 An AS_SET implies that the destinations listed in the NLRI can be 2145 reached through paths that traverse at least some of the 2146 constituent autonomous systems. AS_SETs provide sufficient 2147 information to avoid routing information looping; however their 2148 use may prune potentially feasible paths, since such paths are no 2149 longer listed individually as in the form of AS_SEQUENCEs. In 2150 practice this is not likely to be a problem, since once an IP 2151 packet arrives at the edge of a group of autonomous systems, the 2152 BGP speaker at that point is likely to have more detailed path 2153 information and can distinguish individual paths to destinations. 2155 RFC DRAFT June 1995 2157 9.2.4.2 Aggregating Routing Information 2159 Aggregation is the process of combining the characteristics of 2160 several different routes in such a way that a single route can be 2161 advertised. Aggregation can occur as part of the decision process 2162 to reduce the amount of routing information that will be placed in 2163 the Adj-RIBs-Out. 2165 Aggregation reduces the amount of information that a BGP speaker must 2166 store and exchange with other BGP speakers. Routes can be aggregated 2167 by applying the following procedure separately to path attributes of 2168 like type and to the Network Layer Reachability Information. 2170 Routes that have the following attributes shall not be aggregated 2171 unless the corresponding attributes of each route are identical: 2172 MULTI_EXIT_DISC, NEXT_HOP. 2174 Path attributes that have different type codes can not be aggregated 2175 together. Path of the same type code may be aggregated, according to 2176 the following rules: 2178 ORIGIN attribute: If at least one route among routes that are 2179 aggregated has ORIGIN with the value INCOMPLETE, then the 2180 aggregated route must have the ORIGIN attribute with the value 2181 INCOMPLETE. Otherwise, if at least one route among routes that are 2182 aggregated has ORIGIN with the value EGP, then the aggregated 2183 route must have the origin attribute with the value EGP. In all 2184 other case the value of the ORIGIN attribute of the aggregated 2185 route is INTERNAL. 2187 AS_PATH attribute: If routes to be aggregated have identical 2188 AS_PATH attributes, then the aggregated route has the same AS_PATH 2189 attribute as each individual route. 2191 For the purpose of aggregating AS_PATH attributes we model each AS 2192 within the AS_PATH attribute as a tuple , where 2193 "type" identifies a type of the path segment the AS belongs to 2194 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If the 2195 routes to be aggregated have different AS_PATH attributes, then 2196 the aggregated AS_PATH attribute shall satisfy all of the 2197 following conditions: 2199 - all tuples of the type AS_SEQUENCE in the aggregated AS_PATH 2200 shall appear in all of the AS_PATH in the initial set of routes 2201 to be aggregated. 2203 - all tuples of the type AS_SET in the aggregated AS_PATH shall 2204 RFC DRAFT June 1995 2206 appear in at least one of the AS_PATH in the initial set (they 2207 may appear as either AS_SET or AS_SEQUENCE types). 2209 - for any tuple X of the type AS_SEQUENCE in the aggregated 2210 AS_PATH which precedes tuple Y in the aggregated AS_PATH, X 2211 precedes Y in each AS_PATH in the initial set which contains Y, 2212 regardless of the type of Y. 2214 - No tuple with the same value shall appear more than once in 2215 the aggregated AS_PATH, regardless of the tuple's type. 2217 An implementation may choose any algorithm which conforms to these 2218 rules. At a minimum a conformant implementation shall be able to 2219 perform the following algorithm that meets all of the above 2220 conditions: 2222 - determine the longest leading sequence of tuples (as defined 2223 above) common to all the AS_PATH attributes of the routes to be 2224 aggregated. Make this sequence the leading sequence of the 2225 aggregated AS_PATH attribute. 2227 - set the type of the rest of the tuples from the AS_PATH 2228 attributes of the routes to be aggregated to AS_SET, and append 2229 them to the aggregated AS_PATH attribute. 2231 - if the aggregated AS_PATH has more than one tuple with the 2232 same value (regardless of tuple's type), eliminate all, but one 2233 such tuple by deleting tuples of the type AS_SET from the 2234 aggregated AS_PATH attribute. 2236 Appendix 6, section 6.8 presents another algorithm that satisfies 2237 the conditions and allows for more complex policy configurations. 2239 ATOMIC_AGGREGATE: If at least one of the routes to be aggregated 2240 has ATOMIC_AGGREGATE path attribute, then the aggregated route 2241 shall have this attribute as well. 2243 AGGREGATOR: All AGGREGATOR attributes of all routes to be 2244 aggregated should be ignored. 2246 9.3 Route Selection Criteria 2248 Generally speaking, additional rules for comparing routes among 2249 several alternatives are outside the scope of this document. There 2250 are two exceptions: 2252 RFC DRAFT June 1995 2254 - If the local AS appears in the AS path of the new route being 2255 considered, then that new route cannot be viewed as better than 2256 any other route. If such a route were ever used, a routing loop 2257 would result. 2259 - In order to achieve successful distributed operation, only 2260 routes with a likelihood of stability can be chosen. Thus, an AS 2261 must avoid using unstable routes, and it must not make rapid 2262 spontaneous changes to its choice of route. Quantifying the terms 2263 "unstable" and "rapid" in the previous sentence will require 2264 experience, but the principle is clear. 2266 9.4 Originating BGP routes 2268 A BGP speaker may originate BGP routes by injecting routing 2269 information acquired by some other means (e.g. via an IGP) into BGP. 2270 A BGP speaker that originates BGP routes shall assign the degree of 2271 preference to these routes by passing them through the Decision 2272 Process (see Section 9.1). These routes may also be distributed to 2273 other BGP speakers within the local AS as part of the Internal update 2274 process (see Section 9.2.1). The decision whether to distribute non- 2275 BGP acquired routes within an AS via BGP or not depends on the 2276 environment within the AS (e.g. type of IGP) and should be controlled 2277 via configuration. 2279 Appendix 1. BGP FSM State Transitions and Actions. 2281 This Appendix discusses the transitions between states in the BGP FSM 2282 in response to BGP events. The following is the list of these states 2283 and events when the negotiated Hold Time value is non-zero. 2285 BGP States: 2287 1 - Idle 2288 2 - Connect 2289 3 - Active 2290 4 - OpenSent 2291 5 - OpenConfirm 2292 6 - Established 2294 BGP Events: 2296 RFC DRAFT June 1995 2298 1 - BGP Start 2299 2 - BGP Stop 2300 3 - BGP Transport connection open 2301 4 - BGP Transport connection closed 2302 5 - BGP Transport connection open failed 2303 6 - BGP Transport fatal error 2304 7 - ConnectRetry timer expired 2305 8 - Hold Timer expired 2306 9 - KeepAlive timer expired 2307 10 - Receive OPEN message 2308 11 - Receive KEEPALIVE message 2309 12 - Receive UPDATE messages 2310 13 - Receive NOTIFICATION message 2312 The following table describes the state transitions of the BGP FSM 2313 and the actions triggered by these transitions. 2315 Event Actions Message Sent Next State 2316 -------------------------------------------------------------------- 2317 Idle (1) 2318 1 Initialize resources none 2 2319 Start ConnectRetry timer 2320 Initiate a transport connection 2321 others none none 1 2323 Connect(2) 2324 1 none none 2 2325 3 Complete initialization OPEN 4 2326 Clear ConnectRetry timer 2327 5 Restart ConnectRetry timer none 3 2328 7 Restart ConnectRetry timer none 2 2329 Initiate a transport connection 2330 others Release resources none 1 2332 Active (3) 2333 1 none none 3 2334 3 Complete initialization OPEN 4 2335 Clear ConnectRetry timer 2336 5 Close connection 3 2337 Restart ConnectRetry timer 2338 7 Restart ConnectRetry timer none 2 2339 Initiate a transport connection 2340 others Release resources none 1 2341 RFC DRAFT June 1995 2343 OpenSent(4) 2344 1 none none 4 2345 4 Close transport connection none 3 2346 Restart ConnectRetry timer 2347 6 Release resources none 1 2348 10 Process OPEN is OK KEEPALIVE 5 2349 Process OPEN failed NOTIFICATION 1 2350 others Close transport connection NOTIFICATION 1 2351 Release resources 2353 OpenConfirm (5) 2354 1 none none 5 2355 4 Release resources none 1 2356 6 Release resources none 1 2357 9 Restart KeepAlive timer KEEPALIVE 5 2358 11 Complete initialization none 6 2359 Restart Hold Timer 2360 13 Close transport connection 1 2361 Release resources 2362 others Close transport connection NOTIFICATION 1 2363 Release resources 2365 Established (6) 2366 1 none none 6 2367 4 Release resources none 1 2368 6 Release resources none 1 2369 9 Restart KeepAlive timer KEEPALIVE 6 2370 11 Restart Hold Timer KEEPALIVE 6 2371 12 Process UPDATE is OK UPDATE 6 2372 Process UPDATE failed NOTIFICATION 1 2373 13 Close transport connection 1 2374 Release resources 2375 others Close transport connection NOTIFICATION 1 2376 Release resources 2377 --------------------------------------------------------------------- 2379 The following is a condensed version of the above state transition 2380 table. 2382 Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab 2383 RFC DRAFT June 1995 2385 | (1) | (2) | (3) | (4) | (5) | (6) 2386 |--------------------------------------------------------------- 2387 1 | 2 | 2 | 3 | 4 | 5 | 6 2388 | | | | | | 2389 2 | 1 | 1 | 1 | 1 | 1 | 1 2390 | | | | | | 2391 3 | 1 | 4 | 4 | 1 | 1 | 1 2392 | | | | | | 2393 4 | 1 | 1 | 1 | 3 | 1 | 1 2394 | | | | | | 2395 5 | 1 | 3 | 3 | 1 | 1 | 1 2396 | | | | | | 2397 6 | 1 | 1 | 1 | 1 | 1 | 1 2398 | | | | | | 2399 7 | 1 | 2 | 2 | 1 | 1 | 1 2400 | | | | | | 2401 8 | 1 | 1 | 1 | 1 | 1 | 1 2402 | | | | | | 2403 9 | 1 | 1 | 1 | 1 | 5 | 6 2404 | | | | | | 2405 10 | 1 | 1 | 1 | 1 or 5 | 1 | 1 2406 | | | | | | 2407 11 | 1 | 1 | 1 | 1 | 6 | 6 2408 | | | | | | 2409 12 | 1 | 1 | 1 | 1 | 1 | 1 or 6 2410 | | | | | | 2411 13 | 1 | 1 | 1 | 1 | 1 | 1 2412 | | | | | | 2413 --------------------------------------------------------------- 2415 Appendix 2. Comparison with RFC1267 2417 BGP-4 is capable of operating in an environment where a set of 2418 reachable destinations may be expressed via a single IP prefix. The 2419 concept of network classes, or subnetting is foreign to BGP-4. To 2420 accommodate these capabilities BGP-4 changes semantics and encoding 2421 associated with the AS_PATH attribute. New text has been added to 2422 define semantics associated with IP prefixes. These abilities allow 2423 BGP-4 to support the proposed supernetting scheme [9]. 2425 To simplify configuration this version introduces a new attribute, 2426 LOCAL_PREF, that facilitates route selection procedures. 2428 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 2430 RFC DRAFT June 1995 2432 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 2433 certain aggregates are not de-aggregated. Another new attribute, 2434 AGGREGATOR, can be added to aggregate routes in order to advertise 2435 which AS and which BGP speaker within that AS caused the aggregation. 2437 To insure that Hold Timers are symmetric, the Hold Time is now 2438 negotiated on a per-connection basis. Hold Times of zero are now 2439 supported. 2441 Appendix 3. Comparison with RFC 1163 2443 All of the changes listed in Appendix 2, plus the following. 2445 To detect and recover from BGP connection collision, a new field (BGP 2446 Identifier) has been added to the OPEN message. New text (Section 2447 6.8) has been added to specify the procedure for detecting and 2448 recovering from collision. 2450 The new document no longer restricts the border router that is passed 2451 in the NEXT_HOP path attribute to be part of the same Autonomous 2452 System as the BGP Speaker. 2454 New document optimizes and simplifies the exchange of the information 2455 about previously reachable routes. 2457 Appendix 4. Comparison with RFC 1105 2459 All of the changes listed in Appendices 2 and 3, plus the following. 2461 Minor changes to the RFC1105 Finite State Machine were necessary to 2462 accommodate the TCP user interface provided by 4.3 BSD. 2464 The notion of Up/Down/Horizontal relations present in RFC1105 has 2465 been removed from the protocol. 2467 The changes in the message format from RFC1105 are as follows: 2469 1. The Hold Time field has been removed from the BGP header and 2470 added to the OPEN message. 2472 2. The version field has been removed from the BGP header and 2473 added to the OPEN message. 2475 3. The Link Type field has been removed from the OPEN message. 2477 RFC DRAFT June 1995 2479 4. The OPEN CONFIRM message has been eliminated and replaced with 2480 implicit confirmation provided by the KEEPALIVE message. 2482 5. The format of the UPDATE message has been changed 2483 significantly. New fields were added to the UPDATE message to 2484 support multiple path attributes. 2486 6. The Marker field has been expanded and its role broadened to 2487 support authentication. 2489 Note that quite often BGP, as specified in RFC 1105, is referred 2490 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 2491 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 2492 BGP, as specified in this document is referred to as BGP-4. 2494 Appendix 5. TCP options that may be used with BGP 2496 If a local system TCP user interface supports TCP PUSH function, then 2497 each BGP message should be transmitted with PUSH flag set. Setting 2498 PUSH flag forces BGP messages to be transmitted promptly to the 2499 receiver. 2501 If a local system TCP user interface supports setting precedence for 2502 TCP connection, then the BGP transport connection should be opened 2503 with precedence set to Internetwork Control (110) value (see also 2504 [6]). 2506 Appendix 6. Implementation Recommendations 2508 This section presents some implementation recommendations. 2510 6.1 Multiple Networks Per Message 2512 The BGP protocol allows for multiple address prefixes with the same 2513 AS path and next-hop gateway to be specified in one message. Making 2514 use of this capability is highly recommended. With one address prefix 2515 per message there is a substantial increase in overhead in the 2516 receiver. Not only does the system overhead increase due to the 2517 reception of multiple messages, but the overhead of scanning the 2518 routing table for updates to BGP peers and other routing protocols 2519 (and sending the associated messages) is incurred multiple times as 2520 RFC DRAFT June 1995 2522 well. One method of building messages containing many address 2523 prefixes per AS path and gateway from a routing table that is not 2524 organized per AS path is to build many messages as the routing table 2525 is scanned. As each address prefix is processed, a message for the 2526 associated AS path and gateway is allocated, if it does not exist, 2527 and the new address prefix is added to it. If such a message exists, 2528 the new address prefix is just appended to it. If the message lacks 2529 the space to hold the new address prefix, it is transmitted, a new 2530 message is allocated, and the new address prefix is inserted into the 2531 new message. When the entire routing table has been scanned, all 2532 allocated messages are sent and their resources released. Maximum 2533 compression is achieved when all the destinations covered by the 2534 address prefixes share a gateway and common path attributes, making 2535 it possible to send many address prefixes in one 4096-byte message. 2537 When peering with a BGP implementation that does not compress 2538 multiple address prefixes into one message, it may be necessary to 2539 take steps to reduce the overhead from the flood of data received 2540 when a peer is acquired or a significant network topology change 2541 occurs. One method of doing this is to limit the rate of updates. 2542 This will eliminate the redundant scanning of the routing table to 2543 provide flash updates for BGP peers and other routing protocols. A 2544 disadvantage of this approach is that it increases the propagation 2545 latency of routing information. By choosing a minimum flash update 2546 interval that is not much greater than the time it takes to process 2547 the multiple messages this latency should be minimized. A better 2548 method would be to read all received messages before sending updates. 2550 6.2 Processing Messages on a Stream Protocol 2552 BGP uses TCP as a transport mechanism. Due to the stream nature of 2553 TCP, all the data for received messages does not necessarily arrive 2554 at the same time. This can make it difficult to process the data as 2555 messages, especially on systems such as BSD Unix where it is not 2556 possible to determine how much data has been received but not yet 2557 processed. 2559 One method that can be used in this situation is to first try to read 2560 just the message header. For the KEEPALIVE message type, this is a 2561 complete message; for other message types, the header should first be 2562 verified, in particular the total length. If all checks are 2563 successful, the specified length, minus the size of the message 2564 header is the amount of data left to read. An implementation that 2565 would "hang" the routing information process while trying to read 2566 from a peer could set up a message buffer (4096 bytes) per peer and 2567 fill it with data as available until a complete message has been 2568 RFC DRAFT June 1995 2570 received. 2572 6.3 Reducing route flapping 2574 To avoid excessive route flapping a BGP speaker which needs to 2575 withdraw a destination and send an update about a more specific or 2576 less specific route shall combine them into the same UPDATE message. 2578 6.4 BGP Timers 2580 BGP employs five timers: ConnectRetry, Hold Time, KeepAlive, 2581 MinASOriginationInterval, and MinRouteAdvertisementInterval The 2582 suggested value for the ConnectRetry timer is 120 seconds. The 2583 suggested value for the Hold Time is 90 seconds. The suggested value 2584 for the KeepAlive timer is 30 seconds. The suggested value for the 2585 MinASOriginationInterval is 15 seconds. The suggested value for the 2586 MinRouteAdvertisementInterval is 30 seconds. 2588 An implementation of BGP MUST allow these timers to be configurable. 2590 6.5 Path attribute ordering 2592 Implementations which combine update messages as described above in 2593 6.1 may prefer to see all path attributes presented in a known order. 2594 This permits them to quickly identify sets of attributes from 2595 different update messages which are semantically identical. To 2596 facilitate this, it is a useful optimization to order the path 2597 attributes according to type code. This optimization is entirely 2598 optional. 2600 6.6 AS_SET sorting 2602 Another useful optimization that can be done to simplify this 2603 situation is to sort the AS numbers found in an AS_SET. This 2604 optimization is entirely optional. 2606 RFC DRAFT June 1995 2608 6.7 Control over version negotiation 2610 Since BGP-4 is capable of carrying aggregated routes which cannot be 2611 properly represented in BGP-3, an implementation which supports BGP-4 2612 and another BGP version should provide the capability to only speak 2613 BGP-4 on a per-peer basis. 2615 6.8 Complex AS_PATH aggregation 2617 An implementation which chooses to provide a path aggregation 2618 algorithm which retains significant amounts of path information may 2619 wish to use the following procedure: 2621 For the purpose of aggregating AS_PATH attributes of two routes, 2622 we model each AS as a tuple , where "type" identifies 2623 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 2624 AS_SET), and "value" is the AS number. Two ASs are said to be the 2625 same if their corresponding tuples are the same. 2627 The algorithm to aggregate two AS_PATH attributes works as 2628 follows: 2630 a) Identify the same ASs (as defined above) within each AS_PATH 2631 attribute that are in the same relative order within both 2632 AS_PATH attributes. Two ASs, X and Y, are said to be in the 2633 same order if either: 2634 - X precedes Y in both AS_PATH attributes, or - Y precedes X 2635 in both AS_PATH attributes. 2637 b) The aggregated AS_PATH attribute consists of ASs identified 2638 in (a) in exactly the same order as they appear in the AS_PATH 2639 attributes to be aggregated. If two consecutive ASs identified 2640 in (a) do not immediately follow each other in both of the 2641 AS_PATH attributes to be aggregated, then the intervening ASs 2642 (ASs that are between the two consecutive ASs that are the 2643 same) in both attributes are combined into an AS_SET path 2644 segment that consists of the intervening ASs from both AS_PATH 2645 attributes; this segment is then placed in between the two 2646 consecutive ASs identified in (a) of the aggregated attribute. 2647 If two consecutive ASs identified in (a) immediately follow 2648 each other in one attribute, but do not follow in another, then 2649 the intervening ASs of the latter are combined into an AS_SET 2650 path segment; this segment is then placed in between the two 2651 consecutive ASs identified in (a) of the aggregated attribute. 2653 RFC DRAFT June 1995 2655 If as a result of the above procedure a given AS number appears 2656 more than once within the aggregated AS_PATH attribute, all, but 2657 the last instance (rightmost occurrence) of that AS number should 2658 be removed from the aggregated AS_PATH attribute. 2660 References 2662 [1] Mills, D., "Exterior Gateway Protocol Formal Specification", RFC 2663 904, BBN, April 1984. 2665 [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET 2666 Backbone", RFC 1092, T.J. Watson Research Center, February 1989. 2668 [3] Braun, H-W., "The NSFNET Routing Architecture", RFC 1093, 2669 MERIT/NSFNET Project, February 1989. 2671 [4] Postel, J., "Transmission Control Protocol - DARPA Internet 2672 Program Protocol Specification", RFC 793, DARPA, September 1981. 2674 [5] Rekhter, Y., and P. Gross, "Application of the Border Gateway 2675 Protocol in the Internet", T.J. Watson Research Center, IBM Corp., 2676 MCI, Internet Draft. 2678 [6] Postel, J., "Internet Protocol - DARPA Internet Program Protocol 2679 Specification", RFC 791, DARPA, September 1981. 2681 [7] "Information Processing Systems - Telecommunications and 2682 Information Exchange between Systems - Protocol for Exchange of 2683 Inter-domain Routeing Information among Intermediate Systems to 2684 Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 2686 [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter- 2687 Domain Routing (CIDR): an Address Assignment and Aggregation 2688 Strategy", RFC 1519, BARRNet, cisco, MERIT, OARnet, September 1993 2690 [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation 2691 with CIDR", RFC 1518, T.J. Watson Research Center, cisco, September 2692 1993 2694 Security Considerations 2696 Security issues are not discussed in this document. 2698 RFC DRAFT June 1995 2700 Editors' Addresses 2702 Yakov Rekhter 2703 cisco Systems, Inc. 2704 170 W. Tasman Dr. 2705 San Jose, CA 95134 2706 email: yakov@cisco.com 2708 Tony Li 2709 cisco Systems, Inc. 2710 170 W. Tasman Dr. 2711 San Jose, CA 95134 2712 email: tli@cisco.com