8.2 Basic BGP Operation
8.2.3 BGP message types
Different message types play an essential role in BGP operation. Each message type includes the BGP message header.

The message header contains only three fields: a 16-byte Marker field, a 2-byte Length field, and a 1-byte Type field. The Marker field is used either to authenticate incoming BGP messages or to detect loss of synchronization between two BGP peers.

The Length field indicates the total BGP message length, including the header. The smallest BGP message is 19 bytes (16 + 2 + 1), and the largest possible message is 4096 bytes.

The Type field can have four values (1 to 4). Each of these values corresponds to one of the four BGP message types, described below:

  • Open Message - This message is used to establish connections with peers and includes fields for the BGP version number; AS number, hold time, and Router ID.
  • Keepalive Message - This message type is sent periodically between peers to maintain connections and verify paths held by the router sending the keepalive. If the periodic timer is set to a value of 0, no keepalives are sent. The recommended keepalive interval is one-third of the hold time interval. The keepalive message is a 19-byte BGP message header with no data following it.
  • Notification Message - This message type is used to inform the receiving router of errors. This message includes a field for error codes , which can be used to troubleshoot BGP connections.
  • Update Message - The update messages contain all the information BGP uses to construct a loop-free picture of the internetwork. There are three basic components of an update message: network-layer reachability information (NLRI), path attributes, and withdrawn routes. These three elements are described briefly in the following sections.