BGP4 Message Types

BGP4 messages can be of the following types: OPEN, UPDATE, NOTIFICATION, KEEPALIVE, or ROUTE-REFRESH.

All BGP4 messages use a common packet header, with the following byte lengths:
Marker Length Type Data
16 2 1 variable
Note

Note

All values in the following tables are in bytes.

OPEN message

After establishing TCP connection, BGP peers exchange OPEN message to identify each other.

Version Autonomous System Hold-Time BGP Identifier Optional Parameter Len Optional Parameters
1 2 or 4 2 4 1 4
Version
Only BGP4 version 4 is supported.
Autonomous System
Both 2-byte and 4-byte autonomous system numbers are supported.
KEEPALIVE and HOLDTIME timers
A BGP timer command specifies both keep-alive and hold-time operands that manage the intervals for BGP KEEPALIVE and HOLDTIME messages. The keep-alive time specifies how frequently the device sends KEEPALIVE messages to its BGP4 neighbors. The hold-time specifies how long the device waits for a KEEPALIVE or UPDATE message from a neighbor before concluding that the neighbor is dead. When two neighbors have different hold-times, the lowest value is used. A hold-time of 0 means "always consider neighbor to be active."
BGP Identifier
Indicates the router (or device) ID of the sender. When a router-id is not configured, the device-id is taken from the loopback interface. Otherwise, the lowest IP address in the system is used.
Parameter List
An optional list of additional parameters used in peer negotiation.

UPDATE message

The UPDATE message advertises new routes, withdraws previously advertised routes, or both. The UPDATE message passes BGP4 attributes to describe the characteristics of a BGP path by the advertising device.

Withdrawn Routes Length Withdrawn Routes Total Path Attributes Len Path Attributes NLRI
2 variable 2 variable variable
Withdrawn Routes Length
Indicates the length of the next (withdrawn routes) field. It can be 0.
Withdrawn Routes
Contains a list of routes (or IP-prefix/Length) to indicate routes being withdrawn.
Total Path Attribute Len
Indicates the length of the next (path attributes) field. It can be 0.
Path Attributes
Indicates characteristics of the advertised path. Possible attributes: Origin, AS Path, Next Hop, MED (Multi-Exit Discriminator), Local Preference, Atomic Aggregate, Aggregator, Community, extended-Communities. All well-known attributes, as described in RFC 4271, are supported.
NLRI
Network Layer Reachability Information. The set of destinations whose addresses are represented by one prefix. This field contains a list of IP address prefixes for the advertised routes.

NOTIFICATION message

If an error causes the TCP connection to close, the closing peer sends a notification message to indicate the type of error.

Error Code Error Subcode Error Data
1 1 variable
Error Code
Indicates the type of error, which can be one of following:
  • Message header error
  • Open message error
  • Update message error
  • Hold timer expired
  • Finite state-machine error
  • Cease (voluntarily)
Error Subcode
Provides specific information about the reported error.
Error Data
Provides data based on the error code and the subcode.

KEEPALIVE message

Because BGP does not regularly exchanges route updates to maintain a session, KEEPALIVE messages are sent to keep the session alive. The KEEPALIVE time specifies how frequently the device sends KEEPALIVE messages to its BGP4 neighbors.

A KEEPALIVE message contains the BGP header without a data field. The default KEEPALIVE time is 60 seconds and is configurable.

REFRESH message

A REFRESH message is sent to a neighbor requesting that the neighbor resend the route updates. This message is useful when the inbound policy has been changed.