draft-ietf-idr-bgp4-12.txt   draft-ietf-idr-bgp4-13.txt 
Network Working Group Y. Rekhter Network Working Group Y. Rekhter
INTERNET DRAFT Juniper Networks INTERNET DRAFT Juniper Networks
T. Li T. Li
Procket Networks, Inc. Procket Networks, Inc.
Editors Editors
A Border Gateway Protocol 4 (BGP-4) A Border Gateway Protocol 4 (BGP-4)
<draft-ietf-idr-bgp4-12.txt> <draft-ietf-idr-bgp4-13.txt>
Status of this Memo Status of this Memo
This document is an Internet-Draft and is in full conformance with This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC2026. all provisions of Section 10 of RFC2026.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet- other groups may also distribute working documents as Internet-
Drafts. Drafts.
skipping to change at page 2, line 7 skipping to change at page 2, line 7
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 of Jeffrey C. Honig for their contributions to the earlier version of
this document. this document.
We like to explicitly thank Bob Braden for the review of the earlier We like to explicitly thank Bob Braden for the review of the earlier
version of this document as well as his constructive and valuable version of this document as well as his constructive and valuable
comments. 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 previous 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 with a strong combination of toughness, professionalism, and
courtesy. courtesy.
This updated version of the document is the product of the IETF IDR This updated version of the document is the product of the IETF IDR
Working Group with Yakov Rekhter and Tony Li as editors. Certain Working Group with Yakov Rekhter and Tony Li as editors. Certain
sections of the document borrowed heavily from IDRP [7], which is the sections of the document borrowed heavily from IDRP [7], which is the
OSI counterpart of BGP. For this credit should be given to the ANSI OSI counterpart of BGP. For this credit should be given to the ANSI
X3S3.3 group chaired by Lyman Chapin and to Charles Kunzinger who was X3S3.3 group chaired by Lyman Chapin and to Charles Kunzinger who was
the IDRP editor within that group. We would also like to thank Mike the IDRP editor within that group. We would also like to thank Enke
Craren, Dimitry Haskin, John Krawczyk, David LeRoy, John Scudder, Chen, Edward Crabbe, Mike Craren, Vincent Gillet, Eric Gray, Jeffrey
John Stewart III, Dave Thaler, Paul Traina, and Curtis Villamizar for Haas, Dimitry Haskin, John Krawczyk, David LeRoy, John Scudder, John
their comments. Stewart III, Dave Thaler, Paul Traina, Curtis Villamizar, and Alex
Zinin for their comments.
We would like to specially acknowledge numerous contributions by We would like to specially acknowledge numerous contributions by
Dennis Ferguson. Dennis Ferguson.
2. Introduction 2. Introduction
The Border Gateway Protocol (BGP) is an inter-Autonomous System The Border Gateway Protocol (BGP) is an inter-Autonomous System
routing protocol. It is built on experience gained with EGP as routing protocol. It is built on experience gained with EGP as
defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as defined in RFC 904 [1] and EGP usage in the NSFNET Backbone as
described in RFC 1092 [2] and RFC 1093 [3]. described in RFC 1092 [2] and RFC 1093 [3].
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 (ASs) that reachability information traverses. Autonomous Systems (ASs) that reachability information traverses.
This information is sufficient to construct a graph of AS This information is sufficient to construct a graph of AS
connectivity from which routing loops may be pruned and some policy connectivity from which routing loops may be pruned and some policy
decisions at the AS level may be enforced. decisions at the AS level may be enforced.
BGP-4 provides a new set of mechanisms for supporting classless BGP-4 provides a new set of mechanisms for supporting Classless
interdomain routing. These mechanisms include support for Inter-Domain Routing (CIDR) [8, 9]. These mechanisms include support
advertising an IP prefix and eliminates the concept of network for advertising an IP prefix and eliminates the concept of network
"class" within BGP. BGP-4 also introduces mechanisms which allow "class" within BGP. BGP-4 also introduces mechanisms which allow
aggregation of routes, including aggregation of AS paths. These aggregation of routes, including aggregation of AS paths.
changes provide support for the proposed supernetting scheme [8, 9].
To characterize the set of policy decisions that can be enforced To characterize the set of policy decisions that can be enforced
using BGP, one must focus on the rule that a BGP speaker advertise to using BGP, one must focus on the rule that a BGP speaker advertises
its peers (other BGP speakers which it communicates with) in to its peers (other BGP speakers which it communicates with) in
neighboring ASs only those routes that it itself uses. This rule neighboring ASs only those routes that it itself uses. This rule
reflects the "hop-by-hop" routing paradigm generally used throughout reflects the "hop-by-hop" routing paradigm generally used throughout
the current Internet. Note that some policies cannot be supported by the current Internet. Note that some policies cannot be supported by
the "hop-by-hop" routing paradigm and thus require techniques such as the "hop-by-hop" routing paradigm and thus require techniques such as
source routing to enforce. For example, BGP does not enable one AS source routing (aka explicit routing) to enforce. For example, BGP
to send traffic to a neighboring AS intending that the traffic take a does not enable one AS to send traffic to a neighboring AS intending
different route from that taken by traffic originating in the that the traffic take a different route from that taken by traffic
neighboring AS. On the other hand, BGP can support any policy originating in the neighboring AS. On the other hand, BGP can support
conforming to the "hop-by-hop" routing paradigm. Since the current any policy conforming to the "hop-by-hop" routing paradigm. Since the
Internet uses only the "hop-by-hop" routing paradigm and since BGP current Internet uses only the "hop-by-hop" inter-AS routing paradigm
can support any policy that conforms to that paradigm, BGP is highly and since BGP can support any policy that conforms to that paradigm,
applicable as an inter-AS routing protocol for the current Internet. BGP is highly applicable as an inter-AS routing protocol for the
current Internet.
A more complete discussion of what policies can and cannot be A more complete discussion of what policies can and cannot be
enforced with BGP is outside the scope of this document (but refer to enforced with BGP is outside the scope of this document (but refer to
the companion document discussing BGP usage [5]). the companion document discussing BGP usage [5]).
BGP runs over a reliable transport protocol. This eliminates the BGP runs over a reliable transport protocol. This eliminates the need
need to implement explicit update fragmentation, retransmission, to implement explicit update fragmentation, retransmission,
acknowledgment, and sequencing. Any authentication scheme used by acknowledgment, and sequencing. Any authentication scheme used by the
the transport protocol may be used in addition to BGP's own transport protocol (e.g., RFC2385 [10]) may be used in addition to
authentication mechanisms. The error notification mechanism used in BGP's own authentication mechanisms. The error notification mechanism
BGP assumes that the transport protocol supports a "graceful" close, used in BGP assumes that the transport protocol supports a "graceful"
i.e., that all outstanding data will be delivered before the close, i.e., that all outstanding data will be delivered before the
connection is closed. connection is closed.
BGP uses TCP [4] as its transport protocol. TCP meets BGP's BGP uses TCP [4] as its transport protocol. TCP meets BGP's transport
transport requirements and is present in virtually all commercial requirements and is present in virtually all commercial routers and
routers and hosts. In the following descriptions the phrase hosts. In the following descriptions the phrase "transport protocol
"transport protocol connection" can be understood to refer to a TCP connection" can be understood to refer to a TCP connection. BGP uses
connection. BGP uses TCP port 179 for establishing its connections. TCP port 179 for establishing its connections.
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
and common metrics to route packets within the AS, and using an and common metrics to route packets within the AS, and using an
exterior gateway protocol to route packets to other ASs. Since this exterior gateway protocol to route packets to other ASs. Since this
classic definition was developed, it has become common for a single classic definition was developed, it has become common for a single
AS to use several interior gateway protocols and sometimes several AS to use several interior gateway protocols and sometimes several
sets of metrics within an AS. The use of the term Autonomous System sets of metrics within an AS. The use of the term Autonomous System
here stresses the fact that, even when multiple IGPs and metrics are here stresses the fact that, even when multiple IGPs and metrics are
used, the administration of an AS appears to other ASs to have a used, the administration of an AS appears to other ASs to have a
single coherent interior routing plan and presents a consistent single coherent interior routing plan and presents a consistent
picture of what destinations are reachable through it. picture of what destinations are reachable through it.
The planned use of BGP in the Internet environment, including such The planned use of BGP in the Internet environment, including such
issues as topology, the interaction between BGP and IGPs, and the issues as topology, the interaction between BGP and IGPs, and the
enforcement of routing policy rules is presented in a companion enforcement of routing policy rules is presented in a companion
document [5]. This document is the first of a series of documents document [5]. This document is the first of a series of documents
planned to explore various aspects of BGP application. Please send planned to explore various aspects of BGP application.
comments to the BGP mailing list (bgp@ans.net).
3. Summary of Operation 3. Summary of Operation
Two systems form a transport protocol connection between one another. Two systems form a transport protocol connection between one another.
They exchange messages to open and confirm the connection parameters. They exchange messages to open and confirm the connection parameters.
The initial data flow is the entire BGP routing table. Incremental The initial data flow is the entire BGP routing table. Incremental
updates are sent as the routing tables change. BGP does not require updates are sent as the routing tables change. BGP does not require
periodic refresh of the entire BGP routing table. Therefore, a BGP periodic refresh of the entire BGP routing table. Therefore, a BGP
speaker must retain the current version of the entire BGP routing speaker must retain the current version of the entire BGP routing
tables of all of its peers for the duration of the connection. tables of all of its peers for the duration of the connection. If
the implementation decides to not store the routes that have been
received from a peer, but have been filtered out according to
configured local policy, the BGP Route Refresh option [12] may be
used to request the full set of routes from a peer without resetting
the BGP session when the local policy configuration changes.
KEEPALIVE messages are sent periodically to ensure the liveness of KEEPALIVE messages are sent periodically to ensure the liveness of
the connection. NOTIFICATION messages are sent in response to errors the connection. NOTIFICATION messages are sent in response to errors
or special conditions. If a connection encounters an error or special conditions. If a connection encounters an error condition,
condition, a NOTIFICATION message is sent and the connection is a NOTIFICATION message is sent and the connection is closed.
closed.
The hosts executing the Border Gateway Protocol need not be routers. The hosts executing the Border Gateway Protocol need not be routers.
A non-routing host could exchange routing information with routers A non-routing host could exchange routing information with routers
via EGP or even an interior routing protocol. That non-routing host via EGP or even an interior routing protocol. That non-routing host
could then use BGP to exchange routing information with a border could then use BGP to exchange routing information with a border
router in another Autonomous System. The implications and router in another Autonomous System. The implications and
applications of this architecture are for further study. applications of this architecture are for further study.
Connections between BGP speakers of different ASs are referred to as Connections between BGP speakers of different ASs are referred to as
"external" links. BGP connections between BGP speakers within the "external" links. BGP connections between BGP speakers within the
skipping to change at page 5, line 11 skipping to change at page 5, line 17
have all been updated with transit information before the EBGP have all been updated with transit information before the EBGP
speakers announce to other ASs that transit service is being speakers announce to other ASs that transit service is being
provided. provided.
3.1 Routes: Advertisement and Storage 3.1 Routes: Advertisement and Storage
For purposes of this protocol a route is defined as a unit of For purposes of this protocol a route is defined as a unit of
information that pairs a destination with the attributes of a path to information that pairs a destination with the attributes of a path to
that destination: that destination:
- Routes are advertised between a pair of BGP speakers in UPDATE - Routes are advertised between BGP speakers in UPDATE messages.
messages: the destination is the systems whose IP addresses are The destination is the systems whose IP addresses are reported in
reported in the Network Layer Reachability Information (NLRI) the Network Layer Reachability Information (NLRI) field, and the
field, and the the path is the information reported in the path path is the information reported in the path attributes fields of
attributes fields of the same UPDATE message. the same UPDATE message.
- Routes are stored in the Routing Information Bases (RIBs): - Routes are stored in the Routing Information Bases (RIBs):
namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes namely, the Adj-RIBs-In, the Loc-RIB, and the Adj-RIBs-Out. Routes
that will be advertised to other BGP speakers must be present in that will be advertised to other BGP speakers must be present in
the Adj-RIB-Out; routes that will be used by the local BGP speaker the Adj-RIB-Out. Routes that will be used by the local BGP
must be present in the Loc-RIB, and the next hop for each of these speaker must be present in the Loc-RIB, and the next hop for each
routes must be present in the local BGP speaker's forwarding of these routes must be present in the local BGP speaker's Routing
information base; and routes that are received from other BGP Table. Routes that are received from other BGP speakers are
speakers are present in the Adj-RIBs-In. present in the Adj-RIBs-In.
If a BGP speaker chooses to advertise the route, it may add to or If a BGP speaker chooses to advertise the route, it may add to or
modify the path attributes of the route before advertising it to a modify the path attributes of the route before advertising it to a
peer. peer.
BGP provides mechanisms by which a BGP speaker can inform its peer BGP provides mechanisms by which a BGP speaker can inform its peer
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 destinations 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 field
in the UPDATE message, thus marking the associated route as being in the UPDATE message, thus marking the associated route as being
no longer available for use no longer available for use
b) a replacement route with the same Network Layer Reachability b) a replacement route with the same NLRI can be advertised, or
Information can be advertised, or
c) the BGP speaker - BGP speaker connection can be closed, which c) the BGP speaker - BGP speaker connection can be closed, which
implicitly removes from service all routes which the pair of implicitly removes from service all routes which the pair of
speakers had advertised to each other. speakers had advertised to each other.
3.2 Routing Information Bases 3.2 Routing Information Bases
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:
skipping to change at page 6, line 39 skipping to change at page 6, line 39
for advertisement to specific peers by means of the local speaker's for advertisement to specific peers by means of the local speaker's
UPDATE messages. UPDATE messages.
Although the conceptual model distinguishes between Adj-RIBs-In, Loc- Although the conceptual model distinguishes between Adj-RIBs-In, Loc-
RIB, and Adj-RIBs-Out, this neither implies nor requires that an 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 router uses to forward packets (or to
construct the forwarding table that is used for packet forwarding) is
maintained in the Routing Table. The Routing Table accumulates routes
to directly connected networks, static routes, routes learned from
the IGP protocols, and routes learned from BGP. Whether or not a
specific BGP route should be installed in the Routing Table, and
whether a BGP route should override a route to the same destination
installed by another source is a local policy decision, not specified
in this document. Besides actual packet forwarding, the Routing Table
is used for resolution of the next-hop addresses specified in BGP
updates (see Section 9.1.2).
4. Message Formats 4. Message Formats
This section describes message formats used by BGP. This section describes message formats used by BGP.
Messages are sent over a reliable transport protocol connection. A Messages are sent over a reliable transport protocol connection. A
message is processed only after it is entirely received. The maximum message is processed only after it is entirely received. The maximum
message size is 4096 octets. All implementations are required to message size is 4096 octets. All implementations are required to
support this maximum message size. The smallest message that may be support this maximum message size. The smallest message that may be
sent consists of a BGP header without a data portion, or 19 octets. sent consists of a BGP header without a data portion, or 19 octets.
skipping to change at page 7, line 41 skipping to change at page 8, line 6
Otherwise, the value of the marker can be predicted by some a Otherwise, the value of the marker can be predicted by some a
computation specified as part of the authentication mechanism computation specified as part of the authentication mechanism
(which is specified as part of the Authentication Information) (which is specified as part of the Authentication Information)
used. The Marker can be used to detect loss of synchronization used. The Marker can be used to detect loss of synchronization
between a pair of BGP peers, and to authenticate incoming BGP between a pair of BGP peers, and to authenticate incoming BGP
messages. messages.
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 message, including the header, in octets. Thus, e.g., it allows
allows one to locate in the transport-level stream the (Marker one to locate in the transport-level stream the (Marker field
field of the) next message. The value of the Length field must of the) next message. The value of the Length field must always
always be at least 19 and no greater than 4096, and may be be at least 19 and no greater than 4096, and may be further
further constrained, depending on the message type. No constrained, depending on the message type. No "padding" of
"padding" of extra data after the message is allowed, so the extra data after the message is allowed, so the Length field
Length field must have the smallest value required given the must have the smallest value required given the rest of the
rest of the message. 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. The following type codes are defined: message. The following type codes are defined:
1 - OPEN 1 - OPEN
2 - UPDATE 2 - UPDATE
3 - NOTIFICATION 3 - NOTIFICATION
4 - KEEPALIVE 4 - KEEPALIVE
skipping to change at page 11, line 22 skipping to change at page 11, line 19
Authentication Code field. Authentication Code field.
The minimum length of the OPEN message is 29 octets (including The minimum length of the OPEN message is 29 octets (including
message 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 packet can be used to construct peers. The information in the UPDATE packet can be used to construct
a graph describing the relationships of the various Autonomous a graph describing the relationships of the various Autonomous
Systems. By applying rules to be discussed, routing information Systems. By applying rules to be discussed, routing information loops
loops and some other anomalies may be detected and removed from and some other anomalies may be detected and removed from inter-AS
inter-AS routing. routing.
An UPDATE message is used to advertise a single feasible route to a An UPDATE message is used to advertise a single feasible route to a
peer, or to withdraw multiple unfeasible routes from service (see peer, or to withdraw multiple unfeasible routes from service (see
3.1). An UPDATE message may simultaneously advertise a feasible route 3.1). An UPDATE message may simultaneously advertise a feasible route
and withdraw multiple unfeasible routes from service. The UPDATE and withdraw multiple unfeasible routes from service. The UPDATE
message always includes the fixed-size BGP header, and can optionally message always includes the fixed-size BGP header, and can optionally
include the other fields as shown below: include the other fields as shown below:
+-----------------------------------------------------+ +-----------------------------------------------------+
| Unfeasible 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) |
+-----------------------------------------------------+ +-----------------------------------------------------+
Unfeasible 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 must allow the the Withdrawn Routes field in octets. Its value must allow 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.
skipping to change at page 13, line 27 skipping to change at page 13, line 24
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 is the Transitive bit. It defines whether an optional attribute
attribute is transitive (if set to 1) or non-transitive (if set is transitive (if set to 1) or non-transitive (if set to 0).
to 0). For well-known attributes, the Transitive bit must be For well-known attributes, the Transitive bit must be set to 1.
set to 1. (See Section 5 for a discussion of transitive (See Section 5 for a discussion of transitive attributes.)
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 is the Partial bit. It defines whether the information
contained in the optional transitive attribute is partial (if contained in the optional transitive attribute is partial (if
set to 1) or complete (if set to 0). For well-known attributes set to 1) or complete (if set to 0). For well-known attributes
and for optional non-transitive attributes the Partial bit must and for optional non-transitive attributes the Partial bit must
be set to 0. 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).
Extended Length may be used only if the length of the attribute
value is greater than 255 octets.
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 (and must be ignored when received). unused. They must be zero when sent and must be ignored when
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
skipping to change at page 14, line 34 skipping to change at page 14, line 28
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 0 IGP - Network Layer Reachability Information
is interior to the originating AS is interior to the originating AS
1 EGP - Network Layer Reachability Information 1 EGP - Network Layer Reachability Information
learned via EGP learned via the EGP protocol
2 INCOMPLETE - Network Layer Reachability 2 INCOMPLETE - Network Layer Reachability
Information learned by some other means Information learned by some other means
Its usage is defined in 5.1.1 Its usage 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
skipping to change at page 15, line 23 skipping to change at page 15, line 17
The path segment value field contains one or more AS The path segment value field contains one or more AS
numbers, each encoded as a 2-octets long field. numbers, each encoded as a 2-octets long 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 IP This is a well-known mandatory attribute that defines the IP
address of the border router that should be used as the next address of the border router that should be used as the next
hop to the destinations listed in the Network Layer hop to the destinations listed in the Network Layer
Reachability 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 four
octet non-negative integer. The value of this attribute may octet non-negative integer. The value of this attribute may
be used by a BGP speaker's decision process to discriminate be used by a BGP speaker's decision process to discriminate
among multiple exit points to a neighboring autonomous among multiple entry points to a neighboring autonomous
system. system.
Its usage is defined in 5.1.4. Its usage is defined in 5.1.4.
e) LOCAL_PREF (Type Code 5): e) LOCAL_PREF (Type Code 5):
LOCAL_PREF is a well-known mandatory attribute that is a LOCAL_PREF is a well-known mandatory attribute that is a
four octet non-negative integer. It is used by a BGP speaker four octet non-negative integer. A BGP speaker uses it to
to inform other internal peers of the advertising speaker's inform other internal peers of the advertising speaker's
degree of preference for an advertised route. Usage of this degree of preference for an advertised route. Usage of this
attribute is described in 5.1.5. attribute is described 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. It is used by a BGP speaker to inform other BGP length 0. A BGP speaker uses it to inform other BGP speakers
speakers that the local system selected a less specific that the local system selected a less specific route without
route without selecting a more specific route which is selecting a more specific route which is included in it.
included in it. Usage of this attribute is described in Usage of this attribute is described in 5.1.6.
5.1.6.
g) AGGREGATOR (Type Code 7) g) AGGREGATOR (Type Code 7)
AGGREGATOR is an optional transitive attribute of length 6. AGGREGATOR is an optional transitive attribute of length 6.
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). Usage of this attribute is described (encoded as 4 octets). This should be the same address as
in 5.1.7 the one used for the BGP Identifier of the speaker. Usage
of this attribute is described in 5.1.7.
Network Layer Reachability Information: Network Layer Reachability Information:
This variable length field contains a list of IP address This variable length field contains a list of IP address
prefixes. The length in octets of the Network Layer prefixes. The length in octets of the Network Layer
Reachability Information is not encoded explicitly, but can be Reachability Information is not encoded explicitly, but can be
calculated as: calculated as:
UPDATE message Length - 23 - Total Path Attributes Length - UPDATE message Length - 23 - Total Path Attributes Length -
Unfeasible 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 Unfeasible 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
Unfeasible Routes Length field. Withdrawn Routes Length field.
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) |
+---------------------------+ +---------------------------+
skipping to change at page 17, line 13 skipping to change at page 17, line 7
octets). octets).
b) Prefix: b) Prefix:
The Prefix field contains IP address prefixes followed by The Prefix field contains IP address prefixes 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 Unfeasible 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 Unfeasible 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 route, which may be An UPDATE message can advertise at most one set of path attributes,
described by several path attributes. All path attributes contained but multiple destinations, provided that the destinations share these
in a given UPDATE messages apply to the destinations carried in the attributes. All path attributes contained in a given UPDATE message
Network Layer Reachability Information field of the UPDATE message. apply to all destinations carried in the NLRI field of the UPDATE
message.
An UPDATE message can list multiple routes to be withdrawn from An UPDATE message can list multiple routes to be withdrawn from
service. Each such route is identified by its destination (expressed service. Each such route is identified by its destination (expressed
as an IP prefix), which unambiguously identifies the route in the as an IP prefix), which unambiguously identifies the route in the
context of the BGP speaker - BGP speaker connection to which it has context of the BGP speaker - BGP speaker connection to which it has
been previously been advertised. been previously advertised.
An UPDATE message may advertise only routes to be withdrawn from An UPDATE message may advertise only routes to be withdrawn from
service, in which case it will not include path attributes or Network service, in which case it will not include path attributes or Network
Layer Reachability Information. Conversely, it may advertise only a Layer Reachability Information. Conversely, it may advertise only a
feasible route, in which case the WITHDRAWN ROUTES field need not be feasible route, in which case the WITHDRAWN ROUTES field need not be
present. present.
4.4 KEEPALIVE Message Format 4.4 KEEPALIVE Message Format
BGP does not use any transport protocol-based keep-alive mechanism to BGP does not use any transport protocol-based keep-alive mechanism to
determine if peers are reachable. Instead, KEEPALIVE messages are determine if peers are reachable. Instead, KEEPALIVE messages are
exchanged between peers often enough as not to cause the Hold Timer exchanged between peers often enough as not to cause the Hold Timer
to expire. A reasonable maximum time between KEEPALIVE messages to expire. A reasonable maximum time between KEEPALIVE messages would
would be one third of the Hold Time interval. KEEPALIVE messages be one third of the Hold Time interval. KEEPALIVE messages MUST NOT
MUST NOT be sent more frequently than one per second. An be sent more frequently than one per second. An implementation MAY
implementation MAY adjust the rate at which it sends KEEPALIVE adjust the rate at which it sends KEEPALIVE messages as a function of
messages as a function of the Hold Time interval. the Hold 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.
KEEPALIVE message consists of only message header and has a length of KEEPALIVE message consists of only message header and has a length of
19 octets. 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.
skipping to change at page 18, line 44 skipping to change at page 18, line 44
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 This 1-octet unsigned integer provides more specific
information about the nature of the reported error. Each Error information about the nature of the reported error. Each Error
Code may have one or more Error Subcodes associated with it. Code may have one or more Error Subcodes associated with it. If
If no appropriate Error Subcode is defined, then a zero no appropriate Error Subcode is defined, then a zero
(Unspecific) value is used for the Error Subcode field. (Unspecific) value is used for the Error Subcode field.
Message Header Error subcodes: Message Header Error subcodes:
1 - Connection Not Synchronized. 1 - Connection Not Synchronized.
2 - Bad Message Length. 2 - Bad Message Length.
3 - Bad Message Type. 3 - Bad Message Type.
OPEN Message Error subcodes: OPEN Message Error subcodes:
skipping to change at page 20, line 25 skipping to change at page 20, line 25
Well-known attributes must be recognized by all BGP implementations. Well-known attributes must be recognized by all BGP implementations.
Some of these attributes are mandatory and must be included in every Some 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.
All well-known attributes must be passed along (after proper All well-known attributes must be passed along (after proper
updating, if necessary) to other BGP peers. updating, if necessary) to other BGP peers.
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 more optional attributes. It is not required or expected that all BGP
BGP implementations support all optional attributes. The handling of implementations support all optional attributes. The handling of an
an unrecognized optional attribute is determined by the setting of unrecognized optional attribute is determined by the setting of the
the Transitive bit in the attribute flags octet. Paths with Transitive bit in the attribute flags octet. Paths with unrecognized
unrecognized transitive optional attributes should be accepted. If a transitive optional attributes should be accepted. If a path with
path with unrecognized transitive optional attribute is accepted and unrecognized transitive optional attribute is accepted and passed
passed along to other BGP peers, then the unrecognized transitive along to other BGP peers, then the unrecognized transitive optional
optional attribute of that path must be passed along with the path to attribute of that path must be passed along with the path to other
other BGP peers with the Partial bit in the Attribute Flags octet set BGP peers with the Partial bit in the Attribute Flags octet set to 1.
to 1. If a path with recognized transitive optional attribute is If a path with recognized transitive optional attribute is accepted
accepted and passed along to other BGP peers and the Partial bit in and passed along to other BGP peers and the Partial bit in the
the Attribute Flags octet is set to 1 by some previous AS, it is not Attribute Flags octet is set to 1 by some previous AS, it is not set
set back to 0 by the current AS. Unrecognized non-transitive optional back to 0 by the current AS. Unrecognized non-transitive optional
attributes must be quietly ignored and not passed along to other BGP attributes must be quietly ignored and not passed along to other BGP
peers. peers.
New transitive optional attributes may be attached to the path by the New transitive optional attributes may be attached to the path by the
originator or by any other AS in the path. If they are not attached originator or by any other BGP speaker in the path. If they are not
by the originator, the Partial bit in the Attribute Flags octet is attached by the originator, the Partial bit in the Attribute Flags
set to 1. The rules for attaching new non-transitive optional octet is set to 1. The rules for attaching new non-transitive
attributes will depend on the nature of the specific attribute. The optional attributes will depend on the nature of the specific
documentation of each new non-transitive optional attribute will be attribute. The documentation of each new non-transitive optional
expected to include such rules. (The description of the attribute will be expected to include such rules. (The description of
MULTI_EXIT_DISC attribute gives an example.) All optional attributes the MULTI_EXIT_DISC attribute gives an example.) All optional
(both transitive and non-transitive) may be updated (if appropriate) attributes (both transitive and non-transitive) may be updated (if
by ASs 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 the UPDATE message in ascending order of attribute type. The receiver
receiver of an UPDATE message must be prepared to handle path of an UPDATE message must be prepared to handle path attributes
attributes within the UPDATE message that are out of order. within the UPDATE message that are out of order.
The same attribute cannot appear more than once within the Path The same attribute cannot appear more than once within the Path
Attributes field of a particular UPDATE message. Attributes field of a particular UPDATE message.
The mandatory category refers to an attribute which must be present The mandatory category refers to an attribute which must be present
in both IBGP and EBGP exchanges if NLRI are contained in the UPDATE in 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 protocol extension mechanism may be purely discretionary, or
discretionary, required, or disallowed in certain contexts. discretionary, required, or disallowed in certain contexts.
skipping to change at page 22, line 33 skipping to change at page 22, line 33
as the last element of the sequence (put it in the leftmost as the last element of the sequence (put it in the leftmost
position) position)
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 shall prepend a new path segment of type the local system shall prepend a new path segment of type
AS_SEQUENCE to the AS_PATH, including its own AS number in that AS_SEQUENCE to the AS_PATH, including its own AS number in that
segment. segment.
When a BGP speaker originates a route then: When a BGP speaker originates a route then:
a) the originating speaker shall include its own AS number in a) the originating speaker shall include its own AS number in the
the AS_PATH attribute of all UPDATE messages sent to an AS_PATH attribute of all UPDATE messages sent to an external peer.
external peer. (In this case, the AS number of the originating (In this case, the AS number of the originating speaker's
speaker's autonomous system will be the only entry in the autonomous system will be the only entry in the AS_PATH
AS_PATH attribute). attribute).
b) the originating speaker shall include an empty AS_PATH b) the originating speaker shall include an empty AS_PATH
attribute in all UPDATE messages sent to internal peers. (An attribute in all UPDATE messages sent to internal peers. (An
empty AS_PATH attribute is one whose length field contains the empty AS_PATH attribute is one whose length field contains the
value zero). value zero).
For the purpose of inter-AS traffic engineering, a BGP speaker may
include more than one instance of its own AS 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 path attribute defines the IP address of the border The NEXT_HOP path attribute defines the IP address of the border
router that should be used as the next hop to the destinations listed router that should be used as the next hop to the destinations listed
in the UPDATE message. When advertising a NEXT_HOP attribute to an in the UPDATE message. The NEXT_HOP attribute is calculated as
external peer, a router may use one of its own interface addresses in follows.
the NEXT_HOP attribute provided the external peer to which the route
is being advertised shares a common subnet with the NEXT_HOP address. 1) When sending a message to an internal peer, the BGP speaker
This is known as a "first party" NEXT_HOP attribute. A BGP speaker should not modify the NEXT_HOP attribute, unless it has been
can advertise to an external peer an interface of any internal peer explicitly configured to announce its own IP address as the
router in the NEXT_HOP attribute provided the external peer to which NEXT_HOP.
the route is being advertised shares a common subnet with the
NEXT_HOP address. This is known as a "third party" NEXT_HOP 2) When sending a message to an external peer X:
attribute. A BGP speaker can advertise any adjacent router in the
NEXT_HOP attribute provided that the IP address of this router was - If the route being announced was learned from an internal
learned from an external peer and the external peer to which the peer or is locally originated, the BGP speaker can use for the
route is being advertised shares a common subnet with the NEXT_HOP NEXT_HOP attribute an interface address of the internal peer
address. This is a second form of "third party" NEXT_HOP attribute. router through which the announced network is reachable for the
speaker, provided that peer X shares a common subnet with this
address. This is a form of "third party" NEXT_HOP attribute.
- If the route being announced was learned from an external
peer, the speaker can use in the NEXT_HOP attribute an IP
address of any adjacent router (known from the received
NEXT_HOP attribute) that the speaker itself uses for local
route calculation, provided that peer X shares a common subnet
with this address. This is a second form of "third party"
NEXT_HOP attribute.
- If the external peer to which the route is being advertised
shares a common subnet with one of the announcing router's own
interfaces, the router may use the IP address associated with
such an interface in the NEXT_HOP attribute. This is known as a
"first party" NEXT_HOP attribute.
- By default (if none of the above conditions apply), the BGP
speaker should use in the NEXT_HOP attribute the IP address
that is used to establish the BGP session.
Normally the NEXT_HOP attribute is chosen such that the shortest Normally the NEXT_HOP attribute is chosen such that the shortest
available path will be taken. A BGP speaker must be able to support available path will be taken. A BGP speaker must be able to support
disabling advertisement of third party NEXT_HOP attributes to handle disabling advertisement of third party NEXT_HOP attributes to handle
imperfectly bridged media. imperfectly bridged media.
A BGP speaker must never advertise an address of a peer to that peer A BGP speaker must never advertise an address of a peer to that peer
as a NEXT_HOP, for a route that the speaker is originating. A BGP as a NEXT_HOP, for a route that the speaker is originating. A BGP
speaker must never install a route with itself as the next hop. speaker must never install a route with itself as the next hop.
When a BGP speaker advertises the route to an internal peer, the The NEXT_HOP attribute is used by the BGP speaker to determine the
advertising speaker should not modify the NEXT_HOP attribute actual outbound interface and immediate next-hop address that should
associated with the route. When a BGP speaker receives the route via be used to forward transit packets to the associated destinations.
an internal link, it may forward packets to the NEXT_HOP address if The immediate next-hop address is determined by performing a
the address contained in the attribute is on a common subnet with the recursive route lookup operation for the IP address in the NEXT_HOP
local and remote BGP speakers. attribute using the contents of the Routing Table (see Section
9.1.2.2). The resolving route will always specify the outbound
interface. If the resolving route specifies the next-hop address,
this address should be used as the immediate address for packet
forwarding. If the address in the NEXT_HOP attribute is directly
resolved through a route to an attached subnet (such a route will not
specify the next-hop address), the outbound interface should be taken
from the resolving route and the address in the NEXT_HOP attribute
should be used as the immediate next-hop address.
5.1.4 MULTI_EXIT_DISC 5.1.4 MULTI_EXIT_DISC
The MULTI_EXIT_DISC attribute may be used on external (inter-AS) The MULTI_EXIT_DISC attribute may be used on external (inter-AS)
links to discriminate among multiple exit or entry points to the same links to discriminate among multiple exit or entry points to the same
neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four neighboring AS. The value of the MULTI_EXIT_DISC attribute is a four
octet unsigned number which is called a metric. All other factors octet unsigned number which is called a metric. All other factors
being equal, the exit or entry point with lower metric should be being equal, the exit point with lower metric should be preferred. If
preferred. If received over external links, the MULTI_EXIT_DISC received over external links, the MULTI_EXIT_DISC attribute MAY be
attribute MAY be propagated over internal links to other BGP speakers propagated over internal links to other BGP speakers within the same
within the same AS. The MULTI_EXIT_DISC attribute received from a AS. The MULTI_EXIT_DISC attribute received from a neighboring AS MUST
neighboring AS MUST NOT be propagated to other neighboring ASs. NOT be propagated to other neighboring ASs.
A BGP speaker MUST IMPLEMENT a mechanism based on local configuration A BGP speaker MUST IMPLEMENT a mechanism based on local configuration
which allows the MULTI_EXIT_DISC attribute to be removed from a which allows the MULTI_EXIT_DISC attribute to be removed from a
route. This MAY be done either prior to or after determining the route. This MAY be done prior to determining the degree of preference
degree of preference of the route and performing route selection of the route and performing route selection (decision process phases
(decision process phases 1 and 2). 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 an external value of the MULTI_EXIT_DISC attribute received over an external
link. If it does so, it shall do so prior to determining the degree link. If it does so, it shall do so prior to determining the degree
of preference of the route and performing route selection (decision of preference of the route and performing route selection (decision
process phases 1 and 2). process phases 1 and 2).
5.1.5 LOCAL_PREF 5.1.5 LOCAL_PREF
LOCAL_PREF is a well-known mandatory attribute that SHALL be included LOCAL_PREF is a well-known mandatory attribute that SHALL be included
in all UPDATE messages that a given BGP speaker sends to the other in all UPDATE messages that a given BGP speaker sends to the other
internal peers. A BGP speaker SHALL calculate the degree of internal peers. A BGP speaker SHALL calculate the degree of
preference for each external route and include the degree of preference for each external route based on the locally configured
preference when advertising a route to its internal peers. The higher policy, and include the degree of preference when advertising a route
degree of preference MUST be preferred. A BGP speaker shall use the to its internal peers. The higher degree of preference MUST be
degree of preference learned via LOCAL_PREF in its decision process preferred. A BGP speaker shall use the degree of preference learned
(see section 9.1.1). via LOCAL_PREF in 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 that
it sends to external peers. If it is contained in an UPDATE message it sends to external peers, except for the case of BGP Confederations
that is received from an external peer, then this attribute MUST be [13]. If it is contained in an UPDATE message that is received from
ignored by the receiving speaker. an external peer, then this attribute MUST be ignored by the
receiving speaker, except for the case of BGP Confederations [13].
5.1.6 ATOMIC_AGGREGATE 5.1.6 ATOMIC_AGGREGATE
ATOMIC_AGGREGATE is a well-known discretionary attribute. If a BGP ATOMIC_AGGREGATE is a well-known discretionary attribute. If a BGP
speaker, when presented with a set of overlapping routes from one of speaker, when presented with a set of overlapping routes from one of
its peers (see 9.1.4), selects the less specific route without its peers (see 9.1.4), selects the less specific route without
selecting the more specific one, then the local system MUST attach selecting the more specific one, then the local system MUST attach
the ATOMIC_AGGREGATE attribute to the route when propagating it to the ATOMIC_AGGREGATE attribute to the route when propagating it to
other BGP speakers (if that attribute is not already present in the other BGP speakers (if that attribute is not already present in the
received less specific route). A BGP speaker that receives a route received less specific route). A BGP speaker that receives a route
skipping to change at page 25, line 10 skipping to change at page 25, line 43
cognizant of the fact that the actual path to destinations, as cognizant of the fact that the actual path to destinations, as
specified in the NLRI of the route, while having the loop-free specified in the NLRI of the route, while having the loop-free
property, may traverse ASs that are not listed in the AS_PATH property, may traverse ASs that are not listed in the AS_PATH
attribute. attribute.
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.4.2). A in updates which are formed by aggregation (see Section 9.2.4.2). A
BGP speaker which performs route aggregation may add the AGGREGATOR BGP speaker which performs route aggregation may add the AGGREGATOR
attribute which shall contain its own AS number and IP address. 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.
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 When any of the conditions described here are detected, a
NOTIFICATION message with the indicated Error Code, Error Subcode, NOTIFICATION message with the indicated Error Code, Error Subcode,
and Data fields is sent, and the BGP connection is closed. If no and Data fields is sent, and the BGP connection is closed. If no
Error Subcode is specified, then a zero must be used. Error Subcode is specified, then a zero must be used.
The phrase "the BGP connection is closed" means that the transport The phrase "the BGP connection is closed" means that the transport
protocol connection has been closed and that all resources for that protocol connection has been closed, the associated Adj-RIB-In has
BGP connection have been deallocated. Routing table entries been cleared, and that all resources for that BGP connection have
associated with the remote peer are marked as invalid. The fact that been deallocated. Entries in the Loc-RIB associated with the remote
the routes have become invalid is passed to other BGP peers before peer are marked as invalid. The fact that the routes have become
the routes are deleted from the system. invalid is passed to other BGP peers before the routes are deleted
from the system.
Unless specified explicitly, the Data field of the NOTIFICATION Unless specified explicitly, the Data field of the NOTIFICATION
message 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 are indicated All errors detected while processing the Message Header are indicated
by sending the NOTIFICATION message with Error Code Message Header by sending the NOTIFICATION message with Error Code Message Header
Error. The Error Subcode elaborates on the specific nature of the Error. The Error Subcode elaborates on the specific nature of the
error. error.
skipping to change at page 26, line 6 skipping to change at page 26, line 44
ones if the message type is OPEN. The expected value of the Marker ones if the message type is OPEN. The expected value of the Marker
field for all other types of BGP messages determined based on the field for all other types of BGP messages determined based on the
presence of the Authentication Information Optional Parameter in the presence of the Authentication Information Optional Parameter in the
BGP OPEN message and the actual authentication mechanism (if the BGP OPEN message and the actual authentication mechanism (if the
Authentication Information in the BGP OPEN message is present). If Authentication Information in the BGP OPEN message is present). If
the Marker field of the message header is not the expected one, then the Marker field of the message header is not the expected one, then
a synchronization error has occurred and the Error Subcode is set to a synchronization error has occurred and the Error Subcode is set to
Connection Not Synchronized. Connection Not Synchronized.
If the Length field of the message header is less than 19 or greater If the Length field of the message header is less than 19 or greater
than 4096, or if the Length field of an OPEN message is less than than 4096, or if the Length field of an OPEN message is less than the
the minimum length of the OPEN message, or if the Length field of an minimum length of the OPEN message, or if the Length field of an
UPDATE message is less than the minimum length of the UPDATE message, UPDATE message is less than the minimum length of the UPDATE message,
or if the Length field of a KEEPALIVE message is not equal to 19, or or if the Length field of a KEEPALIVE message is not equal to 19, or
if the Length field of a NOTIFICATION message is less than the if the Length field of a NOTIFICATION message is less than the
minimum length of the NOTIFICATION message, then the Error Subcode is minimum length of the NOTIFICATION message, then the Error Subcode is
set to Bad Message Length. The Data field contains the erroneous set to Bad Message Length. The Data field contains the erroneous
Length field. 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 is set to Bad Message Type. The Data field contains Error Subcode is set to Bad Message Type. The Data field contains the
the erroneous Type field. erroneous Type field.
6.2 OPEN message error handling. 6.2 OPEN message error handling.
All errors detected while processing the OPEN message are indicated All errors detected while processing the OPEN message are indicated
by sending the NOTIFICATION message with Error Code OPEN Message by sending the NOTIFICATION message with Error Code OPEN Message
Error. The Error Subcode elaborates on the specific nature of the Error. The Error Subcode elaborates on the specific nature of the
error. error.
If the version number contained in the Version field of the received If the version number contained in the Version field of the received
OPEN message is not supported, then the Error Subcode is set to OPEN message is not supported, then the Error Subcode is set to
skipping to change at page 26, line 40 skipping to change at page 27, line 32
less than the version the remote BGP peer bid (as indicated in the less than the version the remote BGP peer bid (as indicated in the
received OPEN message). received OPEN message).
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 is set to Bad Peer AS. The determination of then the Error Subcode is set to Bad Peer AS. The determination of
acceptable Autonomous System numbers is outside the scope of this 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 Error Subcode MUST be set to Unacceptable Hold Time. An
implementation MUST reject Hold Time values of one or two seconds. implementation MUST reject Hold Time values of one or two seconds. An
An implementation MAY reject any proposed Hold Time. An implementation MAY reject any proposed Hold Time. An implementation
implementation which accepts a Hold Time MUST use the negotiated which accepts a Hold Time MUST use the negotiated value for the Hold
value for the Hold Time. 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 is set to Bad BGP Identifier. incorrect, then the Error Subcode is 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 IP host address. a valid IP host address.
If one of the Optional Parameters in the OPEN message is not If one of the Optional Parameters in the OPEN message is not
recognized, then the Error Subcode is set to Unsupported Optional recognized, then the Error Subcode is set to Unsupported Optional
Parameters. Parameters.
skipping to change at page 27, line 21 skipping to change at page 28, line 15
Authentication Failure. Authentication Failure.
6.3 UPDATE message error handling. 6.3 UPDATE message error handling.
All errors detected while processing the UPDATE message are indicated All errors detected while processing the UPDATE message are indicated
by sending the NOTIFICATION message with Error Code UPDATE Message by sending the NOTIFICATION message with Error Code UPDATE Message
Error. The error subcode elaborates on the specific nature of the Error. The error subcode elaborates on the specific nature of the
error. 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 Unfeasible Routes Length or Total Attribute attributes. If the Withdrawn Routes Length or Total Attribute Length
Length is too large (i.e., if Unfeasible Routes Length + Total is too large (i.e., if Withdrawn Routes Length + Total Attribute
Attribute Length + 23 exceeds the message Length), then the Error Length + 23 exceeds the message Length), then the Error Subcode is
Subcode is set to Malformed Attribute List. 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 is set to Attribute the Attribute Type Code, then the Error Subcode is set to Attribute
Flags Error. The Data field contains the erroneous attribute (type, Flags Error. The Data field contains the erroneous attribute (type,
length and value). length and value).
If any recognized attribute has Attribute Length that conflicts with If any recognized attribute has Attribute Length that conflicts with
the expected length (based on the attribute type code), then the the expected length (based on the attribute type code), then the
Error Subcode is set to Attribute Length Error. The Data field Error Subcode is set to Attribute Length Error. The Data field
contains the erroneous attribute (type, length and value). contains the erroneous attribute (type, length and value).
skipping to change at page 28, line 13 skipping to change at page 29, line 6
Subcode is set to Invalid Origin Attribute. The Data field contains Subcode is set to Invalid Origin Attribute. The Data field contains
the unrecognized attribute (type, length and value). 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 is set to Invalid NEXT_HOP Attribute. The Data field Error Subcode is set to Invalid NEXT_HOP Attribute. The Data field
contains the incorrect attribute (type, length and value). Syntactic contains the incorrect attribute (type, length and value). Syntactic
correctness means that the NEXT_HOP attribute represents a valid IP correctness means that the NEXT_HOP attribute represents a valid IP
host address. Semantic correctness applies only to the external BGP host address. Semantic correctness applies only to the external BGP
links. It means that the interface associated with the IP address, as links. It means that the interface associated with the IP address, as
specified in the NEXT_HOP attribute, shares a common subnet with the specified in the NEXT_HOP attribute, shares a common subnet with the
receiving BGP speaker and is not the IP address of the receiving BGP receiving BGP speaker (unless the speaker has been configured to run
speaker. If the NEXT_HOP attribute is semantically incorrect, the the external BGP session over multiple IP hops), and is not the IP
error should be logged, and the the route should be ignored. In this address of the receiving BGP speaker. If the NEXT_HOP attribute is
case, no NOTIFICATION message should be sent. semantically incorrect, the error should be logged, and the route
should be ignored. In this case, no NOTIFICATION message should be
sent.
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 is set to path is syntactically incorrect, then the Error Subcode is set to
Malformed AS_PATH. Malformed AS_PATH.
The information carried by the AS_PATH attribute is checked for AS The information carried by the AS_PATH attribute is checked for AS
loops. AS loop detection is done by scanning the full AS path (as loops. AS loop detection is done by scanning the full AS path (as
specified in the AS_PATH attribute), and checking that the autonomous specified in the AS_PATH attribute), and checking that the autonomous
system number of the local system does not appear in the AS path. If system number of the local system does not appear in the AS path. If
the autonomous system number appears in the AS path the route may be the autonomous system number appears in the AS path the route may be
skipping to change at page 28, line 45 skipping to change at page 29, line 40
discarded, and the Error Subcode is set to Optional Attribute Error. discarded, and the Error Subcode is set to Optional Attribute Error.
The Data field contains the attribute (type, length and value). The Data field contains the attribute (type, 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 is set to Malformed Attribute List. the Error Subcode is set to Malformed Attribute List.
The NLRI field in the UPDATE message is checked for syntactic The NLRI field in the UPDATE message is checked for syntactic
validity. If the field is syntactically incorrect, then the Error validity. If the field is syntactically incorrect, then the Error
Subcode is set to Invalid Network Field. Subcode is set to Invalid Network Field.
If a prefix in the NLRI field is semantically incorrect (e.g., an
unexpected multicast IP address), an error should be logged locally,
and the prefix should be ignored.
An UPDATE message that contains correct path attributes, but no NLRI, 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 there is an error in that If a peer sends a NOTIFICATION message, and there is an error in that
message, there is unfortunately no means of reporting this error via message, there is unfortunately no means of reporting this error via
a subsequent NOTIFICATION message. Any such error, such as an a subsequent NOTIFICATION message. Any such error, such as an
unrecognized Error Code or Error Subcode, should be noticed, logged unrecognized Error Code or Error Subcode, should be noticed, logged
locally, and brought to the attention of the administration of the locally, and brought to the attention of the administration of the
skipping to change at page 29, line 37 skipping to change at page 30, line 37
with Error Code Finite State Machine Error. with 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 absence of any fatal errors (that are indicated in this section),
a BGP peer may choose at any given time to close its BGP connection a BGP peer may choose at any given time to close its BGP connection
by sending the NOTIFICATION message with Error Code Cease. However, by sending the NOTIFICATION message with Error Code Cease. However,
the Cease NOTIFICATION message must not be used when a fatal error the Cease NOTIFICATION message must not be used when a fatal error
indicated by this section does exist. indicated by this section does exist.
A BGP speaker may support the ability to impose an (locally
configured) upper bound on the number of address prefixes the speaker
is willing to accept from a neighbor. When the upper bound is
reached, the speaker (under control of local configuration) may
either (a) stop accepting new address prefixes from the neighbor, or
(b) terminate the BGP peering with the neighbor. If the BGP speaker
decides to terminate its peering with a neighbor because the number
of address prefixes received from the neighbor exceeds the locally
configured upper bound, then the speaker must send to the neighbor a
NOTIFICATION message with the Error Code Cease.
6.8 Connection collision detection. 6.8 Connection collision detection.
If a pair of BGP speakers try simultaneously to establish a TCP If a pair of BGP speakers try simultaneously to establish a TCP
connection to each other, then two parallel connections between this connection to each other, then two parallel connections between this
pair of speakers might well be formed. We refer to this situation as pair of speakers might well be formed. We refer to this situation as
connection collision. Clearly, one of these connections must be connection collision. Clearly, one of these connections must be
closed. closed.
Based on the value of the BGP Identifier a convention is established Based on the value of the BGP Identifier a convention is established
for detecting which BGP connection is to be preserved when a for detecting which BGP connection is to be preserved when a
skipping to change at page 31, line 14 skipping to change at page 32, line 21
7. BGP Version Negotiation. 7. BGP Version Negotiation.
BGP speakers may negotiate the version of the protocol by making BGP speakers may negotiate the version of the protocol by making
multiple attempts to open a BGP connection, starting with the highest multiple attempts to open a BGP connection, starting with the highest
version number each supports. If an open attempt fails with an Error version number each supports. If an open attempt fails with an Error
Code OPEN Message Error, and an Error Subcode Unsupported Version Code OPEN Message Error, and an Error Subcode Unsupported Version
Number, then the BGP speaker has available the version number it Number, then the BGP speaker has available the version number it
tried, the version number its peer tried, the version number passed tried, the version number its peer tried, the version number passed
by its peer in the NOTIFICATION message, and the version numbers that by its peer in the NOTIFICATION message, and the version numbers that
it supports. If the two peers do support one or more common it supports. If the two peers do support one or more common versions,
versions, then this will allow them to rapidly determine the highest then this will allow them to rapidly determine the highest common
common version. In order to support BGP version negotiation, future version. In order to support BGP version negotiation, future versions
versions of BGP must retain the format of the OPEN and NOTIFICATION of BGP must retain the format of the OPEN and NOTIFICATION messages.
messages.
8. BGP Finite State machine. 8. BGP Finite State machine.
This section specifies BGP operation in terms of a Finite State This section specifies BGP operation in terms of a Finite State
Machine (FSM). Following is a brief summary and overview of BGP Machine (FSM). Following is a brief summary and overview of BGP
operations by state as determined by this FSM. A condensed version operations by state as determined by this FSM.
of the BGP FSM is found in Appendix 1.
Initially BGP is in the Idle state. Initially BGP is in the Idle state.
Idle state: Idle state:
In this state BGP refuses all incoming BGP connections. No In this state BGP refuses all incoming BGP connections. No
resources are allocated to the peer. In response to the Start resources are allocated to the peer. In response to the Start
event (initiated by either system or operator) the local system event (initiated by either system or operator) the local system
initializes all BGP resources, starts the ConnectRetry timer, initializes all BGP resources, starts the ConnectRetry timer,
initiates a transport connection to other BGP peer, while initiates a transport connection to other BGP peer, while
skipping to change at page 32, line 7 skipping to change at page 33, line 13
requires generation of the Start event. If such an event is requires generation of the Start event. If such an event is
generated automatically, then persistent BGP errors may result generated automatically, then persistent BGP errors may result
in persistent flapping of the speaker. To avoid such a in persistent flapping of the speaker. To avoid such a
condition it is recommended that Start events should not be condition it is recommended that Start events should not be
generated immediately for a peer that was previously generated immediately for a peer that was previously
transitioned to Idle due to an error. For a peer that was transitioned to Idle due to an error. For a peer that was
previously transitioned to Idle due to an error, the time previously transitioned to Idle due to an error, the time
between consecutive generation of Start events, if such events between consecutive generation of Start events, if such events
are generated automatically, shall exponentially increase. The are generated automatically, shall exponentially increase. The
value of the initial timer shall be 60 seconds. The time shall value of the initial timer shall be 60 seconds. The time shall
be doubled for each consecutive retry. be doubled for each consecutive retry. An implementation MAY
impose a configurable upper bound on that time. Once the upper
bound is reached, the speaker shall no longer automatically
generate the Start event for the peer.
Any other event received in the Idle state is ignored. Any other event received in the Idle state is ignored.
Connect state: Connect state:
In this state BGP is waiting for the transport protocol In this state BGP is waiting for the transport protocol
connection to be completed. connection to be completed.
If the transport protocol connection succeeds, the local system If the transport protocol connection succeeds, the local system
clears the ConnectRetry timer, completes initialization, sends clears the ConnectRetry timer, completes initialization, sends
skipping to change at page 32, line 31 skipping to change at page 33, line 40
timeout), the local system restarts the ConnectRetry timer, timeout), the local system restarts the ConnectRetry timer,
continues to listen for a connection that may be initiated by continues to listen for a connection that may be initiated by
the remote BGP peer, and changes its state to Active state. the remote BGP peer, and changes its state to Active state.
In response to the ConnectRetry timer expired event, the local In response to the ConnectRetry timer expired event, the local
system restarts the ConnectRetry timer, initiates a transport system restarts the ConnectRetry timer, initiates a transport
connection to other BGP peer, continues to listen for a connection to other BGP peer, continues to listen for a
connection that may be initiated by the remote BGP peer, and connection that may be initiated by the remote BGP peer, and
stays in the Connect state. stays in the Connect state.
Start event is ignored in the Connect state. The Start event is ignored in the Connect state.
In response to any other event (initiated by either system or In response to any other event (initiated by either system or
operator), the local system releases all BGP resources operator), the local system releases all BGP resources
associated with this connection and changes its state to Idle. associated with this connection and changes its state to Idle.
Active state: Active state:
In this state BGP is trying to acquire a peer by listening for In this state BGP is trying to acquire a peer by listening for
and accepting a transport protocol connection. and accepting a transport protocol connection.
If the transport protocol connection succeeds, the local system If the transport protocol connection succeeds, the local system
clears the ConnectRetry timer, completes initialization, sends clears the ConnectRetry timer, completes initialization, sends
an OPEN message to its peer, sets its Hold Timer to a large an OPEN message to its peer, sets its Hold Timer to a large
value, and changes its state to OpenSent. A Hold Timer value value, and changes its state to OpenSent. A Hold Timer value of
of 4 minutes is suggested. 4 minutes is suggested.
In response to the ConnectRetry timer expired event, the local In response to the ConnectRetry timer expired event, the local
system restarts the ConnectRetry timer, initiates a transport system restarts the ConnectRetry timer, initiates a transport
connection to other BGP peer, continues to listen for a connection to the other BGP peer, continues to listen for a
connection that may be initiated by the remote BGP peer, and connection that may be initiated by the remote BGP peer, and
changes its state to Connect. changes its state to Connect.
If the local system allows BGP connections with unconfigured If the local system allows BGP connections with unconfigured
peers, then when the local system detects that a remote peer is peers, then when the local system detects that a remote peer is
trying to establish a BGP connection to it, and the IP address trying to establish a BGP connection to it, and the IP address
of the remote peer is not a configured one, the local system of the remote peer is not a configured one, the local system
creates a temporary peer entry, completes initialization, sends creates a temporary peer entry, completes initialization, sends
an OPEN message to its peer, sets its Hold Timer to a large an OPEN message to its peer, sets its Hold Timer to a large
value, and changes its state to OpenSent. value, and changes its state to OpenSent.
If the local system does not allow BGP connections with If the local system does not allow BGP connections with
unconfigured peers, then the local system rejects connections unconfigured peers, then the local system rejects connections
from IP addresses that are not configured peers, and remains in from IP addresses that are not configured peers, and remains in
the Active state. the Active state.
Start event is ignored in the Active state. The Start event is ignored in the Active state.
In response to any other event (initiated by either system or In response to any other event (initiated by either system or
operator), the local system releases all BGP resources operator), the local system releases all BGP resources
associated with this connection and changes its state to Idle. associated with this connection and changes its state to Idle.
OpenSent state: OpenSent state:
In this state BGP waits for an OPEN message from its peer. In this state BGP waits for an OPEN message from its peer.
When an OPEN message is received, all fields are checked for When an OPEN message is received, all fields are checked for
correctness. If the BGP message header checking or OPEN correctness. If the BGP message header checking or OPEN message
message checking detects an error (see Section 6.2), or a checking detects an error (see Section 6.2), or a connection
connection collision (see Section 6.8) the local system sends a collision (see Section 6.8) the local system sends a
NOTIFICATION message and changes its state to Idle. NOTIFICATION message and changes its state to Idle.
If there are no errors in the OPEN message, BGP sends a If there are no errors in the OPEN message, BGP sends a
KEEPALIVE message and sets a KeepAlive timer. The Hold Timer, KEEPALIVE message and sets a KeepAlive timer. The Hold Timer,
which was originally set to a large value (see above), is which was originally set to a large value (see above), is
replaced with the negotiated Hold Time value (see section 4.2). replaced with the negotiated Hold Time value (see section 4.2).
If the negotiated Hold Time value is zero, then the Hold Time If the negotiated Hold Time value is zero, then the Hold Time
timer and KeepAlive timers are not started. If the value of timer and KeepAlive timers are not started. If the value of the
the Autonomous System field is the same as the local Autonomous Autonomous System field is the same as the local Autonomous
System number, then the connection is an "internal" connection; System number, then the connection is an "internal" connection;
otherwise, it is "external". (This will effect UPDATE otherwise, it is "external". (This will affect UPDATE
processing as described below.) Finally, the state is changed processing as described below.) Finally, the state is changed
to OpenConfirm. to OpenConfirm.
If a disconnect notification is received from the underlying If a disconnect notification is received from the underlying
transport protocol, the local system closes the BGP connection, transport protocol, the local system closes the BGP connection,
restarts the ConnectRetry timer, while continue listening for restarts the ConnectRetry timer, while continue listening for
connection that may be initiated by the remote BGP peer, and connection that may be initiated by the remote BGP peer, and
goes into the Active state. goes into the Active state.
If the Hold Timer expires, the local system sends NOTIFICATION If the Hold Timer expires, the local system sends NOTIFICATION
message with error code Hold Timer Expired and changes its message with error code Hold Timer Expired and changes its
state to Idle. state to Idle.
In response to the Stop event (initiated by either system or In response to the Stop event (initiated by either system or
operator) the local system sends NOTIFICATION message with operator) the local system sends NOTIFICATION message with
Error Code Cease and changes its state to Idle. Error Code Cease and changes its state to Idle.
Start event is ignored in the OpenSent state. The Start event is ignored in the OpenSent state.
In response to any other event the local system sends In response to any other event the local system sends
NOTIFICATION message with Error Code Finite State Machine Error NOTIFICATION message with Error Code Finite State Machine Error
and changes its state to Idle. and changes its state to Idle.
Whenever BGP changes its state from OpenSent to Idle, it closes Whenever BGP changes its state from OpenSent to Idle, it closes
the BGP (and transport-level) connection and releases all the BGP (and transport-level) connection and releases all
resources associated with that connection. resources associated with that connection.
OpenConfirm state: OpenConfirm state:
skipping to change at page 34, line 48 skipping to change at page 36, line 9
If the KeepAlive timer expires, the local system sends a If the KeepAlive timer expires, the local system sends a
KEEPALIVE message and restarts its KeepAlive timer. KEEPALIVE message and restarts its KeepAlive timer.
If a disconnect notification is received from the underlying If a disconnect notification is received from the underlying
transport protocol, the local system changes its state to Idle. transport protocol, the local system changes its state to Idle.
In response to the Stop event (initiated by either system or In response to the Stop event (initiated by either system or
operator) the local system sends NOTIFICATION message with operator) the local system sends NOTIFICATION message with
Error Code Cease and changes its state to Idle. Error Code Cease and changes its state to Idle.
Start event is ignored in the OpenConfirm state. The Start event is ignored in the OpenConfirm state.
In response to any other event the local system sends In response to any other event the local system sends
NOTIFICATION message with Error Code Finite State Machine Error NOTIFICATION message with Error Code Finite State Machine Error
and changes its state to Idle. and changes its state to Idle.
Whenever BGP changes its state from OpenConfirm to Idle, it Whenever BGP changes its state from OpenConfirm to Idle, it
closes the BGP (and transport-level) connection and releases closes the BGP (and transport-level) connection and releases
all resources associated with that connection. all resources associated with that connection.
Established state: Established state:
skipping to change at page 35, line 44 skipping to change at page 37, line 5
KEEPALIVE message and restarts its KeepAlive timer. KEEPALIVE message and restarts its KeepAlive timer.
Each time the local system sends a KEEPALIVE or UPDATE message, Each time the local system sends a KEEPALIVE or UPDATE message,
it restarts its KeepAlive timer, unless the negotiated Hold it restarts its KeepAlive timer, unless the negotiated Hold
Time value is zero. Time value is zero.
In response to the Stop event (initiated by either system or In response to the Stop event (initiated by either system or
operator), the local system sends a NOTIFICATION message with operator), the local system sends a NOTIFICATION message with
Error Code Cease and changes its state to Idle. Error Code Cease and changes its state to Idle.
Start event is ignored in the Established state. The Start event is ignored in the Established state.
In response to any other event, the local system sends In response to any other event, the local system sends
NOTIFICATION message with Error Code Finite State Machine Error NOTIFICATION message with Error Code Finite State Machine Error
and changes its state to Idle. and changes its state to Idle.
Whenever BGP changes its state from Established to Idle, it Whenever BGP changes its state from Established to Idle, it
closes the BGP (and transport-level) connection, releases all closes the BGP (and transport-level) connection, releases all
resources associated with that connection, and deletes all resources associated with that connection, and deletes all
routes derived from that connection. routes derived from that connection.
9. UPDATE Message Handling 9. UPDATE Message Handling
An UPDATE message may be received only in the Established state. An UPDATE message may be received only in the Established state.
When an UPDATE message is received, each field is checked for When an UPDATE message is received, each field is checked for
validity as specified in Section 6.3. validity as specified in Section 6.3.
If an optional non-transitive attribute is unrecognized, it is If an optional non-transitive attribute is unrecognized, it is
quietly ignored. If an optional transitive attribute is quietly ignored. If an optional transitive attribute is unrecognized,
unrecognized, the Partial bit (the third high-order bit) in the the Partial bit (the third high-order bit) in the attribute flags
attribute flags octet is set to 1, and the attribute is retained for octet is set to 1, and the attribute is retained for propagation to
propagation to other BGP speakers. other BGP speakers.
If an optional attribute is recognized, and has a valid value, then, If an optional attribute is recognized, and has a valid value, then,
depending on the type of the optional attribute, it is processed depending on the type of the optional attribute, it is processed
locally, retained, and updated, if necessary, for possible locally, retained, and updated, if necessary, for possible
propagation to other BGP speakers. propagation to other BGP speakers.
If the UPDATE message contains a non-empty WITHDRAWN ROUTES field, If the UPDATE message contains a non-empty WITHDRAWN ROUTES field,
the previously advertised routes whose destinations (expressed as IP the previously advertised routes whose destinations (expressed as IP
prefixes) contained in this field shall be removed from the Adj-RIB- prefixes) contained in this field shall be removed from the Adj-RIB-
In. This BGP speaker shall run its Decision Process since the In. This BGP speaker shall run its Decision Process since the
previously advertised route is not longer available for use. previously advertised route is no longer available for use.
If the UPDATE message contains a feasible route, it shall be placed If the UPDATE message contains a feasible route, it shall be placed
in the appropriate Adj-RIB-In, and the following additional actions in the appropriate Adj-RIB-In, and the following additional actions
shall be taken: shall be taken:
i) If its Network Layer Reachability Information (NLRI) is identical i) If its Network Layer Reachability Information (NLRI) is identical
to the one of a route currently stored in the Adj-RIB-In, then the to the one of a route currently stored in the Adj-RIB-In, then the
new route shall replace the older route in the Adj-RIB-In, thus new route shall replace the older route in the Adj-RIB-In, thus
implicitly withdrawing the older route from service. The BGP speaker implicitly withdrawing the older route from service. The BGP speaker
shall run its Decision Process since the older route is no longer shall run its Decision Process since the older route is no longer
skipping to change at page 37, line 19 skipping to change at page 38, line 27
v) If the new route is an overlapping route that is less specific v) If the new route is an overlapping route that is less specific
(see 9.1.4) than an earlier route contained in the Adj-RIB-In, the (see 9.1.4) than an earlier route contained in the Adj-RIB-In, the
BGP speaker shall run its Decision Process on the set of destinations BGP speaker shall run its Decision Process on the set of destinations
described only by the less specific route. described only by the less specific route.
9.1 Decision Process 9.1 Decision Process
The Decision Process selects routes for subsequent advertisement by The Decision Process selects routes for subsequent advertisement by
applying the policies in the local Policy Information Base (PIB) to applying the policies in the local Policy Information Base (PIB) to
the routes stored in its Adj-RIB-In. The output of the Decision the routes stored in its Adj-RIBs-In. The output of the Decision
Process is the set of routes that will be advertised to all peers; Process is the set of routes that will be advertised to all peers;
the selected routes will be stored in the local speaker's Adj-RIB- the selected routes will be stored in the local speaker's Adj-RIB-
Out. Out.
The selection process is formalized by defining a function that takes The selection process is formalized by defining a function that takes
the attribute of a given route as an argument and returns a non- the attribute of a given route as an argument and returns a non-
negative integer denoting the degree of preference for the route. negative integer denoting the degree of preference for the route.
The function that calculates the degree of preference for a given The function that calculates the degree of preference for a given
route shall not use as its inputs any of the following: the existence route shall not use as its inputs any of the following: the existence
of other routes, the non-existence of other routes, or the path of other routes, the non-existence of other routes, or the path
attributes of other routes. Route selection then consists of attributes of other routes. Route selection then consists of
individual application of the degree of preference function to each individual application of the degree of preference function to each
feasible route, followed by the choice of the one with the highest feasible route, followed by the choice of the one with the highest
degree of preference. degree of preference.
The Decision Process operates on routes contained in each Adj-RIB-In, The Decision Process operates on routes contained in each Adj-RIB-In,
and is responsible for: and is responsible for:
- selection of routes to be advertised to internal peers - selection of routes to be used locally by the speaker
- selection of routes to be advertised to internal peers
- selection of routes to be advertised to external peers - selection of routes to be advertised to external peers
- route aggregation and route information reduction - route aggregation and route information reduction
The Decision Process takes place in three distinct phases, each The Decision Process takes place in three distinct phases, each
triggered by a different event: triggered by a different event:
a) Phase 1 is responsible for calculating the degree of preference a) Phase 1 is responsible for calculating the degree of preference
for each route received from an external peer, and MAY also for each route received from an external peer, and MAY also
advertise to all the internal peers the routes from external advertise to all the internal peers the routes from external peers
peers that have the highest degree of preference for each distinct that have the highest degree of preference for each distinct
destination. destination.
b) Phase 2 is invoked on completion of phase 1. It is responsible b) Phase 2 is invoked on completion of phase 1. It is responsible
for choosing the best route out of all those available for each for choosing the best route out of all those available for each
distinct destination, and for installing each chosen route into distinct destination, and for installing each chosen route into
the appropriate Loc-RIB. the appropriate Loc-RIB.
c) Phase 3 is invoked after the Loc-RIB has been modified. It is c) Phase 3 is invoked after the Loc-RIB has been modified. It is
responsible for disseminating routes in the Loc-RIB to each responsible for disseminating routes in the Loc-RIB to each
external peer, according to the policies contained in the PIB. external peer, according to the policies contained in the PIB.
skipping to change at page 39, line 11 skipping to change at page 40, line 20
1. The Phase 2 function is a separate process which completes when 1. The Phase 2 function is a separate process which completes when
it has no further work to do. The Phase 2 process shall consider all it has no further work to do. The Phase 2 process shall consider all
routes that are present in the Adj-RIBs-In, including those received routes that are present in the Adj-RIBs-In, including those received
from both internal and external peers. from both internal and external peers.
The Phase 2 decision function shall be blocked from running while the The Phase 2 decision function shall be blocked from running while the
Phase 3 decision function is in process. The Phase 2 function shall Phase 3 decision function is in process. The Phase 2 function shall
lock all Adj-RIBs-In prior to commencing its function, and shall lock all Adj-RIBs-In prior to commencing its function, and shall
unlock them on completion. unlock them on completion.
If the NEXT_HOP attribute of a BGP route depicts an address to which If the NEXT_HOP attribute of a BGP route depicts an address that is
the local BGP speaker doesn't have a route in its Loc-RIB, the BGP not resolvable, or it would become unresolvable if the route was
route should be excluded from the Phase 2 decision function. installed in the routing table the BGP route should be excluded from
the Phase 2 decision function.
It is critical that routers within an AS do not make conflicting It is critical that routers within an AS do not make conflicting
decisions regarding route selection that would cause forwarding loops decisions regarding route selection that would cause forwarding loops
to occur. to occur.
For each set of destinations for which a feasible route exists in the For each set of destinations for which a feasible route exists in the
Adj-RIBs-In, the local BGP speaker shall identify the route that has: Adj-RIBs-In, the local BGP speaker shall identify the route that has:
a) the highest degree of preference of any route to the same set a) the highest degree of preference of any route to the same set
of destinations, or of destinations, or
b) is the only route to that destination, or b) is the only route to that destination, or
c) is selected as a result of the Phase 2 tie breaking rules c) is selected as a result of the Phase 2 tie breaking rules
specified in 9.1.2.1. specified in 9.1.2.2.
The local speaker SHALL then install that route in the Loc-RIB, The local speaker SHALL then install that route in the Loc-RIB,
replacing any route to the same destination that is currently being replacing any route to the same destination that is currently being
held in the Loc-RIB. The local speaker MUST determine the immediate held in the Loc-RIB. If the new BGP route is installed in the Routing
next hop to the address depicted by the NEXT_HOP attribute of the Table (as a result of the local policy decision), care must be taken
selected route by performing a lookup in the IGP and selecting one of to ensure that invalid BGP routes to the same destination are removed
the possible paths in the IGP. This immediate next hop MUST be used from the Routing Table. Whether or not the new route replaces an
when installing the selected route in the Loc-RIB. If the route to already existing non-BGP route in the routing table depends on the
the address depicted by the NEXT_HOP attribute changes such that the policy configured on the BGP speaker.
immediate next hop changes, route selection should be recalculated as
The local speaker MUST determine the immediate next hop to the
address depicted by the NEXT_HOP attribute of the selected route by
performing a best matching route lookup in the Routing Table and
selecting one of the possible paths (if multiple best paths to the
same prefix are available). If the route to the address depicted by
the NEXT_HOP attribute changes such that the immediate next hop or
the IGP cost to the NEXT_HOP (if the NEXT_HOP is resolved through an
IGP route) changes, route selection should be recalculated as
specified above. specified above.
Unfeasible routes shall be removed from the Loc-RIB, and Notice that even though BGP routes do not have to be installed in the
corresponding unfeasible routes shall then be removed from the Adj- Routing Table with the immediate next hop(s), implementations must
RIBs-In. take care that before any packets are forwarded along a BGP route,
it's associated NEXT_HOP address is resolved to the immediate
(directly connected) next-hop address and this address (or multiple
addresses) is finally used for actual packet forwarding.
9.1.2.1 Breaking Ties (Phase 2) Unfeasible routes SHALL be removed from the Loc-RIB and the routing
table. However, corresponding unfeasible routes SHOULD be kept in the
Adj-RIBs-In.
9.1.2.1 Route Resolvability Condition
As indicated in Section 9.1.2, BGP routers should exclude
unresolvable routes from the Phase 2 decision. This ensures that only
valid routes are installed in Loc-RIB and the Routing Table.
The route resolvability condition is defined as follows.
1. A route Rte1, referencing only the intermediate network
address, is considered resolvable if the Routing Table contains at
least one resolvable route Rte2 that matches Rte1's intermediate
network address and is not recursively resolved (directly or
indirectly) through Rte1. If multiple matching routes are
available, only the longest matching route should be considered.
2. Routes referencing interfaces (with or without intermediate
addresses) are considered resolvable if the state of the
referenced interface is up and IP processing is enabled on this
interface.
BGP routes do not refer to interfaces, but can be resolved through
the routes in the Routing Table that can be of both types. IGP routes
and routes to directly connected networks are expected to specify the
outbound interface.
Note that a BGP route is considered unresolvable not only in
situations where the router's Routing Table contains no route
matching the BGP route's NEXT_HOP. Mutually recursive routes (routes
resolving each other or themselves), also fail the resolvability
check.
It is also important that implementations do not consider feasible
routes that would become unresolvable if they were installed in the
Routing Table even if their NEXT_HOPs are resolvable using the
current contents of the Routing Table. This check ensures that a BGP
speaker does not install in the Routing Table routes that will be
removed and not used by the speaker. Therefore, in addition to local
Routing Table stability, this check also improves behavior of the
protocol in the network.
Whenever a BGP speaker identifies a route that fails the
resolvability check because of mutual recursion, an error message
should be logged.
9.1.2.2 Breaking Ties (Phase 2)
In its Adj-RIBs-In a BGP speaker may have several routes to the same In its Adj-RIBs-In a BGP speaker may have several routes to the same
destination that have the same degree of preference. The local destination that have the same degree of preference. The local
speaker can select only one of these routes for inclusion in the speaker can select only one of these routes for inclusion in the
associated Loc-RIB. The local speaker considers all routes with the associated Loc-RIB. The local speaker considers all routes with the
same degrees of preference, both those received from internal peers, same degrees of preference, both those received from internal peers,
and those received from external peers. and those received from external peers.
The following tie-breaking procedure assumes that for each candidate The following tie-breaking procedure assumes that for each candidate
route all the BGP speakers within an autonomous system can ascertain route all the BGP speakers within an autonomous system can ascertain
the cost of a path (interior distance) to the address depicted by the the cost of a path (interior distance) to the address depicted by the
NEXT_HOP attribute of the route. NEXT_HOP attribute of the route, and follow the same route selection
algorithm.
The tie-breaking algorithm begins by considering all equally The tie-breaking algorithm begins by considering all equally
preferable routes and then selects routes to be removed from preferable routes to the same destination, and then selects routes to
consideration. The algorithm terminates as soon as only one route be removed from consideration. The algorithm terminates as soon as
remains in consideration. The criteria must be applied in the order only one route remains in consideration. The criteria must be
specified. applied in the order specified.
Several of the criteria are described using pseudo-code. Note that Several of the criteria are described using pseudo-code. Note that
the pseudo-code shown was chosen for clarity, not efficiency. It is the pseudo-code shown was chosen for clarity, not efficiency. It is
not intended to specify any particular implementation. BGP not intended to specify any particular implementation. BGP
implementations MAY use any algorithm which produces the same results implementations MAY use any algorithm which produces the same results
as those described here. as those described here.
a) Remove from consideration routes with less-preferred a) Remove from consideration routes with less-preferred
MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable MULTI_EXIT_DISC attributes. MULTI_EXIT_DISC is only comparable
between routes learned from the same neighboring AS. Routes which between routes learned from the same neighboring AS. Routes which
skipping to change at page 40, line 50 skipping to change at page 43, line 29
value of route n's MULTI_EXIT_DISC attribute. If route n has no value of route n's MULTI_EXIT_DISC attribute. If route n has no
MULTI_EXIT_DISC attribute, the function returns the highest MULTI_EXIT_DISC attribute, the function returns the highest
possible MULTI_EXIT_DISC value, i.e. 2^32-1. possible MULTI_EXIT_DISC value, i.e. 2^32-1.
Similarly, neighborAS(n) is a function which returns the neighbor Similarly, neighborAS(n) is a function which returns the neighbor
AS from which the route was received. AS from which the route was received.
b) Remove from consideration any routes with less-preferred b) Remove from consideration any routes with less-preferred
interior cost. The interior cost of a route is determined by interior cost. The interior cost of a route is determined by
calculating the metric to the next hop for the route using the calculating the metric to the next hop for the route using the
interior routing protocol(s). If the next hop for a route is Routing Table. If the next hop for a route is reachable, but no
reachable, but no cost can be determined, then this step should be cost can be determined, then this step should be skipped
should be skipped (equivalently, consider all routes to have equal (equivalently, consider all routes to have equal costs).
costs).
This is also described in the following procedure. This is also described in the following procedure.
for m = all routes still under consideration for m = all routes still under consideration
for n = all routes in still under consideration for n = all routes in still under consideration
if (cost(n) is better than cost(m)) if (cost(n) is better than cost(m))
remove m from consideration remove m from consideration
In the pseudo-code above, cost(n) is a function which returns the In the pseudo-code above, cost(n) is a function which returns the
cost of the path (interior distance) to the address given in the cost of the path (interior distance) to the address given in the
skipping to change at page 41, line 31 skipping to change at page 44, line 10
d) Remove from consideration all routes other than the route that d) Remove from consideration all routes other than the route that
was advertised by the BGP speaker whose BGP Identifier has the was advertised by the BGP speaker whose BGP Identifier has the
lowest value. lowest value.
9.1.3 Phase 3: Route Dissemination 9.1.3 Phase 3: Route Dissemination
The Phase 3 decision function shall be invoked on completion of Phase The Phase 3 decision function shall be invoked on completion of Phase
2, or when any of the following events occur: 2, or when any of the following events occur:
a) when routes in a Loc-RIB to local destinations have changed a) when routes in the Loc-RIB to local destinations have changed
b) when locally generated routes learned by means outside of BGP b) when locally generated routes learned by means outside of BGP
have changed have changed
c) when a new BGP speaker - BGP speaker connection has been c) when a new BGP speaker - BGP speaker connection has been
established established
The Phase 3 function is a separate process which completes when it The Phase 3 function is a separate process which completes when it
has no further work to do. The Phase 3 Routing Decision function has no further work to do. The Phase 3 Routing Decision function
shall be blocked from running while the Phase 2 decision function is shall be blocked from running while the Phase 2 decision function is
in process. in process.
All routes in the Loc-RIB shall be processed into a corresponding All routes in the Loc-RIB shall be processed into a corresponding
entry in the associated Adj-RIBs-Out. Route aggregation and entry in the associated Adj-RIBs-Out. Route aggregation and
information reduction techniques (see 9.2.4.1) may optionally be information reduction techniques (see 9.2.4.1) may optionally be
applied. applied.
For the benefit of future support of inter-AS multicast capabilities, When the updating of the Adj-RIBs-Out and the Routing Table is
a BGP speaker that participates in inter-AS multicast routing shall complete, the local BGP speaker shall run the external update process
advertise a route it receives from one of its external peers and if of 9.2.2.
it installs it in its Loc-RIB, it shall advertise it back to the peer
from which the route was received. For a BGP speaker that does not
participate in inter-AS multicast routing such an advertisement is
optional. When doing such an advertisement, the NEXT_HOP attribute
should be set to the address of the peer. An implementation may also
optimize such an advertisement by truncating information in the
AS_PATH attribute to include only its own AS number and that of the
peer that advertised the route (such truncation requires the ORIGIN
attribute to be set to INCOMPLETE). In addition an implementation is
not required to pass optional or discretionary path attributes with
such an advertisement.
When the updating of the Adj-RIBs-Out and the Forwarding Information
Base (FIB) is complete, the local BGP speaker shall run the external
update process of 9.2.2.
9.1.4 Overlapping Routes 9.1.4 Overlapping Routes
A BGP speaker may transmit routes with overlapping Network Layer A BGP speaker may transmit routes with overlapping Network Layer
Reachability Information (NLRI) to another BGP speaker. NLRI overlap Reachability Information (NLRI) to another BGP speaker. NLRI overlap
occurs when a set of destinations are identified in non-matching occurs when a set of destinations are identified in non-matching
multiple routes. Since BGP encodes NLRI using IP prefixes, overlap multiple routes. Since BGP encodes NLRI using IP prefixes, overlap
will always exhibit subset relationships. A route describing a will always exhibit subset relationships. A route describing a
smaller set of destinations (a longer prefix) is said to be more smaller set of destinations (a longer prefix) is said to be more
specific than a route describing a larger set of destinations (a specific than a route describing a larger set of destinations (a
shorted prefix); similarly, a route describing a larger set of shorted prefix); similarly, a route describing a larger set of
destinations (a shorter prefix) is said to be less specific than a destinations (a shorter prefix) is said to be less specific than a
route describing a smaller set of destinations (a longer prefix). route describing a smaller set of destinations (a longer prefix).
The precedence relationship effectively decomposes less specific The precedence relationship effectively decomposes less specific
routes into two parts: routes into two parts:
- a set of destinations described only by the less specific - a set of destinations described only by the less specific route,
route, and and
- a set of destinations described by the overlap of the less - a set of destinations described by the overlap of the less
specific and the more specific routes specific and the more specific routes
When overlapping routes are present in the same Adj-RIB-In, the more When overlapping routes are present in the same Adj-RIB-In, the more
specific route shall take precedence, in order from more specific to specific route shall take precedence, in order from more specific to
least specific. least specific.
The set of destinations described by the overlap represents a portion The set of destinations described by the overlap represents a portion
of the less specific route that is feasible, but is not currently in of the less specific route that is feasible, but is not currently in
use. If a more specific route is later withdrawn, the set of use. If a more specific route is later withdrawn, the set of
destinations described by the overlap will still be reachable using destinations described by the overlap will still be reachable using
the less specific route. the less specific route.
If a BGP speaker receives overlapping routes, the Decision Process If a BGP speaker receives overlapping routes, the Decision Process
MUST consider both routes based on the configured acceptance policy. MUST consider both routes based on the configured acceptance policy.
If both a less and a more specific route are accepted, then the If both a less and a more specific route are accepted, then the
Decision Process MUST either install both the less and the more Decision Process MUST either install both the less and the more
specific routes or it MUST aggregate the two routes and install the specific routes or it MUST aggregate the two routes and install the
aggregated route. aggregated route, provided that both routes have the same value of
the NEXT_HOP attribute.
If a BGP speaker chooses to aggregate, then it MUST add If a BGP speaker chooses to aggregate, then it MUST add
ATOMIC_AGGREGATE attribute to the route. A route that carries ATOMIC_AGGREGATE attribute to the route. A route that carries
ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the ATOMIC_AGGREGATE attribute can not be de-aggregated. That is, the
NLRI of this route can not be made more specific. Forwarding along NLRI of this route can not be made more specific. Forwarding along
such a route does not guarantee that IP packets will actually such a route does not guarantee that IP packets will actually
traverse only ASs listed in the AS_PATH attribute of the route. traverse only ASs listed in the AS_PATH attribute of the route.
9.2 Update-Send Process 9.2 Update-Send Process
skipping to change at page 43, line 45 skipping to change at page 46, line 12
all of which are located in the same autonomous system, is referred all of which are located in the same autonomous system, is referred
to as internal distribution. to as internal distribution.
9.2.1 Internal Updates 9.2.1 Internal Updates
The Internal update process is concerned with the distribution of The Internal update process is concerned with the distribution of
routing information to internal peers. routing information to internal peers.
When a BGP speaker receives an UPDATE message from an internal peer, When a BGP speaker receives an UPDATE message from an internal peer,
the receiving BGP speaker shall not re-distribute the routing the receiving BGP speaker shall not re-distribute the routing
information contained in that UPDATE message to other internal peers. information contained in that UPDATE message to other internal peers,
unless the speaker acts as a BGP Route Reflector [11].
When a BGP speaker receives a new route from an external peer, it When a BGP speaker receives a new route from an external peer, it
MUST advertise that route to all other internal peers by means of an MUST advertise that route to all other internal peers by means of an
UPDATE message if this route will be installed in its Loc-RIB UPDATE message if this route will be installed in its Loc-RIB
according to the route selection rules in 9.1.2. according to the route selection rules in 9.1.2.
When a BGP speaker receives an UPDATE message with a non-empty When a BGP speaker receives an UPDATE message with a non-empty
WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all WITHDRAWN ROUTES field, it shall remove from its Adj-RIB-In all
routes whose destinations was carried in this field (as IP prefixes). routes whose destinations were carried in this field (as IP
The speaker shall take the following additional steps: prefixes). The speaker shall take the following additional steps:
1) if the corresponding feasible route had not been previously 1) if the corresponding feasible route had not been previously
advertised, then no further action is necessary advertised, then no further action is necessary
2) if the corresponding feasible route had been previously 2) if the corresponding feasible route had been previously
advertised, then: advertised, then:
i) if a new route is selected for advertisement that has the i) If a new route for the same NLRI is selected for
same Network Layer Reachability Information as the unfeasible advertisement, then the BGP speaker shall advertise the
routes, then the local BGP speaker shall advertise the
replacement route replacement route
ii) if a replacement route is not available for advertisement, ii) if a replacement route is not available for advertisement,
then the BGP speaker shall include the destinations of the then the BGP speaker shall include the destinations of the
unfeasible route (in form of IP prefixes) in the WITHDRAWN unfeasible route (in form of IP prefixes) in the WITHDRAWN
ROUTES field of an UPDATE message, and shall send this message ROUTES field of an UPDATE message, and shall send this message
to each peer to whom it had previously advertised the to each peer to whom it had previously advertised the
corresponding feasible route. corresponding feasible route.
All feasible routes which are advertised shall be placed in the All feasible routes which are advertised shall be placed in the
appropriate Adj-RIBs-Out, and all unfeasible routes which are appropriate Adj-RIBs-Out, and all unfeasible routes which are
advertised shall be removed from the Adj-RIBs-Out. advertised shall be removed from the Adj-RIBs-Out after the
corresponding update messages have been sent.
9.2.1.1 Breaking Ties (Internal Updates) 9.2.1.1 Breaking Ties (Internal Updates)
If a local BGP speaker has connections to several external peers, If a local BGP speaker has connections to several external peers,
there will be multiple Adj-RIBs-In associated with these peers. These there will be multiple Adj-RIBs-In associated with these peers. These
Adj-RIBs-In might contain several equally preferable routes to the Adj-RIBs-In might contain several equally preferable routes to the
same destination, all of which were advertised by external peers. same destination, all of which were advertised by external peers.
The local BGP speaker shall select one of these routes according to The local BGP speaker shall select one of these routes according to
the following rules: the following rules:
skipping to change at page 45, line 18 skipping to change at page 47, line 33
select the route with the lowest cost. select the route with the lowest cost.
c) In all other cases, select the route that was advertised by the c) In all other cases, select the route that was advertised by the
BGP speaker whose BGP Identifier has the lowest value. BGP speaker whose BGP Identifier has the lowest value.
9.2.2 External Updates 9.2.2 External Updates
The external update process is concerned with the distribution of The external update process is concerned with the distribution of
routing information to external peers. As part of Phase 3 route routing information to external peers. As part of Phase 3 route
selection process, the BGP speaker has updated its Adj-RIBs-Out and selection process, the BGP speaker has updated its Adj-RIBs-Out and
its Forwarding Table. All newly installed routes and all newly its Routing Table. All newly installed routes and all newly
unfeasible routes for which there is no replacement route shall be unfeasible routes for which there is no replacement route shall be
advertised to external peers by means of UPDATE message. advertised to external peers by means of UPDATE message.
Any routes in the Loc-RIB marked as unfeasible shall be removed. Any routes in the Loc-RIB marked as unfeasible shall be removed.
Changes to the reachable destinations within its own autonomous Changes to the reachable destinations within its own autonomous
system shall also be advertised in an UPDATE message. system shall also be advertised in an UPDATE message.
9.2.3 Controlling Routing Traffic Overhead 9.2.3 Controlling Routing Traffic Overhead
The BGP protocol constrains the amount of routing traffic (that is, The BGP protocol constrains the amount of routing traffic (that is,
skipping to change at page 48, line 9 skipping to change at page 50, line 23
longer listed individually as in the form of AS_SEQUENCEs. In longer listed individually as in the form of AS_SEQUENCEs. In
practice this is not likely to be a problem, since once an IP practice this is not likely to be a problem, since once an IP
packet arrives at the edge of a group of autonomous systems, the packet arrives at the edge of a group of autonomous systems, the
BGP speaker at that point is likely to have more detailed path BGP speaker at that point is likely to have more detailed path
information and can distinguish individual paths to destinations. information and can distinguish individual paths to destinations.
9.2.4.2 Aggregating Routing Information 9.2.4.2 Aggregating Routing Information
Aggregation is the process of combining the characteristics of Aggregation is the process of combining the characteristics of
several different routes in such a way that a single route can be several different routes in such a way that a single route can be
advertised. Aggregation can occur as part of the decision process advertised. Aggregation can occur as part of the decision process to
to reduce the amount of routing information that will be placed in reduce the amount of routing information that will be placed in the
the Adj-RIBs-Out. Adj-RIBs-Out.
Aggregation reduces the amount of information that a BGP speaker must Aggregation reduces the amount of information that a BGP speaker must
store and exchange with other BGP speakers. Routes can be aggregated store and exchange with other BGP speakers. Routes can be aggregated
by applying the following procedure separately to path attributes of by applying the following procedure separately to path attributes of
like type and to the Network Layer Reachability Information. like type and to the Network Layer Reachability Information.
Routes that have the following attributes shall not be aggregated Routes that have the following attributes shall not be aggregated
unless the corresponding attributes of each route are identical: unless the corresponding attributes of each route are identical:
MULTI_EXIT_DISC, NEXT_HOP. MULTI_EXIT_DISC, NEXT_HOP.
If the aggregation occurs as part of the update process, routes with
different NEXT_HOP values can be aggregated when announced through an
external BGP session.
Path attributes that have different type codes can not be aggregated Path attributes that have different type codes can not be aggregated
together. Path of the same type code may be aggregated, according to together. Path of the same type code may be aggregated, according to
the following rules: the following rules:
ORIGIN attribute: If at least one route among routes that are ORIGIN attribute: If at least one route among routes that are
aggregated has ORIGIN with the value INCOMPLETE, then the aggregated has ORIGIN with the value INCOMPLETE, then the
aggregated route must have the ORIGIN attribute with the value aggregated route must have the ORIGIN attribute with the value
INCOMPLETE. Otherwise, if at least one route among routes that are INCOMPLETE. Otherwise, if at least one route among routes that are
aggregated has ORIGIN with the value EGP, then the aggregated aggregated has ORIGIN with the value EGP, then the aggregated
route must have the origin attribute with the value EGP. In all route must have the origin attribute with the value EGP. In all
skipping to change at page 50, line 7 skipping to change at page 52, line 24
aggregated should be ignored. aggregated should be ignored.
9.3 Route Selection Criteria 9.3 Route Selection Criteria
Generally speaking, additional rules for comparing routes among Generally speaking, additional rules for comparing routes among
several alternatives are outside the scope of this document. There several alternatives are outside the scope of this document. There
are two exceptions: are two exceptions:
- If the local AS appears in the AS path of the new route being - If the local AS appears in the AS path of the new route being
considered, then that new route cannot be viewed as better than considered, then that new route cannot be viewed as better than
any other route. If such a route were ever used, a routing loop any other route (provided that the speaker is configured to accept
could result (see Section 6.3). such routes). If such a route were ever used, a routing loop could
result (see Section 6.3).
- In order to achieve successful distributed operation, only - In order to achieve successful distributed operation, only
routes with a likelihood of stability can be chosen. Thus, an AS routes with a likelihood of stability can be chosen. Thus, an AS
must avoid using unstable routes, and it must not make rapid must avoid using unstable routes, and it must not make rapid
spontaneous changes to its choice of route. Quantifying the terms spontaneous changes to its choice of route. Quantifying the terms
"unstable" and "rapid" in the previous sentence will require "unstable" and "rapid" in the previous sentence will require
experience, but the principle is clear. experience, but the principle is clear.
Care must be taken to ensure that BGP speakers in the same AS do
not make inconsistent decisions.
9.4 Originating BGP routes 9.4 Originating BGP routes
A BGP speaker may originate BGP routes by injecting routing A BGP speaker may originate BGP routes by injecting routing
information acquired by some other means (e.g. via an IGP) into BGP. information acquired by some other means (e.g. via an IGP) into BGP.
A BGP speaker that originates BGP routes shall assign the degree of A BGP speaker that originates BGP routes shall assign the degree of
preference to these routes by passing them through the Decision preference to these routes by passing them through the Decision
Process (see Section 9.1). These routes may also be distributed to Process (see Section 9.1). These routes may also be distributed to
other BGP speakers within the local AS as part of the Internal update other BGP speakers within the local AS as part of the Internal update
process (see Section 9.2.1). The decision whether to distribute non- process (see Section 9.2.1). The decision whether to distribute non-
BGP acquired routes within an AS via BGP or not depends on the BGP acquired routes within an AS via BGP or not depends on the
environment within the AS (e.g. type of IGP) and should be controlled environment within the AS (e.g. type of IGP) and should be controlled
via configuration. via configuration.
Appendix 1. BGP FSM State Transitions and Actions. Appendix 1. Comparison with RFC1771
This Appendix discusses the transitions between states in the BGP FSM
in response to BGP events. The following is the list of these states
and events when the negotiated Hold Time value is non-zero.
BGP States:
1 - Idle
2 - Connect
3 - Active
4 - OpenSent
5 - OpenConfirm
6 - Established
BGP Events:
1 - BGP Start There are numerous editorial changes (too many to list here).
2 - BGP Stop
3 - BGP Transport connection open
4 - BGP Transport connection closed
5 - BGP Transport connection open failed
6 - BGP Transport fatal error
7 - ConnectRetry timer expired
8 - Hold Timer expired
9 - KeepAlive timer expired
10 - Receive OPEN message
11 - Receive KEEPALIVE message
12 - Receive UPDATE messages
13 - Receive NOTIFICATION message
The following table describes the state transitions of the BGP FSM The following list the technical changes:
and the actions triggered by these transitions.
Event Actions Message Sent Next State Changes to reflect the usages of such features as TCP MD5 [10],
-------------------------------------------------------------------- BGP Route Reflectors [11], BGP Confederations [13], and BGP Route
Idle (1) Refresh [12].
1 Initialize resources none 2
Start ConnectRetry timer
Initiate a transport connection
others none none 1
Connect(2) Clarification on the use of the BGP Identifier in the AGGREGATOR
1 none none 2 attribute.
3 Complete initialization OPEN 4
Clear ConnectRetry timer
5 Restart ConnectRetry timer none 3
7 Restart ConnectRetry timer none 2
Initiate a transport connection
others Release resources none 1
Active (3) Procedures for imposing an upper bound on the number of prefixes
1 none none 3 that a BGP speaker would accept from a peer.
3 Complete initialization OPEN 4
Clear ConnectRetry timer
5 Close connection 3
Restart ConnectRetry timer
7 Restart ConnectRetry timer none 2
Initiate a transport connection
others Release resources none 1
OpenSent(4)
1 none none 4
4 Close transport connection none 3
Restart ConnectRetry timer
6 Release resources none 1
10 Process OPEN is OK KEEPALIVE 5
Process OPEN failed NOTIFICATION 1
others Close transport connection NOTIFICATION 1
Release resources
OpenConfirm (5) The ability of a BGP speaker to include more than one instance of
1 none none 5 its own AS in the AS_PATH attribute for the purpose of inter-AS
4 Release resources none 1 traffic engineering.
6 Release resources none 1
9 Restart KeepAlive timer KEEPALIVE 5
11 Complete initialization none 6
Restart Hold Timer
13 Close transport connection 1
Release resources
others Close transport connection NOTIFICATION 1
Release resources
Established (6) Clarifications on the various types of NEXT_HOPs.
1 none none 6
4 Release resources none 1
6 Release resources none 1
9 Restart KeepAlive timer KEEPALIVE 6
11 Restart Hold Timer KEEPALIVE 6
12 Process UPDATE is OK UPDATE 6
Process UPDATE failed NOTIFICATION 1
13 Close transport connection 1
Release resources
others Close transport connection NOTIFICATION 1
Release resources
---------------------------------------------------------------------
The following is a condensed version of the above state transition The relationship between the immediate next hop, and the next hop
table. as specified in the NEXT_HOP path attribute.
Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab Clarifications on the tie-breaking procedures.
| (1) | (2) | (3) | (4) | (5) | (6)
|---------------------------------------------------------------
1 | 2 | 2 | 3 | 4 | 5 | 6
| | | | | |
2 | 1 | 1 | 1 | 1 | 1 | 1
| | | | | |
3 | 1 | 4 | 4 | 1 | 1 | 1
| | | | | |
4 | 1 | 1 | 1 | 3 | 1 | 1
| | | | | |
5 | 1 | 3 | 3 | 1 | 1 | 1
| | | | | |
6 | 1 | 1 | 1 | 1 | 1 | 1
| | | | | |
7 | 1 | 2 | 2 | 1 | 1 | 1
| | | | | |
8 | 1 | 1 | 1 | 1 | 1 | 1
| | | | | |
9 | 1 | 1 | 1 | 1 | 5 | 6
| | | | | |
10 | 1 | 1 | 1 | 1 or 5 | 1 | 1
| | | | | |
11 | 1 | 1 | 1 | 1 | 6 | 6
| | | | | |
12 | 1 | 1 | 1 | 1 | 1 | 1 or 6
| | | | | |
13 | 1 | 1 | 1 | 1 | 1 | 1
| | | | | |
---------------------------------------------------------------
Appendix 2. Comparison with RFC1267 Appendix 2. Comparison with RFC1267
All the changes listed in Appendix 1, plus the following.
BGP-4 is capable of operating in an environment where a set of BGP-4 is capable of operating in an environment where a set of
reachable destinations may be expressed via a single IP prefix. The reachable destinations may be expressed via a single IP prefix. The
concept of network classes, or subnetting is foreign to BGP-4. To concept of network classes, or subnetting is foreign to BGP-4. To
accommodate these capabilities BGP-4 changes semantics and encoding accommodate these capabilities BGP-4 changes semantics and encoding
associated with the AS_PATH attribute. New text has been added to associated with the AS_PATH attribute. New text has been added to
define semantics associated with IP prefixes. These abilities allow define semantics associated with IP prefixes. These abilities allow
BGP-4 to support the proposed supernetting scheme [9]. BGP-4 to support the proposed supernetting scheme [9].
To simplify configuration this version introduces a new attribute, To simplify configuration this version introduces a new attribute,
LOCAL_PREF, that facilitates route selection procedures. LOCAL_PREF, that facilitates route selection procedures.
skipping to change at page 54, line 16 skipping to change at page 54, line 20
certain aggregates are not de-aggregated. Another new attribute, certain aggregates are not de-aggregated. Another new attribute,
AGGREGATOR, can be added to aggregate routes in order to advertise AGGREGATOR, can be added to aggregate routes in order to advertise
which AS and which BGP speaker within that AS caused the aggregation. which AS and which BGP speaker within that AS caused the aggregation.
To insure that Hold Timers are symmetric, the Hold Time is now To insure that Hold Timers are symmetric, the Hold Time is now
negotiated on a per-connection basis. Hold Times of zero are now negotiated on a per-connection basis. Hold Times of zero are now
supported. supported.
Appendix 3. Comparison with RFC 1163 Appendix 3. Comparison with RFC 1163
All of the changes listed in Appendix 2, plus the following. All of the changes listed in Appendices 1 and 2, plus the following.
To detect and recover from BGP connection collision, a new field (BGP To detect and recover from BGP connection collision, a new field (BGP
Identifier) has been added to the OPEN message. New text (Section Identifier) has been added to the OPEN message. New text (Section
6.8) has been added to specify the procedure for detecting and 6.8) has been added to specify the procedure for detecting and
recovering from collision. recovering from collision.
The new document no longer restricts the border router that is passed The new document no longer restricts the border router that is passed
in the NEXT_HOP path attribute to be part of the same Autonomous in the NEXT_HOP path attribute to be part of the same Autonomous
System as the BGP Speaker. System as the BGP Speaker.
New document optimizes and simplifies the exchange of the information New document optimizes and simplifies the exchange of the information
about previously reachable routes. about previously reachable routes.
Appendix 4. Comparison with RFC 1105 Appendix 4. Comparison with RFC 1105
All of the changes listed in Appendices 2 and 3, plus the following. All of the changes listed in Appendices 1, 2 and 3, plus the
following.
Minor changes to the RFC1105 Finite State Machine were necessary to Minor changes to the RFC1105 Finite State Machine were necessary to
accommodate the TCP user interface provided by 4.3 BSD. accommodate the TCP user interface provided by 4.3 BSD.
The notion of Up/Down/Horizontal relations present in RFC1105 has The notion of Up/Down/Horizontal relations present in RFC1105 has
been removed from the protocol. been removed from the protocol.
The changes in the message format from RFC1105 are as follows: The changes in the message format from RFC1105 are as follows:
1. The Hold Time field has been removed from the BGP header and 1. The Hold Time field has been removed from the BGP header and
skipping to change at page 55, line 39 skipping to change at page 55, line 44
with precedence set to Internetwork Control (110) value (see also with precedence set to Internetwork Control (110) value (see also
[6]). [6]).
Appendix 6. Implementation Recommendations Appendix 6. Implementation Recommendations
This section presents some implementation recommendations. This section presents some implementation recommendations.
6.1 Multiple Networks Per Message 6.1 Multiple Networks Per Message
The BGP protocol allows for multiple address prefixes with the same The BGP protocol allows for multiple address prefixes with the same
AS path and next-hop gateway to be specified in one message. Making path attributes to be specified in one message. Making use of this
use of this capability is highly recommended. With one address prefix capability is highly recommended. With one address prefix per message
per message there is a substantial increase in overhead in the there is a substantial increase in overhead in the receiver. Not only
receiver. Not only does the system overhead increase due to the does the system overhead increase due to the reception of multiple
reception of multiple messages, but the overhead of scanning the messages, but the overhead of scanning the routing table for updates
routing table for updates to BGP peers and other routing protocols to BGP peers and other routing protocols (and sending the associated
(and sending the associated messages) is incurred multiple times as messages) is incurred multiple times as well.
well. One method of building messages containing many address
prefixes per AS path and gateway from a routing table that is not One method of building messages containing many address prefixes per
organized per AS path is to build many messages as the routing table a path attribute set from a routing table that is not organized on a
is scanned. As each address prefix is processed, a message for the per path attribute set basis is to build many messages as the routing
associated AS path and gateway is allocated, if it does not exist, table is scanned. As each address prefix is processed, a message for
and the new address prefix is added to it. If such a message exists, the associated set of path attributes is allocated, if it does not
the new address prefix is just appended to it. If the message lacks exist, and the new address prefix is added to it. If such a message
the space to hold the new address prefix, it is transmitted, a new exists, the new address prefix is just appended to it. If the message
message is allocated, and the new address prefix is inserted into the lacks the space to hold the new address prefix, it is transmitted, a
new message. When the entire routing table has been scanned, all new message is allocated, and the new address prefix is inserted into
the new message. When the entire routing table has been scanned, all
allocated messages are sent and their resources released. Maximum allocated messages are sent and their resources released. Maximum
compression is achieved when all the destinations covered by the compression is achieved when all the destinations covered by the
address prefixes share a gateway and common path attributes, making address prefixes share a common set of path attributes making it
it possible to send many address prefixes in one 4096-byte message. possible to send many address prefixes in one 4096-byte message.
When peering with a BGP implementation that does not compress When peering with a BGP implementation that does not compress
multiple address prefixes into one message, it may be necessary to multiple address prefixes into one message, it may be necessary to
take steps to reduce the overhead from the flood of data received take steps to reduce the overhead from the flood of data received
when a peer is acquired or a significant network topology change when a peer is acquired or a significant network topology change
occurs. One method of doing this is to limit the rate of updates. occurs. One method of doing this is to limit the rate of updates.
This will eliminate the redundant scanning of the routing table to This will eliminate the redundant scanning of the routing table to
provide flash updates for BGP peers and other routing protocols. A provide flash updates for BGP peers and other routing protocols. A
disadvantage of this approach is that it increases the propagation disadvantage of this approach is that it increases the propagation
latency of routing information. By choosing a minimum flash update latency of routing information. By choosing a minimum flash update
skipping to change at page 59, line 10 skipping to change at page 59, line 12
each other in one attribute, but do not follow in another, then each other in one attribute, but do not follow in another, then
the intervening ASs of the latter are combined into an AS_SET the intervening ASs of the latter are combined into an AS_SET
path segment; this segment is then placed in between the two path segment; this segment is then placed in between the two
consecutive ASs identified in (a) of the aggregated attribute. consecutive ASs identified in (a) of the aggregated attribute.
If as a result of the above procedure a given AS number appears If as a result of the above procedure a given AS number appears
more than once within the aggregated AS_PATH attribute, all, but more than once within the aggregated AS_PATH attribute, all, but
the last instance (rightmost occurrence) of that AS number should the last instance (rightmost occurrence) of that AS number should
be removed from the aggregated AS_PATH attribute. be removed from the aggregated AS_PATH attribute.
Security Considerations
BGP supports the ability to authenticate BGP messages by using BGP
authentication. The authentication could be done on a per peer basis.
In addition, BGP supports the ability to authenticate its data stream
by using [10]. This authentication could be done on a per peer basis.
Finally, BGP could also use IPSec to authenticate its data stream.
Among the mechanisms mentioned in this paragraph, [10] is the most
widely deployed.
References References
[1] Mills, D., "Exterior Gateway Protocol Formal Specification", [1] Mills, D., "Exterior Gateway Protocol Formal Specification",
RFC904, April 1984. RFC904, April 1984.
[2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET
Backbone", RFC1092, February 1989. Backbone", RFC1092, February 1989.
[3] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, February [3] Braun, H-W., "The NSFNET Routing Architecture", RFC1093, February
1989. 1989.
skipping to change at page 59, line 42 skipping to change at page 60, line 10
Inter-domain Routeing Information among Intermediate Systems to Inter-domain Routeing Information among Intermediate Systems to
Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993 Support Forwarding of ISO 8473 PDUs", ISO/IEC IS10747, 1993
[8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter- [8] Fuller, V., Li, T., Yu, J., and Varadhan, K., ""Classless Inter-
Domain Routing (CIDR): an Address Assignment and Aggregation Domain Routing (CIDR): an Address Assignment and Aggregation
Strategy", RFC1519, September 1993. Strategy", RFC1519, September 1993.
[9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation [9] Rekhter, Y., Li, T., "An Architecture for IP Address Allocation
with CIDR", RFC 1518, September 1993. with CIDR", RFC 1518, September 1993.
Security Considerations [10] Heffernan, A., "Protection of BGP Sessions via the TCP MD5
Signature Option", RFC2385, August 1998.
Security issues are not discussed in this document. [11] Bates, T., Chandra, R., Chen, E., "BGP Route Reflection - An
Alternative to Full Mesh IBGP", RFC2796, April 2000.
[12] Chen, E., "Route Refresh Capability for BGP-4", RFC2918,
September 2000.
[13] Traina, P, McPherson, D., Scudder, J., "Autonomous System
Confederations for BGP", RFC3065, February 2001.
Editors' Addresses Editors' Addresses
Yakov Rekhter Yakov Rekhter
Juniper Networks Juniper Networks
1194 N. Mathilda Avenue 1194 N. Mathilda Avenue
Sunnyvale, CA 94089 Sunnyvale, CA 94089
email: yakov@juniper.net email: yakov@juniper.net
Tony Li Tony Li
Procket Networks Procket Networks
3910 Freedom Circle, Ste. 102A 1100 Cadillac Ct.
Santa Clara CA 95054 Milpitas, CA 95035
Email: tli@procket.com Email: tli@procket.com
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/