Protocol 46 of 81Layer 3FrameAssembly v3.3.0
Raw .mdllms-full.txt
rpkirtrRPKI-Router Origin Validation Protocol

rpkirtr — TCP 323 RPKI Route Origin Validation ROA Cache Sync

Default Port / Protocol
TCP 323
Host Endpoint Rule
Dual-Stack IPv4/IPv6
Wireshark Display Filter
rpki-rtr
Standards & Specs
RFC 6810, RFC 8210
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6RPKI-RTR (TCP 323) (TCP 323)
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

Stop fat-fingered BGP route leaks at the border: rpkirtr streams RFC 8210 ipv4prefix and ipv6prefix Validated ROA Payloads (prefix, maxlen, asn) over TCP 323 just like Routinator.

RPKI-Router Protocol (rpkirtr, TCP 323, RFC 6810 v0 / RFC 8210 v1) delivers cryptographically validated Route Origin Authorization (ROA) prefix-to-ASN bindings (Validated ROA Payloads, VRPs) from local RPKI relying-party caches (Routinator, Cloudflare OctoRPKI, Fort, stayrtr) to border BGP routers performing Route Origin Validation (ROV). Routers send resetquery or serialquery PDUs, and the cache streams back cacheresponse, ipv4prefix / ipv6prefix announcements or withdrawals (prefix, maxlen, asn), and endofdata.

FrameAssembly builds exact binary RFC 8210 v1 (default) or RFC 6810 v0 PDUs—including 20-byte IPv4 Prefix PDUs, 32-byte IPv6 Prefix PDUs, 24-byte v1 End of Data timing headers (refresh, retry, expire), and structured errorreport diagnostics—over stateful TCP port 323.

01. Application

BGP Route Origin Validation (ROV) Invalid-Prefix Lab Testing

Stream ipv4prefix and ipv6prefix VRPs (prefix, maxlen, asn) followed by endofdata to test router ROV route-maps (valid, invalid, not-found) and Wireshark rpki-rtr dissection.

02. Application

Routinator / StayRTR Peering LAN & Management VRF Firewall Audits

Verify ACLs between peering-edge routers and RPKI validator clusters permit stateful TCP 323 (and optional tcpmd5 authentication).

03. Application

Incremental Serial Sync, Withdrawals & Cache Error Handling

Reproduce serialnotify -> serialquery delta syncs (withdraw flag 0), cachereset, and errorreport (errcode, errmsg) edge cases.

Fig. 1 · RFC Octet & Bit Schematic

RFC Wire Header Layout (rpkirtr)

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
RPKI-RTR (TCP 323) Wire PDU & Payload (Variable)
Controlling .frasm Modifiers
rpkirtr serialnotify · version · sessionid · announce · prefix · payload · hexpayload
Compiler Default Behavior
RFC-compliant RPKI-RTR (TCP 323) defaults (RFC 6810)
Wireshark Dissection Note · Verifying RPKI-RTR v1 Validated ROA Payloads on TCP 323

Filter with rpki-rtr on TCP 323 to inspect Serial/Reset Queries, IPv4/IPv6 Prefix VRPs (Prefix Length, Max Length, Origin ASN), and End-of-Data refresh/retry/expire intervals.

Minimal Quickstart (rpkirtr_quickstart.frasm)

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

rpkirtr_quickstart.frasm9 lines
Open in Playground
host edge_bgp { ip 192.0.2.10 }
host routinator { ip 192.0.2.53 }
compile {
edge_bgp -> routinator rpkirtr resetquery version 1 wait 1ms
edge_bgp <- routinator rpkirtr cacheresponse version 1 sessionid 42 wait 1ms
edge_bgp <- routinator rpkirtr ipv4prefix version 1 announce prefix "203.0.113.0/24" maxlen 24 asn 64500 wait 1ms
edge_bgp <- routinator rpkirtr endofdata version 1 sessionid 42 serial 100 refresh 3600 retry 600 expire 7200
}

Handled Automatically on the Wire

  • Defaults to stateful TCP dstport 323 and RFC 8210 version 1 (including the 12 extra refresh/retry/expire interval bytes on v1 endofdata vs 12-byte v0 endofdata).
  • Parses prefix "<cidr>" ("203.0.113.0/24" or "2001:db8::/32") into Prefix Length, Max Length (defaults to prefix_len if maxlen is omitted), and binary IPv4 (4B) or IPv6 (16B) octets.
  • Sets Flags byte 1 for announce (default) or 0 for withdraw on ipv4prefix and ipv6prefix PDUs.
Multi-Frame Example

Full RFC 8210 RPKI-RTR v1 Bootstrap & Incremental ROA Withdrawal Cycle

Models a border router establishing TCP 323 with a Routinator cache, executing a resetquery full table sync (IPv4 + IPv6 VRPs + endofdata), and later receiving a serialnotify incremental ROA withdraw.

