RFC 1105

Border Gateway Protocol (BGP)

๐Ÿ“… published June 1989, from ietf

RFC 1105: A Border Gateway Protocol (BGP) ๐ŸŒโœจ

Okay bestie, this is RFC 1105, titled A Border Gateway Protocol (BGP) ๐Ÿ’–. It's from the Network Working Group and dated June 1989. The authors are K. Lougheed from cisco Systems and Y. Rekhter from the T.J. Watson Research Center at IBM Corp. ๐Ÿซถ The header doesn't list a category, and it doesn't list anything it obsoletes or updates.


Status of this Memo ๐Ÿฆ‹

This RFC lays out one specific way to swap network reachability info between Autonomous Systems, and it's giving main character energy ๐Ÿ’…

When this was written, BGP implementations already existed for cisco routers and for the NSFNET Nodal Switching Systems ๐Ÿ”ฅ A public domain version for "gated" was being built at that time.

Distribution of this memo is unlimited ๐ŸŒˆ

1. Introduction ๐ŸŒธ

BGP (the Border Gateway Protocol) is an inter-autonomous system routing protocol, so it runs between autonomous systems, not inside one ๐Ÿงš It's built on experience with EGP as defined in RFC 904 [1], plus EGP usage on the NSFNET Backbone as described in RFC 1092 [2] and RFC 1093 [3].

