RTP/RTCP/RTSP Real-Time Protocols Amit Hetawal University of Delaware CISC 856 -Fall 2005 Thanks to  Professor Amer
Overview <ul><li>History of streaming media </li></ul><ul><li>Streaming performance requirements </li></ul><ul><li>Protoco...
Brief history of streaming media
Real-time multimedia streaming <ul><li>Real-time multimedia applications </li></ul><ul><ul><li>Video teleconferencing </li...
Streaming performance requirements <ul><ul><li>Sequencing   </li></ul></ul><ul><ul><ul><li>–  to report PDU loss  </li></u...
Ideal Timing – no jitter 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 First RTP-PDU ...
Reality – 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.0...
Jitter  (contd.) 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.0...
Jitter  (contd.) Playback buffer 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 : <ul><li>Solution: </li></ul><ul><ul><li>After rece...
Streaming performance requirements <ul><ul><li>Sequencing   </li></ul></ul><ul><ul><ul><li>–  to report PDU loss  </li></u...
<ul><ul><li>TCP is not used because: </li></ul></ul><ul><li>TCP does retransmissions    unbounded delays </li></ul><ul><l...
TCP (till now) RTSP Protocol stack for multimedia services RTP RTCP
RTP: Introduction <ul><li>Provides end-to-end transport functions for real-time applications </li></ul><ul><ul><li>Support...
RTP Session <ul><li>RTP  session   is sending and receiving of RTP data by a group of participants </li></ul><ul><ul><li>F...
RTP Synchronization Source <ul><li>synchronization source -  e ach source of RTP PDUs  </li></ul><ul><li>Identified by a u...
RTP  Basics of Data Transmission RTP PDUs
RTP PDU Header <ul><li>Incremented by one for each RTP PDU: </li></ul><ul><ul><li>PDU loss detection </li></ul></ul><ul><u...
Mixer RTP  mixer  - an intermediate system that receives & combines RTP PDUs of one or more RTP sessions into a new RTP PD...
Translator <ul><li>An intermediate system that… </li></ul><ul><ul><li>Connects two or more networks </li></ul></ul><ul><ul...
RTP Control Protocol (RTCP) <ul><ul><li>RTCP specifies report PDUs exchanged between sources and destinations of multimedi...
RTCP message types <ul><li>Typically, several RTCP PDUs of different types are transmitted in a single UDP PDU </li></ul>
… … Last SR (LSR) Extended Highest sequence Number Received Interarrival Jitter Cumulative Number of PDU Lost Fraction Los...
Ethereal capture for RTP-PDU Basic header
Ethereal capture for RTCP-PDU header of SR report sender info receiver   report block SDES items
<ul><li>Timestamps in RTP PDUs are tied to the individual video and audio sampling clocks </li></ul><ul><ul><li>timestamps...
RTCP bandwidth scaling <ul><li>Solution </li></ul><ul><li>RTCP attempts to limit its traffic to 5% of the session bandwidt...
Real-Time Streaming Protocol (RTSP) <ul><li>Application layer protocol (default port 554) </li></ul><ul><li>Usually  runs ...
RTSP Overview  web browser media player Web Server Web Server/Media server RTSP pres. desc,streaming commands RTP/RTCP aud...
RTSP Methods read server/client parameter C    S GET_PARAMETER change server/client parameter C    S SET_PARAMETER immed...
RTSP Session AV subsystem RTSP client RTSP OK RTSP PLAY RTSP OK RTP AUDIO RTP VIDEO RTSP TEARDOWN RTSP OK choose UDP port ...
Example:Media on demand (Unicast) Media server A audio.example.com Media server V video.example.com Web server W -holds th...
RTSP Message sequence C W V A C->V   :  SETUP rtsp://video.example.com/twister/video.en RTSP/1.0 Cseq:1 Transport : RTP/AV...
RTSP Message sequence  (contd.) C W V A C->V: PLAY rtsp://video.example.com/twister/video RTSP/1.0  Cseq: 2  Session: 2345...
RTSP Message sequence  (contd.) C W V A C->A: TEARDOWN rtsp://audio.example.com/twister/audio.en RTSP/1.0 Cseq: 3  Session...
References [1] B. A. Forouzan, “TCP/IP Protocol Suite”,  Third edition,  [2] H. Schulzrinne, S. Casner, R. Frederick and V...
RTCP compound PDU SR sender report receiver report receiver report SSRC SSRC SSRC source 2 source 3 RTCP PDU 1 SDES CNAME ...
Example source 1 reports, there are 2 other sources SR sender report receiver report receiver report SSRC SSRC SSRC source...
RTCP processing in Translators <ul><li>SR sender information  : Does not generate their own sender information( most of th...
RTCP processing in Mixers <ul><li>SR sender information  : Generates its own SR info. Because the characteristics of sourc...
Source description PDUs <ul><li>May contain: </li></ul><ul><ul><li>a CNAME item (canonical identifier/name)  </li></ul></u...
Upcoming SlideShare
Loading in...5
×

RTP/RTCP (ppt)

11,921

Published on

RTP/RTCP (ppt)

  1. 1. RTP/RTCP/RTSP Real-Time Protocols Amit Hetawal University of Delaware CISC 856 -Fall 2005 Thanks to Professor Amer
  2. 2. Overview <ul><li>History of streaming media </li></ul><ul><li>Streaming performance requirements </li></ul><ul><li>Protocol stack for multimedia services </li></ul><ul><li>Real-time transport protocol (RTP) </li></ul><ul><li>RTP control protocol (RTCP) </li></ul><ul><li>Real-time streaming protocol (RTSP) </li></ul>
  3. 3. Brief history of streaming media
  4. 4. Real-time multimedia streaming <ul><li>Real-time multimedia applications </li></ul><ul><ul><li>Video teleconferencing </li></ul></ul><ul><ul><li>Internet Telephony (VoIP) </li></ul></ul><ul><ul><li>Internet audio, video streaming </li></ul></ul>(A-PDUs)
  5. 5. Streaming performance requirements <ul><ul><li>Sequencing </li></ul></ul><ul><ul><ul><li>– to report PDU loss </li></ul></ul></ul><ul><ul><ul><li>to report PDU reordering </li></ul></ul></ul><ul><ul><ul><li>to perform out-of-order decoding </li></ul></ul></ul><ul><ul><li>Time stamping and Buffering </li></ul></ul><ul><ul><ul><li>for play out </li></ul></ul></ul><ul><ul><ul><li>for jitter and delay calculation </li></ul></ul></ul><ul><ul><li>Payload type identification </li></ul></ul><ul><ul><ul><li>for media interpretation </li></ul></ul></ul><ul><ul><li>Error concealment –covers up errors from lost PDU by using redundancy in most-adjacent-frame </li></ul></ul><ul><ul><li>Quality of Service (QoS) feedback – from receiver to sender for operation adjustment </li></ul></ul><ul><ul><li>Rate control –sender reduces sending rate adaptively to network congestion </li></ul></ul>
  6. 6. Ideal Timing – no jitter 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 First RTP-PDU Second RTP-PDU Third RTP-PDU application 30 seconds
  7. 7. Reality – 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 Second RTP-PDU Third RTP-PDU 00.00.40 Fourth RTP-PDU 00.00.41 00.00.51 delay
  8. 8. Jitter (contd.) 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
  9. 9. Jitter (contd.) Playback buffer At time 00:00:18 At time 00:00:28 At time 00:00:38
  10. 10. How does Sequence number and Timestamp help ? Audio silence example : <ul><li>Solution: </li></ul><ul><ul><li>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. </li></ul></ul><ul><ul><li>Why might this cause problems? </li></ul></ul><ul><li>Consider audio data </li></ul><ul><ul><li>What should the sender do during silence? </li></ul></ul><ul><li>Not send anything </li></ul><ul><ul><li>Receiver cannot distinguish between loss and silence </li></ul></ul>sender receiver silence Seq no.1, Tmpst 100 Seq no.2, Tmpst 200 Seq no.3, Tmpst 300 Seq no.4, Tmpst 600 Seq no.5, Tmpst 700
  11. 11. Streaming performance requirements <ul><ul><li>Sequencing </li></ul></ul><ul><ul><ul><li>– to report PDU loss </li></ul></ul></ul><ul><ul><ul><li>to report PDU reordering </li></ul></ul></ul><ul><ul><ul><li>to perform out-of-order decoding </li></ul></ul></ul><ul><ul><li>Time stamping and Buffering </li></ul></ul><ul><ul><ul><li>for play out </li></ul></ul></ul><ul><ul><ul><li>for jitter and delay calculation </li></ul></ul></ul><ul><ul><li>Payload type identification </li></ul></ul><ul><ul><ul><li>for media interpretation </li></ul></ul></ul><ul><ul><li>Error concealment –covers up errors from lost PDU by using redundancy in most-adjacent-frame </li></ul></ul><ul><ul><li>Quality of Service (QoS) feedback – from receiver to sender for operation adjustment </li></ul></ul><ul><ul><li>Rate control –sender reduces sending rate adaptively to network congestion </li></ul></ul>
  12. 12. <ul><ul><li>TCP is not used because: </li></ul></ul><ul><li>TCP does retransmissions  unbounded delays </li></ul><ul><li>No provision for time stamping </li></ul><ul><li>TCP does not support multicast </li></ul><ul><li>TCP congestion control (slow-start) unsuitable for real-time transport </li></ul>RTP + UDP usually used for multimedia services Support from transport layers
  13. 13. TCP (till now) RTSP Protocol stack for multimedia services RTP RTCP
  14. 14. RTP: Introduction <ul><li>Provides end-to-end transport functions for real-time applications </li></ul><ul><ul><li>Supports different payload types </li></ul></ul><ul><li>All RTP and RTCP PDUs are sent to same multicast group (by all participants) </li></ul><ul><ul><li>All RTP PDUs sent to an even-numbered UDP port, 2p </li></ul></ul><ul><ul><li>All RTCP PDUs sent to UDP port 2p+1 </li></ul></ul><ul><li>Does NOT provide timely delivery or other QoS guarantees </li></ul><ul><ul><li>Relies on other protocols like RTCP and lower layers </li></ul></ul><ul><li>Does NOT assume the underlying network is reliable and delivers PDUs in sequence </li></ul><ul><ul><li>Uses sequence number </li></ul></ul>RTP RTCP Application UDP IP Data Link Physical Transport layer
  15. 15. RTP Session <ul><li>RTP session is sending and receiving of RTP data by a group of participants </li></ul><ul><ul><li>For each participant, a session is a pair of transport addresses used to communicate with the group </li></ul></ul><ul><li>If multiple media types are communicated by the group, the transmission of each medium constitutes a session . </li></ul>
  16. 16. RTP Synchronization Source <ul><li>synchronization source - e ach source of RTP PDUs </li></ul><ul><li>Identified by a unique,randomly chosen 32-bit ID (the SSRC) </li></ul><ul><li>A host generating multiple streams within a single RTP must use a different SSRC per stream </li></ul>
  17. 17. RTP Basics of Data Transmission RTP PDUs
  18. 18. RTP PDU Header <ul><li>Incremented by one for each RTP PDU: </li></ul><ul><ul><li>PDU loss detection </li></ul></ul><ul><ul><li>Restore PDU sequence </li></ul></ul><ul><li>Sampling instant of first data octet </li></ul><ul><li>multiple PDUs can have same timestamp </li></ul><ul><li>not necessarily monotonic </li></ul><ul><li>used to synchronize different </li></ul><ul><li>media streams </li></ul>Payload type Identifies synchronization source ( used by mixers ) Identifies contributing sources
  19. 19. Mixer RTP mixer - an intermediate system that receives & combines RTP PDUs of one or more RTP sessions into a new RTP PDU <ul><li>Stream may be transcoded, special effects may be performed. </li></ul><ul><li>A mixer will typically have to define synchronization relationships between streams.Thus… </li></ul><ul><ul><li>Sources that are mixed together become contributing sources ( CSRC) </li></ul></ul><ul><ul><li>Mixer itself appears as a new source having a new SSRC </li></ul></ul>
  20. 20. Translator <ul><li>An intermediate system that… </li></ul><ul><ul><li>Connects two or more networks </li></ul></ul><ul><ul><ul><li>Multicasting through a firewall </li></ul></ul></ul><ul><ul><ul><li>Modifies stream encoding, changing the stream’s timing </li></ul></ul></ul><ul><ul><ul><li>Transparent to participants </li></ul></ul></ul><ul><ul><ul><li>SSRC’s remain intact </li></ul></ul></ul>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. 21. RTP Control Protocol (RTCP) <ul><ul><li>RTCP specifies report PDUs exchanged between sources and destinations of multimedia information </li></ul></ul><ul><ul><ul><li>receiver reception report </li></ul></ul></ul><ul><ul><ul><li>sender report </li></ul></ul></ul><ul><ul><ul><li>source description report </li></ul></ul></ul><ul><ul><li>Reports contain statistics such as the number of RTP-PDUs sent, number of RTP-PDUs lost, inter-arrival jitter </li></ul></ul><ul><ul><li>Used by application to modify sender transmission rates and for diagnostics purposes </li></ul></ul>
  22. 22. RTCP message types <ul><li>Typically, several RTCP PDUs of different types are transmitted in a single UDP PDU </li></ul>
  23. 23. … … Last SR (LSR) Extended Highest sequence Number Received Interarrival Jitter Cumulative Number of PDU Lost Fraction Lost SSRC_1 (SSRC of the 1 st Source) Profile-Specific Extensions SSRC_2 (SSRC of the 2 nd Source) Delay Since Last SR (DLSR) SSRC of Sender Length (16 bits) PT=200/201  SR/RR RC P V Sender Info Header Report Block 1 Report Block 2 Sender/Receiver report PDUs RTP Timestamp Sender’s PDU Count NTP Timestamp, most significant word NTP Timestamp, least significant word Sender’s Octet Count
  24. 24. Ethereal capture for RTP-PDU Basic header
  25. 25. Ethereal capture for RTCP-PDU header of SR report sender info receiver report block SDES items
  26. 26. <ul><li>Timestamps in RTP PDUs are tied to the individual video and audio sampling clocks </li></ul><ul><ul><li>timestamps are not tied to the wall-clock time, or each other! </li></ul></ul>Synchronization of streams using RTCP <ul><li>Each RTCP sender-report PDU contains (for most recently generated PDU in associated RTP stream): </li></ul><ul><ul><li>The timestamp of RTP PDU </li></ul></ul><ul><ul><li>The wall-clock time for when PDU was created </li></ul></ul><ul><li>Receivers can use this association to synchronize the playout of audio and video </li></ul>Internetwork RTP audio RTCP audio RTP video RTP video
  27. 27. RTCP bandwidth scaling <ul><li>Solution </li></ul><ul><li>RTCP attempts to limit its traffic to 5% of the session bandwidth to ensure it can scale! </li></ul><ul><li>RTCP gives 75% of this rate to the receivers; and the remaining 25% to the sender. </li></ul><ul><li>Example </li></ul><ul><li>Suppose one sender, sending video at a rate of 2 Mbps. Then RTCP attempts to limit its traffic to 100 Kbps. </li></ul><ul><li>The 75 kbps is equally shared among receivers: </li></ul><ul><ul><li>With R receivers, each receiver gets to send RTCP traffic at 75/R kbps. </li></ul></ul><ul><li>Sender gets to send RTCP traffic at 25 kbps. </li></ul><ul><li>Problem </li></ul><ul><li>What happens when there is one sender and many receivers? </li></ul><ul><li>RTCP reports scale linearly with the number of participants and would match or exceed the amount of RTP data! More overhead than useful data! </li></ul>
  28. 28. Real-Time Streaming Protocol (RTSP) <ul><li>Application layer protocol (default port 554) </li></ul><ul><li>Usually runs on RTP for stream & TCP for control </li></ul><ul><li>Provides the control channel </li></ul><ul><li>Uses out-of-band signaling </li></ul><ul><li>Usable for Live broadcasts / multicast </li></ul><ul><li>Also known as “ Network remote control ” for multi-media servers. </li></ul>
  29. 29. RTSP Overview web browser media player Web Server Web Server/Media server RTSP pres. desc,streaming commands RTP/RTCP audio/video content Presentation descriptor HTTP presentation descriptor
  30. 30. RTSP Methods read server/client parameter C  S GET_PARAMETER change server/client parameter C  S SET_PARAMETER immediate teardown C  S TEARDOWN redirection to another server C  S REDIRECT pause media delivery C  S PAUSE start media delivery C  S PLAY start media recording C  S RECORD create media session C  S SETUP announce new session description C  S ANNOUNCE get description of media stream C  S DESCRIBE C  S determine capabilities of server/client C  S OPTIONS
  31. 31. RTSP Session AV subsystem RTSP client RTSP OK RTSP PLAY RTSP OK RTP AUDIO RTP VIDEO RTSP TEARDOWN RTSP OK choose UDP port RTSP SETUP Default port 554 media server RTSP server data source media player get UDP port RTCP TCP UDP
  32. 32. Example:Media on demand (Unicast) Media server A audio.example.com Media server V video.example.com Web server W -holds the media descriptors Client C
  33. 33. RTSP Message sequence C W V A 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 C -> W : GET/Twister.sdp HTTP/1.1 Host: www.example.com Accept: application/sdp W-> C : HTTP/1.0 200 OK Content-Type: application/sdp 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
  34. 34. RTSP Message sequence (contd.) C W V A C->V: PLAY rtsp://video.example.com/twister/video RTSP/1.0 Cseq: 2 Session: 23456789 V->C: RTSP/1.0 200 OK Cseq: 2 Session: 23456789 RTP-Info: url=rtsp://video.example.com/twister/video; seq=12312232; 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;
  35. 35. RTSP Message sequence (contd.) C W V A 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 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
  36. 36. References [1] B. A. Forouzan, “TCP/IP Protocol Suite”, Third edition, [2] H. Schulzrinne, S. Casner, R. Frederick and V. Jacobson, &quot;RTP: a transport protocol for real-time applications&quot;, RFC 3550, July 2003. [3] H. Schulzrinne, A. Rao and R. Lanphier, &quot;Real Time Streaming Protocol (RTSP)&quot;, RFC 2326, April 1998.
  37. 37. RTCP compound PDU SR sender report receiver report receiver report SSRC SSRC SSRC source 2 source 3 RTCP PDU 1 SDES CNAME PHONE SSRC RTCP PDU 2 compound PDU (single UDP datagram)
  38. 38. Example source 1 reports, there are 2 other sources SR sender report receiver report receiver report SSRC SSRC SSRC source 2 source 3 RTCP PDU
  39. 39. RTCP processing in Translators <ul><li>SR sender information : Does not generate their own sender information( most of the times ), but forwards the SR PDUs received from one side to other </li></ul><ul><li>RR reception report blocks : Does not generate their own RR reports ( most of the times ), but forwards RR reports received from one side to another. SSRC are left intact </li></ul><ul><li>SDES : Forwards without changing the SDES info. but may filter non CNAME SDES, if bandwidth is limited </li></ul><ul><li>BYE : Forwards BYE PDU unchanged. A translator about to cease forwarding, send a BYE PDU to each connected nodes </li></ul>
  40. 40. RTCP processing in Mixers <ul><li>SR sender information : Generates its own SR info. Because the characteristics of source stream is lost in the mix. The SR info is sent in same direction as the mixed stream </li></ul><ul><li>RR reception report blocks : Generates its own reports for sources in each cloud and sends them only to same cloud </li></ul><ul><li>SDES : Forwards without changing the SDES info. but may filter non CNAME SDES, if bandwidth is limited </li></ul><ul><li>BYE : Forwards BYE PDU unchanged. A mixer about to cease forwarding, send a BYE PDU to each connected nodes </li></ul>
  41. 41. Source description PDUs <ul><li>May contain: </li></ul><ul><ul><li>a CNAME item (canonical identifier/name) </li></ul></ul><ul><ul><li>a NAME item (real user name) </li></ul></ul><ul><ul><li>an EMAIL item </li></ul></ul><ul><ul><li>a PHONE item </li></ul></ul><ul><ul><li>a LOC item (geographic location) </li></ul></ul><ul><ul><li>a TOOL item (application name) </li></ul></ul><ul><ul><li>a NOTE item (transient msg, e.g. for status) </li></ul></ul><ul><ul><li>a PRIV item (private extension) </li></ul></ul>Value 1 2 3 4 5 6 7 8 CNAME=1 length user and domain name
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×