Upload
tarek-nader
View
2.259
Download
2
Tags:
Embed Size (px)
DESCRIPTION
What is RTP? all info. about RTP
Citation preview
RTP: Real-timeTransport Protocol
Presented by:1- AbdElrahman Mohamed Amer
2-Tarek Nader Esmat
Presentation Outline
Introduction History of streaming media Overview of RTP What is RTP? Why RTP? How RTP work? RTP Features (Advantages) RTP Disadvantages RTP HeaderReal-time streaming protocol (RTSP)
Brief history of streaming media
Origin of Protocol(RTP)
Developed by the Audio-Video Transport Working Group of the IETF “Internet Engineering Task Force” : H. Schulzrinne (Columbia University) S. Casner (Packet Design) R. Frederick (Blue Coat Systems Inc.) V. Jacobson (Packet Design)
First published as RFC 1889 in the year 1996
Superseded by RFC 3550 in the year 2003
Real-Time Transport Protocol
End-to-end delivery services for applications transmitting real-time data, such as audio and video over multicast and unicast networks.
Applications that use RTP are:Less sensitive to packet loss.Very sensitive to packet delays.
E.x:-– Video teleconferencing– Internet Telephony (VoIP)– Internet audio, video streaming
Application layer protocol
Typically used on top of IP and UDP•Layer 4 – UDP or TCP•Layer 3 – Internet Protocol IP•Layer 7 – RTP
How RTP work?
RTP Features All RTP and RTCP PDUs are sent to same
multicast group (by all participants)
RTP supports several file formats like MPEG and MJPEG but you can add extra formats.
RTP also has jitter compensation, multimedia streaming (tolerates packet loss) and detection of out of sequence arrival in data attributes.
Streaming performance requirements– Sequencing
– to report PDU loss – to report PDU reordering – to perform out-of-order decoding
– Time stamping and Buffering – for play out– for jitter and delay calculation
– Payload type identification– for media interpretation
– Error concealment –covers up errors from lost PDU by using redundancy in most-adjacent-frame
– Quality of Service (QoS) feedback – from receiver to sender for operation adjustment
– Rate control –sender reduces sending rate adaptively to network congestion
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
30 s
econ
ds
First RTP-PDU
Second RTP-PDU
Third RTP-PDU
application
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
delay
First RTP-PDU
Second RTP-PDU
Third RTP-PDU 00.00.40
Fourth RTP-PDU 00.00.41
00.00.51
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.3500.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
Jitter (contd.)
Playback buffer
At time 00:00:18
At time 00:00:28
At time 00:00:38
Support from transport layersWhy not only RTP?
Assume the underlying network is reliable and delivers PDUs in sequence. Uses sequence number.
Provide timely delivery or other QoS guarantees. However, it does provide necessary data to application to order packets and adjust signal quality. Relies on other protocols like RTCP and lower layers (e.g. UDP, TCP) to do so.
Handle resource reservation .
Need other protocols like RSVP
Handle connection setups or tear-downs.
Need other protocols like SIP or H.323
Define media data formats or encodings.
Need media specific profiles.
RTP Does Not
RTCP
Why not UDP?
UDP offers datagram-like serviceConnectionless , Unreliable , Unordered No Flow , Error , Congestion controlPort numbers
RTP + UDP usually used for multimedia services
Why not TCP?
TCP does retransmissions unbounded delays due to (Acks, Flow control, windowing) No provision for time stamping TCP does not support multicast TCP congestion control (slow-start) unsuitable for real-time transport (A-V media)
RTP Packets
RTP PDU HeaderIncremented by one for each RTP PDU:
PDU loss detection
Restore PDU sequence
Sampling instant of first data octet
multiple PDUs can have same timestamp
not necessarily monotonic
used to synchronize different
media streams
Payload type
Identifies synchronization source
(used by mixers)Identifies contributing sources
V - Version. 2 bits. X - Extension. 1 bit. CC - CSRC count. 4 bits.
M - Marker. 1 bit. e.g., the start of a talk spurt
PT - Payload Type. 7 bits. e.g., specific audio codec• PT=0: PCM 64Kbpz; PT=3: GSM 13Kbps
Sequence Number. 16 bits. (packet count)
Timestamp. 32 bits.
SSRC, Synchronization source. 32 bits. CSRC, Contributing source. 32 bits.
P- padding .1bit
- gap in sequence #: packet loss
• e.g., audio@8KHz, 20ms samples/packet- timestamp increment per packet: 160
• 90KHz used for video- a video frame may be encapsulated in a few packets
• gap in timestamp: silence
RTP Data Transfer Protocol : Synchronization
RTP Data Transfer Protocol : RTP profiles
Media specific (e.g., audio)
• timestamp: e.g., sampling rate, 8KHz PCM• packet size: e.g., about 20ms samples in PCM
- packets independent as much as possible: ALF
SSRC, Synchronization source. 32 bits.
Sequence Number. 16 bits.
Timestamp. 32 bits.
M - Marker. 1 bit. PT - Payload Type. 7 bits.
Ethereal capture for RTP-PDU
Basic header
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.
RTP Synchronization Source
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
RTP Basics of Data Transmission
RTP PDUs
How does Sequence number and Timestamp help ?
Audio silence example:
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.
– Why might this cause problems?
send
er
rece
iver
silence
Seq no.1, Tmpst 100Seq no.2, Tmpst 200
Seq no.3, Tmpst 300
Seq no.4, Tmpst 600Seq no.5, Tmpst 700
Consider audio data– What should the sender do during silence?
Not send anything
Receiver cannot distinguish between loss and silence
Real-Time Streaming Protocol (RTSP)
Application layer protocol (default port 554)Usually runs on RTP for stream & TCP for control Provides the control channel Uses out-of-band signaling Usable for Live broadcasts / multicast
Also known as “Network remote control” for multi-media servers.
web browser
media player
Web Server
Web Server/Media server
RTSP Overview
RTSPpres. desc,streaming commands
RTP/RTCPaudio/video content
Presentation
descriptor
HTTPpresentation descriptor
RTSP Methods
OPTIONSC S
determine capabilities of server/clientC S
DESCRIBE C S get description of media stream
ANNOUNCE C S announce new session description
SETUP C S create media session
RECORD C S start media recording
PLAY C S start media delivery
PAUSE C S pause media delivery
REDIRECT C S redirection to another server
TEARDOWN C S immediate teardown
SET_PARAMETER C S change server/client parameter
GET_PARAMETER C S read server/client parameter
RTSP Session
media server
RTSPserver
datasource
media player
AVsubsyste
m
RTSPclient
RTSP OK
RTSP PLAY
RTSP OK
RTP AUDIO
RTP VIDEO
RTSP TEARDOWNRTSP OK
get UDP portchooseUDP port
RTSP SETUP
Default port 554
RTCP
TCP
UDP
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
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
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;
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
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.
QUESTIONS?
Thank you for your attention!