Protocol 97 of 81Layer 7FrameAssembly v3.3.0
Raw .mdllms-full.txt
rocev2RDMA over Converged Ethernet v2 (InfiniBand Annex A17)

rocev2 — UDP 4791 InfiniBand BTH/RETH/AETH & Variant ICRC-32

Default Port / Protocol
UDP 4791
Host Endpoint Rule
Dual-Stack IPv4/IPv6
Wireshark Display Filter
infiniband
Standards & Specs
IBTA RoCEv2 Annex A17, InfiniBand Arch Vol 1
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6UDP 4791RoCEv2 (InfiniBand BTH)
L2 Tagging: vlan · qinq · repeatable mpls · fcsHost Family: Dual-Stack IPv4/IPv6L3 QoS & TTL: ttl · dscp · ecnL4 State: UDP

What It Does on the Wire

AI GPU cluster fabrics live on UDP 4791 paired with dscp 26 + ecn 2 and pfc: rocev2 packs the 12-byte InfiniBand BTH (destqp, seqnum), 16-byte RETH (addr, key, count), and 4-byte Invariant CRC (crc) automatically!

RDMA over Converged Ethernet v2 (rocev2, IBTA Annex A17) powers AI/LLM GPU training fabrics (NCCL collective all-reduce), NVMe-oF/RDMA storage, and ultra-low-latency HPC clusters by encapsulating InfiniBand Base Transport Headers (BTH) inside IPv4/IPv6 + UDP port 4791. Every RoCEv2 packet carries a 12-byte BTH (OpCode, Solicited/Migrate/Pad, Partition Key pkey, 24-bit Destination Queue Pair destqp, Acknowledge Request ackreq, and 24-bit Packet Sequence Number seqnum), optional RETH (64-bit Virtual Address addr, 32-bit R_Key key, 32-bit DMA Length count) or AETH (Syndrome/Status, 24-bit Message SeqNum msgid), payload, and a trailing 4-byte Invariant CRC (ICRC).

FrameAssembly computes the InfiniBand Annex A17 RoCEv2 ICRC (masking mutable IP TTL/DSCP/ECN, UDP checksum, and BTH Resv8a bits to 1s per spec!) automatically and lets you pair rocev2 with dscp 26 ecn 3 (CE) and Layer 2 pfc pause frames for end-to-end DCQCN lossless fabric labs.

01. Application

AI GPU Cluster Lossless Fabric & DCQCN Congestion Notification (ECN + CNP)

Simulate ECN-marked (ecn 3 Congestion Experienced) rocev2 write bursts on dscp 26 (AF31, vlan 100 pcp 3) triggering RoCEv2 Congestion Notification Packets (opcode 0x81 CNP) and pfc pause frames.

02. Application

Zero-Copy RDMA Write / Read Memory Registration (RETH + AETH) Analysis

Inspect 64-bit GPU/host virtual addresses (addr), remote keys (key), DMA byte lengths (count), 24-bit Queue Pairs (destqp), and PSNs (seqnum) in Wireshark (infiniband).

03. Application

DPU / SmartNIC ICRC Offload & Negative Checksum Testing

Verify hardware RoCEv2 parsers accept auto-computed Annex A17 ICRCs and properly drop corrupted packets when an explicit wrong crc 0xdeadbeef is injected.

Fig. 1 · RFC Octet & Bit Schematic

RFC Wire Header Layout (rocev2)

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
RoCEv2 (InfiniBand BTH) Wire PDU & Payload (Variable)
Controlling .frasm Modifiers
rocev2 read · pkey · destqp · ackreq · addr · payload · hexpayload
Compiler Default Behavior
RFC-compliant RoCEv2 (InfiniBand BTH) defaults (IBTA RoCEv2 Annex A17)
Wireshark Dissection Note · Verifying InfiniBand RoCEv2 BTH, RETH & ICRC-32 on UDP 4791