rpkirtr_roa_sync.frasm21 lines
Open in Playground
host peering_rtr { ip 10.30.0.1 }
host rpki_cache { ip 10.30.0.20 }
compile {
// 1. TCP 323 handshake between BGP router and Routinator validator
peering_rtr -> rpki_cache tcp syn srcport 52323 dstport 323 win 65535 mss 1460 wait 1ms
peering_rtr <- rpki_cache tcp syn ack win 65535 mss 1460 wait 1ms
peering_rtr -> rpki_cache tcp ack wait 1ms
// 2. Initial Reset Query -> Cache Response + IPv4/IPv6 VRPs + End of Data (serial 500)
peering_rtr -> rpki_cache rpkirtr resetquery version 1 wait 1ms
peering_rtr <- rpki_cache rpkirtr cacheresponse version 1 sessionid 7 wait 1ms
peering_rtr <- rpki_cache rpkirtr ipv4prefix version 1 announce prefix "198.51.100.0/24" maxlen 24 asn 65010 wait 1ms
peering_rtr <- rpki_cache rpkirtr ipv6prefix version 1 announce prefix "2001:db8:40::/48" maxlen 48 asn 65010 wait 1ms
peering_rtr <- rpki_cache rpkirtr endofdata version 1 sessionid 7 serial 500 refresh 1800 retry 600 expire 7200 wait 5ms
// 3. Cache bumps serial to 501 and withdraws stale ROA
peering_rtr <- rpki_cache rpkirtr serialnotify version 1 sessionid 7 serial 501 wait 1ms
peering_rtr -> rpki_cache rpkirtr serialquery version 1 sessionid 7 serial 500 wait 1ms
peering_rtr <- rpki_cache rpkirtr cacheresponse version 1 sessionid 7 wait 1ms
peering_rtr <- rpki_cache rpkirtr ipv4prefix version 1 withdraw prefix "198.51.100.0/24" maxlen 24 asn 65010 wait 1ms
peering_rtr <- rpki_cache rpkirtr endofdata version 1 sessionid 7 serial 501 refresh 1800 retry 600 expire 7200
}
Terminal Commands (FrameAssembly CLI v3.3.0)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show rpkirtr_roa_sync.frasm

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

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

# 4. Verify dissected protocol fields in tshark
tshark -r rpkirtr_roa_sync.pcap -Y "rpki-rtr"

All rpkirtr 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 rpkirtr:

src_host -> dst_host rpkirtr [serialnotify | serialquery | resetquery | cacheresponse | ipv4prefix | ipv6prefix | endofdata | cachereset | errorreport] [version <0|1>] [sessionid <0..65535>] [serial <number>] [announce | withdraw | flags <0..255>] [prefix "<cidr>"] [maxlen <0..255>] [asn <number>] [refresh <number>] [retry <number>] [expire <number>] [errcode <0..65535>] [errmsg "<text>"]
Keyword / OptionAccepted ValueDefaultEffect on Packet
serialnotify | serialquery | resetquery | cacheresponse | ipv4prefix | ipv6prefix | endofdata | cachereset | errorreportRPKI-RTR PDU type keywordipv4prefix (Type 4)Selects PDU Type (0=Serial Notify, 1=Serial Query, 2=Reset Query, 3=Cache Response, 4=IPv4 Prefix, 6=IPv6 Prefix, 7=End of Data, 8=Cache Reset, 10=Error Report).
version <0|1>Protocol version (0 = RFC 6810, 1 = RFC 8210)1 (RFC 8210)Sets Protocol Version in byte 0 (1 adds refresh, retry, and expire timers to endofdata).
sessionid <0..65535> | serial <number>16-bit Cache Session ID & 32-bit Serial Numbersessionid 1, serial 1Tracks cache epoch (sessionid) and monotonic serial state across serialnotify, serialquery, cacheresponse, and endofdata.
announce | withdraw | flags <0..255>ROA announcement flag (1) or withdrawal (0)announce (flags 1)Sets the Flags byte in ipv4prefix / ipv6prefix PDUs (1 announce VRP, 0 withdraw VRP).
prefix "<cidr>" | maxlen <0..128> | asn <number>Quoted IPv4/IPv6 CIDR, Max Length & 32-bit Origin ASN"192.0.2.0/24", maxlen = prefix_len, asn 65001Writes the Prefix Length, Max Length, IPv4/IPv6 prefix bytes, and 4-byte Origin AS Number.
refresh <number> | retry <number> | expire <number>32-bit intervals in seconds (v1 endofdata)refresh 3600, retry 600, expire 7200Populates the three RFC 8210 timing parameters at the end of version 1 endofdata PDUs.
errcode <0..65535> | errmsg "<text>"16-bit error code & UTF-8 diagnostic texterrcode 0, ""Populates Error Code (0..8) and length-prefixed UTF-8 Error Text inside errorreport (Type 10) PDUs.

Cross-Layer Wrappers Valid with rpkirtr

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 323Overrides 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

Match ipv4prefix vs ipv6prefix to Your CIDR Address Family

Rejected
rtr <- cache rpkirtr ipv4prefix prefix "2001:db8::/32" maxlen 48 asn 65001
Valid v3.3.0 Syntax
rtr <- cache rpkirtr ipv6prefix prefix "2001:db8::/32" maxlen 48 asn 65001

ipv4prefix (PDU Type 4, 20 bytes) carries a 4-byte IPv4 prefix, whereas ipv6prefix (PDU Type 6, 32 bytes) carries a 16-byte IPv6 prefix.

Keep maxlen >= CIDR Prefix Length

Rejected
rtr <- cache rpkirtr ipv4prefix prefix "203.0.113.0/24" maxlen 16 asn 64500
Valid v3.3.0 Syntax
rtr <- cache rpkirtr ipv4prefix prefix "203.0.113.0/24" maxlen 24 asn 64500

Per RFC 8210 Section 5.6, Max-Length must be greater than or equal to Prefix-Length (<= 32 for IPv4, <= 128 for IPv6) or routers reject the VRP as corrupt.

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