rtspReal Time Streaming Protocol IP Camera & Media ControlIP Security Camera & NVR Stream Control (nvr <-> cam rtsp TCP 554)
What It Does on the Wire
Controlling CCTV cameras and media relays on TCP 554 — remember to spell the RTSP Transport: header transporthdr so it never collides with FrameAssembly’s Layer 4 transport keyword!
Real Time Streaming Protocol (rtsp, RFC 2326 / RFC 7826) controls IP security cameras, NVRs, and live video servers over TCP port 554. An NVR typically sends OPTIONS, DESCRIBE, SETUP (negotiating client RTP/RTCP UDP ports inside the Transport: header), PLAY, and TEARDOWN.
FrameAssembly formats RTSP/1.0 requests and status responses (RTSP/1.0 200 OK) with CSeq, Transport (transporthdr), and Session headers while tracking TCP sequence numbers automatically.
Physical Security VLAN & NVR Firewall Policy Testing
Verify that camera VLAN firewalls allow TCP 554 (rtsp) from the VMS/NVR to ONVIF cameras and permit return UDP rtp video streams.
IoT / IP Camera Unauthorized Stream Access IDS Rules
Simulate external or cross-VLAN rtsp describe uri "rtsp://cam01.local/live" probes to test IoT segmentation alerts.
Firewall RTSP ALG Dynamic Port Pinholing Checks
Test whether perimeter firewalls parse transporthdr "RTP/AVP;unicast;client_port=5004-5005" during rtsp setup.
Minimal Quickstart (rtsp_quickstart.frasm)
Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.
host nvr_srv { ip 10.50.10.10 }host ip_cam { ip 10.50.20.45 }compile { nvr_srv -> ip_cam rtsp options uri "rtsp://10.50.20.45:554/stream1" cseq 1 wait 2ms nvr_srv <- ip_cam rtsp status 200 cseq 1 wait 2ms nvr_srv -> ip_cam rtsp setup uri "rtsp://10.50.20.45:554/stream1/track1" cseq 2 transporthdr "RTP/AVP;unicast;client_port=5004-5005"}What the Compiler Calculates So You Don't Have To
- Defaults to TCP destination port
554(psh ack) and writes-terminatedRTSP/1.0lines withCSeq. - Switches from an RTSP client request to an
RTSP/1.0 <status> OKserver reply wheneverstatusis set. - Writes
Transport:(transporthdr) andSession:(session) headers cleanly for Wireshark RTSP/RTP conversation tracking.
Full IP Camera RTSP Setup, PLAY, RTP Video Frame & TEARDOWN
Walks through TCP 554 connection setup, DESCRIBE, SETUP (client_port=5004-5005), PLAY, an H.264 rtp pt 96 packet from the camera, and TEARDOWN.
host vms_nvr { ip 192.168.60.10 }host gate_cam { ip 192.168.60.105 }compile { vms_nvr -> gate_cam tcp syn srcport 51554 dstport 554 win 65535 mss 1460 wait 1ms vms_nvr <- gate_cam tcp syn ack win 65535 mss 1460 wait 1ms vms_nvr -> gate_cam tcp ack wait 1ms vms_nvr -> gate_cam rtsp describe uri "rtsp://192.168.60.105/h264" cseq 1 wait 2ms vms_nvr <- gate_cam rtsp status 200 cseq 1 wait 2ms vms_nvr -> gate_cam rtsp setup uri "rtsp://192.168.60.105/h264/trackID=1" cseq 2 transporthdr "RTP/AVP;unicast;client_port=5004-5005" wait 2ms vms_nvr <- gate_cam rtsp status 200 cseq 2 transporthdr "RTP/AVP;unicast;client_port=5004-5005;server_port=8000-8001" session "98112233" wait 2ms vms_nvr -> gate_cam rtsp play uri "rtsp://192.168.60.105/h264" cseq 3 session "98112233" wait 2ms vms_nvr <- gate_cam rtsp status 200 cseq 3 session "98112233" wait 5ms // Camera sends H.264 RTP packet (pt 96) to client port 5004 gate_cam -> vms_nvr rtp srcport 8000 dstport 5004 pt 96 seq 1 timestamp 90000 ssrc 0xcafebabe marker 1 payload "h264-nal-idr" wait 10ms vms_nvr -> gate_cam rtsp teardown uri "rtsp://192.168.60.105/h264" cseq 4 session "98112233"}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show rtsp_camera_session.frasm
# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly rtsp_camera_session.frasm rtsp_camera_session.pcap
frameassembly rtsp_camera_session.frasm rtsp_camera_session.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse rtsp_camera_session.pcap rtsp_camera_session_edited.frasmAll rtsp 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 rtsp:
src_host -> dst_host rtsp [options | describe | setup | play | teardown | method "<text>"] [uri "<text>"] [status <100..599>] [cseq <number>] [transporthdr "<text>"] [session "<text>"]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| options | describe | setup | play | teardown | method "<text>" | RTSP request verb | options | Sets the RTSP command method on the request line. |
| uri "<text>" | Quoted rtsp://... stream URL | "rtsp://camera.local/stream" | Sets the target stream URL in the RTSP request line. |
| status <100..599> | RTSP response status code (200, 401, 404, 454) | Omitted on requests | Switches the packet to an RTSP/1.0 <status> OK response. |
| cseq <number> | Command sequence counter | 1 | Writes the mandatory CSeq: header matching requests to responses. |
| transporthdr "<text>" | Quoted RTSP Transport: header string | Omitted unless set | Writes the Transport: header (named transporthdr so it never collides with Layer 4 transport tcp|udp). |
| session "<text>" | Quoted RTSP Session ID | Omitted unless set | Writes the Session: header linking SETUP, PLAY, and TEARDOWN. |
Cross-Layer Wrappers Valid with rtsp
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 rtsp
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 554 | 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
Always Use transporthdr (Never transport) for the RTSP Transport Header
nvr_srv -> ip_cam rtsp setup transport "RTP/AVP;unicast;client_port=5004-5005"nvr_srv -> ip_cam rtsp setup transporthdr "RTP/AVP;unicast;client_port=5004-5005"In FrameAssembly, transport is reserved for switching Layer 4 TCP/UDP on dual-transport protocols. RTSP runs over TCP 554 and uses transporthdr for the Transport: header.