Protocol 58 of 81Layer 7FrameAssembly v3.2.2
Raw .mdllms-full.txt
rtpReal-time Transport Protocol Audio & Video Streams

rtp — 12-Byte Voice/Video Media Streams & DSCP EF Marking

Default Port / Protocol
UDP 5004
Host Endpoint Rule
Dual-Stack IPv4/IPv6
Wireshark Display Filter
rtp
Standards & Specs
RFC 3550, RFC 3551, RFC 4733
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6UDP 5004RTP (Media)
L2 Tagging: vlan · qinq · mplsHost Family: Dual-Stack IPv4/IPv6L3 QoS & TTL: ttl · dscp · ecnL4 State: UDP

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.

01. Application

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.

02. Application

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.

03. Application

Multicast Paging & Broadcast IPTV Stream Labs

Send rtp pt 96 streams to a 239.x.x.x multicast host alongside igmp joins.

Fig. 1 · RFC Octet & Bit Schematic

RFC Wire Header Layout (rtp)

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
RTP (Media) Wire PDU & Payload (Variable)
Controlling .frasm Modifiers
rtp pt · seq · timestamp · ssrc · marker · payload · hexpayload
Compiler Default Behavior
RFC-compliant RTP (Media) defaults (RFC 3550)

Minimal Quickstart (rtp_quickstart.frasm)

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

rtp_quickstart.frasm8 lines
Open in 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"
}

Handled Automatically on the Wire

  • Defaults to UDP destination port 5004 and writes RTP Version 2 (0x80) in the upper bits of byte 0.
  • Packs the 1-bit marker and 7-bit Payload Type (pt) cleanly into byte 1 ((marker << 7) | pt).
  • Treats seq on an rtp line as the 16-bit RTP header Sequence Number.
Multi-Frame Example

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.

rtp_qos_jitter_lab.frasm11 lines
Open in Playground
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"
}
Terminal Commands (FrameAssembly CLI v3.2.2)
# 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.frasm

# 4. Verify dissected protocol fields in tshark
tshark -r rtp_qos_jitter_lab.pcap -Y "rtp"

All 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 / OptionAccepted ValueDefaultEffect 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 Number1Sets bytes 2..3 of the RTP header used by receivers to detect packet loss and reordering.
timestamp <number>32-bit media sampling clock timestamp160Sets 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 ID0x12345678Uniquely identifies the unidirectional RTP media stream in bytes 8..11.
marker <0|1>1 (talkspurt start / end-of-video-frame) or 00Sets 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
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).
payload "<text>" | hexpayload "<hex>"Quoted text or hex bytes (choose one)OmittedAppends or overrides raw payload bytes ("deadbeef" or "de:ad:be:ef") and updates packet lengths and checksums.
srcmac <mac> | dstmac <mac> | ethertype <0..65535>Colon/hyphen/Cisco MAC · EtherType u16 (e.g. 0x0800)Host MAC / RFC multicast MAC / auto EtherTypeOverrides the 14-byte Ethernet II source MAC, destination MAC, or 16-bit EtherType for this single packet.
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>]Label 0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255Unlabeled (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..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>]IPv4 ID, DF/MF flags, fragment offset 0..8191ipid 1, flags 0, fragoffset 0Sets 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)0Sets 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..65535srcport 49152 (remembered), UDP 5004Overrides 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

Valid v3.2.2 Syntax
Pair rtp with sip invite + SDP, or enable RTP heuristic dissection in Wireshark

Because 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)

Rejected
handset_a -> handset_b rtp pt 200
Valid v3.2.2 Syntax
handset_a -> handset_b rtp pt 96

The RTP Payload Type shares byte 1 with the 1-bit marker flag, so pt must be 0..127.

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