Filter with infiniband on UDP 4791 to expand Base Transport Header (Opcode, Dest QP, AckReq, PSN), RDMA Extended Transport Header (Virtual Address, R_Key, DMA Length), and 4-byte Invariant CRC.

Minimal Quickstart (rocev2_quickstart.frasm)

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

rocev2_quickstart.frasm7 lines
Open in Playground
host gpu_node_01 { ip 10.90.3.11 }
host gpu_node_02 { ip 10.90.3.12 }
compile {
gpu_node_01 -> gpu_node_02 rocev2 write pkey 0xffff destqp 0x000104 ackreq seqnum 1000 addr 0x7f8000100000 key 0xa1b2c3d4 count 4096 dscp 26 ecn 2 payload "NCCL-ALLREDUCE-SHARD" wait 50us
gpu_node_01 <- gpu_node_02 rocev2 opcode "ack" pkey 0xffff destqp 0x000103 seqnum 1000 status 0x00 msgid 1 dscp 26 ecn 2
}

Handled Automatically on the Wire

  • Defaults to UDP destination port 4791 (srcport entropy for ECMP hashing) and writes the 12-byte InfiniBand Base Transport Header (BTH).
  • Attaches the 16-byte RDMA Extended Transport Header (RETH: va, rkey, dma_len) on RC RDMA write (0x0a) / read (0x0c), or the 4-byte AETH (syndrome, msn) on ack (0x11) / Read Responses.
  • Computes the genuine IEEE 802.3 CRC-32 IBTA Annex A17 Invariant CRC (ICRC) over the masked pseudo-IP + UDP + BTH + payload automatically (unless crc is overridden).
Multi-Frame Example

AI Training Cluster DCQCN Loop: ECN-Marked RDMA Write, RoCEv2 CNP (0x81) & RC ACK

Captures a GPU node sending an RDMA Write (ECN = CE 3 marked by a congested spine switch), the receiver returning a RoCEv2 Congestion Notification Packet (opcode 0x81 on QP 1 / data QP) plus RC ACK, followed by a paced RDMA Read.

rocev2_dcqcn_gpu_fabric.frasm13 lines
Open in Playground
host h100_rank0 { ip 10.192.0.10 mac 0c:42:a1:00:00:10 }
host h100_rank1 { ip 10.192.0.11 mac 0c:42:a1:00:00:11 }
compile {
// 1. RC RDMA Write Only (0x0a) on CoS 3 / DSCP 26 experiencing switch ECN Congestion Experienced (ecn 3)
h100_rank0 -> h100_rank1 rocev2 write srcport 58100 pkey 0xffff destqp 0x000200 ackreq seqnum 5001 addr 0x00007f0040000000 key 0x11223344 count 65536 vlan 100 pcp 3 dscp 26 ecn 3 payload "FP16-GRADIENT-TENSOR" wait 20us
// 2. Receiver immediately fires DCQCN Congestion Notification Packet (BTH OpCode 0x81 CNP, DSCP 48 CS6)
h100_rank0 <- h100_rank1 rocev2 opcode 0x81 pkey 0xffff destqp 0x0001ff seqnum 0 vlan 100 pcp 6 dscp 48 wait 15us
// 3. Receiver returns RC Acknowledge (OpCode 0x11, AETH ACK credit syndrome 0x00)
h100_rank0 <- h100_rank1 rocev2 opcode "ack" pkey 0xffff destqp 0x0001ff seqnum 5001 status 0x00 msgid 42 vlan 100 pcp 3 dscp 26 ecn 2 wait 80us
// 4. Rate-paced RC RDMA Read Request (OpCode 0x0c, ECN ECT(0) = 2)
h100_rank0 -> h100_rank1 rocev2 read srcport 58100 pkey 0xffff destqp 0x000200 ackreq seqnum 5002 addr 0x00007f0040010000 key 0x11223344 count 4096 vlan 100 pcp 3 dscp 26 ecn 2
}
Terminal Commands (FrameAssembly CLI v3.3.0)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show rocev2_dcqcn_gpu_fabric.frasm

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

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

