wire / wire-format / bgp-message
BGP is the routing protocol of the Internet. BGP messages are carried over TCP (port 179). Four message types: OPEN (1), UPDATE (2), NOTIFICATION (3), KEEPALIVE (4). All BGP messages: 16-byte marker (all 0xFF), 2-byte length, 1-byte type.
aka: BGP (Border Gateway Protocol) message
spec: RFC 4271
BGP is the routing protocol of the Internet. BGP messages are carried over TCP (port 179). Four message types: OPEN (1), UPDATE (2), NOTIFICATION (3), KEEPALIVE (4). All BGP messages: 16-byte marker (all 0xFF), 2-byte length, 1-byte type.
| field | size | meaning |
|---|---|---|
| Marker | 16 bytes | All 0xFF (authentication, or just a marker in modern BGP). |
| Length | 2 bytes (uint16) | Total message length including header (19-4096 bytes). |
| Type | 1 byte | 1 OPEN, 2 UPDATE, 3 NOTIFICATION, 4 KEEPALIVE. |
| OPEN body | variable | Version (1), My Autonomous System (2/4 bytes), Hold Time (2), BGP Identifier (4), Optional Parameters (variable: type, length, value). |
| UPDATE body | variable | Withdrawn Routes Length (2) + Withdrawn Routes (variable) + Total Path Attribute Length (2) + Path Attributes (variable) + NLRI (variable). |
| NOTIFICATION body | variable | Error Code (1), Error Subcode (1), Data (variable). |
| KEEPALIVE body | 0 bytes | No body (length = 19). |
example:
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 13 04
BGP KEEPALIVE message (length 19, type 4)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/bgp-message
or /wire-format/bgp-message.json