Download presentation
Presentation is loading. Please wait.
Published byReginald Gray Modified over 9 years ago
1
RTP/RTCP/RTSP Ben Biro CISC 856 – Spring '10 University of Delaware Thanks to Professor Amer, Henning Schulzrinne, Colin Perkins, Amit Hetawal
2
Overview Purpose Real-time Transport Protocol (RTP) Real-Time Control Protocol (RTCP) Real-Time Streaming Protocol (RTSP) Example
3
Real-Time Multimedia Traffic
4
Non-Real-Time Media
5
Real-Time Media
6
Motivation Video Conference Multicast Conferencing Live Broadcasts
7
Real-Time Media Transfer Encode Encapsulate Transport Layer Transport Layer Reconstruct Playback Buffer Decode Record Frames Playback Internet
8
Ideal 00.00.00 00.00.10 00.00.20 00.00.30 00.00.11 00.00.21 00.00.31 Send time Play time 30 seconds First RTP-PDU Second RTP-PDU Third RTP-PDU application
9
Jitter 00.00.00 00.00.10 00.00.20 00.00.30 00.00.11 Send time Play time 00.00.21 00.00.25 00.00.35 00.00.37 00.00.47 delay First RTP-PDU Second RTP-PDU Third RTP-PDU 00.00.40 Fourth RTP-PDU 00.00.41 00.00.51
10
Jitter 00.00.00 00.00.10 00.00.20 00.00.30 00.00.11 Send time Play time 00.00.21 00.00.25 00.00.35 00.00.37 00.00.47 First RTP-PDU(0) Second RTP-PDU(10) Third RTP-PDU(20) 00.00.40 Fourth RTP-PDU (30) 00.00.41 00.00.51 00.00.18 00.00.28 00.00.38 00.00.48 00.00.58
11
Requirements Sending in real-time Provide timestamping to overcome jitter Buffering and reordering Conceal errors Encoding identification Report QoS and congestion Multi-participant
12
TCP Why not use TCP? TCP has sequence numbers... TCP is reliable... Still need timestamps! Retransmission and slow-start are not suited for real-time TCP does not support multicasting
13
Protocol Stack TCP (till now) RTSP RTPRTCP
14
Real-Time Transport Protocol (RTP) Provides Timestamping Sequence numbers: Like TCP, RTP keeps sequence numbers to detect loss and reorder PDU's Payload identification: Supports for various payload types Uses an ephemeral even numbered port (2p) Does not assume underlying network is reliable Not involved in actual delivery Does not perform any QoS
15
Synchronization Source (SSRC) Identifies the sender of the data Used to separate different streams Initialized to a random 32-bit number Unique to each RTP stream in a session
16
Timestamp Initialized to random 32-bit number Incremented at every sampling cycle NOT at every RTP-PDU Marks time at which first byte is played Needed for synchronization 0:000:060:120:180:24 Playback Buffer Seq. No. 824 Timestamp 3200 Seq. No. 825 Timestamp 3360 Seq. No. 826 Timestamp 3520 Seq. No. 828 Timestamp 3840 SenderReceiver Seq. No. 827 Timestamp 3680 0:000:05 0:060:11 0:120:17 0:180:23 0:240:29
17
Scenario - Loss Seq. No. 234 Timestamp 3200 Seq. No. 235 Timestamp 3360 Seq. No. 236 Timestamp 3520 Seq. No. 238 Timestamp 3840 Sender Receiver Loss Detected
18
Scenario – Out of Order Seq. No. 234 Timestamp 3200 Seq. No. 235 Timestamp 3360 Seq. No. 236 Timestamp 3520 Seq. No. 238 Timestamp 3840 SenderReceiver Seq. No. 237 Timestamp 3680 0:000:05 0:060:11 0:120:17 0:180:23 0:240:29 0:00 Playback Buffer 0:000:06 0:12 0:24 0:180:24 Seq. No. 237 Timestamp 3680 0:12
19
Scenario - Silence Seq. No. 234 Timestamp 3200 Seq. No. 235 Timestamp 3360 Seq. No. 236 Timestamp 3520 Seq. No. 237 Timestamp 3840 SenderReceiver Silence 0:00 Playback Buffer 0:000:06 0:12 0:240:18 0:12
20
Translators An intermediate system that connects two or more networks Used to bridge over routers/firewalls Can translate payload to a different encoding Invisible to end systems Keeps SSRC intact end system 1 end system 2 transl.1 from ES1: SSRC=6 from ES2: SSRC=23 transl.2 from ES2: SSRC=23 from ES1: SSRC=6 authorized tunnel firewall from ES2: SSRC=23 from ES1: SSRC=6
21
Mixers Intermediate system that receives and combines separate RTP-PDU's from different sources into a single RTP-PDU Transcodes and resynchronizes payload Has own SSRC Sources whose RTP-PDU's were combined become Contributing Sources (CSRC)
22
Translators and Mixers
23
Protocol Stack TCP (till now) RTSP RTPRTCP
24
Real-Time Control Protocol (RTCP) Uses an odd number port immediately following the RTP port (2p + 1) Multicast to all participants in session Provides QoS reporting and synchronization information Provides application user information RTCP typically tries to limit itself to 5% of the total bandwidth allotted to the RTP session 25% of that is reserved for Sender Reports
25
RTCP Messages
26
Sender Report (SR) Sent by sources that produce RTP streams One for each stream Contains a 64-bit NTP timestamp, which is the wall clock time, down to fractions of a second, the SR was sent at Contains the RTP timestamp the SR was sent at Used by receivers to synchronize audio and video streams SSRC 17 Timestamp 3200 SSRC 17 Timestamp 3360 SSRC 2 Timestamp 680 SSRC 17 NTP 8:36:04.258 RTP Timestamp 3380 SenderReceiver SSRC 2 NTP 8:36:04.258 RTP Timestamp 700
27
Receiver Report (RR) Sent by receivers, one for each stream in the RTP session Reports statistics on PDU loss and jitter so the sender can perform congestion control Contains information on when the last Sender Report was received
28
RTCP in Translators/Mixers Translators generally forward RTCP messages unchanged Mixers produce their own Sender and Receiver Reports Mixers have their own Source Description
29
Protocol Stack TCP (till now) RTSP RTPRTCP
30
Real-Time Streaming Protocol (RTSP) Provides session control for streaming media RTP and RTSP can work together, or not RTSP is similar in syntax to HTTP 1.1 Out of band control RTSP usually runs on TCP URL: 'rtsp://example.mediaserver.com' Default port 554
31
RTSP Methods
32
RTSP Example web browser media player Web Server Web Server/Media server RTSP pres. desc,streaming commands RTP/RTCP audio/video contentPresentation descriptor HTTP presentation descriptor
33
RTSP Example Media ClientMedia Server SETUP PLAY RTP Audio Stream RTP Video Stream RTCP TEARDOWN Session ID and Port Numbers Chosen DESCRIBE PAUSE Obtains Session Description Close Session Begins sending streams Send Session Description
34
RTSP Example (cont.) C-> A : SETUP rtsp://audio.example.com/twister/audio.en RTSP/1.0 Cseq:1 Transport : RTP/AVP/UDP;unicast;client_port=3056-3057 A-> C : RTSP/1.0 200 OK Cseq:1 Session: 12345678 Transport : RTP/AVP/UDP;unicast;client_port=3056-3057 server_port=5000-5001 C->A: PLAY rtsp://audio.example.com/twister/audio.en RTSP/1.0 Cseq: 2 Session: 12345678 A->C: RTSP/1.0 200 OK Cseq: 2 Session: 12345678 RTP-Info: url=rtsp://audio.example.com/twister/audio.en; seq=876655; C->A: TEARDOWN rtsp://audio.example.com/twister/audio.en RTSP/1.0 Cseq: 3 Session: 12345678 A->C: RTSP/1.0 200 OK Cseq: 3
35
References C. Perkins, “RTP: Audio and Video for the Internet”, Addision Wesley, June 12, 2003 H. Schulzrinne, S. Casner, R. Frederick and V. Jacobson, “RTP: a transport protocol for real-time applications”, RFC 3550, July 2003 H. Schulzrinne, A. Rao and R. Lanphier, “Real Time Streaming Protocol (RTSP)”, RFC 2326, April 1998 H. Schulzrinne, “Internet Media-on-Demand: The Real-Time Streaming Protocol”, September 1997
36
Questions?
37
RTP Format
38
Sender Report Format
39
Receiver Report Format
40
Source Description (SDES) - CNAME (Type 1) – Canonical Name/Identifier - NAME (Type 2) – Actual User Name - EMAIL (Type 3) - PHONE (Type 4) - LOC (Type 5) – Geographic Location - TOOL (Type 6) – Indicates RTP Implementation - NOTE (Type 7) - Personal Note From User - PRIV (Type 8) - Application Specific Description
41
Bye Message
42
Compounding
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.