BGP Message Formats

 

BGP messages are carried within TCP segments using TCP port 179. The maximum message size is 4096 octets, and the minimum size is 19 octets. All BGP messages have a common header (see Figure 2-43). Depending on the message type, a data portion might or might not follow the header.

Figure 2-43. The BGP Message Header

graphics/02fig43.gif

Marker is a 16-octet field that is used to detect loss of synchronization between BGP peers and to authenticate messages when authentication is supported. If the message type is Open or if the Open message contains no authentication information, the Marker field is set to all 1s. Otherwise, the value of the marker can be predicted by some computation as part of the authentication process.

Length is a 0-octet field that indicates the total length of the message, including the header, in octets.

Type is a 0-octet field specifying the message type. Table 2-6 indicates the possible type codes.

Table 2-6. BGP Type Codes
Code Type
1 Open
2 Update
3 Notification
4 Keepalive

The Open Message

The Open message, whose format is shown in Figure 2-44, is the first message sent after a TCP connection has been established. If a received Open message is acceptable, a Keepalive message is sent to confirm the Open. After the Open has been confirmed, the BGP connection is in the Established state and Update, Keepalive, and Notification messages can be sent.

Figure 2-44. The BGP Open Message Format

graphics/02fig44.gif

The BGP Open message contains the following fields:

  • Version ” A 1-octet field specifying the BGP version running on the originator.

  • My Autonomous System ” A 2-octet field specifying the AS number of the originator.

  • Hold Time ” A 2-octet number indicating the number of seconds the sender proposes for the hold time. A receiver compares the value of the Hold Time field and the value of its configured hold time and accepts the smaller value or rejects the connection. The hold time must be either 0 or at least 3 seconds.

  • BGP Identifier ” The router ID of the originator. A Cisco router sets its router ID as either the highest IP address of any of its loopback interfaces or, if no loopback interface is configured, the highest IP address of any of its physical interfaces.

  • Optional Parameters Length ” A 1-octet field indicating the total length of the following Optional Parameters field, in octets. If the value of this field is zero, no Optional Parameters field in included in the message.

  • Optional Parameters ” A variable-length field containing a list of optional parameters. Each parameter is specified by a 1-octet type field, a 1-octet length field, and a variable-length field containing the parameter value.

The Update Message

The Update message, whose format is shown in Figure 2-45, is used to advertise a single feasible route to a peer, or to withdraw multiple unfeasible routes, or both.

Figure 2-45. The BGP Update Message Format

graphics/02fig45.gif

The BGP Update message contains the following fields:

  • Unfeasible Routes Length ” A 2-octet field indicating the total length of the following Withdrawn Routes field, in octets. A value of zero indicates that no routes are being withdrawn and that no Withdrawn Routes field is included in the message.

  • Withdrawn Routes ” A variable-length field containing a list of routes to be withdrawn from service. Each route in the list is described with a (Length, Prefix) tuple in which the Length is the length of the prefix and the Prefix is the IP address prefix of the withdrawn route. If the Length part of the tuple is zero, the Prefix matches all routes.

  • Total Path Attribute Length ” A 2-octet field indicating the total length of the following Path Attribute field, in octets. A value of zero indicates that attributes and NLRI are not included in this message.

  • Path Attributes ” A variable-length field listing the attributes associated with the NLRI in the following field. Each path attribute is a variable-length triple of (Attribute Type, Attribute Length, Attribute Value). The Attribute Type part of the triple is a 2-octet field consisting of four flag bits, four unused bits, and an Attribute Type code (see Figure 2-46).

    Figure 2-46. The Attribute Type Part of the Path Attributes Field

    graphics/02fig46.gif

  • Network Layer Reachability Information ” A variable-length field containing a list of (Length, Prefix) tuples. The Length indicates the length in bits of the following prefix, and the Prefix is the IP address prefix of the NLRI. A Length value of zero indicates a prefix that matches all IP addresses.

Table 2-7 shows the most common Attribute Type codes and the possible Attribute Values for each Attribute Type.

Table 2-7. Attribute Types and Associated Attribute Values [*]
Attribute Type Code Attribute Type Attribute Value Code Attribute Value
1 ORIGIN IGP
1 EGP
2 Incomplete
2 AS_PATH 1 AS_SET
2 AS_SEQUENCE
3 AS_CONFED_SET
4 AS_CONFED_SEQUENCE
3 NEXT_HOP Next-hop IP address
4 MULTI_EXIT_DISC 4-octet MED
5 LOCAL_PREF 4-octet LOCAL_PREF
6 ATOMIC_AGGREGATE None
7 AGGREGATOR AS number and IP address of aggregator
8 COMMUNITY 4-octet community identifier
9 ORIGINATOR_ID 4-octet router ID of originator
10 CLUSTER_LIST Variable-length list of cluster IDs

[*] Other attribute types exist, but they are proprietary to non-Cisco vendors and are therefore beyond the scope of this book.

The Keepalive Message

Keepalive messages are exchanged on a period one-third the hold time, but not less than 1 second. If the negotiated hold time is 0, Keepalives are not sent.

The Keepalive message consists of only the 19-octet BGP message header, with no additional data.

The Notification Message

Notification messages, whose format is shown in Figure 2-47, are sent when an error condition is detected . The BGP connection is closed immediately after the message is sent.

Figure 2-47. The BGP Notification Message Format

graphics/02fig47.gif

The BGP Notification message contains the following fields:

  • Error Code ” A 1-octet field indicating the type of error.

  • Error Subcode ” A 1-octet field providing more-specific information about the error. Table 2-8 shows the possible error codes and associated error subcodes.

  • Data ” A variable-length field used to diagnose the reason for the error. The contents of the Data field depend on the error code and subcode.

Table 2-8. BGP Notification Message Error Codes and Error Subcodes
Error Code Error Error Subcode Subcode Detail
1 Message Header Error 1 Connection not synchronized
2 Bad message length
3 Bad message type
2 Open Message Error 1 Unsupported version number
2 Bad peer AS
3 Bad BGP identifier
4 Unsupported optional parameter
5 Authentication failure
6 Unacceptable hold time
3 Update Message Error 1 Malformed attribute list
2 Unrecognized well-known attribute
3 Missing well-known attribute
4 Attribute flags error
5 Attribute length error
6 Invalid ORIGIN attribute
7 AS routing loop
8 Invalid NEXT_HOP attribute
9 Optional attribute error
10 Invalid network field
11 Malformed AS_PATH
4 Hold Timer Expired
5 Finite State Machine Error
6 Cease


Routing TCP[s]IP (Vol. 22001)
Routing TCP[s]IP (Vol. 22001)
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 182

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net