The main job of a BGP speaking system is to trade network reachability info with other BGP systems โœจ That info includes which autonomous systems (AS's) your traffic has to transit to reach those networks. It's enough to build a graph of AS connectivity, which means routing loops can get pruned and AS-level policy decisions can get enforced ๐Ÿ‘‘

BGP runs over a reliable transport level protocol, which is honestly so iconic ๐Ÿ˜ญ This means nobody has to implement explicit update fragmentation, retransmission, acknowledgement, or sequencing. Any authentication scheme the transport protocol uses can be used alongside BGP's own authentication mechanisms ๐Ÿ”

The initial BGP implementation is based on TCP [4], but any reliable transport may be used ๐Ÿฆ‹ A message passing protocol like VMTP [5] might be more natural for BGP, ngl. TCP will be used anyway, since it's present in virtually all commercial routers and hosts ๐Ÿ’œ In the descriptions that follow, "transport protocol connection" can be understood to mean a TCP connection. BGP uses TCP port 179 for establishing its connections ๐ŸŽ€

2. Summary of Operation ๐Ÿ’–

Two hosts form a transport protocol connection with each other. They trade messages to open and confirm the connection parameters ๐Ÿซถ The first data flow is the entire BGP routing table. After that, incremental updates get sent as the routing tables change ๐Ÿ”„ Keepalive messages get sent periodically to make sure the connection is still alive ๐Ÿ’“ Notification messages get sent in response to errors or special conditions ๐Ÿšจ If a connection hits an error condition, a notification message gets sent and the connection is optionally closed ๐Ÿ’€

The hosts running the Border Gateway Protocol don't need to be routers, bestie ๐Ÿ™ˆ A non-routing host could swap routing info with routers via EGP or even an interior routing protocol. That non-routing host could then use BGP to exchange routing info with a border gateway in another autonomous system. The implications and applications of this setup are for further study ๐Ÿ”ฎ

If a particular AS has more than one BGP gateway, then all of those gateways should have a consistent view of routing ๐Ÿ‘ฏ The intra-AS routing protocol gives a consistent view of the AS's interior routes. A consistent view of the routes exterior to the AS can be provided in a bunch of different ways ๐ŸŒท One way is to use BGP to exchange routing info between the BGP gateways inside a single AS. In that case, to keep the routing info consistent, these gateways MUST have direct BGP sessions with each other (the BGP sessions should form a complete graph) ๐Ÿซถ This doesn't mean every BGP gateway in a single AS has to have a direct link to every other one. Other methods can be used to keep the routing info consistent too ๐Ÿงš

3. Message Formats ๐ŸŽ€

This section covers the message formats, plus what to do when errors show up while processing these messages ๐Ÿ“

Messages are sent over a reliable transport protocol connection. A message gets processed only after it's been entirely received. The maximum message size is 1024 bytes, and all implementations are required to support this maximum message size ๐Ÿ’… The smallest message that can be sent is a BGP header with no data portion, which is 8 bytes ๐Ÿฆ‹

When we say "the BGP connection is closed," we mean the transport protocol connection has been closed and all resources for that BGP connection have been deallocated ๐Ÿงน Routing table entries tied to the remote peer get marked as invalid. This info gets passed along to other BGP peers before it's deleted from the system ๐Ÿ’œ

3.1 Message Header Format ๐Ÿ’…

Each message has a fixed size header. There may or may not be a data portion after the header, depending on the message type ๐ŸŒˆ The layout of these fields is shown below.

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |        Marker                |          Length                |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    Version   |     Type      |        Hold Time               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Marker: 16 bits ๐Ÿšฆ

The Marker field is 16 bits, all ones ๐Ÿ’ซ It marks the start of a message. If the first two bytes of a message aren't all ones, that's a synchronization error. The BGP connection should be closed after sending a notification message with opcode 5 (connection not synchronized). No notification data is sent in this case ๐Ÿ™…โ€โ™€๏ธ

Length: 16 bits ๐Ÿ“

The Length field is 16 bits. It's the total length of the message, including the header, in bytes ๐Ÿงฎ If an illegal length shows up (more than 1024 bytes or less than 8 bytes), a notification message with opcode 6 (bad message length) and two data bytes of the bad length should be sent, and then the BGP connection gets closed ๐Ÿ’…

Version: 8 bits ๐Ÿ”ข

The Version field is 8 bits of protocol version number. The current BGP version number is 1 โœจ If a bad version number is found, a notification message with opcode 8 (bad version number) should be sent and the BGP connection closed. The bad version number should be included in one byte of notification data ๐Ÿ™ˆ

Type: 8 bits ๐Ÿท๏ธ

The Type field is 8 bits of message type code. These are the type codes that are defined:

              1 - OPEN
              2 - UPDATE
              3 - NOTIFICATION
              4 - KEEPALIVE
              5 - OPEN CONFIRM

If an unrecognized type value shows up, a notification message with opcode 7 (bad type code) should be sent, with data consisting of the byte of the type field in question, and then the BGP connection gets closed ๐Ÿšซ

Hold Timer: 16 bits. โณ

This field holds the number of seconds that may elapse since receiving a BGP KEEPALIVE or BGP UPDATE message from our BGP peer. Once that time is up, we declare an error and close the BGP connection ๐Ÿ’”

3.2 OPEN Message Format ๐Ÿ‘‘

After a transport protocol connection is established, the first message either side sends is an OPEN message ๐ŸŽ‰ If the OPEN message is acceptable, an OPEN CONFIRM message gets sent back to confirm it. Once the OPEN is confirmed, UPDATE, KEEPALIVE, and NOTIFICATION messages may be exchanged ๐Ÿ’…

On top of the fixed size BGP header, the OPEN message has these fields:

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |    My Autonomous System      |   Link Type   |  Auth. Code    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   |                 Authentication Data                           |
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

My Autonomous System: 16 bits ๐Ÿ 

This field is our 16 bit autonomous system number. If there's a problem with this field, a notification message with opcode 9 (invalid AS field) should be sent and the BGP connection closed. No notification data is sent ๐Ÿ™…โ€โ™€๏ธ

The Link Type field is a single octet containing one of these codes, which define our position in the AS graph relative to our peer ๐Ÿ—บ๏ธ

                 0  - INTERNAL
                 1  - UP
                 2  - DOWN
                 3  - H-LINK

UP means the peer is higher in the AS hierarchy, DOWN means lower, and H-LINK means same level ๐Ÿชœ INTERNAL means the peer is another BGP speaking host in our autonomous system. INTERNAL links are used to keep AS routing info consistent with an AS that has multiple border gateways ๐Ÿซถ If the Link Type field is unacceptable, a notification message with opcode 1 (link type error in open) and data consisting of the expected link type should be sent and the BGP connection closed. The acceptable values for the Link Type fields of two BGP peers are discussed below ๐Ÿ“–

Authentication Code: 8 bits ๐Ÿ”

The Authentication Code field is an octet whose value describes the authentication mechanism in use. A value of 0 means no BGP authentication ๐Ÿ™Œ A separate authentication mechanism may be used when establishing the transport level connection. If the authentication code isn't recognized, a notification message with opcode 2 (unknown authentication code) and no data is sent, and the BGP connection is closed ๐Ÿšซ

Authentication Data: variable length ๐Ÿ—๏ธ

The Authentication Data field is variable length and contains authentication data. If the Authentication Code field is 0, the Authentication Data field has zero length โœจ If authentication fails, a notification message with opcode 3 (authentication failure) and no data is sent, and the BGP connection is closed. That's a whole no-vibes moment ๐Ÿ˜ญ

3.3 OPEN CONFIRM Message Format โญ

An OPEN CONFIRM message is sent after receiving an OPEN message ๐Ÿ’Œ This completes the BGP connection setup. UPDATE, NOTIFICATION, and KEEPALIVE messages may now be exchanged ๐ŸŽŠ

An OPEN CONFIRM message is a BGP header with an OPEN CONFIRM type code. There's no data in an OPEN CONFIRM message ๐Ÿซง

3.4 UPDATE Message Format ๐Ÿฆ‹

Okay bestie, UPDATE messages are how BGP peers swap routing info ๐Ÿ’… The info in an UPDATE packet can be used to build a graph of how the different autonomous systems are connected ๐ŸŒธ If you apply the rules we're about to get into, you can spot routing loops and some other weird anomalies and clean them out of the inter-AS routing ๐Ÿงš

Whenever something goes wrong in an UPDATE message, a notification message gets sent with opcode 4 (bad update) ๐Ÿšจ It also carries a two byte subcode that explains what went wrong, plus a data field with as much of the UPDATE message's data portion as it can fit ๐Ÿซถ UPDATE messages look like this:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Gateway                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   AS count    | Direction     |         AS Number             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     repeat (Direction, AS Number) pairs AS count times        |
/                                                               /
/                                                               /
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Net Count                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Network                                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Metric                   |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|       repeat (Network, Metric) pairs Net Count times          |
/                                                               /
/                                                               /
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Gateway: 32 bits.

The Gateway field is the address of a gateway that has routes to the Internet networks listed in the rest of the UPDATE message ๐ŸŒˆ This gateway MUST belong to the same AS as the BGP peer who advertises it ๐Ÿ‘‘ If there's a problem with the gateway field, a notification message with subcode 6 (invalid gateway field) gets sent ๐Ÿ’€

AS count: 8 bits.

This field is the count of Direction and AS Number pairs in this UPDATE message ๐Ÿ“ If an incorrect AS count field shows up, subcode 1 (invalid AS count) is specified in the notification message ๐Ÿ™ˆ

Direction: 8 bits

The Direction field is an octet holding the direction the routing info took when it exited the AS named in the next AS Number field ๐Ÿฆ‹ These are the values that are defined:

        1  - UP            (went up a link in the graph)
        2  - DOWN          (went down a link in the graph)
        3  - H_LINK        (horizontal link in the graph)
        4  - EGP_LINK      (EGP derived information)
        5  - INCOMPLETE    (incomplete information)

There's a special provision for passing exterior learned (non-BGP) routes over BGP, and it's lowkey so cute ๐ŸŽ€ If an EGP learned route gets passed over BGP, the Direction field is set to EGP-LINK and the AS Number field is set to the AS number of the EGP peer that advertised the route โœจ All other exterior-learned routes (non-BGP and non-EGP) may be passed by setting the AS Number field to zero and the Direction field to INCOMPLETE ๐Ÿซถ If the direction code isn't recognized, a notification message with subcode 2 (invalid direction code) is sent ๐Ÿ˜ญ

AS Number: 16 bits

This field is the AS number that transmitted the routing info ๐Ÿ’œ If there's a problem with this AS number, a notification message with subcode 3 (invalid autonomous system) is sent ๐Ÿ™ˆ

Net Count: 16 bits.

The Net Count field is the number of Metric and Network field pairs that follow it ๐Ÿงš If there's a problem with this field, a notification with subcode 7 (invalid net count field) is sent ๐Ÿ’…

Network: 32 bits

The Network field is four bytes of Internet network number ๐ŸŒธ If there's a problem with the network field, a notification message with subcode 8 (invalid network field) is sent ๐Ÿ’€

Metric: 16 bits

The Metric field is 16 bits of an unspecified metric, so it's giving mystery โœจ BGP metrics are comparable ONLY if routes have exactly the same AS path ๐Ÿ‘‘ A metric of all ones means the network is unreachable ๐Ÿ˜ญ In every other case the metric field is MEANINGLESS and MUST BE IGNORED ๐Ÿ™ˆ There are no illegal metric values ๐Ÿ’–


3.5 NOTIFICATION Message Format ๐Ÿšจ

NOTIFICATION messages get sent whenever an error condition is detected ๐Ÿ’€ The BGP connection gets closed shortly after the notification message goes out ๐Ÿฆ‹

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Opcode               |           Data                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Opcode: 16 bits

The Opcode field describes the type of NOTIFICATION ๐ŸŒˆ These are the opcodes that have been defined:

    1 (*) - link type error in open.  Data is one byte of proper
            link type.
    2 (*) - unknown authentication code.  No data.
    3 (*) - authentication failure.  No data.
    4     - update error.  See below for data description.
    5 (*) - connection out of sync.  No data.
    6 (*) - invalid message length.  Data is two bytes of
            bad length.
    7 (*) - invalid message type.  Data is one byte of bad
            message type.
    8 (*) - invalid version number.  Data is one byte of
            bad version.
    9 (*) - invalid AS field in OPEN.  No data.
   10 (*) - BGP Cease.  No data.

The starred opcodes in that list are considered fatal errors, and they cause transport connection termination ๐Ÿ”ฅ

The update error (opcode 4) has 16 bits of subcode as its data, followed by the last UPDATE message in question ๐Ÿงš After the subcode comes as much of the data portion of that UPDATE as possible ๐Ÿ’– These are the subcodes that are defined:

       1 - invalid AS count
       2 - invalid direction code
       3 - invalid autonomous system
       4 - EGP_LINK or INCOMPLETE_LINK link type at other than
           the end of the AS path list
       5 - routing loop
       6 - invalid gateway field
       7 - invalid Net Count field
       8 - invalid network field

Data: variable

The Data field contains zero or more bytes of data that help you diagnose why the NOTIFICATION happened ๐Ÿ” What's in the Data field depends on the opcode, so check the opcode descriptions above for more details ๐Ÿซถ


3.6 KEEPALIVE Message Format ๐Ÿซถ

BGP doesn't use any transport-protocol-based keepalive mechanism to figure out if peers are reachable ๐Ÿฆ‹ Instead, KEEPALIVE messages get exchanged between peers often enough that the hold time (as advertised in the BGP header) never expires ๐Ÿ’… A reasonable minimum frequency of KEEPALIVE exchange would be one third of the Hold Time interval โฐ

As soon as the Hold Time associated with a BGP peer has expired, the BGP connection is closed and BGP deallocates all resources associated with that peer ๐Ÿ’€

The KEEPALIVE message is just a BGP header without any data ๐ŸŒธ

4. BGP Finite State machine โœจ

okay bestie, this section is all about how BGP behaves, described as a Finite State Machine (FSM) ๐Ÿฆ‹ it's giving state-by-state energy. here's the quick recap of what BGP does in each state. the condensed version lives in Appendix 1 ๐Ÿ’œ

Initially BGP is in the BGP_Idle state.

BGP_Idle state

In this state BGP refuses all incoming BGP connections. No resources are allocated to the BGP neighbor. In response to the Start event (initiated by either system or operator) the local system initializes all BGP resources and changes its state to BGP_Active ๐ŸŒธ

BGP_Active state

In this state BGP is trying to acquire a BGP neighbor by opening a transport protocol connection. If the transport protocol open fails (for example, retransmission timeout), BGP stays in the BGP_Active state ๐Ÿฅบ

Otherwise, the local system sends an OPEN message to its peer and changes its state to BGP_OpenSent. Since the hold time of the peer is still undetermined, the hold time is initialized to some large value โณ

In response to the Stop event (initiated by either system or operator) the local system releases all BGP resources and changes its state to BGP_Idle ๐Ÿ™ˆ

BGP_OpenSent state

In this state BGP waits for an OPEN message from its peer. When an OPEN message is received, all fields are checked for correctness. If the initial BGP header checking detects an error, BGP deallocates all resources associated with this peer and returns to the BGP_Active state. Otherwise, the Link Type, Authentication Code, and Authentication Data fields are checked for correctness ๐Ÿ”

If the link type is incorrect, a NOTIFICATION message with opcode 1 (link type error in open) is sent. The following combination of link type fields are correct; all other combinations are invalid ๐Ÿ‘€

                      Our view         Peer view
                      UP                DOWN
                      DOWN              UP
                      INTERNAL          INTERNAL
                      H-LINK            H-LINK

If the link between two peers is INTERNAL, then AS number of both peers must be the same. Otherwise, a NOTIFICATION message with opcode 1 (link type error in open) is sent ๐Ÿ’…

If both peers have the same AS number and the link type between these peers is not INTERNAL, then a NOTIFICATION message with opcode 1 (link type error in open) is sent ๐Ÿ’€

If the value of the Authentication Code field is zero, any information in the Authentication Data field (if present) is ignored. If the Authentication Code field is non-zero it is checked for known authentication codes. If authentication code is unknown, then the BGP NOTIFICATION message with opcode 2 (unknown authentication code) is sent ๐Ÿ”

If the Authentication Code value is non-zero, then the corresponding authentication procedure is invoked. The default values are a zero Authentication Code and no Authentication Data ๐ŸŽ€

If any of the above tests detect an error, the local system closes the BGP connection and changes its state to BGP_Idle ๐Ÿšซ

If there are no errors in the BGP OPEN message, BGP sends an OPEN CONFIRM message and goes into the BGP_OpenConfirm state. At this point the hold timer, which was originally set to some arbitrary large value (see above), is replaced with the value indicated in the OPEN message โœจ

If disconnect notification is received from the underlying transport protocol or if the hold time expires, the local system closes the BGP connection and changes its state to BGP_Idle ๐Ÿ˜ญ

BGP_OpenConfirm state

In this state BGP waits for an OPEN CONFIRM message. As soon as this message is received, BGP changes its state to BGP_Established ๐ŸŽ‰ If the hold timer expires before an OPEN CONFIRM message is received, the local system closes the BGP connection and changes its state to BGP_Idle ๐Ÿ’”

BGP_Established state

In the BGP_Established state BGP can exchange UPDATE, NOTIFICATION, and KEEPALIVE messages with its peer ๐Ÿ‘‘

If disconnect notification is received from the underlying transport protocol or if the hold time expires, the local system closes the BGP connection and changes its state to BGP_Idle ๐Ÿ˜ค

In response to the Stop event initiated by either the system or operator, the local system sends a NOTIFICATION message with opcode 10 (BGP Cease), closes the BGP connection, and changes its state to BGP_Idle ๐ŸŒˆ


5. UPDATE Message Handling ๐Ÿ’Œ

okay so a BGP UPDATE message may be received only in the BGP_Established state. When a BGP UPDATE message is received, each field is checked for validity. When a NOTIFICATION message is sent regarding an UPDATE, the opcode is always 4 (update error), the subcode depends on the type of error, and the rest of the data field is as much as possible of the data portion of the UPDATE that caused the error ๐Ÿง

If the Gateway field is incorrect, a BGP NOTIFICATION message is sent with subcode 6 (invalid gateway field). All information in this UPDATE message is discarded ๐Ÿ—‘๏ธ

If the AS Count field is less than or equal to zero, a BGP NOTIFICATION is sent with subcode 1 (invalid AS count). Otherwise, the complete AS path is extracted and checked as described below ๐Ÿ›ค๏ธ

If one of the Direction fields in the AS route list is not defined, a BGP NOTIFICATION message is sent with subcode 2 (invalid direction code) ๐Ÿงญ

If one of the AS Number fields in the AS route list is incorrect, a BGP NOTIFICATION message is sent with subcode 3 (invalid autonomous system) ๐Ÿšจ

If either a EGP_LINK or a INCOMPLETE_LINK link type occurs at other than the end of the AS path, a BGP NOTIFICATION message is sent with subcode 4 (EGP_LINK or INCOMPLETE_LINK link type at other than the end of the AS path list) ๐Ÿ™…โ€โ™€๏ธ

If none of the above tests failed, the full AS route is checked for AS loops ๐Ÿ”

AS loop detection is done by scanning the full AS route and checking that each AS in this route occurs only once. If an AS loop is detected, a BGP NOTIFICATION message is sent with subcode 5 (routing loop) ๐ŸŒ€

If any of the above errors are detected, no further processing is done. Otherwise, the complete AS path is correct and the rest of the UPDATE message is processed ๐Ÿฅณ

If the Net Count field is incorrect, a BGP NOTIFICATION message is sent with subcode 7 (invalid Net Count field) ๐Ÿ”ข

Each network and metric pair listed in the BGP UPDATE message is checked for a valid network number. If the Network field is incorrect, a BGP Notification message is sent with subcode 8 (invalid network field). No checking is done on the metric field. It is up to a particular implementation to decide whether to continue processing or terminate it upon the first incorrect network ๐Ÿคทโ€โ™€๏ธ

If the network, its complete AS path, and the gateway are correct, then the route is compared with other routes to the same network. If the new route is better than the current one, then it is flooded to other BGP peers as follows ๐ŸŒŠ

  • If the BGP UPDATE was received over the INTERNAL link, it is not propagated over any other INTERNAL link. This restriction is due to the fact that all BGP gateways within a single AS form a completely connected graph (see above) ๐Ÿซถ
  • Before sending a BGP UPDATE message over the non-INTERNAL links, check the AS path to insure that doing so would not cause a routing loop. The BGP UPDATE message is then propagated (subject to the local policy restrictions) over any non-INTERNAL link over which a routing loop would not result ๐Ÿง 
  • If the BGP UPDATE message is propagated over a non-INTERNAL link, then the current AS number and link type of the link over which it is going to be propagated is prepended to the full AS path and the AS count field is incremented by 1. If the BGP UPDATE message is propagated over an INTERNAL link, then the full AS path is passed unmodified and the AS count stays the same. The Gateway field is replaced with the sender's own address ๐Ÿ’–

6. Acknowledgements ๐Ÿซถ

we would like to express our thanks to Len Bosack (cisco Systems), Jeff Honig (Cornell University) and all members of the IWG task force for their contributions to this document ๐ŸŒธ

Appendix 1 โœจ

BGP FSM State Transitions and Actions โœจ

Okay bestie, this is the part where we watch the BGP FSM hop between states every time something happens ๐Ÿฆ‹. Here's the full cast of states and events:

BGP States:

     1 - BGP_Idle
     2 - BGP_Active
     3 - BGP_OpenSent
     4 - BGP_OpenConfirm
     5 - BGP_Established

BGP Events:

     1 - BGP Start
     2 - BGP Transport connection open
     3 - BGP Transport connection closed
     4 - BGP Transport connection open failed
     5 - Receive OPEN message
     6 - Receive OPEN CONFIRM message
     7 - Receive KEEPALIVE message
     8 - Receive UPDATE messages
     9 - Receive NOTIFICATION message
    10 - Holdtime timer expired
    11 - KeepAlive timer expired
    12 - Receive CEASE message
    13 - BGP Stop

Next up is the big state transition table ๐Ÿ’…. It shows, for each state and event, what actions fire, what message gets sent (if any), and which state you land in next. The state you're in is the heading, and each event goes under it.

   Event                Actions               Message Sent   Next State
   --------------------------------------------------------------------
   BGP_Idle (1)
     1            Initialize resources           none             2
   BGP_Active (2)
     2           Initialize resources            OPEN             3
     4                   none                    none             2
    13           Release resources               none             1

   BGP_OpenSent(3)
    3                    none                    none             1
    5            Process OPEN is OK            OPEN CONFIRM       4
                 Process OPEN Message failed   NOTIFICATION       1
   11            Restart KeepAlive timer       KEEPALIVE          3
   13            Release resources               none             1

   BGP_OpenConfirm (4)
    6            Complete initialization         none             5
    3                   none                     none             1
   10            Close transport connection      none             1
   11            Restart KeepAlive timer       KEEPALIVE          4
   13            Release resources               none             1

   BGP_Established (5)
    7            Process KEEPALIVE               none             5
    8            Process UPDATE is OK          UPDATE             5
                 Process UPDATE failed         NOTIFICATION       5
    9            Process NOTIFICATION            none             5
   10            Close transport connection      none             1
   11            Restart KeepAlive timer       KEEPALIVE          5
   12            Close transport connection    NOTIFICATION       1
   13            Release resources               none             1
   --------------------------------------------------------------------

Now the rule for everything else ๐Ÿ’€. Any state-event combo that isn't in the table is a fatal error. When that happens, the BGP transport connection gets terminated (if necessary) and the FSM transitions to BGP_Idle. Wild, but that's the deal.

If the big table feels like too much, there's a condensed version ๐ŸŒธ. Same info, just squished into a grid where the rows are events and the columns are states:

Events|BGP_Idle BGP_Active BGP_OpenSent BGP_OpenConfirm BGP_Estab
      |  (1)   |    (2)   |     (3)    |      (4)      |      (5)
      |-------------------------------------------------------------
 1    |   2    |          |            |               |
      |        |          |            |               |
 2    |        |     3    |            |               |
      |        |          |            |               |
 3    |        |          |      1     |       1       |
      |        |          |            |               |
 4    |        |     2    |            |               |
      |        |          |            |               |
 5    |        |          |    4 or 1  |               |
      |        |          |            |               |
 6    |        |          |            |       5       |
      |        |          |            |               |
 7    |        |          |            |               |       5
      |        |          |            |               |
 8    |        |          |            |               |       5
      |        |          |            |               |
 9    |        |          |            |               |       5
      |        |          |            |               |
10    |        |          |            |       1       |       1
      |        |          |            |               |
11    |        |          |      3     |       4       |       5
      |        |          |            |               |
12    |        |          |            |               |       1
      |        |          |            |               |
13    |        |     1    |      1     |       1       |       1
      |        |          |            |               |
      --------------------------------------------------------------

References

  • [1] Mills, D., "Exterior Gateway Protocol Formal Specification", RFC 904, BBN, April 1984. ๐Ÿ“š
  • [2] Rekhter, Y., "EGP and Policy Based Routing in the New NSFNET Backbone", RFC 1092, T. J. Watson Research Center, February 1989. ๐Ÿ“š
  • [3] Braun, H-W., "The NSFNET Routing Architecture", RFC 1093, MERIT/NSFNET Project, February 1989. ๐Ÿ“š
  • [4] Postel, J., "Transmission Control Protocol - DARPA Internet Program Protocol Specification", RFC 793, DARPA, September 1981. ๐Ÿ“š
  • [5] Cheriton, D., "VMTP: Versatile Message Transaction Protocol", RFC 1045, Stanford University, February 1988. ๐Ÿ“š

Authors' Addresses ๐Ÿซถ

The two legends who wrote this one ๐ŸŒˆ:

Kirk Lougheed
cisco Systems, Inc.
1360 Willow Road, Suite 201
Menlo Park, CA 94025

Phone: (415) 326-1941

Email: LOUGHEED@MATHOM.CISCO.COM
Jacob Rekhter
T.J. Watson Research Center
IBM Corporation
P.O. Box 218
Yorktown Heights, NY 10598

Phone: (914) 945-3896

Email: YAKOV@IBM.COM
๐Ÿ“ฆ where this page comes from