idnits 2.17.1 draft-ietf-idr-bgp4-21.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 97 longer pages, the longest (page 2) being 61 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 99 instances of too long lines in the document, the longest one being 10 characters in excess of 72. ** The abstract seems to contain references ([RFC1518,RFC1519]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. == There are 3 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 401 has weird spacing: '...setting any B...' == Line 2188 has weird spacing: '... system autom...' == Line 3113 has weird spacing: '...rom the under...' == Line 4284 has weird spacing: '...hen all the d...' -- The exact meaning of the all-uppercase expression 'MAY NOT' is not defined in RFC 2119. If it is intended as a requirements expression, it should be rewritten using one of the combinations defined in RFC 2119; otherwise it should not be all-uppercase. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: BGP implementations MUST recognize all well-known attrbutes. Some of these attributes are mandatory and MUST be included in every UPDATE message that contains NLRI. Others are discretionary and MAY or MAY NOT be sent in a particular UPDATE message. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: Optional Attribute Status: 1) The DelayOpen optional attribute SHOULD be set to FALSE. 2) The DelayOpenTimer SHOULD not be running. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: If the route is learned from an external peer, then the local BGP speaker computes the degree of preference based on preconfigured policy information. If the return value indicates that the route is ineligible, the route MAY NOT serve as an input to the next phase of route selection; otherwise the return value MUST be used as the LOCAL_PREF value in any IBGP readvertisement. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: If due to the limits on the maximum size of an UPDATE message (see Section 4) a single route doesn't fit into the message, the BGP speaker MUST not advertise the route to its peers and MAY choose to log an error locally. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- Couldn't find a document date in the document -- date freshness check skipped. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'RF3065' is mentioned on line 1381, but not defined -- Looks like a reference, but probably isn't: '9' on line 4173 == Unused Reference: 'RFC1772' is defined on line 4505, but no explicit reference was found in the text == Unused Reference: 'RFC1997' is defined on line 4517, but no explicit reference was found in the text == Unused Reference: 'RFC2858' is defined on line 4529, but no explicit reference was found in the text ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 2385 (Obsoleted by RFC 5925) ** Obsolete normative reference: RFC 2434 (Obsoleted by RFC 5226) -- Obsolete informational reference (is this intentional?): RFC 1519 (Obsoleted by RFC 4632) -- Obsolete informational reference (is this intentional?): RFC 2796 (Obsoleted by RFC 4456) -- Obsolete informational reference (is this intentional?): RFC 2842 (ref. 'RFC3392') (Obsoleted by RFC 3392) -- Obsolete informational reference (is this intentional?): RFC 2858 (Obsoleted by RFC 4760) -- Obsolete informational reference (is this intentional?): RFC 3065 (Obsoleted by RFC 5065) Summary: 7 errors (**), 0 flaws (~~), 16 warnings (==), 9 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Y. Rekhter 3 INTERNET DRAFT Juniper Networks 4 T. Li 5 Procket Networks, Inc. 6 S. Hares 7 NextHop Technologies, Inc. 8 Editors 10 A Border Gateway Protocol 4 (BGP-4) 11 13 Status of this Memo 15 This document is an Internet-Draft and is in full conformance with 16 all provisions of Section 10 of RFC2026. 18 Internet-Drafts are working documents of the Internet Engineering 19 Task Force (IETF), its areas, and its working groups. Note that 20 other groups may also distribute working documents as Internet- 21 Drafts. 23 Internet-Drafts are draft documents valid for a maximum of six months 24 and may be updated, replaced, or obsoleted by other documents at any 25 time. It is inappropriate to use Internet-Drafts as reference 26 material or to cite them other than as ``work in progress.'' 28 The list of current Internet-Drafts can be accessed at 29 http://www.ietf.org/ietf/1id-abstracts.txt 31 The list of Internet-Draft Shadow Directories can be accessed at 32 http://www.ietf.org/shadow.html. 34 Copyright Notice 36 Copyright (C) The Internet Society (2003). All Rights Reserved. 38 Abstract 40 The Border Gateway Protocol (BGP) is an inter-Autonomous System 41 routing protocol. 43 RFC DRAFT September 2003 45 The primary function of a BGP speaking system is to exchange network 46 reachability information with other BGP systems. This network 47 reachability information includes information on the list of 48 Autonomous Systems (ASs) that reachability information traverses. 49 This information is sufficient to construct a graph of AS 50 connectivity for this reachability from which routing loops may be 51 pruned and some policy decisions at the AS level may be enforced. 53 BGP-4 provides a set of mechanisms for supporting Classless Inter- 54 Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms include 55 support for advertising a set of destinations as an IP prefix, and 56 eliminating the concept of network "class" within BGP. BGP-4 also 57 introduces mechanisms which allow aggregation of routes, including 58 aggregation of AS paths. 60 Routing information exchanged via BGP supports only the destination- 61 based forwarding paradigm, which assumes that a router forwards a 62 packet based solely on the destination address carried in the IP 63 header of the packet. This, in turn, reflects the set of policy 64 decisions that can (and can not) be enforced using BGP. BGP can 65 support only the policies conforming to the destination-based 66 forwarding paradigm. 68 This specification covers only the exchange of IP version 4 network 69 reachability information. 71 RFC DRAFT September 2003 73 Table of Contents 75 1. Definition of commonly used terms . . . . . . . . . . . . . . 5 76 2. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 77 Specification of Requirements . . . . . . . . . . . . . . . . . . 8 78 3. Summary of Operation . . . . . . . . . . . . . . . . . . . . . 8 79 3.1 Routes: Advertisement and Storage . . . . . . . . . . . . . . 9 80 3.2 Routing Information Bases . . . . . . . . . . . . . . . . . . 10 81 4. Message Formats . . . . . . . . . . . . . . . . . . . . . . . 12 82 4.1 Message Header Format . . . . . . . . . . . . . . . . . . . . 12 83 4.2 OPEN Message Format . . . . . . . . . . . . . . . . . . . . . 13 84 4.3 UPDATE Message Format . . . . . . . . . . . . . . . . . . . . 15 85 4.4 KEEPALIVE Message Format . . . . . . . . . . . . . . . . . . 22 86 4.5 NOTIFICATION Message Format . . . . . . . . . . . . . . . . . 22 87 5. Path Attributes . . . . . . . . . . . . . . . . . . . . . . . 24 88 5.1 Path Attribute Usage . . . . . . . . . . . . . . . . . . . . 26 89 5.1.1 ORIGIN . . . . . . . . . . . . . . . . . . . . . . . . . . 26 90 5.1.2 AS_PATH . . . . . . . . . . . . . . . . . . . . . . . . . . 26 91 5.1.3 NEXT_HOP . . . . . . . . . . . . . . . . . . . . . . . . . 27 92 5.1.4 MULTI_EXIT_DISC . . . . . . . . . . . . . . . . . . . . . . 29 93 5.1.5 LOCAL_PREF . . . . . . . . . . . . . . . . . . . . . . . . 30 94 5.1.6 ATOMIC_AGGREGATE . . . . . . . . . . . . . . . . . . . . . 30 95 5.1.7 AGGREGATOR . . . . . . . . . . . . . . . . . . . . . . . . 31 96 6. BGP Error Handling . . . . . . . . . . . . . . . . . . . . . . 31 97 6.1 Message Header error handling . . . . . . . . . . . . . . . . 31 98 6.2 OPEN message error handling . . . . . . . . . . . . . . . . . 32 99 6.3 UPDATE message error handling . . . . . . . . . . . . . . . . 33 100 6.4 NOTIFICATION message error handling . . . . . . . . . . . . . 35 101 6.5 Hold Timer Expired error handling . . . . . . . . . . . . . . 35 102 6.6 Finite State Machine error handling . . . . . . . . . . . . . 35 103 6.7 Cease . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 104 6.8 BGP connection collision detection . . . . . . . . . . . . . 36 105 7. BGP Version Negotiation . . . . . . . . . . . . . . . . . . . 37 106 8. BGP Finite State machine . . . . . . . . . . . . . . . . . . . 38 107 8.1 Events for the BGP FSM . . . . . . . . . . . . . . . . . . . 39 108 8.1.1 Optional Events linked to Optional Session attributes . . . 39 109 8.1.2 Administrative Events . . . . . . . . . . . . . . . . . . 44 110 8.1.3 Timer Events . . . . . . . . . . . . . . . . . . . . . . . 47 111 8.1.4 TCP connection based Events . . . . . . . . . . . . . . . . 49 112 8.1.5 BGP Messages based Events . . . . . . . . . . . . . . . . . 51 113 8.2 Description of FSM . . . . . . . . . . . . . . . . . . . . . 53 114 8.2.1 FSM Definition . . . . . . . . . . . . . . . . . . . . . . 53 115 8.2.1.1 Terms "active" and "passive" . . . . . . . . . . . . . . 54 116 8.2.1.2 FSM and collision detection . . . . . . . . . . . . . . . 54 117 8.2.1.3 FSM and Optional Attributes . . . . . . . . . . . . . . 55 118 8.2.1.4 FSM Event numbers . . . . . . . . . . . . . . . . . . . . 55 119 RFC DRAFT September 2003 121 8.2.1.5 FSM actions that are implementation dependent . . . . . . 56 122 8.2.2 Finite State Machine . . . . . . . . . . . . . . . . . . . 56 123 9. UPDATE Message Handling . . . . . . . . . . . . . . . . . . . 72 124 9.1 Decision Process . . . . . . . . . . . . . . . . . . . . . . 73 125 9.1.1 Phase 1: Calculation of Degree of Preference . . . . . . . 74 126 9.1.2 Phase 2: Route Selection . . . . . . . . . . . . . . . . . 74 127 9.1.2.1 Route Resolvability Condition . . . . . . . . . . . . . . 76 128 9.1.2.2 Breaking Ties (Phase 2) . . . . . . . . . . . . . . . . . 77 129 9.1.3 Phase 3: Route Dissemination . . . . . . . . . . . . . . . 79 130 9.1.4 Overlapping Routes . . . . . . . . . . . . . . . . . . . . 80 131 9.2 Update-Send Process . . . . . . . . . . . . . . . . . . . . . 81 132 9.2.1 Controlling Routing Traffic Overhead . . . . . . . . . . . 82 133 9.2.1.1 Frequency of Route Advertisement . . . . . . . . . . . . 82 134 9.2.1.2 Frequency of Route Origination . . . . . . . . . . . . . 83 135 9.2.2 Efficient Organization of Routing Information . . . . . . . 83 136 9.2.2.1 Information Reduction . . . . . . . . . . . . . . . . . . 83 137 9.2.2.2 Aggregating Routing Information . . . . . . . . . . . . . 84 138 9.3 Route Selection Criteria . . . . . . . . . . . . . . . . . . 86 139 9.4 Originating BGP routes . . . . . . . . . . . . . . . . . . . 87 140 10. BGP Timers . . . . . . . . . . . . . . . . . . . . . . . . . 87 141 Appendix A. Comparison with RFC1771 . . . . . . . . . . . . . . . 88 142 Appendix B. Comparison with RFC1267 . . . . . . . . . . . . . . . 89 143 Appendix C. Comparison with RFC 1163 . . . . . . . . . . . . . . 90 144 Appendix D. Comparison with RFC 1105 . . . . . . . . . . . . . . 90 145 Appendix E. TCP options that may be used with BGP . . . . . . . . 91 146 Appendix F. Implementation Recommendations . . . . . . . . . . . 91 147 Appendix F.1 Multiple Networks Per Message . . . . . . . . . . . 91 148 Appendix F.2 Reducing route flapping . . . . . . . . . . . . . . 92 149 Appendix F.3 Path attribute ordering . . . . . . . . . . . . . . 92 150 Appendix F.4 AS_SET sorting . . . . . . . . . . . . . . . . . . . 92 151 Appendix F.5 Control over version negotiation . . . . . . . . . . 93 152 Appendix F.6 Complex AS_PATH aggregation . . . . . . . . . . . . 93 153 Security Considerations . . . . . . . . . . . . . . . . . . . . . 94 154 IANA Considerations . . . . . . . . . . . . . . . . . . . . . . . 94 155 IPR Notice . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 156 Full Copyright Notice . . . . . . . . . . . . . . . . . . . . . . 95 157 Normative References . . . . . . . . . . . . . . . . . . . . . . 96 158 Non-normative References . . . . . . . . . . . . . . . . . . . . 96 159 Authors Information . . . . . . . . . . . . . . . . . . . . . . . 97 160 RFC DRAFT September 2003 162 Abstract 164 The Border Gateway Protocol (BGP) is an inter-Autonomous System rout- 165 ing protocol. 167 The primary function of a BGP speaking system is to exchange network 168 reachability information with other BGP systems. This network reacha- 169 bility information includes information on the list of Autonomous 170 Systems (ASs) that reachability information traverses. This informa- 171 tion is sufficient to construct a graph of AS connectivity for this 172 reachability from which routing loops may be pruned and some policy 173 decisions at the AS level may be enforced. 175 BGP-4 provides a set of mechanisms for supporting Classless Inter- 176 Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms include 177 support for advertising a set of destinations as an IP prefix and 178 eliminating the concept of network "class" within BGP. BGP-4 also 179 introduces mechanisms which allow aggregation of routes, including 180 aggregation of AS paths. 182 Routing information exchanged via BGP supports only the destination- 183 based forwarding paradigm, which assumes that a router forwards a 184 packet based solely on the destination address carried in the IP 185 header of the packet. This, in turn, reflects the set of policy deci- 186 sions that can (and can not) be enforced using BGP. BGP can support 187 only the policies conforming to the destination-based forwarding 188 paradigm. 190 1. Definition of commonly used terms 192 This section provides definition for terms that have a specific mean- 193 ing to the BGP protocol and that are used throughout the text. 195 Adj-RIB-In 196 The Adj-RIBs-In contain unprocessed routing information that has 197 been advertised to the local BGP speaker by its peers. 199 Adj-RIB-Out 200 The Adj-RIBs-Out contains the routes for advertisement to specific 201 peers by means of the local speaker's UPDATE messages. 203 Autonomous System (AS) 204 The classic definition of an Autonomous System is a set of routers 205 under a single technical administration, using an interior gateway 206 protocol (IGP) and common metrics to determine how to route pack- 207 ets within the AS, and using an inter-AS routing protocol to 208 determine how to route packets to other ASs. Since this classic 209 RFC DRAFT September 2003 211 definition was developed, it has become common for a single AS to 212 use several IGPs and sometimes several sets of metrics within an 213 AS. The use of the term Autonomous System here stresses the fact 214 that, even when multiple IGPs and metrics are used, the adminis- 215 tration of an AS appears to other ASs to have a single coherent 216 interior routing plan and presents a consistent picture of what 217 destinations are reachable through it. 219 BGP Identifier 220 A 4-octet unsigned integer indicating the BGP Identifier of the 221 sender of BGP messages. A given BGP speaker sets the value of its 222 BGP Identifier to an IP address assigned to that BGP speaker. The 223 value of the BGP Identifier is determined on startup and is the 224 same for every local interface and every BGP peer. 226 BGP speaker 227 A router that implements BGP. 229 EBGP 230 External BGP (BGP connection between external peers). 232 External peer 233 Peer that is in a different Autonomous System than the local sys- 234 tem. 236 Feasible route 237 A route that is available for use. 239 IBGP 240 Internal BGP (BGP connection between internal peers). 242 Internal peer 243 Peer that is in the same Autonomous System as the local system. 245 IGP 246 Interior Gateway Protocol - a routing protocol used to exchange 247 routing information among routers within a single Autonomous Sys- 248 tem. 250 Loc-RIB 251 The Loc-RIB contains the routes that have been selected by the 252 local BGP speaker's Decision Process. 254 NLRI 255 Network Layer Reachability Information. 257 Route 258 A unit of information that pairs a set of destinations with the 259 RFC DRAFT September 2003 261 attributes of a path to those destinations. The set of destina- 262 tions are systems whose IP addresses are contained in one IP 263 address prefix carried in the Network Layer Reachability Informa- 264 tion (NLRI) field of an UPDATE message. The path is the informa- 265 tion reported in the path attributes field of the same UPDATE mes- 266 sage. 268 RIB 269 Routing Information Base. 271 Unfeasible route 272 A previously advertised feasible route that is no longer available 273 for use. 275 2. Acknowledgments 277 This document was originally published as RFC 1267 in October 1991, 278 jointly authored by Kirk Lougheed and Yakov Rekhter. 280 We would like to express our thanks to Guy Almes, Len Bosack, and 281 Jeffrey C. Honig for their contributions to the earlier version 282 (BGP-1) of this document. 284 We would like to specially acknowledge numerous contributions by Den- 285 nis Ferguson to the earlier version of this document. 287 We like to explicitly thank Bob Braden for the review of the earlier 288 version (BGP-2) of this document as well as his constructive and 289 valuable comments. 291 We would also like to thank Bob Hinden, Director for Routing of the 292 Internet Engineering Steering Group, and the team of reviewers he 293 assembled to review the earlier version (BGP-2) of this document. 294 This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia 295 Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted 296 with a strong combination of toughness, professionalism, and cour- 297 tesy. 299 Certain sections of the document borrowed heavily from IDRP 300 [IS10747], which is the OSI counterpart of BGP. For this credit 301 should be given to the ANSI X3S3.3 group chaired by Lyman Chapin and 302 to Charles Kunzinger who was the IDRP editor within that group. 304 We would also like to thank Benjamin Abarbanel, Enke Chen, Edward 305 Crabbe, Mike Craren, Vincent Gillet, Eric Gray, Jeffrey Haas, Dimitry 306 Haskin, John Krawczyk, David LeRoy, Dan Massey, Jonathan Natale, Dan 307 Pei, Mathew Richardson, John Scudder, John Stewart III, Dave Thaler, 308 RFC DRAFT September 2003 310 Paul Traina, Russ White, Curtis Villamizar, and Alex Zinin for their 311 comments. 313 We would like to specially acknowledge Andrew Lange for his help in 314 preparing the final version of this document. 316 Finally, we would like to thank all the members of the IDR Working 317 Group for their ideas and support they have given to this document. 319 Specification of Requirements 321 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 322 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 323 document are to be interpreted as described in RFC2119 [RFC2119]. 325 3. Summary of Operation 327 The Border Gateway Protocol (BGP) is an inter-Autonomous System rout- 328 ing protocol. It is built on experience gained with EGP as defined in 329 [RFC904] and EGP usage in the NSFNET Backbone as described in 330 [RFC1092] and [RFC1093]. 332 The primary function of a BGP speaking system is to exchange network 333 reachability information with other BGP systems. This network reacha- 334 bility information includes information on the list of Autonomous 335 Systems (ASs) that reachability information traverses. This informa- 336 tion is sufficient to construct a graph of AS connectivity from which 337 routing loops may be pruned and some policy decisions at the AS level 338 may be enforced. 340 In the context of this document we assume that a BGP speaker adver- 341 tises to its peers only those routes that it itself uses (in this 342 context a BGP speaker is said to "use" a BGP route if it is the most 343 preferred BGP route and is used in forwarding). All other cases are 344 outside the scope of this document. 346 In the context of this document the term "IP address" refers to an IP 347 Version 4 address [RFC791]. 349 Routing information exchanged via BGP supports only the destination- 350 based forwarding paradigm, which assumes that a router forwards a 351 packet based solely on the destination address carried in the IP 352 header of the packet. This, in turn, reflects the set of policy deci- 353 sions that can (and can not) be enforced using BGP. Note that some 354 RFC DRAFT September 2003 356 policies can not be supported by the destination-based forwarding 357 paradigm, and thus require techniques such as source routing (aka 358 explicit routing) to be enforced. Such policies can not be enforced 359 using BGP either. For example, BGP does not enable one AS to send 360 traffic to a neighboring AS for forwarding to some destination 361 (reachable through but) beyond that neighboring AS intending that the 362 traffic take a different route to that taken by the traffic originat- 363 ing in the neighboring AS (for that same destination). On the other 364 hand, BGP can support any policy conforming to the destination-based 365 forwarding paradigm. 367 BGP-4 provides a new set of mechanisms for supporting Classless 368 Inter-Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms 369 include support for advertising a set of destinations as an IP prefix 370 and eliminating the concept of network "class" within BGP. BGP-4 371 also introduces mechanisms which allow aggregation of routes, includ- 372 ing aggregation of AS paths. 374 This document uses the term `Autonomous System' (AS) throughout. The 375 classic definition of an Autonomous System is a set of routers under 376 a single technical administration, using an interior gateway protocol 377 (IGP) and common metrics to determine how to route packets within the 378 AS, and using an inter-AS routing protocol to determine how to route 379 packets to other ASs. Since this classic definition was developed, it 380 has become common for a single AS to use several IGPs and sometimes 381 several sets of metrics within an AS. The use of the term Autonomous 382 System here stresses the fact that, even when multiple IGPs and met- 383 rics are used, the administration of an AS appears to other ASs to 384 have a single coherent interior routing plan and presents a consis- 385 tent picture of what destinations are reachable through it. 387 BGP uses TCP [RFC793] as its transport protocol. This eliminates the 388 need to implement explicit update fragmentation, retransmission, 389 acknowledgment, and sequencing. BGP listens on TCP port 179. The 390 error notification mechanism used in BGP assumes that TCP supports a 391 "graceful" close, i.e., that all outstanding data will be delivered 392 before the connection is closed. 394 Two systems form a TCP connection between one another. They exchange 395 messages to open and confirm the connection parameters. 397 The initial data flow is the portion of the BGP routing table that is 398 allowed by the export policy, called the Adj-Ribs-Out (see 3.2). 399 Incremental updates are sent as the routing tables change. BGP does 400 not require periodic refresh of the routing table. To allow local 401 policy changes to have the correct effect without resetting any BGP 402 connections, a BGP speaker SHOULD either (a) retain the current ver- 403 sion of the routes advertised to it by all of its peers for the 404 RFC DRAFT September 2003 406 duration of the connection, or (b) make use of the Route Refresh 407 extension [RFC2918]. 409 KEEPALIVE messages may be sent periodically to ensure the liveness of 410 the connection. NOTIFICATION messages are sent in response to errors 411 or special conditions. If a connection encounters an error condition, 412 a NOTIFICATION message is sent and the connection is closed. 414 A peer in a different AS is referred to as an external peer, while a 415 peer in the same AS is referred to as an internal peer. Internal BGP 416 and external BGP are commonly abbreviated IBGP and EBGP. 418 If a particular AS has multiple BGP speakers and is providing transit 419 service for other ASs, then care must be taken to ensure a consistent 420 view of routing within the AS. A consistent view of the interior 421 routes of the AS is provided by the IGP used within the AS. For the 422 purpose of this document, it is assumed that a consistent view of the 423 routes exterior to the AS is provided by having all BGP speakers 424 within the AS maintain IBGP with each other. 426 This document specifies the base behavior of the BGP protocol. This 427 behavior can and is modified by extension specifications. When the 428 protocol is extended the new behavior is fully documented in the 429 extension specifications. 431 3.1 Routes: Advertisement and Storage 433 For the purpose of this protocol, a route is defined as a unit of 434 information that pairs a set of destinations with the attributes of a 435 path to those destinations. The set of destinations are systems whose 436 IP addresses are contained in one IP address prefix carried in the 437 Network Layer Reachability Information (NLRI) field of an UPDATE mes- 438 sage, and the path is the information reported in the path attributes 439 field of the same UPDATE message. 441 Routes are advertised between BGP speakers in UPDATE messages. Mul- 442 tiple routes that have the same path attributes can be advertised in 443 a single UPDATE message by including multiple prefixes in the NLRI 444 field of the UPDATE message. 446 Routes are stored in the Routing Information Bases (RIBs): namely, 447 the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out, as described in 448 Section 3.2. 450 If a BGP speaker chooses to advertise a previously received route, it 451 MAY add to or modify the path attributes of the route before adver- 452 tising it to a peer. 454 RFC DRAFT September 2003 456 BGP provides mechanisms by which a BGP speaker can inform its peer 457 that a previously advertised route is no longer available for use. 458 There are three methods by which a given BGP speaker can indicate 459 that a route has been withdrawn from service: 461 a) the IP prefix that expresses the destination for a previously 462 advertised route can be advertised in the WITHDRAWN ROUTES field 463 in the UPDATE message, thus marking the associated route as being 464 no longer available for use 466 b) a replacement route with the same NLRI can be advertised, or 468 c) the BGP speaker - BGP speaker connection can be closed, which 469 implicitly removes from service all routes which the pair of 470 speakers had advertised to each other. 472 Changing attribute(s) of a route is accomplished by advertising a 473 replacement route. The replacement route carries new (changed) 474 attributes and has the same address prefix as the original route. 476 3.2 Routing Information Base 478 The Routing Information Base (RIB) within a BGP speaker consists of 479 three distinct parts: 481 a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has 482 been learned from inbound UPDATE messages received from other BGP 483 speakers. Their contents represent routes that are available as an 484 input to the Decision Process. 486 b) Loc-RIB: The Loc-RIB contains the local routing information 487 that the BGP speaker has selected by applying its local policies 488 to the routing information contained in its Adj-RIBs-In. These are 489 the routes that will be used by the local BGP speaker. The next 490 hop for each of these routes MUST be resolvable via the local BGP 491 speaker's Routing Table. 493 c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the 494 local BGP speaker has selected for advertisement to its peers. The 495 routing information stored in the Adj-RIBs-Out will be carried in 496 the local BGP speaker's UPDATE messages and advertised to its 497 peers. 499 In summary, the Adj-RIBs-In contain unprocessed routing information 500 that has been advertised to the local BGP speaker by its peers; the 501 Loc-RIB contains the routes that have been selected by the local BGP 502 speaker's Decision Process; and the Adj-RIBs-Out organize the routes 503 RFC DRAFT September 2003 505 for advertisement to specific peers by means of the local speaker's 506 UPDATE messages. 508 Although the conceptual model distinguishes between Adj-RIBs-In, Loc- 509 RIB, and Adj-RIBs-Out, this neither implies nor requires that an 510 implementation must maintain three separate copies of the routing 511 information. The choice of implementation (for example, 3 copies of 512 the information vs 1 copy with pointers) is not constrained by the 513 protocol. 515 Routing information that the BGP speaker uses to forward packets (or 516 to construct the forwarding table that is used for packet forwarding) 517 is maintained in the Routing Table. The Routing Table accumulates 518 routes to directly connected networks, static routes, routes learned 519 from the IGP protocols, and routes learned from BGP. Whether or not 520 a specific BGP route should be installed in the Routing Table, and 521 whether a BGP route should override a route to the same destination 522 installed by another source is a local policy decision, not specified 523 in this document. Besides actual packet forwarding, the Routing Table 524 is used for resolution of the next-hop addresses specified in BGP 525 updates (see Section 5.1.3). 527 4. Message Formats 529 This section describes message formats used by BGP. 531 BGP messages are sent over a TCP connection. A message is processed 532 only after it is entirely received. The maximum message size is 4096 533 octets. All implementations are required to support this maximum mes- 534 sage size. The smallest message that may be sent consists of a BGP 535 header without a data portion, or 19 octets. 537 All multi-octet fields are in network byte order. 539 4.1 Message Header Format 541 Each message has a fixed-size header. There may or may not be a data 542 portion following the header, depending on the message type. The lay- 543 out of these fields is shown below: 545 RFC DRAFT September 2003 547 0 1 2 3 548 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 549 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 550 | | 551 + + 552 | | 553 + + 554 | Marker | 555 + + 556 | | 557 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 558 | Length | Type | 559 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 561 Marker: 563 This 16-octet field is included for compatibility; it MUST be 564 set to all ones. 566 Length: 568 This 2-octet unsigned integer indicates the total length of the 569 message, including the header, in octets. Thus, e.g., it allows 570 one to locate in the TCP stream the (Marker field of the) next 571 message. The value of the Length field MUST always be at least 572 19 and no greater than 4096, and MAY be further constrained, 573 depending on the message type. No "padding" of extra data after 574 the message is allowed, so the Length field MUST have the 575 smallest value required given the rest of the message. 577 Type: 579 This 1-octet unsigned integer indicates the type code of the 580 message. This document defines the following type codes: 582 1 - OPEN 583 2 - UPDATE 584 3 - NOTIFICATION 585 4 - KEEPALIVE 587 [RFC2918] defines one more type code. 589 4.2 OPEN Message Format 591 After a TCP connection is established, the first message sent by each 592 side is an OPEN message. If the OPEN message is acceptable, a 593 RFC DRAFT September 2003 595 KEEPALIVE message confirming the OPEN is sent back. 597 In addition to the fixed-size BGP header, the OPEN message contains 598 the following fields: 600 0 1 2 3 601 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 602 +-+-+-+-+-+-+-+-+ 603 | Version | 604 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 605 | My Autonomous System | 606 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 607 | Hold Time | 608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 609 | BGP Identifier | 610 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 611 | Opt Parm Len | 612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 613 | | 614 | Optional Parameters (variable) | 615 | | 616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 618 Version: 620 This 1-octet unsigned integer indicates the protocol version 621 number of the message. The current BGP version number is 4. 623 My Autonomous System: 625 This 2-octet unsigned integer indicates the Autonomous System 626 number of the sender. 628 Hold Time: 630 This 2-octet unsigned integer indicates the number of seconds 631 that the sender proposes for the value of the Hold Timer. Upon 632 receipt of an OPEN message, a BGP speaker MUST calculate the 633 value of the Hold Timer by using the smaller of its configured 634 Hold Time and the Hold Time received in the OPEN message. The 635 Hold Time MUST be either zero or at least three seconds. An 636 implementation MAY reject connections on the basis of the Hold 637 Time. The calculated value indicates the maximum number of 638 seconds that may elapse between the receipt of successive 639 KEEPALIVE, and/or UPDATE messages by the sender. 641 BGP Identifier: 643 RFC DRAFT September 2003 645 This 4-octet unsigned integer indicates the BGP Identifier of 646 the sender. A given BGP speaker sets the value of its BGP Iden- 647 tifier to an IP address assigned to that BGP speaker. The 648 value of the BGP Identifier is determined on startup and is the 649 same for every local interface and every BGP peer. 651 Optional Parameters Length: 653 This 1-octet unsigned integer indicates the total length of the 654 Optional Parameters field in octets. If the value of this field 655 is zero, no Optional Parameters are present. 657 Optional Parameters: 659 This field contains a list of optional parameters, where each 660 parameter is encoded as a triplet. 663 0 1 664 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 665 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 666 | Parm. Type | Parm. Length | Parameter Value (variable) 667 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 669 Parameter Type is a one octet field that unambiguously identi- 670 fies individual parameters. Parameter Length is a one octet 671 field that contains the length of the Parameter Value field in 672 octets. Parameter Value is a variable length field that is 673 interpreted according to the value of the Parameter Type field. 675 [RFC3392] defines the Capabilities Optional Parameter. 677 The minimum length of the OPEN message is 29 octets (including mes- 678 sage header). 680 4.3 UPDATE Message Format 682 UPDATE messages are used to transfer routing information between BGP 683 peers. The information in the UPDATE message can be used to construct 684 a graph describing the relationships of the various Autonomous Sys- 685 tems. By applying rules to be discussed, routing information loops 686 and some other anomalies may be detected and removed from inter-AS 687 routing. 689 An UPDATE message is used to advertise feasible routes sharing common 690 path attributes to a peer, or to withdraw multiple unfeasible routes 691 RFC DRAFT September 2003 693 from service (see 3.1). An UPDATE message MAY simultaneously adver- 694 tise a feasible route and withdraw multiple unfeasible routes from 695 service. The UPDATE message always includes the fixed-size BGP 696 header, and also includes the other fields as shown below (note, some 697 of the shown fields may not be present in every UPDATE message): 699 +-----------------------------------------------------+ 700 | Withdrawn Routes Length (2 octets) | 701 +-----------------------------------------------------+ 702 | Withdrawn Routes (variable) | 703 +-----------------------------------------------------+ 704 | Total Path Attribute Length (2 octets) | 705 +-----------------------------------------------------+ 706 | Path Attributes (variable) | 707 +-----------------------------------------------------+ 708 | Network Layer Reachability Information (variable) | 709 +-----------------------------------------------------+ 711 Withdrawn Routes Length: 713 This 2-octets unsigned integer indicates the total length of 714 the Withdrawn Routes field in octets. Its value allows the 715 length of the Network Layer Reachability Information field to 716 be determined as specified below. 718 A value of 0 indicates that no routes are being withdrawn from 719 service, and that the WITHDRAWN ROUTES field is not present in 720 this UPDATE message. 722 Withdrawn Routes: 724 This is a variable length field that contains a list of IP 725 address prefixes for the routes that are being withdrawn from 726 service. Each IP address prefix is encoded as a 2-tuple of the 727 form , whose fields are described below: 729 +---------------------------+ 730 | Length (1 octet) | 731 +---------------------------+ 732 | Prefix (variable) | 733 +---------------------------+ 735 The use and the meaning of these fields are as follows: 737 a) Length: 739 RFC DRAFT September 2003 741 The Length field indicates the length in bits of the IP 742 address prefix. A length of zero indicates a prefix that 743 matches all IP addresses (with prefix, itself, of zero 744 octets). 746 b) Prefix: 748 The Prefix field contains an IP address prefix followed by 749 the minimum number of trailing bits needed to make the end 750 of the field fall on an octet boundary. Note that the value 751 of trailing bits is irrelevant. 753 Total Path Attribute Length: 755 This 2-octet unsigned integer indicates the total length of the 756 Path Attributes field in octets. Its value allows the length of 757 the Network Layer Reachability field to be determined as speci- 758 fied below. 760 A value of 0 indicates that no Network Layer Reachability 761 Information field is present in this UPDATE message. 763 Path Attributes: 765 A variable length sequence of path attributes is present in 766 every UPDATE message, except for an UPDATE message that carries 767 only the withdrawn routes. Each path attribute is a triple 768 of variable 769 length. 771 Attribute Type is a two-octet field that consists of the 772 Attribute Flags octet followed by the Attribute Type Code 773 octet. 775 0 1 776 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 777 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 778 | Attr. Flags |Attr. Type Code| 779 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 781 The high-order bit (bit 0) of the Attribute Flags octet is the 782 Optional bit. It defines whether the attribute is optional (if 783 set to 1) or well-known (if set to 0). 785 The second high-order bit (bit 1) of the Attribute Flags octet 786 is the Transitive bit. It defines whether an optional attribute 787 is transitive (if set to 1) or non-transitive (if set to 0). 788 For well-known attributes, the Transitive bit MUST be set to 1. 790 RFC DRAFT September 2003 792 (See Section 5 for a discussion of transitive attributes.) 794 The third high-order bit (bit 2) of the Attribute Flags octet 795 is the Partial bit. It defines whether the information con- 796 tained in the optional transitive attribute is partial (if set 797 to 1) or complete (if set to 0). For well-known attributes and 798 for optional non-transitive attributes the Partial bit MUST be 799 set to 0. 801 The fourth high-order bit (bit 3) of the Attribute Flags octet 802 is the Extended Length bit. It defines whether the Attribute 803 Length is one octet (if set to 0) or two octets (if set to 1). 805 The lower-order four bits of the Attribute Flags octet are 806 unused. They MUST be zero when sent and MUST be ignored when 807 received. 809 The Attribute Type Code octet contains the Attribute Type Code. 810 Currently defined Attribute Type Codes are discussed in Section 811 5. 813 If the Extended Length bit of the Attribute Flags octet is set 814 to 0, the third octet of the Path Attribute contains the length 815 of the attribute data in octets. 817 If the Extended Length bit of the Attribute Flags octet is set 818 to 1, then the third and the fourth octets of the path 819 attribute contain the length of the attribute data in octets. 821 The remaining octets of the Path Attribute represent the 822 attribute value and are interpreted according to the Attribute 823 Flags and the Attribute Type Code. The supported Attribute Type 824 Codes, their attribute values and uses are the following: 826 a) ORIGIN (Type Code 1): 828 ORIGIN is a well-known mandatory attribute that defines the 829 origin of the path information. The data octet can assume 830 the following values: 832 Value Meaning 834 0 IGP - Network Layer Reachability Information 835 is interior to the originating AS 837 1 EGP - Network Layer Reachability Information 838 learned via the EGP protocol [RFC904] 839 RFC DRAFT September 2003 841 2 INCOMPLETE - Network Layer Reachability 842 Information learned by some other means 844 Usage of this attribute is defined in 5.1.1. 846 b) AS_PATH (Type Code 2): 848 AS_PATH is a well-known mandatory attribute that is composed 849 of a sequence of AS path segments. Each AS path segment is 850 represented by a triple . 853 The path segment type is a 1-octet long field with the fol- 854 lowing values defined: 856 Value Segment Type 858 1 AS_SET: unordered set of ASs a route in the 859 UPDATE message has traversed 861 2 AS_SEQUENCE: ordered set of ASs a route in 862 the UPDATE message has traversed 864 The path segment length is a 1-octet long field containing 865 the number of ASs (not the number of octets) in the path 866 segment value field. 868 The path segment value field contains one or more AS num- 869 bers, each encoded as a 2-octets long field. 871 Usage of this attribute is defined in 5.1.2. 873 c) NEXT_HOP (Type Code 3): 875 This is a well-known mandatory attribute that defines the 876 (unicast) IP address of the router that SHOULD be used as 877 the next hop to the destinations listed in the Network Layer 878 Reachability Information field of the UPDATE message. 880 Usage of this attribute is defined in 5.1.3. 882 d) MULTI_EXIT_DISC (Type Code 4): 884 This is an optional non-transitive attribute that is a four 885 octet unsigned integer. The value of this attribute MAY be 886 used by a BGP speaker's Decision Process to discriminate 887 among multiple entry points to a neighboring autonomous 888 RFC DRAFT September 2003 890 system. 892 Usage of this attribute is defined in 5.1.4. 894 e) LOCAL_PREF (Type Code 5): 896 LOCAL_PREF is a well-known attribute that is a four octet 897 unsigned integer. A BGP speaker uses it to inform its other 898 internal peers of the advertising speaker's degree of pref- 899 erence for an advertised route. 901 Usage of this attribute is defined in 5.1.5. 903 f) ATOMIC_AGGREGATE (Type Code 6) 905 ATOMIC_AGGREGATE is a well-known discretionary attribute of 906 length 0. 908 Usage of this attribute is defined in 5.1.6. 910 g) AGGREGATOR (Type Code 7) 912 AGGREGATOR is an optional transitive attribute of length 6. 913 The attribute contains the last AS number that formed the 914 aggregate route (encoded as 2 octets), followed by the IP 915 address of the BGP speaker that formed the aggregate route 916 (encoded as 4 octets). This SHOULD be the same address as 917 the one used for the BGP Identifier of the speaker. 919 Usage of this attribute is defined in 5.1.7. 921 Network Layer Reachability Information: 923 This variable length field contains a list of IP address pre- 924 fixes. The length in octets of the Network Layer Reachability 925 Information is not encoded explicitly, but can be calculated 926 as: 928 UPDATE message Length - 23 - Total Path Attributes Length - 929 Withdrawn Routes Length 931 where UPDATE message Length is the value encoded in the fixed- 932 size BGP header, Total Path Attribute Length and Withdrawn 933 Routes Length are the values encoded in the variable part of 934 the UPDATE message, and 23 is a combined length of the fixed- 935 size BGP header, the Total Path Attribute Length field and the 936 Withdrawn Routes Length field. 938 RFC DRAFT September 2003 940 Reachability information is encoded as one or more 2-tuples of 941 the form , whose fields are described below: 943 +---------------------------+ 944 | Length (1 octet) | 945 +---------------------------+ 946 | Prefix (variable) | 947 +---------------------------+ 949 The use and the meaning of these fields are as follows: 951 a) Length: 953 The Length field indicates the length in bits of the IP 954 address prefix. A length of zero indicates a prefix that 955 matches all IP addresses (with prefix, itself, of zero 956 octets). 958 b) Prefix: 960 The Prefix field contains an IP address prefix followed by 961 enough trailing bits to make the end of the field fall on an 962 octet boundary. Note that the value of the trailing bits is 963 irrelevant. 965 The minimum length of the UPDATE message is 23 octets -- 19 octets 966 for the fixed header + 2 octets for the Withdrawn Routes Length + 2 967 octets for the Total Path Attribute Length (the value of Withdrawn 968 Routes Length is 0 and the value of Total Path Attribute Length is 969 0). 971 An UPDATE message can advertise at most one set of path attributes, 972 but multiple destinations, provided that the destinations share these 973 attributes. All path attributes contained in a given UPDATE message 974 apply to all destinations carried in the NLRI field of the UPDATE 975 message. 977 An UPDATE message can list multiple routes to be withdrawn from ser- 978 vice. Each such route is identified by its destination (expressed as 979 an IP prefix), which unambiguously identifies the route in the con- 980 text of the BGP speaker - BGP speaker connection to which it has been 981 previously advertised. 983 An UPDATE message might advertise only routes to be withdrawn from 984 service, in which case it will not include path attributes or Network 985 Layer Reachability Information. Conversely, it may advertise only a 986 feasible route, in which case the WITHDRAWN ROUTES field need not be 987 present. 989 RFC DRAFT September 2003 991 An UPDATE message SHOULD NOT include the same address prefix in the 992 WITHDRAWN ROUTES and Network Layer Reachability Information fields, 993 however a BGP speaker MUST be able to process UPDATE messages in this 994 form. A BGP speaker SHOULD treat an UPDATE message of this form as if 995 the WITHDRAWN ROUTES doesn't contain the address prefix. 997 4.4 KEEPALIVE Message Format 999 BGP does not use any TCP-based keep-alive mechanism to determine if 1000 peers are reachable. Instead, KEEPALIVE messages are exchanged 1001 between peers often enough as not to cause the Hold Timer to expire. 1002 A reasonable maximum time between KEEPALIVE messages would be one 1003 third of the Hold Time interval. KEEPALIVE messages MUST NOT be sent 1004 more frequently than one per second. An implementation MAY adjust the 1005 rate at which it sends KEEPALIVE messages as a function of the Hold 1006 Time interval. 1008 If the negotiated Hold Time interval is zero, then periodic KEEPALIVE 1009 messages MUST NOT be sent. 1011 A KEEPALIVE message consists of only message header and has a length 1012 of 19 octets. 1014 4.5 NOTIFICATION Message Format 1016 A NOTIFICATION message is sent when an error condition is detected. 1017 The BGP connection is closed immediately after sending it. 1019 In addition to the fixed-size BGP header, the NOTIFICATION message 1020 contains the following fields: 1022 0 1 2 3 1023 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 1024 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1025 | Error code | Error subcode | Data (variable) | 1026 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1028 Error Code: 1030 This 1-octet unsigned integer indicates the type of NOTIFICA- 1031 TION. The following Error Codes have been defined: 1033 Error Code Symbolic Name Reference 1034 RFC DRAFT September 2003 1036 1 Message Header Error Section 6.1 1038 2 OPEN Message Error Section 6.2 1040 3 UPDATE Message Error Section 6.3 1042 4 Hold Timer Expired Section 6.5 1044 5 Finite State Machine Error Section 6.6 1046 6 Cease Section 6.7 1048 Error subcode: 1050 This 1-octet unsigned integer provides more specific informa- 1051 tion about the nature of the reported error. Each Error Code 1052 may have one or more Error Subcodes associated with it. If no 1053 appropriate Error Subcode is defined, then a zero (Unspecific) 1054 value is used for the Error Subcode field. 1056 Message Header Error subcodes: 1058 1 - Connection Not Synchronized. 1059 2 - Bad Message Length. 1060 3 - Bad Message Type. 1062 OPEN Message Error subcodes: 1064 1 - Unsupported Version Number. 1065 2 - Bad Peer AS. 1066 3 - Bad BGP Identifier. 1067 4 - Unsupported Optional Parameter. 1068 5 - [Deprecated - see Appendix A]. 1069 6 - Unacceptable Hold Time. 1071 UPDATE Message Error subcodes: 1073 1 - Malformed Attribute List. 1074 2 - Unrecognized Well-known Attribute. 1075 3 - Missing Well-known Attribute. 1076 4 - Attribute Flags Error. 1077 5 - Attribute Length Error. 1078 6 - Invalid ORIGIN Attribute. 1079 7 - [Deprecated - see Appendix A]. 1080 8 - Invalid NEXT_HOP Attribute. 1081 9 - Optional Attribute Error. 1082 10 - Invalid Network Field. 1084 RFC DRAFT September 2003 1086 11 - Malformed AS_PATH. 1088 Data: 1090 This variable-length field is used to diagnose the reason for 1091 the NOTIFICATION. The contents of the Data field depend upon 1092 the Error Code and Error Subcode. See Section 6 below for more 1093 details. 1095 Note that the length of the Data field can be determined from 1096 the message Length field by the formula: 1098 Message Length = 21 + Data Length 1100 The minimum length of the NOTIFICATION message is 21 octets (includ- 1101 ing message header). 1103 5. Path Attributes 1105 This section discusses the path attributes of the UPDATE message. 1107 Path attributes fall into four separate categories: 1109 1. Well-known mandatory. 1110 2. Well-known discretionary. 1111 3. Optional transitive. 1112 4. Optional non-transitive. 1114 BGP implementations MUST recognize all well-known attrbutes. Some of 1115 these attributes are mandatory and MUST be included in every UPDATE 1116 message that contains NLRI. Others are discretionary and MAY or MAY 1117 NOT be sent in a particular UPDATE message. 1119 Once a BGP peer has updated any well-known attributes, it MUST pass 1120 these attributes in any updates it transmits to its peers. 1122 In addition to well-known attributes, each path MAY contain one or 1123 more optional attributes. It is not required or expected that all BGP 1124 implementations support all optional attributes. The handling of an 1125 unrecognized optional attribute is determined by the setting of the 1126 Transitive bit in the attribute flags octet. Paths with unrecognized 1127 transitive optional attributes SHOULD be accepted. If a path with 1128 unrecognized transitive optional attribute is accepted and passed 1129 along to other BGP peers, then the unrecognized transitive optional 1130 attribute of that path MUST be passed along with the path to other 1131 RFC DRAFT September 2003 1133 BGP peers with the Partial bit in the Attribute Flags octet set to 1. 1134 If a path with recognized transitive optional attribute is accepted 1135 and passed along to other BGP peers and the Partial bit in the 1136 Attribute Flags octet is set to 1 by some previous AS, it MUST NOT be 1137 set back to 0 by the current AS. Unrecognized non-transitive optional 1138 attributes MUST be quietly ignored and not passed along to other BGP 1139 peers. 1141 New transitive optional attributes MAY be attached to the path by the 1142 originator or by any other BGP speaker in the path. If they are not 1143 attached by the originator, the Partial bit in the Attribute Flags 1144 octet is set to 1. The rules for attaching new non-transitive 1145 optional attributes will depend on the nature of the specific 1146 attribute. The documentation of each new non-transitive optional 1147 attribute will be expected to include such rules. (The description of 1148 the MULTI_EXIT_DISC attribute gives an example.) All optional 1149 attributes (both transitive and non-transitive) MAY be updated (if 1150 appropriate) by BGP speakers in the path. 1152 The sender of an UPDATE message SHOULD order path attributes within 1153 the UPDATE message in ascending order of attribute type. The receiver 1154 of an UPDATE message MUST be prepared to handle path attributes 1155 within the UPDATE message that are out of order. 1157 The same attribute (attribute with the same type) can not appear more 1158 than once within the Path Attributes field of a particular UPDATE 1159 message. 1161 The mandatory category refers to an attribute which MUST be present 1162 in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE 1163 message. Attributes classified as optional for the purpose of the 1164 protocol extension mechanism may be purely discretionary, or discre- 1165 tionary, required, or disallowed in certain contexts. 1167 attribute EBGP IBGP 1168 ORIGIN mandatory mandatory 1169 AS_PATH mandatory mandatory 1170 NEXT_HOP mandatory mandatory 1171 MULTI_EXIT_DISC discretionary discretionary 1172 LOCAL_PREF see Section 5.1.5 required 1173 ATOMIC_AGGREGATE see Section 5.1.6 and 9.1.4 1174 AGGREGATOR discretionary discretionary 1175 RFC DRAFT September 2003 1177 5.1 Path Attribute Usage 1179 The usage of each BGP path attribute is described in the following 1180 clauses. 1182 5.1.1 ORIGIN 1184 ORIGIN is a well-known mandatory attribute. The ORIGIN attribute is 1185 generated by the speaker that originates the associated routing 1186 information. Its value SHOULD NOT be changed by any other speaker. 1188 5.1.2 AS_PATH 1190 AS_PATH is a well-known mandatory attribute. This attribute identi- 1191 fies the autonomous systems through which routing information carried 1192 in this UPDATE message has passed. The components of this list can be 1193 AS_SETs or AS_SEQUENCEs. 1195 When a BGP speaker propagates a route which it has learned from 1196 another BGP speaker's UPDATE message, it modifies the route's AS_PATH 1197 attribute based on the location of the BGP speaker to which the route 1198 will be sent: 1200 a) When a given BGP speaker advertises the route to an internal 1201 peer, the advertising speaker SHALL NOT modify the AS_PATH 1202 attribute associated with the route. 1204 b) When a given BGP speaker advertises the route to an external 1205 peer, then the advertising speaker updates the AS_PATH attribute 1206 as follows: 1208 1) if the first path segment of the AS_PATH is of type 1209 AS_SEQUENCE, the local system prepends its own AS number as the 1210 last element of the sequence (put it in the leftmost position 1211 with respect to the position of octets in the protocol mes- 1212 sage). If the act of prepending will cause an overflow in the 1213 AS_PATH segment, i.e. more than 255 ASs, it SHOULD prepend a 1214 new segment of type AS_SEQUENCE and prepend its own AS number 1215 to this new segment. 1217 2) if the first path segment of the AS_PATH is of type AS_SET, 1218 the local system prepends a new path segment of type 1219 RFC DRAFT September 2003 1221 AS_SEQUENCE to the AS_PATH, including its own AS number in that 1222 segment. 1224 When a BGP speaker originates a route then: 1226 a) the originating speaker includes its own AS number in a path 1227 segment of type AS_SEQUENCE in the AS_PATH attribute of all UPDATE 1228 messages sent to an external peer. (In this case, the AS number of 1229 the originating speaker's autonomous system will be the only entry 1230 the path segment, and this path segment will be the only segment 1231 in the AS_PATH attribute). 1233 b) the originating speaker includes an empty AS_PATH attribute in 1234 all UPDATE messages sent to internal peers. (An empty AS_PATH 1235 attribute is one whose length field contains the value zero). 1237 Whenever the modification of the AS_PATH attribute calls for includ- 1238 ing or prepending the AS number of the local system, the local system 1239 MAY include/prepend more than one instance of its own AS number in 1240 the AS_PATH attribute. This is controlled via local configuration. 1242 5.1.3 NEXT_HOP 1244 The NEXT_HOP is a well-known mandatory attribute that defines the IP 1245 address of the router that SHOULD be used as the next hop to the des- 1246 tinations listed in the UPDATE message. The NEXT_HOP attribute is 1247 calculated as follows. 1249 1) When sending a message to an internal peer, if the route is not 1250 locally originated the BGP speaker SHOULD NOT modify the NEXT_HOP 1251 attribute, unless it has been explicitly configured to announce 1252 its own IP address as the NEXT_HOP. When announcing a locally 1253 originated route to an internal peer, the BGP speaker SHOULD use 1254 as the NEXT_HOP the interface address of the router through which 1255 the announced network is reachable for the speaker; if the route 1256 is directly connected to the speaker, or the interface address of 1257 the router through which the announced network is reachable for 1258 the speaker is the internal peer's address, then the BGP speaker 1259 SHOULD use for the NEXT_HOP attribute its own IP address (the 1260 address of the interface that is used to reach the peer). 1262 2) When sending a message to an external peer X, and the peer is 1263 one IP hop away from the speaker: 1265 - If the route being announced was learned from an internal 1266 peer or is locally originated, the BGP speaker can use for the 1267 RFC DRAFT September 2003 1269 NEXT_HOP attribute an interface address of the internal peer 1270 router (or the internal router) through which the announced 1271 network is reachable for the speaker, provided that peer X 1272 shares a common subnet with this address. This is a form of 1273 "third party" NEXT_HOP attribute. 1275 - Otherwise, if the route being announced was learned from an 1276 external peer, the speaker can use in the NEXT_HOP attribute an 1277 IP address of any adjacent router (known from the received 1278 NEXT_HOP attribute) that the speaker itself uses for local 1279 route calculation, provided that peer X shares a common subnet 1280 with this address. This is a second form of "third party" 1281 NEXT_HOP attribute. 1283 - Otherwise, if the external peer to which the route is being 1284 advertised shares a common subnet with one of the interfaces of 1285 the announcing BGP speaker, the speaker MAY use the IP address 1286 associated with such an interface in the NEXT_HOP attribute. 1287 This is known as a "first party" NEXT_HOP attribute. 1289 - By default (if none of the above conditions apply), the BGP 1290 speaker SHOULD use in the NEXT_HOP attribute the IP address of 1291 the interface that the speaker uses to establish the BGP con- 1292 nection to peer X. 1294 3) When sending a message to an external peer X, and the peer is 1295 multiple IP hops away from the speaker (aka "multihop EBGP"): 1297 - The speaker MAY be configured to propagate the NEXT_HOP 1298 attribute. In this case when advertising a route that the 1299 speaker learned from one of its peers, the NEXT_HOP attribute 1300 of the advertised route is exactly the same as the NEXT_HOP 1301 attribute of the learned route (the speaker just doesn't modify 1302 the NEXT_HOP attribute). 1304 - By default, the BGP speaker SHOULD use in the NEXT_HOP 1305 attribute the IP address of the interface that the speaker uses 1306 to establish the BGP connection to peer X. 1308 Normally the NEXT_HOP attribute is chosen such that the shortest 1309 available path will be taken. A BGP speaker MUST be able to support 1310 disabling advertisement of third party NEXT_HOP attributes to handle 1311 imperfectly bridged media. 1313 A route originated by a BGP speaker SHALL NOT be advertised to a peer 1314 using an address of that peer as NEXT_HOP. A BGP speaker SHALL NOT 1315 install a route with itself as the next hop. 1317 RFC DRAFT September 2003 1319 The NEXT_HOP attribute is used by the BGP speaker to determine the 1320 actual outbound interface and immediate next-hop address that SHOULD 1321 be used to forward transit packets to the associated destinations. 1323 The immediate next-hop address is determined by performing a recur- 1324 sive route lookup operation for the IP address in the NEXT_HOP 1325 attribute using the contents of the Routing Table, selecting one 1326 entry if multiple entries of equal cost exist. The Routing Table 1327 entry which resolves the IP address in the NEXT_HOP attribute will 1328 always specify the outbound interface. If the entry specifies an 1329 attached subnet, but does not specify a next-hop address, then the 1330 address in the NEXT_HOP attribute SHOULD be used as the immediate 1331 next-hop address. If the entry also specifies the next-hop address, 1332 this address SHOULD be used as the immediate next-hop address for 1333 packet forwarding. 1335 5.1.4 MULTI_EXIT_DISC 1337 The MULTI_EXIT_DISC is an optional non-transitive attribute which is 1338 intended to be used on external (inter-AS) links to discriminate 1339 among multiple exit or entry points to the same neighboring AS. The 1340 value of the MULTI_EXIT_DISC attribute is a four octet unsigned num- 1341 ber which is called a metric. All other factors being equal, the exit 1342 point with lower metric SHOULD be preferred. If received over EBGP, 1343 the MULTI_EXIT_DISC attribute MAY be propagated over IBGP to other 1344 BGP speakers within the same AS (see also 9.1.2.2). The 1345 MULTI_EXIT_DISC attribute received from a neighboring AS MUST NOT be 1346 propagated to other neighboring ASs. 1348 A BGP speaker MUST implement a mechanism based on local configuration 1349 which allows the MULTI_EXIT_DISC attribute to be removed from a 1350 route. If a BGP speaker is configured to remove the MULTI_EXIT_DISC 1351 attribute from a route, then this removal MUST be done prior to 1352 determining the degree of preference of the route and performing 1353 route selection (Decision Process phases 1 and 2). 1355 An implementation MAY also (based on local configuration) alter the 1356 value of the MULTI_EXIT_DISC attribute received over EBGP. If a BGP 1357 speaker is configured to alter the value of the MULTI_EXIT_DISC 1358 attribute received over EBGP, then altering the value MUST be done 1359 prior to determining the degree of preference of the route and per- 1360 forming route selection (Decision Process phases 1 and 2). See Sec- 1361 tion 9.1.2.2 for necessary restrictions on this. 1363 RFC DRAFT September 2003 1365 5.1.5 LOCAL_PREF 1367 LOCAL_PREF is a well-known attribute that SHALL be included in all 1368 UPDATE messages that a given BGP speaker sends to the other internal 1369 peers. A BGP speaker SHALL calculate the degree of preference for 1370 each external route based on the locally configured policy, and 1371 include the degree of preference when advertising a route to its 1372 internal peers. The higher degree of preference MUST be preferred. A 1373 BGP speaker uses the degree of preference learned via LOCAL_PREF in 1374 its Decision Process (see Section 9.1.1). 1376 A BGP speaker MUST NOT include this attribute in UPDATE messages that 1377 it sends to external peers, except for the case of BGP Confederations 1378 [RFC3065]. If it is contained in an UPDATE message that is received 1379 from an external peer, then this attribute MUST be ignored by the 1380 receiving speaker, except for the case of BGP Confederations 1381 [RF3065]. 1383 5.1.6 ATOMIC_AGGREGATE 1385 ATOMIC_AGGREGATE is a well-known discretionary attribute. 1387 When a BGP speaker aggregates several routes for the purpose of 1388 advertisement to a particular peer, the AS_PATH of the aggregated 1389 route normally includes an AS_SET formed from the set of ASs from 1390 which the aggregate was formed. In many cases the network adminis- 1391 trator can determine that the aggregate can safely be advertised 1392 without the AS_SET and not form route loops. 1394 If an aggregate excludes at least some of the AS numbers present in 1395 the AS_PATH of the routes that are aggregated as a result of dropping 1396 the AS_SET, the aggregated route, when advertised to the peer, SHOULD 1397 include the ATOMIC_AGGREGATE attribute. 1399 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1400 attribute SHOULD NOT remove the attribute from the route when propa- 1401 gating it to other speakers. 1403 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1404 attribute MUST NOT make any NLRI of that route more specific (as 1405 defined in 9.1.4) when advertising this route to other BGP speakers. 1407 A BGP speaker that receives a route with the ATOMIC_AGGREGATE 1408 attribute needs to be aware of the fact that the actual path to des- 1409 tinations, as specified in the NLRI of the route, while having the 1410 RFC DRAFT September 2003 1412 loop-free property, may not be the path specified in the AS_PATH 1413 attribute of the route. 1415 5.1.7 AGGREGATOR 1417 AGGREGATOR is an optional transitive attribute which MAY be included 1418 in updates which are formed by aggregation (see Section 9.2.2.2). A 1419 BGP speaker which performs route aggregation MAY add the AGGREGATOR 1420 attribute which SHALL contain its own AS number and IP address. The 1421 IP address SHOULD be the same as the BGP Identifier of the speaker. 1423 6. BGP Error Handling. 1425 This section describes actions to be taken when errors are detected 1426 while processing BGP messages. 1428 When any of the conditions described here are detected, a NOTIFICA- 1429 TION message with the indicated Error Code, Error Subcode, and Data 1430 fields is sent, and the BGP connection is closed, unless it is 1431 explicitly stated that no NOTIFICATION message is to be sent and the 1432 BGP connection is not to be closed. If no Error Subcode is specified, 1433 then a zero MUST be used. 1435 The phrase "the BGP connection is closed" means that the TCP connec- 1436 tion has been closed, the associated Adj-RIB-In has been cleared, and 1437 that all resources for that BGP connection have been deallocated. 1438 Entries in the Loc-RIB associated with the remote peer are marked as 1439 invalid. The local system recalculates its best routes for the des- 1440 tinations of the routes marked as invalid, and before the invalid 1441 routes are deleted from the system advertises to its peers either 1442 withdraws for the routes marked as invalid, or the new best routes 1443 before the invalid routes are deleted from the system. 1445 Unless specified explicitly, the Data field of the NOTIFICATION mes- 1446 sage that is sent to indicate an error is empty. 1448 6.1 Message Header error handling. 1450 All errors detected while processing the Message Header MUST be indi- 1451 cated by sending the NOTIFICATION message with Error Code Message 1452 Header Error. The Error Subcode elaborates on the specific nature of 1453 the error. 1455 RFC DRAFT September 2003 1457 The expected value of the Marker field of the message header is all 1458 ones. If the Marker field of the message header is not as expected, 1459 then a synchronization error has occurred and the Error Subcode MUST 1460 be set to Connection Not Synchronized. 1462 If at least one of the following is true: 1464 - if the Length field of the message header is less than 19 or 1465 greater than 4096, or 1467 - if the Length field of an OPEN message is less than the minimum 1468 length of the OPEN message, or 1470 - if the Length field of an UPDATE message is less than the mini- 1471 mum length of the UPDATE message, or 1473 - if the Length field of a KEEPALIVE message is not equal to 19, 1474 or 1476 - if the Length field of a NOTIFICATION message is less than the 1477 minimum length of the NOTIFICATION message, 1479 then the Error Subcode MUST be set to Bad Message Length. The Data 1480 field MUST contain the erroneous Length field. 1482 If the Type field of the message header is not recognized, then the 1483 Error Subcode MUST be set to Bad Message Type. The Data field MUST 1484 contain the erroneous Type field. 1486 6.2 OPEN message error handling. 1488 All errors detected while processing the OPEN message MUST be indi- 1489 cated by sending the NOTIFICATION message with Error Code OPEN Mes- 1490 sage Error. The Error Subcode elaborates on the specific nature of 1491 the error. 1493 If the version number contained in the Version field of the received 1494 OPEN message is not supported, then the Error Subcode MUST be set to 1495 Unsupported Version Number. The Data field is a 2-octets unsigned 1496 integer, which indicates the largest locally supported version number 1497 less than the version the remote BGP peer bid (as indicated in the 1498 received OPEN message), or if the smallest locally supported version 1499 number is greater than the version the remote BGP peer bid, then the 1500 smallest locally supported version number. 1502 If the Autonomous System field of the OPEN message is unacceptable, 1503 RFC DRAFT September 2003 1505 then the Error Subcode MUST be set to Bad Peer AS. The determination 1506 of acceptable Autonomous System numbers is outside the scope of this 1507 protocol. 1509 If the Hold Time field of the OPEN message is unacceptable, then the 1510 Error Subcode MUST be set to Unacceptable Hold Time. An implementa- 1511 tion MUST reject Hold Time values of one or two seconds. An imple- 1512 mentation MAY reject any proposed Hold Time. An implementation which 1513 accepts a Hold Time MUST use the negotiated value for the Hold Time. 1515 If the BGP Identifier field of the OPEN message is syntactically 1516 incorrect, then the Error Subcode MUST be set to Bad BGP Identifier. 1517 Syntactic correctness means that the BGP Identifier field represents 1518 a valid unicast IP host address. 1520 If one of the Optional Parameters in the OPEN message is not recog- 1521 nized, then the Error Subcode MUST be set to Unsupported Optional 1522 Parameters. 1524 If one of the Optional Parameters in the OPEN message is recognized, 1525 but is malformed, then the Error Subcode MUST be set to 0 (Unspe- 1526 cific). 1528 6.3 UPDATE message error handling. 1530 All errors detected while processing the UPDATE message MUST be indi- 1531 cated by sending the NOTIFICATION message with Error Code UPDATE Mes- 1532 sage Error. The error subcode elaborates on the specific nature of 1533 the error. 1535 Error checking of an UPDATE message begins by examining the path 1536 attributes. If the Withdrawn Routes Length or Total Attribute Length 1537 is too large (i.e., if Withdrawn Routes Length + Total Attribute 1538 Length + 23 exceeds the message Length), then the Error Subcode MUST 1539 be set to Malformed Attribute List. 1541 If any recognized attribute has Attribute Flags that conflict with 1542 the Attribute Type Code, then the Error Subcode MUST be set to 1543 Attribute Flags Error. The Data field MUST contain the erroneous 1544 attribute (type, length and value). 1546 If any recognized attribute has Attribute Length that conflicts with 1547 the expected length (based on the attribute type code), then the 1548 Error Subcode MUST be set to Attribute Length Error. The Data field 1549 MUST contain the erroneous attribute (type, length and value). 1551 RFC DRAFT September 2003 1553 If any of the mandatory well-known attributes are not present, then 1554 the Error Subcode MUST be set to Missing Well-known Attribute. The 1555 Data field MUST contain the Attribute Type Code of the missing well- 1556 known attribute. 1558 If any of the mandatory well-known attributes are not recognized, 1559 then the Error Subcode MUST be set to Unrecognized Well-known 1560 Attribute. The Data field MUST contain the unrecognized attribute 1561 (type, length and value). 1563 If the ORIGIN attribute has an undefined value, then the Error Sub- 1564 code MUST be set to Invalid Origin Attribute. The Data field MUST 1565 contain the unrecognized attribute (type, length and value). 1567 If the NEXT_HOP attribute field is syntactically incorrect, then the 1568 Error Subcode MUST be set to Invalid NEXT_HOP Attribute. The Data 1569 field MUST contain the incorrect attribute (type, length and value). 1570 Syntactic correctness means that the NEXT_HOP attribute represents a 1571 valid IP host address. 1573 The IP address in the NEXT_HOP MUST meet the following criteria to be 1574 considered semantically correct: 1576 a) It MUST NOT be the IP address of the receiving speaker 1578 b) In the case of an EBGP where the sender and receiver are one IP 1579 hop away from each other, either the IP address in the NEXT_HOP 1580 MUST be the sender's IP address (that is used to establish the BGP 1581 connection), or the interface associated with the NEXT_HOP IP 1582 address MUST share a common subnet with the receiving BGP speaker. 1584 If the NEXT_HOP attribute is semantically incorrect, the error SHOULD 1585 be logged, and the route SHOULD be ignored. In this case, a NOTIFICA- 1586 TION message SHOULD NOT be sent, and connection SHOULD NOT be closed. 1588 The AS_PATH attribute is checked for syntactic correctness. If the 1589 path is syntactically incorrect, then the Error Subcode MUST be set 1590 to Malformed AS_PATH. 1592 If the UPDATE message is received from an external peer, the local 1593 system MAY check whether the leftmost (with respect to the position 1594 of octets in the protocol message) AS in the AS_PATH attribute is 1595 equal to the autonomous system number of the peer that sent the mes- 1596 sage. If the check determines that this is not the case, the Error 1597 Subcode MUST be set to Malformed AS_PATH. 1599 If an optional attribute is recognized, then the value of this 1600 attribute MUST be checked. If an error is detected, the attribute 1601 RFC DRAFT September 2003 1603 MUST be discarded, and the Error Subcode MUST be set to Optional 1604 Attribute Error. The Data field MUST contain the attribute (type, 1605 length and value). 1607 If any attribute appears more than once in the UPDATE message, then 1608 the Error Subcode MUST be set to Malformed Attribute List. 1610 The NLRI field in the UPDATE message is checked for syntactic valid- 1611 ity. If the field is syntactically incorrect, then the Error Subcode 1612 MUST be set to Invalid Network Field. 1614 If a prefix in the NLRI field is semantically incorrect (e.g., an 1615 unexpected multicast IP address), an error SHOULD be logged locally, 1616 and the prefix SHOULD be ignored. 1618 An UPDATE message that contains correct path attributes, but no NLRI, 1619 SHALL be treated as a valid UPDATE message. 1621 6.4 NOTIFICATION message error handling. 1623 If a peer sends a NOTIFICATION message, and the receiver of the mes- 1624 sage detects an error in that message, the receiver can not use a 1625 NOTIFICATION message to report this error back to the peer. Any such 1626 error, such as an unrecognized Error Code or Error Subcode, SHOULD be 1627 noticed, logged locally, and brought to the attention of the adminis- 1628 tration of the peer. The means to do this, however, lies outside the 1629 scope of this document. 1631 6.5 Hold Timer Expired error handling. 1633 If a system does not receive successive KEEPALIVE and/or UPDATE 1634 and/or NOTIFICATION messages within the period specified in the Hold 1635 Time field of the OPEN message, then the NOTIFICATION message with 1636 Hold Timer Expired Error Code is sent and the BGP connection is 1637 closed. 1639 6.6 Finite State Machine error handling. 1641 Any error detected by the BGP Finite State Machine (e.g., receipt of 1642 an unexpected event) is indicated by sending the NOTIFICATION message 1643 with Error Code Finite State Machine Error. 1645 RFC DRAFT September 2003 1647 6.7 Cease. 1649 In absence of any fatal errors (that are indicated in this section), 1650 a BGP peer MAY choose at any given time to close its BGP connection 1651 by sending the NOTIFICATION message with Error Code Cease. However, 1652 the Cease NOTIFICATION message MUST NOT be used when a fatal error 1653 indicated by this section does exist. 1655 A BGP speaker MAY support the ability to impose an (locally config- 1656 ured) upper bound on the number of address prefixes the speaker is 1657 willing to accept from a neighbor. When the upper bound is reached, 1658 the speaker (under control of local configuration) either (a) dis- 1659 cards new address prefixes from the neighbor (while maintaining BGP 1660 connection with the neighbor), or (b) terminates the BGP connection 1661 with the neighbor. If the BGP speaker decides to terminate its BGP 1662 connection with a neighbor because the number of address prefixes 1663 received from the neighbor exceeds the locally configured upper 1664 bound, then the speaker MUST send to the neighbor a NOTIFICATION mes- 1665 sage with the Error Code Cease. The speaker MAY also log this 1666 locally. 1668 6.8 BGP connection collision detection. 1670 If a pair of BGP speakers try simultaneously to establish a BGP con- 1671 nection to each other, then two parallel connections between this 1672 pair of speakers might well be formed. If the source IP address used 1673 by one of these connections is the same as the destination IP address 1674 used by the other, and the destination IP address used by the first 1675 connection is the same as the source IP address used by the other, we 1676 refer to this situation as connection collision. Clearly in the 1677 presence of connection collision, one of these connections MUST be 1678 closed. 1680 Based on the value of the BGP Identifier a convention is established 1681 for detecting which BGP connection is to be preserved when a colli- 1682 sion does occur. The convention is to compare the BGP Identifiers of 1683 the peers involved in the collision and to retain only the connection 1684 initiated by the BGP speaker with the higher-valued BGP Identifier. 1686 Upon receipt of an OPEN message, the local system MUST examine all of 1687 its connections that are in the OpenConfirm state. A BGP speaker MAY 1688 also examine connections in an OpenSent state if it knows the BGP 1689 Identifier of the peer by means outside of the protocol. If among 1690 these connections there is a connection to a remote BGP speaker whose 1691 BGP Identifier equals the one in the OPEN message, and this 1692 RFC DRAFT September 2003 1694 connection collides with the connection over which the OPEN message 1695 is received then the local system performs the following collision 1696 resolution procedure: 1698 1. The BGP Identifier of the local system is compared to the BGP 1699 Identifier of the remote system (as specified in the OPEN mes- 1700 sage). Comparing BGP Identifiers is done by converting them to 1701 host byte order and treating them as (4-octet long) unsigned inte- 1702 gers. 1704 2. If the value of the local BGP Identifier is less than the 1705 remote one, the local system closes the BGP connection that 1706 already exists (the one that is already in the OpenConfirm state), 1707 and accepts the BGP connection initiated by the remote system. 1709 3. Otherwise, the local system closes newly created BGP connection 1710 (the one associated with the newly received OPEN message), and 1711 continues to use the existing one (the one that is already in the 1712 OpenConfirm state). 1714 Unless allowed via configuration, a connection collision with an 1715 existing BGP connection that is in Established state causes closing 1716 of the newly created connection. 1718 Note that a connection collision can not be detected with connections 1719 that are in Idle, or Connect, or Active states. 1721 Closing the BGP connection (that results from the collision resolu- 1722 tion procedure) is accomplished by sending the NOTIFICATION message 1723 with the Error Code Cease. 1725 7. BGP Version Negotiation 1727 BGP speakers MAY negotiate the version of the protocol by making mul- 1728 tiple attempts to open a BGP connection, starting with the highest 1729 version number each supports. If an open attempt fails with an Error 1730 Code OPEN Message Error, and an Error Subcode Unsupported Version 1731 Number, then the BGP speaker has available the version number it 1732 tried, the version number its peer tried, the version number passed 1733 by its peer in the NOTIFICATION message, and the version numbers that 1734 it supports. If the two peers do support one or more common versions, 1735 then this will allow them to rapidly determine the highest common 1736 version. In order to support BGP version negotiation, future versions 1737 of BGP MUST retain the format of the OPEN and NOTIFICATION messages. 1739 RFC DRAFT September 2003 1741 8. BGP Finite State machine (FSM) 1743 The data structures and FSM described in this document are 1744 conceptual and do not have to be implemented precisely as described 1745 here, as long as the implementations support the described 1746 functionality and their externally visible behavior is the same. 1748 This section specifies the BGP operation in terms of a Finite State 1749 Machine (FSM). The section falls into 2 parts: 1751 1) Description of Events for the State machine (Section 8.1) 1752 2) Description of the FSM (Section 8.2) 1754 Session attributes required (mandatory) for each connection are: 1756 1) State 1757 2) ConnectRetryCounter 1758 3) ConnectRetryTimer 1759 4) ConnectRetryTime 1760 5) HoldTimer 1761 6) HoldTime 1762 7) KeepaliveTimer 1763 8) KeepaliveTime 1765 The state session attribute indicates what state the BGP FSM 1766 is in. The ConnectRetryCounter indicates the number of times 1767 a BGP peer has tried to establish a peer session. 1769 The mandatory attributes related to timers are described in 1770 section 10. Each timer has a "timer" and a "time" (the initial 1771 value). 1773 The optional Session attributes are listed below. These optional 1774 attributes may be supported either per connection or per local sys- 1775 tem: 1777 1) AcceptConnectionsUnconfiguredPeers 1778 2) AllowAutomaticStart 1779 3) AllowAutomaticStop 1780 4) CollisionDetectEstablishedState 1781 5) DampPeerOscillations 1782 6) DelayOpen 1783 7) DelayOpenTime 1784 8) DelayOpenTimer 1785 9) IdleHoldTime 1786 10) IdleHoldTimer 1787 11) PassiveTcpEstablishment 1788 RFC DRAFT September 2003 1790 12) SendNOTIFICATIONwithoutOPEN 1791 13) TrackTcpState 1793 The optional session attributes support different features of the BGP 1794 functionality that have implications for the BGP FSM state 1795 transitions. Two groups of the attributes relate to timers are: 1796 group 1: DelayOpen, DelayOpenTime, DelayOpenTimer 1797 group 2: DampPeerOscillations, IdleHoldTime, IdleHoldTimer 1799 The first parameter (DelayOpen, DampPeerOscillations) is an 1800 optional attribute that indicates that the Timer function is 1801 active. The "Time" value specifies the initial value for "Timer" 1802 (DelayOpenTime, IdleHoldTime). The "Timer" specifies the actual timer. 1804 Please refer to section 8.1.1 for an explanation 1805 of the interaction between these optional attributes and the events 1806 signaled to the state machine. Section 8.2.1.4 also provides 1807 a short overview of the different types of optional attributes 1808 (flags or timers). 1810 8.1 Events for the BGP FSM 1812 8.1.1 Optional Events linked to Optional Session attributes 1814 The Inputs to the BGP FSM are events. Events can either be 1815 mandatory or optional. Some optional events are linked to 1816 optional session attributes. Optional session attributes enable 1817 several groups of FSM functionality. 1819 The description below describes the linkage between FSM 1820 functionality, events and the optional session attributes. 1822 Group 1: Automatic Administrative Events (Start/Stop) 1824 Optional Session Attributes: AllowAutomaticStart, AllowAutomaticStop, 1825 DampPeerOscillations, IdleHoldTime, 1826 IdleHoldTimer 1828 Option 1: AllowAutomaticStart 1829 RFC DRAFT September 2003 1831 Description: A BGP peer connection can be started and stopped 1832 by administrative control. This administrative 1833 control can either be manual, based on 1834 operator intervention, or under the control 1835 of logic specific to a BGP implementation. 1836 The term "automatic" refers to a start being 1837 issued to the BGP peer connection FSM when 1838 such logic determines that the BGP peer 1839 connection should be restarted. 1841 The AllowAutomaticStart attribute specifies 1842 that this BGP connection supports automatic 1843 starting of the BGP connection. 1845 If the BGP implementation supports 1846 AllowAutomaticStart, the peer may be 1847 repeatedly restarted. Three other options 1848 control the rate at which the automatic 1849 restart occurs: DampPeerOscillations, 1850 IdleHoldTime, and the IdleHoldTimer. 1852 The DampPeerOscillations option specifies 1853 that the implementation engages additional 1854 logic to damp the oscillations of BGP peers 1855 in the face of sequences of automatic start 1856 and automatic stop. IdleHoldTime specifies 1857 how long the BGP peer is held in the Idle 1858 state prior to allowing the next automatic 1859 restart. The IdleHoldTimer is the timer 1860 that runs to hold the peer in Idle state. 1862 An example of DampPeerOscillations logic 1863 is an increase of the IdleHoldTime value 1864 if a BGP peer oscillates connectivity 1865 (connected/disconnected) repeatedly 1866 within a time period. To engage this 1867 logic, a peer could connected and disconnect 1868 10 times within 5 minutes. The IdleHoldTime 1869 value would be reset from 0 to 120 seconds. 1871 Values: TRUE or FALSE 1873 Option 2: AllowAutomaticStop 1875 Description: This BGP peer session optional attribute 1876 indicates that the BGP connection allows 1877 RFC DRAFT September 2003 1879 "automatic" stopping of the BGP connection. 1880 An "automatic" stop is defined as a stop under 1881 the control of implementation specific logic. 1882 The implementation specific logic is outside 1883 the scope of this specification. 1885 Values: TRUE or FALSE 1887 Option 3: DampPeerOscillations 1889 Description: The DampPeerOscillations optional session 1890 attribute indicates that this BGP connection 1891 is using logic that damps BGP peer oscillations 1892 in the Idle State. 1894 Value: TRUE or FALSE 1896 Option 4: IdleHoldTime 1898 Description: The IdleHoldTime is a the value 1899 that is set in the IdleHoldtimer. 1901 Values: Time in seconds 1903 Option 5: IdleHoldTimer 1905 Description: The IdleHoldTimer aids in controlling BGP peer 1906 oscillation. The IdleHoldTimer is used to keep 1907 the BGP peer in Idle for a particular duration. 1908 The IdleHoldTimer expired event is described 1909 in section 8.1.3. 1911 Values: Time in seconds 1913 Group 2: Unconfigured Peers 1915 Optional Session Attributes: AcceptConnectionsUnconfiguredPeers 1917 Option 1: AcceptConnectionsUnconfiguredPeers 1919 Description: The BGP FSM optionally allows the acceptance of BGP 1920 peer connections from neighbors that are not 1921 pre-configured. The 1922 "AcceptConnectionsUnconfiguredPeers" optional 1923 RFC DRAFT September 2003 1925 session attribute allows the FSM to support 1926 the state transitions that allow the 1927 implementation to accept or reject these 1928 unconfigured peers. 1930 The AcceptConnectionsUnconfiguredPeers has 1931 security implications. Please refer to the 1932 BGP Vulnerabilities document[BGP_VULN] for 1933 details. 1935 Value: True or False 1937 Group 3: TCP processing 1939 Optional Session Attributes: PassiveTcpEstablishment, TrackTcpState 1941 Option 1: PassiveTcpEstablishment 1943 Description: This option indicates that the BGP FSM will passively 1944 wait for the remote BGP peer to establish the BGP 1945 TCP connection. 1947 value: TRUE or FALSE 1949 Option 2: TrackTcpState 1951 Description: The BGP FSM normally tracks the end result of a TCP 1952 connection attempt rather than individual TCP messages. 1953 Optionally, the BGP FSM can support additional 1954 interaction with the TCP connection negotiation. The 1955 interaction with the TCP events may increase the 1956 amount of logging the BGP peer connection 1957 requires and the number of BGP FSM changes. 1959 Value: TRUE or FALSE 1961 Group 4: BGP Message Processing 1963 Optional Session Attributes: DelayOpen, DelayOpenTimer, 1964 SendNOTIFICATIONwithoutOPEN, 1965 CollisionDetectEstablishedState 1967 Option 1: DelayOpen 1969 Description: The DelayOpen optional session attribute allows 1970 implementations to be configured to delay 1971 RFC DRAFT September 2003 1973 sending an OPEN message for specific time 1974 period (DelayOpenTime). The delay allows 1975 the remote BGP Peer time to send the first 1976 OPEN message. 1978 Value: TRUE or FALSE 1980 Option 2: DelayOpenTime 1982 Description: The DelayOpenTime is the initial value that is 1983 set in the DelayOpenTimer. 1985 Value: Time in seconds 1987 Option 3: DelayOpenTimer 1989 Description: The DelayOpenTimer optional session attribute 1990 specifies a time that the local system will wait 1991 prior to sending an OPEN message on the connection. 1993 Value: Time in seconds 1995 Option 4: SendNOTIFICATIONwithoutOPEN 1997 Description: The SendNOTIFICIATONwithoutOPEN allows a peer to 1998 send a NOTIFICATION without first sending an 1999 OPEN message. Without this optional session 2000 attribute, the BGP connection assumes that an 2001 OPEN message must be sent by a peer prior 2002 to the peer sending a NOTIFICATION message. 2004 Value: True or False 2006 Option 5: CollisionDetectEstablishedState 2008 Description: Normally, a Detect Collision (6.8) will 2009 be ignored in the Established state. This 2010 optional session attribute indicates that 2011 this BGP connection processes a 2012 collisions in the Established state. 2014 Value: True or False 2016 Note: The optional session attributes clarify the BGP FSM description 2017 for existing features of BGP implementations. The optional 2018 RFC DRAFT September 2003 2020 session attributes may be pre-defined for an implementation 2021 and not readable via management interfaces for existing 2022 correct implementations. As newer BGP MIBs (version 2 2023 and beyond) are supported, these fields will be accessible 2024 via a management interface. 2026 8.1.2 Administrative Events 2028 An administrative event is an event in which the operator interface 2029 and BGP Policy engine signal the BGP finite state machine to start or 2030 stop the BGP state machine. The basic start and stop indication are 2031 augmented by optional connection attributes to signal a certain type 2032 of start or stop mechanism to the BGP FSM. An example of this combi- 2033 nation is event 5, AutomaticStart_with_PassiveTcpEstablishment. With 2034 this event, the BGP implementation signals to the BGP FSM that the 2035 implementation is using an Automatic Start with option to use a Pas- 2036 sive TCP Establishment. The Passive TCP establishment signals that 2037 this BGP FSM will wait for the remote side to start the TCP estab- 2038 lishment. 2040 Please note that only Event 1 (ManualStart) and Event 2 (ManualStop) 2041 are mandatory administrative events. All other administrative events 2042 are optional (Events 3-8). Each event below has a name, definition, 2043 status (mandatory or optional), and what optional session attributes 2044 SHOULD be set at each stage. When generating Event 1 through Event 8 2045 for the BGP FSM, the conditions specified in the "Optional Attribute 2046 Status" section are verified. If any of these conditions are not 2047 satisfied, then the local system should log a FSM error. 2049 The settings of optional session attributes may be implicit in some 2050 implementations and therefore may not be set explicitly by an exter- 2051 nal operator action. Section 8.2.1.5 describes these implicit set- 2052 tings of the optional session attributes. The administrative states 2053 described below may also be implicit in some implementations and not 2054 directly configurable by an external operator. 2056 Event1: ManualStart 2058 Definition: Local system administrator manually starts peer 2059 connection. 2061 Status: Mandatory 2063 Optional 2064 RFC DRAFT September 2003 2066 Attribute 2067 Status: The PassiveTcpEstablishment attribute SHOULD be 2068 set to FALSE. 2070 Event2: ManualStop 2072 Definition: Local system administrator manually 2073 stops the peer connection. 2075 Status: Mandatory 2077 Optional 2078 Attribute 2079 Status: No interaction with any optional attributes. 2081 Event3: AutomaticStart 2083 Definition: Local system automatically starts the 2084 BGP connection. 2086 Status: Optional, depending on local system 2088 Optional 2089 Attribute 2090 Status: 1) The AllowAutomaticStart attribute SHOULD be set 2091 if this event occurs. 2092 2) If the PassiveTcpEstablishment optional session 2093 attribute is supported, it SHOULD be set to FALSE. 2094 3) If the DampPeerOscillations is supported, it 2095 SHOULD be set to FALSE when this event occurs. 2097 Event4: ManualStart_with_PassiveTcpEstablishment 2099 Definition: Local system administrator manually starts the peer 2100 connection, but has the PassiveTcpEstablishment 2101 enabled. The PassiveTcpEstablishment optional 2102 attribute indicates that the peer will listen prior 2103 to establishing the connection. 2105 Status: Optional, depending on local system 2107 Optional 2108 Attribute 2109 Status: 1) The PassiveTcpEstablishment attribute SHOULD 2110 be set to TRUE if this event occurs. 2111 2) The DampPeerOscillations attribute SHOULD be 2112 RFC DRAFT September 2003 2114 set to FALSE when this event occurs. 2116 Event5: AutomaticStart_with_PassiveTcpEstablishment 2118 Definition: Local system automatically starts the 2119 BGP connection with the PassiveTcpEstablishment 2120 enabled. The PassiveTcpEstablishment 2121 optional attribute indicates 2122 that the peer will listen prior to 2123 establishing a connection. 2125 Status: Optional, depending on local system 2127 Optional 2128 Attribute 2129 Status: 1) The AllowAutomaticStart attribute SHOULD 2130 be set to TRUE. 2131 2) The PassiveTcpEstablishment attribute SHOULD 2132 be set to TRUE 2133 3) If the DampPeerOscillations attribute is 2134 supported, the DampPeerOscillations SHOULD 2135 be set to FALSE. 2137 Event6: AutomaticStart_with_DampPeerOscillations 2139 Definition: Local system automatically starts the 2140 BGP peer connection with peer oscillation 2141 damping enabled. The exact method of damping 2142 persistent peer oscillations is left up to the 2143 implementation and is outside the scope of 2144 this document. 2146 Status: Optional, depending on local system. 2148 Optional 2149 Attribute 2150 Status: 1) The AllowAutomaticStart attribute SHOULD 2151 be set to TRUE. 2152 2) The DampPeerOscillations attribute SHOULD 2153 be set to TRUE. 2154 3) The PassiveTcpEstablishment attribute 2155 SHOULD be set to FALSE. 2157 Event 7: AutomaticStart_with_DampPeerOscillations_and_ 2158 RFC DRAFT September 2003 2160 PassiveTcpEstablishment 2162 Definition: Local system automatically starts the 2163 BGP peer connection with peer oscillation 2164 damping enabled and PassiveTcpEstablishment 2165 enabled. The exact method of damping 2166 persistent peer oscillations is left up to the 2167 implementation and is outside the scope of 2168 this document. 2170 Status: Optional, depending on local system 2172 Optional 2173 Attributes 2174 Status: 1) The AllowAutomaticStart attribute 2175 SHOULD be set to TRUE. 2176 2) The DampPeerOscillations attribute SHOULD 2177 be set to TRUE. 2178 3) The PassiveTcpEstablishment attribute 2179 SHOULD be set to TRUE. 2181 Event8: AutomaticStop 2183 Definition: Local system automatically stops the 2184 BGP connection. 2186 An example of an automatic stop event is 2187 exceeding the number of prefixes for a given 2188 peer and the local system automatically 2189 disconnecting the peer. 2191 Status: Optional, depending on local system 2193 Optional 2194 Attribute 2195 Status: 1) The AllowAutomaticStop attribute 2196 SHOULD be TRUE 2198 8.1.3 Timer Events 2200 Event9: ConnectRetryTime_Expires 2201 RFC DRAFT September 2003 2203 Definition: An event generated when the ConnectRetryTimer 2204 expires. 2206 Status: Mandatory 2208 Event10: HoldTimer_Expires 2210 Definition: An event generated when the HoldTimer expires. 2212 Status: Mandatory 2214 Event11: KeepaliveTimer_Expires 2216 Definition: An event generated when the KeepaliveTimer expires. 2217 Status: Mandatory 2219 Event12: DelayOpenTimer_Expires 2221 Definition: An event generated when the DelayOpenTimer expires. 2223 Status: Optional 2225 Optional 2226 Attribute 2227 Status: If this event occurs, 2228 1) DelayOpen attribute SHOULD be set to TRUE, 2229 2) DelayOpenTime attribute SHOULD be supported, 2230 3) DelayOpenTimer SHOULD be supported, 2232 Event13: IdleHoldTimer_Expires 2234 Definition: An event generated when the IdleHoldTimer 2235 expires indicating that the BGP connection has 2236 completed waiting for the back-off period 2237 to prevent BGP peer oscillation. 2239 The IdleHoldTimer is only used when the 2240 persistent peer oscillation damping 2241 function is enabled by setting the 2242 DampPeerOscillations optional attribute 2243 is set to TRUE. 2245 Implementations not implementing the 2246 persistent peer oscillation damping 2247 function may not have the IdleHoldTimer. 2249 RFC DRAFT September 2003 2251 Status: Optional 2253 Optional 2254 Attribute 2255 Status: If this event occurs: 2256 1) DampPeerOscillations attribute SHOULD be set 2257 to TRUE. 2258 2) IdleHoldTimer SHOULD have just expired. 2260 8.1.4 TCP Connection based Events 2262 Event14: TcpConnection_Valid 2264 Definition: Event indicating the local system reception of 2265 a TCP connection request with a valid 2266 source IP address and TCP port and a valid 2267 destination IP address and TCP Port. The 2268 definition of invalid source and invalid 2269 destination IP address is left to the 2270 implementation. 2272 BGP's destination port SHOULD be port 179 2273 as defined by IANA. 2275 TCP connection request is denoted by the 2276 local system receiving a TCP SYN. 2278 Status: Optional 2280 Optional 2281 Attribute 2282 Status: 1) The TrackTcpState attribute SHOULD be set to 2283 TRUE if this event occurs. 2285 Event15: Tcp_CR_Invalid 2287 Definition: Event indicating the local system reception 2288 of a TCP connection request with either 2289 an invalid source address or port 2290 number or an invalid destination 2291 address or port number. 2293 BGP destination port number SHOULD be 179 2294 as defined by IANA. 2296 RFC DRAFT September 2003 2298 A TCP connection request occurs when 2299 the local system receives a TCP 2300 SYN. 2302 Status: Optional 2304 Optional 2305 Attribute 2306 Status: 1) The TrackTcpState attribute should be set to 2307 TRUE if this event occurs. 2309 Event16: Tcp_CR_Acked 2311 Definition: Event indicating the local system's request 2312 to establish a TCP connection to the remote 2313 peer. 2315 The local system's TCP connection sent a TCP 2316 SYN, and received a TCP SYN/ACK messages, 2317 and sent a TCP ACK. 2319 Status: Mandatory 2321 Event17: TcpConnectionConfirmed 2323 Definition: Event indicating that the local system has 2324 received a confirmation that the TCP 2325 connection has been established by the 2326 remote site. 2328 The remote peer's TCP engine sent a TCP SYN. 2329 The local peer's TCP engine sent a SYN, ACK 2330 message and now has received a final ACK. 2332 Status: Mandatory 2334 Event18: TcpConnectionFails 2336 Definition: Event indicating that the local system has 2337 received a TCP connection failure notice. 2339 The remote BGP peer's TCP machine could have 2340 sent a FIN. The local peer would respond 2341 with a FIN-ACK. Another alternative is that 2342 the local peer indicated a timeout in the 2343 TCP connection and downed the connection. 2345 RFC DRAFT September 2003 2347 Status: Mandatory 2349 8.1.5 BGP Message-based Events 2351 Event19: BGPOpen 2353 Definition: An event is generated when a valid OPEN 2354 message has been received. 2356 Status: Mandatory 2358 Optional 2359 Attribute 2360 Status: 1) The DelayOpen optional attribute SHOULD 2361 be set to FALSE. 2362 2) The DelayOpenTimer SHOULD not be running. 2364 Event20: BGPOpen with DelayOpenTimer running 2366 Definition: An event is generated when a valid OPEN 2367 message has been received for a peer 2368 that has a successfully established 2369 transport connection and is currently 2370 delaying the sending of a BGP open 2371 message. 2373 Status: Optional 2375 Optional 2376 Attribute 2377 Status: 1) The DelayOpen attribute SHOULD be 2378 set to TRUE. 2379 2) The DelayOpenTimer SHOULD be running. 2381 Event21: BGPHeaderErr 2383 Definition: An event is generated when a received 2384 BGP message header is not valid. 2386 Status: Mandatory 2388 Event22: BGPOpenMsgErr 2389 RFC DRAFT September 2003 2391 Definition: An event is generated when an OPEN message 2392 has been received with errors. 2394 Status: Mandatory 2396 Event23: OpenCollisionDump 2398 Definition: An event generated administratively 2399 when a connection collision has been 2400 detected while processing an incoming 2401 OPEN message and this connection has been 2402 selected to be disconnected. See section 2403 6.8 for more information on collision 2404 detection. 2406 Event23 is an administrative action 2407 generated by implementation logic 2408 that determines that this connection 2409 needs to be dropped per the rules in 2410 section 6.8. This event may occur if the FSM 2411 is implemented as two linked state machines. 2413 Status: Optional, depending on local system 2415 Optional 2416 Attribute 2417 Status: If the state machine is to process this 2418 attribute in Established state, 2419 1) CollisionDetectEstablished 2420 optional attribute SHOULD be set to TRUE 2422 Please note: The OpenCollisionDump event can occur 2423 in Idle, Connect, Active, OpenSent, OpenConfirm 2424 without any optional attributes being set. 2426 Event24: NotifMsgVerErr 2428 Definition: An event is generated when a 2429 NOTIFICATION message with "version 2430 error" is received. 2432 Status: Mandatory 2434 Event25: NotifMsg 2435 RFC DRAFT September 2003 2437 Definition: An event is generated when a 2438 NOTIFICATION message is received and 2439 the error code is anything but 2440 "version error". 2442 Status: Mandatory 2444 Event26: KeepAliveMsg 2446 Definition: An event is generated when a KEEPALIVE 2447 message is received. 2449 Status: Mandatory 2451 Event27: UpdateMsg 2453 Definition: An event is generated when a valid 2454 UPDATE message is received. 2456 Status: Mandatory 2458 Event28: UpdateMsgErr 2460 Definition: An event is generated when an invalid 2461 UPDATE message is received. 2463 Status: Mandatory 2465 8.2 Description of FSM 2467 8.2.1 FSM Definition 2469 BGP MUST maintain a separate FSM for each configured peer. Each BGP 2470 peer paired in a potential connection, unless configured to remain in 2471 the idle state, or configured to remain passive, will attempt to con- 2472 nect to the other. For the purpose of this discussion, the active or 2473 connecting side of the TCP connection (the side of a TCP connection 2474 sending the first TCP SYN packet) is called outgoing. The passive or 2475 listening side (the sender of the first SYN/ACK) is called an incom- 2476 ing connection. (See Section 8.2.1.1 for information on the terms 2477 active and passive used below.) 2479 A BGP implementation MUST connect to and listen on TCP port 179 for 2480 RFC DRAFT September 2003 2482 incoming connections in addition to trying to connect to peers. For 2483 each incoming connection, a state machine MUST be instantiated. 2484 There exists a period in which the identity of the peer on the other 2485 end of an incoming connection is known, but the BGP identifier is not 2486 known. During this time, both an incoming and an outgoing connection 2487 for the same configured peering may exist. This is referred to as a 2488 connection collision. (See Section 6.8.) 2490 A BGP implementation will have at most one FSM for each configured 2491 peering plus one FSM for each incoming TCP connection for which the 2492 peer has not yet been identified. Each FSM corresponds to exactly one 2493 TCP connection. 2495 There may be more than one connection between a pair of peers if the 2496 connections are configured to use a different pair of IP addresses. 2497 This is referred to as multiple "configured peerings" to the same 2498 peer. 2500 8.2.1.1 Terms "active" and "passive" 2502 The terms active and passive have been in the Internet operator's 2503 vocabulary for almost a decade and have proven useful. The words 2504 active and passive have slightly different meanings applied to a TCP 2505 connection or applied to a peer. There is only one active side and 2506 one passive side to any one TCP connection per the definition above 2507 and the state machine below. When a BGP speaker is configured active, 2508 it may end up on either the active or passive side of the connection 2509 that eventually gets established. Once the TCP connection is com- 2510 pleted, it doesn't matter which end was active and which end was pas- 2511 sive. The only difference is which side of the TCP connection has 2512 port number 179. 2514 8.2.1.2 FSM and collision detection 2516 There is one FSM per BGP connection. When the connection collision 2517 occurs prior to determining what peer a connection is associated 2518 with, there may be two connections for one peer. After the connec- 2519 tion collision is resolved (see Section 6.8) the FSM for the connec- 2520 tion that is closed SHOULD be disposed of. 2522 RFC DRAFT September 2003 2524 8.2.1.3 FSM and Optional Session Attributes 2526 Optional Session Attributes specify either attributes that act 2527 as flags (TRUE or FALSE) or optional timers. For optional 2528 attributes that act as flags, if the optional session attribute 2529 can be set to TRUE on the system, the corresponding the BGP FSM 2530 actions must be supported. For example, if the following options 2531 can be set in a BGP implementation: AutoStart and 2532 PassiveTCPEstablishment, then the events 3, 4 and 5 must be 2533 supported. If an Optional Session attribute cannot be set to 2534 TRUE, the events supporting that set of options do not have to 2535 be supported. 2537 Each of the optional timers (DelayOpenTimer and IdleHoldTimer), 2538 has a group of attributes that are: 2540 - flag indicating support, 2541 - Time set in Timer 2542 - Timer. 2544 The two optional timers show this format: 2546 DelayOpenTimer: DelayOpen, DelayOpenTime, DelayOpenTimer 2547 IdleHoldTimer: DampPeerOscillations, IdleHoldTime, 2548 IdleHoldTmer 2550 If the flag indicating support for an optional timer 2551 (DelayOpen or DampPeerOscillations), cannot be set to TRUE, 2552 the timers and events supporting that 2553 option do not have to be supported. 2555 8.2.1.4 FSM Event numbers 2557 The Event numbers (1-28) utilized in this state machine description 2558 aid in specifying the behavior of the BGP state machine. Implementa- 2559 tions MAY use these numbers to provide network management informa- 2560 tion. The exact form of a FSM or the FSM events are specific to each 2561 implementation. 2563 RFC DRAFT September 2003 2565 8.2.1.5 FSM actions that are implementation dependent. 2567 The BGP FSM specifies at certain points that BGP initialization will 2568 occur or that BGP resources will be deleted. The initialization of 2569 the BGP FSM and the associated resources depend on the policy portion 2570 of the BGP implementation. The details of these actions are outside 2571 the scope of the FSM document. 2573 8.2.2 Finite State Machine 2575 Idle state: 2577 Initially the BGP peer FSM is in the Idle state. (Hereafter 2578 the BGP peer FSM will be shortened to BGP FSM.) 2580 In this state BGP FSM refuses all incoming BGP 2581 connections for this peer. No resources are allocated to the peer. 2582 In response to a ManualStart event (Event 1) or an 2583 AutomaticStart event (Event 3), the local system: 2584 - initializes all BGP resources for the peer connection, 2585 - sets ConnectRetryCounter to zero, 2586 - starts the ConnectRetryTimer with initial value, 2587 - initiates a TCP connection to the other BGP peer, 2588 - listens for a connection that may be initiated by 2589 the remote BGP peer, and 2590 - changes its state to Connect. 2592 The ManualStop event (Event 2) and AutomaticStop (Event 8) event 2593 are ignored in the Idle state. 2595 In response to a ManualStart_with_PassiveTcpEstablishment event 2596 (Event 4) or AutomaticStart_with_PassiveTcpEstablishment event 2597 (Event 5), the local system: 2598 - initializes all BGP resources, 2599 - sets the ConnectRetryCounter to zero, 2600 - starts the ConnectRetryTimer with initial value, 2601 - listens for a connection that may be initiated by 2602 the remote peer, and 2603 - changes its state to Active. 2605 The exact value of the ConnectRetryTimer is a local 2606 matter, but it SHOULD be sufficiently large to allow TCP 2607 initialization. 2609 If the DampPeerOscillations attribute is set to TRUE, 2610 RFC DRAFT September 2003 2612 the following three additional events may occur 2613 within Idle state: 2614 - AutomaticStart_with_DampPeerOscillations (Event6), 2615 - AutomaticStart_with_DampPeerOscillations_and_ 2616 PassiveTcpEstablishment (Event7), 2617 - IdleHoldTimer_Expired (Event 13). 2619 Upon receiving these 3 events, the local system will 2620 use these events to prevent peer oscillations. 2621 The method of preventing persistent peer oscillation is 2622 outside the scope of this document. 2624 Any other event (Events 9-12, 15-28) received in the Idle state 2625 does not cause change in the state of the local system. 2627 Connect State: 2629 In this state, BGP FSM is waiting for the TCP connection to 2630 be completed. 2632 The start events (Events 1, 3-7) are ignored in connect 2633 state. 2635 In response to a ManualStop event [Event 2), the local system: 2636 - drops the TCP connection, 2637 - releases all BGP resources, 2638 - sets ConnectRetryCounter to zero, 2639 - stops the ConnectRetryTimer and sets ConnectRetryTimer 2640 to zero, and 2641 - changes its state to Idle. 2643 In response to the ConnectRetryTimer_Expires event (Event 2644 9), the local system: 2645 - drops the TCP connection, 2646 - restarts the ConnectRetryTimer, 2647 - stops the DelayOpenTimer and resets the timer to zero, 2648 - initiates a TCP connection to the other BGP peer, 2649 - continues to listen for a connection that may be 2650 initiated by the remote BGP peer, and 2651 - stays in Connect state. 2653 If the DelayOpenTimer_Expires event (Event12) occurs in the 2654 Connect state, the local system: 2655 - sends an OPEN message to its peer, 2656 - sets the HoldTimer to a large value, and 2657 RFC DRAFT September 2003 2659 - changes its state to OpenSent. 2661 If the BGP FSM receives a TcpConnection_valid event 2662 (Event 14), the TCP connection is processed, and 2663 the connection remains in the Connect state. 2665 If the BGP FSM receives a Tcp_CR_Invalid event (Event 15), 2666 the local system rejects the TCP connection, and the connection 2667 remains in the Connect state. 2669 If the TCP connection succeeds (Event 16 or 2670 Event 17), the local system checks the DelayOpen attribute prior 2671 to processing. If the DelayOpen attribute is set to TRUE, 2672 the local system: 2673 - stops the ConnectRetryTimer (if running) and sets the 2674 ConnectRetryTimer to zero, 2675 - sets the DelayOpenTimer to the initial value, and 2676 - stays in the Connect state. 2677 If the DelayOpen attribute is not set to TRUE, the local system: 2678 - stops the ConnectRetryTimer (if running) and sets the 2679 ConnectRetryTimer to zero, 2680 - completes BGP initialization 2681 - sends an OPEN message to its peer, 2682 - sets HoldTimer to a large value, and 2683 - changes its state to OpenSent. 2685 A HoldTimer value of 4 minutes is suggested. 2687 If the TCP connection fails (Event18), 2688 the local system checks the DelayOpenTimer. If the 2689 DelayOpenTimer is running, the local system: 2690 - restarts the ConnectRetryTimer with initial value, 2691 - stops the DelayOpenTimer and resets value to zero, 2692 - continues to listen for a connection that may be 2693 initiated by the remote BGP peer, and 2694 - changes its state to Active. 2696 If the DelayOpenTimer is not running, the local system: 2697 - stops the ConnectRetryTimer to zero, 2698 - drops the TCP connection, 2699 - releases all BGP resources, and 2700 - changes its state to Idle. 2702 If an OPEN message is received while the DelayOpenTimer is 2703 running (Event 20), the local system: 2705 - stops the ConnectRetryTimer (if running) and 2706 sets the ConnectRetryTimer to zero, 2707 RFC DRAFT September 2003 2709 - completes the BGP initialization, 2710 - stops and clears the DelayOpenTimer 2711 (sets the value to zero), 2712 - sends an OPEN message, 2713 - sends a KEEPALIVE message, 2714 - if the HoldTimer initial value is non-zero, 2715 - starts the keepaliveTimer with the initial value and 2716 - resets the hold timer to the negotiated value, 2717 else if HoldTimer Initial value is zero, 2718 - resets the KeepaliveTimer and 2719 - resets the HoldTimer value to zero, 2720 - and changes its state to OpenConfirm. 2722 If the value of the autonomous system field is the same as the local 2723 Autonomous System number, set the connection status to an internal 2724 connection; otherwise it is "external". 2726 If BGP message header checking detects an error (Event 21) or 2727 OPEN message checking detects an error (Event 22) (see section 2728 6.2), the local system: 2729 - (optionally) If the SendNOTIFICATIONwithoutOPEN attribute 2730 is set to TRUE, then the local system first sends 2731 a NOTIFICATION message with the appropriate error 2732 code, and then 2734 - stops the ConnectRetryTimer (if running) 2735 and sets the ConnectRetryTimer to zero, 2736 - releases all BGP resources, 2737 - drops the TCP connection, 2738 - increments the ConnectRetryCounter by 1, 2739 - (optionally) performs peer oscillation damping 2740 if the DampPeerOscillations attribute is set to TRUE, and 2741 - changes its state to Idle. 2743 If a NOTIFICATION message is received with a version 2744 error(Event24), the local system checks the DelayOpenTimer. 2745 If the DelayOpenTimer is running, the local system: 2746 - stops the ConnectRetryTimer (if running) 2747 and sets the ConnectRetryTimer to zero, 2748 - stops and resets the DelayOpenTimer (sets to zero), 2749 - releases all BGP resources, 2750 - drops the TCP connection, and 2751 - changes its state to Idle. 2753 If the DelayOpenTimer is not running, the local system: 2754 - stops the ConnectRetryTimer and sets the 2755 ConnectRetryTimer to zero, 2756 - releases all BGP resources, 2757 RFC DRAFT September 2003 2759 - drops the TCP connection, 2760 - increments the ConnectRetryCounter by 1, 2761 - performs peer oscillation damping if the 2762 DampPeerOscillations attribute is set to True, and 2763 - changes its state to Idle. 2765 In response to any other events (Events 8,10-11,13,19,23, 2766 25-28) the local system: 2767 - if the ConnectRetryTimer is running, 2768 stops and resets the ConnectRetrytimer (sets to zero), 2769 - if the DelayOpenTimer is running, 2770 stops and resets the DelayOpenTimer (sets to zero), 2771 - releases all BGP resources, 2772 - drops the TCP connection, 2773 - increments the ConnectRetryCounter by 1, 2774 - performs peer oscillation damping if the 2775 DampPeerOscillations attribute is set to True, and 2776 - changes its state to Idle. 2778 Active State: 2780 In this state BGP FSM is trying to acquire a peer by listening 2781 for and accepting a TCP connection. 2783 The start events (Event1, 3-7) are ignored in the Active 2784 state. 2786 In response to a ManualStop event (Event 2), the local system: 2787 - If the DelayOpenTimer is running and the 2788 SendNOTIFICATIONwithoutOPEN session attribute is set, 2789 the local system sends a NOTIFICATION with a Cease, 2790 - releases all BGP resources including 2791 stopping the DelayOpenTimer 2792 - drops the TCP connection, 2793 - sets ConnectRetryCounter to zero, 2794 - stops the ConnectRetryTimer and sets the 2795 ConnectRetryTimer to zero, and 2796 - changes its state to Idle. 2798 In response to a ConnectRetryTimer expires event (Event 9), 2799 the local system: 2800 - restarts the ConnectRetryTimer (with initial value), 2801 - initiates a TCP connection to the other BGP peer, 2802 - continues to listen for TCP connection that may be 2803 initiated by remote BGP peer, and 2804 RFC DRAFT September 2003 2806 - changes its state to Connect. 2808 If the local system receives an DelayOpenTimer_Expired event 2809 (Event 12), the local system: 2810 - sets the ConnectRetryTimer to zero, 2811 - stops and clears the DelayOpenTimer (set to zero), 2812 - completes the BGP initialization, 2813 - sends the OPEN message to its remote peer, 2814 - sets its hold timer to a large value, and 2815 - changes its state to OpenSent. 2817 A HoldTimer value of 4 minutes is also suggested for this 2818 state transition. 2820 If the local system receives a TcpConnection_Valid event 2821 (Event 14), the local system processes the TCP connection 2822 flags and stays in Active state. 2824 If the local system receives an Tcp_CR_Invalid event (Event 15): 2825 the local system rejects the TCP connection and stays in 2826 the Active State. 2828 In response to a TCP connection succeeding (Event 16 or Event 17), the 2829 local system checks the DelayOpen optional attribute prior to 2830 processing. 2831 If the DelayOpen attribute is set to TRUE, the local 2832 system: 2833 - stops the ConnectRetryTimer and sets the 2834 ConnectRetryTimer to zero, 2835 - sets the DelayOpenTimer to the initial value 2836 (DelayOpenTime), and 2837 - stays in the Active state. 2838 If the DelayOpen attribute is set to FALSE, the local 2839 system: 2840 - sets the ConnectRetryTimer to zero, 2841 - completes the BGP initialization, 2842 - sends the OPEN message to its peer, 2843 - sets its HoldTimer to a large value, and 2844 - changes its state to OpenSent. 2846 A HoldTimer value of 4 minutes is suggested as a "large value" for 2847 the HoldTimer. 2849 If the local system receives a TcpConnectionFails event (Event 18), 2850 the local system: 2852 RFC DRAFT September 2003 2854 - restarts ConnectRetryTimer (with initial value), 2855 - stops and clears the DelayOpenTimer (sets the value to zero), 2856 - releases all BGP resource, 2857 - increments ConnectRetryCounter by 1, 2858 - optionally performs peer oscillation damping if 2859 the DampPeerOscillations attribute is set to TRUE, and 2860 - changes its state to Idle. 2862 If an OPEN message is received and the DelayOpenTimer is 2863 running (Event 20), the local system: 2864 - stops ConnectRetryTimer (if running) and sets 2865 the ConnectRetryTimer to zero, 2866 - stops and clears DelayOpenTimer (sets to zero), 2867 - completes the BGP initialization, 2868 - sends an OPEN message, 2869 - sends a KEEPALIVE message, 2870 - if the HoldTimer value is non-zero, 2871 - starts the KeepaliveTimer to initial value, 2872 - resets the HoldTimer to the negotiated value, 2873 else if the HoldTimer is zero 2874 - resets the KeepaliveTimer (set to zero), 2875 - resets the HoldTimer to zero, and 2876 - changes its state to OpenConfirm. 2878 If the value of the autonomous system field is the same as 2879 the local Autonomous System number, set the connection status 2880 to an internal connection; otherwise it is external. 2882 If BGP message header checking detects an error (Event 21) 2883 or OPEN message checking detects an error (Event 22) (see 2884 section 6.2), the local system: 2885 - (optionally) sends a NOTIFICATION message with the 2886 appropriate error code if the SendNOTIFICATIONwithoutOPEN 2887 attribute is set to TRUE, 2888 - sets the ConnectRetryTimer to zero, 2889 - releases all BGP resources, 2890 - drops the TCP connection, 2891 - increments the ConnectRetryCounter by 1, 2892 - (optionally) performs peer oscillation damping if the 2893 DampPeerOscillations attribute is set to TRUE, and 2894 - changes its state to Idle. 2896 If a NOTIFICATION message is received with a version 2897 error (Event 24), the local system checks the DelayOpenTimer. 2898 If the DelayOpenTimer is running, the local system: 2899 - stops the ConnectRetryTimer (if running) and 2900 sets the ConnectRetryTimer to zero, 2901 RFC DRAFT September 2003 2903 - stops and resets the DelayOpenTimer (sets to zero), 2904 - releases all BGP resources, 2905 - drops the TCP connection, and 2906 - changes its state to Idle. 2907 If the DelayOpenTimer is not running, the local system: 2908 - sets the ConnectRetryTimer to zero, 2909 - releases all BGP resources, 2910 - drops the TCP connection, 2911 - increments the ConnectRetryCounter by 1, 2912 - (optionally) performs peer oscillation damping 2913 if the DampPeerOscillations attribute is set to TRUE, and 2914 - changes its state to Idle. 2916 In response to any other event (Events 8,10-11,13,19,23,25-28), 2917 the local system: 2918 - sets the ConnectRetryTimer to zero, 2919 - releases all BGP resources, 2920 - drops the TCP connection, 2921 - increments the ConnectRetryCounter by one, 2922 - (optionally) performs peer oscillation damping if 2923 the DampPeerOscillations attribute is set to TRUE, and 2924 - changes its state to Idle. 2926 OpenSent: 2928 In this state BGP FSM waits for an OPEN message from its peer. 2930 The start events (Event1, 3-7) are ignored in the OpenSent 2931 state. 2933 If a ManualStop event (Event 2) is issued in OpenSent 2934 state, the local system: 2935 - sends the NOTIFICATION with a cease, 2936 - sets the ConnectRetryTimer to zero, 2937 - releases all BGP resources, 2938 - drops the TCP connection, 2939 - sets ConnectRetryCounter to zero, and 2940 - changes its state to Idle. 2942 If an AutomaticStop event (Event 8) is issued in OpenSent 2943 state, the local system: 2944 - sends the NOTIFICATION with a cease, 2945 - sets the ConnectRetryTimer to zero, 2946 - release all the BGP resources, 2947 - drops the TCP connection, 2948 - increments the ConnectRetryCounter by 1, 2949 - (optionally) performs peer oscillation damping if the 2950 RFC DRAFT September 2003 2952 DampPeerOscillations attribute is set to TRUE, and 2953 - changes its state to Idle. 2955 If the HoldTimer_Expires (Event 10), the local system: 2956 - sends a NOTIFICATION message with error code Hold 2957 Timer Expired, 2958 - sets the ConnectRetryTimer to zero, 2959 - releases all BGP resources, 2960 - drops the TCP connection, 2961 - increments the ConnectRetryCounter, 2962 - (optionally) performs peer oscillation damping if the 2963 DampPeerOscillations attribute is set to TRUE, and 2964 - changes its state to Idle. 2966 If a TcpConnection_Valid (Event 14) or Tcp_CR_Acked (Event 16) 2967 is received, or a TcpConnectConfirm event (Event 17) is 2968 received, a second TCP connection may be in progress. This 2969 second TCP connection is tracked per Connection Collision 2970 processing (Section 6.8) until an OPEN message is received. 2972 A TCP Connection Request for an Invalid port 2973 (Tcp_CR_Invalid (Event 15)) is ignored. 2975 If a TcpConnectionFails event (Event18) indication is received, 2976 the local system: 2977 - closes the BGP connection, 2978 - restarts the ConnectRetryTimer, 2979 - continues to listen for a connection that may be 2980 initiated by the remote BGP peer, and 2981 - changes its state to Active. 2983 When an OPEN message is received, all fields are checked 2984 for correctness. If there are no errors in the OPEN message 2985 (Event 19), the local system: 2986 - resets the DelayOpenTimer to zero, 2987 - sets the BGP ConnectRetryTimer to zero, 2988 - sends a KEEPALIVE message, and 2989 - sets a KeepAliveTimer (via the text below) 2990 - sets the HoldTimer according to the negotiated value 2991 (see Section 4.2), 2992 - changes its state to OpenConfirm. 2994 If the negotiated hold time value is zero, then the HoldTimer and 2995 KeepaliveTimer are not started. If the value of the Autonomous 2996 System field is the same as the local Autonomous System number, 2997 then the connection is an "internal" connection; otherwise, it 2998 is an "external" connection. (This will impact UPDATE processing 2999 RFC DRAFT September 2003 3001 as described below.) 3003 If the BGP message header checking (Event 21) or OPEN message 3004 check detects an error (Event 22)(see Section 6.2), the local system: 3005 - sends a NOTIFICATION message with appropriate error 3006 code, 3007 - sets the ConnectRetryTimer to zero, 3008 - releases all BGP resources, 3009 - drops the TCP connection, 3010 - increments the ConnectRetryCounter by 1, 3011 - (optionally) performs peer oscillation damping if the 3012 DampPeerOscillations attribute is TRUE, and 3013 - changes its state to Idle. 3015 Collision detection mechanisms (Section 6.8) need to be 3016 applied when a valid BGP OPEN message is received (Event 19 or 3017 Event 20). Please refer to Section 6.8 for the details of 3018 the comparison. A CollisionDetectDump event occurs when the 3019 BGP implementation determines, by a means outside the scope of 3020 this document, that a connection collision has occurred. 3022 If a connection in OpenSent is determined to be the 3023 connection that must be closed, an OpenCollisionDump (Event 23) 3024 is signaled to the state machine. If such an event is 3025 received in OpenSent state, the local system: 3026 - sends a NOTIFICATION with a Cease 3027 - sets the ConnectRetryTimer to zero, 3028 - releases all BGP resources, 3029 - drops the TCP connection, 3030 - increments ConnectRetryCounter by 1, 3031 - (optionally) performs peer oscillation damping if the 3032 DampPeerOscillations attribute is set to TRUE, and 3033 - changes its state to Idle. 3035 If a NOTIFICATION message is received with a version 3036 error (Event24), the local system: 3037 - sets the ConnectRetryTimer to zero, 3038 - releases all BGP resources, 3039 - drops the TCP connection, and 3040 - changes its state to Idle. 3042 In response to any other event (Events 9, 11-13,20,25-28), 3043 the local system: 3044 - sends the NOTIFICATION with the Error Code Finite 3045 state machine error, 3046 - sets the ConnectRetryTimer to zero, 3047 RFC DRAFT September 2003 3049 - releases all BGP resources, 3050 - drops the TCP connection, 3051 - increments the ConnectRetryCounter by 1, 3052 - (optionally) performs peer oscillation damping if the 3053 DampPeerOscillations attribute is set to TRUE, and 3054 - changes its state to Idle. 3056 OpenConfirm State: 3058 In this state BGP waits for a KEEPALIVE or NOTIFICATION 3059 message. 3061 Any start event (Event1, 3-7) is ignored in the OpenConfirm 3062 state. 3064 In response to a ManualStop event (Event 2) initiated by 3065 the operator, the local system: 3066 - sends the NOTIFICATION message with Cease, 3067 - releases all BGP resources, 3068 - drops the TCP connection, 3069 - sets the ConnectRetryCounter to zero, 3070 - sets the ConnectRetryTimer to zero, and 3071 - changes its state to Idle. 3073 In response to the AutomaticStop event initiated by the 3074 system (Event 8), the local system: 3075 - sends the NOTIFICATION message with Cease, 3076 - sets the ConnectRetryTimer to zero, 3077 - releases all BGP resources, 3078 - drops the TCP connection, 3079 - increments the ConnectRetryCounter by 1, 3080 - (optionally) performs peer oscillation damping 3081 if the DampPeerOscillations attribute is set to TRUE, 3082 and 3083 - changes its state to Idle. 3085 If the HoldTime_Expires event (Event 10) occurs before a KEEPALIVE 3086 message is received, the local system: 3087 - sends the NOTIFICATION message with the error code, 3088 - sets the ConnectRetryTimer to zero, 3089 - releases all BGP resources, 3090 - drops the TCP connection, 3091 - increments the ConnectRetryCounter by 1, 3092 - (optionally) performs peer oscillation damping if 3093 RFC DRAFT September 2003 3095 the DampPeerOscillations attribute is set to TRUE, and 3096 - changes its state to Idle. 3098 If the local system receives a KEEPALIVETimer_Expires 3099 event (Event 11), the system: 3100 - sends a KEEPALIVE message, 3101 - restarts the KeepaliveTimer, and 3102 - remains in OpenConfirmed state. 3104 In the event of TcpConnection_Valid event (Event 14), or TCP 3105 connection succeeding (Event 16 or Event 17) while in OpenConfirm, 3106 the local system needs to track the second connection. 3108 If a TCP connection is attempted to an invalid port (Event 3109 15), the local system will ignore the second connection 3110 attempt. 3112 If the local system receives a TcpConnectionFails event 3113 (Event 18) from the underlying TCP or a NOTIFICATION 3114 message (Event 25), the local system: 3115 - sets the ConnectRetryTimer to zero, 3116 - releases all BGP resources, 3117 - drops the TCP connection, 3118 - increments the ConnectRetryCounter by 1, 3119 - (optionally) performs peer oscillation damping if the 3120 DampPeerOscillations attribute is set to TRUE, and 3121 - changes its state to Idle. 3123 If the local system receives a NOTIFICATION message with a 3124 version error (NotifMsgVerErr (Event 24)), the local system: 3125 - sets the ConnectRetryTimer to zero, 3126 - releases all BGP resources, 3127 - drops the TCP connection, and 3128 - changes its state to Idle. 3130 If the local system receives a valid OPEN message 3131 (BGPOpen (Event 19)), the collision detect function is 3132 processed per Section 6.8. If this connection is to be 3133 dropped due to connection collision, the local system: 3134 - sends a NOTIFICATION with a Cease, 3135 - sets the ConnectRetryTimer to zero, 3136 - releases all BGP resources, 3137 - drops the TCP connection (send TCP FIN), 3138 - increments the ConnectRetryCounter by 1, 3139 - (optionally) performs peer oscillation damping if the 3140 RFC DRAFT September 2003 3142 DampPeerOscillations attribute is set to TRUE, and 3143 - changes its state to Idle. 3145 If an OPEN message is received, all fields are checked for 3146 correctness. If the BGP message header checking 3147 (BGPHeaderErr (Event21)) or OPEN message check detects 3148 an error (see Section 6.2) (BGPOpenMsgErr(Event22)), the 3149 local system: 3150 - sends a NOTIFICATION message with appropriate error 3151 code, 3152 - sets the ConnectRetryTimer to zero, 3153 - releases all BGP resources, 3154 - drops the TCP connection, 3155 - increments the ConnectRetryCounter by 1, 3156 - (optionally) performs peer oscillation damping if the 3157 DampPeerOscillations attribute is set to TRUE, and 3158 - changes its state to Idle. 3160 If during the processing of another OPEN message, the BGP 3161 implementation determines by a means outside the scope of 3162 this document that a connection collision has occurred and 3163 this connection is to be closed, the local system will 3164 issue an OpenCollisionDump event (Event 23). When the local 3165 system receives an OpenCollisionDump event (Event 23), the 3166 local system: 3167 - sends a NOTIFICATION with a Cease 3168 - sets the ConnectRetryTimer to zero, 3169 - releases all BGP resources 3170 - drops the TCP connection, 3171 - increments the ConnectRetryCounter by 1, 3172 - (optionally) performs peer oscillation damping if the 3173 DampPeerOscillations attribute is set to TRUE, and 3174 - changes its state to Idle. 3176 If the local system receives a KEEPALIVE message 3177 (KeepAliveMsg (Event 26)), the local system: 3178 - restarts the HoldTimer and 3179 - changes its state to Established. 3181 In response to any other event (Events 9, 12-13, 20, 27-28), 3182 the local system: 3183 - sends a NOTIFICATION with a code of Finite State 3184 Machine Error, 3185 - sets the ConnectRetryTimer to zero, 3186 - releases all BGP resources, 3187 RFC DRAFT September 2003 3189 - drops the TCP connection, 3190 - increments the ConnectRetryCounter by 1, 3191 - (optionally) performs peer oscillation damping if the 3192 DampPeerOscillations attribute is set to TRUE, and 3193 - changes its state to Idle. 3195 Established State: 3197 In the Established state, the BGP FSM can exchange UPDATE, 3198 NOTFICATION, and KEEPALIVE messages with its peer. 3200 Any Start event (Event 1, 3-7) is ignored in the 3201 Established state. 3203 In response to a ManualStop event (initiated by an 3204 operator)(Event2), the local system: 3205 - sends the NOTIFICATION message with Cease, 3206 - sets the ConnectRetryTimer to zero, 3207 - deletes all routes associated with this connection, 3208 - releases BGP resources, 3209 - drops the TCP connection, 3210 - sets ConnectRetryCounter to zero, and 3211 - changes its state to Idle. 3213 In response to an AutomaticStop event (Event8), the local system: 3214 - sends a NOTIFICATION with Cease, 3215 - sets the ConnectRetryTimer to zero 3216 - deletes all routes associated with this connection, 3217 - releases all BGP resources, 3218 - drops the TCP connection, 3219 - increments the ConnectRetryCounter by 1, 3220 - (optionally) performs peer oscillation damping if the 3221 DampPeerOscillations attribute is set to TRUE, and 3222 - changes its state to Idle. 3224 One reason for an AutomaticStop event is: A BGP receives 3225 UPDATE messages with number of prefixes for a given 3226 peer so that the total prefixes received exceeds the 3227 maximum number of prefixes configured. The local system 3228 automatically disconnects the peer. 3230 If the HoldTimer_Expires event occurs (Event10), the 3231 local system: 3232 - sends a NOTIFICATION message with Error Code Hold 3233 Timer Expired, 3234 RFC DRAFT September 2003 3236 - sets the ConnectRetryTimer to zero, 3237 - releases all BGP resources, 3238 - drops the TCP connection, 3239 - increments the ConnectRetryCounter by 1, 3240 - (optionally) performs peer oscillation damping if the 3241 DampPeerOscillations attribute is set to TRUE, and 3242 - changes its state to Idle. 3244 If the KeepaliveTimer_Expires event occurs (Event11), 3245 the local system: 3246 - sends a KEEPALIVE message, and 3247 - restarts its KeepAliveTimer unless the negotiated 3248 HoldTime value is zero. 3250 Each time the local system sends a KEEPALIVE or UPDATE 3251 message, it restarts its KeepAliveTimer, unless the 3252 negotiated HoldTime value is zero. 3254 A TcpConnection_valid (Event 14) received for a 3255 valid port will cause the second connection to be 3256 tracked. 3258 An invalid TCP connection (Tcp_CR_Invalid Event 3259 (Event 15)), will be ignored. 3261 In response to an indication that the TCP connection 3262 is successfully established (Event 16 3263 or Event 17), the second connection SHALL be tracked until 3264 it sends an OPEN message. 3266 If a valid OPEN message (BGPOpen (Event 19)) is received, 3267 and if the CollisionDetectEstablishedState optional 3268 attribute is TRUE, the OPEN message will be checked 3269 to see if it collides (Section 6.8) with any other connection. 3270 If the BGP implementation determines that this connection 3271 needs to be terminated, it will process an OpenCollisionDump 3272 event (Event 23). If this connection needs to be 3273 terminated, the local system: 3274 - sends a NOTIFICATION with a Cease, 3275 - sets the ConnectRetryTimer to zero, 3276 - deletes all routes associated with this connection, 3277 - releases all BGP resources, 3278 - drops the TCP connection, 3279 - increments ConnectRetryCounter by 1, 3280 - (optionally) performs peer oscillation damping if the 3281 DampPeerOscillations is set to TRUE, and 3282 - changes its state to Idle. 3284 RFC DRAFT September 2003 3286 If the local system receives a NOTIFICATION message 3287 (Event24 or Event 25) or a TcpConnectionsFails (Event18) 3288 from the underlying TCP, it: 3289 - sets the ConnectRetryTimer to zero, 3290 - deletes all routes associated with this connection, 3291 - releases all the BGP resources, 3292 - drops the TCP connection, 3293 - increments the ConnectRetryCounter by 1, 3294 - changes its state to Idle. 3296 If the local system receives a KEEPALIVE message 3297 (Event 26), the local system: 3298 - restarts its HoldTimer, if the negotiated HoldTime 3299 value is non-zero, and 3300 - remains in the Established state. 3302 If the local system receives an UPDATE message (Event27), 3303 the local system: 3304 - processes the update packet, 3305 - restarts its HoldTimer if the negotiated HoldTime 3306 value is non-zero, and 3307 - remains in the Established state. 3309 If the local system receives an UPDATE message, and the 3310 UPDATE message error handling procedure (see Section 6.3) 3311 detects an error (Event28), the local system: 3312 - sends a NOTIFICATION message with Update error, 3313 - sets the Connect Retry timer to zero, 3314 - deletes all routes associated with this connection, 3315 - releases all BGP resources, 3316 - drops the TCP connection, 3317 - increments the ConnectRetryCounter by 1, 3318 - (optionally) performs peer oscillation damping if the 3319 DampPeerOscillations attribute is set to TRUE, and 3320 - changes its state to Idle. 3322 In response to any other event (Events 9, 12-13, 20-22) the 3323 local system: 3324 - sends a NOTIFICATION message with Error Code Finite 3325 State Machine Error, 3326 - deletes all routes associated with this connection, 3327 - sets the Connect Retry timer to zero, 3328 - releases all BGP resources, 3329 - drops the TCP connection, 3330 RFC DRAFT September 2003 3332 - increments the ConnectRetryCounter by 1, 3333 - (optionally) performs peer oscillation damping if the 3334 DampPeerOscillations attribute is set to TRUE, and 3335 - changes its state to Idle. 3337 9. UPDATE Message Handling 3339 An UPDATE message may be received only in the Established state. 3340 Receiving an UPDATE message in any other state is an error. When an 3341 UPDATE message is received, each field is checked for validity as 3342 specified in Section 6.3. 3344 If an optional non-transitive attribute is unrecognized, it is qui- 3345 etly ignored. If an optional transitive attribute is unrecognized, 3346 the Partial bit (the third high-order bit) in the attribute flags 3347 octet is set to 1, and the attribute is retained for propagation to 3348 other BGP speakers. 3350 If an optional attribute is recognized, and has a valid value, then, 3351 depending on the type of the optional attribute, it is processed 3352 locally, retained, and updated, if necessary, for possible propaga- 3353 tion to other BGP speakers. 3355 If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, 3356 the previously advertised routes whose destinations (expressed as IP 3357 prefixes) contained in this field SHALL be removed from the Adj-RIB- 3358 In. This BGP speaker SHALL run its Decision Process since the previ- 3359 ously advertised route is no longer available for use. 3361 If the UPDATE message contains a feasible route, the Adj-RIB-In will 3362 be updated with this route as follows: if the NLRI of the new route 3363 is identical to the one of the route currently stored in the Adj-RIB- 3364 In, then the new route SHALL replace the older route in the Adj-RIB- 3365 In, thus implicitly withdrawing the older route from service. Other- 3366 wise, if the Adj-RIB-In has no route with NLRI identical to the new 3367 route, the new route SHALL be placed in the Adj-RIB-In. 3369 Once the BGP speaker updates the Adj-RIB-In, the speaker SHALL run 3370 its Decision Process. 3372 RFC DRAFT September 2003 3374 9.1 Decision Process 3376 The Decision Process selects routes for subsequent advertisement by 3377 applying the policies in the local Policy Information Base (PIB) to 3378 the routes stored in its Adj-RIBs-In. The output of the Decision Pro- 3379 cess is the set of routes that will be advertised to peers; the 3380 selected routes will be stored in the local speaker's Adj-RIBs-Out 3381 according to policy. 3383 The BGP Decision Process described here is conceptual, and does not 3384 have to be implemented precisely as described here, as long as the 3385 implementations support the described functionality and their exter- 3386 nally visible behavior is the same. 3388 The selection process is formalized by defining a function that takes 3389 the attribute of a given route as an argument and returns either (a) 3390 a non-negative integer denoting the degree of preference for the 3391 route, or (b) a value denoting that this route is ineligible to be 3392 installed in Loc-RIB and will be excluded from the next phase of 3393 route selection. 3395 The function that calculates the degree of preference for a given 3396 route SHALL NOT use as its inputs any of the following: the existence 3397 of other routes, the non-existence of other routes, or the path 3398 attributes of other routes. Route selection then consists of individ- 3399 ual application of the degree of preference function to each feasible 3400 route, followed by the choice of the one with the highest degree of 3401 preference. 3403 The Decision Process operates on routes contained in the Adj-RIBs-In, 3404 and is responsible for: 3406 - selection of routes to be used locally by the speaker 3408 - selection of routes to be advertised to other BGP peers 3410 - route aggregation and route information reduction 3412 The Decision Process takes place in three distinct phases, each trig- 3413 gered by a different event: 3415 a) Phase 1 is responsible for calculating the degree of preference 3416 for each route received from a peer. 3418 b) Phase 2 is invoked on completion of phase 1. It is responsible 3419 for choosing the best route out of all those available for each 3420 distinct destination, and for installing each chosen route into 3421 RFC DRAFT September 2003 3423 the Loc-RIB. 3425 c) Phase 3 is invoked after the Loc-RIB has been modified. It is 3426 responsible for disseminating routes in the Loc-RIB to each peer, 3427 according to the policies contained in the PIB. Route aggregation 3428 and information reduction can optionally be performed within this 3429 phase. 3431 9.1.1 Phase 1: Calculation of Degree of Preference 3433 The Phase 1 decision function is invoked whenever the local BGP 3434 speaker receives from a peer an UPDATE message that advertises a new 3435 route, a replacement route, or withdrawn routes. 3437 The Phase 1 decision function is a separate process which completes 3438 when it has no further work to do. 3440 The Phase 1 decision function locks an Adj-RIB-In prior to operating 3441 on any route contained within it, and unlocks it after operating on 3442 all new or unfeasible routes contained within it. 3444 For each newly received or replacement feasible route, the local BGP 3445 speaker determines a degree of preference as follows: 3447 If the route is learned from an internal peer, either the value of 3448 the LOCAL_PREF attribute is taken as the degree of preference, or 3449 the local system computes the degree of preference of the route 3450 based on preconfigured policy information. Note that the latter 3451 (computing the degree of preference based on preconfigured policy 3452 information) may result in formation of persistent routing loops. 3454 If the route is learned from an external peer, then the local BGP 3455 speaker computes the degree of preference based on preconfigured 3456 policy information. If the return value indicates that the route 3457 is ineligible, the route MAY NOT serve as an input to the next 3458 phase of route selection; otherwise the return value MUST be used 3459 as the LOCAL_PREF value in any IBGP readvertisement. 3461 The exact nature of this policy information and the computation 3462 involved is a local matter. 3464 9.1.2 Phase 2: Route Selection 3466 The Phase 2 decision function is invoked on completion of Phase 1. 3468 RFC DRAFT September 2003 3470 The Phase 2 function is a separate process which completes when it 3471 has no further work to do. The Phase 2 process considers all routes 3472 that are eligible in the Adj-RIBs-In. 3474 The Phase 2 decision function is blocked from running while the Phase 3475 3 decision function is in process. The Phase 2 function locks all 3476 Adj-RIBs-In prior to commencing its function, and unlocks them on 3477 completion. 3479 If the NEXT_HOP attribute of a BGP route depicts an address that is 3480 not resolvable, or it would become unresolvable if the route was 3481 installed in the routing table the BGP route MUST be excluded from 3482 the Phase 2 decision function. 3484 If the AS_PATH attribute of a BGP route contains an AS loop, the BGP 3485 route should be excluded from the Phase 2 decision function. AS loop 3486 detection is done by scanning the full AS path (as specified in the 3487 AS_PATH attribute), and checking that the autonomous system number of 3488 the local system does not appear in the AS path. Operations of a BGP 3489 speaker that is configured to accept routes with its own autonomous 3490 system number in the AS path are outside the scope of this document. 3492 It is critical that BGP speakers within an AS do not make conflicting 3493 decisions regarding route selection that would cause forwarding loops 3494 to occur. 3496 For each set of destinations for which a feasible route exists in the 3497 Adj-RIBs-In, the local BGP speaker identifies the route that has: 3499 a) the highest degree of preference of any route to the same set 3500 of destinations, or 3502 b) is the only route to that destination, or 3504 c) is selected as a result of the Phase 2 tie breaking rules spec- 3505 ified in 9.1.2.2. 3507 The local speaker SHALL then install that route in the Loc-RIB, 3508 replacing any route to the same destination that is currently being 3509 held in the Loc-RIB. When the new BGP route is installed in the Rout- 3510 ing Table, care must be taken to ensure that existing routes to the 3511 same destination that are now considered invalid are removed from the 3512 Routing Table. Whether or not the new BGP route replaces an existing 3513 non-BGP route in the Routing Table depends on the policy configured 3514 on the BGP speaker. 3516 The local speaker MUST determine the immediate next-hop address from 3517 the NEXT_HOP attribute of the selected route (see Section 5.1.3). If 3518 RFC DRAFT September 2003 3520 either the immediate next hop or the IGP cost to the NEXT_HOP (where 3521 the NEXT_HOP is resolved through an IGP route) changes, Phase 2 Route 3522 Selection MUST be performed again. 3524 Notice that even though BGP routes do not have to be installed in the 3525 Routing Table with the immediate next hop(s), implementations MUST 3526 take care that before any packets are forwarded along a BGP route, 3527 its associated NEXT_HOP address is resolved to the immediate 3528 (directly connected) next-hop address and this address (or multiple 3529 addresses) is finally used for actual packet forwarding. 3531 Unresolvable routes SHALL be removed from the Loc-RIB and the routing 3532 table. However, corresponding unresolvable routes SHOULD be kept in 3533 the Adj-RIBs-In (in case they become resolvable). 3535 9.1.2.1 Route Resolvability Condition 3537 As indicated in Section 9.1.2, BGP speakers SHOULD exclude unresolv- 3538 able routes from the Phase 2 decision. This ensures that only valid 3539 routes are installed in Loc-RIB and the Routing Table. 3541 The route resolvability condition is defined as follows. 3543 1. A route Rte1, referencing only the intermediate network 3544 address, is considered resolvable if the Routing Table contains at 3545 least one resolvable route Rte2 that matches Rte1's intermediate 3546 network address and is not recursively resolved (directly or indi- 3547 rectly) through Rte1. If multiple matching routes are available, 3548 only the longest matching route SHOULD be considered. 3550 2. Routes referencing interfaces (with or without intermediate 3551 addresses) are considered resolvable if the state of the refer- 3552 enced interface is up and IP processing is enabled on this inter- 3553 face. 3555 BGP routes do not refer to interfaces, but can be resolved through 3556 the routes in the Routing Table that can be of both types (those that 3557 specify interfaces or those that do not). IGP routes and routes to 3558 directly connected networks are expected to specify the outbound 3559 interface. Static routes can specify the outbound interface, or the 3560 intermediate address, or both. 3562 Note that a BGP route is considered unresolvable not only in situa- 3563 tions where the BGP speaker's Routing Table contains no route match- 3564 ing the BGP route's NEXT_HOP. Mutually recursive routes (routes 3565 resolving each other or themselves), also fail the resolvability 3566 RFC DRAFT September 2003 3568 check. 3570 It is also important that implementations do not consider feasible 3571 routes that would become unresolvable if they were installed in the 3572 Routing Table even if their NEXT_HOPs are resolvable using the cur- 3573 rent contents of the Routing Table (an example of such routes would 3574 be mutually recursive routes). This check ensures that a BGP speaker 3575 does not install in the Routing Table routes that will be removed and 3576 not used by the speaker. Therefore, in addition to local Routing Ta- 3577 ble stability, this check also improves behavior of the protocol in 3578 the network. 3580 Whenever a BGP speaker identifies a route that fails the resolvabil- 3581 ity check because of mutual recursion, an error message SHOULD be 3582 logged. 3584 9.1.2.2 Breaking Ties (Phase 2) 3586 In its Adj-RIBs-In a BGP speaker may have several routes to the same 3587 destination that have the same degree of preference. The local 3588 speaker can select only one of these routes for inclusion in the 3589 associated Loc-RIB. The local speaker considers all routes with the 3590 same degrees of preference, both those received from internal peers, 3591 and those received from external peers. 3593 The following tie-breaking procedure assumes that for each candidate 3594 route all the BGP speakers within an autonomous system can ascertain 3595 the cost of a path (interior distance) to the address depicted by the 3596 NEXT_HOP attribute of the route, and follow the same route selection 3597 algorithm. 3599 The tie-breaking algorithm begins by considering all equally prefer- 3600 able routes to the same destination, and then selects routes to be 3601 removed from consideration. The algorithm terminates as soon as only 3602 one route remains in consideration. The criteria MUST be applied in 3603 the order specified. 3605 Several of the criteria are described using pseudo-code. Note that 3606 the pseudo-code shown was chosen for clarity, not efficiency. It is 3607 not intended to specify any particular implementation. BGP implemen- 3608 tations MAY use any algorithm which produces the same results as 3609 those described here. 3611 a) Remove from consideration all routes which are not tied for 3612 having the smallest number of AS numbers present in their AS_PATH 3613 attributes. Note, that when counting this number, an AS_SET counts 3614 RFC DRAFT September 2003 3616 as 1, no matter how many ASs are in the set. 3618 b) Remove from consideration all routes which are not tied for 3619 having the lowest Origin number in their Origin attribute. 3621 c) Remove from consideration routes with less-preferred 3622 MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable 3623 between routes learned from the same neighboring AS (the neighbor- 3624 ing AS is determined from the AS_PATH attribute). Routes which do 3625 not have the MULTI_EXIT_DISC attribute are considered to have the 3626 lowest possible MULTI_EXIT_DISC value. 3628 This is also described in the following procedure: 3630 for m = all routes still under consideration 3631 for n = all routes still under consideration 3632 if (neighborAS(m) == neighborAS(n)) and (MED(n) < MED(m)) 3633 remove route m from consideration 3635 In the pseudo-code above, MED(n) is a function which returns the 3636 value of route n's MULTI_EXIT_DISC attribute. If route n has no 3637 MULTI_EXIT_DISC attribute, the function returns the lowest possi- 3638 ble MULTI_EXIT_DISC value, i.e. 0. 3640 Similarly, neighborAS(n) is a function which returns the neighbor 3641 AS from which the route was received. If the route is learned via 3642 IBGP, and the other IBGP speaker didn't originate the route, it is 3643 the neighbor AS from which the other IBGP speaker learned the 3644 route. If the route is learned via IBGP, and the other IBGP 3645 speaker originated the route, it is the local AS. 3647 If a MULTI_EXIT_DISC attribute is removed before re-advertising a 3648 route into IBGP, then comparison based on the received EBGP 3649 MULTI_EXIT_DISC attribute MAY still be performed. If an implemen- 3650 tation chooses to remove MULTI_EXIT_DISC, then the optional com- 3651 parison on MULTI_EXIT_DISC if performed at all MUST be performed 3652 only among EBGP learned routes. The best EBGP learned route may 3653 then be compared with IBGP learned routes after the removal of the 3654 MULTI_EXIT_DISC attribute. If MULTI_EXIT_DISC is removed from a 3655 subset of EBGP learned routes and the selected "best" EBGP learned 3656 route will not have MULTI_EXIT_DISC removed, then the 3657 MULTI_EXIT_DISC must be used in the comparison with IBGP learned 3658 routes. For IBGP learned routes the MULTI_EXIT_DISC MUST be used 3659 in route comparisons which reach this step in the Decision Pro- 3660 cess. Including the MULTI_EXIT_DISC of an EBGP learned route in 3661 the comparison with an IBGP learned route, then removing the 3662 MULTI_EXIT_DISC attribute and advertising the route has been 3663 proven to cause route loops. 3665 RFC DRAFT September 2003 3667 d) If at least one of the candidate routes was received via EBGP, 3668 remove from consideration all routes which were received via IBGP. 3670 e) Remove from consideration any routes with less-preferred inte- 3671 rior cost. The interior cost of a route is determined by calcu- 3672 lating the metric to the NEXT_HOP for the route using the Routing 3673 Table. If the NEXT_HOP hop for a route is reachable, but no cost 3674 can be determined, then this step should be skipped (equivalently, 3675 consider all routes to have equal costs). 3677 This is also described in the following procedure. 3679 for m = all routes still under consideration 3680 for n = all routes in still under consideration 3681 if (cost(n) is lower than cost(m)) 3682 remove m from consideration 3684 In the pseudo-code above, cost(n) is a function which returns the 3685 cost of the path (interior distance) to the address given in the 3686 NEXT_HOP attribute of the route. 3688 f) Remove from consideration all routes other than the route that 3689 was advertised by the BGP speaker whose BGP Identifier has the 3690 lowest value. 3692 g) Prefer the route received from the lowest peer address. 3694 9.1.3 Phase 3: Route Dissemination 3696 The Phase 3 decision function is invoked on completion of Phase 2, or 3697 when any of the following events occur: 3699 a) when routes in the Loc-RIB to local destinations have changed 3701 b) when locally generated routes learned by means outside of BGP 3702 have changed 3704 c) when a new BGP speaker - BGP speaker connection has been estab- 3705 lished 3707 The Phase 3 function is a separate process which completes when it 3708 has no further work to do. The Phase 3 Routing Decision function is 3709 blocked from running while the Phase 2 decision function is in pro- 3710 cess. 3712 All routes in the Loc-RIB are processed into Adj-RIBs-Out according 3713 RFC DRAFT September 2003 3715 to configured policy. This policy MAY exclude a route in the Loc-RIB 3716 from being installed in a particular Adj-RIB-Out. A route SHALL NOT 3717 be installed in the Adj-Rib-Out unless the destination and NEXT_HOP 3718 described by this route may be forwarded appropriately by the Routing 3719 Table. If a route in Loc-RIB is excluded from a particular Adj-RIB- 3720 Out the previously advertised route in that Adj-RIB-Out MUST be with- 3721 drawn from service by means of an UPDATE message (see 9.2). 3723 Route aggregation and information reduction techniques (see 9.2.2.1) 3724 may optionally be applied. 3726 Any local policy which results in routes being added to an Adj-RIB- 3727 Out without also being added to the local BGP speaker's forwarding 3728 table, is outside the scope of this document. 3730 When the updating of the Adj-RIBs-Out and the Routing Table is com- 3731 plete, the local BGP speaker runs the Update-Send process of 9.2. 3733 9.1.4 Overlapping Routes 3735 A BGP speaker may transmit routes with overlapping Network Layer 3736 Reachability Information (NLRI) to another BGP speaker. NLRI overlap 3737 occurs when a set of destinations are identified in non-matching mul- 3738 tiple routes. Since BGP encodes NLRI using IP prefixes, overlap will 3739 always exhibit subset relationships. A route describing a smaller 3740 set of destinations (a longer prefix) is said to be more specific 3741 than a route describing a larger set of destinations (a shorter pre- 3742 fix); similarly, a route describing a larger set of destinations is 3743 said to be less specific than a route describing a smaller set of 3744 destinations. 3746 The precedence relationship effectively decomposes less specific 3747 routes into two parts: 3749 - a set of destinations described only by the less specific route, 3750 and 3752 - a set of destinations described by the overlap of the less spe- 3753 cific and the more specific routes 3755 The set of destinations described by the overlap represents a portion 3756 of the less specific route that is feasible, but is not currently in 3757 use. If a more specific route is later withdrawn, the set of desti- 3758 nations described by the overlap will still be reachable using the 3759 less specific route. 3761 RFC DRAFT September 2003 3763 If a BGP speaker receives overlapping routes, the Decision Process 3764 MUST consider both routes based on the configured acceptance policy. 3765 If both a less and a more specific route are accepted, then the Deci- 3766 sion Process MUST either install in Loc-RIB both the less and the 3767 more specific routes or it MUST aggregate the two routes and install 3768 in Loc-RIB the aggregated route, provided that both routes have the 3769 same value of the NEXT_HOP attribute. 3771 If a BGP speaker chooses to aggregate, then it SHOULD either include 3772 all AS used to form the aggregate in an AS_SET or add the 3773 ATOMIC_AGGREGATE attribute to the route. This attribute is now pri- 3774 marily informational. With the elimination of IP routing protocols 3775 that do not support classless routing and the elimination of router 3776 and host implementations that do not support classless routing, there 3777 is no longer a need to de-aggregate. Routes SHOULD NOT be de-aggre- 3778 gated. A route that carries ATOMIC_AGGREGATE attribute in particular 3779 MUST NOT be de-aggregated. That is, the NLRI of this route can not be 3780 made more specific. Forwarding along such a route does not guarantee 3781 that IP packets will actually traverse only ASs listed in the AS_PATH 3782 attribute of the route. 3784 9.2 Update-Send Process 3786 The Update-Send process is responsible for advertising UPDATE mes- 3787 sages to all peers. For example, it distributes the routes chosen by 3788 the Decision Process to other BGP speakers which may be located in 3789 either the same autonomous system or a neighboring autonomous system. 3791 When a BGP speaker receives an UPDATE message from an internal peer, 3792 the receiving BGP speaker SHALL NOT re-distribute the routing infor- 3793 mation contained in that UPDATE message to other internal peers 3794 (unless the speaker acts as a BGP Route Reflector [RFC2796]). 3796 As part of Phase 3 of the route selection process, the BGP speaker 3797 has updated its Adj-RIBs-Out. All newly installed routes and all 3798 newly unfeasible routes for which there is no replacement route SHALL 3799 be advertised to its peers by means of an UPDATE message. 3801 A BGP speaker SHOULD NOT advertise a given feasible BGP route from 3802 its Adj-RIB-Out if it would produce an UPDATE message containing the 3803 same BGP route as was previously advertised. 3805 Any routes in the Loc-RIB marked as unfeasible SHALL be removed. 3806 Changes to the reachable destinations within its own autonomous sys- 3807 tem SHALL also be advertised in an UPDATE message. 3809 RFC DRAFT September 2003 3811 If due to the limits on the maximum size of an UPDATE message (see 3812 Section 4) a single route doesn't fit into the message, the BGP 3813 speaker MUST not advertise the route to its peers and MAY choose to 3814 log an error locally. 3816 9.2.1 Controlling Routing Traffic Overhead 3818 The BGP protocol constrains the amount of routing traffic (that is, 3819 UPDATE messages) in order to limit both the link bandwidth needed to 3820 advertise UPDATE messages and the processing power needed by the 3821 Decision Process to digest the information contained in the UPDATE 3822 messages. 3824 9.2.1.1 Frequency of Route Advertisement 3826 The parameter MinRouteAdvertisementIntervalTimer determines the mini- 3827 mum amount of time that must elapse between advertisement and/or 3828 withdrawal of routes to a particular destination by a BGP speaker to 3829 a peer. This rate limiting procedure applies on a per-destination 3830 basis, although the value of MinRouteAdvertisementIntervalTimer is 3831 set on a per BGP peer basis. 3833 Two UPDATE messages sent by a BGP speaker to a peer that advertise 3834 feasible routes and/or withdrawal of unfeasible routes to some common 3835 set of destinations MUST be separated by at least MinRouteAdvertise- 3836 mentIntervalTimer. Clearly, this can only be achieved precisely by 3837 keeping a separate timer for each common set of destinations. This 3838 would be unwarranted overhead. Any technique which ensures that the 3839 interval between two UPDATE messages sent from a BGP speaker to a 3840 peer that advertise feasible routes and/or withdrawal of unfeasible 3841 routes to some common set of destinations will be at least Min- 3842 RouteAdvertisementIntervalTimer, and will also ensure a constant 3843 upper bound on the interval is acceptable. 3845 Since fast convergence is needed within an autonomous system, either 3846 (a) the MinRouteAdvertisementIntervalTimer used for internal peers 3847 SHOULD be shorter than the MinRouteAdvertisementIntervalTimer used 3848 for external peers, or (b) the procedure describe in this section 3849 SHOULD NOT apply for routes sent to internal peers. 3851 This procedure does not limit the rate of route selection, but only 3852 the rate of route advertisement. If new routes are selected multiple 3853 RFC DRAFT September 2003 3855 times while awaiting the expiration of MinRouteAdvertisementInterval- 3856 Timer, the last route selected SHALL be advertised at the end of Min- 3857 RouteAdvertisementIntervalTimer. 3859 9.2.1.2 Frequency of Route Origination 3861 The parameter MinASOriginationIntervalTimer determines the minimum 3862 amount of time that must elapse between successive advertisements of 3863 UPDATE messages that report changes within the advertising BGP 3864 speaker's own autonomous systems. 3866 9.2.2 Efficient Organization of Routing Information 3868 Having selected the routing information which it will advertise, a 3869 BGP speaker may avail itself of several methods to organize this 3870 information in an efficient manner. 3872 9.2.2.1 Information Reduction 3874 Information reduction may imply a reduction in granularity of policy 3875 control - after information is collapsed, the same policies will 3876 apply to all destinations and paths in the equivalence class. 3878 The Decision Process may optionally reduce the amount of information 3879 that it will place in the Adj-RIBs-Out by any of the following meth- 3880 ods: 3882 a) Network Layer Reachability Information (NLRI): 3884 Destination IP addresses can be represented as IP address pre- 3885 fixes. In cases where there is a correspondence between the 3886 address structure and the systems under control of an autonomous 3887 system administrator, it will be possible to reduce the size of 3888 the NLRI carried in the UPDATE messages. 3890 b) AS_PATHs: 3892 AS path information can be represented as ordered AS_SEQUENCEs or 3893 unordered AS_SETs. AS_SETs are used in the route aggregation algo- 3894 rithm described in 9.2.2.2. They reduce the size of the AS_PATH 3895 information by listing each AS number only once, regardless of how 3896 many times it may have appeared in multiple AS_PATHs that were 3897 RFC DRAFT September 2003 3899 aggregated. 3901 An AS_SET implies that the destinations listed in the NLRI can be 3902 reached through paths that traverse at least some of the con- 3903 stituent autonomous systems. AS_SETs provide sufficient informa- 3904 tion to avoid routing information looping; however their use may 3905 prune potentially feasible paths, since such paths are no longer 3906 listed individually as in the form of AS_SEQUENCEs. In practice 3907 this is not likely to be a problem, since once an IP packet 3908 arrives at the edge of a group of autonomous systems, the BGP 3909 speaker at that point is likely to have more detailed path infor- 3910 mation and can distinguish individual paths to destinations. 3912 9.2.2.2 Aggregating Routing Information 3914 Aggregation is the process of combining the characteristics of sev- 3915 eral different routes in such a way that a single route can be adver- 3916 tised. Aggregation can occur as part of the Decision Process to 3917 reduce the amount of routing information that will be placed in the 3918 Adj-RIBs-Out. 3920 Aggregation reduces the amount of information that a BGP speaker must 3921 store and exchange with other BGP speakers. Routes can be aggregated 3922 by applying the following procedure separately to path attributes of 3923 the same type and to the Network Layer Reachability Information. 3925 Routes that have different MULTI_EXIT_DISC attribute SHALL NOT be 3926 aggregated. 3928 Path attributes that have different type codes can not be aggregated 3929 together. Path attributes of the same type code may be aggregated, 3930 according to the following rules: 3932 NEXT_HOP: 3933 When aggregating routes that have different NEXT_HOP attribute, 3934 the NEXT_HOP attribute of the aggregated route SHALL identify 3935 an interface on the BGP speaker that performs the aggregation. 3937 ORIGIN attribute: 3938 If at least one route among routes that are aggregated has ORI- 3939 GIN with the value INCOMPLETE, then the aggregated route MUST 3940 have the ORIGIN attribute with the value INCOMPLETE. Other- 3941 wise, if at least one route among routes that are aggregated 3942 has ORIGIN with the value EGP, then the aggregated route MUST 3943 have the ORIGIN attribute with the value EGP. In all other 3944 cases the value of the ORIGIN attribute of the aggregated route 3945 RFC DRAFT September 2003 3947 is IGP. 3949 AS_PATH attribute: 3950 If routes to be aggregated have identical AS_PATH attributes, 3951 then the aggregated route has the same AS_PATH attribute as 3952 each individual route. 3954 For the purpose of aggregating AS_PATH attributes we model each 3955 AS within the AS_PATH attribute as a tuple , where 3956 "type" identifies a type of the path segment the AS belongs to 3957 (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If 3958 the routes to be aggregated have different AS_PATH attributes, 3959 then the aggregated AS_PATH attribute SHALL satisfy all of the 3960 following conditions: 3962 - all tuples of type AS_SEQUENCE in the aggregated AS_PATH 3963 SHALL appear in all of the AS_PATH in the initial set of 3964 routes to be aggregated. 3966 - all tuples of type AS_SET in the aggregated AS_PATH SHALL 3967 appear in at least one of the AS_PATH in the initial set 3968 (they may appear as either AS_SET or AS_SEQUENCE types). 3970 - for any tuple X of type AS_SEQUENCE in the aggregated 3971 AS_PATH which precedes tuple Y in the aggregated AS_PATH, X 3972 precedes Y in each AS_PATH in the initial set which contains 3973 Y, regardless of the type of Y. 3975 - No tuple of type AS_SET with the same value SHALL appear 3976 more than once in the aggregated AS_PATH. 3978 - Multiple tuples of type AS_SEQUENCE with the same value 3979 may appear in the aggregated AS_PATH only when adjacent to 3980 another tuple of the same type and value. 3982 An implementation may choose any algorithm which conforms to 3983 these rules. At a minimum a conformant implementation SHALL be 3984 able to perform the following algorithm that meets all of the 3985 above conditions: 3987 - determine the longest leading sequence of tuples (as 3988 defined above) common to all the AS_PATH attributes of the 3989 routes to be aggregated. Make this sequence the leading 3990 sequence of the aggregated AS_PATH attribute. 3992 - set the type of the rest of the tuples from the AS_PATH 3993 attributes of the routes to be aggregated to AS_SET, and 3994 append them to the aggregated AS_PATH attribute. 3996 RFC DRAFT September 2003 3998 - if the aggregated AS_PATH has more than one tuple with the 3999 same value (regardless of tuple's type), eliminate all, but 4000 one such tuple by deleting tuples of the type AS_SET from 4001 the aggregated AS_PATH attribute. 4003 - for each pair of adjacent tuples in the aggregated 4004 AS_PATH, if both tuples have the same type, merge them 4005 together, as long as doing so will not cause a segment with 4006 length greater than 255 to be generated. 4008 Appendix F, Section F.6 presents another algorithm that satis- 4009 fies the conditions and allows for more complex policy configu- 4010 rations. 4012 ATOMIC_AGGREGATE: 4013 If at least one of the routes to be aggregated has 4014 ATOMIC_AGGREGATE path attribute, then the aggregated route 4015 SHALL have this attribute as well. 4017 AGGREGATOR: 4018 Any AGGREGATOR attributes from the routes to be aggregated MUST 4019 NOT be included in the aggregated route. The BGP speaker per- 4020 forming the route aggregation MAY attach a new AGGREGATOR 4021 attribute (see Section 5.1.7). 4023 9.3 Route Selection Criteria 4025 Generally speaking, additional rules for comparing routes among sev- 4026 eral alternatives are outside the scope of this document. There are 4027 two exceptions: 4029 - If the local AS appears in the AS path of the new route being 4030 considered, then that new route can not be viewed as better than 4031 any other route (provided that the speaker is configured to accept 4032 such routes). If such a route were ever used, a routing loop could 4033 result. 4035 - In order to achieve successful distributed operation, only 4036 routes with a likelihood of stability can be chosen. Thus, an AS 4037 SHOULD avoid using unstable routes, and it SHOULD NOT make rapid 4038 spontaneous changes to its choice of route. Quantifying the terms 4039 "unstable" and "rapid" in the previous sentence will require expe- 4040 rience, but the principle is clear. Routes that are unstable can 4041 be "penalized" (e.g., by using the procedures described in 4042 [RFC2439]). 4044 RFC DRAFT September 2003 4046 9.4 Originating BGP routes 4048 A BGP speaker may originate BGP routes by injecting routing informa- 4049 tion acquired by some other means (e.g. via an IGP) into BGP. A BGP 4050 speaker that originates BGP routes assigns the degree of preference 4051 (e.g., via CLI) to these routes by passing them through the Decision 4052 Process (see Section 9.1). These routes MAY also be distributed to 4053 other BGP speakers within the local AS as part of the update process 4054 (see Section 9.2). The decision whether to distribute non-BGP 4055 acquired routes within an AS via BGP or not depends on the environ- 4056 ment within the AS (e.g. type of IGP) and SHOULD be controlled via 4057 configuration. 4059 10 BGP Timers 4061 BGP employs five timers: ConnectRetryTimer (see Section 8), HoldTimer 4062 (see Section 4.2), KeepAliveTimer (see Section 8), MinASOrigination- 4063 IntervalTimer (see Section 9.2.1.2), and MinRouteAdvertisementInter- 4064 valTimer (see Section 9.2.1.1). 4066 Two optional timers MAY be supported: DelayOpenTimer, IdleHoldTimer 4067 by BGP (see section 8). Section 8 describes their use. The full oper- 4068 ation of these optional timers is outside the scope of this document. 4070 ConnectRetryTime is a mandatory FSM attribute that stores the initial 4071 value for the ConnectRetryTimer. The suggested default value for the 4072 ConnectRetryTime is 120 seconds. 4074 Holdtime is a mandatory FSM attribute that stores the initial value 4075 for the HoldTimer. The suggested default value for the HoldTime is 90 4076 seconds. 4078 During some portions of the state machine (see Section 8), the Hold- 4079 Timer is set to a large value. The suggested default for this large 4080 value is 4 minutes. 4082 The KeepaliveTime is a mandatory FSM attribute that stores the ini- 4083 tial value for the KeepaliveTimer. The suggested default value for 4084 the KeepaliveTime is 1/3 of the HoldTime. 4086 The suggested default value for the MinASOriginationIntervalTimer is 4087 15 seconds. 4089 The suggested default value for the MinRouteAdvertisementInterval- 4090 Timer on EBGP connections is 30 seconds. 4092 RFC DRAFT September 2003 4094 The suggested default value for the MinRouteAdvertisementInterval- 4095 Timer on IBGP connections is 5 seconds. 4097 An implementation of BGP MUST allow the HoldTimer to be configurable 4098 on a per peer basis, and MAY allow the other timers to be config- 4099 urable. 4101 To minimize the likelihood that the distribution of BGP messages by a 4102 given BGP speaker will contain peaks, jitter SHOULD be applied to the 4103 timers associated with MinASOriginationIntervalTimer, KeepAliveTimer, 4104 MinRouteAdvertisementIntervalTimer, and ConnectRetryTimer. A given 4105 BGP speaker MAY apply the same jitter to each of these quantities 4106 regardless of the destinations to which the updates are being sent; 4107 that is, jitter need not be configured on a "per peer" basis. 4109 The suggested default amount of jitter SHALL be determined by multi- 4110 plying the base value of the appropriate timer by a random factor 4111 which is uniformly distributed in the range from 0.75 to 1.0. A new 4112 random value SHOULD be picked each time the timer is set. The range 4113 of the jitter random value MAY be configurable. 4115 Appendix A. Comparison with RFC1771 4117 There are numerous editorial changes (too many to list here). 4119 The following list the technical changes: 4121 Changes to reflect the usages of such features as TCP MD5 4122 [RFC2385], BGP Route Reflectors [RFC2796], BGP Confederations 4123 [RFC3065], and BGP Route Refresh [RFC2918]. 4125 Clarification on the use of the BGP Identifier in the AGGREGATOR 4126 attribute. 4128 Procedures for imposing an upper bound on the number of prefixes 4129 that a BGP speaker would accept from a peer. 4131 The ability of a BGP speaker to include more than one instance of 4132 its own AS in the AS_PATH attribute for the purpose of inter-AS 4133 traffic engineering. 4135 Clarifications on the various types of NEXT_HOPs. 4137 Clarifications to the use of the ATOMIC_AGGREGATE attribute. 4139 The relationship between the immediate next hop, and the next hop 4140 as specified in the NEXT_HOP path attribute. 4142 RFC DRAFT September 2003 4144 Clarifications on the tie-breaking procedures. 4146 Clarifications on the frequency of route advertisements. 4148 Optional Parameter Type 1 (Authentication Information) has been 4149 deprecated. 4151 UPDATE Message Error subcode 7 (AS Routing Loop) has been depre- 4152 cated. 4154 OPEN Message Error subcode 5 (Authentication Failure) has been 4155 deprecated. 4157 Use of the Marker field for authentication has been deprecated. 4159 Implementations MUST support TCP MD5 [RFC2385] for authentication. 4161 Clarification of BGP FSM. 4163 Appendix B. Comparison with RFC1267 4165 All the changes listed in Appendix A, plus the following. 4167 BGP-4 is capable of operating in an environment where a set of reach- 4168 able destinations may be expressed via a single IP prefix. The con- 4169 cept of network classes, or subnetting is foreign to BGP-4. To 4170 accommodate these capabilities BGP-4 changes semantics and encoding 4171 associated with the AS_PATH attribute. New text has been added to 4172 define semantics associated with IP prefixes. These abilities allow 4173 BGP-4 to support the proposed supernetting scheme [9]. 4175 To simplify configuration this version introduces a new attribute, 4176 LOCAL_PREF, that facilitates route selection procedures. 4178 The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. 4179 A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that 4180 certain aggregates are not de-aggregated. Another new attribute, 4181 AGGREGATOR, can be added to aggregate routes in order to advertise 4182 which AS and which BGP speaker within that AS caused the aggregation. 4184 To insure that Hold Timers are symmetric, the Hold Timer is now nego- 4185 tiated on a per-connection basis. Hold Timers of zero are now sup- 4186 ported. 4188 RFC DRAFT September 2003 4190 Appendix C. Comparison with RFC 1163 4192 All of the changes listed in Appendices A and B, plus the following. 4194 To detect and recover from BGP connection collision, a new field (BGP 4195 Identifier) has been added to the OPEN message. New text (Section 4196 6.8) has been added to specify the procedure for detecting and recov- 4197 ering from collision. 4199 The new document no longer restricts the router that is passed in the 4200 NEXT_HOP path attribute to be part of the same Autonomous System as 4201 the BGP Speaker. 4203 New document optimizes and simplifies the exchange of the information 4204 about previously reachable routes. 4206 Appendix D. Comparison with RFC 1105 4208 All of the changes listed in Appendices A, B and C, plus the follow- 4209 ing. 4211 Minor changes to the RFC1105 Finite State Machine were necessary to 4212 accommodate the TCP user interface provided by 4.3 BSD. 4214 The notion of Up/Down/Horizontal relations present in RFC1105 has 4215 been removed from the protocol. 4217 The changes in the message format from RFC1105 are as follows: 4219 1. The Hold Time field has been removed from the BGP header and 4220 added to the OPEN message. 4222 2. The version field has been removed from the BGP header and 4223 added to the OPEN message. 4225 3. The Link Type field has been removed from the OPEN message. 4227 4. The OPEN CONFIRM message has been eliminated and replaced with 4228 implicit confirmation provided by the KEEPALIVE message. 4230 5. The format of the UPDATE message has been changed signifi- 4231 cantly. New fields were added to the UPDATE message to support 4232 multiple path attributes. 4234 6. The Marker field has been expanded and its role broadened to 4235 RFC DRAFT September 2003 4237 support authentication. 4239 Note that quite often BGP, as specified in RFC 1105, is referred 4240 to as BGP-1, BGP, as specified in RFC 1163, is referred to as 4241 BGP-2, BGP, as specified in RFC1267 is referred to as BGP-3, and 4242 BGP, as specified in this document is referred to as BGP-4. 4244 Appendix E. TCP options that may be used with BGP 4246 If a local system TCP user interface supports TCP PUSH function, then 4247 each BGP message SHOULD be transmitted with PUSH flag set. Setting 4248 PUSH flag forces BGP messages to be transmitted promptly to the 4249 receiver. 4251 If a local system TCP user interface supports setting of the DSCP 4252 field [RFC2474] for TCP connections, then the TCP connection used by 4253 BGP SHOULD be opened with bits 0-2 of the DSCP field set to 110 4254 (binary). 4256 Appendix F. Implementation Recommendations 4258 This section presents some implementation recommendations. 4260 Appendix F.1 Multiple Networks Per Message 4262 The BGP protocol allows for multiple address prefixes with the same 4263 path attributes to be specified in one message. Making use of this 4264 capability is highly recommended. With one address prefix per message 4265 there is a substantial increase in overhead in the receiver. Not only 4266 does the system overhead increase due to the reception of multiple 4267 messages, but the overhead of scanning the routing table for updates 4268 to BGP peers and other routing protocols (and sending the associated 4269 messages) is incurred multiple times as well. 4271 One method of building messages containing many address prefixes per 4272 a path attribute set from a routing table that is not organized on a 4273 per path attribute set basis is to build many messages as the routing 4274 table is scanned. As each address prefix is processed, a message for 4275 the associated set of path attributes is allocated, if it does not 4276 exist, and the new address prefix is added to it. If such a message 4277 exists, the new address prefix is just appended to it. If the message 4278 lacks the space to hold the new address prefix, it is transmitted, a 4279 RFC DRAFT September 2003 4281 new message is allocated, and the new address prefix is inserted into 4282 the new message. When the entire routing table has been scanned, all 4283 allocated messages are sent and their resources released. Maximum 4284 compression is achieved when all the destinations covered by the 4285 address prefixes share a common set of path attributes making it pos- 4286 sible to send many address prefixes in one 4096-byte message. 4288 When peering with a BGP implementation that does not compress multi- 4289 ple address prefixes into one message, it may be necessary to take 4290 steps to reduce the overhead from the flood of data received when a 4291 peer is acquired or a significant network topology change occurs. One 4292 method of doing this is to limit the rate of updates. This will 4293 eliminate the redundant scanning of the routing table to provide 4294 flash updates for BGP peers and other routing protocols. A disadvan- 4295 tage of this approach is that it increases the propagation latency of 4296 routing information. By choosing a minimum flash update interval 4297 that is not much greater than the time it takes to process the multi- 4298 ple messages this latency should be minimized. A better method would 4299 be to read all received messages before sending updates. 4301 Appendix F.2 Reducing route flapping 4303 To avoid excessive route flapping a BGP speaker which needs to with- 4304 draw a destination and send an update about a more specific or less 4305 specific route SHOULD combine them into the same UPDATE message. 4307 Appendix F.3 Path attribute ordering 4309 Implementations which combine update messages as described above in 4310 6.1 may prefer to see all path attributes presented in a known order. 4311 This permits them to quickly identify sets of attributes from differ- 4312 ent update messages which are semantically identical. To facilitate 4313 this, it is a useful optimization to order the path attributes 4314 according to type code. This optimization is entirely optional. 4316 Appendix F.4 AS_SET sorting 4318 Another useful optimization that can be done to simplify this situa- 4319 tion is to sort the AS numbers found in an AS_SET. This optimization 4320 is entirely optional. 4322 RFC DRAFT September 2003 4324 Appendix F.5 Control over version negotiation 4326 Since BGP-4 is capable of carrying aggregated routes which can not be 4327 properly represented in BGP-3, an implementation which supports BGP-4 4328 and another BGP version should provide the capability to only speak 4329 BGP-4 on a per-peer basis. 4331 Appendix F.6 Complex AS_PATH aggregation 4333 An implementation which chooses to provide a path aggregation algo- 4334 rithm which retains significant amounts of path information may wish 4335 to use the following procedure: 4337 For the purpose of aggregating AS_PATH attributes of two routes, 4338 we model each AS as a tuple , where "type" identifies 4339 a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, 4340 AS_SET), and "value" is the AS number. Two ASs are said to be the 4341 same if their corresponding tuples are the same. 4343 The algorithm to aggregate two AS_PATH attributes works as fol- 4344 lows: 4346 a) Identify the same ASs (as defined above) within each AS_PATH 4347 attribute that are in the same relative order within both 4348 AS_PATH attributes. Two ASs, X and Y, are said to be in the 4349 same order if either: 4350 - X precedes Y in both AS_PATH attributes, or - Y precedes X 4351 in both AS_PATH attributes. 4353 b) The aggregated AS_PATH attribute consists of ASs identified 4354 in (a) in exactly the same order as they appear in the AS_PATH 4355 attributes to be aggregated. If two consecutive ASs identified 4356 in (a) do not immediately follow each other in both of the 4357 AS_PATH attributes to be aggregated, then the intervening ASs 4358 (ASs that are between the two consecutive ASs that are the 4359 same) in both attributes are combined into an AS_SET path seg- 4360 ment that consists of the intervening ASs from both AS_PATH 4361 attributes; this segment is then placed in between the two con- 4362 secutive ASs identified in (a) of the aggregated attribute. If 4363 two consecutive ASs identified in (a) immediately follow each 4364 other in one attribute, but do not follow in another, then the 4365 intervening ASs of the latter are combined into an AS_SET path 4366 segment; this segment is then placed in between the two consec- 4367 utive ASs identified in (a) of the aggregated attribute. 4369 RFC DRAFT September 2003 4371 c) For each pair of adjacent tuples in the aggregated AS_PATH, 4372 if both tuples have the same type, merge them together, as long 4373 as doing so will not cause a segment with length greater than 4374 255 to be generated. 4376 If as a result of the above procedure a given AS number appears 4377 more than once within the aggregated AS_PATH attribute, all, but 4378 the last instance (rightmost occurrence) of that AS number SHOULD 4379 be removed from the aggregated AS_PATH attribute. 4381 Security Considerations 4383 The authentication mechanism that an implementation of BGP MUST sup- 4384 port is specified in [RFC2385]. The authentication provided by this 4385 mechanism could be done on a per peer basis. 4387 BGP vulnerabilities analysis is discussed in [BGP_VULN]. 4389 IANA Considerations 4391 All new BGP message types, Path Attributes Type codes, Message Header 4392 Error subcodes, OPEN Message Error subcodes, and UPDATE Message Error 4393 subcodes MUST only be made using the Standards Action process defined 4394 in [RFC2434]. 4396 This document defines the following message types: OPEN, UPDATE, 4397 KEEPALIVE, NOTIFICATION. 4399 This document defines the following Path Attributes Type codes: ORI- 4400 GIN, AS_PATH, NEXT_HOP, MULTI_EXIT_DISC, LOCAL_PREF, ATOMIC_AGGRE- 4401 GATE, AGGREGATOR. 4403 This document defines the following Message Header Error subcodes: 4404 Connection Not Synchronized, Bad Message Length, Bad Message Type. 4406 This document defines the following OPEN Message Error subcodes: 4407 Unsupported Version Number, Bad Peer AS, Bad BGP Identifier, Unsup- 4408 ported Optional Parameter, Unacceptable Hold Time. 4410 This document defines the following UPDATE Message Error subcodes: 4411 Malformed Attribute List, Unrecognized Well-known Attribute, Missing 4412 Well-known Attribute, Attribute Flags Error, Attribute Length Error, 4413 Invalid ORIGIN Attribute, Invalid NEXT_HOP Attribute, Optional 4414 Attribute Error, Invalid Network Field, Malformed AS_PATH. 4416 RFC DRAFT September 2003 4418 IPR Notice 4420 The IETF has been notified of intellectual property rights claimed in 4421 regard to some or all of the specification contained in this docu- 4422 ment. For more information consult the online list of claimed rights. 4424 The IETF takes no position regarding the validity or scope of any 4425 intellectual property or other rights that might be claimed to per- 4426 tain to the implementation or use of the technology described in this 4427 document or the extent to which any license under such rights might 4428 or might not be available; neither does it represent that it has made 4429 any effort to identify any such rights. Information on the IETF's 4430 procedures with respect to rights in standards-track and standards- 4431 related documentation can be found in BCP-11. Copies of claims of 4432 rights made available for publication and any assurances of licenses 4433 to be made available, or the result of an attempt made to obtain a 4434 general license or permission for the use of such proprietary rights 4435 by implementors or users of this specification can be obtained from 4436 the IETF Secretariat. 4438 The IETF invites any interested party to bring to its attention any 4439 copyrights, patents or patent applications, or other proprietary 4440 rights which may cover technology that may be required to practice 4441 this standard. Please address the information to the IETF Executive 4442 Director. 4444 Full Copyright Notice 4446 Copyright (C) The Internet Society (2003). All Rights Reserved. 4448 This document and translations of it may be copied and furnished to 4449 others, and derivative works that comment on or otherwise explain it 4450 or assist in its implementation may be prepared, copied, published 4451 and distributed, in whole or in part, without restriction of any 4452 kind, provided that the above copyright notice and this paragraph are 4453 included on all such copies and derivative works. However, this doc- 4454 ument itself may not be modified in any way, such as by removing the 4455 copyright notice or references to the Internet Society or other 4456 Internet organizations, except as needed for the purpose of develop- 4457 ing Internet standards in which case the procedures for copyrights 4458 defined in the Internet Standards process must be followed, or as 4459 required to translate it into languages other than English. 4461 The limited permissions granted above are perpetual and will not be 4462 RFC DRAFT September 2003 4464 revoked by the Internet Society or its successors or assigns. 4466 This document and the information contained herein is provided on an 4467 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 4468 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 4469 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 4470 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MER- 4471 CHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE." 4473 Normative References 4475 [RFC791] Postel, J., "Internet Protocol - DARPA Internet Program Pro- 4476 tocol Specification", RFC791, September 1981. 4478 [RFC793] Postel, J., "Transmission Control Protocol - DARPA Internet 4479 Program Protocol Specification", RFC793, September 1981. 4481 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 4482 Requirement Levels", BCP 14, RFC 2119, March 1997. 4484 [RFC2385] Heffernan, A., "Protection of BGP Sessions via the TCP MD5 4485 Signature Option", RFC2385, August 1998. 4487 [RFC2434] Narten, T., Alvestrand, H., "Guidelines for Writing an IANA 4488 Considerations Section in RFCs", RFC2434, October 1998 4490 [RFC2474] Nichols, K., et al.,"Definition of the Differentiated Ser- 4491 vices Field (DS Field) in the IPv4 and IPv6 Headers", RFC2474, Decem- 4492 ber 1998 4494 Non-normative References 4496 [RFC904] Mills, D., "Exterior Gateway Protocol Formal Specification", 4497 RFC904, April 1984. 4499 [RFC1092] Rekhter, Y., "EGP and Policy Based Routing in the New 4500 NSFNET Backbone", RFC1092, February 1989. 4502 [RFC1093] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, 4503 February 1989. 4505 [RFC1772] Rekhter, Y., and P. Gross, "Application of the Border Gate- 4506 way Protocol in the Internet", RFC1772, March 1995. 4508 [RFC1518] Rekhter, Y., Li, T., "An Architecture for IP Address 4509 RFC DRAFT September 2003 4511 Allocation with CIDR", RFC 1518, September 1993. 4513 [RFC1519] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless 4514 Inter-Domain Routing (CIDR): an Address Assignment and Aggregation 4515 Strategy", RFC1519, September 1993. 4517 [RFC1997] R. Chandra, P. Traina, T. Li, "BGP Communities Attribute", 4518 RFC 1997, August 1996. 4520 [RFC2439] C. Villamizar, R. Chandra, R. Govindan, "BGP Route Flap 4521 Damping", RFC2439, November 1998. 4523 [RFC2796] Bates, T., Chandra, R., Chen, E., "BGP Route Reflection - 4524 An Alternative to Full Mesh IBGP", RFC2796, April 2000. 4526 [RFC3392] R. Chandra, J. Scudder, "Capabilities Advertisement with 4527 BGP-4", RFC2842. 4529 [RFC2858] T. Bates, R. Chandra, D. Katz, Y. Rekhter, "Multiprotocol 4530 Extensions for BGP-4", RFC2858. 4532 [RFC2918] Chen, E., "Route Refresh Capability for BGP-4", RFC2918, 4533 September 2000. 4535 [RFC3065] Traina, P, McPherson, D., Scudder, J., "Autonomous System 4536 Confederations for BGP", RFC3065, February 2001. 4538 [IS10747] "Information Processing Systems - Telecommunications and 4539 Information Exchange between Systems - Protocol for Exchange of 4540 Inter-domain Routeing Information among Intermediate Systems to Sup- 4541 port Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 4543 [BGP_VULN] Murphy, S., "BGP Security Vulnerabilities Analysis", 4544 draft-ietf-idr-bgp-vuln-00.txt, work in progress 4546 Editors' Addresses 4548 Yakov Rekhter 4549 Juniper Networks 4550 email: yakov@juniper.net 4552 Tony Li 4553 Procket Networks, Inc. 4554 email: tli@procket.com 4556 Susan Hares 4557 RFC DRAFT September 2003 4559 NextHop Technologies, Inc. 4560 email: skh@nexthop.com