Protocol 45 of 81Layer 3FrameAssembly v3.3.0
Raw .mdllms-full.txt
bmpBGP Monitoring Protocol v3

bmp — TCP 1790 Real-Time BGP Adj-RIB-In Collector Streams

Default Port / Protocol
TCP 1790
Host Endpoint Rule
Dual-Stack IPv4/IPv6
Wireshark Display Filter
bmp
Standards & Specs
RFC 7854, RFC 8671, RFC 9069
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6BMP v3 (RFC 7854) (TCP 1790)
L2 Tagging: vlan · qinq · repeatable mpls · fcsHost Family: Dual-Stack IPv4/IPv6L3 QoS & TTL: ttl · dscp · ecnL4 State: Auto 4-tuple seq / acknum

What It Does on the Wire

Feed live-looking BGP Adj-RIB-In telemetry into pmacct, GoBMP, or Akvorado over TCP 1790 without touching production peering routers — bmp packs the 42-byte Per-Peer Header and embedded BGP PDUs automatically.

BGP Monitoring Protocol (bmp, TCP 1790, RFC 7854) streams real-time pre-policy and post-policy Adj-RIB-In route updates, peer session state transitions, and prefix-drop counters from core/edge routers to route collectors such as pmacct, GoBMP, OpenBMP, Akvorado, and Kentik. Every BMP frame begins with a 6-byte Common Header (Version = 3, 32-bit Message Length, Message Type 0..6), followed by a 42-byte Per-Peer Header on peer-scoped messages (routemon, statsreport, peerdown, peerup) or Information TLVs on session-scoped messages (initiation, termination).

FrameAssembly tracks TCP port 1790 sequence numbers automatically, formats IPv4-mapped or native 16-byte IPv6 peer addresses inside the 42-byte Per-Peer Header, and embeds valid BGP OPEN / UPDATE frames inside peerup and routemon messages so Wireshark bmp dissects the full hierarchy.

01. Application

pmacct, Akvorado & GoBMP Route-Collector Ingestion Testing

Replay a deterministic initiation -> peerup -> routemon -> statsreport TCP 1790 stream into BGP telemetry collectors in CI without spinning up FRR/BIRD peers.

02. Application

BGP Hijack, Route-Leak & Peer-Flap Alert Validation

Emit peerdown (reason) and routemon frames for specific peerip and 4-byte asn values to test NOC route-anomaly alerting pipelines.

03. Application

Management VRF & Collector Firewall Policy Verification

Verify out-of-band firewall rules allow unidirectional router-initiated TCP 1790 streams from loopback interfaces to central BMP collectors.

Fig. 1 · RFC Octet & Bit Schematic

RFC Wire Header Layout (bmp)

Select any 32-bit wire word or field slice below to inspect which .frasm modifiers control those octets and what defaults the compiler writes.

0 ··············· 15 · 16 ··············· 31 bit
Selected Wire Segment
BMP v3 (RFC 7854) Wire PDU & Payload (Variable)
Controlling .frasm Modifiers
bmp routemon · version · peertype · peerip · sysname · payload · hexpayload
Compiler Default Behavior
RFC-compliant BMP v3 (RFC 7854) defaults (RFC 7854)
Wireshark Dissection Note · Expanding Embedded BGP Updates Inside BMP v3 (TCP 1790)

Filter with bmp on TCP 1790 to inspect the 42-byte Per-Peer Header (Peer Type, Peer IP, 4-byte ASN, BGP ID) and expand nested BGP OPEN / UPDATE messages.

Minimal Quickstart (bmp_quickstart.frasm)

Select Preview Packets to compile in-browser and inspect timestamps + wire byte lengths, or open directly in the Playground.

bmp_quickstart.frasm10 lines
Open in Playground
host edge_rtr { ip 192.0.2.1 }
host bmp_collector { ip 192.0.2.100 }
compile {
edge_rtr -> bmp_collector tcp syn srcport 51790 dstport 1790 win 65535 mss 1460 wait 1ms
edge_rtr <- bmp_collector tcp syn ack win 65535 mss 1460 wait 1ms
edge_rtr -> bmp_collector tcp ack wait 1ms
edge_rtr -> bmp_collector bmp initiation sysname "edge-rtr-01" sysdesc "FRRouting 10.1" wait 2ms
edge_rtr -> bmp_collector bmp peerup peerip 198.51.100.2 asn 64512 bgpid 198.51.100.2
}

