RTSP

advertisement
Agenda
A brief overview to RTP and RTCP
Telekooperation
1
Real-Time Transport Protocol (RTP)
Protocol to the continuous transmission of audiovisual data
(streams) over IP-based networks
Product of Internet Engineering Task Force, AVT WG
Standardized first in 1996
 RFC 1889
In 2003, a revised RFC
 RFC 3550 which obsoletes RFC 1889.
:
Telekooperation
2
RTP goals
lightweight: specification and implementation
flexible: provide mechanism, don’t dictate algorithms
protocol-neutral: UDP/IP, ST-II, IPX, ATM-AALx, . . .
scalable: unicast, multicast from 2 to O(10^7)
separate control/data: some functions may be taken over by
conference control protocol
secure: support for encryption, possibly authentication
:
Telekooperation
3
RTP overview
RTP is a packet-based protocol
 usually running over UDP
Transport multimedia data streams (audio, video, text, etc.) over
networks
 Encode
 Package
 Send
It applies in many areas
 IP telephony technologies (H.323, SIP)
RTP is mainly used for transmission of realtime sensitive data flows,
while the Real-Time Streaming Protocol (RTSP) manages and
controls the data transmission.
:
Telekooperation
4
Architecture
:
Telekooperation
5
The RTP header
Ver. (2 bits)
 Indicates the version of the protocol. Current version is 2.
P (1 bit)
 Indicates if there are extra padding bytes at the packet.
X (1 bit)
 Indicates if protocol extensions are being used in the packet.
CC (4 bits)
 Number of CSRC identifiers that follow the fixed header.
M (1 bit)
 If it is set, data has some special relevance for the application.
PT (7 bits)
 Format of the payload and determines its interpretation by the application.
:
Telekooperation
6
What else
Synchronisation Source
 The data source, characterized by an identifier (32 bit) in the header
Mixer
 Switching center, which receive RTP packets from one or multiple sources and
forward them.
 Mix packages (and synchronizes) and can carry out format conversions.
Translator
 Don‘t modify packets, but route through firewalls etc.
Reciever
 The reciever of the RTP packets sorts them on the basis of the sequence