# 4. Verify dissected protocol fields in tshark
tshark -r rocev2_dcqcn_gpu_fabric.pcap -Y "infiniband"

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

src_host -> dst_host rocev2 [read | write | opcode "<text_or_num>"] [pkey <0..65535>] [destqp <0..16777215>] [ackreq] [seqnum <0..16777215>] [addr <number>] [key <number>] [count <number>] [status <0..255>] [msgid <0..16777215>] [crc <number>]
Keyword / OptionAccepted ValueDefaultEffect on Packet
read | write | opcode "<text_or_num>"RC RDMA OpCode keyword ("send","write","read","ack","cnp") or 8-bit BTH OpCode (0x04 Send, 0x0a Write, 0x0c Read, 0x11 ACK, 0x81 CNP)send (0x04 RC Send Only)Sets byte 0 of the 12-byte InfiniBand Base Transport Header (BTH) and selects optional RETH / AETH subheaders.
pkey <0..65535>16-bit Partition Key0xffff (Default full-member partition)Writes bytes 2..3 of the BTH.
destqp <0..16777215>24-bit Destination Queue Pair number0x000100Writes bytes 5..7 of the BTH identifying the remote HCA Queue Pair.
ackreq | seqnum <0..16777215>Acknowledge Request bit (0x80) & 24-bit Packet Sequence Number (PSN)ackreq off, seqnum 1Populates BTH bytes 8..11 (A-bit in MSB of byte 8 + 24-bit PSN in bytes 9..11).
addr <number> | key <number> | count <number>64-bit Virtual Address, 32-bit R_Key, and 32-bit DMA Length (RETH)addr 0, key 0, count 0Writes the 16-byte RDMA Extended Transport Header (RETH) on write and read requests.
status <0..255> | msgid <0..16777215>8-bit AETH Syndrome (0x00 ACK, 0x60 RNR NAK) & 24-bit Message Sequence Numberstatus 0, msgid 1Writes the 4-byte ACK Extended Transport Header (AETH) on ack and RDMA Read Response packets.
crc <number>Optional 32-bit Invariant CRC overrideAuto-computed IBTA Annex A17 ICRCOverrides the trailing 4-byte little-endian ICRC for negative NIC drop testing.

Cross-Layer Wrappers Valid with rocev2

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), UDP 4791Overrides source or destination port and remembers the port pair automatically on <- replies.
transport sctpOptional SCTP association transport (IP Proto 132)UDP (UDP 4791)Carries this Layer 7 PDU inside a stateful RFC 9260 SCTP DATA chunk with automatic Verification Tag, TSN tracking, and CRC-32c.
badchecksum | nochecksumL4 checksum fault or UDP zero-checksum flagValid RFC checksum / CRC-32cbadchecksum corrupts the L4 checksum for negative firewall/NIC offload tests; nochecksum writes 0x0000 in UDP headers.

Gotchas & Quick Fixes

destqp and seqnum (PSN) Are 24-Bit Fields (0..16777215)

Rejected
n1 -> n2 rocev2 write destqp 0x01000000 seqnum 1
Valid v3.3.0 Syntax
n1 -> n2 rocev2 write destqp 0x000200 seqnum 1

InfiniBand BTH reserves the upper byte before both Destination QP and PSN (A-bit + reserved bits), capping destqp and seqnum at 0xffffff (16,777,215).

Pair RoCEv2 with ECN-Capable Transport Markings (ecn 2 or ecn 3)

Valid v3.3.0 Syntax
n1 -> n2 rocev2 write destqp 256 seqnum 1 dscp 26 ecn 2

Production RoCEv2 lossless fabrics rely on IP header ECN bits (ecn 2 ECT(0) in normal operation, ecn 3 CE under congestion) to trigger DCQCN rate control before PFC buffer exhaustion.

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