Handled Automatically on the Wire

  • Defaults to stateful TCP dstport 1790 and computes the 32-bit big-endian BMP Message Length across the 6-byte Common Header, 42-byte Per-Peer Header, and embedded BGP PDU or TLVs.
  • Sets the V flag (0x80) automatically in the Per-Peer Header when peerip is an IPv6 address, or encodes an IPv4 address in the lower 4 bytes of the 16-byte Peer Address field.
  • Populates Type 1 (sysDescr) and Type 2 (sysName) Information TLVs on initiation frames and embeds valid RFC 4271 BGP framing inside peerup and routemon.
Multi-Frame Example

Full BMP v3 Telemetry Export: Initiation, eBGP Peer-Up, Route Monitoring & Peer-Down

Models a border router opening a TCP 1790 session to an OpenBMP/pmacct collector, reporting initiation metadata, bringing up eBGP peer AS 65100, exporting a routemon RIB update plus statsreport, and logging a peerdown event.

bmp_collector_stream.frasm16 lines
Open in Playground
host border_pe { ip 10.250.0.11 }
host pmacct_rx { ip 10.250.0.90 }
compile {
// 1. Router initiates TCP 1790 connection to BMP collector
border_pe -> pmacct_rx tcp syn srcport 53790 dstport 1790 win 65535 mss 1460 wait 1ms
border_pe <- pmacct_rx tcp syn ack win 65535 mss 1460 wait 1ms
border_pe -> pmacct_rx tcp ack wait 1ms
// 2. Session Initiation TLVs (sysName + sysDescr)
border_pe -> pmacct_rx bmp initiation sysname "border-pe-fra01" sysdesc "Arista EOS 4.32" wait 2ms
// 3. Per-peer telemetry: Peer Up -> Route Monitoring -> Stats Report -> Peer Down
border_pe -> pmacct_rx bmp peerup peertype 0 peerip 203.0.113.9 asn 65100 bgpid 203.0.113.9 wait 2ms
border_pe -> pmacct_rx bmp routemon peertype 0 flags 0x00 peerip 203.0.113.9 asn 65100 bgpid 203.0.113.9 wait 2ms
border_pe -> pmacct_rx bmp statsreport peerip 203.0.113.9 asn 65100 bgpid 203.0.113.9 wait 5ms
border_pe -> pmacct_rx bmp peerdown peerip 203.0.113.9 asn 65100 bgpid 203.0.113.9 reason 1
}
Terminal Commands (FrameAssembly CLI v3.3.0)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show bmp_collector_stream.frasm

# 2. Compile .frasm -> classic .pcap, nanosecond .pcapng, or pipe via '-'
frameassembly bmp_collector_stream.frasm bmp_collector_stream.pcap
frameassembly bmp_collector_stream.frasm bmp_collector_stream.pcapng

# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse bmp_collector_stream.pcap bmp_collector_stream_edited.frasm

# 4. Verify dissected protocol fields in tshark
tshark -r bmp_collector_stream.pcap -Y "bmp"

All bmp Keywords & Header Options

Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after bmp:

src_host -> dst_host bmp [routemon | statsreport | peerdown | peerup | initiation | termination] [version <0..255>] [peertype <0..255>] [flags <0..255>] [peerip <ip>] [asn <number>] [bgpid <ipv4>] [sysname "<text>"] [sysdesc "<text>"] [reason <0..65535>]
Keyword / OptionAccepted ValueDefaultEffect on Packet
routemon | statsreport | peerdown | peerup | initiation | terminationBMP v3 message type keywordinitiation (Type 4) or routemon (Type 0)Selects RFC 7854 Message Type (0=Route Monitoring, 1=Stats Report, 2=Peer Down, 3=Peer Up, 4=Initiation, 5=Termination).
version <0..255>8-bit BMP protocol version3 (RFC 7854)Writes byte 0 of the 6-byte BMP Common Header (3 for standard BMPv3).
peertype <0..255> | flags <0..255>Per-Peer Header Type & Flagspeertype 0 (Global), flags auto (0x80 if IPv6 peerip)peertype selects Global (0), RD Instance (1), Local (2), or Loc-RIB (3); flags sets V/L/A bits (0x40 = Post-Policy).
peerip <ip> | asn <number> | bgpid <ipv4>Monitored BGP neighbor IP, 32-bit ASN & 4-byte BGP ID192.0.2.2, asn 65001, bgpid 192.0.2.2Populates the 16-byte Peer Address, 4-byte Peer AS, and 4-byte Peer BGP ID inside the 42-byte Per-Peer Header.
sysname "<text>" | sysdesc "<text>"Quoted UTF-8 strings"router", "FrameAssembly BMP"Encodes Information TLV Type 2 (sysName) and Type 1 (sysDescr) on initiation frames.
reason <0..65535>Reason code on peerdown or termination1Sets the Peer Down Reason byte (1..5) on peerdown or 16-bit Termination Reason TLV on termination.