numbers and submits them to the respective application.
:
Telekooperation
7
Telekooperation
8
Real Time Control Protocol (RTCP)
Dient der Aushandlung und Einhaltung von Quality of Service (QoS)
Parametern durch den periodischen Austausch von
Steuernachrichten zwischen Sender und Empfänger
Mittels:
1. Rückmeldung der bisher erbrachten Dienstqualität, wodurch eine
Anpassung der Übertragungsrate erfolgen kann
2. Identifikation aller Sitzungsteilnehmer, wodurch semantisch
zusammenhängende aber getrennt gesendete Medienströme
synchronisiert werden können
3. Steuerung der für RTCP-Pakete verwendeten Bandbreite, damit
der Austausch von RTCP-Nachrichten nicht die Übertragung
behindert, was bei vielen Sitzungsteilnehmern passieren könnte.
Telekooperation
9
RTCP packet structure
Telekooperation
10
RTCP sender reports (SR)
SSRC of sender: identifies source of data
NTP timestamp: when report was sent
RTP timestamp: corresponding “RTP time”  lip sync
sender’s packet count: total number sent
sender’s octet count: total number sent
followed by zero or more receiver report
Telekooperation
11
RTCP receiver reports (RR)
SSRC of source: identifies who’s being reported on
fraction lost: binary fraction
cumulative number of packets lost: long-term loss
highest sequence number received: compare losses, disconnect
interarrival jitter: smoothed interpacket distortion
LSR: time last SR heard
DLSR: delay since last SR
Telekooperation
12
Questions
Find more on the online slides
Telekooperation
13
Agenda
Streaming Motivation
The RTSP/RTP Session Overview
Bits from example Session
Telekooperation
14
RTSP
Wikipedia:
The Real Time Streaming Protocol (RTSP), developed by the IETF and
created in 1998 as RFC 2326, is a protocol for use in streaming media
systems which allows a client to remotely control a streaming media
server, issuing VCR-like commands such as "play" and "pause", and
allowing time-based access to files on a server.
The sending of streaming data itself is not part of the RTSP protocol. Most
RTSP servers use the standards-based RTP as the transport protocol for
the actual audio/video data, acting somewhat as a metadata channel.
…
Telekooperation
15
Resources on the Web
Wikipedia is a good start:
http://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol
RFC RTSP: http://tools.ietf.org/html/rfc2326
RFC RTP: http://tools.ietf.org/html/rfc3550
Tutorial on RTSP:
http://www.myiptv.org/Articles/RTSP/tabid/72/Default.aspx
Pictures and parts of text taken from:
http://www.cs.columbia.edu/~hgs/rtsp/
Telekooperation
16
Streaming vs. Television
- reuse existing infrastructure
- flexible media: modem, wireless, cable, LAN, . . .
- Quality scales from stamp-size flipbook to HDTV – adaptive
- Side information easy (closed captioning)
- Easy integration with WWW
- Security through encryption
- Cheap authoring, service lots of content
Telekooperation
17
Applications
- Lectures, seminars
- On-demand instruction
- Entertainment: specialty content (cf. youtube)
- Voice mail
- P2P video streaming
Telekooperation
18
Challenges
bandwidth: 64–128 kb/s for talking heads, 1.5 Mb/s for movies
quality: packet loss, predictability
reliability: makes CATV look good. . .
billing infrastructure: pay-per-view?
cheap receivers: shouldn’t cost more than set-top box
Telekooperation
19
Internet real-time & multimedia protocols
resource reservation: RSVP, …
media transport: RTP, AVP, …
stream control: RTSP
stream description: SDP, …
SDP: http://tools.ietf.org/html/rfc4566
AVP: http://www.ece.osu.edu/~zheng/publications/AVP-protocol.pdf
Telekooperation
20
RTSP and HTTP: similarities
Protocol format: text, MIME-headers
Request/response = request line + headers + body
Status codes
Security mechanisms
URL format
Telekooperation
21
RTSP is not HTTP
- Server state needed
- Different methods
- Server  client
- Protocol Extension posssible:
Extensions start with “x-”, e.g.: x-historyLog
Telekooperation
22
Agenda
Streaming Motivation
The RTSP/RTP Session Overview
Bits from example Session
Telekooperation
23
RTSP / RTP Session
Telekooperation
24
RTSP URLs
Whole presentation:
rtsp://media.example.com:554/twister
track within presentation:
rtsp://media.example.com:554/twister/audiotrack
but: name hierarchy != media hiearchy != file system
Telekooperation
25
RTSP Request headers
Accept
Accept-Encoding
Accept-Language
Authorization
Bandwidth
Conference
From
If-Modified-Since
Range
Referer
Scale
Speed
User-Agent
media description formats
encoding of media format
human language
basic and digest authentication
client bandwidth available
conference identifier
name of requestor
conditional retrieval
time range to play
how did we get here?
(play time)/(real time)
speed-up delivery
software
Telekooperation
26
RTSP Response headers
Location
Proxy-Authenticate
Public
Retry-After
Server
Vary
WWW-Authenticate
redirection
authenticate to proxy
methods supported
busy, come back later
server software
cache tag
request authorization
Hint:
All headers and bodies end with a double carriage return line feed.
Telekooperation
27
Time Formats
smpte=0:10:00
“Society of Motion Picture and Television
Engineers” - hour:minute:second:frame
- optional
npt=126.315
Normal play time - {hh;mm;ss}.ms
- mandatory
Rtptime= 1324433
Part of RTP, needed to differentiate between
emission time and media time
seq=1214324432
part of RTP != time; sequence number of first
frame
Telekooperation
28
Agenda
Streaming Motivation
The RTSP/RTP Session Overview
Bits from example Session
Telekooperation
29
Unicast session: open streams
C->S:
SETUP rtsp://audio.com/twister/audio.en RTSP/1.0
CSeq: 1
Transport: RTP/AVP/UDP;unicast;client_port=3056-3057
S->C:
RTSP/1.0 200 OK
CSeq: 1
Session: 12345678
Transport: RTP/AVP/UDP;unicast;
client_port=3056-3057;server_port=5000-5001
C->S:
SETUP rtsp://video.com/twister/video RTSP/1.0
CSeq: 1
Transport: RTP/AVP/UDP;unicast;client_port=3058-3059
S->C:
RTSP/1.0 200 OK
CSeq: 1
Session: 23456789
Transport: RTP/AVP/UDP;unicast;
client_port=3058-3059;server_port=5002-5003
Error
Codes
listed in
RFC, but
same as
HTTP
Telekooperation
30
Unicast session: play
C->S:
PLAY rtsp://video.com/twister/video RTSP/1.0
CSeq: 2
Session: 23456789
Range: smpte=0:10:00-
S->C:
RTSP/1.0 200 OK
CSeq: 2
Session: 23456789
Range: smpte=0:10:00-0:20:00
RTP-Info: url=rtsp://video.com/twister/video;seq=12312232;rtptime=78712811
C->S:
PLAY rtsp://audio.com/twister/audio.en RTSP/1.0
CSeq: 2
Session: 12345678
Range: smpte=0:10:00-
S->C:
RTSP/1.0 200 OK
RTP Interaction
CSeq: 2
Session: 12345678
Range: smpte=0:10:00-0:20:00
RTP-Info: url=rtsp://audio.com/twister/audio.en;seq=876655;rtptime=1032181
Telekooperation
31
Summary
- Internet multimedia-on-demand
- Integrated services
- Protocol Extensions
- Conferencing
- Telephony
- WebTV as VOD
- Flexible plug and play RTSP/RTP/AVP/SDP ….
Telekooperation
32
Download