rtpReal-time Transport Protocol Audio & Video StreamsVoice Media Streams & DSCP 46 EF Queue Checks (phone1 <-> phone2 rtp)
What It Does on the Wire
SIP sets up the call and rtp carries the actual voice packets — tack dscp 46 (EF) and wait 20ms onto G.711 pt 0 frames to verify your WAN routers aren’t dropping voice into best-effort queues.
Real-time Transport Protocol (rtp, RFC 3550) carries live VoIP voice (G.711, Opus), WebRTC video (VP9, H.264), and IP camera streams over UDP (default dstport 5004). Every RTP packet begins with a 12-byte RTP v2 (0x80) header containing the 1-bit marker, 7-bit Payload Type (pt), 16-bit seq, 32-bit media sample timestamp, and 32-bit Synchronization Source (ssrc).
Combining rtp with FrameAssembly’s precision wait clock (wait 20ms for standard 50-pps G.711 audio, or variable delays to simulate WAN jitter) and dscp 46 (Expedited Forwarding) lets you test QoS queues and Wireshark RTP Stream Analysis with microsecond accuracy.
Test Switch & WAN Router QoS (dscp 46 EF) Priority Queuing
Replay rtp packets marked with vlan 30 pcp 5 dscp 46 through switches and SD-WAN edges to confirm voice media lands in strict-priority queues without DSCP bleaching.
Simulate Packet Loss, Out-of-Order & Jitter in Wireshark RTP Analysis
Intentionally skip an RTP seq number (for example 1, 2, 4) or vary wait (20ms, 65ms, 5ms) to validate packet-loss and jitter alarms in VoIP monitoring probes.
Multicast Paging & Broadcast IPTV Stream Labs
Send rtp pt 96 streams to a 239.x.x.x multicast host alongside igmp joins.
Minimal Quickstart (rtp_quickstart.frasm)
Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.
host handset_a { ip 10.30.1.101 }host handset_b { ip 10.30.1.102 }compile { handset_a -> handset_b rtp pt 0 seq 1 timestamp 160 ssrc 0x12345678 marker 1 dscp 46 payload "frame-1" wait 20ms handset_a -> handset_b rtp pt 0 seq 2 timestamp 320 ssrc 0x12345678 marker 0 dscp 46 payload "frame-2" wait 20ms handset_a -> handset_b rtp pt 0 seq 3 timestamp 480 ssrc 0x12345678 marker 0 dscp 46 payload "frame-3"}What the Compiler Calculates So You Don't Have To
- Defaults to UDP destination port
5004and writes RTP Version2(0x80) in the upper bits of byte 0. - Packs the 1-bit
markerand 7-bit Payload Type (pt) cleanly into byte 1 ((marker << 7) | pt). - Treats
seqon anrtpline as the 16-bit RTP header Sequence Number.
G.711 VoIP Stream With Simulated WAN Jitter & Single-Packet Drop
Emits a G.711 PCMU (pt 0, 8 kHz = +160 timestamp ticks per 20ms) voice burst containing a skipped sequence number (seq 3 dropped) and a 55ms jitter spike.
host branch_phone { ip 172.16.30.21 }host hq_gateway { ip 172.16.1.10 }compile { // Normal 20ms pacing (+160 samples at 8000 Hz) branch_phone -> hq_gateway rtp srcport 16384 dstport 16400 pt 0 seq 1 timestamp 160 ssrc 0xdeadbeef marker 1 dscp 46 payload "audio-pkt-1" wait 20ms branch_phone -> hq_gateway rtp pt 0 seq 2 timestamp 320 ssrc 0xdeadbeef marker 0 dscp 46 payload "audio-pkt-2" wait 55ms // seq 3 intentionally omitted to test 1-packet loss + 55ms jitter detection! branch_phone -> hq_gateway rtp pt 0 seq 4 timestamp 640 ssrc 0xdeadbeef marker 0 dscp 46 payload "audio-pkt-4" wait 5ms branch_phone -> hq_gateway rtp pt 0 seq 5 timestamp 800 ssrc 0xdeadbeef marker 0 dscp 46 payload "audio-pkt-5"}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show rtp_qos_jitter_lab.frasm
# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly rtp_qos_jitter_lab.frasm rtp_qos_jitter_lab.pcap
frameassembly rtp_qos_jitter_lab.frasm rtp_qos_jitter_lab.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse rtp_qos_jitter_lab.pcap rtp_qos_jitter_lab_edited.frasmAll rtp 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 rtp:
src_host -> dst_host rtp [pt <0..127>] [seq <0..65535>] [timestamp <number>] [ssrc <hex_or_num>] [marker <0|1>]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| pt <0..127> | 7-bit RTP Payload Type (0 PCMU, 8 PCMA, 9 G.722, 96 Opus/H.264, 101 DTMF) | 0 (G.711 PCMU) | Sets the lower 7 bits of byte 1 in the 12-byte RTP header. |
| seq <0..65535> | 16-bit RTP Sequence Number | 1 | Sets bytes 2..3 of the RTP header used by receivers to detect packet loss and reordering. |
| timestamp <number> | 32-bit media sampling clock timestamp | 160 | Sets bytes 4..7 of the RTP header (+160 per 20ms for 8kHz voice; +1800 per frame for 90kHz 50fps video). |
| ssrc <hex_or_num> | 32-bit Synchronization Source ID | 0x12345678 | Uniquely identifies the unidirectional RTP media stream in bytes 8..11. |
| marker <0|1> | 1 (talkspurt start / end-of-video-frame) or 0 | 0 | Sets the 1-bit M flag at the top of byte 1. |
Cross-Layer Wrappers Valid with rtp
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
10 options
Cross-Layer Wrappers Valid with rtp
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), UDP 5004 | Overrides source or destination port and remembers the port pair automatically on <- replies. |
Gotchas & Quick Fixes
Enable Wireshark "Try to decode RTP outside of conversations" for Standalone RTP Captures
Pair rtp with sip invite + SDP, or enable RTP heuristic dissection in WiresharkBecause RTP uses dynamic even UDP ports without a fixed magic header, Wireshark auto-detects RTP when preceded by sip / rtsp setup—or on any UDP port when *Analyze -> Enabled Protocols -> rtp_udp* is checked.
pt Maximum Value Is 127 (7 Bits)
handset_a -> handset_b rtp pt 200handset_a -> handset_b rtp pt 96The RTP Payload Type shares byte 1 with the 1-bit marker flag, so pt must be 0..127.