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/subcode | Meaning | Usual cause |
|---|---|---|
| 2/2 | OPEN error: bad peer AS | remote-as wrong on one side |
| 2/3 | OPEN error: bad BGP identifier | Duplicate router ID |
| 4/0 | Hold timer expired | Lost keepalives: link, CPU or MTU problem |
| 6/1 | Cease: maximum prefixes reached | maximum-prefix tripped |
| 6/2 | Cease: administrative shutdown | neighbor x shutdown on the peer |
| 6/4 | Cease: administrative reset | clear 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):
%BGP-3-NOTIFICATION: sent to neighbor 192.0.2.1 2/2 (peer in wrong AS) 2 bytes FBF0KEEPALIVE
Only the 19-byte header. Cisco sends one every 60 seconds by default.
They will ask next
Are BGP updates periodic like RIP?
No. After the initial exchange BGP sends UPDATEs only when something changes. Keepalives are the only periodic messages.
Traps
- Saying keepalives carry routes, or that BGP refreshes its whole table periodically.