Escolar Documentos
Profissional Documentos
Cultura Documentos
RTP/RTCP/RTSP
Overview
History of streaming media Streaming performance requirements Protocol stack for multimedia services Real-time transport protocol (RTP) RTP control protocol (RTCP) Real-time streaming protocol (RTSP)
00.00.00
30 seconds
First RTP-PDU
application
00.00.11 00.00.21
Second RTP-PDU
Third RTP-PDU
00.00.31
Reality jitter
delay
First RTP-PDU Second RTP-PDU
00.00.11 00.00.21 00.00.25 00.00.35 00.00.37 00.00.41 00.00.47 00.00.51
Send time
Play time
Jitter
(contd.)
00.00.18
00.00.28
Send time
Play time
Jitter
Playback buffer
(contd.)
At time 00:00:18
At time 00:00:28
At time 00:00:38
How does Sequence number and Timestamp help ? Audio silence example:
Consider audio data What should the sender do during silence? Not send anything Why might this cause problems?
Seq no .1, Tmp st 100 Seq no .2, Tmp st 200 Seq no .3, Tmp st 300
silence
Solution:
After receiving no PDUs for a while, next PDU received at the receiver will reflect a big jump in timestamp, but have the correct next seq. no. Thus, receiver knows what happened.
receiver
sender
RTSP
RTP
RTCP
TCP
(till now)
RTP: Introduction
Provides end-to-end transport functions for real-time applications Supports different payload types All RTP and RTCP PDUs are sent to same multicast group (by all participants) All RTP PDUs sent to an even-numbered UDP port, 2p All RTCP PDUs sent to UDP port 2p+1
Transport layer
Does NOT provide timely delivery or other QoS guarantees Relies on other protocols like RTCP and lower layers Does NOT assume the underlying network is reliable and delivers PDUs in sequence Uses sequence number
RTP Session
RTP session is sending and receiving of RTP data by a group of participants For each participant, a session is a pair of transport addresses used to communicate with the group If multiple media types are communicated by the group, the transmission of each medium constitutes a session.
synchronization source - each source of RTP PDUs Identified by a unique,randomly chosen 32-bit ID (the SSRC) A host generating multiple streams within a single RTP must use a different SSRC per stream
(used by mixers)
Mixer
RTP mixer - an intermediate system that receives & combines RTP PDUs of one or more RTP sessions into a new RTP PDU
Translator
An intermediate system that Connects two or more networks Multicasting through a firewall
Modifies stream encoding, changing the streams timing Transparent to participants SSRCs remain intact
end system 1
from ES1: SSRC=6 from ES2: SSRC=23
transl.1
end system 2
transl.2
from ES1: SSRC=6 from ES2: SSRC=23
diagnostics purposes
Typically, several RTCP PDUs of different types are transmitted in a single UDP PDU
SSRC of Sender NTP Timestamp, most significant word NTP Timestamp, least significant word RTP Timestamp Senders PDU Count
Header
Sender Info
Fraction Lost
Interarrival Jitter
Last SR (LSR)
Report Block 1
Report Block 2
Basic header
SDES items
Internetwork
Timestamps in RTP PDUs are tied to the individual video and audio sampling clocks timestamps are not tied to the wall-clock time, or each other!
Each RTCP sender-report PDU contains (for most recently generated PDU in
associated RTP stream): The timestamp of RTP PDU The wall-clock time for when PDU was created Receivers can use this association to synchronize the playout of audio and video
RTSP Overview
Web Server
web browser
Presentation descriptor
HTTP
presentation descriptor
media player
RTP/RTCP
audio/video content
RTSP Methods
OPTIONS DESCRIBE ANNOUNCE SETUP RECORD PLAY PAUSE REDIRECT TEARDOWN SET_PARAMETER GET_PARAMETER C S C S C S CS C S C S C S C S C S C S CS CS get description of media stream announce new session description create media session start media recording start media delivery pause media delivery redirection to another server immediate teardown change server/client parameter read server/client parameter determine capabilities of server/client
RTSP Session
RTSP server
get UDP port
TCP
RTSP client
choose UDP port
UDP
AV subsyste m
media player
Client C
W V C
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->V : SETUP rtsp://video.example.com/twister/video.en RTSP/1.0 Cseq:1 Transport : RTP/AVP/UDP;unicast;client_port=3058-3059 A-> C : RTSP/1.0 200 OK Cseq:1 Session: 23456789 Transport : RTP/AVP/UDP;unicast;client_port=3058-3059 server_port=5002-5003
(contd.)
W
V->C: RTSP/1.0 200 OK Cseq: 2 Session: 23456789 RTP-Info: url=rtsp://video.example.com/twister/video; seq=12312232;
V C
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;
(contd.)
W V
C->V: TEARDOWN rtsp://video.example.com/twister/video RTSP/1.0 Cseq: 3 Session: 23456789 V->C: RTSP/1.0 200 OK Cseq: 3
References
[1] B. A. Forouzan, TCP/IP Protocol Suite, Third edition, [2] H. Schulzrinne, S. Casner, R. Frederick and V. Jacobson, "RTP: a transport protocol for real-time applications", RFC 3550, July 2003. [3] H. Schulzrinne, A. Rao and R. Lanphier, "Real Time Streaming Protocol (RTSP)", RFC 2326, April 1998.
RTCP PDU 1
SR
sender report
SSRC
SSRC
SDES
SSRC
CNAME PHONE
Example
source 1 reports, there are 2 other sources
RTCP PDU
SR
sender report
SSRC
SSRC
SSRC
CNAME=1
length