Octet

What message types does BGP use, and what is in the OPEN message?

Show the answer

Say this first

Five types. OPEN (1) starts the session and carries the version, my AS, hold time, BGP identifier (router ID) and capabilities. UPDATE (2) advertises and withdraws routes. NOTIFICATION (3) reports an error and closes the session. KEEPALIVE (4) proves the peer is alive and confirms the OPEN. ROUTE-REFRESH (5, RFC 2918) asks the peer to send its routes again.

Go deeper

OPEN

  • Version 4. My AS: 2 bytes; a 4-byte ASN puts AS_TRANS (23456) here and the real ASN in a capability.
  • Hold time: the session uses the lower of the two values; it must be 0 or at least 3 seconds.
  • BGP identifier: the router ID. The two peers must have different IDs.
  • Capabilities: multiprotocol address families, route refresh, 4-byte AS, graceful restart, add-path. Adding a new address family later means new capabilities, which on most platforms resets the session.

UPDATE

One UPDATE carries withdrawn prefixes, one set of path attributes, and the prefixes (NLRI) that share those attributes. IPv6 and VPN routes travel inside the MP_REACH_NLRI and MP_UNREACH_NLRI attributes.

NOTIFICATION codes you will meet

Code/subcodeMeaningUsual cause
2/2OPEN error: bad peer ASremote-as wrong on one side
2/3OPEN error: bad BGP identifierDuplicate router ID
4/0Hold timer expiredLost keepalives: link, CPU or MTU problem
6/1Cease: maximum prefixes reachedmaximum-prefix tripped
6/2Cease: administrative shutdownneighbor x shutdown on the peer
6/4Cease: administrative resetclear ip bgp on the peer

A wrong AS shows up in the log like this; the two bytes are the AS the peer sent, in hex (FBF0 is 64496):

Output
%BGP-3-NOTIFICATION: sent to neighbor 192.0.2.1 2/2 (peer in wrong AS) 2 bytes FBF0

KEEPALIVE

Only the 19-byte header. Cisco sends one every 60 seconds by default.

Traps

  • Saying keepalives carry routes, or that BGP refreshes its whole table periodically.
How did you do?Book 4.1 Global Internet