12.7 BGP Message Types

There are four main message types that BGP uses to establish and maintain BGP neighbors:

  • OPEN– The first message sent between peers immediately after TCP 3-Way handshake has completed. It includes transmission of the full routing table.
  • KEEPALIVE – Confirms the receipt of OPEN messages, where this process must be completed by both peers before any UPDATE messages (etc.) can take place. It also persists the connection when a peer relationship is formed, sent often enough to ensure the hold-timer does not expire. The KEEPALIVE message does not contain any data, it only uses the BGP packet header for transmission.
  • UPDATE – Is used to provide routing updates to other systems. TCP is used for reliability, and UPDATE messages can simultaneously withdraw routes and advertise new routes in any given message. Advertisement is incremental, not full routing table.
  • NOTIFICATION – Is sent when an error or special condition is detected. Closes an active BGP session and inform routes of why the session is being closed.

A BGP packet header has the following fields.

  • The Marker [16 bytes] contains an authentication value that the message receiver can predict
  • The Length [2 bytes] specifies the size of the message, in bytes
  • The Type [1 byte] indicates one of the four previously discussed message types
  • The Data [variable] is an optional field that can contain upper layer information

A BGP OPEN message contains the following fields.

  • The Version [1 byte] provides the BGP version number so the recipient can determine if it is running a compatible version.
  • The Autonomous System [2 bytes] provides the ASN of the sender
  • The Hold-Time [2 bytes] specifies the amount of time the sender will wait for a message before declaring the peer dead. If hold-time is zero, keepalives are not sent.
  • The BGP Identifier [4 bytes] provides the ID of the sender, which is an IPv4 address
  • The Optional Parameters Length [1 byte] indicates the length of any optional parameters, if applicable
  • The Optional Parameters [4 bytes] specifies any optional parameters if they exist. An example is session authentication.

The BGP KEEPALIVE message uses the BGP Packet Header with the Type field specifying KEEPALIVE. It does not contain any additional data.

The BGP UPDATE message contains the following fields.

  • The Unfeasible Routes Length [2 bytes] specifies the length of the Withdrawn Routes field, or that it is not present in the message
  • The Withdrawn Routes [variable] contains a list of IP prefixes being withdrawn from service
  • The Total Path Attribute Length [2 bytes] specifies the length of the Path Attributes field, or that it is not present in the message
  • The Path Attributes [variable] describes the characteristics of the advertised path, such as AS Path, Local Pref, etc.
  • The Network Layer Reachability Information [variable] contains a list of IP address prefixes that are reachable by this path.

The BGP NOTIFICATION message contains the following fields.

  • The Error Code [1 byte] indicates the type of error present
  • The Error Subcode [1 byte] indicates more detailed information about the specific error code
  • The Error Data [variable] contains data about the error code and subcode fields. This field diagnoses the reason for the notification message.