draft-ietf-idr-bgp4-26.txt   rfc4271.txt 
Network Working Group Y. Rekhter
INTERNET DRAFT T.Li
Obsoletes: RFC1771 S. Hares
Editors
A Border Gateway Protocol 4 (BGP-4)
<draft-ietf-idr-bgp4-26.txt>
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 Network Working Group Y. Rekhter, Ed.
Task Force (IETF), its areas, and its working groups. Note that Request for Comments: 4271 T. Li, Ed.
other groups may also distribute working documents as Internet- Obsoletes: 1771 S. Hares, Ed.
Drafts. Category: Standards Track January 2006
Internet-Drafts are draft documents valid for a maximum of six months A Border Gateway Protocol 4 (BGP-4)
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 Status of This Memo
http://www.ietf.org/ietf/1id-abstracts.txt
The list of Internet-Draft Shadow Directories can be accessed at This document specifies an Internet standards track protocol for the
http://www.ietf.org/shadow.html. Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2003). All Rights Reserved. Copyright (C) The Internet Society (2006).
Abstract Abstract
The Border Gateway Protocol (BGP) is an inter-Autonomous System This document discusses the Border Gateway Protocol (BGP), which is
routing protocol. an inter-Autonomous System routing protocol.
The primary function of a BGP speaking system is to exchange network The primary function of a BGP speaking system is to exchange network
reachability information with other BGP systems. This network reachability information with other BGP systems. This network
reachability information includes information on the list of reachability information includes information on the list of
Autonomous Systems (ASes) that reachability information traverses.
RFC DRAFT October 2004 This information is sufficient for constructing a graph of AS
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 connectivity for this reachability from which routing loops may be
pruned and some policy decisions at the AS level may be enforced. pruned, and, at the AS level, some policy decisions may be enforced.
BGP-4 provides a set of mechanisms for supporting Classless Inter- BGP-4 provides a set of mechanisms for supporting Classless Inter-
Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms include Domain Routing (CIDR). These mechanisms include support for
support for advertising a set of destinations as an IP prefix, and advertising a set of destinations as an IP prefix, and eliminating
eliminating the concept of network "class" within BGP. BGP-4 also the concept of network "class" within BGP. BGP-4 also introduces
introduces mechanisms which allow aggregation of routes, including mechanisms that allow aggregation of routes, including aggregation of
aggregation of AS paths. 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.
This document obsoletes RFC1771.
RFC DRAFT October 2004
Table of Contents
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 . . . . . . . . . . . . . . . . . . . . . . . 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
RFC DRAFT October 2004 This document obsoletes RFC 1771.
8.2.1.5 FSM actions that are implementation dependent . . . . . . 56 Table of Contents
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 . . . . . . . . . . . . . . . . . . . . . . . 95
IPR Disclosure Acknowledgement . . . . . . . . . . . . . . . . . 97
Copyright Notice . . . . . . . . . . . . . . . . . . . . . . . . 98
Normative References . . . . . . . . . . . . . . . . . . . . . . 98
Non-normative References . . . . . . . . . . . . . . . . . . . . 99
Authors Information . . . . . . . . . . . . . . . . . . . . . . . 100
RFC DRAFT October 2004 1. Introduction ....................................................4
1.1. Definition of Commonly Used Terms ..........................4
1.2. Specification of Requirements ..............................6
2. Acknowledgements ................................................6
3. Summary of Operation ............................................7
3.1. Routes: Advertisement and Storage ..........................9
3.2. Routing Information Base ..................................10
4. Message Formats ................................................11
4.1. Message Header Format .....................................12
4.2. OPEN Message Format .......................................13
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 .........................................29
5.1.6. ATOMIC_AGGREGATE ...................................29
5.1.7. AGGREGATOR .........................................30
6. BGP Error Handling. ............................................30
6.1. Message Header Error Handling .............................31
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 .......................35
6.7. Cease .....................................................35
6.8. BGP Connection Collision Detection ........................35
7. BGP Version Negotiation ........................................36
8. BGP Finite State Machine (FSM) .................................37
8.1. Events for the BGP FSM ....................................38
8.1.1. Optional Events Linked to Optional Session
Attributes .........................................38
8.1.2. Administrative Events ..............................42
8.1.3. Timer Events .......................................46
8.1.4. TCP Connection-Based Events ........................47
8.1.5. BGP Message-Based Events ...........................49
8.2. Description of FSM ........................................51
8.2.1. FSM Definition .....................................51
8.2.1.1. Terms "active" and "passive" ..............52
8.2.1.2. FSM and Collision Detection ...............52
8.2.1.3. FSM and Optional Session Attributes .......52
8.2.1.4. FSM Event Numbers .........................53
8.2.1.5. FSM Actions that are Implementation
Dependent .................................53
8.2.2. Finite State Machine ...............................53
9. UPDATE Message Handling ........................................75
9.1. Decision Process ..........................................76
9.1.1. Phase 1: Calculation of Degree of Preference .......77
9.1.2. Phase 2: Route Selection ...........................77
9.1.2.1. Route Resolvability Condition .............79
9.1.2.2. Breaking Ties (Phase 2) ...................80
9.1.3. Phase 3: Route Dissemination .......................82
9.1.4. Overlapping Routes .................................83
9.2. Update-Send Process .......................................84
9.2.1. Controlling Routing Traffic Overhead ...............85
9.2.1.1. Frequency of Route Advertisement ..........85
9.2.1.2. Frequency of Route Origination ............85
9.2.2. Efficient Organization of Routing Information ......86
9.2.2.1. Information Reduction .....................86
9.2.2.2. Aggregating Routing Information ...........87
9.3. Route Selection Criteria ..................................89
9.4. Originating BGP routes ....................................89
10. BGP Timers ....................................................90
Appendix A. Comparison with RFC 1771 .............................92
Appendix B. Comparison with RFC 1267 .............................93
Appendix C. Comparison with RFC 1163 .............................93
Appendix D. Comparison with RFC 1105 .............................94
Appendix E. TCP Options that May Be Used with BGP ................94
Appendix F. Implementation Recommendations .......................95
Appendix F.1. Multiple Networks Per Message .........95
Appendix F.2. Reducing Route Flapping ...............96
Appendix F.3. Path Attribute Ordering ...............96
Appendix F.4. AS_SET Sorting ........................96
Appendix F.5. Control Over Version Negotiation ......96
Appendix F.6. Complex AS_PATH Aggregation ...........96
Security Considerations ...........................................97
IANA Considerations ...............................................99
Normative References .............................................101
Informative References ...........................................101
Abstract 1. Introduction
The Border Gateway Protocol (BGP) is an inter-Autonomous System rout- The Border Gateway Protocol (BGP) is an inter-Autonomous System
ing protocol. routing protocol.
The primary function of a BGP speaking system is to exchange network The primary function of a BGP speaking system is to exchange network
reachability information with other BGP systems. This network reacha- reachability information with other BGP systems. This network
bility information includes information on the list of Autonomous reachability information includes information on the list of
Systems (ASs) that reachability information traverses. This informa- Autonomous Systems (ASes) that reachability information traverses.
tion is sufficient to construct a graph of AS connectivity for this This information is sufficient for constructing a graph of AS
reachability from which routing loops may be pruned and some policy connectivity for this reachability, from which routing loops may be
decisions at the AS level may be enforced. pruned and, at the AS level, some policy decisions may be enforced.
BGP-4 provides a set of mechanisms for supporting Classless Inter- BGP-4 provides a set of mechanisms for supporting Classless Inter-
Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms include Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms include
support for advertising a set of destinations as an IP prefix and support for advertising a set of destinations as an IP prefix and
eliminating the concept of network "class" within BGP. BGP-4 also eliminating the concept of network "class" within BGP. BGP-4 also
introduces mechanisms which allow aggregation of routes, including introduces mechanisms that allow aggregation of routes, including
aggregation of AS paths. aggregation of AS paths.
Routing information exchanged via BGP supports only the destination- Routing information exchanged via BGP supports only the destination-
based forwarding paradigm, which assumes that a router forwards a based forwarding paradigm, which assumes that a router forwards a
packet based solely on the destination address carried in the IP packet based solely on the destination address carried in the IP
header of the packet. This, in turn, reflects the set of policy deci- header of the packet. This, in turn, reflects the set of policy
sions that can (and can not) be enforced using BGP. BGP can support decisions that can (and cannot) be enforced using BGP. BGP can
only the policies conforming to the destination-based forwarding par- support only those policies conforming to the destination-based
adigm. forwarding paradigm.
1. Definition of commonly used terms 1.1. Definition of Commonly Used Terms
This section provides definition for terms that have a specific mean- This section provides definitions for terms that have a specific
ing to the BGP protocol and that are used throughout the text. meaning to the BGP protocol and that are used throughout the text.
Adj-RIB-In Adj-RIB-In
The Adj-RIBs-In contain unprocessed routing information that has The Adj-RIBs-In contains unprocessed routing information that has
been advertised to the local BGP speaker by its peers. been advertised to the local BGP speaker by its peers.
Adj-RIB-Out Adj-RIB-Out
The Adj-RIBs-Out contains the routes for advertisement to specific The Adj-RIBs-Out contains the routes for advertisement to specific
peers by means of the local speaker's UPDATE messages. peers by means of the local speaker's UPDATE messages.
Autonomous System (AS) Autonomous System (AS)
The classic definition of an Autonomous System is a set of routers The classic definition of an Autonomous System is a set of routers
under a single technical administration, using an interior gateway under a single technical administration, using an interior gateway
protocol (IGP) and common metrics to determine how to route pack- protocol (IGP) and common metrics to determine how to route
ets within the AS, and using an inter-AS routing protocol to packets within the AS, and using an inter-AS routing protocol to
determine how to route packets to other ASs. Since this classic determine how to route packets to other ASes. Since this classic
RFC DRAFT October 2004
definition was developed, it has become common for a single AS to definition was developed, it has become common for a single AS to
use several IGPs and sometimes several sets of metrics within an use several IGPs and, sometimes, several sets of metrics within an
AS. The use of the term Autonomous System here stresses the fact AS. The use of the term Autonomous System stresses the fact that,
that, even when multiple IGPs and metrics are used, the adminis- even when multiple IGPs and metrics are used, the administration
tration of an AS appears to other ASs to have a single coherent of an AS appears to other ASes to have a single coherent interior
interior routing plan and presents a consistent picture of what routing plan, and presents a consistent picture of the
destinations are reachable through it. destinations that are reachable through it.
BGP Identifier BGP Identifier
A 4-octet unsigned integer indicating the BGP Identifier of the A 4-octet unsigned integer that indicates the BGP Identifier of
sender of BGP messages. A given BGP speaker sets the value of its the sender of BGP messages. A given BGP speaker sets the value of
BGP Identifier to an IP address assigned to that BGP speaker. The its BGP Identifier to an IP address assigned to that BGP speaker.
value of the BGP Identifier is determined on startup and is the The value of the BGP Identifier is determined upon startup and is
same for every local interface and every BGP peer. the same for every local interface and BGP peer.
BGP speaker BGP speaker
A router that implements BGP. A router that implements BGP.
EBGP EBGP
External BGP (BGP connection between external peers). External BGP (BGP connection between external peers).
External peer External peer
Peer that is in a different Autonomous System than the local sys- Peer that is in a different Autonomous System than the local
tem. system.
Feasible route Feasible route
An advertised route that is available for use by the recipient. An advertised route that is available for use by the recipient.
IBGP IBGP
Internal BGP (BGP connection between internal peers). Internal BGP (BGP connection between internal peers).
Internal peer Internal peer
Peer that is in the same Autonomous System as the local system. Peer that is in the same Autonomous System as the local system.
IGP IGP
Interior Gateway Protocol - a routing protocol used to exchange Interior Gateway Protocol - a routing protocol used to exchange
routing information among routers within a single Autonomous Sys- routing information among routers within a single Autonomous
tem. System.
Loc-RIB Loc-RIB
The Loc-RIB contains the routes that have been selected by the The Loc-RIB contains the routes that have been selected by the
local BGP speaker's Decision Process. local BGP speaker's Decision Process.
NLRI NLRI
Network Layer Reachability Information. Network Layer Reachability Information.
Route Route
A unit of information that pairs a set of destinations with the A unit of information that pairs a set of destinations with the
attributes of a path to those destinations. The set of
RFC DRAFT October 2004 destinations are systems whose IP addresses are contained in one
IP address prefix carried in the Network Layer Reachability
attributes of a path to those destinations. The set of destina- Information (NLRI) field of an UPDATE message. The path is the
tions are systems whose IP addresses are contained in one IP information reported in the path attributes field of the same
address prefix carried in the Network Layer Reachability Informa- UPDATE message.
tion (NLRI) field of an UPDATE message. The path is the informa-
tion reported in the path attributes field of the same UPDATE mes-
sage.
RIB RIB
Routing Information Base. Routing Information Base.
Unfeasible route Unfeasible route
A previously advertised feasible route that is no longer available A previously advertised feasible route that is no longer available
for use. for use.
2. Acknowledgments 1.2. Specification of Requirements
This document was originally published as RFC 1267 in October 1991, 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 RFC 2119 [RFC2119].
2. Acknowledgements
This document was originally published as [RFC1267] in October 1991,
jointly authored by Kirk Lougheed and Yakov Rekhter. jointly authored by Kirk Lougheed and Yakov Rekhter.
We would like to express our thanks to Guy Almes, Len Bosack, and We would like to express our thanks to Guy Almes, Len Bosack, and
Jeffrey C. Honig for their contributions to the earlier version Jeffrey C. Honig for their contributions to the earlier version
(BGP-1) of this document. (BGP-1) of this document.
We would like to specially acknowledge numerous contributions by Den- We would like to specially acknowledge numerous contributions by
nis Ferguson to the earlier version of this document. Dennis Ferguson to the earlier version of this document.
We like to explicitly thank Bob Braden for the review of the earlier We would like to explicitly thank Bob Braden for the review of the
version (BGP-2) of this document as well as his constructive and earlier version (BGP-2) of this document, and for his constructive
valuable comments. and valuable comments.
We would also like to thank Bob Hinden, Director for Routing of the We would also like to thank Bob Hinden, Director for Routing of the
Internet Engineering Steering Group, and the team of reviewers he Internet Engineering Steering Group, and the team of reviewers he
assembled to review the earlier version (BGP-2) of this document. assembled to review the earlier version (BGP-2) of this document.
This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia This team, consisting of Deborah Estrin, Milo Medin, John Moy, Radia
Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted Perlman, Martha Steenstrup, Mike St. Johns, and Paul Tsuchiya, acted
with a strong combination of toughness, professionalism, and cour- with a strong combination of toughness, professionalism, and
tesy. courtesy.
Certain sections of the document borrowed heavily from IDRP Certain sections of the document borrowed heavily from IDRP
[IS10747], which is the OSI counterpart of BGP. For this credit [IS10747], which is the OSI counterpart of BGP. For this, credit
should be given to the ANSI X3S3.3 group chaired by Lyman Chapin and should be given to the ANSI X3S3.3 group chaired by Lyman Chapin and
to Charles Kunzinger who was the IDRP editor within that group. to Charles Kunzinger, who was the IDRP editor within that group.
We would also like to thank Benjamin Abarbanel, Enke Chen, Edward We would also like to thank Benjamin Abarbanel, Enke Chen, Edward
Crabbe, Mike Craren, Vincent Gillet, Eric Gray, Jeffrey Haas, Dimitry Crabbe, Mike Craren, Vincent Gillet, Eric Gray, Jeffrey Haas, Dimitry
Haskin, Stephen Kent, John Krawczyk, David LeRoy, Dan Massey, Haskin, Stephen Kent, John Krawczyk, David LeRoy, Dan Massey,
Jonathan Natale, Dan Pei, Mathew Richardson, John Scudder, John Jonathan Natale, Dan Pei, Mathew Richardson, John Scudder, John
RFC DRAFT October 2004
Stewart III, Dave Thaler, Paul Traina, Russ White, Curtis Villamizar, Stewart III, Dave Thaler, Paul Traina, Russ White, Curtis Villamizar,
and Alex Zinin for their comments. and Alex Zinin for their comments.
We would like to specially acknowledge Andrew Lange for his help in We would like to specially acknowledge Andrew Lange for his help in
preparing the final version of this document. preparing the final version of this document.
Finally, we would like to thank all the members of the IDR Working 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. Group for their ideas and the 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 3. Summary of Operation
The Border Gateway Protocol (BGP) is an inter-Autonomous System rout- The Border Gateway Protocol (BGP) is an inter-Autonomous System
ing protocol. It is built on experience gained with EGP as defined in routing protocol. It is built on experience gained with EGP (as
[RFC904] and EGP usage in the NSFNET Backbone as described in defined in [RFC904]) and EGP usage in the NSFNET Backbone (as
[RFC1092] and [RFC1093]. described in [RFC1092] and [RFC1093]). For more BGP-related
information, see [RFC1772], [RFC1930], [RFC1997], and [RFC2858].
The primary function of a BGP speaking system is to exchange network The primary function of a BGP speaking system is to exchange network
reachability information with other BGP systems. This network reacha- reachability information with other BGP systems. This network
bility information includes information on the list of Autonomous reachability information includes information on the list of
Systems (ASs) that reachability information traverses. This informa- Autonomous Systems (ASes) that reachability information traverses.
tion is sufficient to construct a graph of AS connectivity from which This information is sufficient for constructing a graph of AS
routing loops may be pruned and some policy decisions at the AS level connectivity, from which routing loops may be pruned, and, at the AS
may be enforced. level, some policy decisions may be enforced.
In the context of this document we assume that a BGP speaker adver- In the context of this document, we assume that a BGP speaker
tises to its peers only those routes that it itself uses (in this advertises to its peers only those routes that it uses itself (in
context a BGP speaker is said to "use" a BGP route if it is the most this context, a BGP speaker is said to "use" a BGP route if it is the
preferred BGP route and is used in forwarding). All other cases are most preferred BGP route and is used in forwarding). All other cases
outside the scope of this document. are outside the scope of this document.
In the context of this document the term "IP address" refers to an IP In the context of this document, the term "IP address" refers to an
Version 4 address [RFC791]. IP Version 4 address [RFC791].
Routing information exchanged via BGP supports only the destination- Routing information exchanged via BGP supports only the destination-
based forwarding paradigm, which assumes that a router forwards a based forwarding paradigm, which assumes that a router forwards a
packet based solely on the destination address carried in the IP packet based solely on the destination address carried in the IP
header of the packet. This, in turn, reflects the set of policy deci- header of the packet. This, in turn, reflects the set of policy
sions that can (and can not) be enforced using BGP. Note that some decisions that can (and cannot) be enforced using BGP. Note that
some policies cannot be supported by the destination-based forwarding
RFC DRAFT October 2004
policies can not be supported by the destination-based forwarding
paradigm, and thus require techniques such as source routing (aka paradigm, and thus require techniques such as source routing (aka
explicit routing) to be enforced. Such policies can not be enforced explicit routing) to be enforced. Such policies cannot be enforced
using BGP either. For example, BGP does not enable one AS to send using BGP either. For example, BGP does not enable one AS to send
traffic to a neighboring AS for forwarding to some destination traffic to a neighboring AS for forwarding to some destination
(reachable through but) beyond that neighboring AS intending that the (reachable through but) beyond that neighboring AS, intending that
traffic take a different route to that taken by the traffic originat- the traffic take a different route to that taken by the traffic
ing in the neighboring AS (for that same destination). On the other originating in the neighboring AS (for that same destination). On
hand, BGP can support any policy conforming to the destination-based the other hand, BGP can support any policy conforming to the
forwarding paradigm. destination-based forwarding paradigm.
BGP-4 provides a new set of mechanisms for supporting Classless BGP-4 provides a new set of mechanisms for supporting Classless
Inter-Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms Inter-Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms
include support for advertising a set of destinations as an IP prefix include support for advertising a set of destinations as an IP prefix
and eliminating the concept of network "class" within BGP. BGP-4 and eliminating the concept of a network "class" within BGP. BGP-4
also introduces mechanisms which allow aggregation of routes, includ- also introduces mechanisms that allow aggregation of routes,
ing aggregation of AS paths. including aggregation of AS paths.
This document uses the term `Autonomous System' (AS) throughout. The This document uses the term `Autonomous System' (AS) throughout. The
classic definition of an Autonomous System is a set of routers under classic definition of an Autonomous System is a set of routers under
a single technical administration, using an interior gateway protocol a single technical administration, using an interior gateway protocol
(IGP) and common metrics to determine how to route packets within the (IGP) and common metrics to determine how to route packets within the
AS, and using an inter-AS routing protocol to determine how to route AS, and using an inter-AS routing protocol to determine how to route
packets to other ASs. Since this classic definition was developed, it packets to other ASes. Since this classic definition was developed,
has become common for a single AS to use several IGPs and sometimes it has become common for a single AS to use several IGPs and,
several sets of metrics within an AS. The use of the term Autonomous sometimes, several sets of metrics within an AS. The use of the term
System here stresses the fact that, even when multiple IGPs and met- Autonomous System stresses the fact that, even when multiple IGPs and
rics are used, the administration of an AS appears to other ASs to metrics are used, the administration of an AS appears to other ASes
have a single coherent interior routing plan and presents a consis- to have a single coherent interior routing plan and presents a
tent picture of what destinations are reachable through it. consistent picture of the destinations that are reachable through it.
BGP uses TCP [RFC793] as its transport protocol. This eliminates the BGP uses TCP [RFC793] as its transport protocol. This eliminates the
need to implement explicit update fragmentation, retransmission, need to implement explicit update fragmentation, retransmission,
acknowledgment, and sequencing. BGP listens on TCP port 179. The acknowledgement, and sequencing. BGP listens on TCP port 179. The
error notification mechanism used in BGP assumes that TCP supports a error notification mechanism used in BGP assumes that TCP supports a
"graceful" close, i.e., that all outstanding data will be delivered "graceful" close (i.e., that all outstanding data will be delivered
before the connection is closed. before the connection is closed).
Two systems form a TCP connection between one another. They exchange A TCP connection is formed between two systems. They exchange
messages to open and confirm the connection parameters. messages to open and confirm the connection parameters.
The initial data flow is the portion of the BGP routing table that is 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). allowed by the export policy, called the Adj-Ribs-Out (see 3.2).
Incremental updates are sent as the routing tables change. BGP does Incremental updates are sent as the routing tables change. BGP does
not require periodic refresh of the routing table. To allow local not require a periodic refresh of the routing table. To allow local
policy changes to have the correct effect without resetting any BGP policy changes to have the correct effect without resetting any BGP
connections, a BGP speaker SHOULD either (a) retain the current ver- connections, a BGP speaker SHOULD either (a) retain the current
sion of the routes advertised to it by all of its peers for the version of the routes advertised to it by all of its peers for the
RFC DRAFT October 2004
duration of the connection, or (b) make use of the Route Refresh duration of the connection, or (b) make use of the Route Refresh
extension [RFC2918]. extension [RFC2918].
KEEPALIVE messages may be sent periodically to ensure the liveness of KEEPALIVE messages may be sent periodically to ensure that the
the connection. NOTIFICATION messages are sent in response to errors connection is live. NOTIFICATION messages are sent in response to
or special conditions. If a connection encounters an error condition, errors or special conditions. If a connection encounters an error
a NOTIFICATION message is sent and the connection is closed. 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 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 peer in the same AS is referred to as an internal peer. Internal BGP
and external BGP are commonly abbreviated IBGP and EBGP. and external BGP are commonly abbreviated as IBGP and EBGP.
If a particular AS has multiple BGP speakers and is providing transit 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 service for other ASes, then care must be taken to ensure a
view of routing within the AS. A consistent view of the interior consistent view of routing within the AS. A consistent view of the
routes of the AS is provided by the IGP used within the AS. For the interior routes of the AS is provided by the IGP used within the AS.
purpose of this document, it is assumed that a consistent view of the For the purpose of this document, it is assumed that a consistent
routes exterior to the AS is provided by having all BGP speakers view of the routes exterior to the AS is provided by having all BGP
within the AS maintain IBGP with each other. speakers within the AS maintain IBGP with each other.
This document specifies the base behavior of the BGP protocol. This This document specifies the base behavior of the BGP protocol. This
behavior can and is modified by extension specifications. When the behavior can be, and is, modified by extension specifications. When
protocol is extended the new behavior is fully documented in the the protocol is extended, the new behavior is fully documented in the
extension specifications. extension specifications.
3.1 Routes: Advertisement and Storage 3.1. Routes: Advertisement and Storage
For the purpose of this protocol, a route is defined as a unit of 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 information that pairs a set of destinations with the attributes of a
path to those destinations. The set of destinations are systems whose path to those destinations. The set of destinations are systems
IP addresses are contained in one IP address prefix carried in the whose IP addresses are contained in one IP address prefix that is
Network Layer Reachability Information (NLRI) field of an UPDATE mes- carried in the Network Layer Reachability Information (NLRI) field of
sage, and the path is the information reported in the path attributes an UPDATE message, and the path is the information reported in the
field of the same UPDATE message. path attributes field of the same UPDATE message.
Routes are advertised between BGP speakers in UPDATE messages. Mul- Routes are advertised between BGP speakers in UPDATE messages.
tiple routes that have the same path attributes can be advertised in Multiple routes that have the same path attributes can be advertised
a single UPDATE message by including multiple prefixes in the NLRI in a single UPDATE message by including multiple prefixes in the NLRI
field of the UPDATE message. field of the UPDATE message.
Routes are stored in the Routing Information Bases (RIBs): namely, 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 the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out, as described in
Section 3.2. Section 3.2.
If a BGP speaker chooses to advertise a previously received route, it 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- MAY add to, or modify, the path attributes of the route before
tising it to a peer. advertising it to a peer.
RFC DRAFT October 2004
BGP provides mechanisms by which a BGP speaker can inform its peer BGP provides mechanisms by which a BGP speaker can inform its peers
that a previously advertised route is no longer available for use. that a previously advertised route is no longer available for use.
There are three methods by which a given BGP speaker can indicate There are three methods by which a given BGP speaker can indicate
that a route has been withdrawn from service: that a route has been withdrawn from service:
a) the IP prefix that expresses the destination for a previously a) the IP prefix that expresses the destination for a previously
advertised route can be advertised in the WITHDRAWN ROUTES field advertised route can be advertised in the WITHDRAWN ROUTES
in the UPDATE message, thus marking the associated route as being field in the UPDATE message, thus marking the associated route
no longer available for use as being no longer available for use,
b) a replacement route with the same NLRI can be advertised, or b) a replacement route with the same NLRI can be advertised, or
c) the BGP speaker - BGP speaker connection can be closed, which c) the BGP speaker connection can be closed, which implicitly
implicitly removes from service all routes which the pair of removes all routes the pair of speakers had advertised to each
speakers had advertised to each other. other from service.
Changing attribute(s) of a route is accomplished by advertising a Changing the attribute(s) of a route is accomplished by advertising a
replacement route. The replacement route carries new (changed) replacement route. The replacement route carries new (changed)
attributes and has the same address prefix as the original route. attributes and has the same address prefix as the original route.
3.2 Routing Information Base 3.2. Routing Information Base
The Routing Information Base (RIB) within a BGP speaker consists of The Routing Information Base (RIB) within a BGP speaker consists of
three distinct parts: three distinct parts:
a) Adj-RIBs-In: The Adj-RIBs-In store routing information that has a) Adj-RIBs-In: The Adj-RIBs-In stores routing information learned
been learned from inbound UPDATE messages received from other BGP from inbound UPDATE messages that were received from other BGP
speakers. Their contents represent routes that are available as an speakers. Their contents represent routes that are available
input to the Decision Process. as input to the Decision Process.
b) Loc-RIB: The Loc-RIB contains the local routing information b) Loc-RIB: The Loc-RIB contains the local routing information the
that the BGP speaker has selected by applying its local policies BGP speaker selected by applying its local policies to the
to the routing information contained in its Adj-RIBs-In. These are routing information contained in its Adj-RIBs-In. These are
the routes that will be used by the local BGP speaker. The next the routes that will be used by the local BGP speaker. The
hop for each of these routes MUST be resolvable via the local BGP next hop for each of these routes MUST be resolvable via the
speaker's Routing Table. local BGP speaker's Routing Table.
c) Adj-RIBs-Out: The Adj-RIBs-Out store the information that the c) Adj-RIBs-Out: The Adj-RIBs-Out stores information the local BGP
local BGP speaker has selected for advertisement to its peers. The speaker selected for advertisement to its peers. The routing
routing information stored in the Adj-RIBs-Out will be carried in information stored in the Adj-RIBs-Out will be carried in the
the local BGP speaker's UPDATE messages and advertised to its local BGP speaker's UPDATE messages and advertised to its
peers. peers.
In summary, the Adj-RIBs-In contain unprocessed routing information In summary, the Adj-RIBs-In contains unprocessed routing information
that has been advertised to the local BGP speaker by its peers; the that has been advertised to the local BGP speaker by its peers; the
Loc-RIB contains the routes that have been selected by the local BGP Loc-RIB contains the routes that have been selected by the local BGP
speaker's Decision Process; and the Adj-RIBs-Out organize the routes speaker's Decision Process; and the Adj-RIBs-Out organizes the routes
for advertisement to specific peers (by means of the local speaker's
RFC DRAFT October 2004 UPDATE messages).
for advertisement to specific peers by means of the local speaker's
UPDATE messages.
Although the conceptual model distinguishes between Adj-RIBs-In, Loc- Although the conceptual model distinguishes between Adj-RIBs-In,
RIB, and Adj-RIBs-Out, this neither implies nor requires that an Loc-RIB, and Adj-RIBs-Out, this neither implies nor requires that an
implementation must maintain three separate copies of the routing implementation must maintain three separate copies of the routing
information. The choice of implementation (for example, 3 copies of information. The choice of implementation (for example, 3 copies of
the information vs 1 copy with pointers) is not constrained by the the information vs 1 copy with pointers) is not constrained by the
protocol. protocol.
Routing information that the BGP speaker uses to forward packets (or Routing information that the BGP speaker uses to forward packets (or
to construct the forwarding table that is used for packet forwarding) to construct the forwarding table used for packet forwarding) is
is maintained in the Routing Table. The Routing Table accumulates maintained in the Routing Table. The Routing Table accumulates
routes to directly connected networks, static routes, routes learned routes to directly connected networks, static routes, routes learned
from the IGP protocols, and routes learned from BGP. Whether or not from the IGP protocols, and routes learned from BGP. Whether a
a specific BGP route should be installed in the Routing Table, and specific BGP route should be installed in the Routing Table, and
whether a BGP route should override a route to the same destination whether a BGP route should override a route to the same destination
installed by another source is a local policy decision, not specified installed by another source, is a local policy decision, and is not
in this document. Besides actual packet forwarding, the Routing Table specified in this document. In addition to actual packet forwarding,
is used for resolution of the next-hop addresses specified in BGP the Routing Table is used for resolution of the next-hop addresses
updates (see Section 5.1.3). specified in BGP updates (see Section 5.1.3).
4. Message Formats 4. Message Formats
This section describes message formats used by BGP. This section describes message formats used by BGP.
BGP messages are sent over a TCP connection. A message is processed BGP messages are sent over TCP connections. A message is processed
only after it is entirely received. The maximum message size is 4096 only after it is entirely received. The maximum message size is 4096
octets. All implementations are required to support this maximum mes- octets. All implementations are required to support this maximum
sage size. The smallest message that may be sent consists of a BGP message size. The smallest message that may be sent consists of a
header without a data portion, or 19 octets. BGP header without a data portion (19 octets).
All multi-octet fields are in network byte order. All multi-octet fields are in network byte order.
4.1 Message Header Format 4.1. Message Header Format
Each message has a fixed-size header. There may or may not be a data
portion following the header, depending on the message type. The lay-
out of these fields is shown below:
RFC DRAFT October 2004 Each message has a fixed-size header. There may or may not be a data
portion following the header, depending on the message type. The
layout of these fields is shown below:
0 1 2 3 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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
+ + + +
| | | |
+ + + +
| Marker | | Marker |
+ + + +
skipping to change at page 13, line 29 skipping to change at page 12, line 33
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Marker: Marker:
This 16-octet field is included for compatibility; it MUST be This 16-octet field is included for compatibility; it MUST be
set to all ones. set to all ones.
Length: Length:
This 2-octet unsigned integer indicates the total length of the This 2-octet unsigned integer indicates the total length of the
message, including the header, in octets. Thus, e.g., it allows message, including the header in octets. Thus, it allows one
one to locate in the TCP stream the (Marker field of the) next to locate the (Marker field of the) next message in the TCP
message. The value of the Length field MUST always be at least stream. The value of the Length field MUST always be at least
19 and no greater than 4096, and MAY be further constrained, 19 and no greater than 4096, and MAY be further constrained,
depending on the message type. No "padding" of extra data after depending on the message type. "padding" of extra data after
the message is allowed, so the Length field MUST have the the message is not allowed. Therefore, the Length field MUST
smallest value required given the rest of the message. have the smallest value required, given the rest of the
message.
Type: Type:
This 1-octet unsigned integer indicates the type code of the This 1-octet unsigned integer indicates the type code of the
message. This document defines the following type codes: message. This document defines the following type codes:
1 - OPEN 1 - OPEN
2 - UPDATE 2 - UPDATE
3 - NOTIFICATION 3 - NOTIFICATION
4 - KEEPALIVE 4 - KEEPALIVE
[RFC2918] defines one more type code. [RFC2918] defines one more type code.
4.2 OPEN Message Format 4.2. OPEN Message Format
After a TCP connection is established, the first message sent by each After a TCP connection is established, the first message sent by each
side is an OPEN message. If the OPEN message is acceptable, a side is an OPEN message. If the OPEN message is acceptable, a
RFC DRAFT October 2004
KEEPALIVE message confirming the OPEN is sent back. KEEPALIVE message confirming the OPEN is sent back.
In addition to the fixed-size BGP header, the OPEN message contains In addition to the fixed-size BGP header, the OPEN message contains
the following fields: the following fields:
0 1 2 3 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 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 | | Version |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 14, line 33 skipping to change at page 13, line 35
| Opt Parm Len | | Opt Parm Len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
| Optional Parameters (variable) | | Optional Parameters (variable) |
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Version: Version:
This 1-octet unsigned integer indicates the protocol version This 1-octet unsigned integer indicates the protocol version
number of the message. The current BGP version number is 4. number of the message. The current BGP version number is 4.
My Autonomous System: My Autonomous System:
This 2-octet unsigned integer indicates the Autonomous System This 2-octet unsigned integer indicates the Autonomous System
number of the sender. number of the sender.
Hold Time: Hold Time:
This 2-octet unsigned integer indicates the number of seconds This 2-octet unsigned integer indicates the number of seconds
that the sender proposes for the value of the Hold Timer. Upon the sender proposes for the value of the Hold Timer. Upon
receipt of an OPEN message, a BGP speaker MUST calculate the receipt of an OPEN message, a BGP speaker MUST calculate the
value of the Hold Timer by using the smaller of its configured value of the Hold Timer by using the smaller of its configured
Hold Time and the Hold Time received in the OPEN message. The Hold Time and the Hold Time received in the OPEN message. The
Hold Time MUST be either zero or at least three seconds. An Hold Time MUST be either zero or at least three seconds. An
implementation MAY reject connections on the basis of the Hold implementation MAY reject connections on the basis of the Hold
Time. The calculated value indicates the maximum number of Time. The calculated value indicates the maximum number of
seconds that may elapse between the receipt of successive seconds that may elapse between the receipt of successive
KEEPALIVE, and/or UPDATE messages by the sender. KEEPALIVE and/or UPDATE messages from the sender.
BGP Identifier: BGP Identifier:
RFC DRAFT October 2004
This 4-octet unsigned integer indicates the BGP Identifier of This 4-octet unsigned integer indicates the BGP Identifier of
the sender. A given BGP speaker sets the value of its BGP Iden- the sender. A given BGP speaker sets the value of its BGP
tifier to an IP address assigned to that BGP speaker. The Identifier to an IP address that is assigned to that BGP
value of the BGP Identifier is determined on startup and is the speaker. The value of the BGP Identifier is determined upon
same for every local interface and every BGP peer. startup and is the same for every local interface and BGP peer.
Optional Parameters Length: Optional Parameters Length:
This 1-octet unsigned integer indicates the total length of the This 1-octet unsigned integer indicates the total length of the
Optional Parameters field in octets. If the value of this field Optional Parameters field in octets. If the value of this
is zero, no Optional Parameters are present. field is zero, no Optional Parameters are present.
Optional Parameters: Optional Parameters:
This field contains a list of optional parameters, where each This field contains a list of optional parameters, in which
parameter is encoded as a <Parameter Type, Parameter Length, each parameter is encoded as a <Parameter Type, Parameter
Parameter Value> triplet. Length, Parameter Value> triplet.
0 1 0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
| Parm. Type | Parm. Length | Parameter Value (variable) | Parm. Type | Parm. Length | Parameter Value (variable)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
Parameter Type is a one octet field that unambiguously identi- Parameter Type is a one octet field that unambiguously
fies individual parameters. Parameter Length is a one octet identifies individual parameters. Parameter Length is a one
field that contains the length of the Parameter Value field in octet field that contains the length of the Parameter Value
octets. Parameter Value is a variable length field that is field in octets. Parameter Value is a variable length field
interpreted according to the value of the Parameter Type field. that is interpreted according to the value of the Parameter
Type field.
[RFC3392] defines the Capabilities Optional Parameter. [RFC3392] defines the Capabilities Optional Parameter.
The minimum length of the OPEN message is 29 octets (including mes- The minimum length of the OPEN message is 29 octets (including the
sage header). message header).
4.3 UPDATE Message Format 4.3. UPDATE Message Format
UPDATE messages are used to transfer routing information between BGP UPDATE messages are used to transfer routing information between BGP
peers. The information in the UPDATE message can be used to construct peers. The information in the UPDATE message can be used to
a graph describing the relationships of the various Autonomous Sys- construct a graph that describes the relationships of the various
tems. By applying rules to be discussed, routing information loops Autonomous Systems. By applying rules to be discussed, routing
and some other anomalies may be detected and removed from inter-AS information loops and some other anomalies may be detected and
routing. removed from inter-AS routing.
An UPDATE message is used to advertise feasible routes sharing common
path attributes to a peer, or to withdraw multiple unfeasible routes
RFC DRAFT October 2004
from service (see 3.1). An UPDATE message MAY simultaneously adver- An UPDATE message is used to advertise feasible routes that share
tise a feasible route and withdraw multiple unfeasible routes from common path attributes to a peer, or to withdraw multiple unfeasible
service. The UPDATE message always includes the fixed-size BGP routes from service (see 3.1). An UPDATE message MAY simultaneously
header, and also includes the other fields as shown below (note, some advertise a feasible route and withdraw multiple unfeasible routes
of the shown fields may not be present in every UPDATE message): from service. The UPDATE message always includes the fixed-size BGP
header, and also includes the other fields, as shown below (note,
some of the shown fields may not be present in every UPDATE message):
+-----------------------------------------------------+ +-----------------------------------------------------+
| Withdrawn Routes Length (2 octets) | | Withdrawn Routes Length (2 octets) |
+-----------------------------------------------------+ +-----------------------------------------------------+
| Withdrawn Routes (variable) | | Withdrawn Routes (variable) |
+-----------------------------------------------------+ +-----------------------------------------------------+
| Total Path Attribute Length (2 octets) | | Total Path Attribute Length (2 octets) |
+-----------------------------------------------------+ +-----------------------------------------------------+
| Path Attributes (variable) | | Path Attributes (variable) |
+-----------------------------------------------------+ +-----------------------------------------------------+
| Network Layer Reachability Information (variable) | | Network Layer Reachability Information (variable) |
+-----------------------------------------------------+ +-----------------------------------------------------+
Withdrawn Routes Length: Withdrawn Routes Length:
This 2-octets unsigned integer indicates the total length of This 2-octets unsigned integer indicates the total length of
the Withdrawn Routes field in octets. Its value allows the the Withdrawn Routes field in octets. Its value allows the
length of the Network Layer Reachability Information field to length of the Network Layer Reachability Information field to
be determined as specified below. be determined, as specified below.
A value of 0 indicates that no routes are being withdrawn from A value of 0 indicates that no routes are being withdrawn from
service, and that the WITHDRAWN ROUTES field is not present in service, and that the WITHDRAWN ROUTES field is not present in
this UPDATE message. this UPDATE message.
Withdrawn Routes: Withdrawn Routes:
This is a variable length field that contains a list of IP This is a variable-length field that contains a list of IP
address prefixes for the routes that are being withdrawn from address prefixes for the routes that are being withdrawn from
service. Each IP address prefix is encoded as a 2-tuple of the service. Each IP address prefix is encoded as a 2-tuple of the
form <length, prefix>, whose fields are described below: form <length, prefix>, whose fields are described below:
+---------------------------+ +---------------------------+
| Length (1 octet) | | Length (1 octet) |
+---------------------------+ +---------------------------+
| Prefix (variable) | | Prefix (variable) |
+---------------------------+ +---------------------------+
The use and the meaning of these fields are as follows: The use and the meaning of these fields are as follows:
a) Length: a) Length:
RFC DRAFT October 2004
The Length field indicates the length in bits of the IP The Length field indicates the length in bits of the IP
address prefix. A length of zero indicates a prefix that address prefix. A length of zero indicates a prefix that
matches all IP addresses (with prefix, itself, of zero matches all IP addresses (with prefix, itself, of zero
octets). octets).
b) Prefix: b) Prefix:
The Prefix field contains an IP address prefix followed by The Prefix field contains an IP address prefix, followed by
the minimum number of trailing bits needed to make the end the minimum number of trailing bits needed to make the end
of the field fall on an octet boundary. Note that the value of the field fall on an octet boundary. Note that the value
of trailing bits is irrelevant. of trailing bits is irrelevant.
Total Path Attribute Length: Total Path Attribute Length:
This 2-octet unsigned integer indicates the total length of the This 2-octet unsigned integer indicates the total length of the
Path Attributes field in octets. Its value allows the length of Path Attributes field in octets. Its value allows the length
the Network Layer Reachability field to be determined as speci- of the Network Layer Reachability field to be determined as
fied below. specified below.
A value of 0 indicates that neither the Network Layer Reacha- A value of 0 indicates that neither the Network Layer
bility Information field, nor the Path Attribute field is Reachability Information field nor the Path Attribute field is
present in this UPDATE message. present in this UPDATE message.
Path Attributes: Path Attributes:
A variable length sequence of path attributes is present in A variable-length sequence of path attributes is present in
every UPDATE message, except for an UPDATE message that carries every UPDATE message, except for an UPDATE message that carries
only the withdrawn routes. Each path attribute is a triple only the withdrawn routes. Each path attribute is a triple
<attribute type, attribute length, attribute value> of variable <attribute type, attribute length, attribute value> of variable
length. length.
Attribute Type is a two-octet field that consists of the Attribute Type is a two-octet field that consists of the
Attribute Flags octet followed by the Attribute Type Code Attribute Flags octet, followed by the Attribute Type Code
octet. octet.
0 1 0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Attr. Flags |Attr. Type Code| | Attr. Flags |Attr. Type Code|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The high-order bit (bit 0) of the Attribute Flags octet is the The high-order bit (bit 0) of the Attribute Flags octet is the
Optional bit. It defines whether the attribute is optional (if Optional bit. It defines whether the attribute is optional (if
set to 1) or well-known (if set to 0). set to 1) or well-known (if set to 0).
The second high-order bit (bit 1) of the Attribute Flags octet The second high-order bit (bit 1) of the Attribute Flags octet
is the Transitive bit. It defines whether an optional attribute is the Transitive bit. It defines whether an optional
is transitive (if set to 1) or non-transitive (if set to 0). attribute is transitive (if set to 1) or non-transitive (if set
to 0).
RFC DRAFT October 2004
For well-known attributes, the Transitive bit MUST be set to 1. For well-known attributes, the Transitive bit MUST be set to 1.
(See Section 5 for a discussion of transitive attributes.) (See Section 5 for a discussion of transitive attributes.)
The third high-order bit (bit 2) of the Attribute Flags octet The third high-order bit (bit 2) of the Attribute Flags octet
is the Partial bit. It defines whether the information con- is the Partial bit. It defines whether the information
tained in the optional transitive attribute is partial (if set contained in the optional transitive attribute is partial (if
to 1) or complete (if set to 0). For well-known attributes and set to 1) or complete (if set to 0). For well-known attributes
for optional non-transitive attributes the Partial bit MUST be and for optional non-transitive attributes, the Partial bit
set to 0. MUST be set to 0.
The fourth high-order bit (bit 3) of the Attribute Flags octet The fourth high-order bit (bit 3) of the Attribute Flags octet
is the Extended Length bit. It defines whether the Attribute is the Extended Length bit. It defines whether the Attribute
Length is one octet (if set to 0) or two octets (if set to 1). Length is one octet (if set to 0) or two octets (if set to 1).
The lower-order four bits of the Attribute Flags octet are The lower-order four bits of the Attribute Flags octet are
unused. They MUST be zero when sent and MUST be ignored when unused. They MUST be zero when sent and MUST be ignored when
received. received.
The Attribute Type Code octet contains the Attribute Type Code. The Attribute Type Code octet contains the Attribute Type Code.
Currently defined Attribute Type Codes are discussed in Section Currently defined Attribute Type Codes are discussed in Section
5. 5.
If the Extended Length bit of the Attribute Flags octet is set If the Extended Length bit of the Attribute Flags octet is set
to 0, the third octet of the Path Attribute contains the length to 0, the third octet of the Path Attribute contains the length
of the attribute data in octets. of the attribute data in octets.
If the Extended Length bit of the Attribute Flags octet is set If the Extended Length bit of the Attribute Flags octet is set
to 1, then the third and the fourth octets of the path to 1, the third and fourth octets of the path attribute contain
attribute contain the length of the attribute data in octets. the length of the attribute data in octets.
The remaining octets of the Path Attribute represent the The remaining octets of the Path Attribute represent the
attribute value and are interpreted according to the Attribute attribute value and are interpreted according to the Attribute
Flags and the Attribute Type Code. The supported Attribute Type Flags and the Attribute Type Code. The supported Attribute
Codes, their attribute values and uses are the following: Type Codes, and their attribute values and uses are as follows:
a) ORIGIN (Type Code 1): a) ORIGIN (Type Code 1):
ORIGIN is a well-known mandatory attribute that defines the ORIGIN is a well-known mandatory attribute that defines the
origin of the path information. The data octet can assume origin of the path information. The data octet can assume
the following values: the following values:
Value Meaning Value Meaning
0 IGP - Network Layer Reachability Information
is interior to the originating AS
1 EGP - Network Layer Reachability Information 0 IGP - Network Layer Reachability Information
learned via the EGP protocol [RFC904] is interior to the originating AS
RFC DRAFT October 2004 1 EGP - Network Layer Reachability Information
learned via the EGP protocol [RFC904]
2 INCOMPLETE - Network Layer Reachability 2 INCOMPLETE - Network Layer Reachability
Information learned by some other means Information learned by some other means
Usage of this attribute is defined in 5.1.1. Usage of this attribute is defined in 5.1.1.
b) AS_PATH (Type Code 2): b) AS_PATH (Type Code 2):
AS_PATH is a well-known mandatory attribute that is composed AS_PATH is a well-known mandatory attribute that is composed
of a sequence of AS path segments. Each AS path segment is of a sequence of AS path segments. Each AS path segment is
represented by a triple <path segment type, path segment represented by a triple <path segment type, path segment
length, path segment value>. length, path segment value>.
The path segment type is a 1-octet long field with the fol- The path segment type is a 1-octet length field with the
lowing values defined: following values defined:
Value Segment Type Value Segment Type
1 AS_SET: unordered set of ASs a route in the 1 AS_SET: unordered set of ASes a route in the
UPDATE message has traversed UPDATE message has traversed
2 AS_SEQUENCE: ordered set of ASs a route in 2 AS_SEQUENCE: ordered set of ASes a route in
the UPDATE message has traversed the UPDATE message has traversed
The path segment length is a 1-octet long field containing The path segment length is a 1-octet length field,
the number of ASs (not the number of octets) in the path containing the number of ASes (not the number of octets) in
segment value field. the path segment value field.
The path segment value field contains one or more AS num- The path segment value field contains one or more AS
bers, each encoded as a 2-octets long field. numbers, each encoded as a 2-octet length field.
Usage of this attribute is defined in 5.1.2. Usage of this attribute is defined in 5.1.2.
c) NEXT_HOP (Type Code 3): c) NEXT_HOP (Type Code 3):
This is a well-known mandatory attribute that defines the This is a well-known mandatory attribute that defines the
(unicast) IP address of the router that SHOULD be used as (unicast) IP address of the router that SHOULD be used as
the next hop to the destinations listed in the Network Layer the next hop to the destinations listed in the Network Layer
Reachability Information field of the UPDATE message. Reachability Information field of the UPDATE message.
Usage of this attribute is defined in 5.1.3. Usage of this attribute is defined in 5.1.3.
d) MULTI_EXIT_DISC (Type Code 4): d) MULTI_EXIT_DISC (Type Code 4):
This is an optional non-transitive attribute that is a four This is an optional non-transitive attribute that is a
octet unsigned integer. The value of this attribute MAY be four-octet unsigned integer. The value of this attribute
used by a BGP speaker's Decision Process to discriminate MAY be used by a BGP speaker's Decision Process to
among multiple entry points to a neighboring autonomous discriminate among multiple entry points to a neighboring
autonomous system.
RFC DRAFT October 2004
system.
Usage of this attribute is defined in 5.1.4. Usage of this attribute is defined in 5.1.4.
e) LOCAL_PREF (Type Code 5): e) LOCAL_PREF (Type Code 5):
LOCAL_PREF is a well-known attribute that is a four octet LOCAL_PREF is a well-known attribute that is a four-octet
unsigned integer. A BGP speaker uses it to inform its other unsigned integer. A BGP speaker uses it to inform its other
internal peers of the advertising speaker's degree of pref- internal peers of the advertising speaker's degree of
erence for an advertised route. preference for an advertised route.
Usage of this attribute is defined in 5.1.5. Usage of this attribute is defined in 5.1.5.
f) ATOMIC_AGGREGATE (Type Code 6) f) ATOMIC_AGGREGATE (Type Code 6)
ATOMIC_AGGREGATE is a well-known discretionary attribute of ATOMIC_AGGREGATE is a well-known discretionary attribute of
length 0. length 0.
Usage of this attribute is defined in 5.1.6. Usage of this attribute is defined in 5.1.6.
skipping to change at page 20, line 40 skipping to change at page 20, line 7
The attribute contains the last AS number that formed the The attribute contains the last AS number that formed the
aggregate route (encoded as 2 octets), followed by the IP aggregate route (encoded as 2 octets), followed by the IP
address of the BGP speaker that formed the aggregate route address of the BGP speaker that formed the aggregate route
(encoded as 4 octets). This SHOULD be the same address as (encoded as 4 octets). This SHOULD be the same address as
the one used for the BGP Identifier of the speaker. the one used for the BGP Identifier of the speaker.
Usage of this attribute is defined in 5.1.7. Usage of this attribute is defined in 5.1.7.
Network Layer Reachability Information: Network Layer Reachability Information:
This variable length field contains a list of IP address pre- This variable length field contains a list of IP address
fixes. The length in octets of the Network Layer Reachability prefixes. The length, in octets, of the Network Layer
Information is not encoded explicitly, but can be calculated Reachability Information is not encoded explicitly, but can be
as: calculated as:
UPDATE message Length - 23 - Total Path Attributes Length - UPDATE message Length - 23 - Total Path Attributes Length
Withdrawn Routes Length - Withdrawn Routes Length
where UPDATE message Length is the value encoded in the fixed- where UPDATE message Length is the value encoded in the fixed-
size BGP header, Total Path Attribute Length and Withdrawn size BGP header, Total Path Attribute Length, and Withdrawn
Routes Length are the values encoded in the variable part of Routes Length are the values encoded in the variable part of
the UPDATE message, and 23 is a combined length of the fixed- the UPDATE message, and 23 is a combined length of the fixed-
size BGP header, the Total Path Attribute Length field and the size BGP header, the Total Path Attribute Length field, and the
Withdrawn Routes Length field. Withdrawn Routes Length field.
RFC DRAFT October 2004
Reachability information is encoded as one or more 2-tuples of Reachability information is encoded as one or more 2-tuples of
the form <length, prefix>, whose fields are described below: the form <length, prefix>, whose fields are described below:
+---------------------------+ +---------------------------+
| Length (1 octet) | | Length (1 octet) |
+---------------------------+ +---------------------------+
| Prefix (variable) | | Prefix (variable) |
+---------------------------+ +---------------------------+
The use and the meaning of these fields are as follows: The use and the meaning of these fields are as follows:
a) Length: a) Length:
The Length field indicates the length in bits of the IP The Length field indicates the length in bits of the IP
address prefix. A length of zero indicates a prefix that address prefix. A length of zero indicates a prefix that
matches all IP addresses (with prefix, itself, of zero matches all IP addresses (with prefix, itself, of zero
octets). octets).
b) Prefix: b) Prefix:
The Prefix field contains an IP address prefix followed by The Prefix field contains an IP address prefix, followed by
enough trailing bits to make the end of the field fall on an enough trailing bits to make the end of the field fall on an
octet boundary. Note that the value of the trailing bits is octet boundary. Note that the value of the trailing bits is
irrelevant. irrelevant.
The minimum length of the UPDATE message is 23 octets -- 19 octets The minimum length of the UPDATE message is 23 octets -- 19 octets
for the fixed header + 2 octets for the Withdrawn Routes Length + 2 for the fixed header + 2 octets for the Withdrawn Routes Length + 2
octets for the Total Path Attribute Length (the value of Withdrawn octets for the Total Path Attribute Length (the value of Withdrawn
Routes Length is 0 and the value of Total Path Attribute Length is Routes Length is 0 and the value of Total Path Attribute Length is
0). 0).
An UPDATE message can advertise at most one set of path attributes, An UPDATE message can advertise, at most, one set of path attributes,
but multiple destinations, provided that the destinations share these but multiple destinations, provided that the destinations share these
attributes. All path attributes contained in a given UPDATE message attributes. All path attributes contained in a given UPDATE message
apply to all destinations carried in the NLRI field of the UPDATE apply to all destinations carried in the NLRI field of the UPDATE
message. message.
An UPDATE message can list multiple routes to be withdrawn from ser- An UPDATE message can list multiple routes that are to be withdrawn
vice. Each such route is identified by its destination (expressed as from service. Each such route is identified by its destination
an IP prefix), which unambiguously identifies the route in the con- (expressed as an IP prefix), which unambiguously identifies the route
text of the BGP speaker - BGP speaker connection to which it has been in the context of the BGP speaker - BGP speaker connection to which
previously advertised. it has been previously advertised.
An UPDATE message might advertise only routes to be withdrawn from
service, in which case it will not include path attributes or Network
Layer Reachability Information. Conversely, it may advertise only a
feasible route, in which case the WITHDRAWN ROUTES field need not be
present.
RFC DRAFT October 2004 An UPDATE message might advertise only routes that are to be
withdrawn from service, in which case the message will not include
path attributes or Network Layer Reachability Information.
Conversely, it may advertise only a feasible route, in which case the
WITHDRAWN ROUTES field need not be present.
An UPDATE message SHOULD NOT include the same address prefix in the An UPDATE message SHOULD NOT include the same address prefix in the
WITHDRAWN ROUTES and Network Layer Reachability Information fields, WITHDRAWN ROUTES and Network Layer Reachability Information fields.
however a BGP speaker MUST be able to process UPDATE messages in this However, a BGP speaker MUST be able to process UPDATE messages in
form. A BGP speaker SHOULD treat an UPDATE message of this form as if this form. A BGP speaker SHOULD treat an UPDATE message of this form
the WITHDRAWN ROUTES doesn't contain the address prefix. as though the WITHDRAWN ROUTES do not contain the address prefix.
4.4 KEEPALIVE Message Format 4.4. KEEPALIVE Message Format
BGP does not use any TCP-based keep-alive mechanism to determine if BGP does not use any TCP-based, keep-alive mechanism to determine if
peers are reachable. Instead, KEEPALIVE messages are exchanged peers are reachable. Instead, KEEPALIVE messages are exchanged
between peers often enough as not to cause the Hold Timer to expire. between peers often enough not to cause the Hold Timer to expire. A
A reasonable maximum time between KEEPALIVE messages would be one reasonable maximum time between KEEPALIVE messages would be one third
third of the Hold Time interval. KEEPALIVE messages MUST NOT be sent of the Hold Time interval. KEEPALIVE messages MUST NOT be sent more
more frequently than one per second. An implementation MAY adjust the frequently than one per second. An implementation MAY adjust the
rate at which it sends KEEPALIVE messages as a function of the Hold rate at which it sends KEEPALIVE messages as a function of the Hold
Time interval. Time interval.
If the negotiated Hold Time interval is zero, then periodic KEEPALIVE If the negotiated Hold Time interval is zero, then periodic KEEPALIVE
messages MUST NOT be sent. messages MUST NOT be sent.
A KEEPALIVE message consists of only message header and has a length A KEEPALIVE message consists of only the message header and has a
of 19 octets. length of 19 octets.
4.5 NOTIFICATION Message Format 4.5. NOTIFICATION Message Format
A NOTIFICATION message is sent when an error condition is detected. A NOTIFICATION message is sent when an error condition is detected.
The BGP connection is closed immediately after sending it. The BGP connection is closed immediately after it is sent.
In addition to the fixed-size BGP header, the NOTIFICATION message In addition to the fixed-size BGP header, the NOTIFICATION message
contains the following fields: contains the following fields:
0 1 2 3 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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error code | Error subcode | Data (variable) | | Error code | Error subcode | Data (variable) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Error Code: Error Code:
This 1-octet unsigned integer indicates the type of NOTIFICA- This 1-octet unsigned integer indicates the type of
TION. The following Error Codes have been defined: NOTIFICATION. The following Error Codes have been defined:
Error Code Symbolic Name Reference Error Code Symbolic Name Reference
RFC DRAFT October 2004
1 Message Header Error Section 6.1 1 Message Header Error Section 6.1
2 OPEN Message Error Section 6.2 2 OPEN Message Error Section 6.2
3 UPDATE Message Error Section 6.3 3 UPDATE Message Error Section 6.3
4 Hold Timer Expired Section 6.5 4 Hold Timer Expired Section 6.5
5 Finite State Machine Error Section 6.6 5 Finite State Machine Error Section 6.6
6 Cease Section 6.7 6 Cease Section 6.7
Error subcode: Error subcode:
This 1-octet unsigned integer provides more specific informa- This 1-octet unsigned integer provides more specific
tion about the nature of the reported error. Each Error Code information about the nature of the reported error. Each Error
may have one or more Error Subcodes associated with it. If no Code may have one or more Error Subcodes associated with it.
appropriate Error Subcode is defined, then a zero (Unspecific) If no appropriate Error Subcode is defined, then a zero
value is used for the Error Subcode field. (Unspecific) value is used for the Error Subcode field.
Message Header Error subcodes:
1 - Connection Not Synchronized.
2 - Bad Message Length.
3 - Bad Message Type.
OPEN Message Error subcodes: Message Header Error subcodes:
1 - Unsupported Version Number. 1 - Connection Not Synchronized.
2 - Bad Peer AS. 2 - Bad Message Length.
3 - Bad BGP Identifier. 3 - Bad Message Type.
4 - Unsupported Optional Parameter.
5 - [Deprecated - see Appendix A].
6 - Unacceptable Hold Time.
UPDATE Message Error subcodes: OPEN Message Error subcodes:
1 - Malformed Attribute List. 1 - Unsupported Version Number.
2 - Unrecognized Well-known Attribute. 2 - Bad Peer AS.
3 - Missing Well-known Attribute. 3 - Bad BGP Identifier.
4 - Attribute Flags Error. 4 - Unsupported Optional Parameter.
5 - Attribute Length Error. 5 - [Deprecated - see Appendix A].
6 - Invalid ORIGIN Attribute. 6 - Unacceptable Hold Time.
7 - [Deprecated - see Appendix A].
8 - Invalid NEXT_HOP Attribute.
9 - Optional Attribute Error.
10 - Invalid Network Field.
RFC DRAFT October 2004 UPDATE Message Error subcodes:
11 - Malformed AS_PATH. 1 - Malformed Attribute List.
2 - Unrecognized Well-known Attribute.
3 - Missing Well-known Attribute.
4 - Attribute Flags Error.
5 - Attribute Length Error.
6 - Invalid ORIGIN Attribute.
7 - [Deprecated - see Appendix A].
8 - Invalid NEXT_HOP Attribute.
9 - Optional Attribute Error.
10 - Invalid Network Field.
11 - Malformed AS_PATH.
Data: Data:
This variable-length field is used to diagnose the reason for This variable-length field is used to diagnose the reason for
the NOTIFICATION. The contents of the Data field depend upon the NOTIFICATION. The contents of the Data field depend upon
the Error Code and Error Subcode. See Section 6 below for more the Error Code and Error Subcode. See Section 6 for more
details. details.
Note that the length of the Data field can be determined from Note that the length of the Data field can be determined from
the message Length field by the formula: the message Length field by the formula:
Message Length = 21 + Data Length Message Length = 21 + Data Length
The minimum length of the NOTIFICATION message is 21 octets (includ- The minimum length of the NOTIFICATION message is 21 octets
ing message header). (including message header).
5. Path Attributes 5. Path Attributes
This section discusses the path attributes of the UPDATE message. This section discusses the path attributes of the UPDATE message.
Path attributes fall into four separate categories: Path attributes fall into four separate categories:
1. Well-known mandatory. 1. Well-known mandatory.
2. Well-known discretionary. 2. Well-known discretionary.
3. Optional transitive. 3. Optional transitive.
4. Optional non-transitive. 4. Optional non-transitive.
BGP implementations MUST recognize all well-known attributes. Some BGP implementations MUST recognize all well-known attributes. Some
of these attributes are mandatory and MUST be included in every of these attributes are mandatory and MUST be included in every
UPDATE message that contains NLRI. Others are discretionary and MAY UPDATE message that contains NLRI. Others are discretionary and MAY
or MAY NOT be sent in a particular UPDATE message. or MAY NOT be sent in a particular UPDATE message.
Once a BGP peer has updated any well-known attributes, it MUST pass Once a BGP peer has updated any well-known attributes, it MUST pass
these attributes in any updates it transmits to its peers. these attributes to its peers in any updates it transmits.
In addition to well-known attributes, each path MAY contain one or In addition to well-known attributes, each path MAY contain one or
more optional attributes. It is not required or expected that all BGP more optional attributes. It is not required or expected that all
implementations support all optional attributes. The handling of an BGP implementations support all optional attributes. The handling of
unrecognized optional attribute is determined by the setting of the an unrecognized optional attribute is determined by the setting of
Transitive bit in the attribute flags octet. Paths with unrecognized the Transitive bit in the attribute flags octet. Paths with
transitive optional attributes SHOULD be accepted. If a path with unrecognized transitive optional attributes SHOULD be accepted. If a
unrecognized transitive optional attribute is accepted and passed path with an unrecognized transitive optional attribute is accepted
along to other BGP peers, then the unrecognized transitive optional and passed to other BGP peers, then the unrecognized transitive
attribute of that path MUST be passed along with the path to other 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
RFC DRAFT October 2004 set to 1. If a path with a recognized, transitive optional attribute
is accepted and passed along to other BGP peers and the Partial bit
BGP peers with the Partial bit in the Attribute Flags octet set to 1. in the Attribute Flags octet is set to 1 by some previous AS, it MUST
If a path with recognized transitive optional attribute is accepted NOT be set back to 0 by the current AS. Unrecognized non-transitive
and passed along to other BGP peers and the Partial bit in the optional attributes MUST be quietly ignored and not passed along to
Attribute Flags octet is set to 1 by some previous AS, it MUST NOT be other BGP peers.
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 New, transitive optional attributes MAY be attached to the path by
originator or by any other BGP speaker in the path. If they are not the originator or by any other BGP speaker in the path. If they are
attached by the originator, the Partial bit in the Attribute Flags not attached by the originator, the Partial bit in the Attribute
octet is set to 1. The rules for attaching new non-transitive Flags octet is set to 1. The rules for attaching new non-transitive
optional attributes will depend on the nature of the specific optional attributes will depend on the nature of the specific
attribute. The documentation of each new non-transitive optional attribute. The documentation of each new non-transitive optional
attribute will be expected to include such rules. (The description of attribute will be expected to include such rules (the description of
the MULTI_EXIT_DISC attribute gives an example.) All optional the MULTI_EXIT_DISC attribute gives an example). All optional
attributes (both transitive and non-transitive) MAY be updated (if attributes (both transitive and non-transitive), MAY be updated (if
appropriate) by BGP speakers in the path. appropriate) by BGP speakers in the path.
The sender of an UPDATE message SHOULD order path attributes within The sender of an UPDATE message SHOULD order path attributes within
the UPDATE message in ascending order of attribute type. The receiver the UPDATE message in ascending order of attribute type. The
of an UPDATE message MUST be prepared to handle path attributes receiver of an UPDATE message MUST be prepared to handle path
within the UPDATE message that are out of order. attributes within UPDATE messages that are out of order.
The same attribute (attribute with the same type) can not appear more The same attribute (attribute with the same type) cannot appear more
than once within the Path Attributes field of a particular UPDATE than once within the Path Attributes field of a particular UPDATE
message. message.
The mandatory category refers to an attribute which MUST be present The mandatory category refers to an attribute that MUST be present in
in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE both IBGP and EBGP exchanges if NLRI are contained in the UPDATE
message. Attributes classified as optional for the purpose of the message. Attributes classified as optional for the purpose of the
protocol extension mechanism may be purely discretionary, or discre- protocol extension mechanism may be purely discretionary,
tionary, required, or disallowed in certain contexts. discretionary, required, or disallowed in certain contexts.
attribute EBGP IBGP attribute EBGP IBGP
ORIGIN mandatory mandatory ORIGIN mandatory mandatory
AS_PATH mandatory mandatory AS_PATH mandatory mandatory
NEXT_HOP mandatory mandatory NEXT_HOP mandatory mandatory
MULTI_EXIT_DISC discretionary discretionary MULTI_EXIT_DISC discretionary discretionary
LOCAL_PREF see Section 5.1.5 required LOCAL_PREF see Section 5.1.5 required
ATOMIC_AGGREGATE see Section 5.1.6 and 9.1.4 ATOMIC_AGGREGATE see Section 5.1.6 and 9.1.4
AGGREGATOR discretionary discretionary AGGREGATOR discretionary discretionary
RFC DRAFT October 2004 5.1. Path Attribute Usage
5.1 Path Attribute Usage
The usage of each BGP path attribute is described in the following The usage of each BGP path attribute is described in the following
clauses. clauses.
5.1.1 ORIGIN 5.1.1. ORIGIN
ORIGIN is a well-known mandatory attribute. The ORIGIN attribute is ORIGIN is a well-known mandatory attribute. The ORIGIN attribute is
generated by the speaker that originates the associated routing generated by the speaker that originates the associated routing
information. Its value SHOULD NOT be changed by any other speaker. information. Its value SHOULD NOT be changed by any other speaker.
5.1.2 AS_PATH 5.1.2. AS_PATH
AS_PATH is a well-known mandatory attribute. This attribute identi- AS_PATH is a well-known mandatory attribute. This attribute
fies the autonomous systems through which routing information carried identifies the autonomous systems through which routing information
in this UPDATE message has passed. The components of this list can be carried in this UPDATE message has passed. The components of this
AS_SETs or AS_SEQUENCEs. list can be AS_SETs or AS_SEQUENCEs.
When a BGP speaker propagates a route which it has learned from When a BGP speaker propagates a route it learned from another BGP
another BGP speaker's UPDATE message, it modifies the route's AS_PATH speaker's UPDATE message, it modifies the route's AS_PATH attribute
attribute based on the location of the BGP speaker to which the route based on the location of the BGP speaker to which the route will be
will be sent: sent:
a) When a given BGP speaker advertises the route to an internal a) When a given BGP speaker advertises the route to an internal
peer, the advertising speaker SHALL NOT modify the AS_PATH peer, the advertising speaker SHALL NOT modify the AS_PATH
attribute associated with the route. attribute associated with the route.
b) When a given BGP speaker advertises the route to an external b) When a given BGP speaker advertises the route to an external
peer, then the advertising speaker updates the AS_PATH attribute peer, the advertising speaker updates the AS_PATH attribute as
as follows: follows:
1) if the first path segment of the AS_PATH is of type 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 AS_SEQUENCE, the local system prepends its own AS number as
last element of the sequence (put it in the leftmost position the last element of the sequence (put it in the leftmost
with respect to the position of octets in the protocol mes- position with respect to the position of octets in the
sage). If the act of prepending will cause an overflow in the protocol message). If the act of prepending will cause an
AS_PATH segment, i.e. more than 255 ASs, it SHOULD prepend a overflow in the AS_PATH segment (i.e., more than 255 ASes),
new segment of type AS_SEQUENCE and prepend its own AS number it SHOULD prepend a new segment of type AS_SEQUENCE and
to this new segment. prepend its own AS number to this new segment.
2) if the first path segment of the AS_PATH is of type AS_SET, 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 the local system prepends a new path segment of type
AS_SEQUENCE to the AS_PATH, including its own AS number in
RFC DRAFT October 2004 that segment.
AS_SEQUENCE to the AS_PATH, including its own AS number in that
segment.
3) if the AS_PATH is empty, the local system creates a path 3) if the AS_PATH is empty, the local system creates a path
segment of type AS_SEQUENCE, places its own AS into that seg- segment of type AS_SEQUENCE, places its own AS into that
ment, and places that segment into the AS_PATH. segment, and places that segment into the AS_PATH.
When a BGP speaker originates a route then: When a BGP speaker originates a route then:
a) the originating speaker includes its own AS number in a path 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 segment, of type AS_SEQUENCE, in the AS_PATH attribute of all
messages sent to an external peer. (In this case, the AS number of UPDATE messages sent to an external peer. In this case, the AS
the originating speaker's autonomous system will be the only entry number of the originating speaker's autonomous system will be
the path segment, and this path segment will be the only segment the only entry the path segment, and this path segment will be
in the AS_PATH attribute). the only segment in the AS_PATH attribute.
b) the originating speaker includes an empty AS_PATH attribute in b) the originating speaker includes an empty AS_PATH attribute in
all UPDATE messages sent to internal peers. (An empty AS_PATH all UPDATE messages sent to internal peers. (An empty AS_PATH
attribute is one whose length field contains the value zero). attribute is one whose length field contains the value zero).
Whenever the modification of the AS_PATH attribute calls for includ- Whenever the modification of the AS_PATH attribute calls for
ing or prepending the AS number of the local system, the local system including or prepending the AS number of the local system, the local
MAY include/prepend more than one instance of its own AS number in system MAY include/prepend more than one instance of its own AS
the AS_PATH attribute. This is controlled via local configuration. number in the AS_PATH attribute. This is controlled via local
configuration.
5.1.3 NEXT_HOP 5.1.3. NEXT_HOP
The NEXT_HOP is a well-known mandatory attribute that defines the IP The NEXT_HOP is a well-known mandatory attribute that defines the IP
address of the router that SHOULD be used as the next hop to the des- address of the router that SHOULD be used as the next hop to the
tinations listed in the UPDATE message. The NEXT_HOP attribute is destinations listed in the UPDATE message. The NEXT_HOP attribute is
calculated as follows. calculated as follows:
1) When sending a message to an internal peer, if the route is not 1) When sending a message to an internal peer, if the route is not
locally originated the BGP speaker SHOULD NOT modify the NEXT_HOP locally originated, the BGP speaker SHOULD NOT modify the
attribute, unless it has been explicitly configured to announce NEXT_HOP attribute unless it has been explicitly configured to
its own IP address as the NEXT_HOP. When announcing a locally announce its own IP address as the NEXT_HOP. When announcing a
originated route to an internal peer, the BGP speaker SHOULD use locally-originated route to an internal peer, the BGP speaker
as the NEXT_HOP the interface address of the router through which SHOULD use the interface address of the router through which
the announced network is reachable for the speaker; if the route the announced network is reachable for the speaker as the
is directly connected to the speaker, or the interface address of NEXT_HOP. If the route is directly connected to the speaker,
the router through which the announced network is reachable for or if the interface address of the router through which the
the speaker is the internal peer's address, then the BGP speaker announced network is reachable for the speaker is the internal
SHOULD use for the NEXT_HOP attribute its own IP address (the peer's address, then the BGP speaker SHOULD use its own IP
address of the interface that is used to reach the peer). address for the NEXT_HOP attribute (the address of the
interface that is used to reach the peer).
2) When sending a message to an external peer X, and the peer is
RFC DRAFT October 2004
one IP hop away from the speaker: 2) When sending a message to an external peer, X, and the peer is
one IP hop away from the speaker:
- If the route being announced was learned from an internal - If the route being announced was learned from an internal
peer or is locally originated, the BGP speaker can use for the peer or is locally originated, the BGP speaker can use an
NEXT_HOP attribute an interface address of the internal peer interface address of the internal peer router (or the
router (or the internal router) through which the announced internal router) through which the announced network is
network is reachable for the speaker, provided that peer X reachable for the speaker for the NEXT_HOP attribute,
shares a common subnet with this address. This is a form of provided that peer X shares a common subnet with this
"third party" NEXT_HOP attribute. address. This is a form of "third party" NEXT_HOP attribute.
- Otherwise, if the route being announced was learned from an - Otherwise, if the route being announced was learned from an
external peer, the speaker can use in the NEXT_HOP attribute an external peer, the speaker can use an IP address of any
IP address of any adjacent router (known from the received adjacent router (known from the received NEXT_HOP attribute)
NEXT_HOP attribute) that the speaker itself uses for local that the speaker itself uses for local route calculation in
route calculation, provided that peer X shares a common subnet the NEXT_HOP attribute, provided that peer X shares a common
with this address. This is a second form of "third party" subnet with this address. This is a second form of "third
NEXT_HOP attribute. party" NEXT_HOP attribute.
- Otherwise, if the external peer to which the route is being - Otherwise, if the external peer to which the route is being
advertised shares a common subnet with one of the interfaces of advertised shares a common subnet with one of the interfaces
the announcing BGP speaker, the speaker MAY use the IP address of the announcing BGP speaker, the speaker MAY use the IP
associated with such an interface in the NEXT_HOP attribute. address associated with such an interface in the NEXT_HOP
This is known as a "first party" NEXT_HOP attribute. attribute. This is known as a "first party" NEXT_HOP
attribute.
- By default (if none of the above conditions apply), the BGP - By default (if none of the above conditions apply), the BGP
speaker SHOULD use in the NEXT_HOP attribute the IP address of speaker SHOULD use the IP address of the interface that the
the interface that the speaker uses to establish the BGP con- speaker uses to establish the BGP connection to peer X in the
nection to peer X. NEXT_HOP attribute.
3) When sending a message to an external peer X, and the peer is 3) When sending a message to an external peer X, and the peer is
multiple IP hops away from the speaker (aka "multihop EBGP"): multiple IP hops away from the speaker (aka "multihop EBGP"):
- The speaker MAY be configured to propagate the NEXT_HOP - The speaker MAY be configured to propagate the NEXT_HOP
attribute. In this case when advertising a route that the attribute. In this case, when advertising a route that the
speaker learned from one of its peers, the NEXT_HOP attribute speaker learned from one of its peers, the NEXT_HOP attribute
of the advertised route is exactly the same as the NEXT_HOP of the advertised route is exactly the same as the NEXT_HOP
attribute of the learned route (the speaker just doesn't modify attribute of the learned route (the speaker does not modify
the NEXT_HOP attribute). the NEXT_HOP attribute).
- By default, the BGP speaker SHOULD use in the NEXT_HOP
attribute the IP address of the interface that the speaker uses
to establish the BGP connection to peer X.
Normally the NEXT_HOP attribute is chosen such that the shortest - By default, the BGP speaker SHOULD use the IP address of the
available path will be taken. A BGP speaker MUST be able to support interface that the speaker uses in the NEXT_HOP attribute to
disabling advertisement of third party NEXT_HOP attributes to handle establish the BGP connection to peer X.
imperfectly bridged media.
RFC DRAFT October 2004 Normally, the NEXT_HOP attribute is chosen such that the shortest
available path will be taken. A BGP speaker MUST be able to support
the disabling advertisement of third party NEXT_HOP attributes in
order to handle imperfectly bridged media.
A route originated by a BGP speaker SHALL NOT be advertised to a peer A route originated by a BGP speaker SHALL NOT be advertised to a peer
using an address of that peer as NEXT_HOP. A BGP speaker SHALL NOT using an address of that peer as NEXT_HOP. A BGP speaker SHALL NOT
install a route with itself as the next hop. install a route with itself as the next hop.
The NEXT_HOP attribute is used by the BGP speaker to determine the The NEXT_HOP attribute is used by the BGP speaker to determine the
actual outbound interface and immediate next-hop address that SHOULD actual outbound interface and immediate next-hop address that SHOULD
be used to forward transit packets to the associated destinations. be used to forward transit packets to the associated destinations.
The immediate next-hop address is determined by performing a recur- The immediate next-hop address is determined by performing a
sive route lookup operation for the IP address in the NEXT_HOP recursive route lookup operation for the IP address in the NEXT_HOP
attribute using the contents of the Routing Table, selecting one attribute, using the contents of the Routing Table, selecting one
entry if multiple entries of equal cost exist. The Routing Table entry if multiple entries of equal cost exist. The Routing Table
entry which resolves the IP address in the NEXT_HOP attribute will entry that resolves the IP address in the NEXT_HOP attribute will
always specify the outbound interface. If the entry specifies an always specify the outbound interface. If the entry specifies an
attached subnet, but does not specify a next-hop address, then the attached subnet, but does not specify a next-hop address, then the
address in the NEXT_HOP attribute SHOULD be used as the immediate address in the NEXT_HOP attribute SHOULD be used as the immediate
next-hop address. If the entry also specifies the next-hop address, next-hop address. If the entry also specifies the next-hop address,
this address SHOULD be used as the immediate next-hop address for this address SHOULD be used as the immediate next-hop address for
packet forwarding. packet forwarding.
5.1.4 MULTI_EXIT_DISC 5.1.4. MULTI_EXIT_DISC
The MULTI_EXIT_DISC is an optional non-transitive attribute which is The MULTI_EXIT_DISC is an optional non-transitive attribute that is
intended to be used on external (inter-AS) links to discriminate intended to be used on external (inter-AS) links to discriminate
among multiple exit or entry points to the same neighboring AS. The 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- value of the MULTI_EXIT_DISC attribute is a four-octet unsigned
ber which is called a metric. All other factors being equal, the exit number, called a metric. All other factors being equal, the exit
point with lower metric SHOULD be preferred. If received over EBGP, point with the lower metric SHOULD be preferred. If received over
the MULTI_EXIT_DISC attribute MAY be propagated over IBGP to other EBGP, the MULTI_EXIT_DISC attribute MAY be propagated over IBGP to
BGP speakers within the same AS (see also 9.1.2.2). The other 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 MULTI_EXIT_DISC attribute received from a neighboring AS MUST NOT be
propagated to other neighboring ASs. propagated to other neighboring ASes.
A BGP speaker MUST implement a mechanism based on local configuration A BGP speaker MUST implement a mechanism (based on local
which allows the MULTI_EXIT_DISC attribute to be removed from a configuration) that allows the MULTI_EXIT_DISC attribute to be
route. If a BGP speaker is configured to remove the MULTI_EXIT_DISC removed from a route. If a BGP speaker is configured to remove the
attribute from a route, then this removal MUST be done prior to MULTI_EXIT_DISC attribute from a route, then this removal MUST be
determining the degree of preference of the route and performing done prior to determining the degree of preference of the route and
route selection (Decision Process phases 1 and 2). prior to performing route selection (Decision Process phases 1 and
2).
An implementation MAY also (based on local configuration) alter the An implementation MAY also (based on local configuration) alter the
value of the MULTI_EXIT_DISC attribute received over EBGP. If a BGP 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 speaker is configured to alter the value of the MULTI_EXIT_DISC
attribute received over EBGP, then altering the value MUST be done attribute received over EBGP, then altering the value MUST be done
prior to determining the degree of preference of the route and per- prior to determining the degree of preference of the route and prior
forming route selection (Decision Process phases 1 and 2). See to performing route selection (Decision Process phases 1 and 2). See
RFC DRAFT October 2004
Section 9.1.2.2 for necessary restrictions on this. Section 9.1.2.2 for necessary restrictions on this.
5.1.5 LOCAL_PREF 5.1.5. LOCAL_PREF
LOCAL_PREF is a well-known attribute that SHALL be included in all 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 UPDATE messages that a given BGP speaker sends to other internal
peers. A BGP speaker SHALL calculate the degree of preference for peers. A BGP speaker SHALL calculate the degree of preference for
each external route based on the locally configured policy, and each external route based on the locally-configured policy, and
include the degree of preference when advertising a route to its include the degree of preference when advertising a route to its
internal peers. The higher degree of preference MUST be preferred. A internal peers. The higher degree of preference MUST be preferred.
BGP speaker uses the degree of preference learned via LOCAL_PREF in 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 A BGP speaker MUST NOT include this attribute in UPDATE messages it
it sends to external peers, except for the case of BGP Confederations sends to external peers, except in the case of BGP Confederations
[RFC3065]. If it is contained in an UPDATE message that is received [RFC3065]. If it is contained in an UPDATE message that is received
from an external peer, then this attribute MUST be ignored by the from an external peer, then this attribute MUST be ignored by the
receiving speaker, except for the case of BGP Confederations receiving speaker, except in the case of BGP Confederations
[RF3065]. [RFC3065].
5.1.6 ATOMIC_AGGREGATE 5.1.6. ATOMIC_AGGREGATE
ATOMIC_AGGREGATE is a well-known discretionary attribute. ATOMIC_AGGREGATE is a well-known discretionary attribute.
When a BGP speaker aggregates several routes for the purpose of When a BGP speaker aggregates several routes for the purpose of
advertisement to a particular peer, the AS_PATH of the aggregated advertisement to a particular peer, the AS_PATH of the aggregated
route normally includes an AS_SET formed from the set of ASs from route normally includes an AS_SET formed from the set of ASes from
which the aggregate was formed. In many cases the network adminis- which the aggregate was formed. In many cases, the network
trator can determine that the aggregate can safely be advertised administrator can determine if the aggregate can safely be advertised
without the AS_SET and not form route loops. without the AS_SET, and without forming route loops.
If an aggregate excludes at least some of the AS numbers present in If an aggregate excludes at least some of the AS numbers present in
the AS_PATH of the routes that are aggregated as a result of dropping the AS_PATH of the routes that are aggregated as a result of dropping
the AS_SET, the aggregated route, when advertised to the peer, SHOULD the AS_SET, the aggregated route, when advertised to the peer, SHOULD
include the ATOMIC_AGGREGATE attribute. include the ATOMIC_AGGREGATE attribute.
A BGP speaker that receives a route with the ATOMIC_AGGREGATE A BGP speaker that receives a route with the ATOMIC_AGGREGATE
attribute SHOULD NOT remove the attribute from the route when propa- attribute SHOULD NOT remove the attribute when propagating the route
gating it to other speakers. to other speakers.
A BGP speaker that receives a route with the ATOMIC_AGGREGATE A BGP speaker that receives a route with the ATOMIC_AGGREGATE
attribute MUST NOT make any NLRI of that route more specific (as 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. defined in 9.1.4) when advertising this route to other BGP speakers.
RFC DRAFT October 2004
A BGP speaker that receives a route with the ATOMIC_AGGREGATE A BGP speaker that receives a route with the ATOMIC_AGGREGATE
attribute needs to be aware of the fact that the actual path to des- attribute needs to be aware of the fact that the actual path to
tinations, as specified in the NLRI of the route, while having the destinations, as specified in the NLRI of the route, while having the
loop-free property, may not be the path specified in the AS_PATH loop-free property, may not be the path specified in the AS_PATH
attribute of the route. attribute of the route.
5.1.7 AGGREGATOR 5.1.7. AGGREGATOR
AGGREGATOR is an optional transitive attribute which MAY be included AGGREGATOR is an optional transitive attribute, which MAY be included
in updates which are formed by aggregation (see Section 9.2.2.2). A in updates that are formed by aggregation (see Section 9.2.2.2). A
BGP speaker which performs route aggregation MAY add the AGGREGATOR BGP speaker that performs route aggregation MAY add the AGGREGATOR
attribute which SHALL contain its own AS number and IP address. The 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. IP address SHOULD be the same as the BGP Identifier of the speaker.
6. BGP Error Handling. 6. BGP Error Handling.
This section describes actions to be taken when errors are detected This section describes actions to be taken when errors are detected
while processing BGP messages. while processing BGP messages.
When any of the conditions described here are detected, a NOTIFICA- When any of the conditions described here are detected, a
TION message with the indicated Error Code, Error Subcode, and Data NOTIFICATION message, with the indicated Error Code, Error Subcode,
fields is sent, and the BGP connection is closed, unless it is and Data fields, is sent, and the BGP connection is closed (unless it
explicitly stated that no NOTIFICATION message is to be sent and the is explicitly stated that no NOTIFICATION message is to be sent and
BGP connection is not to be closed. If no Error Subcode is specified, the BGP connection is not to be closed). If no Error Subcode is
then a zero MUST be used. specified, then a zero MUST be used.
The phrase "the BGP connection is closed" means that the TCP connec- The phrase "the BGP connection is closed" means the TCP connection
tion has been closed, the associated Adj-RIB-In has been cleared, and has been closed, the associated Adj-RIB-In has been cleared, and all
that all resources for that BGP connection have been deallocated. resources for that BGP connection have been deallocated. Entries in
Entries in the Loc-RIB associated with the remote peer are marked as the Loc-RIB associated with the remote peer are marked as invalid.
invalid. The local system recalculates its best routes for the des- The local system recalculates its best routes for the destinations of
tinations of the routes marked as invalid, and before the invalid the routes marked as invalid. Before the invalid routes are deleted
routes are deleted from the system advertises to its peers either from the system, it advertises, to its peers, either withdraws for
withdraws for the routes marked as invalid, or the new best routes the routes marked as invalid, or the new best routes before the
before the invalid routes are deleted from the system. invalid routes are deleted from the system.
Unless specified explicitly, the Data field of the NOTIFICATION mes- Unless specified explicitly, the Data field of the NOTIFICATION
sage that is sent to indicate an error is empty. message that is sent to indicate an error is empty.
6.1 Message Header error handling. 6.1. Message Header Error Handling
All errors detected while processing the Message Header MUST be All errors detected while processing the Message Header MUST be
indicated by sending the NOTIFICATION message with the Error Code
RFC DRAFT October 2004 Message Header Error. The Error Subcode elaborates on the specific
nature of the error.
indicated 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 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, ones. If the Marker field of the message header is not as expected,
then a synchronization error has occurred and the Error Subcode MUST then a synchronization error has occurred and the Error Subcode MUST
be set to Connection Not Synchronized. be set to Connection Not Synchronized.
If at least one of the following is true: If at least one of the following is true:
- if the Length field of the message header is less than 19 or - if the Length field of the message header is less than 19 or
greater than 4096, or greater than 4096, or
- if the Length field of an OPEN message is less than the minimum - if the Length field of an OPEN message is less than the minimum
length of the OPEN message, or length of the OPEN message, or
- if the Length field of an UPDATE message is less than the mini- - if the Length field of an UPDATE message is less than the
mum length of the UPDATE message, or minimum length of the UPDATE message, or
- if the Length field of a KEEPALIVE message is not equal to 19, - if the Length field of a KEEPALIVE message is not equal to 19,
or or
- if the Length field of a NOTIFICATION message is less than the - if the Length field of a NOTIFICATION message is less than the
minimum length of the NOTIFICATION message, minimum length of the NOTIFICATION message,
then the Error Subcode MUST be set to Bad Message Length. The Data then the Error Subcode MUST be set to Bad Message Length. The Data
field MUST contain the erroneous Length field. field MUST contain the erroneous Length field.
If the Type field of the message header is not recognized, then the If the Type field of the message header is not recognized, then the
Error Subcode MUST be set to Bad Message Type. The Data field MUST Error Subcode MUST be set to Bad Message Type. The Data field MUST
contain the erroneous Type field. contain the erroneous Type field.
6.2 OPEN message error handling. 6.2. OPEN Message Error Handling
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 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
RFC DRAFT October 2004 All errors detected while processing the OPEN message MUST be
indicated by sending the NOTIFICATION message with the Error Code
OPEN Message Error. The Error Subcode elaborates on the specific
nature of the error.
number is greater than the version the remote BGP peer bid, then the If the version number in the Version field of the received OPEN
smallest locally supported version number. message is not supported, then the Error Subcode MUST be set to
Unsupported Version Number. The Data field is a 2-octet 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, If the Autonomous System field of the OPEN message is unacceptable,
then the Error Subcode MUST be set to Bad Peer AS. The determination then the Error Subcode MUST be set to Bad Peer AS. The determination
of acceptable Autonomous System numbers is outside the scope of this of acceptable Autonomous System numbers is outside the scope of this
protocol. protocol.
If the Hold Time field of the OPEN message is unacceptable, then the If the Hold Time field of the OPEN message is unacceptable, then the
Error Subcode MUST be set to Unacceptable Hold Time. An implementa- Error Subcode MUST be set to Unacceptable Hold Time. An
tion MUST reject Hold Time values of one or two seconds. An imple- implementation MUST reject Hold Time values of one or two seconds.
mentation MAY reject any proposed Hold Time. An implementation which An implementation MAY reject any proposed Hold Time. An
accepts a Hold Time MUST use the negotiated value for the Hold Time. implementation that accepts a Hold Time MUST use the negotiated value
for the Hold Time.
If the BGP Identifier field of the OPEN message is syntactically If the BGP Identifier field of the OPEN message is syntactically
incorrect, then the Error Subcode MUST be set to Bad BGP Identifier. incorrect, then the Error Subcode MUST be set to Bad BGP Identifier.
Syntactic correctness means that the BGP Identifier field represents Syntactic correctness means that the BGP Identifier field represents
a valid unicast IP host address. a valid unicast IP host address.
If one of the Optional Parameters in the OPEN message is not recog- If one of the Optional Parameters in the OPEN message is not
nized, then the Error Subcode MUST be set to Unsupported Optional recognized, then the Error Subcode MUST be set to Unsupported
Parameters. Optional Parameters.
If one of the Optional Parameters in the OPEN message is recognized, If one of the Optional Parameters in the OPEN message is recognized,
but is malformed, then the Error Subcode MUST be set to 0 (Unspe- but is malformed, then the Error Subcode MUST be set to 0
cific). (Unspecific).
6.3 UPDATE message error handling. 6.3. UPDATE Message Error Handling
All errors detected while processing the UPDATE message MUST be indi- All errors detected while processing the UPDATE message MUST be
cated by sending the NOTIFICATION message with Error Code UPDATE Mes- indicated by sending the NOTIFICATION message with the Error Code
sage Error. The error subcode elaborates on the specific nature of UPDATE Message Error. The error subcode elaborates on the specific
the error. nature of the error.
Error checking of an UPDATE message begins by examining the path Error checking of an UPDATE message begins by examining the path
attributes. If the Withdrawn Routes Length or Total Attribute Length attributes. If the Withdrawn Routes Length or Total Attribute Length
is too large (i.e., if Withdrawn Routes Length + Total Attribute is too large (i.e., if Withdrawn Routes Length + Total Attribute
Length + 23 exceeds the message Length), then the Error Subcode MUST Length + 23 exceeds the message Length), then the Error Subcode MUST
be set to Malformed Attribute List. be set to Malformed Attribute List.
If any recognized attribute has Attribute Flags that conflict with If any recognized attribute has Attribute Flags that conflict with
the Attribute Type Code, then the Error Subcode MUST be set to the Attribute Type Code, then the Error Subcode MUST be set to
Attribute Flags Error. The Data field MUST contain the erroneous Attribute Flags Error. The Data field MUST contain the erroneous
attribute (type, length and value). attribute (type, length, and value).
If any recognized attribute has Attribute Length that conflicts with
RFC DRAFT October 2004
the expected length (based on the attribute type code), then the If any recognized attribute has an Attribute Length that conflicts
Error Subcode MUST be set to Attribute Length Error. The Data field with the expected length (based on the attribute type code), then the
MUST contain 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 If any of the well-known mandatory attributes are not present, then
the Error Subcode MUST be set to Missing Well-known Attribute. The the Error Subcode MUST be set to Missing Well-known Attribute. The
Data field MUST contain the Attribute Type Code of the missing well- Data field MUST contain the Attribute Type Code of the missing,
known attribute. well-known attribute.
If any of the mandatory well-known attributes are not recognized, If any of the well-known mandatory attributes are not recognized,
then the Error Subcode MUST be set to Unrecognized Well-known then the Error Subcode MUST be set to Unrecognized Well-known
Attribute. The Data field MUST contain the unrecognized attribute Attribute. The Data field MUST contain the unrecognized attribute
(type, length and value). (type, length, and value).
If the ORIGIN attribute has an undefined value, then the Error Sub- If the ORIGIN attribute has an undefined value, then the Error Sub-
code MUST be set to Invalid Origin Attribute. The Data field MUST code MUST be set to Invalid Origin Attribute. The Data field MUST
contain the unrecognized attribute (type, length and value). contain the unrecognized attribute (type, length, and value).
If the NEXT_HOP attribute field is syntactically incorrect, then the If the NEXT_HOP attribute field is syntactically incorrect, then the
Error Subcode MUST be set to Invalid NEXT_HOP Attribute. The Data Error Subcode MUST be set to Invalid NEXT_HOP Attribute. The Data
field MUST contain the incorrect attribute (type, length and value). field MUST contain the incorrect attribute (type, length, and value).
Syntactic correctness means that the NEXT_HOP attribute represents a Syntactic correctness means that the NEXT_HOP attribute represents a
valid IP host address. valid IP host address.
The IP address in the NEXT_HOP MUST meet the following criteria to be The IP address in the NEXT_HOP MUST meet the following criteria to be
considered semantically correct: considered semantically correct:
a) It MUST NOT be the IP address of the receiving speaker 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 b) In the case of an EBGP, where the sender and receiver are one
hop away from each other, either the IP address in the NEXT_HOP IP hop away from each other, either the IP address in the
MUST be the sender's IP address (that is used to establish the BGP NEXT_HOP MUST be the sender's IP address that is used to
connection), or the interface associated with the NEXT_HOP IP establish the BGP connection, or the interface associated with
address MUST share a common subnet with the receiving BGP speaker. 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 If the NEXT_HOP attribute is semantically incorrect, the error SHOULD
be logged, and the route SHOULD be ignored. In this case, a NOTIFICA- be logged, and the route SHOULD be ignored. In this case, a
TION message SHOULD NOT be sent, and connection SHOULD NOT be closed. NOTIFICATION message SHOULD NOT be sent, and the connection SHOULD
NOT be closed.
The AS_PATH attribute is checked for syntactic correctness. If the The AS_PATH attribute is checked for syntactic correctness. If the
path is syntactically incorrect, then the Error Subcode MUST be set path is syntactically incorrect, then the Error Subcode MUST be set
to Malformed AS_PATH. to Malformed AS_PATH.
If the UPDATE message is received from an external peer, the local If the UPDATE message is received from an external peer, the local
system MAY check whether the leftmost (with respect to the position system MAY check whether the leftmost (with respect to the position
of octets in the protocol message) AS in the AS_PATH attribute is 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- equal to the autonomous system number of the peer that sent the
sage. If the check determines that this is not the case, the Error message. If the check determines this is not the case, the Error
RFC DRAFT October 2004
Subcode MUST be set to Malformed AS_PATH. Subcode MUST be set to Malformed AS_PATH.
If an optional attribute is recognized, then the value of this If an optional attribute is recognized, then the value of this
attribute MUST be checked. If an error is detected, the attribute attribute MUST be checked. If an error is detected, the attribute
MUST be discarded, and the Error Subcode MUST be set to Optional MUST be discarded, and the Error Subcode MUST be set to Optional
Attribute Error. The Data field MUST contain the attribute (type, Attribute Error. The Data field MUST contain the attribute (type,
length and value). length, and value).
If any attribute appears more than once in the UPDATE message, then If any attribute appears more than once in the UPDATE message, then
the Error Subcode MUST be 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- The NLRI field in the UPDATE message is checked for syntactic
ity. If the field is syntactically incorrect, then the Error Subcode validity. If the field is syntactically incorrect, then the Error
MUST be set to Invalid Network Field. Subcode MUST be set to Invalid Network Field.
If a prefix in the NLRI field is semantically incorrect (e.g., an If a prefix in the NLRI field is semantically incorrect (e.g., an
unexpected multicast IP address), an error SHOULD be logged locally, unexpected multicast IP address), an error SHOULD be logged locally,
and the prefix SHOULD be ignored. and the prefix SHOULD be ignored.
An UPDATE message that contains correct path attributes, but no NLRI, An UPDATE message that contains correct path attributes, but no NLRI,
SHALL be treated as a valid UPDATE message. SHALL be treated as a valid UPDATE message.
6.4 NOTIFICATION message error handling. 6.4. NOTIFICATION Message Error Handling
If a peer sends a NOTIFICATION message, and the receiver of the mes- If a peer sends a NOTIFICATION message, and the receiver of the
sage detects an error in that message, the receiver can not use a message detects an error in that message, the receiver cannot use a
NOTIFICATION message to report this error back to the peer. Any such NOTIFICATION message to report this error back to the peer. Any such
error, such as an unrecognized Error Code or Error Subcode, SHOULD be error (e.g., an unrecognized Error Code or Error Subcode) SHOULD be
noticed, logged locally, and brought to the attention of the adminis- noticed, logged locally, and brought to the attention of the
tration of the peer. The means to do this, however, lies outside the administration of the peer. The means to do this, however, lies
scope of this document. outside the scope of this document.
6.5 Hold Timer Expired error handling. 6.5. Hold Timer Expired Error Handling
If a system does not receive successive KEEPALIVE and/or UPDATE If a system does not receive successive KEEPALIVE, UPDATE, and/or
and/or NOTIFICATION messages within the period specified in the Hold NOTIFICATION messages within the period specified in the Hold Time
Time field of the OPEN message, then the NOTIFICATION message with field of the OPEN message, then the NOTIFICATION message with the
Hold Timer Expired Error Code is sent and the BGP connection is Hold Timer Expired Error Code is sent and the BGP connection is
closed. closed.
RFC DRAFT October 2004 6.6. Finite State Machine Error Handling
6.6 Finite State Machine error handling.
Any error detected by the BGP Finite State Machine (e.g., receipt of Any error detected by the BGP Finite State Machine (e.g., receipt of
an unexpected event) is indicated by sending the NOTIFICATION message an unexpected event) is indicated by sending the NOTIFICATION message
with Error Code Finite State Machine Error. with the Error Code Finite State Machine Error.
6.7 Cease. 6.7. Cease
In absence of any fatal errors (that are indicated in this section), In the absence of any fatal errors (that are indicated in this
a BGP peer MAY choose at any given time to close its BGP connection section), a BGP peer MAY choose, at any given time, to close its BGP
by sending the NOTIFICATION message with Error Code Cease. However, connection by sending the NOTIFICATION message with the Error Code
the Cease NOTIFICATION message MUST NOT be used when a fatal error Cease. However, the Cease NOTIFICATION message MUST NOT be used when
indicated by this section does exist. a fatal error indicated by this section does exist.
A BGP speaker MAY support the ability to impose an (locally config- A BGP speaker MAY support the ability to impose a locally-configured,
ured) upper bound on the number of address prefixes the speaker is upper bound on the number of address prefixes the speaker is willing
willing to accept from a neighbor. When the upper bound is reached, to accept from a neighbor. When the upper bound is reached, the
the speaker (under control of local configuration) either (a) dis- speaker, under control of local configuration, either (a) discards
cards new address prefixes from the neighbor (while maintaining BGP new address prefixes from the neighbor (while maintaining the BGP
connection with the neighbor), or (b) terminates the BGP connection connection with the neighbor), or (b) terminates the BGP connection
with the neighbor. If the BGP speaker decides to terminate its BGP with the neighbor. If the BGP speaker decides to terminate its BGP
connection with a neighbor because the number of address prefixes connection with a neighbor because the number of address prefixes
received from the neighbor exceeds the locally configured upper received from the neighbor exceeds the locally-configured, upper
bound, then the speaker MUST send to the neighbor a NOTIFICATION mes- bound, then the speaker MUST send the neighbor a NOTIFICATION message
sage with the Error Code Cease. The speaker MAY also log this with the Error Code Cease. The speaker MAY also log this locally.
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
presence of connection collision, one of these connections MUST be
closed.
Based on the value of the BGP Identifier a convention is established 6.8. BGP Connection Collision Detection
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
RFC DRAFT October 2004 If a pair of BGP speakers try to establish a BGP connection with each
other simultaneously, then two parallel connections 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, connection collision has occurred. In the
event of connection collision, one of the connections MUST be closed.
initiated by the BGP speaker with the higher-valued BGP Identifier. Based on the value of the BGP Identifier, a convention is established
for detecting which BGP connection is to be preserved when a
collision occurs. 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 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 its connections that are in the OpenConfirm state. A BGP speaker MAY
also examine connections in an OpenSent state if it knows the BGP also examine connections in an OpenSent state if it knows the BGP
Identifier of the peer by means outside of the protocol. If among Identifier of the peer by means outside of the protocol. If, among
these connections there is a connection to a remote BGP speaker whose these connections, there is a connection to a remote BGP speaker
BGP Identifier equals the one in the OPEN message, and this connec- whose BGP Identifier equals the one in the OPEN message, and this
tion collides with the connection over which the OPEN message is connection collides with the connection over which the OPEN message
received then the local system performs the following collision reso- is received, then the local system performs the following collision
lution procedure: resolution procedure:
1. The BGP Identifier of the local system is compared to the BGP 1) The BGP Identifier of the local system is compared to the BGP
Identifier of the remote system (as specified in the OPEN mes- Identifier of the remote system (as specified in the OPEN
sage). Comparing BGP Identifiers is done by converting them to message). Comparing BGP Identifiers is done by converting them
host byte order and treating them as (4-octet long) unsigned inte- to host byte order and treating them as 4-octet unsigned
gers. integers.
2. If the value of the local BGP Identifier is less than the 2) If the value of the local BGP Identifier is less than the
remote one, the local system closes the BGP connection that remote one, the local system closes the BGP connection that
already exists (the one that is already in the OpenConfirm state), already exists (the one that is already in the OpenConfirm
and accepts the BGP connection initiated by the remote system. state), and accepts the BGP connection initiated by the remote
system.
3. Otherwise, the local system closes newly created BGP connection 3) Otherwise, the local system closes the newly created BGP
(the one associated with the newly received OPEN message), and connection (the one associated with the newly received OPEN
continues to use the existing one (the one that is already in the message), and continues to use the existing one (the one that
OpenConfirm state). is already in the OpenConfirm state).
Unless allowed via configuration, a connection collision with an Unless allowed via configuration, a connection collision with an
existing BGP connection that is in Established state causes closing existing BGP connection that is in the Established state causes
of the newly created connection. closing of the newly created connection.
Note that a connection collision can not be detected with connections Note that a connection collision cannot be detected with connections
that are in Idle, or Connect, or Active states. that are in Idle, Connect, or Active states.
Closing the BGP connection (that results from the collision resolu- Closing the BGP connection (that results from the collision
tion procedure) is accomplished by sending the NOTIFICATION message resolution procedure) is accomplished by sending the NOTIFICATION
with the Error Code Cease. message with the Error Code Cease.
7. BGP Version Negotiation 7. BGP Version Negotiation
BGP speakers MAY negotiate the version of the protocol by making mul- BGP speakers MAY negotiate the version of the protocol by making
tiple attempts to open a BGP connection, starting with the highest multiple attempts at opening a BGP connection, starting with the
version number each supports. If an open attempt fails with an Error highest version number each BGP speaker supports. If an open attempt
Code OPEN Message Error, and an Error Subcode Unsupported Version fails with an Error Code, OPEN Message Error, and an Error Subcode,
Number, then the BGP speaker has available the version number it 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 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.
RFC DRAFT October 2004 8. BGP Finite State Machine (FSM)
tried, the version number its peer tried, the version number passed The data structures and FSM described in this document are conceptual
by its peer in the NOTIFICATION message, and the version numbers that and do not have to be implemented precisely as described here, as
it supports. If the two peers do support one or more common versions, long as the implementations support the described functionality and
then this will allow them to rapidly determine the highest common they exhibit the same externally visible behavior.
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 (FSM) This section specifies the BGP operation in terms of a Finite State
Machine (FSM). The section falls into two parts:
The data structures and FSM described in this document are 1) Description of Events for the State machine (Section 8.1)
conceptual and do not have to be implemented precisely as described 2) Description of the FSM (Section 8.2)
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 Session attributes required (mandatory) for each connection are:
Machine (FSM). The section falls into 2 parts:
1) Description of Events for the State machine (Section 8.1) 1) State
2) Description of the FSM (Section 8.2) 2) ConnectRetryCounter
3) ConnectRetryTimer
4) ConnectRetryTime
5) HoldTimer
6) HoldTime
7) KeepaliveTimer
8) KeepaliveTime
Session attributes required (mandatory) for each connection are: The state session attribute indicates the current state of the BGP
FSM. The ConnectRetryCounter indicates the number of times a BGP
peer has tried to establish a peer session.
1) State The mandatory attributes related to timers are described in Section
2) ConnectRetryCounter 10. Each timer has a "timer" and a "time" (the initial value).
3) ConnectRetryTimer
4) ConnectRetryTime
5) HoldTimer
6) HoldTime
7) KeepaliveTimer
8) KeepaliveTime
The state session attribute indicates what state the BGP FSM The optional Session attributes are listed below. These optional
is in. The ConnectRetryCounter indicates the number of times attributes may be supported, either per connection or per local
a BGP peer has tried to establish a peer session. system:
The mandatory attributes related to timers are described in 1) AcceptConnectionsUnconfiguredPeers
section 10. Each timer has a "timer" and a "time" (the initial 2) AllowAutomaticStart
value). 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 are listed below. These optional The optional session attributes support different features of the BGP
attributes may be supported either per connection or per local sys- functionality that have implications for the BGP FSM state
tem: transitions. Two groups of the attributes which relate to timers
are:
1) AcceptConnectionsUnconfiguredPeers group 1: DelayOpen, DelayOpenTime, DelayOpenTimer
2) AllowAutomaticStart group 2: DampPeerOscillations, IdleHoldTime, IdleHoldTimer
3) AllowAutomaticStop
RFC DRAFT October 2004 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 the "Timer"
(DelayOpenTime, IdleHoldTime). The "Timer" specifies the actual
timer.
4) CollisionDetectEstablishedState Please refer to Section 8.1.1 for an explanation of the interaction
5) DampPeerOscillations between these optional attributes and the events signaled to the
6) DelayOpen state machine. Section 8.2.1.3 also provides a short overview of the
7) DelayOpenTime different types of optional attributes (flags or timers).
8) DelayOpenTimer
9) IdleHoldTime
10) IdleHoldTimer
11) PassiveTcpEstablishment
12) SendNOTIFICATIONwithoutOPEN
13) TrackTcpState
The optional session attributes support different features of the BGP 8.1. Events for the BGP FSM
functionality that have implications for the BGP FSM state
transitions. Two groups of the attributes which relate to timers are:
group 1: DelayOpen, DelayOpenTime, DelayOpenTimer
group 2: DampPeerOscillations, IdleHoldTime, IdleHoldTimer
The first parameter (DelayOpen, DampPeerOscillations) is an 8.1.1. Optional Events Linked to Optional Session Attributes
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 The Inputs to the BGP FSM are events. Events can either be mandatory
of the interaction between these optional attributes and the events or optional. Some optional events are linked to optional session
signaled to the state machine. Section 8.2.1.3 also provides attributes. Optional session attributes enable several groups of FSM
a short overview of the different types of optional attributes functionality.
(flags or timers).
8.1 Events for the BGP FSM The linkage between FSM functionality, events, and the optional
session attributes are described below.
8.1.1 Optional Events linked to Optional Session attributes Group 1: Automatic Administrative Events (Start/Stop)
The Inputs to the BGP FSM are events. Events can either be Optional Session Attributes: AllowAutomaticStart,
mandatory or optional. Some optional events are linked to AllowAutomaticStop,
optional session attributes. Optional session attributes enable DampPeerOscillations,
several groups of FSM functionality. IdleHoldTime, IdleHoldTimer
The description below describes the linkage between FSM Option 1: AllowAutomaticStart
functionality, events and the optional session attributes.
RFC DRAFT October 2004 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 that
is 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.
Group 1: Automatic Administrative Events (Start/Stop) The AllowAutomaticStart attribute specifies that
this BGP connection supports automatic starting of
the BGP connection.
Optional Session Attributes: AllowAutomaticStart, AllowAutomaticStop, If the BGP implementation supports
DampPeerOscillations, IdleHoldTime, AllowAutomaticStart, the peer may be repeatedly
IdleHoldTimer restarted. Three other options control the rate
at which the automatic restart occurs:
DampPeerOscillations, IdleHoldTime, and the
IdleHoldTimer.
Option 1: AllowAutomaticStart 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 the length of time the BGP
peer is held in the Idle state prior to allowing
the next automatic restart. The IdleHoldTimer is
the timer that holds the peer in Idle state.
Description: A BGP peer connection can be started and stopped An example of DampPeerOscillations logic is an
by administrative control. This administrative increase of the IdleHoldTime value if a BGP peer
control can either be manual, based on oscillates connectivity (connected/disconnected)
operator intervention, or under the control repeatedly within a time period. To engage this
of logic specific to a BGP implementation. logic, a peer could connect and disconnect 10
The term "automatic" refers to a start being times within 5 minutes. The IdleHoldTime value
issued to the BGP peer connection FSM when would be reset from 0 to 120 seconds.
such logic determines that the BGP peer
connection should be restarted.
The AllowAutomaticStart attribute specifies Values: TRUE or FALSE
that this BGP connection supports automatic
starting of the BGP connection.
If the BGP implementation supports Option 2: AllowAutomaticStop
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 Description: This BGP peer session optional attribute indicates
that the implementation engages additional that the BGP connection allows "automatic"
logic to damp the oscillations of BGP peers stopping of the BGP connection. An "automatic"
in the face of sequences of automatic start stop is defined as a stop under the control of
and automatic stop. IdleHoldTime specifies implementation-specific logic. The
how long the BGP peer is held in the Idle implementation-specific logic is outside the scope
state prior to allowing the next automatic of this specification.
restart. The IdleHoldTimer is the timer
that runs to hold the peer in Idle state.
An example of DampPeerOscillations logic Values: TRUE or FALSE
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 connect and disconnect
10 times within 5 minutes. The IdleHoldTime
value would be reset from 0 to 120 seconds.
RFC DRAFT October 2004 Option 3: DampPeerOscillations
Values: TRUE or FALSE Description: The DampPeerOscillations optional session
attribute indicates that the BGP connection is
using logic that damps BGP peer oscillations in
the Idle State.
Option 2: AllowAutomaticStop Value: TRUE or FALSE
Description: This BGP peer session optional attribute Option 4: IdleHoldTime
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 Description: The IdleHoldTime is the value that is set in the
IdleHoldTimer.
Option 3: DampPeerOscillations Values: Time in seconds
Description: The DampPeerOscillations optional session Option 5: IdleHoldTimer
attribute indicates that this BGP connection
is using logic that damps BGP peer oscillations
in the Idle State.
Value: TRUE or FALSE 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_Expires event is described in
Section 8.1.3.
Option 4: IdleHoldTime Values: Time in seconds
Description: The IdleHoldTime is the value Group 2: Unconfigured Peers
that is set in the IdleHoldTimer.
Values: Time in seconds Optional Session Attributes: AcceptConnectionsUnconfiguredPeers
Option 5: IdleHoldTimer Option 1: AcceptConnectionsUnconfiguredPeers
Description: The IdleHoldTimer aids in controlling BGP peer Description: The BGP FSM optionally allows the acceptance of
oscillation. The IdleHoldTimer is used to keep BGP peer connections from neighbors that are not
the BGP peer in Idle for a particular duration. pre-configured. The
The IdleHoldTimer_Expires event is described "AcceptConnectionsUnconfiguredPeers" optional
in section 8.1.3. session attribute allows the FSM to support the
state transitions that allow the implementation to
accept or reject these unconfigured peers.
Values: Time in seconds The AcceptConnectionsUnconfiguredPeers has
security implications. Please refer to the BGP
Vulnerabilities document [RFC4272] for details.
Group 2: Unconfigured Peers Value: True or False
Optional Session Attributes: AcceptConnectionsUnconfiguredPeers Group 3: TCP processing
RFC DRAFT October 2004 Optional Session Attributes: PassiveTcpEstablishment,
TrackTcpState
Option 1: AcceptConnectionsUnconfiguredPeers 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.
Description: The BGP FSM optionally allows the acceptance of BGP value: TRUE or FALSE
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 Option 2: TrackTcpState
security implications. Please refer to the
BGP Vulnerabilities document[BGP_VULN] for
details.
Value: True or False 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.
Group 3: TCP processing Value: TRUE or FALSE
Optional Session Attributes: PassiveTcpEstablishment, TrackTcpState Group 4: BGP Message Processing
Option 1: PassiveTcpEstablishment Optional Session Attributes: DelayOpen, DelayOpenTime,
DelayOpenTimer,
SendNOTIFICATIONwithoutOPEN,
CollisionDetectEstablishedState
Description: This option indicates that the BGP FSM will passively Option 1: DelayOpen
wait for the remote BGP peer to establish the BGP
TCP connection.
value: TRUE or FALSE Description: The DelayOpen optional session attribute allows
implementations to be configured to delay sending
an OPEN message for a specific time period
(DelayOpenTime). The delay allows the remote BGP
Peer time to send the first OPEN message.
Option 2: TrackTcpState Value: TRUE or FALSE
Description: The BGP FSM normally tracks the end result of a TCP Option 2: DelayOpenTime
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 Description: The DelayOpenTime is the initial value set in the
DelayOpenTimer.
Group 4: BGP Message Processing Value: Time in seconds
Optional Session Attributes: DelayOpen, DelayOpenTime, Option 3: DelayOpenTimer
DelayOpenTimer,
RFC DRAFT October 2004 Description: The DelayOpenTimer optional session attribute is
used to delay the sending of an OPEN message on a
connection. The DelayOpenTimer_Expires event
(Event 12) is described in Section 8.1.3.
SendNOTIFICATIONwithoutOPEN, Value: Time in seconds
CollisionDetectEstablishedState
Option 1: DelayOpen Option 4: SendNOTIFICATIONwithoutOPEN
Description: The DelayOpen optional session attribute allows Description: The SendNOTIFICATIONwithoutOPEN allows a peer to
implementations to be configured to delay send a NOTIFICATION without first sending an OPEN
sending an OPEN message for a specific time message. Without this optional session attribute,
period (DelayOpenTime). The delay allows the BGP connection assumes that an OPEN message
the remote BGP Peer time to send the first must be sent by a peer prior to the peer sending a
OPEN message. NOTIFICATION message.
Value: TRUE or FALSE Value: True or False
Option 2: DelayOpenTime Option 5: CollisionDetectEstablishedState
Description: The DelayOpenTime is the initial value that is Description: Normally, a Detect Collision (see Section 6.8)
set in the DelayOpenTimer. will be ignored in the Established state. This
optional session attribute indicates that this BGP
connection processes collisions in the Established
state.
Value: Time in seconds Value: True or False
Option 3: DelayOpenTimer 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.
Description: The DelayOpenTimer optional session attribute 8.1.2. Administrative Events
is used to delay the sending of an OPEN message
on a connection. The DelayOpenTimer_Expires event
(Event 12) is described in section 8.1.3.
Value: Time in seconds 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 indications are
augmented by optional connection attributes that signal a certain
type of start or stop mechanism to the BGP FSM. An example of this
combination 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 the option to use
a Passive TCP Establishment. The Passive TCP establishment signals
that this BGP FSM will wait for the remote side to start the TCP
establishment.
Option 4: SendNOTIFICATIONwithoutOPEN 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 the optional session attributes
that 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 an FSM error.
Description: The SendNOTIFICATIONwithoutOPEN allows a peer to The settings of optional session attributes may be implicit in some
send a NOTIFICATION without first sending an implementations, and therefore may not be set explicitly by an
OPEN message. Without this optional session external operator action. Section 8.2.1.5 describes these implicit
attribute, the BGP connection assumes that an settings of the optional session attributes. The administrative
OPEN message must be sent by a peer prior states described below may also be implicit in some implementations
to the peer sending a NOTIFICATION message. and not directly configurable by an external operator.
Value: True or False Event 1: ManualStart
Option 5: CollisionDetectEstablishedState Definition: Local system administrator manually starts the peer
connection.
Description: Normally, a Detect Collision (6.8) will Status: Mandatory
be ignored in the Established state. This
RFC DRAFT October 2004 Optional
Attribute
Status: The PassiveTcpEstablishment attribute SHOULD be set
to FALSE.
optional session attribute indicates that Event 2: ManualStop
this BGP connection processes
collisions in the Established state.
Value: True or False Definition: Local system administrator manually stops the peer
connection.
Note: The optional session attributes clarify the BGP FSM description Status: Mandatory
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 Optional
Attribute
Status: No interaction with any optional attributes.
An administrative event is an event in which the operator interface Event 3: AutomaticStart
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) Definition: Local system automatically starts the BGP
are mandatory administrative events. All other administrative events connection.
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 Status: Optional, depending on local system
implementations and therefore may not be set explicitly by an exter- Optional
nal operator action. Section 8.2.1.5 describes these implicit set- Attribute
tings of the optional session attributes. The administrative states Status: 1) The AllowAutomaticStart attribute SHOULD be set
described below may also be implicit in some implementations and not to TRUE if this event occurs.
directly configurable by an external operator. 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.
RFC DRAFT October 2004 Event 4: ManualStart_with_PassiveTcpEstablishment
Event 1: ManualStart Definition: Local system administrator manually starts the peer
connection, but has PassiveTcpEstablishment
enabled. The PassiveTcpEstablishment optional
attribute indicates that the peer will listen prior
to establishing the connection.
Definition: Local system administrator manually starts peer Status: Optional, depending on local system
connection.
Status: Mandatory Optional
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.
Optional Event 5: AutomaticStart_with_PassiveTcpEstablishment
Attribute
Status: The PassiveTcpEstablishment attribute SHOULD be
set to FALSE.
Event 2: ManualStop Definition: Local system automatically starts the BGP
connection with the PassiveTcpEstablishment
enabled. The PassiveTcpEstablishment optional
attribute indicates that the peer will listen prior
to establishing a connection.
Definition: Local system administrator manually Status: Optional, depending on local system
stops the peer connection.
Status: Mandatory Optional
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.
Optional Event 6: AutomaticStart_with_DampPeerOscillations
Attribute
Status: No interaction with any optional attributes.
Event 3: AutomaticStart Definition: Local system automatically starts the BGP peer
connection with peer oscillation damping enabled.
The exact method of damping persistent peer
oscillations is determined by the implementation
and is outside the scope of this document.
Definition: Local system automatically starts the Status: Optional, depending on local system.
BGP connection.
Status: Optional, depending on local system Optional
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.
Optional Event 7: AutomaticStart_with_DampPeerOscillations_and_
Attribute PassiveTcpEstablishment
Status: 1) The AllowAutomaticStart attribute SHOULD be set
to TRUE if 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.
Event 4: ManualStart_with_PassiveTcpEstablishment Definition: Local system automatically starts the BGP peer
connection with peer oscillation damping enabled
and PassiveTcpEstablishment enabled. The exact
method of damping persistent peer oscillations is
determined by the implementation and is outside the
scope of this document.
Definition: Local system administrator manually starts peer Status: Optional, depending on local system
connection, but has PassiveTcpEstablishment
enabled. The PassiveTcpEstablishment optional
attribute indicates that the peer will listen prior
to establishing the connection.
RFC DRAFT October 2004 Optional
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.
Status: Optional, depending on local system Event 8: AutomaticStop
Optional Definition: Local system automatically stops the BGP
Attribute connection.
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.
Event 5: AutomaticStart_with_PassiveTcpEstablishment 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.
Definition: Local system automatically starts the Status: Optional, depending on local system
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 Optional
Attribute
Status: 1) The AllowAutomaticStop attribute SHOULD be TRUE.
Optional 8.1.3. Timer Events
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.
Event 6: AutomaticStart_with_DampPeerOscillations Event 9: ConnectRetryTimer_Expires
Definition: Local system automatically starts the Definition: An event generated when the ConnectRetryTimer
BGP peer connection with peer oscillation expires.
damping enabled. The exact method of damping
persistent peer oscillations is left up to the
implementation and is outside the scope of
this document.
Status: Optional, depending on local system. Status: Mandatory
Optional Event 10: HoldTimer_Expires
Attribute
Status: 1) The AllowAutomaticStart attribute SHOULD
be set to TRUE.
RFC DRAFT October 2004 Definition: An event generated when the HoldTimer expires.
2) The DampPeerOscillations attribute SHOULD Status: Mandatory
be set to TRUE.
3) The PassiveTcpEstablishment attribute
SHOULD be set to FALSE.
Event 7: AutomaticStart_with_DampPeerOscillations_and_ Event 11: KeepaliveTimer_Expires
PassiveTcpEstablishment
Definition: Local system automatically starts the Definition: An event generated when the KeepaliveTimer expires.
BGP peer connection with peer oscillation
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
this document.
Status: Optional, depending on local system Status: Mandatory
Optional Event 12: DelayOpenTimer_Expires
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.
Event 8: AutomaticStop Definition: An event generated when the DelayOpenTimer expires.
Definition: Local system automatically stops the Status: Optional
BGP connection.
An example of an automatic stop event is Optional
exceeding the number of prefixes for a given Attribute
peer and the local system automatically Status: If this event occurs,
disconnecting the peer. 1) DelayOpen attribute SHOULD be set to TRUE,
2) DelayOpenTime attribute SHOULD be supported,
3) DelayOpenTimer SHOULD be supported.
Status: Optional, depending on local system Event 13: IdleHoldTimer_Expires
Optional Definition: An event generated when the IdleHoldTimer expires,
Attribute indicating that the BGP connection has completed
Status: 1) The AllowAutomaticStop attribute waiting for the back-off period to prevent BGP peer
SHOULD be TRUE oscillation.
RFC DRAFT October 2004 The IdleHoldTimer is only used when the persistent
peer oscillation damping function is enabled by
setting the DampPeerOscillations optional attribute
to TRUE.
8.1.3 Timer Events Implementations not implementing the persistent
peer oscillation damping function may not have the
IdleHoldTimer.
Event 9: ConnectRetryTimer_Expires Status: Optional
Definition: An event generated when the ConnectRetryTimer Optional
expires. Attribute
Status: If this event occurs:
1) DampPeerOscillations attribute SHOULD be set to
TRUE.
2) IdleHoldTimer SHOULD have just expired.
Status: Mandatory 8.1.4. TCP Connection-Based Events
Event 10: HoldTimer_Expires Event 14: TcpConnection_Valid
Definition: An event generated when the HoldTimer expires. Definition: Event indicating the local system reception of a
TCP connection request with a valid source IP
address, TCP port, destination IP address, and TCP
Port. The definition of invalid source and invalid
destination IP address is determined by the
implementation.
Status: Mandatory BGP's destination port SHOULD be port 179, as
defined by IANA.
Event 11: KeepaliveTimer_Expires TCP connection request is denoted by the local
system receiving a TCP SYN.
Definition: An event generated when the KeepaliveTimer expires. Status: Optional
Status: Mandatory
Event 12: DelayOpenTimer_Expires Optional
Attribute
Status: 1) The TrackTcpState attribute SHOULD be set to
TRUE if this event occurs.
Definition: An event generated when the DelayOpenTimer expires. Event 15: Tcp_CR_Invalid
Status: Optional 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.
Optional BGP destination port number SHOULD be 179, as
Attribute defined by IANA.
Status: If this event occurs,
1) DelayOpen attribute SHOULD be set to TRUE,
2) DelayOpenTime attribute SHOULD be supported,
3) DelayOpenTimer SHOULD be supported,
Event 13: IdleHoldTimer_Expires A TCP connection request occurs when the local
system receives a TCP SYN.
Definition: An event generated when the IdleHoldTimer Status: Optional
expires indicating that the BGP connection has
completed waiting for the back-off period
to prevent BGP peer oscillation.
The IdleHoldTimer is only used when the Optional
persistent peer oscillation damping Attribute
function is enabled by setting the Status: 1) The TrackTcpState attribute should be set to
DampPeerOscillations optional attribute TRUE if this event occurs.
RFC DRAFT October 2004 Event 16: Tcp_CR_Acked
to TRUE. Definition: Event indicating the local system's request to
establish a TCP connection to the remote peer.
Implementations not implementing the The local system's TCP connection sent a TCP SYN,
persistent peer oscillation damping received a TCP SYN/ACK message, and sent a TCP ACK.
function may not have the IdleHoldTimer.
Status: Optional Status: Mandatory
Optional Event 17: TcpConnectionConfirmed
Attribute
Status: If this event occurs:
1) DampPeerOscillations attribute SHOULD be set
to TRUE.
2) IdleHoldTimer SHOULD have just expired.
8.1.4 TCP Connection based Events Definition: Event indicating that the local system has received
a confirmation that the TCP connection has been
established by the remote site.
Event 14: TcpConnection_Valid 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.
Definition: Event indicating the local system reception of Status: Mandatory
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 Event 18: TcpConnectionFails
as defined by IANA.
TCP connection request is denoted by the Definition: Event indicating that the local system has received
local system receiving a TCP SYN. a TCP connection failure notice.
Status: Optional The remote BGP peer's TCP machine could have sent a
FIN. The local peer would respond with a FIN-ACK.
Another possibility is that the local peer
indicated a timeout in the TCP connection and
downed the connection.
Optional Status: Mandatory
Attribute
Status: 1) The TrackTcpState attribute SHOULD be set to
TRUE if this event occurs.
Event 15: Tcp_CR_Invalid 8.1.5. BGP Message-Based Events
Definition: Event indicating the local system reception Event 19: BGPOpen
of a TCP connection request with either
RFC DRAFT October 2004 Definition: An event is generated when a valid OPEN message has
been received.
an invalid source address or port Status: Mandatory
number or an invalid destination
address or port number.
BGP destination port number SHOULD be 179 Optional
as defined by IANA. Attribute
Status: 1) The DelayOpen optional attribute SHOULD be set
to FALSE.
2) The DelayOpenTimer SHOULD not be running.
A TCP connection request occurs when Event 20: BGPOpen with DelayOpenTimer running
the local system receives a TCP
SYN.
Status: Optional 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.
Optional Status: Optional
Attribute
Status: 1) The TrackTcpState attribute should be set to
TRUE if this event occurs.
Event 16: Tcp_CR_Acked Optional
Attribute
Status: 1) The DelayOpen attribute SHOULD be set to TRUE.
2) The DelayOpenTimer SHOULD be running.
Definition: Event indicating the local system's request Event 21: BGPHeaderErr
to establish a TCP connection to the remote
peer.
The local system's TCP connection sent a TCP Definition: An event is generated when a received BGP message
SYN, and received a TCP SYN/ACK message, header is not valid.
and sent a TCP ACK.
Status: Mandatory Status: Mandatory
Event 17: TcpConnectionConfirmed Event 22: BGPOpenMsgErr
Definition: Event indicating that the local system has Definition: An event is generated when an OPEN message has been
received a confirmation that the TCP received with errors.
connection has been established by the
remote site.
The remote peer's TCP engine sent a TCP SYN. Status: Mandatory
The local peer's TCP engine sent a SYN, ACK
message and now has received a final ACK.
Status: Mandatory Event 23: OpenCollisionDump
Event 18: TcpConnectionFails 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 be disconnected.
See Section 6.8 for more information on collision
detection.
Definition: Event indicating that the local system has Event 23 is an administrative action generated by
received a TCP connection failure notice. implementation logic that determines whether 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.
RFC DRAFT October 2004 Status: Optional
The remote BGP peer's TCP machine could have Optional
sent a FIN. The local peer would respond Attribute
with a FIN-ACK. Another alternative is that Status: If the state machine is to process this event in
the local peer indicated a timeout in the the Established state,
TCP connection and downed the connection. 1) CollisionDetectEstablishedState optional
attribute SHOULD be set to TRUE.
Status: Mandatory Please note: The OpenCollisionDump event can occur
in Idle, Connect, Active, OpenSent, and OpenConfirm
without any optional attributes being set.
8.1.5 BGP Message-based Events Event 24: NotifMsgVerErr
Event 19: BGPOpen Definition: An event is generated when a NOTIFICATION message
with "version error" is received.
Definition: An event is generated when a valid OPEN Status: Mandatory
message has been received.
Status: Mandatory Event 25: NotifMsg
Optional Definition: An event is generated when a NOTIFICATION message
Attribute is received and the error code is anything but
Status: 1) The DelayOpen optional attribute SHOULD "version error".
be set to FALSE.
2) The DelayOpenTimer SHOULD not be running.
Event 20: BGPOpen with DelayOpenTimer running Status: Mandatory
Definition: An event is generated when a valid OPEN Event 26: KeepAliveMsg
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 Definition: An event is generated when a KEEPALIVE message is
received.
Optional Status: Mandatory
Attribute
Status: 1) The DelayOpen attribute SHOULD be
set to TRUE.
2) The DelayOpenTimer SHOULD be running.
Event 21: BGPHeaderErr Event 27: UpdateMsg
RFC DRAFT October 2004 Definition: An event is generated when a valid UPDATE message
is received.
Definition: An event is generated when a received Status: Mandatory
BGP message header is not valid.
Status: Mandatory Event 28: UpdateMsgErr
Event 22: BGPOpenMsgErr Definition: An event is generated when an invalid UPDATE
message is received.
Definition: An event is generated when an OPEN message Status: Mandatory
has been received with errors.
Status: Mandatory 8.2. Description of FSM
Event 23: OpenCollisionDump 8.2.1. FSM Definition
Definition: An event generated administratively BGP MUST maintain a separate FSM for each configured peer. Each BGP
when a connection collision has been peer paired in a potential connection will attempt to connect to the
detected while processing an incoming other, unless configured to remain in the idle state, or configured
OPEN message and this connection has been to remain passive. For the purpose of this discussion, the active or
selected to be disconnected. See section connecting side of the TCP connection (the side of a TCP connection
6.8 for more information on collision sending the first TCP SYN packet) is called outgoing. The passive or
detection. listening side (the sender of the first SYN/ACK) is called an
incoming connection. (See Section 8.2.1.1 for information on the
terms active and passive used below.)
Event 23 is an administrative action A BGP implementation MUST connect to and listen on TCP port 179 for
generated by implementation logic incoming connections in addition to trying to connect to peers. For
that determines that this connection each incoming connection, a state machine MUST be instantiated.
needs to be dropped per the rules in There exists a period in which the identity of the peer on the other
section 6.8. This event may occur if the FSM end of an incoming connection is known, but the BGP identifier is not
is implemented as two linked state machines. known. During this time, both an incoming and outgoing connection
may exist for the same configured peering. This is referred to as a
connection collision (see Section 6.8).
Status: Optional 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.
Optional There may be more than one connection between a pair of peers if the
Attribute connections are configured to use a different pair of IP addresses.
Status: If the state machine is to process this This is referred to as multiple "configured peerings" to the same
event in Established state, peer.
1) CollisionDetectEstablishedState
optional attribute SHOULD be set to TRUE
Please note: The OpenCollisionDump event can occur 8.2.1.1. Terms "active" and "passive"
in Idle, Connect, Active, OpenSent, OpenConfirm
without any optional attributes being set.
Event 24: NotifMsgVerErr 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 when applied to a
TCP connection or 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 as 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 was
passive. The only difference is in which side of the TCP connection
has port number 179.
Definition: An event is generated when a 8.2.1.2. FSM and Collision Detection
RFC DRAFT October 2004 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
connection collision is resolved (see Section 6.8), the FSM for the
connection that is closed SHOULD be disposed.
NOTIFICATION message with "version 8.2.1.3. FSM and Optional Session Attributes
error" is received.
Status: Mandatory 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 BGP FSM actions must be
supported. For example, if the following options can be set in a BGP
implementation: AutoStart and PassiveTcpEstablishment, then 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.
Event 25: NotifMsg Each of the optional timers (DelayOpenTimer and IdleHoldTimer) has a
group of attributes that are:
Definition: An event is generated when a - flag indicating support,
NOTIFICATION message is received and - Time set in Timer
the error code is anything but - Timer.
"version error".
Status: Mandatory The two optional timers show this format:
Event 26: KeepAliveMsg DelayOpenTimer: DelayOpen, DelayOpenTime, DelayOpenTimer
IdleHoldTimer: DampPeerOscillations, IdleHoldTime,
IdleHoldTimer
Definition: An event is generated when a KEEPALIVE If the flag indicating support for an optional timer (DelayOpen or
message is received. DampPeerOscillations) cannot be set to TRUE, the timers and events
supporting that option do not have to be supported.
Status: Mandatory 8.2.1.4. FSM Event Numbers
Event 27: UpdateMsg The Event numbers (1-28) utilized in this state machine description
aid in specifying the behavior of the BGP state machine.
Implementations MAY use these numbers to provide network management
information. The exact form of an FSM or the FSM events are specific
to each implementation.
Definition: An event is generated when a valid 8.2.1.5. FSM Actions that are Implementation Dependent
UPDATE message is received.
Status: Mandatory At certain points, the BGP FSM specifies 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.
Event 28: UpdateMsgErr 8.2.2. Finite State Machine
Definition: An event is generated when an invalid Idle state:
UPDATE message is received.
Status: Mandatory Initially, the BGP peer FSM is in the Idle state. Hereafter, the
BGP peer FSM will be shortened to BGP FSM.
8.2 Description of FSM 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:
8.2.1 FSM Definition - initializes all BGP resources for the peer connection,
BGP MUST maintain a separate FSM for each configured peer. Each BGP - sets ConnectRetryCounter to zero,
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
RFC DRAFT October 2004 - starts the ConnectRetryTimer with the initial value,
connecting side of the TCP connection (the side of a TCP connection - initiates a TCP connection to the other BGP peer,
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 for information on the terms
active and passive used below.)
A BGP implementation MUST connect to and listen on TCP port 179 for - listens for a connection that may be initiated by the remote
incoming connections in addition to trying to connect to peers. For BGP peer, and
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
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.)
A BGP implementation will have at most one FSM for each configured - changes its state to Connect.
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 connection between a pair of peers if the The ManualStop event (Event 2) and AutomaticStop (Event 8) event
connections are configured to use a different pair of IP addresses. are ignored in the Idle state.
This is referred to as multiple "configured peerings" to the same
peer.
8.2.1.1 Terms "active" and "passive" In response to a ManualStart_with_PassiveTcpEstablishment event
(Event 4) or AutomaticStart_with_PassiveTcpEstablishment event
(Event 5), the local system:
The terms active and passive have been in the Internet operator's - initializes all BGP resources,
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 - sets the ConnectRetryCounter to zero,
There is one FSM per BGP connection. When the connection collision - starts the ConnectRetryTimer with the initial value,
occurs prior to determining what peer a connection is associated
RFC DRAFT October 2004 - listens for a connection that may be initiated by the remote
peer, and
with, there may be two connections for one peer. After the connec- - changes its state to Active.
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 Session Attributes The exact value of the ConnectRetryTimer is a local matter, but it
SHOULD be sufficiently large to allow TCP initialization.
Optional Session Attributes specify either attributes that act If the DampPeerOscillations attribute is set to TRUE, the
as flags (TRUE or FALSE) or optional timers. For optional following three additional events may occur within the Idle state:
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), - AutomaticStart_with_DampPeerOscillations (Event 6),
has a group of attributes that are:
- flag indicating support, - AutomaticStart_with_DampPeerOscillations_and_
- Time set in Timer PassiveTcpEstablishment (Event 7),
- Timer.
The two optional timers show this format: - IdleHoldTimer_Expires (Event 13).
DelayOpenTimer: DelayOpen, DelayOpenTime, DelayOpenTimer Upon receiving these 3 events, the local system will use these
IdleHoldTimer: DampPeerOscillations, IdleHoldTime, events to prevent peer oscillations. The method of preventing
IdleHoldTimer persistent peer oscillation is outside the scope of this document.
If the flag indicating support for an optional timer Any other event (Events 9-12, 15-28) received in the Idle state
(DelayOpen or DampPeerOscillations), cannot be set to TRUE, does not cause change in the state of the local system.
the timers and events supporting that
option do not have to be supported.
8.2.1.4 FSM Event numbers Connect State:
The Event numbers (1-28) utilized in this state machine description In this state, BGP FSM is waiting for the TCP connection to be
aid in specifying the behavior of the BGP state machine. Implementa- completed.
tions MAY use these numbers to provide network management informa-
tion. The exact form of a FSM or the FSM events are specific to each
implementation.
RFC DRAFT October 2004 The start events (Events 1, 3-7) are ignored in the Connect state.
8.2.1.5 FSM actions that are implementation dependent. In response to a ManualStop event (Event 2), the local system:
The BGP FSM specifies at certain points that BGP initialization will - drops the TCP connection,
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 - releases all BGP resources,
- sets ConnectRetryCounter to zero,
Idle state: - stops the ConnectRetryTimer and sets ConnectRetryTimer to
zero, and
Initially the BGP peer FSM is in the Idle state. (Hereafter - changes its state to Idle.
the BGP peer FSM will be shortened to BGP FSM.)
In this state BGP FSM refuses all incoming BGP In response to the ConnectRetryTimer_Expires event (Event 9), the
connections for this peer. No resources are allocated to the peer. local system:
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 ManualStop event (Event 2) and AutomaticStop (Event 8) event - drops the TCP connection,
are ignored in the Idle state.
In response to a ManualStart_with_PassiveTcpEstablishment event - restarts the ConnectRetryTimer,
(Event 4) or AutomaticStart_with_PassiveTcpEstablishment event
(Event 5), the local system:
- initializes all BGP resources,
- 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 ConnectRetryTimer is a local - stops the DelayOpenTimer and resets the timer to zero,
matter, but it SHOULD be sufficiently large to allow TCP
initialization.
If the DampPeerOscillations attribute is set to TRUE, - initiates a TCP connection to the other BGP peer,
RFC DRAFT October 2004 - continues to listen for a connection that may be initiated by
the remote BGP peer, and
the following three additional events may occur - stays in the Connect state.
within Idle state:
- AutomaticStart_with_DampPeerOscillations (Event 6),
- AutomaticStart_with_DampPeerOscillations_and_
PassiveTcpEstablishment (Event 7),
- IdleHoldTimer_Expires (Event 13).
Upon receiving these 3 events, the local system will If the DelayOpenTimer_Expires event (Event 12) occurs in the
use these events to prevent peer oscillations. Connect state, the local system:
The method of preventing persistent peer oscillation is
outside the scope of this document.
Any other event (Events 9-12, 15-28) received in the Idle state - sends an OPEN message to its peer,
does not cause change in the state of the local system.
Connect State: - sets the HoldTimer to a large value, and
In this state, BGP FSM is waiting for the TCP connection to - changes its state to OpenSent.
be completed.
The start events (Events 1, 3-7) are ignored in connect If the BGP FSM receives a TcpConnection_Valid event (Event 14),
state. the TCP connection is processed, and the connection remains in the
Connect state.
In response to a ManualStop event (Event 2), the local system: If the BGP FSM receives a Tcp_CR_Invalid event (Event 15), the
- drops the TCP connection, local system rejects the TCP connection, and the connection
- releases all BGP resources, remains in the Connect state.
- sets ConnectRetryCounter to zero,
- stops the ConnectRetryTimer and sets ConnectRetryTimer
to zero, and
- changes its state to Idle.
In response to the ConnectRetryTimer_Expires event (Event 9), If the TCP connection succeeds (Event 16 or Event 17), the local
the local system: system checks the DelayOpen attribute prior to processing. If the
- drops the TCP connection, DelayOpen attribute is set to TRUE, the local system:
- 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 DelayOpenTimer_Expires event (Event 12) occurs in the - stops the ConnectRetryTimer (if running) and sets the
Connect state, the local system: ConnectRetryTimer to zero,
- sends an OPEN message to its peer,
- sets the HoldTimer to a large value, and
RFC DRAFT October 2004 - sets the DelayOpenTimer to the initial value, and
- stays in the Connect state.
- changes its state to OpenSent. If the DelayOpen attribute is set to FALSE, the local system:
If the BGP FSM receives a TcpConnection_Valid event - stops the ConnectRetryTimer (if running) and sets the
(Event 14), the TCP connection is processed, and ConnectRetryTimer to zero,
the connection remains in the Connect state.
If the BGP FSM receives a Tcp_CR_Invalid event (Event 15), - completes BGP initialization
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), - sends an OPEN message to its peer,
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 DelayOpen attribute is set to FALSE, 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 HoldTimer to a large value, and
- changes its state to OpenSent.
A HoldTimer value of 4 minutes is suggested. - sets the HoldTimer to a large value, and
If the TCP connection fails (Event 18), the local system - changes its state to OpenSent.
checks the DelayOpenTimer. If the DelayOpenTimer is running,
the local system:
- restarts the ConnectRetryTimer with initial value,
- stops the DelayOpenTimer and resets its 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 DelayOpenTimer is not running, the local system: A HoldTimer value of 4 minutes is suggested.
- 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 while the DelayOpenTimer is If the TCP connection fails (Event 18), the local system checks
running (Event 20), the local system: the DelayOpenTimer. If the DelayOpenTimer is running, the local
system:
- stops the ConnectRetryTimer (if running) and - restarts the ConnectRetryTimer with the initial value,
sets the ConnectRetryTimer to zero,
RFC DRAFT October 2004 - stops the DelayOpenTimer and resets its value to zero,
- completes the BGP initialization, - continues to listen for a connection that may be initiated by
- stops and clears the DelayOpenTimer the remote BGP peer, and
(sets the value to zero),
- sends an OPEN message,
- sends a KEEPALIVE message,
- if the HoldTimer initial value is non-zero,
- starts the KeepaliveTimer with the initial value and
- resets the HoldTimer 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 - changes its state to Active.
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 If the DelayOpenTimer is not running, the local system:
OPEN message checking detects an error (Event 22) (see section
6.2), the local system:
- (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
- stops the ConnectRetryTimer (if running) - stops the ConnectRetryTimer to zero,
and sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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 a NOTIFICATION message is received with a version - drops the TCP connection,
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 DelayOpenTimer is not running, the local system: - releases all BGP resources, and
- stops the ConnectRetryTimer and sets the
ConnectRetryTimer to zero,
- releases all BGP resources,
RFC DRAFT October 2004 - changes its state to Idle.
- drops the TCP connection, If an OPEN message is received while the DelayOpenTimer is running
- increments the ConnectRetryCounter by 1, (Event 20), the local system:
- 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, - stops the ConnectRetryTimer (if running) and sets the
25-28) the local system: ConnectRetryTimer to zero,
- 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 ConnectRetryCounter by 1,
- performs peer oscillation damping if the
DampPeerOscillations attribute is set to True, and
- changes its state to Idle.
Active State: - completes the BGP initialization,
- stops and clears the DelayOpenTimer (sets the value to zero),
In this state BGP FSM is trying to acquire a peer by listening - sends an OPEN message,
for and accepting a TCP connection.
The start events (Events 1, 3-7) are ignored in the Active - sends a KEEPALIVE message,
state.
In response to a ManualStop event (Event 2), the local system: - if the HoldTimer initial value is non-zero,
- 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 DelayOpenTimer
- drops the TCP connection,
- sets ConnectRetryCounter to zero,
- stops the ConnectRetryTimer and sets the
ConnectRetryTimer to zero, and
- changes its state to Idle.
In response to a ConnectRetryTimer_Expires event (Event 9), - starts the KeepaliveTimer with the initial value and
the local system:
- restarts the ConnectRetryTimer (with initial value),
- initiates a TCP connection to the other BGP peer,
- continues to listen for TCP connection that may be
initiated by remote BGP peer, and
RFC DRAFT October 2004 - resets the HoldTimer to the negotiated value,
- changes its state to Connect. else, if the HoldTimer initial value is zero,
If the local system receives a DelayOpenTimer_Expires event - resets the KeepaliveTimer and
(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 its remote peer,
- sets its hold timer to a large value, and
- changes its state to OpenSent.
A HoldTimer value of 4 minutes is also suggested for this - resets the HoldTimer value to zero,
state transition.
If the local system receives a TcpConnection_Valid event - and changes its state to OpenConfirm.
(Event 14), the local system processes the TCP connection
flags and stays in Active state.
If the local system receives an Tcp_CR_Invalid event (Event 15): If the value of the autonomous system field is the same as the
the local system rejects the TCP connection and stays in local Autonomous System number, set the connection status to an
the Active State. internal connection; otherwise it will be "external".
In response to a TCP connection succeeding (Event 16 or Event 17), If BGP message header checking (Event 21) or OPEN message checking
the local system checks the DelayOpen optional attribute prior to detects an error (Event 22) (see Section 6.2), the local system:
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.
A HoldTimer value of 4 minutes is suggested as a "large value" for - (optionally) If the SendNOTIFICATIONwithoutOPEN attribute is
the HoldTimer. set to TRUE, then the local system first sends a NOTIFICATION
message with the appropriate error code, and then
If the local system receives a TcpConnectionFails event (Event 18), - stops the ConnectRetryTimer (if running) and sets the
the local system: ConnectRetryTimer to zero,
RFC DRAFT October 2004 - releases all BGP resources,
- restarts ConnectRetryTimer (with initial value), - drops the TCP connection,
- 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 and the DelayOpenTimer is - increments the ConnectRetryCounter by 1,
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,
- 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 - (optionally) performs peer oscillation damping if the
the local Autonomous System number, set the connection status DampPeerOscillations attribute is set to TRUE, and
to an internal connection; otherwise it is external.
If BGP message header checking detects an error (Event 21) - changes its state to Idle.
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 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 If a NOTIFICATION message is received with a version error (Event
error (Event 24), the local system checks the DelayOpenTimer. 24), the local system checks the DelayOpenTimer. If the
If the DelayOpenTimer is running, the local system: DelayOpenTimer is running, the local system:
- stops the ConnectRetryTimer (if running) and
sets the ConnectRetryTimer to zero,
RFC DRAFT October 2004 - stops the ConnectRetryTimer (if running) and sets the
ConnectRetryTimer to zero,
- stops and resets the DelayOpenTimer (sets 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 DelayOpenTimer is not running, the local system:
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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.
In response to any other event (Events 8,10-11,13,19,23,25-28), - releases all BGP resources,
the local system:
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection,
- 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: - drops the TCP connection, and
In this state BGP FSM waits for an OPEN message from its peer. - changes its state to Idle.
The start events (Events 1, 3-7) are ignored in the OpenSent If the DelayOpenTimer is not running, the local system:
state.
If a ManualStop event (Event 2) is issued in OpenSent - stops the ConnectRetryTimer and sets the ConnectRetryTimer to
state, the local system: zero,
- sends the NOTIFICATION with a cease,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection,
- sets the ConnectRetryCounter to zero, and
- changes its state to Idle.
If an AutomaticStop event (Event 8) is issued in OpenSent - releases all BGP resources,
state, the local system:
- sends the NOTIFICATION with a cease,
- sets the ConnectRetryTimer to zero,
- releases all the BGP resources,
- drops the TCP connection,
- increments the ConnectRetryCounter by 1,
- (optionally) performs peer oscillation damping if the
RFC DRAFT October 2004 - drops the TCP connection,
DampPeerOscillations attribute is set to TRUE, and - increments the ConnectRetryCounter by 1,
- changes its state to Idle.
If the HoldTimer_Expires (Event 10), the local system: - performs peer oscillation damping if the DampPeerOscillations
- sends a NOTIFICATION message with error code Hold attribute is set to True, and
Timer Expired,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection,
- increments the ConnectRetryCounter,
- (optionally) performs peer oscillation damping if the
DampPeerOscillations attribute is set to TRUE, and
- changes its state to Idle.
If a TcpConnection_Valid (Event 14) or Tcp_CR_Acked (Event 16) - changes its state to Idle.
is received, or a TcpConnectionConfirmed 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 Request for an Invalid port In response to any other events (Events 8, 10-11, 13, 19, 23,
(Tcp_CR_Invalid (Event 15)) is ignored. 25-28), the local system:
If a TcpConnectionFails event (Event 18) is received, - if the ConnectRetryTimer is running, stops and resets the
the local system: ConnectRetryTimer (sets to zero),
- closes the BGP connection,
- 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 - if the DelayOpenTimer is running, stops and resets the
for correctness. If there are no errors in the OPEN message DelayOpenTimer (sets to zero),
(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 HoldTimer and - releases all BGP resources,
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
RFC DRAFT October 2004 - drops the TCP connection,
as described below.) - increments the ConnectRetryCounter by 1,
If the BGP message header checking (Event 21) or OPEN message - performs peer oscillation damping if the DampPeerOscillations
check detects an error (Event 22)(see Section 6.2), the local system: attribute is set to True, and
- sends a NOTIFICATION message with appropriate error
code,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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 - changes its state to Idle.
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 state is determined to be the Active State:
connection that must be closed, an OpenCollisionDump (Event 23)
is signaled to the state machine. If such an event is
received in OpenSent state, the local system:
- sends a NOTIFICATION with a Cease
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection,
- 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 In this state, BGP FSM is trying to acquire a peer by listening
error (Event 24), the local system: for, and accepting, a TCP connection.
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection, and
- changes its state to Idle.
In response to any other event (Events 9, 11-13,20,25-28), The start events (Events 1, 3-7) are ignored in the Active state.
the local system:
- sends the NOTIFICATION with the Error Code Finite
state machine error,
- sets the ConnectRetryTimer to zero,
RFC DRAFT October 2004 In response to a ManualStop event (Event 2), the local system:
- releases all BGP resources, - If the DelayOpenTimer is running and the
- drops the TCP connection, SendNOTIFICATIONwithoutOPEN session attribute is set, the
- increments the ConnectRetryCounter by 1, local system sends a NOTIFICATION with a Cease,
- (optionally) performs peer oscillation damping if the
DampPeerOscillations attribute is set to TRUE, and
- changes its state to Idle.
OpenConfirm State: - releases all BGP resources including stopping the
DelayOpenTimer
In this state BGP waits for a KEEPALIVE or NOTIFICATION - drops the TCP connection,
message.
Any start event (Events 1, 3-7) is ignored in the OpenConfirm - sets ConnectRetryCounter to zero,
state.
In response to a ManualStop event (Event 2) initiated by - stops the ConnectRetryTimer and sets the ConnectRetryTimer to
the operator, the local system: zero, and
- sends the NOTIFICATION message with Cease,
- releases all BGP resources,
- drops the TCP connection,
- sets the ConnectRetryCounter to zero,
- sets the ConnectRetryTimer to zero, and
- changes its state to Idle.
In response to the AutomaticStop event initiated by the - changes its state to Idle.
system (Event 8), the local system:
- sends the NOTIFICATION message with Cease,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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 HoldTimer_Expires event (Event 10) occurs before a KEEPALIVE In response to a ConnectRetryTimer_Expires event (Event 9), the
message is received, the local system: 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 ConnectRetryCounter by 1,
- (optionally) performs peer oscillation damping if
RFC DRAFT October 2004 - restarts the ConnectRetryTimer (with initial value),
the DampPeerOscillations attribute is set to TRUE, and - initiates a TCP connection to the other BGP peer,
- changes its state to Idle.
If the local system receives a KeepaliveTimer_Expires - continues to listen for a TCP connection that may be initiated
event (Event 11), the system: by a remote BGP peer, and
- sends a KEEPALIVE message,
- restarts the KeepaliveTimer, and
- remains in OpenConfirmed state.
In the event of TcpConnection_Valid event (Event 14), or TCP - changes its state to Connect.
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), If the local system receives a DelayOpenTimer_Expires event (Event
the local system will ignore the second connection 12), the local system:
attempt.
If the local system receives a TcpConnectionFails event - sets the ConnectRetryTimer to zero,
(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 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 with a - stops and clears the DelayOpenTimer (set to zero),
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 - completes the BGP initialization,
(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 ConnectRetryCounter by 1,
- (optionally) performs peer oscillation damping if the
RFC DRAFT October 2004 - sends the OPEN message to its remote peer,
- sets its hold timer to a large value, and
DampPeerOscillations attribute is set to TRUE, and - changes its state to OpenSent.
- changes its state to Idle.
If an OPEN message is received, all fields are checked for A HoldTimer value of 4 minutes is also suggested for this state
correctness. If the BGP message header checking transition.
(BGPHeaderErr (Event 21)) or OPEN message check detects
an error (see Section 6.2) (BGPOpenMsgErr (Event 22)), the
local system:
- sends a NOTIFICATION message with appropriate error
code,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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 during the processing of another OPEN message, the BGP If the local system receives a TcpConnection_Valid event (Event
implementation determines by a means outside the scope of 14), the local system processes the TCP connection flags and stays
this document that a connection collision has occurred and in the Active state.
this connection is to be closed, the local system will
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 ConnectRetryTimer to zero,
- releases all BGP resources
- 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 If the local system receives a Tcp_CR_Invalid event (Event 15),
(KeepAliveMsg (Event 26)), the local system: the local system rejects the TCP connection and stays in the
- restarts the HoldTimer and Active State.
- changes its state to Established.
In response to any other event (Events 9, 12-13, 20, 27-28), In response to the success of a TCP connection (Event 16 or Event
the local system: 17), the local system checks the DelayOpen optional attribute
- sends a NOTIFICATION with a code of Finite State prior to processing.
Machine Error,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
RFC DRAFT October 2004 If the DelayOpen attribute is set to TRUE, the local system:
- drops the TCP connection, - stops the ConnectRetryTimer and sets the ConnectRetryTimer
- increments the ConnectRetryCounter by 1, to zero,
- (optionally) performs peer oscillation damping if the
DampPeerOscillations attribute is set to TRUE, and
- changes its state to Idle.
Established State: - sets the DelayOpenTimer to the initial value
(DelayOpenTime), and
In the Established state, the BGP FSM can exchange UPDATE, - stays in the Active state.
NOTIFICATION, and KEEPALIVE messages with its peer.
Any Start event (Events 1, 3-7) is ignored in the If the DelayOpen attribute is set to FALSE, the local system:
Established state.
In response to a ManualStop event (initiated by an - sets the ConnectRetryTimer to zero,
operator) (Event 2), the local system:
- sends the NOTIFICATION message with Cease,
- 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 AutomaticStop event (Event 8), the local system: - completes the BGP initialization,
- sends a NOTIFICATION with Cease,
- sets the ConnectRetryTimer to zero
- deletes all routes associated with this connection,
- releases all BGP resources,
- 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.
One reason for an AutomaticStop event is: A BGP receives - sends the OPEN message to its peer,
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 HoldTimer_Expires event occurs (Event 10), the - sets its HoldTimer to a large value, and
local system:
- sends a NOTIFICATION message with Error Code Hold
Timer Expired,
RFC DRAFT October 2004 - changes its state to OpenSent.
- sets the ConnectRetryTimer to zero, A HoldTimer value of 4 minutes is suggested as a "large value" for
- releases all BGP resources, the HoldTimer.
- 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 KeepaliveTimer_Expires event occurs (Event 11), If the local system receives a TcpConnectionFails event (Event
the local system: 18), 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 - restarts the ConnectRetryTimer (with the initial value),
message, it restarts its KeepaliveTimer, unless the - stops and clears the DelayOpenTimer (sets the value to zero),
negotiated HoldTime value is zero.
A TcpConnection_Valid (Event 14) received for a - releases all BGP resource,
valid port will cause the second connection to be
tracked.
An invalid TCP connection (Tcp_CR_Invalid event - increments the ConnectRetryCounter by 1,
(Event 15)), will be ignored.
In response to an indication that the TCP connection - optionally performs peer oscillation damping if the
is successfully established (Event 16 or Event 17), DampPeerOscillations attribute is set to TRUE, and
the second connection SHALL be tracked until
it sends an OPEN message.
If a valid OPEN message (BGPOpen (Event 19)) is received, - changes its state to Idle.
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 ConnectRetryTimer to zero,
- deletes all routes associated with this connection,
- releases all BGP resources,
- drops the TCP connection,
- increments ConnectRetryCounter by 1,
- (optionally) performs peer oscillation damping if the
DampPeerOscillations is set to TRUE, and
- changes its state to Idle.
RFC DRAFT October 2004 If an OPEN message is received and the DelayOpenTimer is running
(Event 20), the local system:
If the local system receives a NOTIFICATION message - stops the ConnectRetryTimer (if running) and sets the
(Event 24 or Event 25) or a TcpConnectionFails (Event 18) ConnectRetryTimer to zero,
from the underlying TCP, it:
- sets the ConnectRetryTimer to zero,
- deletes all routes associated with this connection,
- releases all the BGP resources,
- drops the TCP connection,
- increments the ConnectRetryCounter by 1,
- changes its state to Idle.
If the local system receives a KEEPALIVE message - stops and clears the DelayOpenTimer (sets to zero),
(Event 26), the local system:
- restarts its HoldTimer, if the negotiated HoldTime
value is non-zero, and
- remains in the Established state.
If the local system receives an UPDATE message (Event 27), - completes the BGP initialization,
the local system:
- processes the message,
- restarts its HoldTimer if the negotiated HoldTime
value is non-zero, and
- remains in the Established state.
If the local system receives an UPDATE message, and the - sends an OPEN message,
UPDATE message error handling procedure (see Section 6.3)
detects an error (Event 28), the local system:
- sends a NOTIFICATION message with Update error,
- sets the ConnectRetryTimer to zero,
- deletes all routes associated with this connection,
- releases all BGP resources,
- 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.
In response to any other event (Events 9, 12-13, 20-22) the - sends a KEEPALIVE message,
local system:
- sends a NOTIFICATION message with Error Code Finite
State Machine Error,
- deletes all routes associated with this connection,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection,
RFC DRAFT October 2004 - if the HoldTimer value is non-zero,
- increments the ConnectRetryCounter by 1, - starts the KeepaliveTimer to initial value,
- (optionally) performs peer oscillation damping if the
DampPeerOscillations attribute is set to TRUE, and
- changes its state to Idle.
9. UPDATE Message Handling - 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 will be external.
If BGP message header checking (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 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 (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 DelayOpenTimer is not running, the local system:
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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.
In response to any other event (Events 8, 10-11, 13, 19, 23,
25-28), the local system:
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection,
- 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 FSM waits for an OPEN message from its peer.
The start events (Events 1, 3-7) are ignored in the OpenSent
state.
If a ManualStop event (Event 2) is issued in the OpenSent state,
the local system:
- sends the NOTIFICATION with a Cease,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection,
- sets the ConnectRetryCounter to zero, and
- changes its state to Idle.
If an AutomaticStop event (Event 8) is issued in the OpenSent
state, the local system:
- sends the NOTIFICATION with a Cease,
- sets the ConnectRetryTimer to zero,
- releases all the BGP resources,
- 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 HoldTimer_Expires (Event 10), the local system:
- sends a NOTIFICATION message with the error code Hold Timer
Expired,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection,
- increments the ConnectRetryCounter,
- (optionally) performs peer oscillation damping if the
DampPeerOscillations attribute is set to TRUE, and
- changes its state to Idle.
If a TcpConnection_Valid (Event 14), Tcp_CR_Acked (Event 16), or a
TcpConnectionConfirmed 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 Request for an Invalid port (Tcp_CR_Invalid
(Event 15)) is ignored.
If a TcpConnectionFails event (Event 18) is received, the local
system:
- closes the BGP connection,
- 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 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 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 (Event 21) or OPEN message
checking detects an error (Event 22)(see Section 6.2), the local
system:
- sends a NOTIFICATION message with the appropriate error code,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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. A
CollisionDetectDump event occurs when the BGP implementation
determines, by means outside the scope of this document, that a
connection collision has occurred.
If a connection in the OpenSent state is determined to be the
connection that must be closed, an OpenCollisionDump (Event 23) is
signaled to the state machine. If such an event is received in
the OpenSent state, the local system:
- sends a NOTIFICATION with a Cease,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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 a NOTIFICATION message is received with a version error (Event
24), the local system:
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- drops the TCP connection, and
- changes its state to Idle.
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 ConnectRetryTimer to zero,
- releases all BGP resources,
- 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.
OpenConfirm State:
In this state, BGP waits for a KEEPALIVE or NOTIFICATION message.
Any start event (Events 1, 3-7) is ignored in the OpenConfirm
state.
In response to a ManualStop event (Event 2) initiated by the
operator, the local system:
- sends the NOTIFICATION message with a Cease,
- releases all BGP resources,
- drops the TCP connection,
- sets the ConnectRetryCounter to zero,
- sets the ConnectRetryTimer to zero, and
- changes its state to Idle.
In response to the AutomaticStop event initiated by the system
(Event 8), the local system:
- sends the NOTIFICATION message with a Cease,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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 HoldTimer_Expires event (Event 10) occurs before a
KEEPALIVE message is received, the local system:
- sends the NOTIFICATION message with the Error Code Hold Timer
Expired,
- sets the ConnectRetryTimer to zero,
- releases all BGP resources,
- 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 KeepaliveTimer_Expires event (Event
11), the local system:
- sends a KEEPALIVE message,
- restarts the KeepaliveTimer, and
- remains in the OpenConfirmed state.
In the event of a TcpConnection_Valid event (Event 14), or the
success of a TCP connection (Event 16 or Event 17) while in
OpenConfirm, the local system needs to track the second
connection.
If a TCP connection is attempted with an invalid port (Event 15),
the local system will ignore the second connection attempt.
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 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 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 (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: