wire / wire-format / bgp-message

BGP (Border Gateway Protocol) 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.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: BGP (Border Gateway Protocol) message

wire format

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.

fieldsizemeaning
Marker16 bytesAll 0xFF (authentication, or just a marker in modern BGP).
Length2 bytes (uint16)Total message length including header (19-4096 bytes).
Type1 byte1 OPEN, 2 UPDATE, 3 NOTIFICATION, 4 KEEPALIVE.
OPEN bodyvariableVersion (1), My Autonomous System (2/4 bytes), Hold Time (2), BGP Identifier (4), Optional Parameters (variable: type, length, value).
UPDATE bodyvariableWithdrawn Routes Length (2) + Withdrawn Routes (variable) + Total Path Attribute Length (2) + Path Attributes (variable) + NLRI (variable).
NOTIFICATION bodyvariableError Code (1), Error Subcode (1), Data (variable).
KEEPALIVE body0 bytesNo 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)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/bgp-message or /wire-format/bgp-message.json