amqpAdvanced Message Queuing Protocol (RabbitMQ)RabbitMQ Exchanges, Channels & Queue Deliveries (app <-> mq amqp TCP 5672)
What It Does on the Wire
From the 8-byte "AMQP\x00\x00\x09\x01" greeting to basicpublish and 0xce frame-end markers on TCP 5672, amqp lets you verify message-bus firewall rules without spinning up RabbitMQ.
Advanced Message Queuing Protocol (amqp, AMQP 0-9-1) powers RabbitMQ and enterprise event-driven message queues over TCP port 5672. Connections open with the 8-byte AMQP protocolheader, negotiate channels (connectionstart, channelopen), route messages via exchange and routingkey (basicpublish, basicdeliver), and keep idle sockets open with heartbeat frames—each terminated by the 0xce frame-end byte.
FrameAssembly computes AMQP frame sizes, Class/Method IDs (10.10 Connection.Start, 20.10 Channel.Open, 60.40 Basic.Publish, 60.60 Basic.Deliver), and the 0xce frame-end marker automatically.
RabbitMQ Cluster & Microservice Firewall Rule Checks (TCP 5672)
Verify VPC and data-center firewall policies between producer services, RabbitMQ brokers, and consumer workers.
Troubleshoot Load Balancer Idle Drops vs AMQP heartbeat Frames
Capture amqp heartbeat channel 0 frames (Type 8) to diagnose NLB/HAProxy TCP idle timeout resets.
Audit Event-Bus Exchange & Routing-Key Traffic in Wireshark
Inspect basicpublish and basicdeliver packets carrying real exchange and routingkey metadata.
Minimal Quickstart (amqp_quickstart.frasm)
Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.
host producer { ip 10.65.1.15 }host rabbitmq { ip 10.65.1.56 }compile { producer -> rabbitmq tcp syn srcport 55672 dstport 5672 wait 1ms producer <- rabbitmq tcp syn ack wait 1ms producer -> rabbitmq tcp ack wait 1ms producer -> rabbitmq amqp protocolheader wait 1ms producer <- rabbitmq amqp connectionstart channel 0 wait 2ms producer -> rabbitmq amqp basicpublish channel 1 exchange "orders" routingkey "order.created" payload "{\"id\":901}"}What the Compiler Calculates So You Don't Have To
- Defaults to TCP destination port
5672(psh ack) and appends the mandatory0xceframe-end octet to every AMQP 0-9-1 frame. - Emits the exact 8-byte
AMQP\x00\x00\x09\x01connection header onprotocolheaderso Wireshark locks onto the AMQP dissector. - Encodes short-string length prefixes for
exchangeandroutingkeyinside Class60(Basic.Publish/Basic.Deliver) Method frames.
Full RabbitMQ Connection Startup, Channel Open, Publish, Deliver & Heartbeat
Walks through TCP 5672 connection startup, opening Channel 1, publishing an audit event to "sec.events", delivering to a worker, and sending a Channel 0 heartbeat.
host auth_svc { ip 172.16.65.10 }host mq_node { ip 172.16.65.56 }compile { auth_svc -> mq_node tcp syn srcport 51672 dstport 5672 win 65535 mss 1460 wait 1ms auth_svc <- mq_node tcp syn ack win 65535 mss 1460 wait 1ms auth_svc -> mq_node tcp ack wait 1ms auth_svc -> mq_node amqp protocolheader wait 1ms auth_svc <- mq_node amqp connectionstart channel 0 wait 2ms auth_svc -> mq_node amqp channelopen channel 1 wait 2ms auth_svc -> mq_node amqp basicpublish channel 1 exchange "sec.events" routingkey "login.mfa" payload "{\"user\":\"netadmin\"}" wait 3ms auth_svc <- mq_node amqp basicdeliver channel 1 exchange "sec.events" routingkey "login.mfa" payload "{\"user\":\"netadmin\"}" wait 10ms auth_svc <- mq_node amqp heartbeat channel 0}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show amqp_rabbitmq_flow.frasm
# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly amqp_rabbitmq_flow.frasm amqp_rabbitmq_flow.pcap
frameassembly amqp_rabbitmq_flow.frasm amqp_rabbitmq_flow.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse amqp_rabbitmq_flow.pcap amqp_rabbitmq_flow_edited.frasmAll amqp 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 amqp:
src_host -> dst_host amqp [protocolheader | connectionstart | channelopen | basicpublish | basicdeliver | heartbeat] [channel <0..65535>] [exchange "<text>"] [routingkey "<text>"]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| protocolheader | connectionstart | channelopen | basicpublish | basicdeliver | heartbeat | AMQP 0-9-1 frame/method selector | basicpublish (channel 1) | Selects the 8-byte AMQP header, Method frame (Type 1), or Heartbeat frame (Type 8). |
| channel <0..65535> | 16-bit AMQP channel number (0 for connection/heartbeat, >= 1 for work channels) | 1 (0 on connectionstart/heartbeat) | Sets bytes 1..2 of the 7-byte AMQP frame header. |
| exchange "<text>" | routingkey "<text>" | Quoted exchange name and routing key | exchange "", routingkey "test" | Populates the Exchange and Routing-Key short strings in basicpublish and basicdeliver. |
Cross-Layer Wrappers Valid with amqp
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
11 options
Cross-Layer Wrappers Valid with amqp
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
| Option | Range / Format | Default | Effect on Packet |
|---|---|---|---|
| wait <number><ns|us|ms|s|m> | Time gap (ns, us, ms, s, m) | 10ms | Advances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back). |
| payload "<text>" | hexpayload "<hex>" | Quoted text or hex bytes (choose one) | Omitted | Appends or overrides raw payload bytes ("deadbeef" or "de:ad:be:ef") and updates packet lengths and checksums. |
| srcmac <mac> | dstmac <mac> | Colon, hyphen, or Cisco dot MAC | Host MAC / RFC multicast MAC | Overrides the 14-byte Ethernet II source or destination MAC address for this single packet. |
| vlan <0..4095> [pcp <0..7>] [dei <0|1>] | VLAN ID 0..4095, PCP 0..7, DEI 0..1 | Untagged | Wraps 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..4095 | Untagged (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> [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>] | Label 0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255 | Unlabeled (at most 1 mpls tag per packet) | Inserts a 32-bit MPLS label header (0x8847) ahead of the Layer 3 header. |
| ttl <0..255> [dscp <0..63>] [ecn <0..3>] | TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3 | ttl 64, dscp 0, ecn 0 | Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings. |
| ipid <0..65535> [df] [mf] [fragoffset <0..8191>] | IPv4 ID, DF/MF flags, fragment offset 0..8191 | ipid 1, flags 0, fragoffset 0 | Sets IPv4 Identification, Do-Not-Fragment (df), More-Fragments (mf), and fragment offset (ignored over IPv6). |
| flowlabel <0..1048575> | 20-bit IPv6 Flow Label (0..1048575) | 0 | Sets the 20-bit IPv6 Flow Label for ECMP routing tests (ignored when running over IPv4 hosts). |
| srcport <0..65535> | dstport <0..65535> | Port number 0..65535 | srcport 49152 (remembered), TCP 5672 | Overrides source or destination port and remembers the port pair automatically on <- replies. |
| seq <number> | acknum <number> | win <0..65535> | syn | ack | psh | fin | rst | TCP sequence/ack numbers, window size, flags & RFC 7323 options | psh ack, win 65535, automatic TCP seq/acknum | Overrides automatic TCP sequence tracking, flags, or RFC 7323 options (mss, wscale, sackperm, tsval, tsecr). |
Gotchas & Quick Fixes
Heartbeats Always Use Channel 0 Per AMQP 0-9-1
auth_svc <- mq_node amqp heartbeat channel 0AMQP 0-9-1 requires Type 8 Heartbeat frames to carry channel 0 (channel >= 1 is used for channelopen, basicpublish, and basicdeliver).