Cross-Layer Wrappers Valid with bmp

802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol

14 options
OptionRange / FormatDefaultEffect on Packet
wait <number><ns|us|ms|s|m>Time gap (ns, us, ms, s, m)10msAdvances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back).
comment "<text>"Quoted UTF-8 annotationOmittedAttaches an Enhanced Packet Block opt_comment annotation when compiling to .pcapng (Wireshark pkt_comment filter).
payload "<text>" | hexpayload "<hex>"Quoted text or hex bytes (choose one)OmittedAppends or overrides raw payload bytes ("deadbeef", "de:ad:be:ef", or "\x01\x02") and updates packet lengths and checksums.
srcmac <mac> | dstmac <mac> | ethertype <0..65535>Colon/hyphen/Cisco MAC · EtherType 0..65535 (e.g. 0x0800)Host MAC / RFC multicast MAC / auto EtherTypeOverrides the 14-byte Ethernet II source MAC, destination MAC, or standalone Layer 2 16-bit EtherType.
fcs | badfcsEthernet CRC-32 trailer flags (choose one)Omittedfcs appends a valid IEEE 802.3 4-byte CRC-32 Frame Check Sequence trailer; badfcs XOR-corrupts the CRC-32 for NIC/tap negative tests.
vlan <0..4095> [pcp <0..7>] [dei <0|1>]VLAN ID 0..4095, PCP 0..7, DEI 0..1UntaggedWraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority.
qinq <0..4095> [innervlan <0..4095>]Outer S-VLAN 0..4095, Inner C-VLAN 0..4095Untagged (innervlan 1 when qinq is set)Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100).
mpls <0..1048575> [label <0..1048575>] [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>]Repeatable label stack (0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255)Unlabeled (auto bos=0 on outer labels, bos=1 on bottom)Prepends one or more 32-bit MPLS label shims (0x8847, e.g. mpls 16000 mpls 24010) ahead of Layer 2 EoMPLS or Layer 3 payloads.
ttl <0..255> [dscp <0..63>] [ecn <0..3>]TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3ttl 64, dscp 0, ecn 0Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings.
ipid <0..65535> [df] [mf] [fragoffset <0..8191>] [routeralert] [badipchecksum]IPv4 ID, DF/MF flags, offset 0..8191, Router Alert & checksum faultipid 1, flags 0, fragoffset 0, valid RFC 1071 checksumSets IPv4 Identification/fragmentation, injects RFC 2113 Router Alert (20 04 00 00), or corrupts the 16-bit IPv4 header checksum (badipchecksum).
flowlabel <0..1048575>20-bit IPv6 Flow Label (0..1048575)0Sets the 20-bit IPv6 Flow Label for ECMP routing tests (valid on IPv6 endpoint pairs only).
srcport <0..65535> | dstport <0..65535>Port number 0..65535srcport 49152 (remembered), TCP 1790Overrides source or destination port and remembers the port pair automatically on <- replies.
badchecksumL4/ICMP/SCTP checksum fault injection flagValid RFC checksum / CRC-32cDeliberately corrupts the TCP, SCTP CRC-32c, ICMP, or ICMPv6 checksum for negative IDS/firewall testing.
seq <number> | acknum <number> | win|window <0..65535> | urgent <0..65535> | syn | ack | psh | fin | rst | urg | ece | cwrTCP sequence/ack numbers, window, flags, SACK, TCP-MD5 & TFO optionspsh ack, win 65535, automatic TCP seq/acknumOverrides automatic TCP sequence tracking, flags, or RFC 7323/2018/2385/7413 options (mss, wscale, sackperm, sackblock, tsval, tsecr, tcpmd5, tfo).

Gotchas & Quick Fixes

BMP Runs Unidirectionally From Router to Collector Over TCP 1790

Rejected
Expecting BMP request/response queries from the collector
Valid v3.3.0 Syntax
router -> collector bmp initiation sysname "rtr-01"

Per RFC 7854 Section 3.2, the monitored router sends BMP messages unidirectionally; the collector only acknowledges at the TCP layer (tcp syn ack / tcp ack) and never transmits BMP PDUs.

bgpid Is Always a 4-Byte Dotted-Quad Identifier

Rejected
router -> collector bmp peerup peerip 2001:db8::2 bgpid 2001:db8::2
Valid v3.3.0 Syntax
router -> collector bmp peerup peerip 2001:db8::2 bgpid 192.0.2.2

Even when peerip is an IPv6 neighbor (2001:db8::2), RFC 4271 / RFC 6286 BGP Identifiers (bgpid) are always 32-bit dotted-quad values.

Field Guide 05
VLANs, QinQ, MPLS, Tunnel Soup & Dual-Stack IPv6