--- 1/draft-ietf-idr-bgp4-20.txt 2006-02-04 23:30:19.000000000 +0100 +++ 2/draft-ietf-idr-bgp4-21.txt 2006-02-04 23:30:20.000000000 +0100 @@ -1,21 +1,21 @@ Network Working Group Y. Rekhter INTERNET DRAFT Juniper Networks T. Li Procket Networks, Inc. S. Hares NextHop Technologies, Inc. Editors A Border Gateway Protocol 4 (BGP-4) - + Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. @@ -24,120 +24,153 @@ and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as ``work in progress.'' The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. -Specification of Requirements +Copyright Notice - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in RFC2119 [RFC2119]. + Copyright (C) The Internet Society (2003). All Rights Reserved. + +Abstract + + The Border Gateway Protocol (BGP) is an inter-Autonomous System + routing protocol. + + The primary function of a BGP speaking system is to exchange network + reachability information with other BGP systems. This network + reachability information includes information on the list of + Autonomous Systems (ASs) that reachability information traverses. + This information is sufficient to construct a graph of AS + connectivity for this reachability from which routing loops may be + pruned and some policy decisions at the AS level may be enforced. + + BGP-4 provides a set of mechanisms for supporting Classless Inter- + Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms include + support for advertising a set of destinations as an IP prefix, and + eliminating the concept of network "class" within BGP. BGP-4 also + introduces mechanisms which allow aggregation of routes, including + aggregation of AS paths. + + Routing information exchanged via BGP supports only the destination- + based forwarding paradigm, which assumes that a router forwards a + packet based solely on the destination address carried in the IP + header of the packet. This, in turn, reflects the set of policy + decisions that can (and can not) be enforced using BGP. BGP can + support only the policies conforming to the destination-based + forwarding paradigm. + + This specification covers only the exchange of IP version 4 network + reachability information. Table of Contents - Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 1. Definition of commonly used terms . . . . . . . . . . . . . . 4 - 2. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 6 - 3. Summary of Operation . . . . . . . . . . . . . . . . . . . . . 7 + 1. Definition of commonly used terms . . . . . . . . . . . . . . 5 + 2. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 + Specification of Requirements . . . . . . . . . . . . . . . . . . 8 + 3. Summary of Operation . . . . . . . . . . . . . . . . . . . . . 8 3.1 Routes: Advertisement and Storage . . . . . . . . . . . . . . 9 3.2 Routing Information Bases . . . . . . . . . . . . . . . . . . 10 - 4. Message Formats . . . . . . . . . . . . . . . . . . . . . . . 11 - 4.1 Message Header Format . . . . . . . . . . . . . . . . . . . . 11 - 4.2 OPEN Message Format . . . . . . . . . . . . . . . . . . . . . 12 - 4.3 UPDATE Message Format . . . . . . . . . . . . . . . . . . . . 14 - 4.4 KEEPALIVE Message Format . . . . . . . . . . . . . . . . . . 21 - 4.5 NOTIFICATION Message Format . . . . . . . . . . . . . . . . . 21 - 5. Path Attributes . . . . . . . . . . . . . . . . . . . . . . . 23 - 5.1 Path Attribute Usage . . . . . . . . . . . . . . . . . . . . 25 - 5.1.1 ORIGIN . . . . . . . . . . . . . . . . . . . . . . . . . . 25 - 5.1.2 AS_PATH . . . . . . . . . . . . . . . . . . . . . . . . . . 25 - 5.1.3 NEXT_HOP . . . . . . . . . . . . . . . . . . . . . . . . . 26 - 5.1.4 MULTI_EXIT_DISC . . . . . . . . . . . . . . . . . . . . . . 28 - 5.1.5 LOCAL_PREF . . . . . . . . . . . . . . . . . . . . . . . . 28 - 5.1.6 ATOMIC_AGGREGATE . . . . . . . . . . . . . . . . . . . . . 29 - 5.1.7 AGGREGATOR . . . . . . . . . . . . . . . . . . . . . . . . 30 - 6. BGP Error Handling . . . . . . . . . . . . . . . . . . . . . . 30 - 6.1 Message Header error handling . . . . . . . . . . . . . . . . 30 - 6.2 OPEN message error handling . . . . . . . . . . . . . . . . . 31 - 6.3 UPDATE message error handling . . . . . . . . . . . . . . . . 32 - 6.4 NOTIFICATION message error handling . . . . . . . . . . . . . 34 - 6.5 Hold Timer Expired error handling . . . . . . . . . . . . . . 34 - 6.6 Finite State Machine error handling . . . . . . . . . . . . . 34 - 6.7 Cease . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 - 6.8 BGP connection collision detection . . . . . . . . . . . . . 35 - 7. BGP Version Negotiation . . . . . . . . . . . . . . . . . . . 36 - 8. BGP Finite State machine . . . . . . . . . . . . . . . . . . . 36 - 8.1 Events for the BGP FSM . . . . . . . . . . . . . . . . . . . 37 - 8.1.1 Administrative Events . . . . . . . . . . . . . . . . . . 37 - 8.1.2 Timer Events . . . . . . . . . . . . . . . . . . . . . . . 40 - 8.1.3 TCP connection based Events . . . . . . . . . . . . . . . . 41 - 8.1.4 BGP Messages based Events . . . . . . . . . . . . . . . . . 43 - 8.2 Description of FSM . . . . . . . . . . . . . . . . . . . . . 45 - 8.2.1 FSM Definition . . . . . . . . . . . . . . . . . . . . . . 45 - 8.2.1.1 Terms "active" and "passive" . . . . . . . . . . . . . . 46 - 8.2.1.2 FSM and collision detection . . . . . . . . . . . . . . . 46 - 8.2.1.3 FSM and Optional Attributes . . . . . . . . . . . . . . 47 - 8.2.1.4 FSM Event numbers . . . . . . . . . . . . . . . . . . . . 47 - 8.2.2 Finite State Machine . . . . . . . . . . . . . . . . . . . 47 - 9. UPDATE Message Handling . . . . . . . . . . . . . . . . . . . 62 - 9.1 Decision Process . . . . . . . . . . . . . . . . . . . . . . 63 - 9.1.1 Phase 1: Calculation of Degree of Preference . . . . . . . 64 - 9.1.2 Phase 2: Route Selection . . . . . . . . . . . . . . . . . 65 - 9.1.2.1 Route Resolvability Condition . . . . . . . . . . . . . . 66 - 9.1.2.2 Breaking Ties (Phase 2) . . . . . . . . . . . . . . . . . 67 - 9.1.3 Phase 3: Route Dissemination . . . . . . . . . . . . . . . 69 - 9.1.4 Overlapping Routes . . . . . . . . . . . . . . . . . . . . 70 - 9.2 Update-Send Process . . . . . . . . . . . . . . . . . . . . . 71 - 9.2.1 Controlling Routing Traffic Overhead . . . . . . . . . . . 72 - 9.2.1.1 Frequency of Route Advertisement . . . . . . . . . . . . 72 - 9.2.1.2 Frequency of Route Origination . . . . . . . . . . . . . 73 - 9.2.2 Efficient Organization of Routing Information . . . . . . . 73 - 9.2.2.1 Information Reduction . . . . . . . . . . . . . . . . . . 73 - 9.2.2.2 Aggregating Routing Information . . . . . . . . . . . . . 74 - 9.3 Route Selection Criteria . . . . . . . . . . . . . . . . . . 76 - 9.4 Originating BGP routes . . . . . . . . . . . . . . . . . . . 77 - 10. BGP Timers . . . . . . . . . . . . . . . . . . . . . . . . . 77 - Appendix A. Comparison with RFC1771 . . . . . . . . . . . . . . . 78 - Appendix B. Comparison with RFC1267 . . . . . . . . . . . . . . . 79 - Appendix C. Comparison with RFC 1163 . . . . . . . . . . . . . . 80 - Appendix D. Comparison with RFC 1105 . . . . . . . . . . . . . . 80 - Appendix E. TCP options that may be used with BGP . . . . . . . . 81 - Appendix F. Implementation Recommendations . . . . . . . . . . . 81 - Appendix F.1 Multiple Networks Per Message . . . . . . . . . . . 81 - Appendix F.2 Reducing route flapping . . . . . . . . . . . . . . 82 - Appendix F.3 Path attribute ordering . . . . . . . . . . . . . . 82 - Appendix F.4 AS_SET sorting . . . . . . . . . . . . . . . . . . . 82 - Appendix F.5 Control over version negotiation . . . . . . . . . . 83 - Appendix F.6 Complex AS_PATH aggregation . . . . . . . . . . . . 83 - Security Considerations . . . . . . . . . . . . . . . . . . . . . 84 - IANA Considerations . . . . . . . . . . . . . . . . . . . . . . . 84 - Normative References . . . . . . . . . . . . . . . . . . . . . . 84 - Non-normative References . . . . . . . . . . . . . . . . . . . . 85 - Authors Information . . . . . . . . . . . . . . . . . . . . . . . 86 + 4. Message Formats . . . . . . . . . . . . . . . . . . . . . . . 12 + 4.1 Message Header Format . . . . . . . . . . . . . . . . . . . . 12 + 4.2 OPEN Message Format . . . . . . . . . . . . . . . . . . . . . 13 + 4.3 UPDATE Message Format . . . . . . . . . . . . . . . . . . . . 15 + 4.4 KEEPALIVE Message Format . . . . . . . . . . . . . . . . . . 22 + 4.5 NOTIFICATION Message Format . . . . . . . . . . . . . . . . . 22 + 5. Path Attributes . . . . . . . . . . . . . . . . . . . . . . . 24 + 5.1 Path Attribute Usage . . . . . . . . . . . . . . . . . . . . 26 + 5.1.1 ORIGIN . . . . . . . . . . . . . . . . . . . . . . . . . . 26 + 5.1.2 AS_PATH . . . . . . . . . . . . . . . . . . . . . . . . . . 26 + 5.1.3 NEXT_HOP . . . . . . . . . . . . . . . . . . . . . . . . . 27 + 5.1.4 MULTI_EXIT_DISC . . . . . . . . . . . . . . . . . . . . . . 29 + 5.1.5 LOCAL_PREF . . . . . . . . . . . . . . . . . . . . . . . . 30 + 5.1.6 ATOMIC_AGGREGATE . . . . . . . . . . . . . . . . . . . . . 30 + 5.1.7 AGGREGATOR . . . . . . . . . . . . . . . . . . . . . . . . 31 + 6. BGP Error Handling . . . . . . . . . . . . . . . . . . . . . . 31 + 6.1 Message Header error handling . . . . . . . . . . . . . . . . 31 + 6.2 OPEN message error handling . . . . . . . . . . . . . . . . . 32 + 6.3 UPDATE message error handling . . . . . . . . . . . . . . . . 33 + 6.4 NOTIFICATION message error handling . . . . . . . . . . . . . 35 + 6.5 Hold Timer Expired error handling . . . . . . . . . . . . . . 35 + 6.6 Finite State Machine error handling . . . . . . . . . . . . . 35 + 6.7 Cease . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 + 6.8 BGP connection collision detection . . . . . . . . . . . . . 36 + 7. BGP Version Negotiation . . . . . . . . . . . . . . . . . . . 37 + 8. BGP Finite State machine . . . . . . . . . . . . . . . . . . . 38 + 8.1 Events for the BGP FSM . . . . . . . . . . . . . . . . . . . 39 + 8.1.1 Optional Events linked to Optional Session attributes . . . 39 + 8.1.2 Administrative Events . . . . . . . . . . . . . . . . . . 44 + 8.1.3 Timer Events . . . . . . . . . . . . . . . . . . . . . . . 47 + 8.1.4 TCP connection based Events . . . . . . . . . . . . . . . . 49 + 8.1.5 BGP Messages based Events . . . . . . . . . . . . . . . . . 51 + 8.2 Description of FSM . . . . . . . . . . . . . . . . . . . . . 53 + 8.2.1 FSM Definition . . . . . . . . . . . . . . . . . . . . . . 53 + 8.2.1.1 Terms "active" and "passive" . . . . . . . . . . . . . . 54 + 8.2.1.2 FSM and collision detection . . . . . . . . . . . . . . . 54 + 8.2.1.3 FSM and Optional Attributes . . . . . . . . . . . . . . 55 + 8.2.1.4 FSM Event numbers . . . . . . . . . . . . . . . . . . . . 55 + 8.2.1.5 FSM actions that are implementation dependent . . . . . . 56 + 8.2.2 Finite State Machine . . . . . . . . . . . . . . . . . . . 56 + 9. UPDATE Message Handling . . . . . . . . . . . . . . . . . . . 72 + 9.1 Decision Process . . . . . . . . . . . . . . . . . . . . . . 73 + 9.1.1 Phase 1: Calculation of Degree of Preference . . . . . . . 74 + 9.1.2 Phase 2: Route Selection . . . . . . . . . . . . . . . . . 74 + 9.1.2.1 Route Resolvability Condition . . . . . . . . . . . . . . 76 + 9.1.2.2 Breaking Ties (Phase 2) . . . . . . . . . . . . . . . . . 77 + 9.1.3 Phase 3: Route Dissemination . . . . . . . . . . . . . . . 79 + 9.1.4 Overlapping Routes . . . . . . . . . . . . . . . . . . . . 80 + 9.2 Update-Send Process . . . . . . . . . . . . . . . . . . . . . 81 + 9.2.1 Controlling Routing Traffic Overhead . . . . . . . . . . . 82 + 9.2.1.1 Frequency of Route Advertisement . . . . . . . . . . . . 82 + 9.2.1.2 Frequency of Route Origination . . . . . . . . . . . . . 83 + 9.2.2 Efficient Organization of Routing Information . . . . . . . 83 + 9.2.2.1 Information Reduction . . . . . . . . . . . . . . . . . . 83 + 9.2.2.2 Aggregating Routing Information . . . . . . . . . . . . . 84 + 9.3 Route Selection Criteria . . . . . . . . . . . . . . . . . . 86 + 9.4 Originating BGP routes . . . . . . . . . . . . . . . . . . . 87 + 10. BGP Timers . . . . . . . . . . . . . . . . . . . . . . . . . 87 + Appendix A. Comparison with RFC1771 . . . . . . . . . . . . . . . 88 + Appendix B. Comparison with RFC1267 . . . . . . . . . . . . . . . 89 + Appendix C. Comparison with RFC 1163 . . . . . . . . . . . . . . 90 + Appendix D. Comparison with RFC 1105 . . . . . . . . . . . . . . 90 + Appendix E. TCP options that may be used with BGP . . . . . . . . 91 + Appendix F. Implementation Recommendations . . . . . . . . . . . 91 + Appendix F.1 Multiple Networks Per Message . . . . . . . . . . . 91 + Appendix F.2 Reducing route flapping . . . . . . . . . . . . . . 92 + Appendix F.3 Path attribute ordering . . . . . . . . . . . . . . 92 + Appendix F.4 AS_SET sorting . . . . . . . . . . . . . . . . . . . 92 + Appendix F.5 Control over version negotiation . . . . . . . . . . 93 + Appendix F.6 Complex AS_PATH aggregation . . . . . . . . . . . . 93 + Security Considerations . . . . . . . . . . . . . . . . . . . . . 94 + IANA Considerations . . . . . . . . . . . . . . . . . . . . . . . 94 + IPR Notice . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 + Full Copyright Notice . . . . . . . . . . . . . . . . . . . . . . 95 + Normative References . . . . . . . . . . . . . . . . . . . . . . 96 + Non-normative References . . . . . . . . . . . . . . . . . . . . 96 + Authors Information . . . . . . . . . . . . . . . . . . . . . . . 97 Abstract The Border Gateway Protocol (BGP) is an inter-Autonomous System rout- ing protocol. The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems. This network reacha- bility information includes information on the list of Autonomous Systems (ASs) that reachability information traverses. This informa- - tion is sufficient to construct a graph of AS connectivity from which - routing loops may be pruned and some policy decisions at the AS level - may be enforced. + tion is sufficient to construct a graph of AS connectivity for this + reachability from which routing loops may be pruned and some policy + decisions at the AS level may be enforced. BGP-4 provides a set of mechanisms for supporting Classless Inter- Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms include support for advertising a set of destinations as an IP prefix and eliminating the concept of network "class" within BGP. BGP-4 also introduces mechanisms which allow aggregation of routes, including aggregation of AS paths. Routing information exchanged via BGP supports only the destination- based forwarding paradigm, which assumes that a router forwards a @@ -263,20 +296,26 @@ Pei, Mathew Richardson, John Scudder, John Stewart III, Dave Thaler, Paul Traina, Russ White, Curtis Villamizar, and Alex Zinin for their comments. We would like to specially acknowledge Andrew Lange for his help in preparing the final version of this document. Finally, we would like to thank all the members of the IDR Working Group for their ideas and support they have given to this document. +Specification of Requirements + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in RFC2119 [RFC2119]. + 3. Summary of Operation The Border Gateway Protocol (BGP) is an inter-Autonomous System rout- ing protocol. It is built on experience gained with EGP as defined in [RFC904] and EGP usage in the NSFNET Backbone as described in [RFC1092] and [RFC1093]. The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems. This network reacha- bility information includes information on the list of Autonomous @@ -339,93 +378,90 @@ Two systems form a TCP connection between one another. They exchange messages to open and confirm the connection parameters. The initial data flow is the portion of the BGP routing table that is allowed by the export policy, called the Adj-Ribs-Out (see 3.2). Incremental updates are sent as the routing tables change. BGP does not require periodic refresh of the routing table. To allow local policy changes to have the correct effect without resetting any BGP connections, a BGP speaker SHOULD either (a) retain the current ver- - sion of the routes advertised to it by all of its peers for the dura- - tion of the connection, or (b) make use of the Route Refresh exten- - sion [RFC2918]. + sion of the routes advertised to it by all of its peers for the + duration of the connection, or (b) make use of the Route Refresh + extension [RFC2918]. KEEPALIVE messages may be sent periodically to ensure the liveness of the connection. NOTIFICATION messages are sent in response to errors or special conditions. If a connection encounters an error condition, a NOTIFICATION message is sent and the connection is closed. A peer in a different AS is referred to as an external peer, while a peer in the same AS is referred to as an internal peer. Internal BGP and external BGP are commonly abbreviated IBGP and EBGP. If a particular AS has multiple BGP speakers and is providing transit service for other ASs, then care must be taken to ensure a consistent view of routing within the AS. A consistent view of the interior routes of the AS is provided by the IGP used within the AS. For the purpose of this document, it is assumed that a consistent view of the routes exterior to the AS is provided by having all BGP speakers - within the AS maintain IBGP with each other. Care must be taken to - ensure that the interior routers have all been updated with transit - information before the BGP speakers announce to other ASs that tran- - sit service is being provided. + within the AS maintain IBGP with each other. This document specifies the base behavior of the BGP protocol. This - behavior can and is modified by extention specifications. When the + behavior can and is modified by extension specifications. When the protocol is extended the new behavior is fully documented in the - extention specifications. + extension specifications. 3.1 Routes: Advertisement and Storage For the purpose of this protocol, a route is defined as a unit of information that pairs a set of destinations with the attributes of a path to those destinations. The set of destinations are systems whose IP addresses are contained in one IP address prefix carried in the Network Layer Reachability Information (NLRI) field of an UPDATE mes- sage, and the path is the information reported in the path attributes field of the same UPDATE message. Routes are advertised between BGP speakers in UPDATE messages. Mul- tiple routes that have the same path attributes can be advertised in a single UPDATE message by including multiple prefixes in the NLRI field of the UPDATE message. Routes are stored in the Routing Information Bases (RIBs): namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out, as described in Section 3.2. - If a BGP speaker chooses to advertise the route, it MAY add to or - modify the path attributes of the route before advertising it to a - peer. + If a BGP speaker chooses to advertise a previously received route, it + MAY add to or modify the path attributes of the route before adver- + tising it to a peer. BGP provides mechanisms by which a BGP speaker can inform its peer that a previously advertised route is no longer available for use. There are three methods by which a given BGP speaker can indicate that a route has been withdrawn from service: a) the IP prefix that expresses the destination for a previously advertised route can be advertised in the WITHDRAWN ROUTES field in the UPDATE message, thus marking the associated route as being no longer available for use b) a replacement route with the same NLRI can be advertised, or c) the BGP speaker - BGP speaker connection can be closed, which implicitly removes from service all routes which the pair of speakers had advertised to each other. - Changing attribute of a route is accomplished by advertising a + Changing attribute(s) of a route is accomplished by advertising a replacement route. The replacement route carries new (changed) - attributes and has the same NLRI as the original route. + attributes and has the same address prefix as the original route. -3.2 Routing Information Bases +3.2 Routing Information Base The Routing Information Base (RIB) within a BGP speaker consists of three distinct parts: a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has been learned from inbound UPDATE messages received from other BGP speakers. Their contents represent routes that are available as an input to the Decision Process. b) Loc-RIB: The Loc-RIB contains the local routing information @@ -522,23 +558,23 @@ 1 - OPEN 2 - UPDATE 3 - NOTIFICATION 4 - KEEPALIVE [RFC2918] defines one more type code. 4.2 OPEN Message Format - After a TCP is established, the first message sent by each side is an - OPEN message. If the OPEN message is acceptable, a KEEPALIVE message - confirming the OPEN is sent back. + After a TCP connection is established, the first message sent by each + side is an OPEN message. If the OPEN message is acceptable, a + KEEPALIVE message confirming the OPEN is sent back. In addition to the fixed-size BGP header, the OPEN message contains the following fields: 0 1 2 3 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 +-+-+-+-+-+-+-+-+ | Version | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | My Autonomous System | @@ -602,21 +638,21 @@ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... | Parm. Type | Parm. Length | Parameter Value (variable) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... Parameter Type is a one octet field that unambiguously identi- fies individual parameters. Parameter Length is a one octet field that contains the length of the Parameter Value field in octets. Parameter Value is a variable length field that is interpreted according to the value of the Parameter Type field. - [RFC2842] defines the Capabilities Optional Parameter. + [RFC3392] defines the Capabilities Optional Parameter. The minimum length of the OPEN message is 29 octets (including mes- sage header). 4.3 UPDATE Message Format UPDATE messages are used to transfer routing information between BGP peers. The information in the UPDATE message can be used to construct a graph describing the relationships of the various Autonomous Sys- tems. By applying rules to be discussed, routing information loops @@ -805,30 +841,30 @@ (unicast) IP address of the router that SHOULD be used as the next hop to the destinations listed in the Network Layer Reachability Information field of the UPDATE message. Usage of this attribute is defined in 5.1.3. d) MULTI_EXIT_DISC (Type Code 4): This is an optional non-transitive attribute that is a four octet unsigned integer. The value of this attribute MAY be - used by a BGP speaker's decision process to discriminate + used by a BGP speaker's Decision Process to discriminate among multiple entry points to a neighboring autonomous system. Usage of this attribute is defined in 5.1.4. e) LOCAL_PREF (Type Code 5): LOCAL_PREF is a well-known attribute that is a four octet - unsigned integer. A BGP speaker uses it to inform other + unsigned integer. A BGP speaker uses it to inform its other internal peers of the advertising speaker's degree of pref- erence for an advertised route. Usage of this attribute is defined in 5.1.5. f) ATOMIC_AGGREGATE (Type Code 6) ATOMIC_AGGREGATE is a well-known discretionary attribute of length 0. @@ -1023,42 +1059,42 @@ This section discusses the path attributes of the UPDATE message. Path attributes fall into four separate categories: 1. Well-known mandatory. 2. Well-known discretionary. 3. Optional transitive. 4. Optional non-transitive. - Well-known attributes MUST be recognized by all BGP implementations. - 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. + 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. - All well-known attributes MUST be passed along (after proper updat- - ing, if necessary) to other BGP peers. + Once a BGP peer has updated any well-known attributes, it MUST pass + these attributes in any updates it transmits to its peers. In addition to well-known attributes, each path MAY contain one or more optional attributes. It is not required or expected that all BGP implementations support all optional attributes. The handling of an unrecognized optional attribute is determined by the setting of the Transitive bit in the attribute flags octet. Paths with unrecognized transitive optional attributes SHOULD be accepted. If a path with unrecognized transitive optional attribute is accepted and passed along to other BGP peers, then the unrecognized transitive optional attribute of that path MUST be passed along with the path to other BGP peers with the Partial bit in the Attribute Flags octet set to 1. If a path with recognized transitive optional attribute is accepted and passed along to other BGP peers and the Partial bit in the - Attribute Flags octet is set to 1 by some previous AS, it is not set - back to 0 by the current AS. Unrecognized non-transitive optional + Attribute Flags octet is set to 1 by some previous AS, it MUST NOT be + set back to 0 by the current AS. Unrecognized non-transitive optional attributes MUST be quietly ignored and not passed along to other BGP peers. New transitive optional attributes MAY be attached to the path by the originator or by any other BGP speaker in the path. If they are not attached by the originator, the Partial bit in the Attribute Flags octet is set to 1. The rules for attaching new non-transitive optional attributes will depend on the nature of the specific attribute. The documentation of each new non-transitive optional attribute will be expected to include such rules. (The description of @@ -1116,25 +1152,26 @@ a) When a given BGP speaker advertises the route to an internal peer, the advertising speaker SHALL NOT modify the AS_PATH attribute associated with the route. b) When a given BGP speaker advertises the route to an external peer, then the advertising speaker updates the AS_PATH attribute as follows: 1) if the first path segment of the AS_PATH is of type AS_SEQUENCE, the local system prepends its own AS number as the - last element of the sequence (put it in the leftmost position). - If the act of prepending will cause an overflow in the AS_PATH - segment, i.e. more than 255 ASs, it is legal to prepend a new - segment of type AS_SEQUENCE and prepend its own AS number to - this new segment. + last element of the sequence (put it in the leftmost position + with respect to the position of octets in the protocol mes- + sage). If the act of prepending will cause an overflow in the + AS_PATH segment, i.e. more than 255 ASs, it SHOULD prepend a + new segment of type AS_SEQUENCE and prepend its own AS number + to this new segment. 2) if the first path segment of the AS_PATH is of type AS_SET, the local system prepends a new path segment of type AS_SEQUENCE to the AS_PATH, including its own AS number in that segment. When a BGP speaker originates a route then: a) the originating speaker includes its own AS number in a path segment of type AS_SEQUENCE in the AS_PATH attribute of all UPDATE @@ -1243,46 +1280,49 @@ 5.1.4 MULTI_EXIT_DISC The MULTI_EXIT_DISC is an optional non-transitive attribute which is intended to be used on external (inter-AS) links to discriminate among multiple exit or entry points to the same neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four octet unsigned num- ber which is called a metric. All other factors being equal, the exit point with lower metric SHOULD be preferred. If received over EBGP, the MULTI_EXIT_DISC attribute MAY be propagated over IBGP to other - BGP speakers within the same AS. The MULTI_EXIT_DISC attribute - received from a neighboring AS MUST NOT be propagated to other neigh- - boring ASs. + BGP speakers within the same AS (see also 9.1.2.2). The + MULTI_EXIT_DISC attribute received from a neighboring AS MUST NOT be + propagated to other neighboring ASs. - A BGP speaker MUST IMPLEMENT a mechanism based on local configuration + A BGP speaker MUST implement a mechanism based on local configuration which allows the MULTI_EXIT_DISC attribute to be removed from a - route. This MAY be done prior to determining the degree of preference - of the route and performing route selection (decision process phases - 1 and 2). + route. If a BGP speaker is configured to remove the MULTI_EXIT_DISC + attribute from a route, then this removal MUST be done prior to + determining the degree of preference of the route and performing + route selection (Decision Process phases 1 and 2). An implementation MAY also (based on local configuration) alter the - value of the MULTI_EXIT_DISC attribute received over EBGP. This MAY - be done prior to determining the degree of preference of the route - and performing route selection (decision process phases 1 and 2). See - Section 9.1.2.2 for necessary restrictions on this. + value of the MULTI_EXIT_DISC attribute received over EBGP. If a BGP + speaker is configured to alter the value of the MULTI_EXIT_DISC + attribute received over EBGP, then altering the value MUST be done + prior to determining the degree of preference of the route and per- + forming route selection (Decision Process phases 1 and 2). See Sec- + tion 9.1.2.2 for necessary restrictions on this. 5.1.5 LOCAL_PREF LOCAL_PREF is a well-known attribute that SHALL be included in all UPDATE messages that a given BGP speaker sends to the other internal peers. A BGP speaker SHALL calculate the degree of preference for each external route based on the locally configured policy, and include the degree of preference when advertising a route to its internal peers. The higher degree of preference MUST be preferred. A BGP speaker uses the degree of preference learned via LOCAL_PREF in - its decision process (see Section 9.1.1). + its Decision Process (see Section 9.1.1). A BGP speaker MUST NOT include this attribute in UPDATE messages that it sends to external peers, except for the case of BGP Confederations [RFC3065]. If it is contained in an UPDATE message that is received from an external peer, then this attribute MUST be ignored by the receiving speaker, except for the case of BGP Confederations [RF3065]. 5.1.6 ATOMIC_AGGREGATE @@ -1302,22 +1342,22 @@ A BGP speaker that receives a route with the ATOMIC_AGGREGATE attribute SHOULD NOT remove the attribute from the route when propa- gating it to other speakers. A BGP speaker that receives a route with the ATOMIC_AGGREGATE attribute MUST NOT make any NLRI of that route more specific (as defined in 9.1.4) when advertising this route to other BGP speakers. A BGP speaker that receives a route with the ATOMIC_AGGREGATE - attribute needs to be cognizant of the fact that the actual path to - destinations, as specified in the NLRI of the route, while having the + attribute needs to be aware of the fact that the actual path to des- + tinations, as specified in the NLRI of the route, while having the loop-free property, may not be the path specified in the AS_PATH attribute of the route. 5.1.7 AGGREGATOR AGGREGATOR is an optional transitive attribute which MAY be included in updates which are formed by aggregation (see Section 9.2.2.2). A BGP speaker which performs route aggregation MAY add the AGGREGATOR attribute which SHALL contain its own AS number and IP address. The IP address SHOULD be the same as the BGP Identifier of the speaker. @@ -1331,170 +1371,186 @@ TION message with the indicated Error Code, Error Subcode, and Data fields is sent, and the BGP connection is closed, unless it is explicitly stated that no NOTIFICATION message is to be sent and the BGP connection is not to be closed. If no Error Subcode is specified, then a zero MUST be used. The phrase "the BGP connection is closed" means that the TCP connec- tion has been closed, the associated Adj-RIB-In has been cleared, and that all resources for that BGP connection have been deallocated. Entries in the Loc-RIB associated with the remote peer are marked as - invalid. The fact that the routes have become invalid is passed to - other BGP peers before the routes are deleted from the system. + invalid. The local system recalculates its best routes for the des- + tinations of the routes marked as invalid, and before the invalid + routes are deleted from the system advertises to its peers either + withdraws for the routes marked as invalid, or the new best routes + before the invalid routes are deleted from the system. Unless specified explicitly, the Data field of the NOTIFICATION mes- sage that is sent to indicate an error is empty. 6.1 Message Header error handling. - All errors detected while processing the Message Header are indicated - by sending the NOTIFICATION message with Error Code Message Header - Error. The Error Subcode elaborates on the specific nature of the - error. + All errors detected while processing the Message Header MUST be indi- + cated by sending the NOTIFICATION message with Error Code Message + Header Error. The Error Subcode elaborates on the specific nature of + the error. The expected value of the Marker field of the message header is all ones. If the Marker field of the message header is not as expected, - then a synchronization error has occurred and the Error Subcode is - set to Connection Not Synchronized. + then a synchronization error has occurred and the Error Subcode MUST + be set to Connection Not Synchronized. - If the Length field of the message header is less than 19 or greater - than 4096, or if the Length field of an OPEN message is less than the - minimum length of the OPEN message, or if the Length field of an - UPDATE message is less than the minimum length of the UPDATE message, - or if the Length field of a KEEPALIVE message is not equal to 19, or - if the Length field of a NOTIFICATION message is less than the mini- - mum length of the NOTIFICATION message, then the Error Subcode is set - to Bad Message Length. The Data field contains the erroneous Length - field. + If at least one of the following is true: + + - if the Length field of the message header is less than 19 or + greater than 4096, or + + - if the Length field of an OPEN message is less than the minimum + length of the OPEN message, or + + - if the Length field of an UPDATE message is less than the mini- + mum length of the UPDATE message, or + + - if the Length field of a KEEPALIVE message is not equal to 19, + or + + - if the Length field of a NOTIFICATION message is less than the + minimum length of the NOTIFICATION message, + + then the Error Subcode MUST be set to Bad Message Length. The Data + field MUST contain the erroneous Length field. If the Type field of the message header is not recognized, then the - Error Subcode is set to Bad Message Type. The Data field contains the - erroneous Type field. + Error Subcode MUST be set to Bad Message Type. The Data field MUST + contain the erroneous Type field. 6.2 OPEN message error handling. - All errors detected while processing the OPEN message are indicated - by sending the NOTIFICATION message with Error Code OPEN Message - Error. The Error Subcode elaborates on the specific nature of the - error. + All errors detected while processing the OPEN message MUST be indi- + cated by sending the NOTIFICATION message with Error Code OPEN Mes- + sage Error. The Error Subcode elaborates on the specific nature of + the error. If the version number contained in the Version field of the received - OPEN message is not supported, then the Error Subcode is set to + OPEN message is not supported, then the Error Subcode MUST be set to Unsupported Version Number. The Data field is a 2-octets unsigned integer, which indicates the largest locally supported version number less than the version the remote BGP peer bid (as indicated in the received OPEN message), or if the smallest locally supported version number is greater than the version the remote BGP peer bid, then the smallest locally supported version number. If the Autonomous System field of the OPEN message is unacceptable, - then the Error Subcode is set to Bad Peer AS. The determination of - acceptable Autonomous System numbers is outside the scope of this + then the Error Subcode MUST be set to Bad Peer AS. The determination + of acceptable Autonomous System numbers is outside the scope of this protocol. If the Hold Time field of the OPEN message is unacceptable, then the Error Subcode MUST be set to Unacceptable Hold Time. An implementa- tion MUST reject Hold Time values of one or two seconds. An imple- mentation MAY reject any proposed Hold Time. An implementation which accepts a Hold Time MUST use the negotiated value for the Hold Time. If the BGP Identifier field of the OPEN message is syntactically - incorrect, then the Error Subcode is set to Bad BGP Identifier. Syn- - tactic correctness means that the BGP Identifier field represents a - valid IP host address. + incorrect, then the Error Subcode MUST be set to Bad BGP Identifier. + Syntactic correctness means that the BGP Identifier field represents + a valid unicast IP host address. - If one of the Optional Parameters in the OPEN message is not - recognized, then the Error Subcode is set to Unsupported Optional + If one of the Optional Parameters in the OPEN message is not recog- + nized, then the Error Subcode MUST be set to Unsupported Optional Parameters. If one of the Optional Parameters in the OPEN message is recognized, - but is malformed, then the Error Subcode is set to 0 (Unspecific). + but is malformed, then the Error Subcode MUST be set to 0 (Unspe- + cific). 6.3 UPDATE message error handling. - All errors detected while processing the UPDATE message are indicated - by sending the NOTIFICATION message with Error Code UPDATE Message - Error. The error subcode elaborates on the specific nature of the - error. + All errors detected while processing the UPDATE message MUST be indi- + cated by sending the NOTIFICATION message with Error Code UPDATE Mes- + sage Error. The error subcode elaborates on the specific nature of + the error. Error checking of an UPDATE message begins by examining the path attributes. If the Withdrawn Routes Length or Total Attribute Length is too large (i.e., if Withdrawn Routes Length + Total Attribute - Length + 23 exceeds the message Length), then the Error Subcode is - set to Malformed Attribute List. + Length + 23 exceeds the message Length), then the Error Subcode MUST + be set to Malformed Attribute List. If any recognized attribute has Attribute Flags that conflict with - the Attribute Type Code, then the Error Subcode is set to Attribute - Flags Error. The Data field contains the erroneous attribute (type, - length and value). + the Attribute Type Code, then the Error Subcode MUST be set to + Attribute Flags Error. The Data field MUST contain the erroneous + attribute (type, length and value). If any recognized attribute has Attribute Length that conflicts with the expected length (based on the attribute type code), then the - Error Subcode is set to Attribute Length Error. The Data field con- - tains the erroneous attribute (type, length and value). + Error Subcode MUST be set to Attribute Length Error. The Data field + MUST contain the erroneous attribute (type, length and value). If any of the mandatory well-known attributes are not present, then - the Error Subcode is set to Missing Well-known Attribute. The Data - field contains the Attribute Type Code of the missing well-known - attribute. + the Error Subcode MUST be set to Missing Well-known Attribute. The + Data field MUST contain the Attribute Type Code of the missing well- + known attribute. If any of the mandatory well-known attributes are not recognized, - then the Error Subcode is set to Unrecognized Well-known Attribute. - The Data field contains the unrecognized attribute (type, length and - value). + then the Error Subcode MUST be set to Unrecognized Well-known + Attribute. The Data field MUST contain the unrecognized attribute + (type, length and value). If the ORIGIN attribute has an undefined value, then the Error Sub- - code is set to Invalid Origin Attribute. The Data field contains the - unrecognized attribute (type, length and value). + code MUST be set to Invalid Origin Attribute. The Data field MUST + contain the unrecognized attribute (type, length and value). If the NEXT_HOP attribute field is syntactically incorrect, then the - Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field - contains the incorrect attribute (type, length and value). Syntactic - correctness means that the NEXT_HOP attribute represents a valid IP - host address. + Error Subcode MUST be set to Invalid NEXT_HOP Attribute. The Data + field MUST contain the incorrect attribute (type, length and value). + Syntactic correctness means that the NEXT_HOP attribute represents a + valid IP host address. The IP address in the NEXT_HOP MUST meet the following criteria to be considered semantically correct: a) It MUST NOT be the IP address of the receiving speaker b) In the case of an EBGP where the sender and receiver are one IP hop away from each other, either the IP address in the NEXT_HOP MUST be the sender's IP address (that is used to establish the BGP connection), or the interface associated with the NEXT_HOP IP address MUST share a common subnet with the receiving BGP speaker. If the NEXT_HOP attribute is semantically incorrect, the error SHOULD be logged, and the route SHOULD be ignored. In this case, a NOTIFICA- TION message SHOULD NOT be sent, and connection SHOULD NOT be closed. The AS_PATH attribute is checked for syntactic correctness. If the - path is syntactically incorrect, then the Error Subcode is set to - Malformed AS_PATH. + path is syntactically incorrect, then the Error Subcode MUST be set + to Malformed AS_PATH. If the UPDATE message is received from an external peer, the local - system MAY check whether the leftmost AS in the AS_PATH attribute is + system MAY check whether the leftmost (with respect to the position + of octets in the protocol message) AS in the AS_PATH attribute is equal to the autonomous system number of the peer that sent the mes- sage. If the check determines that this is not the case, the Error - Subcode is set to Malformed AS_PATH. + Subcode MUST be set to Malformed AS_PATH. If an optional attribute is recognized, then the value of this - attribute is checked. If an error is detected, the attribute is dis- - carded, and the Error Subcode is set to Optional Attribute Error. - The Data field contains the attribute (type, length and value). + attribute MUST be checked. If an error is detected, the attribute + MUST be discarded, and the Error Subcode MUST be set to Optional + Attribute Error. The Data field MUST contain the attribute (type, + length and value). If any attribute appears more than once in the UPDATE message, then - the Error Subcode is set to Malformed Attribute List. + the Error Subcode MUST be set to Malformed Attribute List. The NLRI field in the UPDATE message is checked for syntactic valid- ity. If the field is syntactically incorrect, then the Error Subcode - is set to Invalid Network Field. + MUST be set to Invalid Network Field. If a prefix in the NLRI field is semantically incorrect (e.g., an unexpected multicast IP address), an error SHOULD be logged locally, and the prefix SHOULD be ignored. An UPDATE message that contains correct path attributes, but no NLRI, SHALL be treated as a valid UPDATE message. 6.4 NOTIFICATION message error handling. @@ -1531,21 +1587,22 @@ A BGP speaker MAY support the ability to impose an (locally config- ured) upper bound on the number of address prefixes the speaker is willing to accept from a neighbor. When the upper bound is reached, the speaker (under control of local configuration) either (a) dis- cards new address prefixes from the neighbor (while maintaining BGP connection with the neighbor), or (b) terminates the BGP connection with the neighbor. If the BGP speaker decides to terminate its BGP connection with a neighbor because the number of address prefixes received from the neighbor exceeds the locally configured upper bound, then the speaker MUST send to the neighbor a NOTIFICATION mes- - sage with the Error Code Cease. + sage with the Error Code Cease. The speaker MAY also log this + locally. 6.8 BGP connection collision detection. If a pair of BGP speakers try simultaneously to establish a BGP con- nection to each other, then two parallel connections between this pair of speakers might well be formed. If the source IP address used by one of these connections is the same as the destination IP address used by the other, and the destination IP address used by the first connection is the same as the source IP address used by the other, we refer to this situation as connection collision. Clearly in the @@ -1556,24 +1613,24 @@ for detecting which BGP connection is to be preserved when a colli- sion does occur. The convention is to compare the BGP Identifiers of the peers involved in the collision and to retain only the connection initiated by the BGP speaker with the higher-valued BGP Identifier. Upon receipt of an OPEN message, the local system MUST examine all of its connections that are in the OpenConfirm state. A BGP speaker MAY also examine connections in an OpenSent state if it knows the BGP Identifier of the peer by means outside of the protocol. If among these connections there is a connection to a remote BGP speaker whose - BGP Identifier equals the one in the OPEN message, and this connec- - tion collides with the connection over which the OPEN message is - received then the local system performs the following collision reso- - lution procedure: + BGP Identifier equals the one in the OPEN message, and this + connection collides with the connection over which the OPEN message + is received then the local system performs the following collision + resolution procedure: 1. The BGP Identifier of the local system is compared to the BGP Identifier of the remote system (as specified in the OPEN mes- sage). Comparing BGP Identifiers is done by converting them to host byte order and treating them as (4-octet long) unsigned inte- gers. 2. If the value of the local BGP Identifier is less than the remote one, the local system closes the BGP connection that already exists (the one that is already in the OpenConfirm state), @@ -1602,393 +1659,676 @@ version number each supports. If an open attempt fails with an Error Code OPEN Message Error, and an Error Subcode Unsupported Version Number, then the BGP speaker has available the version number it tried, the version number its peer tried, the version number passed by its peer in the NOTIFICATION message, and the version numbers that it supports. If the two peers do support one or more common versions, then this will allow them to rapidly determine the highest common version. In order to support BGP version negotiation, future versions of BGP MUST retain the format of the OPEN and NOTIFICATION messages. -8. BGP Finite State machine +8. BGP Finite State machine (FSM) + + The data structures and FSM described in this document are + conceptual and do not have to be implemented precisely as described + here, as long as the implementations support the described + functionality and their externally visible behavior is the same. This section specifies the BGP operation in terms of a Finite State Machine (FSM). The section falls into 2 parts: 1) Description of Events for the State machine (Section 8.1) 2) Description of the FSM (Section 8.2) - The data structures and FSM described in this document are conceptual - and do not have to be implemented precisely as described here, as - long as the implementations support the described functionality and - their externally visible behavior is the same. - - Session Attributes required for each connection are: + Session attributes required (mandatory) for each connection are: 1) State - 2) Connect Retry timer - 3) Hold timer - 4) Hold time - 5) Keepalive timer - 6) Keepalive time - 7) Connect Retry Count - 8) Connect Retry Initial Value + 2) ConnectRetryCounter + 3) ConnectRetryTimer + 4) ConnectRetryTime + 5) HoldTimer + 6) HoldTime + 7) KeepaliveTimer + 8) KeepaliveTime + + The state session attribute indicates what state the BGP FSM + is in. The ConnectRetryCounter indicates the number of times + a BGP peer has tried to establish a peer session. + + The mandatory attributes related to timers are described in + section 10. Each timer has a "timer" and a "time" (the initial + value). The optional Session attributes are listed below. These optional attributes may be supported either per connection or per local sys- tem: - 1) Delay Open flag - 2) Open Delay Timer - 3) Perform automatic start flag - 4) Perform automatic stop flag - 5) Passive TCP establishment flag - 6) Perform BGP peer oscillation damping flag - (which will be denoted as stop_peer_flap in text) - 7) Idle Hold timer - 8) Perform Collision detect in Established flag - 9) Accept connections from un-configured peers - 10) Track TCP state flag - 11) Send NOTIFICATION without an OPEN flag + 1) AcceptConnectionsUnconfiguredPeers + 2) AllowAutomaticStart + 3) AllowAutomaticStop + 4) CollisionDetectEstablishedState + 5) DampPeerOscillations + 6) DelayOpen + 7) DelayOpenTime + 8) DelayOpenTimer + 9) IdleHoldTime + 10) IdleHoldTimer + 11) PassiveTcpEstablishment + 12) SendNOTIFICATIONwithoutOPEN + 13) TrackTcpState + + The optional session attributes support different features of the BGP + functionality that have implications for the BGP FSM state + transitions. Two groups of the attributes relate to timers are: + group 1: DelayOpen, DelayOpenTime, DelayOpenTimer + group 2: DampPeerOscillations, IdleHoldTime, IdleHoldTimer + + The first parameter (DelayOpen, DampPeerOscillations) is an + optional attribute that indicates that the Timer function is + active. The "Time" value specifies the initial value for "Timer" + (DelayOpenTime, IdleHoldTime). The "Timer" specifies the actual timer. + + Please refer to section 8.1.1 for an explanation + of the interaction between these optional attributes and the events + signaled to the state machine. Section 8.2.1.4 also provides + a short overview of the different types of optional attributes + (flags or timers). 8.1 Events for the BGP FSM -8.1.1 Administrative Events +8.1.1 Optional Events linked to Optional Session attributes - Please note that only Event 1 (manual start) and Event 2 (manual - stop) are mandatory administrative events. All other administrative - events are optional. The optional attributes do not have to be sup- - ported. However, if these attributes are supported, the state of the - flags should be as indicated. + The Inputs to the BGP FSM are events. Events can either be + mandatory or optional. Some optional events are linked to + optional session attributes. Optional session attributes enable + several groups of FSM functionality. - Event1: Manual start + The description below describes the linkage between FSM + functionality, events and the optional session attributes. + + Group 1: Automatic Administrative Events (Start/Stop) + + Optional Session Attributes: AllowAutomaticStart, AllowAutomaticStop, + DampPeerOscillations, IdleHoldTime, + IdleHoldTimer + + Option 1: AllowAutomaticStart + Description: A BGP peer connection can be started and stopped + by administrative control. This administrative + control can either be manual, based on + operator intervention, or under the control + of logic specific to a BGP implementation. + The term "automatic" refers to a start being + issued to the BGP peer connection FSM when + such logic determines that the BGP peer + connection should be restarted. + + The AllowAutomaticStart attribute specifies + that this BGP connection supports automatic + starting of the BGP connection. + + If the BGP implementation supports + AllowAutomaticStart, the peer may be + repeatedly restarted. Three other options + control the rate at which the automatic + restart occurs: DampPeerOscillations, + IdleHoldTime, and the IdleHoldTimer. + + The DampPeerOscillations option specifies + that the implementation engages additional + logic to damp the oscillations of BGP peers + in the face of sequences of automatic start + and automatic stop. IdleHoldTime specifies + how long the BGP peer is held in the Idle + state prior to allowing the next automatic + restart. The IdleHoldTimer is the timer + that runs to hold the peer in Idle state. + + An example of DampPeerOscillations logic + is an increase of the IdleHoldTime value + if a BGP peer oscillates connectivity + (connected/disconnected) repeatedly + within a time period. To engage this + logic, a peer could connected and disconnect + 10 times within 5 minutes. The IdleHoldTime + value would be reset from 0 to 120 seconds. + + Values: TRUE or FALSE + + Option 2: AllowAutomaticStop + + Description: This BGP peer session optional attribute + indicates that the BGP connection allows + "automatic" stopping of the BGP connection. + An "automatic" stop is defined as a stop under + the control of implementation specific logic. + The implementation specific logic is outside + the scope of this specification. + + Values: TRUE or FALSE + + Option 3: DampPeerOscillations + + Description: The DampPeerOscillations optional session + attribute indicates that this BGP connection + is using logic that damps BGP peer oscillations + in the Idle State. + + Value: TRUE or FALSE + + Option 4: IdleHoldTime + + Description: The IdleHoldTime is a the value + that is set in the IdleHoldtimer. + + Values: Time in seconds + + Option 5: IdleHoldTimer + + Description: The IdleHoldTimer aids in controlling BGP peer + oscillation. The IdleHoldTimer is used to keep + the BGP peer in Idle for a particular duration. + The IdleHoldTimer expired event is described + in section 8.1.3. + + Values: Time in seconds + + Group 2: Unconfigured Peers + + Optional Session Attributes: AcceptConnectionsUnconfiguredPeers + + Option 1: AcceptConnectionsUnconfiguredPeers + + Description: The BGP FSM optionally allows the acceptance of BGP + peer connections from neighbors that are not + pre-configured. The + "AcceptConnectionsUnconfiguredPeers" optional + session attribute allows the FSM to support + the state transitions that allow the + implementation to accept or reject these + unconfigured peers. + + The AcceptConnectionsUnconfiguredPeers has + security implications. Please refer to the + BGP Vulnerabilities document[BGP_VULN] for + details. + + Value: True or False + + Group 3: TCP processing + + Optional Session Attributes: PassiveTcpEstablishment, TrackTcpState + + Option 1: PassiveTcpEstablishment + + Description: This option indicates that the BGP FSM will passively + wait for the remote BGP peer to establish the BGP + TCP connection. + + value: TRUE or FALSE + + Option 2: TrackTcpState + + Description: The BGP FSM normally tracks the end result of a TCP + connection attempt rather than individual TCP messages. + Optionally, the BGP FSM can support additional + interaction with the TCP connection negotiation. The + interaction with the TCP events may increase the + amount of logging the BGP peer connection + requires and the number of BGP FSM changes. + + Value: TRUE or FALSE + + Group 4: BGP Message Processing + + Optional Session Attributes: DelayOpen, DelayOpenTimer, + SendNOTIFICATIONwithoutOPEN, + CollisionDetectEstablishedState + + Option 1: DelayOpen + + Description: The DelayOpen optional session attribute allows + implementations to be configured to delay + sending an OPEN message for specific time + period (DelayOpenTime). The delay allows + the remote BGP Peer time to send the first + OPEN message. + + Value: TRUE or FALSE + + Option 2: DelayOpenTime + + Description: The DelayOpenTime is the initial value that is + set in the DelayOpenTimer. + + Value: Time in seconds + + Option 3: DelayOpenTimer + + Description: The DelayOpenTimer optional session attribute + specifies a time that the local system will wait + prior to sending an OPEN message on the connection. + + Value: Time in seconds + + Option 4: SendNOTIFICATIONwithoutOPEN + + Description: The SendNOTIFICIATONwithoutOPEN allows a peer to + send a NOTIFICATION without first sending an + OPEN message. Without this optional session + attribute, the BGP connection assumes that an + OPEN message must be sent by a peer prior + to the peer sending a NOTIFICATION message. + + Value: True or False + + Option 5: CollisionDetectEstablishedState + + Description: Normally, a Detect Collision (6.8) will + be ignored in the Established state. This + optional session attribute indicates that + this BGP connection processes a + collisions in the Established state. + + Value: True or False + + Note: The optional session attributes clarify the BGP FSM description + for existing features of BGP implementations. The optional + session attributes may be pre-defined for an implementation + and not readable via management interfaces for existing + correct implementations. As newer BGP MIBs (version 2 + and beyond) are supported, these fields will be accessible + via a management interface. + +8.1.2 Administrative Events + + An administrative event is an event in which the operator interface + and BGP Policy engine signal the BGP finite state machine to start or + stop the BGP state machine. The basic start and stop indication are + augmented by optional connection attributes to signal a certain type + of start or stop mechanism to the BGP FSM. An example of this combi- + nation is event 5, AutomaticStart_with_PassiveTcpEstablishment. With + this event, the BGP implementation signals to the BGP FSM that the + implementation is using an Automatic Start with option to use a Pas- + sive TCP Establishment. The Passive TCP establishment signals that + this BGP FSM will wait for the remote side to start the TCP estab- + lishment. + + Please note that only Event 1 (ManualStart) and Event 2 (ManualStop) + are mandatory administrative events. All other administrative events + are optional (Events 3-8). Each event below has a name, definition, + status (mandatory or optional), and what optional session attributes + SHOULD be set at each stage. When generating Event 1 through Event 8 + for the BGP FSM, the conditions specified in the "Optional Attribute + Status" section are verified. If any of these conditions are not + satisfied, then the local system should log a FSM error. + + The settings of optional session attributes may be implicit in some + implementations and therefore may not be set explicitly by an exter- + nal operator action. Section 8.2.1.5 describes these implicit set- + tings of the optional session attributes. The administrative states + described below may also be implicit in some implementations and not + directly configurable by an external operator. + + Event1: ManualStart Definition: Local system administrator manually starts peer connection. Status: Mandatory Optional - attributes: Passive TCP establishment flag SHOULD not be set. + Attribute + Status: The PassiveTcpEstablishment attribute SHOULD be + set to FALSE. + + Event2: ManualStop - Event2: Manual stop Definition: Local system administrator manually stops the peer connection. Status: Mandatory - Event3: Automatic start + Optional + Attribute + Status: No interaction with any optional attributes. + + Event3: AutomaticStart Definition: Local system automatically starts the BGP connection. - Status: Optional depending on local system. + Status: Optional, depending on local system Optional - attributes: 1) Perform automatic start flag SHOULD be set + Attribute + Status: 1) The AllowAutomaticStart attribute SHOULD be set if this event occurs. - 2) if the passive Passive TCP establishment flag - is supported, it SHOULD not be set if this - event occurs. - 3) if bgp peer oscillation damping is supported, - the BGP stop_peer_flap flag should not be set - when this event occurs. + 2) If the PassiveTcpEstablishment optional session + attribute is supported, it SHOULD be set to FALSE. + 3) If the DampPeerOscillations is supported, it + SHOULD be set to FALSE when this event occurs. - Event4: Manual start with passive TCP flag + Event4: ManualStart_with_PassiveTcpEstablishment Definition: Local system administrator manually starts the peer - connection, but has the passive TCP establishment - enabled. The passive TCP establishment flag indicates - that the peer will listen prior to - establishing the connection. + connection, but has the PassiveTcpEstablishment + enabled. The PassiveTcpEstablishment optional + attribute indicates that the peer will listen prior + to establishing the connection. - Status: Optional depending on local system. + Status: Optional, depending on local system Optional - attributes: 1) Passive TCP Establishment flag SHOULD be set. - if this event occurs. - 2) If bgp peer oscilation damping is supported, the - stop_peer_flap flag should not be set when - this event occurs. + Attribute + Status: 1) The PassiveTcpEstablishment attribute SHOULD + be set to TRUE if this event occurs. + 2) The DampPeerOscillations attribute SHOULD be + set to FALSE when this event occurs. - Event5: Automatic start with passive TCP flag + Event5: AutomaticStart_with_PassiveTcpEstablishment Definition: Local system automatically starts the - BGP connection with the passive flag - enabled. The passive flag indicates + BGP connection with the PassiveTcpEstablishment + enabled. The PassiveTcpEstablishment + optional attribute indicates that the peer will listen prior to establishing a connection. - Status: Optional depending on local system use - of a passive connection and automatic start. + Status: Optional, depending on local system Optional - attributes: 1) Perform Automatic start flag SHOULD be set - 2) Passive TCP establishment flag SHOULD be set - 3) If the bgp peer oscillation flag is supported, - the stop_peer_flap flag SHOULD not be set. + Attribute + Status: 1) The AllowAutomaticStart attribute SHOULD + be set to TRUE. + 2) The PassiveTcpEstablishment attribute SHOULD + be set to TRUE + 3) If the DampPeerOscillations attribute is + supported, the DampPeerOscillations SHOULD + be set to FALSE. - Event6: Automatic start with bgp_stop_flap option set + Event6: AutomaticStart_with_DampPeerOscillations Definition: Local system automatically starts the BGP peer connection with peer oscillation damping enabled. The exact method of damping persistent peer oscillations is left up to the - implementation, and is outside the scope of + implementation and is outside the scope of this document. - Status: Optional, used only if the bgp peer has enabled - bgp peer oscillation damping enabled with the - optional attribute settings below. + Status: Optional, depending on local system. Optional - attributes: 1) Perform automatic start flag SHOULD be set - 2) stop_peer_flap flag SHOULD be set - 3) Passive TCP establishment flag SHOULD not be set - (cleared). + Attribute + Status: 1) The AllowAutomaticStart attribute SHOULD + be set to TRUE. + 2) The DampPeerOscillations attribute SHOULD + be set to TRUE. + 3) The PassiveTcpEstablishment attribute + SHOULD be set to FALSE. - Event 7: Automatic start with bgp_stop_flap option set and passive - TCP establishment option set + Event 7: AutomaticStart_with_DampPeerOscillations_and_ + PassiveTcpEstablishment Definition: Local system automatically starts the BGP peer connection with peer oscillation - damping enabled and passive TCP establishment + damping enabled and PassiveTcpEstablishment enabled. The exact method of damping persistent peer oscillations is left up to the - implementation, and is outside the scope of + implementation and is outside the scope of this document. - Status: Optional, used only if the bgp peer has enabled - bgp peer oscillation damping with following optional - flags settings below. + Status: Optional, depending on local system Optional - attributes: 1) Perform automatic start flag SHOULD be set - 2) stop_peer_flap flag SHOULD be set - 3) Passive TCP establishment flag SHOULD be set + Attributes + Status: 1) The AllowAutomaticStart attribute + SHOULD be set to TRUE. + 2) The DampPeerOscillations attribute SHOULD + be set to TRUE. + 3) The PassiveTcpEstablishment attribute + SHOULD be set to TRUE. - Event8: Automatic stop + Event8: AutomaticStop Definition: Local system automatically stops the BGP connection. An example of an automatic stop event is exceeding the number of prefixes for a given peer and the local system automatically disconnecting the peer. - Status: Optional depending on local system + Status: Optional, depending on local system Optional - attributes: 1) Peform automatic stop flag SHOULD Be set - -8.1.2 Timer Events + Attribute + Status: 1) The AllowAutomaticStop attribute + SHOULD be TRUE - Event9: Connect retry timer expires +8.1.3 Timer Events - Definition: An event generated when the Connect Retry timer + Event9: ConnectRetryTime_Expires + Definition: An event generated when the ConnectRetryTimer expires. Status: Mandatory - Event10: Hold timer expires + Event10: HoldTimer_Expires Definition: An event generated when the Hold Timer expires. Status: Mandatory - Event11: Keepalive timer expires + Event11: KeepaliveTimer_Expires - Definition: An event generated when the Keepalive timer expires. + Definition: An event generated when the KeepaliveTimer expires. Status: Mandatory - Event12: Open Delay timer expires - Definition: An event generated when the Open Delay timer expires. + Event12: DelayOpenTimer_Expires + + Definition: An event generated when the DelayOpenTimer expires. Status: Optional Optional - attributes: If this event occurs, - 1) Delay Open flag SHOULD be set - 2) Open Delay timer SHOULD be supported + Attribute + Status: If this event occurs, + 1) DelayOpen attribute SHOULD be set to TRUE, + 2) DelayOpenTime attribute SHOULD be supported, + 3) DelayOpenTimer SHOULD be supported, - Event13: Idle hold timer expires + Event13: IdleHoldTimer_Expires Definition: An event generated when the Idle Hold Timer - expires indicating that the session has completed - waiting for a back-off period to prevent bgp peer - oscillation. + expires indicating that the BGP connection has + completed waiting for the back-off period + to prevent BGP peer oscillation. - The Idle Hold Timer is only used when the persistent - peer oscillation damping function is enabled. + The IdleHoldTimer is only used when the + persistent peer oscillation damping + function is enabled by setting the + DampPeerOscillations optional attribute + is set to TRUE. - Implementations not implementing the presistent peer - oscillation damping function may not have the Idle Hold - Timer. + Implementations not implementing the + persistent peer oscillation damping + function may not have the IdleHoldTimer. Status: Optional Optional - Attributes: If this event occurs: - 1) stop_peer_flap flag SHOULD be set indicating - support for persistent peer oscillation damping - functions, - 2) Idle Hold timer should be supported + Attribute + Status: If this event occurs: + 1) DampPeerOscillations attribute SHOULD be set + to TRUE. + 2) IdleHoldTimer SHOULD have just expired. -8.1.3 TCP Connection based Events +8.1.4 TCP Connection based Events - Event14: TCP connection valid indication + Event14: TcpConnection_Valid Definition: Event indicating the local system reception of - a TCP connection request with a valid source - IP address and TCP port, and valid destination - IP address and TCP Port. The definition of - invalid source, and invalid destination - IP address is left to the implementation. + a TCP connection request with a valid + source IP address and TCP port and a valid + destination IP address and TCP Port. The + definition of invalid source and invalid + destination IP address is left to the + implementation. - BGP's destination port SHOULD be port - 179 as defined by IANA. + BGP's destination port SHOULD be port 179 + as defined by IANA. - TCP connection request is denoted by - the local system receiving a TCP SYN. + TCP connection request is denoted by the + local system receiving a TCP SYN. Status: Optional Optional - Attributes: 1) The Track TCP state flag SHOULD be set if - this event occurs. + Attribute + Status: 1) The TrackTcpState attribute SHOULD be set to + TRUE if this event occurs. - Event15: RCV TCP invalid indication + Event15: Tcp_CR_Invalid - Definition: Event indicating the local system reception of - a TCP connection request with either + Definition: Event indicating the local system reception + of a TCP connection request with either an invalid source address or port number or an invalid destination address or port number. BGP destination port number SHOULD be 179 as defined by IANA. - Again, a TCP connection request - denoted by local system receiving a TCP + A TCP connection request occurs when + the local system receives a TCP SYN. Status: Optional Optional - Attributes: 1) The Track TCP state should be set if this event - occurs. + Attribute + Status: 1) The TrackTcpState attribute should be set to + TRUE if this event occurs. - Event16: TCP connection request Acknowledged + Event16: Tcp_CR_Acked - Definition: Event indicating the Local system's request + Definition: Event indicating the local system's request to establish a TCP connection to the remote peer. - The local system's TCP session sent a TCP - SYN, and received a TCP SYN, ACK messages, - and Sent a TCP ACK. + The local system's TCP connection sent a TCP + SYN, and received a TCP SYN/ACK messages, + and sent a TCP ACK. Status: Mandatory - Event17: TCP connection confirmed - Definition: Event indicates that the local system receiving - a confirmation that the TCP connection has - been established by the remote site. + Event17: TcpConnectionConfirmed + + Definition: Event indicating that the local system has + received a confirmation that the TCP + connection has been established by the + remote site. The remote peer's TCP engine sent a TCP SYN. The local peer's TCP engine sent a SYN, ACK - message, and now has received a final ACK. + message and now has received a final ACK. Status: Mandatory - Event18: TCP connection fails + Event18: TcpConnectionFails - Definition: Event indicates that the local system has + Definition: Event indicating that the local system has received a TCP connection failure notice. The remote BGP peer's TCP machine could have sent a FIN. The local peer would respond with a FIN-ACK. Another alternative is that the local peer indicated a timeout in the - TCP session and downed the connection. + TCP connection and downed the connection. Status: Mandatory -8.1.4 BGP Messages based Events +8.1.5 BGP Message-based Events Event19: BGPOpen Definition: An event is generated when a valid OPEN message has been received. Status: Mandatory - optional - attributes: 1) Delay Open flag SHOULD not be set - 2) Open Delay timer SHOULD not be running + Optional + Attribute + Status: 1) The DelayOpen optional attribute SHOULD + be set to FALSE. + 2) The DelayOpenTimer SHOULD not be running. - Event20: BGPOpen with Open Delay Timer running + Event20: BGPOpen with DelayOpenTimer running - Definition: An event is generated when valid OPEN + Definition: An event is generated when a valid OPEN message has been received for a peer that has a successfully established transport connection and is currently delaying the sending of a BGP open message. Status: Optional Optional - attributes: 1) Delay Open Flag SHOULD be set - 2) Open Delay Timer SHOULD be running. + Attribute + Status: 1) The DelayOpen attribute SHOULD be + set to TRUE. + 2) The DelayOpenTimer SHOULD be running. Event21: BGPHeaderErr Definition: An event is generated when a received BGP message header is not valid. Status: Mandatory Event22: BGPOpenMsgErr - Definition: An event is generated when an OPEN message has been received with errors. Status: Mandatory - Event23: Open collision dump + Event23: OpenCollisionDump Definition: An event generated administratively when a connection collision has been detected while processing an incoming OPEN message and this connection has been - selected to disconnected. See Section + selected to be disconnected. See section 6.8 for more information on collision detection. - Event23 is an administrative based only - implementation specific policy. This - Event may occur if the FSM is implemented - as two linked state machines. + Event23 is an administrative action + generated by implementation logic + that determines that this connection + needs to be dropped per the rules in + section 6.8. This event may occur if the FSM + is implemented as two linked state machines. Status: Optional, depending on local system Optional - Attributes: If the state machine is to process this + Attribute + Status: If the state machine is to process this attribute in Established state, - 1) Peform Collision detect in Established - flag SHOULD be set. + 1) CollisionDetectEstablished + optional attribute SHOULD be set to TRUE - Please note: The Open collision dump can occur + Please note: The OpenCollisionDump event can occur in Idle, Connect, Active, OpenSent, OpenConfirm - without any optional flags being set. + without any optional attributes being set. Event24: NotifMsgVerErr Definition: An event is generated when a NOTIFICATION message with "version error" is received. Status: Mandatory Event25: NotifMsg @@ -1985,23 +2325,22 @@ Event24: NotifMsgVerErr Definition: An event is generated when a NOTIFICATION message with "version error" is received. Status: Mandatory Event25: NotifMsg - Definition: An event is generated when a - NOTIFICATION messages is received and + NOTIFICATION message is received and the error code is anything but "version error". Status: Mandatory Event26: KeepAliveMsg Definition: An event is generated when a KEEPALIVE message is received. @@ -2018,786 +2357,856 @@ Definition: An event is generated when an invalid UPDATE message is received. Status: Mandatory 8.2 Description of FSM 8.2.1 FSM Definition - BGP MUST maintain a separate FSM for each configured peer, Each BGP - peer paired in a potential connection unless configured to remain in - the idle state, or configured to remain passive, will attempt to to - connect to the other. For the purpose of this discussion, the active - or connect side of the TCP connection (the side of a TCP connection + BGP MUST maintain a separate FSM for each configured peer. Each BGP + peer paired in a potential connection, unless configured to remain in + the idle state, or configured to remain passive, will attempt to con- + nect to the other. For the purpose of this discussion, the active or + connecting side of the TCP connection (the side of a TCP connection sending the first TCP SYN packet) is called outgoing. The passive or - listening side (the sender of the first SYN ACK) is called an incom- - ing connection (see Section 8.2.1.1 on the terms active and passive - below). + listening side (the sender of the first SYN/ACK) is called an incom- + ing connection. (See Section 8.2.1.1 for information on the terms + active and passive used below.) A BGP implementation MUST connect to and listen on TCP port 179 for incoming connections in addition to trying to connect to peers. For each incoming connection, a state machine MUST be instantiated. There exists a period in which the identity of the peer on the other - end of an incoming connection is known but the BGP identifier is not + end of an incoming connection is known, but the BGP identifier is not known. During this time, both an incoming and an outgoing connection for the same configured peering may exist. This is referred to as a - connection collision (see Section 6.8). + connection collision. (See Section 6.8.) A BGP implementation will have at most one FSM for each configured peering plus one FSM for each incoming TCP connection for which the peer has not yet been identified. Each FSM corresponds to exactly one TCP connection. - There may be more than one connections between a pair of peers if the + There may be more than one connection between a pair of peers if the connections are configured to use a different pair of IP addresses. This is referred to as multiple "configured peerings" to the same peer. 8.2.1.1 Terms "active" and "passive" - The terms active and passive have been in our vocabulary for almost a - decade and have proven useful. The words active and passive have - slightly different meanings applied to a TCP connection or applied to - a peer. There is only one active side and one passive side to any - one TCP connection per the definition above and the state machine - below. When a BGP speaker is configured active it may end up on - either the active or passive side of the connection that eventually - gets established. Once the TCP connection is completed, it doesn't - matter which end was active and which end was passive and the only - difference is which side of the TCP connection has port number 179. + The terms active and passive have been in the Internet operator's + vocabulary for almost a decade and have proven useful. The words + active and passive have slightly different meanings applied to a TCP + connection or applied to a peer. There is only one active side and + one passive side to any one TCP connection per the definition above + and the state machine below. When a BGP speaker is configured active, + it may end up on either the active or passive side of the connection + that eventually gets established. Once the TCP connection is com- + pleted, it doesn't matter which end was active and which end was pas- + sive. The only difference is which side of the TCP connection has + port number 179. 8.2.1.2 FSM and collision detection - There is one FSM per BGP connection. Prior to determining what peer - a connection is associated with there may be two connections for a - given peer. There SHOULD be no more than one connection per peer. - The collision detection identifies the case where there is more than - one connection per peer and provides guidance for which connection to - get rid of. When this occurs, the corresponding FSM for the connec- + There is one FSM per BGP connection. When the connection collision + occurs prior to determining what peer a connection is associated + with, there may be two connections for one peer. After the connec- + tion collision is resolved (see Section 6.8) the FSM for the connec- tion that is closed SHOULD be disposed of. -8.2.1.3 FSM and Optional Attributes - - Optional Attributes specify either flags that augment the normal pro- - cessing of the BGP FSM, or optional timers. If a Optional attribute - can be set on a system, the Events and the BGP FSM actions must be - supported. For example, if the following options can be set in a BGP - implementation: AutoStart and Passive TCP connection Establishment - flag, then the events 3, 4 and 5 must be supported. +8.2.1.3 FSM and Optional Session Attributes - If an Optional attribute cannot be set (that is declared always off - logically), the events supporting that set of options do not have to + Optional Session Attributes specify either attributes that act + as flags (TRUE or FALSE) or optional timers. For optional + attributes that act as flags, if the optional session attribute + can be set to TRUE on the system, the corresponding the BGP FSM + actions must be supported. For example, if the following options + can be set in a BGP implementation: AutoStart and + PassiveTCPEstablishment, then the events 3, 4 and 5 must be + supported. If an Optional Session attribute cannot be set to + TRUE, the events supporting that set of options do not have to be supported. + Each of the optional timers (DelayOpenTimer and IdleHoldTimer), + has a group of attributes that are: + + - flag indicating support, + - Time set in Timer + - Timer. + + The two optional timers show this format: + + DelayOpenTimer: DelayOpen, DelayOpenTime, DelayOpenTimer + IdleHoldTimer: DampPeerOscillations, IdleHoldTime, + IdleHoldTmer + + If the flag indicating support for an optional timer + (DelayOpen or DampPeerOscillations), cannot be set to TRUE, + the timers and events supporting that + option do not have to be supported. + 8.2.1.4 FSM Event numbers The Event numbers (1-28) utilized in this state machine description aid in specifying the behavior of the BGP state machine. Implementa- tions MAY use these numbers to provide network management informa- - tion. The exact form of the FSM and the FSM events is specific to - each implementation. + tion. The exact form of a FSM or the FSM events are specific to each + implementation. + +8.2.1.5 FSM actions that are implementation dependent. + + The BGP FSM specifies at certain points that BGP initialization will + occur or that BGP resources will be deleted. The initialization of + the BGP FSM and the associated resources depend on the policy portion + of the BGP implementation. The details of these actions are outside + the scope of the FSM document. 8.2.2 Finite State Machine Idle state: - Initially BGP is in the Idle state. + Initially the BGP peer FSM is in the Idle state. (Hereafter + the BGP peer FSM will be shortened to BGP FSM.) - In this state BGP refuses all incoming BGP connections. No - resources are allocated to the peer. In response to a - manual start event(Event1) or an automatic start - event(Event3), the local system: - - initializes all BGP resources, - - sets ConnectRetryCnt (the connect retry counter) to zero - - starts the Connect Retry timer with initial value, + In this state BGP FSM refuses all incoming BGP + connections for this peer. No resources are allocated to the peer. + In response to a ManualStart event (Event 1) or an + AutomaticStart event (Event 3), the local system: + - initializes all BGP resources for the peer connection, + - sets ConnectRetryCounter to zero, + - starts the ConnectRetryTimer with initial value, - initiates a TCP connection to the other BGP peer, - listens for a connection that may be initiated by the remote BGP peer, and - changes its state to Connect. - The manual stop event (Event2) and Automatic stop event (Event 8) + The ManualStop event (Event 2) and AutomaticStop (Event 8) event are ignored in the Idle state. - In response to a manual start event with the passive TCP connection - flag (Event 4) or automatic start with the passive TCP connection - flag (Event 5), the local system: + In response to a ManualStart_with_PassiveTcpEstablishment event + (Event 4) or AutomaticStart_with_PassiveTcpEstablishment event + (Event 5), the local system: - initializes all BGP resources, - - sets ConnectRetryCnt (the connect retry counter) to zero, - - starts the Connect Retry timer with initial value, + - sets the ConnectRetryCounter to zero, + - starts the ConnectRetryTimer with initial value, - listens for a connection that may be initiated by the remote peer, and - changes its state to Active. - The exact value of the ConnectRetry timer is a local + The exact value of the ConnectRetryTimer is a local matter, but it SHOULD be sufficiently large to allow TCP initialization. - If the persistent peer oscillation damping function is - enabled, three additional events may occur within Idle state: - - Automatic start with peer_stop_flap set [Event6], - - Automatic start with peer_stop_flap set and - passive TCP establishment flag set [Event7], - - Idle Hold Timer expired [Event 13]. + If the DampPeerOscillations attribute is set to TRUE, + the following three additional events may occur + within Idle state: + - AutomaticStart_with_DampPeerOscillations (Event6), + - AutomaticStart_with_DampPeerOscillations_and_ + PassiveTcpEstablishment (Event7), + - IdleHoldTimer_Expired (Event 13). + Upon receiving these 3 events, the local system will + use these events to prevent peer oscillations. The method of preventing persistent peer oscillation is outside the scope of this document. - Any other events [Events 9-12, 15-28] received in the Idle state + Any other event (Events 9-12, 15-28) received in the Idle state does not cause change in the state of the local system. Connect State: - In this state, BGP is waiting for the TCP connection to + In this state, BGP FSM is waiting for the TCP connection to be completed. - The start events [Event 1, 3-7] are ignored in connect + The start events (Events 1, 3-7) are ignored in connect state. - In response to a manual stop event [Event2], the local system: + In response to a ManualStop event [Event 2), the local system: - drops the TCP connection, - releases all BGP resources, - - sets ConnectRetryCnt (the connect retry count) to zero - - sets the Connect Retry timer to zero, and + - sets ConnectRetryCounter to zero, + - stops the ConnectRetryTimer and sets ConnectRetryTimer + to zero, and - changes its state to Idle. - In response to the Connect Retry timer expires event [Event - 9], the local system: + In response to the ConnectRetryTimer_Expires event (Event + 9), the local system: - drops the TCP connection, - - restarts the Connect Retry timer, - - stops the Open Delay timer and resets the timer to zero, + - restarts the ConnectRetryTimer, + - stops the DelayOpenTimer and resets the timer to zero, - initiates a TCP connection to the other BGP peer, - continues to listen for a connection that may be initiated by the remote BGP peer, and - stays in Connect state. - If the Open Delay timer expires [Event12] in the connect - state, the local system: + If the DelayOpenTimer_Expires event (Event12) occurs in the + Connect state, the local system: - sends an OPEN message to its peer, - - sets the hold timer to a large value, and + - sets the HoldTimer to a large value, and - changes its state to OpenSent. - If the BGP port receives a valid TCP connection indication - [Event 14], the TCP connection is processed and + If the BGP FSM receives a TcpConnection_valid event + (Event 14), the TCP connection is processed, and the connection remains in the Connect state. - If the TCP connection receives an invalid indication [Event 15]: - the local system rejects the TCP connection and the connection + If the BGP FSM receives a Tcp_CR_Invalid event (Event 15), + the local system rejects the TCP connection, and the connection remains in the Connect state. - If the TCP connection succeeds [Event 16 or Event 17], - the local system checks the Delay Open flag prior to - processing. If the Delay Open flag is set, the local system: - - sets the Connect Retry timer to zero, - - set the Open Delay timer to the initial value, and + If the TCP connection succeeds (Event 16 or + Event 17), the local system checks the DelayOpen attribute prior + to processing. If the DelayOpen attribute is set to TRUE, + the local system: + - stops the ConnectRetryTimer (if running) and sets the + ConnectRetryTimer to zero, + - sets the DelayOpenTimer to the initial value, and - stays in the Connect state. - If the Delay Open flag is not set, the local system: - - sets the Connect Retry timer to zero, + If the DelayOpen attribute is not set to TRUE, the local system: + - stops the ConnectRetryTimer (if running) and sets the + ConnectRetryTimer to zero, - completes BGP initialization - sends an OPEN message to its peer, - - sets hold timer to a large value, and + - sets HoldTimer to a large value, and - changes its state to OpenSent. - A hold timer value of 4 minutes is suggested. + A HoldTimer value of 4 minutes is suggested. - If the TCP connection fails [Event18], the local system checks - the Open Delay Timer. If the Open Delay timer is running, - the local system: - - restarts the connect retry time with initial value, - - stops the Open Delay timer and resets value to zero, + If the TCP connection fails (Event18), + the local system checks the DelayOpenTimer. If the + DelayOpenTimer is running, the local system: + - restarts the ConnectRetryTimer with initial value, + - stops the DelayOpenTimer and resets value to zero, - continues to listen for a connection that may be initiated by the remote BGP peer, and - changes its state to Active. - If the open Delay timer is not running, the local system: - - sets the Connect Retry timer to zero, + + If the DelayOpenTimer is not running, the local system: + - stops the ConnectRetryTimer to zero, - drops the TCP connection, - releases all BGP resources, and - changes its state to Idle. - If an OPEN message is received with the Open Delay timer is - running [Event 20], the local system: - - sets the Connect Retry timer to zero, + If an OPEN message is received while the DelayOpenTimer is + running (Event 20), the local system: + + - stops the ConnectRetryTimer (if running) and + sets the ConnectRetryTimer to zero, - completes the BGP initialization, - - stops and clears the Open Delay timer (sets the value to zero), + - stops and clears the DelayOpenTimer + (sets the value to zero), - sends an OPEN message, - sends a KEEPALIVE message, - - If the hold timer value is non-zero, - - start the keepalive timer to inital value, - - reset the hold timer to the negotiated value, - else if hold timer value is zero, - - reset the keepalive timer, and - - reset the hold timer value to zero + - if the HoldTimer initial value is non-zero, + - starts the keepaliveTimer with the initial value and + - resets the hold timer to the negotiated value, + else if HoldTimer Initial value is zero, + - resets the KeepaliveTimer and + - resets the HoldTimer value to zero, - and changes its state to OpenConfirm. If the value of the autonomous system field is the same as the local Autonomous System number, set the connection status to an internal connection; otherwise it is "external". - If BGP message header checking detects an error [Event 21] or - OPEN message checking detects an error [Event 22] (see section + If BGP message header checking detects an error (Event 21) or + OPEN message checking detects an error (Event 22) (see section 6.2), the local system: - - (optionally) If the Send Notification without Open flag is set, - then the local system first sends a NOTIFICATION message - with the appropriate error code, and then + - (optionally) If the SendNOTIFICATIONwithoutOPEN attribute + is set to TRUE, then the local system first sends + a NOTIFICATION message with the appropriate error + code, and then - - sets the Connect Retry timer to zero, + - stops the ConnectRetryTimer (if running) + and sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, - - and changes its state to Idle. + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping + if the DampPeerOscillations attribute is set to TRUE, and + - changes its state to Idle. If a NOTIFICATION message is received with a version - error[Event24], the local system checks the Open Delay timer. - - If the Open Delay timer is running, the local system: - - sets the Connect Retry timer to zero, - - stops and reset the Open Delay timer (sets to zero), + error(Event24), the local system checks the DelayOpenTimer. + If the DelayOpenTimer is running, the local system: + - stops the ConnectRetryTimer (if running) + and sets the ConnectRetryTimer to zero, + - stops and resets the DelayOpenTimer (sets to zero), - releases all BGP resources, - drops the TCP connection, and - changes its state to Idle. - If the Open Delay timer is not running, the local system: - - sets the Connect Retry timer to zero, + + If the DelayOpenTimer is not running, the local system: + - stops the ConnectRetryTimer and sets the + ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - performs peer oscillation damping if the + DampPeerOscillations attribute is set to True, and - changes its state to Idle. - In response to any other events [Events 8,10-11,13,19,23, - 25-28] the local system: - - if the Connect Retry timer is running, - stop and reset the Connect Retry timer (sets to zero), - - if the Open Delay timer is running, - stop and reset the Open Delay timer (sets to zero), + In response to any other events (Events 8,10-11,13,19,23, + 25-28) the local system: + - if the ConnectRetryTimer is running, + stops and resets the ConnectRetrytimer (sets to zero), + - if the DelayOpenTimer is running, + stops and resets the DelayOpenTimer (sets to zero), - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - performs peer oscillation damping if the + DampPeerOscillations attribute is set to True, and - changes its state to Idle. Active State: - In this state BGP is trying to acquire a peer by listening + In this state BGP FSM is trying to acquire a peer by listening for and accepting a TCP connection. - The start events [Event1, 3-7] are ignored in the Active + The start events (Event1, 3-7) are ignored in the Active state. - In response to a manual stop event[Event2], the local system: - - If the Open Delay timer is running and the - Send NOTIFICATION without Open flag is set, - the local system Sends a NOTIFICATION with a Cease, + In response to a ManualStop event (Event 2), the local system: + - If the DelayOpenTimer is running and the + SendNOTIFICATIONwithoutOPEN session attribute is set, + the local system sends a NOTIFICATION with a Cease, - releases all BGP resources including - - stopping the Open delay timer + stopping the DelayOpenTimer - drops the TCP connection, - - sets ConnectRetryCnt (connect retry count) to zero - - sets the Connect Retry timer to zero, and + - sets ConnectRetryCounter to zero, + - stops the ConnectRetryTimer and sets the + ConnectRetryTimer to zero, and - changes its state to Idle. - In response the ConnectRetry timer expires event[Event9], + In response to a ConnectRetryTimer expires event (Event 9), the local system: - - restarts the Connect Retry timer (with initial value), + - restarts the ConnectRetryTimer (with initial value), - initiates a TCP connection to the other BGP peer, - - Continues to listen for TCP connection that may be + - continues to listen for TCP connection that may be initiated by remote BGP peer, and - changes its state to Connect. - If the local system has the Open Delay timer expired - [Event12], the local system: - - sets the Connect Retry timer to zero, - - stops and clears the Open Delay timer (set to zero), + If the local system receives an DelayOpenTimer_Expired event + (Event 12), the local system: + - sets the ConnectRetryTimer to zero, + - stops and clears the DelayOpenTimer (set to zero), - completes the BGP initialization, - - sends the OPEN message to it's remote peer, + - sends the OPEN message to its remote peer, - sets its hold timer to a large value, and - changes its state to OpenSent. - A hold timer value of 4 minutes is also suggested for this + A HoldTimer value of 4 minutes is also suggested for this state transition. - If the local system receives a valid TCP indication - [Event 14], the local system processes the TCP connection - flags, and stays in Active state. + If the local system receives a TcpConnection_Valid event + (Event 14), the local system processes the TCP connection + flags and stays in Active state. - If the local system receives an invalid TCP indication [Event 15]: - the local system rejects the TCP connection, and stays in + If the local system receives an Tcp_CR_Invalid event (Event 15): + the local system rejects the TCP connection and stays in the Active State. - In response to a TCP connection succeeds [Event 16 or Event 17], the - local system checks the "Delay Open Flag" prior to - processing. If the Delay Open flag is set, the local system - o sets the Connect Retry timer to zero, - o sets the Open Delay timer to the initial value, and - o stays in the Active state. + In response to a TCP connection succeeding (Event 16 or Event 17), the + local system checks the DelayOpen optional attribute prior to + processing. + If the DelayOpen attribute is set to TRUE, the local + system: + - stops the ConnectRetryTimer and sets the + ConnectRetryTimer to zero, + - sets the DelayOpenTimer to the initial value + (DelayOpenTime), and + - stays in the Active state. + If the DelayOpen attribute is set to FALSE, the local + system: + - sets the ConnectRetryTimer to zero, + - completes the BGP initialization, + - sends the OPEN message to its peer, + - sets its HoldTimer to a large value, and + - changes its state to OpenSent. - -If the Delay Open flag is not set, the local system - o sets the Connect Retry timer to zero, - o completes the BGP initialization, - o sends the OPEN message to it's peer, - o sets its hold timer to a large value, and - o changes its state to OpenSent. + A HoldTimer value of 4 minutes is suggested as a "large value" for + the HoldTimer. - A hold timer value of 4 minutes is suggested as a "large value" for - the hold timer. + If the local system receives a TcpConnectionFails event (Event 18), + the local system: - If the local system receives a TCP connection fails event [Event 18], - the local system will: - - restart the Connect Retry timer (with initial value), - - stops and clears the Open Delay Timer (sets the value to zero), - - release all BGP resources - - Acknowledge the drop of TCP connection if - TCP disconnect (send a FIN ACK), - - Increment ConnectRetryCnt (connect retry count) by 1, and - - optionally perform peer oscillation damping, and + - restarts ConnectRetryTimer (with initial value), + - stops and clears the DelayOpenTimer (sets the value to zero), + - releases all BGP resource, + - increments ConnectRetryCounter by 1, + - optionally performs peer oscillation damping if + the DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - If an OPEN message is received with the Open Delay timer is - running [Event 20], the local system - - sets the Connect Retry timer to zero, - - stops and clears the Open Delay timer + If an OPEN message is received and the DelayOpenTimer is + running (Event 20), the local system: + - stops ConnectRetryTimer (if running) and sets + the ConnectRetryTimer to zero, + - stops and clears DelayOpenTimer (sets to zero), - completes the BGP initialization, - sends an OPEN message, - - sends a KEEPALIVE message, and - - if the hold timer value is non-zero, - - starts the keepalive timer to initial value, - - resets the hold timer to the negotiated value, - else if the hold timer is zero - - resets the keepalive timer (set to zero), - - resets the hold timer to zero, - - and changes its state to OpenConfirm. + - sends a KEEPALIVE message, + - if the HoldTimer value is non-zero, + - starts the KeepaliveTimer to initial value, + - resets the HoldTimer to the negotiated value, + else if the HoldTimer is zero + - resets the KeepaliveTimer (set to zero), + - resets the HoldTimer to zero, and + - changes its state to OpenConfirm. - If the value of the autonomous system field is the same as the local - Autonomous System number, set the connection status to an internal - connection; otherwise it is "external". + If the value of the autonomous system field is the same as + the local Autonomous System number, set the connection status + to an internal connection; otherwise it is external. - If BGP message header checking detects an error [Event 21] or OPEN - message checking detects an error [Event 22] (see section 6.2), the - local system: - - (optionally) sends NOTIFICATION message with the - appropriate error code, - - sets the Connect Retry timer to zero, + If BGP message header checking detects an error (Event 21) + or OPEN message checking detects an error (Event 22) (see + section 6.2), the local system: + - (optionally) sends a NOTIFICATION message with the + appropriate error code if the SendNOTIFICATIONwithoutOPEN + attribute is set to TRUE, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, - - and changes its state to Idle. + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and + - changes its state to Idle. If a NOTIFICATION message is received with a version - error[Event24], the local system checks the Open Delay timer. - If the Open Delay timer is running, the local system: - - sets the Connect Retry timer to zero, - - stops and reset the Open Delay timer (sets to zero, + error (Event 24), the local system checks the DelayOpenTimer. + If the DelayOpenTimer is running, the local system: + - stops the ConnectRetryTimer (if running) and + sets the ConnectRetryTimer to zero, + - stops and resets the DelayOpenTimer (sets to zero), - releases all BGP resources, - drops the TCP connection, and - changes its state to Idle. - If the Open Delay timer is not running, the local system: - - sets the Connect Retry timer to zero, + If the DelayOpenTimer is not running, the local system: + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping + if the DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - In response to any other event [Events 8,10-11,13,19,23,25-28], + In response to any other event (Events 8,10-11,13,19,23,25-28), the local system: - - sets the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by one, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by one, + - (optionally) performs peer oscillation damping if + the DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. OpenSent: - In this state BGP waits for an OPEN message from its peer. + In this state BGP FSM waits for an OPEN message from its peer. - The Start events [Event1, 3-7] are ignored in the OpenSent + The start events (Event1, 3-7) are ignored in the OpenSent state. - If a manual stop event [Event 2] is issued in Open sent + If a ManualStop event (Event 2) is issued in OpenSent state, the local system: - sends the NOTIFICATION with a cease, - - sets the Connect Retry timer to zero, - - release all BGP resources, + - sets the ConnectRetryTimer to zero, + - releases all BGP resources, - drops the TCP connection, - - set ConnectRetryCnt (connect retry count) to zero, and + - sets ConnectRetryCounter to zero, and - changes its state to Idle. - If an automatic stop event [Event 8] is issued in OpenSent + If an AutomaticStop event (Event 8) is issued in OpenSent state, the local system: - sends the NOTIFICATION with a cease, - - sets the Connect Retry timer to zero, - - release all the BGP resources + - sets the ConnectRetryTimer to zero, + - release all the BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - If the Hold Timer expires[Event 10], the local system: - - - send a NOTIFICATION message with error code Hold + If the HoldTimer_Expires (Event 10), the local system: + - sends a NOTIFICATION message with error code Hold Timer Expired, - - set the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - If a TCP indication is received for valid connection - [Event 14] or TCP request aknowledgement [Event 16] - is received, or a TCP connect confirm [Event 17] is - received a second TCP session may be in progress. This - second TCP session is tracked per the Connection Collision + If a TcpConnection_Valid (Event 14) or Tcp_CR_Acked (Event 16) + is received, or a TcpConnectConfirm event (Event 17) is + received, a second TCP connection may be in progress. This + second TCP connection is tracked per Connection Collision processing (Section 6.8) until an OPEN message is received. - A TCP connection for an invalid port [Event 15] is ignored. + A TCP Connection Request for an Invalid port + (Tcp_CR_Invalid (Event 15)) is ignored. - If a TCP connection fails event [Event18] indication is received + If a TcpConnectionFails event (Event18) indication is received, the local system: - closes the BGP connection, - - restarts the Connect Retry timer, + - restarts the ConnectRetryTimer, - continues to listen for a connection that may be initiated by the remote BGP peer, and - changes its state to Active. When an OPEN message is received, all fields are checked for correctness. If there are no errors in the OPEN message - [Event 19] the local system: - - resets the Open Delay timer to zero, - - sets the BGP Connect Retry timer to zero, - - sends a KEEPALIVE message and - - sets a KeepAlive timer (via the text below) - - sets the hold timer according to the negotiated value - (see Section 4.2), and + (Event 19), the local system: + - resets the DelayOpenTimer to zero, + - sets the BGP ConnectRetryTimer to zero, + - sends a KEEPALIVE message, and + - sets a KeepAliveTimer (via the text below) + - sets the HoldTimer according to the negotiated value + (see Section 4.2), - changes its state to OpenConfirm. - If the negotiated hold time value is zero, then the Hold and - KeepAlive timers are not started. If the value of the Autonomous + If the negotiated hold time value is zero, then the HoldTimer and + KeepaliveTimer are not started. If the value of the Autonomous System field is the same as the local Autonomous System number, then the connection is an "internal" connection; otherwise, it is an "external" connection. (This will impact UPDATE processing as described below.) - If the BGP message header checking [Event21] or OPEN message - check detects an error (see Section 6.2)[Event22], the local system: - + If the BGP message header checking (Event 21) or OPEN message + check detects an error (Event 22)(see Section 6.2), the local system: - sends a NOTIFICATION message with appropriate error code, - - sets the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - - drops the TCP connection - - increments the ConnectRetryCnt (connect retry cout) by 1, - - optionally performs peer oscillation damping, and + - drops the TCP connection, + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is TRUE, and - changes its state to Idle. Collision detection mechanisms (Section 6.8) need to be - applied when a valid BGP OPEN message is received [Event 19 or - Event 20]. Please refer to Section 6.8 for the details of - the comparison. An administrative collision detect is when - BGP implementation determines by means outside the scope of - this document that a connection collision has occurred. + applied when a valid BGP OPEN message is received (Event 19 or + Event 20). Please refer to Section 6.8 for the details of + the comparison. A CollisionDetectDump event occurs when the + BGP implementation determines, by a means outside the scope of + this document, that a connection collision has occurred. If a connection in OpenSent is determined to be the - connection that must be closed, an open collision dump [Event 23] + connection that must be closed, an OpenCollisionDump (Event 23) is signaled to the state machine. If such an event is - received in OpenSent, the local system: + received in OpenSent state, the local system: - sends a NOTIFICATION with a Cease - - sets the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - increments ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. If a NOTIFICATION message is received with a version - error[Event24], the local system: - - sets the Connect Retry timer to zero + error (Event24), the local system: + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - - drops the TCP connection, + - drops the TCP connection, and - changes its state to Idle. - In response to any other event [Events 9, 11-13,20,25-28], + In response to any other event (Events 9, 11-13,20,25-28), the local system: - sends the NOTIFICATION with the Error Code Finite state machine error, - - sets the Connect Retry timer to zero, - - releases all BGP resources + - sets the ConnectRetryTimer to zero, + - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. OpenConfirm State: In this state BGP waits for a KEEPALIVE or NOTIFICATION message. - Any start event [Event1, 3-7] is ignored in the OpenConfirm + Any start event (Event1, 3-7) is ignored in the OpenConfirm state. - In response to a manual stop event[Event 2] initiated by + In response to a ManualStop event (Event 2) initiated by the operator, the local system: - sends the NOTIFICATION message with Cease, - releases all BGP resources, - - drop the TCP connection, - - sets the ConnectRetryCnt (connect retry count) to zero - - sets the Connect Retry timer to zero, and + - drops the TCP connection, + - sets the ConnectRetryCounter to zero, + - sets the ConnectRetryTimer to zero, and - changes its state to Idle. - In response to the Automatic stop event initiated by the - system[Event 8], the local system: + In response to the AutomaticStop event initiated by the + system (Event 8), the local system: - sends the NOTIFICATION message with Cease, - - sets the Connect Retry timer to zero, - - release all BGP resources, + - sets the ConnectRetryTimer to zero, + - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) - by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping + if the DampPeerOscillations attribute is set to TRUE, + and - changes its state to Idle. - If the Hold Timer expires before a KEEPALIVE message is - received [Event 10], the local system: - - send the NOTIFICATION message with the error code - set to Hold Time Expired, - - sets the Connect Retry timer to zero, + If the HoldTime_Expires event (Event 10) occurs before a KEEPALIVE + message is received, the local system: + - sends the NOTIFICATION message with the error code, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if + the DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - If the local system receives a KEEPALIVE timer expires - event [Event 11], the system: + If the local system receives a KEEPALIVETimer_Expires + event (Event 11), the system: - sends a KEEPALIVE message, - - restarts the Keepalive timer, and + - restarts the KeepaliveTimer, and - remains in OpenConfirmed state. - In the event of TCP connection valid indication [Event 14], or TCP - connection succeeding [Event 16 or Event 17] while in OpenConfirm, - the local system needs to track the 2nd connection. + In the event of TcpConnection_Valid event (Event 14), or TCP + connection succeeding (Event 16 or Event 17) while in OpenConfirm, + the local system needs to track the second connection. - If a TCP connection is attempted to an invalid port [Event - 15], the local system will ignore the second connection + If a TCP connection is attempted to an invalid port (Event + 15), the local system will ignore the second connection attempt. - If the local system receives a TCP connection fails event - [Event 18] from the underlying TCP, or a NOTIFICATION - message [Event 25] the local system: - - sets the Connect Retry timer to zero, + If the local system receives a TcpConnectionFails event + (Event 18) from the underlying TCP or a NOTIFICATION + message (Event 25), the local system: + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) - by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - If the local system receives a NOTIFICATION message [Event 24] - with a version error, the local system: - - sets the Connect Retry timer to zero, + If the local system receives a NOTIFICATION message with a + version error (NotifMsgVerErr (Event 24)), the local system: + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, and - changes its state to Idle. - If the local system receives a valid OPEN message [Event 19], the - collision detect function is processed per Section 6.8. If this - connection is to be dropped due to connection collision, the - local system: - - sends a NOTIFICATION with a Cease - - sets the Connect Retry timer to zero, + If the local system receives a valid OPEN message + (BGPOpen (Event 19)), the collision detect function is + processed per Section 6.8. If this connection is to be + dropped due to connection collision, the local system: + - sends a NOTIFICATION with a Cease, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection (send TCP FIN), - - increments the ConnectRetryCnt by 1 (connect retry count), - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - If an OPEN message is received, all fields are check for - correctness. If the BGP message header checking [Event21] - or OPEN message check detects an error (see Section - 6.2)[Event22], the local system: + If an OPEN message is received, all fields are checked for + correctness. If the BGP message header checking + (BGPHeaderErr (Event21)) or OPEN message check detects + an error (see Section 6.2) (BGPOpenMsgErr(Event22)), the + local system: - sends a NOTIFICATION message with appropriate error code, - - sets the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. If during the processing of another OPEN message, the BGP - implementation determines by means outside the scope of + implementation determines by a means outside the scope of this document that a connection collision has occurred and this connection is to be closed, the local system will - issue a open collision dump [Event 23]. When the local - system receives a open collision dump event [Event 23], the + issue an OpenCollisionDump event (Event 23). When the local + system receives an OpenCollisionDump event (Event 23), the local system: - sends a NOTIFICATION with a Cease - - sets the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - releases all BGP resources - - drops all TCP connection, - - increments the ConnectRetryCnt (connect retry count) by 1, - - optionally performs peer oscillation damping, and + - drops the TCP connection, + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - If the local system receives a KEEPALIVE message[Event 26], - - restarts the Hold timer, and + If the local system receives a KEEPALIVE message + (KeepAliveMsg (Event 26)), the local system: + - restarts the HoldTimer and - changes its state to Established. - In response to any other event [Events 9, 12-13, 20, 27-28], + In response to any other event (Events 9, 12-13, 20, 27-28), the local system: - sends a NOTIFICATION with a code of Finite State Machine Error, - - sets the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retrycount) by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. Established State: - In the Established state BGP can exchange UPDATE, + In the Established state, the BGP FSM can exchange UPDATE, NOTFICATION, and KEEPALIVE messages with its peer. - Any start event (Event 1, 3-7) is ignored in the + Any Start event (Event 1, 3-7) is ignored in the Established state. - In response to a manual stop event (initiated by an - operator)[Event2], the local sytem: + In response to a ManualStop event (initiated by an + operator)(Event2), the local system: - sends the NOTIFICATION message with Cease, - - sets the Connect Retry timer to zero, - - delete all routes associated with this connection, - - release BGP resources, - - drops TCP connection, - - sets ConnectRetryCnt (connect retry count) - to zero (0), and + - sets the ConnectRetryTimer to zero, + - deletes all routes associated with this connection, + - releases BGP resources, + - drops the TCP connection, + - sets ConnectRetryCounter to zero, and - changes its state to Idle. - In response to an automatic stop event initiated by the - system (automatic) [Event8], the local system: + In response to an AutomaticStop event (Event8), the local system: - sends a NOTIFICATION with Cease, - - sets the Connect Retry timer to zero + - sets the ConnectRetryTimer to zero - deletes all routes associated with this connection, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) - by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - An example automatic stop event is exceeding the number of - prefixes for a given peer and the local system - automatically disconnecting the peer. + One reason for an AutomaticStop event is: A BGP receives + UPDATE messages with number of prefixes for a given + peer so that the total prefixes received exceeds the + maximum number of prefixes configured. The local system + automatically disconnects the peer. - If the Hold timer expires [Event10], the local system: + If the HoldTimer_Expires event occurs (Event10), the + local system: - sends a NOTIFICATION message with Error Code Hold Timer Expired, - - sets the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) - by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - If the KeepAlive timer expires [Event11], the local system - sends a KEEPALIVE message, it restarts its KeepAlive timer, - unless the negotiated Hold Time value is zero. + If the KeepaliveTimer_Expires event occurs (Event11), + the local system: + - sends a KEEPALIVE message, and + - restarts its KeepAliveTimer unless the negotiated + HoldTime value is zero. Each time the local system sends a KEEPALIVE or UPDATE - message, it restarts its KeepAlive timer, unless the + message, it restarts its KeepAliveTimer, unless the negotiated Hold Time value is zero. - A TCP connection indication [Event 14] received - for a valid port will cause the 2nd connection to be + A TcpConnection_valid (Event 14) received for a + valid port will cause the second connection to be tracked. - A TCP connection indications for invalid port [Event 15], - will be ignored. + An invalid TCP connection (Tcp_CR_Invalid Event + (Event 15)), will be ignored. - In response to a TCP connection succeeds [Event 16 - or Event 17], the 2nd connection SHALL be tracked until + In response to an indication that the TCP connection + is successfully established (Event 16 + or Event 17), the second connection SHALL be tracked until it sends an OPEN message. - If a valid OPEN message [Event 19] is received, it will be - checked to see if it collides (Section 6.8) with any other - session. If the BGP implementation determines that this - connection needs to be terminated, it will process an open - collision dump event[Event 23]. If this session needs to be - terminated, the connection will be terminated by: - + If a valid OPEN message (BGPOpen (Event 19)) is received, + and if the CollisionDetectEstablishedState optional + attribute is TRUE, the OPEN message will be checked + to see if it collides (Section 6.8) with any other connection. + If the BGP implementation determines that this connection + needs to be terminated, it will process an OpenCollisionDump + event (Event 23). If this connection needs to be + terminated, the local system: - sends a NOTIFICATION with a Cease, - - sets the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - deletes all routes associated with this connection, - releases all BGP resources, - drops the TCP connection, - - increments ConnectRetryCnt (connect retry count) - by 1, - - optionally performs peer oscillation damping, and + - increments ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations is set to TRUE, and - changes its state to Idle. If the local system receives a NOTIFICATION message - [Event24 or Event 25] or a TCP connections fails [Event18] + (Event24 or Event 25) or a TcpConnectionsFails (Event18) from the underlying TCP, it: - - sets the Connect Retry timer to zero, + - sets the ConnectRetryTimer to zero, - deletes all routes associated with this connection, - releases all the BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) - by 1, and + - increments the ConnectRetryCounter by 1, - changes its state to Idle. If the local system receives a KEEPALIVE message - [Event 26], the local system will: + (Event 26), the local system: - restarts its Hold Timer, if the negotiated Hold Time value is non-zero, and - - remain in the Established state. + - remains in the Established state. - If the local system receives an UPDATE message [Event27], - the local system will: - - process the update packet - - restarts its Hold timer, if the negotiated Hold Time + If the local system receives an UPDATE message (Event27), + the local system: + - processes the update packet, + - restarts its HoldTimer if the negotiated HoldTime value is non-zero, and - - remain in the Established state. + - remains in the Established state. If the local system receives an UPDATE message, and the UPDATE message error handling procedure (see Section 6.3) - detects an error [Event28], the local system: + detects an error (Event28), the local system: - sends a NOTIFICATION message with Update error, - sets the Connect Retry timer to zero, - - delets all routes associated with this connection, + - deletes all routes associated with this connection, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) - by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. - In response to any other event [Events 9, 12-13, 20-22] the + In response to any other event (Events 9, 12-13, 20-22) the local system: - sends a NOTIFICATION message with Error Code Finite State Machine Error, - deletes all routes associated with this connection, - - sets the Connect Retry timer to zero + - sets the Connect Retry timer to zero, - releases all BGP resources, - drops the TCP connection, - - increments the ConnectRetryCnt (connect retry count) - by 1, - - optionally performs peer oscillation damping, and + - increments the ConnectRetryCounter by 1, + - (optionally) performs peer oscillation damping if the + DampPeerOscillations attribute is set to TRUE, and - changes its state to Idle. 9. UPDATE Message Handling An UPDATE message may be received only in the Established state. - When an UPDATE message is received, each field is checked for valid- - ity as specified in Section 6.3. + Receiving an UPDATE message in any other state is an error. When an + UPDATE message is received, each field is checked for validity as + specified in Section 6.3. If an optional non-transitive attribute is unrecognized, it is qui- etly ignored. If an optional transitive attribute is unrecognized, the Partial bit (the third high-order bit) in the attribute flags octet is set to 1, and the attribute is retained for propagation to other BGP speakers. If an optional attribute is recognized, and has a valid value, then, depending on the type of the optional attribute, it is processed locally, retained, and updated, if necessary, for possible propaga- @@ -2819,39 +3228,44 @@ Once the BGP speaker updates the Adj-RIB-In, the speaker SHALL run its Decision Process. 9.1 Decision Process The Decision Process selects routes for subsequent advertisement by applying the policies in the local Policy Information Base (PIB) to the routes stored in its Adj-RIBs-In. The output of the Decision Pro- cess is the set of routes that will be advertised to peers; the - selected routes will be stored in the local speaker's Adj-RIB-Out + selected routes will be stored in the local speaker's Adj-RIBs-Out according to policy. + The BGP Decision Process described here is conceptual, and does not + have to be implemented precisely as described here, as long as the + implementations support the described functionality and their exter- + nally visible behavior is the same. + The selection process is formalized by defining a function that takes the attribute of a given route as an argument and returns either (a) a non-negative integer denoting the degree of preference for the route, or (b) a value denoting that this route is ineligible to be - installed in LocRib and will be excluded from the next phase of route - selection. + installed in Loc-RIB and will be excluded from the next phase of + route selection. The function that calculates the degree of preference for a given route SHALL NOT use as its inputs any of the following: the existence of other routes, the non-existence of other routes, or the path attributes of other routes. Route selection then consists of individ- ual application of the degree of preference function to each feasible route, followed by the choice of the one with the highest degree of preference. - The Decision Process operates on routes contained in the Adj-RIB-In, + The Decision Process operates on routes contained in the Adj-RIBs-In, and is responsible for: - selection of routes to be used locally by the speaker - selection of routes to be advertised to other BGP peers - route aggregation and route information reduction The Decision Process takes place in three distinct phases, each trig- gered by a different event: @@ -2890,29 +3304,30 @@ the LOCAL_PREF attribute is taken as the degree of preference, or the local system computes the degree of preference of the route based on preconfigured policy information. Note that the latter (computing the degree of preference based on preconfigured policy information) may result in formation of persistent routing loops. 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 is used as - the LOCAL_PREF value in any IBGP readvertisement. + phase of route selection; otherwise the return value MUST be used + as the LOCAL_PREF value in any IBGP readvertisement. The exact nature of this policy information and the computation involved is a local matter. 9.1.2 Phase 2: Route Selection The Phase 2 decision function is invoked on completion of Phase 1. + The Phase 2 function is a separate process which completes when it has no further work to do. The Phase 2 process considers all routes that are eligible in the Adj-RIBs-In. The Phase 2 decision function is blocked from running while the Phase 3 decision function is in process. The Phase 2 function locks all Adj-RIBs-In prior to commencing its function, and unlocks them on completion. If the NEXT_HOP attribute of a BGP route depicts an address that is @@ -3001,22 +3416,22 @@ ing the BGP route's NEXT_HOP. Mutually recursive routes (routes resolving each other or themselves), also fail the resolvability check. It is also important that implementations do not consider feasible routes that would become unresolvable if they were installed in the Routing Table even if their NEXT_HOPs are resolvable using the cur- rent contents of the Routing Table (an example of such routes would be mutually recursive routes). This check ensures that a BGP speaker does not install in the Routing Table routes that will be removed and - not used by the speaker. Therefore, in addition to local Routing - Table stability, this check also improves behavior of the protocol in + not used by the speaker. Therefore, in addition to local Routing Ta- + ble stability, this check also improves behavior of the protocol in the network. Whenever a BGP speaker identifies a route that fails the resolvabil- ity check because of mutual recursion, an error message SHOULD be logged. 9.1.2.2 Breaking Ties (Phase 2) In its Adj-RIBs-In a BGP speaker may have several routes to the same destination that have the same degree of preference. The local @@ -3082,25 +3497,25 @@ MULTI_EXIT_DISC attribute MAY still be performed. If an implemen- tation chooses to remove MULTI_EXIT_DISC, then the optional com- parison on MULTI_EXIT_DISC if performed at all MUST be performed only among EBGP learned routes. The best EBGP learned route may then be compared with IBGP learned routes after the removal of the MULTI_EXIT_DISC attribute. If MULTI_EXIT_DISC is removed from a subset of EBGP learned routes and the selected "best" EBGP learned route will not have MULTI_EXIT_DISC removed, then the MULTI_EXIT_DISC must be used in the comparison with IBGP learned routes. For IBGP learned routes the MULTI_EXIT_DISC MUST be used - in route comparisons which reach this step in the decision pro- + in route comparisons which reach this step in the Decision Pro- cess. Including the MULTI_EXIT_DISC of an EBGP learned route in the comparison with an IBGP learned route, then removing the - MULTI_EXIT_DISC atribute and advertising the route has been proven - to cause route loops. + MULTI_EXIT_DISC attribute and advertising the route has been + proven to cause route loops. d) If at least one of the candidate routes was received via EBGP, remove from consideration all routes which were received via IBGP. e) Remove from consideration any routes with less-preferred inte- rior cost. The interior cost of a route is determined by calcu- lating the metric to the NEXT_HOP for the route using the Routing Table. If the NEXT_HOP hop for a route is reachable, but no cost can be determined, then this step should be skipped (equivalently, consider all routes to have equal costs). @@ -3174,62 +3589,58 @@ The precedence relationship effectively decomposes less specific routes into two parts: - a set of destinations described only by the less specific route, and - a set of destinations described by the overlap of the less spe- cific and the more specific routes - When overlapping routes are present in the same Adj-RIB-In, the more - specific route takes precedence, in order from more specific to least - specific. - The set of destinations described by the overlap represents a portion of the less specific route that is feasible, but is not currently in use. If a more specific route is later withdrawn, the set of desti- nations described by the overlap will still be reachable using the less specific route. If a BGP speaker receives overlapping routes, the Decision Process MUST consider both routes based on the configured acceptance policy. If both a less and a more specific route are accepted, then the Deci- - sion Process MUST either install both the less and the more specific - routes or it MUST aggregate the two routes and install the aggregated - route, provided that both routes have the same value of the NEXT_HOP - attribute. + sion Process MUST either install in Loc-RIB both the less and the + more specific routes or it MUST aggregate the two routes and install + in Loc-RIB the aggregated route, provided that both routes have the + same value of the NEXT_HOP attribute. If a BGP speaker chooses to aggregate, then it SHOULD either include - all AS used to form the aggreagate in an AS_SET or add the + all AS used to form the aggregate in an AS_SET or add the ATOMIC_AGGREGATE attribute to the route. This attribute is now pri- marily informational. With the elimination of IP routing protocols that do not support classless routing and the elimination of router and host implementations that do not support classless routing, there - is no longer a need to deaggregate. Routes SHOULD NOT be de-aggre- + is no longer a need to de-aggregate. Routes SHOULD NOT be de-aggre- gated. A route that carries ATOMIC_AGGREGATE attribute in particular MUST NOT be de-aggregated. That is, the NLRI of this route can not be made more specific. Forwarding along such a route does not guarantee that IP packets will actually traverse only ASs listed in the AS_PATH attribute of the route. 9.2 Update-Send Process The Update-Send process is responsible for advertising UPDATE mes- sages to all peers. For example, it distributes the routes chosen by the Decision Process to other BGP speakers which may be located in either the same autonomous system or a neighboring autonomous system. When a BGP speaker receives an UPDATE message from an internal peer, the receiving BGP speaker SHALL NOT re-distribute the routing infor- - mation contained in that UPDATE message to other internal peers, - unless the speaker acts as a BGP Route Reflector [RFC2796]. + mation contained in that UPDATE message to other internal peers + (unless the speaker acts as a BGP Route Reflector [RFC2796]). As part of Phase 3 of the route selection process, the BGP speaker has updated its Adj-RIBs-Out. All newly installed routes and all newly unfeasible routes for which there is no replacement route SHALL be advertised to its peers by means of an UPDATE message. A BGP speaker SHOULD NOT advertise a given feasible BGP route from its Adj-RIB-Out if it would produce an UPDATE message containing the same BGP route as was previously advertised. @@ -3245,57 +3656,57 @@ 9.2.1 Controlling Routing Traffic Overhead The BGP protocol constrains the amount of routing traffic (that is, UPDATE messages) in order to limit both the link bandwidth needed to advertise UPDATE messages and the processing power needed by the Decision Process to digest the information contained in the UPDATE messages. 9.2.1.1 Frequency of Route Advertisement - The parameter MinRouteAdvertisementInterval determines the minimum - amount of time that must elapse between advertisement and/or with- - drawal of routes to a particular destination by a BGP speaker to a - peer. This rate limiting procedure applies on a per-destination - basis, although the value of MinRouteAdvertisementInterval is set on - a per BGP peer basis. + The parameter MinRouteAdvertisementIntervalTimer determines the mini- + mum amount of time that must elapse between advertisement and/or + withdrawal of routes to a particular destination by a BGP speaker to + a peer. This rate limiting procedure applies on a per-destination + basis, although the value of MinRouteAdvertisementIntervalTimer is + set on a per BGP peer basis. Two UPDATE messages sent by a BGP speaker to a peer that advertise feasible routes and/or withdrawal of unfeasible routes to some common set of destinations MUST be separated by at least MinRouteAdvertise- - mentInterval. Clearly, this can only be achieved precisely by keeping - a separate timer for each common set of destinations. This would be - unwarranted overhead. Any technique which ensures that the interval - between two UPDATE messages sent from a BGP speaker to a peer that - advertise feasible routes and/or withdrawal of unfeasible routes to - some common set of destinations will be at least MinRouteAdvertise- - mentInterval, and will also ensure a constant upper bound on the - interval is acceptable. + mentIntervalTimer. Clearly, this can only be achieved precisely by + keeping a separate timer for each common set of destinations. This + would be unwarranted overhead. Any technique which ensures that the + interval between two UPDATE messages sent from a BGP speaker to a + peer that advertise feasible routes and/or withdrawal of unfeasible + routes to some common set of destinations will be at least Min- + RouteAdvertisementIntervalTimer, and will also ensure a constant + upper bound on the interval is acceptable. Since fast convergence is needed within an autonomous system, either - (a) the MinRouteAdvertisementInterval used for internal peers SHOULD - be shorter than the MinRouteAdvertisementInterval used for external - peers, or (b) the procedure describe in this section SHOULD NOT apply - for routes sent to internal peers. + (a) the MinRouteAdvertisementIntervalTimer used for internal peers + SHOULD be shorter than the MinRouteAdvertisementIntervalTimer used + for external peers, or (b) the procedure describe in this section + SHOULD NOT apply for routes sent to internal peers. This procedure does not limit the rate of route selection, but only the rate of route advertisement. If new routes are selected multiple - times while awaiting the expiration of MinRouteAdvertisementInterval, - the last route selected SHALL be advertised at the end of MinRouteAd- - vertisementInterval. + times while awaiting the expiration of MinRouteAdvertisementInterval- + Timer, the last route selected SHALL be advertised at the end of Min- + RouteAdvertisementIntervalTimer. 9.2.1.2 Frequency of Route Origination - The parameter MinASOriginationInterval determines the minimum amount - of time that must elapse between successive advertisements of UPDATE - messages that report changes within the advertising BGP speaker's own - autonomous systems. + The parameter MinASOriginationIntervalTimer determines the minimum + amount of time that must elapse between successive advertisements of + UPDATE messages that report changes within the advertising BGP + speaker's own autonomous systems. 9.2.2 Efficient Organization of Routing Information Having selected the routing information which it will advertise, a BGP speaker may avail itself of several methods to organize this information in an efficient manner. 9.2.2.1 Information Reduction Information reduction may imply a reduction in granularity of policy @@ -3331,50 +3742,50 @@ listed individually as in the form of AS_SEQUENCEs. In practice this is not likely to be a problem, since once an IP packet arrives at the edge of a group of autonomous systems, the BGP speaker at that point is likely to have more detailed path infor- mation and can distinguish individual paths to destinations. 9.2.2.2 Aggregating Routing Information Aggregation is the process of combining the characteristics of sev- eral different routes in such a way that a single route can be adver- - tised. Aggregation can occur as part of the decision process to + tised. Aggregation can occur as part of the Decision Process to reduce the amount of routing information that will be placed in the Adj-RIBs-Out. Aggregation reduces the amount of information that a BGP speaker must store and exchange with other BGP speakers. Routes can be aggregated by applying the following procedure separately to path attributes of - like type and to the Network Layer Reachability Information. + the same type and to the Network Layer Reachability Information. Routes that have different MULTI_EXIT_DISC attribute SHALL NOT be aggregated. Path attributes that have different type codes can not be aggregated together. Path attributes of the same type code may be aggregated, according to the following rules: NEXT_HOP: When aggregating routes that have different NEXT_HOP attribute, the NEXT_HOP attribute of the aggregated route SHALL identify an interface on the BGP speaker that performs the aggregation. ORIGIN attribute: If at least one route among routes that are aggregated has ORI- GIN with the value INCOMPLETE, then the aggregated route MUST have the ORIGIN attribute with the value INCOMPLETE. Other- wise, if at least one route among routes that are aggregated has ORIGIN with the value EGP, then the aggregated route MUST - have the origin attribute with the value EGP. In all other case - the value of the ORIGIN attribute of the aggregated route is - IGP. + have the ORIGIN attribute with the value EGP. In all other + cases the value of the ORIGIN attribute of the aggregated route + is IGP. AS_PATH attribute: If routes to be aggregated have identical AS_PATH attributes, then the aggregated route has the same AS_PATH attribute as each individual route. For the purpose of aggregating AS_PATH attributes we model each AS within the AS_PATH attribute as a tuple , where "type" identifies a type of the path segment the AS belongs to (e.g. AS_SEQUENCE, AS_SET), and "value" is the AS number. If @@ -3430,90 +3841,105 @@ fies the conditions and allows for more complex policy configu- rations. ATOMIC_AGGREGATE: If at least one of the routes to be aggregated has ATOMIC_AGGREGATE path attribute, then the aggregated route SHALL have this attribute as well. AGGREGATOR: Any AGGREGATOR attributes from the routes to be aggregated MUST - NOT be included in the aggregated route. The BGP speaker - performing the route aggregation MAY attach a new AGGREGATOR + NOT be included in the aggregated route. The BGP speaker per- + forming the route aggregation MAY attach a new AGGREGATOR attribute (see Section 5.1.7). 9.3 Route Selection Criteria Generally speaking, additional rules for comparing routes among sev- eral alternatives are outside the scope of this document. There are two exceptions: - If the local AS appears in the AS path of the new route being considered, then that new route can not be viewed as better than any other route (provided that the speaker is configured to accept such routes). If such a route were ever used, a routing loop could result. - In order to achieve successful distributed operation, only routes with a likelihood of stability can be chosen. Thus, an AS SHOULD avoid using unstable routes, and it SHOULD NOT make rapid spontaneous changes to its choice of route. Quantifying the terms "unstable" and "rapid" in the previous sentence will require expe- - rience, but the principle is clear. - - Care must be taken to ensure that BGP speakers in the same AS do not - make inconsistent decisions. + rience, but the principle is clear. Routes that are unstable can + be "penalized" (e.g., by using the procedures described in + [RFC2439]). 9.4 Originating BGP routes A BGP speaker may originate BGP routes by injecting routing informa- tion acquired by some other means (e.g. via an IGP) into BGP. A BGP speaker that originates BGP routes assigns the degree of preference - to these routes by passing them through the Decision Process (see - Section 9.1). These routes MAY also be distributed to other BGP - speakers within the local AS as part of the update process (see Sec- - tion 9.2). The decision whether to distribute non-BGP acquired routes - within an AS via BGP or not depends on the environment within the AS - (e.g. type of IGP) and SHOULD be controlled via configuration. + (e.g., via CLI) to these routes by passing them through the Decision + Process (see Section 9.1). These routes MAY also be distributed to + other BGP speakers within the local AS as part of the update process + (see Section 9.2). The decision whether to distribute non-BGP + acquired routes within an AS via BGP or not depends on the environ- + ment within the AS (e.g. type of IGP) and SHOULD be controlled via + configuration. 10 BGP Timers - BGP employs five timers: ConnectRetry (see Section 8), Hold Time (see - Section 4.2), KeepAlive (see Section 8), MinASOriginationInterval - (see Section 9.2.1.2), and MinRouteAdvertisementInterval (see Section - 9.2.1.1). - - The suggested default value for the ConnectRetry timer is 120 sec- - onds. + BGP employs five timers: ConnectRetryTimer (see Section 8), HoldTimer + (see Section 4.2), KeepAliveTimer (see Section 8), MinASOrigination- + IntervalTimer (see Section 9.2.1.2), and MinRouteAdvertisementInter- + valTimer (see Section 9.2.1.1). - The suggested default value for the Hold Time is 90 seconds. + Two optional timers MAY be supported: DelayOpenTimer, IdleHoldTimer + by BGP (see section 8). Section 8 describes their use. The full oper- + ation of these optional timers is outside the scope of this document. - The suggested default value for the KeepAlive timer is 1/3 of the - Hold Time. + ConnectRetryTime is a mandatory FSM attribute that stores the initial + value for the ConnectRetryTimer. The suggested default value for the + ConnectRetryTime is 120 seconds. - The suggested default value for the MinASOriginationInterval is 15 + Holdtime is a mandatory FSM attribute that stores the initial value + for the HoldTimer. The suggested default value for the HoldTime is 90 seconds. - The suggested default value for the MinRouteAdvertisementInterval is - 30 seconds. + During some portions of the state machine (see Section 8), the Hold- + Timer is set to a large value. The suggested default for this large + value is 4 minutes. - An implementation of BGP MUST allow the Hold Time timer to be config- - urable on a per peer basis, and MAY allow the other timers to be con- - figurable. + The KeepaliveTime is a mandatory FSM attribute that stores the ini- + tial value for the KeepaliveTimer. The suggested default value for + the KeepaliveTime is 1/3 of the HoldTime. + + The suggested default value for the MinASOriginationIntervalTimer is + 15 seconds. + + The suggested default value for the MinRouteAdvertisementInterval- + Timer on EBGP connections is 30 seconds. + + The suggested default value for the MinRouteAdvertisementInterval- + Timer on IBGP connections is 5 seconds. + + An implementation of BGP MUST allow the HoldTimer to be configurable + on a per peer basis, and MAY allow the other timers to be config- + urable. To minimize the likelihood that the distribution of BGP messages by a given BGP speaker will contain peaks, jitter SHOULD be applied to the - timers associated with MinASOriginationInterval, KeepAlive, Min- - RouteAdvertisementInterval, and ConnectRetry. A given BGP speaker MAY - apply the same jitter to each of these quantities regardless of the - destinations to which the updates are being sent; that is, jitter - need not be configured on a "per peer" basis. + timers associated with MinASOriginationIntervalTimer, KeepAliveTimer, + MinRouteAdvertisementIntervalTimer, and ConnectRetryTimer. A given + BGP speaker MAY apply the same jitter to each of these quantities + regardless of the destinations to which the updates are being sent; + that is, jitter need not be configured on a "per peer" basis. The suggested default amount of jitter SHALL be determined by multi- plying the base value of the appropriate timer by a random factor which is uniformly distributed in the range from 0.75 to 1.0. A new random value SHOULD be picked each time the timer is set. The range of the jitter random value MAY be configurable. Appendix A. Comparison with RFC1771 There are numerous editorial changes (too many to list here). @@ -3551,20 +3977,22 @@ UPDATE Message Error subcode 7 (AS Routing Loop) has been depre- cated. OPEN Message Error subcode 5 (Authentication Failure) has been deprecated. Use of the Marker field for authentication has been deprecated. Implementations MUST support TCP MD5 [RFC2385] for authentication. + Clarification of BGP FSM. + Appendix B. Comparison with RFC1267 All the changes listed in Appendix A, plus the following. BGP-4 is capable of operating in an environment where a set of reach- able destinations may be expressed via a single IP prefix. The con- cept of network classes, or subnetting is foreign to BGP-4. To accommodate these capabilities BGP-4 changes semantics and encoding associated with the AS_PATH attribute. New text has been added to define semantics associated with IP prefixes. These abilities allow @@ -3567,28 +3995,27 @@ cept of network classes, or subnetting is foreign to BGP-4. To accommodate these capabilities BGP-4 changes semantics and encoding associated with the AS_PATH attribute. New text has been added to define semantics associated with IP prefixes. These abilities allow BGP-4 to support the proposed supernetting scheme [9]. To simplify configuration this version introduces a new attribute, LOCAL_PREF, that facilitates route selection procedures. The INTER_AS_METRIC attribute has been renamed to be MULTI_EXIT_DISC. - A new attribute, ATOMIC_AGGREGATE, has been introduced to insure that certain aggregates are not de-aggregated. Another new attribute, AGGREGATOR, can be added to aggregate routes in order to advertise which AS and which BGP speaker within that AS caused the aggregation. - To insure that Hold Timers are symmetric, the Hold Time is now nego- - tiated on a per-connection basis. Hold Times of zero are now sup- + To insure that Hold Timers are symmetric, the Hold Timer is now nego- + tiated on a per-connection basis. Hold Timers of zero are now sup- ported. Appendix C. Comparison with RFC 1163 All of the changes listed in Appendices A and B, plus the following. To detect and recover from BGP connection collision, a new field (BGP Identifier) has been added to the OPEN message. New text (Section 6.8) has been added to specify the procedure for detecting and recov- ering from collision. @@ -3766,27 +4193,101 @@ more than once within the aggregated AS_PATH attribute, all, but the last instance (rightmost occurrence) of that AS number SHOULD be removed from the aggregated AS_PATH attribute. Security Considerations The authentication mechanism that an implementation of BGP MUST sup- port is specified in [RFC2385]. The authentication provided by this mechanism could be done on a per peer basis. - BGP vulnerabilities analysis is discussed in [XXX]. + BGP vulnerabilities analysis is discussed in [BGP_VULN]. IANA Considerations - All extensions to this protocol, including new message types and Path - Attributes MUST only be made using the Standards Action process - defined in [RFC2434]. + All new BGP message types, Path Attributes Type codes, Message Header + Error subcodes, OPEN Message Error subcodes, and UPDATE Message Error + subcodes MUST only be made using the Standards Action process defined + in [RFC2434]. + + This document defines the following message types: OPEN, UPDATE, + KEEPALIVE, NOTIFICATION. + + This document defines the following Path Attributes Type codes: ORI- + GIN, AS_PATH, NEXT_HOP, MULTI_EXIT_DISC, LOCAL_PREF, ATOMIC_AGGRE- + GATE, AGGREGATOR. + + This document defines the following Message Header Error subcodes: + Connection Not Synchronized, Bad Message Length, Bad Message Type. + + This document defines the following OPEN Message Error subcodes: + Unsupported Version Number, Bad Peer AS, Bad BGP Identifier, Unsup- + ported Optional Parameter, Unacceptable Hold Time. + + This document defines the following UPDATE Message Error subcodes: + Malformed Attribute List, Unrecognized Well-known Attribute, Missing + Well-known Attribute, Attribute Flags Error, Attribute Length Error, + Invalid ORIGIN Attribute, Invalid NEXT_HOP Attribute, Optional + Attribute Error, Invalid Network Field, Malformed AS_PATH. + +IPR Notice + + The IETF has been notified of intellectual property rights claimed in + regard to some or all of the specification contained in this docu- + ment. For more information consult the online list of claimed rights. + + The IETF takes no position regarding the validity or scope of any + intellectual property or other rights that might be claimed to per- + tain to the implementation or use of the technology described in this + document or the extent to which any license under such rights might + or might not be available; neither does it represent that it has made + any effort to identify any such rights. Information on the IETF's + procedures with respect to rights in standards-track and standards- + related documentation can be found in BCP-11. Copies of claims of + rights made available for publication and any assurances of licenses + to be made available, or the result of an attempt made to obtain a + general license or permission for the use of such proprietary rights + by implementors or users of this specification can be obtained from + the IETF Secretariat. + + The IETF invites any interested party to bring to its attention any + copyrights, patents or patent applications, or other proprietary + rights which may cover technology that may be required to practice + this standard. Please address the information to the IETF Executive + Director. + +Full Copyright Notice + + Copyright (C) The Internet Society (2003). All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that the above copyright notice and this paragraph are + included on all such copies and derivative works. However, this doc- + ument itself may not be modified in any way, such as by removing the + copyright notice or references to the Internet Society or other + Internet organizations, except as needed for the purpose of develop- + ing Internet standards in which case the procedures for copyrights + defined in the Internet Standards process must be followed, or as + required to translate it into languages other than English. + + The limited permissions granted above are perpetual and will not be + revoked by the Internet Society or its successors or assigns. + + This document and the information contained herein is provided on an + "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING + TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION + HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MER- + CHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE." Normative References [RFC791] Postel, J., "Internet Protocol - DARPA Internet Program Pro- tocol Specification", RFC791, September 1981. [RFC793] Postel, J., "Transmission Control Protocol - DARPA Internet Program Protocol Specification", RFC793, September 1981. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate @@ -3809,55 +4310,55 @@ [RFC1092] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET Backbone", RFC1092, February 1989. [RFC1093] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, February 1989. [RFC1772] Rekhter, Y., and P. Gross, "Application of the Border Gate- way Protocol in the Internet", RFC1772, March 1995. - [RFC1518] Rekhter, Y., Li, T., "An Architecture for IP Address Allo- - cation with CIDR", RFC 1518, September 1993. + [RFC1518] Rekhter, Y., Li, T., "An Architecture for IP Address + Allocation with CIDR", RFC 1518, September 1993. [RFC1519] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy", RFC1519, September 1993. [RFC1997] R. Chandra, P. Traina, T. Li, "BGP Communities Attribute", RFC 1997, August 1996. [RFC2439] C. Villamizar, R. Chandra, R. Govindan, "BGP Route Flap Damping", RFC2439, November 1998. [RFC2796] Bates, T., Chandra, R., Chen, E., "BGP Route Reflection - An Alternative to Full Mesh IBGP", RFC2796, April 2000. - [RFC2842] R. Chandra, J. Scudder, "Capabilities Advertisement with + [RFC3392] R. Chandra, J. Scudder, "Capabilities Advertisement with BGP-4", RFC2842. [RFC2858] T. Bates, R. Chandra, D. Katz, Y. Rekhter, "Multiprotocol Extensions for BGP-4", RFC2858. [RFC2918] Chen, E., "Route Refresh Capability for BGP-4", RFC2918, September 2000. [RFC3065] Traina, P, McPherson, D., Scudder, J., "Autonomous System Confederations for BGP", RFC3065, February 2001. [IS10747] "Information Processing Systems - Telecommunications and Information Exchange between Systems - Protocol for Exchange of Inter-domain Routeing Information among Intermediate Systems to Sup- port Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 - [XXX] Murphy, S., "BGP Security Vulnerabilities Analysis", draft- - ietf-idr-bgp-vuln-00.txt, work in progress + [BGP_VULN] Murphy, S., "BGP Security Vulnerabilities Analysis", + draft-ietf-idr-bgp-vuln-00.txt, work in progress Editors' Addresses Yakov Rekhter Juniper Networks email: yakov@juniper.net Tony Li Procket Networks, Inc. email: tli@procket.com