RTSP

dargspurNetworking and Communications

Oct 27, 2013 (3 years and 7 months ago)

143 views

Telekooperation

1




Agenda

A brief overview to RTP and RTCP

Telekooperation

2


:

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

3


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

4


:

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

5


Architecture

:

Telekooperation

6


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

7


:

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

8




Telekooperation

9


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

10


RTCP packet structure



Telekooperation

11


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

12


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

13


Questions

Find more on the online slides



Telekooperation

14




Agenda

Streaming Motivation

The RTSP/RTP Session Overview

Bits from example Session

Telekooperation

15




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

16




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

17




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

18




Applications



-

Lectures, seminars

-

On
-
demand instruction

-

Entertainment: specialty content (cf. youtube)

-
Voice mail

-

P2P video streaming

Telekooperation

19




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

20




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

21




RTSP and HTTP: similarities



Protocol format: text, MIME
-
headers


Request/response = request line + headers + body


Status codes


Security mechanisms


URL format

Telekooperation

22




RTSP is not HTTP


-

Server state needed

-

Different methods

-

Server


client

-

Protocol Extension posssible:


Extensions start with “x
-
”, e.g.: x
-
historyLog



Telekooperation

23




Agenda

Streaming Motivation

The RTSP/RTP Session Overview

Bits from example Session

Telekooperation

24




RTSP / RTP Session

Telekooperation

25




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

26




RTSP Request headers

Accept



media description formats

Accept
-
Encoding

encoding of media format

Accept
-
Language

human language

Authorization


basic and digest authentication

Bandwidth


client bandwidth available

Conference


conference identifier

From



name of requestor

If
-
Modified
-
Since

conditional retrieval

Range



time range to play

Referer


how did we get here?

Scale



(play time)/(real time)

Speed



speed
-
up delivery

User
-
Agent


software

Telekooperation

27




RTSP Response headers

Location


redirection

Proxy
-
Authenticate

authenticate to proxy

Public



methods supported

Retry
-
After


busy, come back later

Server



server software

Vary



cache tag

WWW
-
Authenticate

request authorization



Hint:

All headers and bodies end with a double carriage return line feed.

Telekooperation

28




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

29




Agenda

Streaming Motivation

The RTSP/RTP Session Overview

Bits from example Session

Telekooperation

30




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

31




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



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

RTP Interaction

Telekooperation

32




Summary

-

Internet multimedia
-
on
-
demand

-
Integrated services

-
Protocol Extensions

-

Conferencing

-

Telephony

-

WebTV as VOD

-

Flexible plug and play RTSP/RTP/AVP/SDP ….