rtsp analysis wireshark

18
www.dsp-ip.com Fast Forward Your Development RTSP SDP Wireshark Analysis

Upload: yossi-cohen

Post on 21-May-2015

16.735 views

Category:

Technology


9 download

DESCRIPTION

Analysis and explanation of RTSP/SDP session with wireshark

TRANSCRIPT

Page 1: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

RTSP SDP Wireshark Analysis

Page 2: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

•Real Time Streaming Protocol

•Used for controlling streaming data over the web.

•Designed to efficiently broadcast audio/video-on-demand to large groups.

•Using Directives to control the stream▫Options, Describe, Setup, Play, Pause,

Record, Teardown.

Page 3: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

• Describes the metadata of the stream.• Mainly used in: SIP, RTSP and other Multicast

sessions. • Sample SDP description:

▫ v=0 ▫ o=jdoe 2890844526 2890842807 IN IP4 10.47.16.5 ▫ s=SDP Seminar ▫ i=A Seminar on the session description protocol u=

http://www.example.com/seminars/sdp.pdf [email protected] (Jane Doe)

▫ c=IN IP4 224.2.17.12/127 ▫ t=2873397496 2873404696 ▫ a=recvonly ▫ m=audio 49170 RTP/AVP 0 ▫ m=video 51372 RTP/AVP 99 ▫ a=rtpmap:99 h263-1998/90000

Session IDSession ID

Protocol VersionProtocol Version

Session NameSession Name

Session Info.Session Info.

Description URI Description URI

Connection Info.Connection Info.

Active session timeActive session time

Session Attribute linesSession Attribute lines

Media Name and Transport addressMedia Name and Transport address

Media Attribute linesMedia Attribute lines

Page 4: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

Web

Browser

Media

Player

Media

Server

Web

Server

ClientClient ServerServer

HTTP GETHTTP GET

Stream URIStream URI

SETUPSETUP

PLAYPLAY

RTP Media Stream

RTP Media Stream

PAUSEPAUSE

TEARDOWNTEARDOWN

DESCRIBEDESCRIBE

OPTIONSOPTIONS

RTP Media Stream

RTP Media Stream

SDP InformationSDP Information

Page 5: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

•version▫The version of rtsp. (RTSP/1.0)

•URL[rtsp/rtspu]://host:port/path

*port – the actual stream will be delivered in other port

Reliable protocol (TCP)

Reliable protocol (TCP)

unreliable protocol (UDP)

unreliable protocol (UDP)

legal domain

name or IP address

legal domain

name or IP address

port used to control the stream

port used to control the stream

the server stream path

the server stream path

Page 6: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

• Session ID ▫ Generated by the server▫ Stays constant for the entire session

• SMPTE – Relative timestamp▫ A relative time from the beginning of the stream.▫ Nested types: smpte-range, smpte-type, smpte-time.▫ smpte-25=(starttime)-(endtime)

• UTC – Absolute time▫ Absolute time using GMT.▫ Nested types: utc-range, utc-time. utc-date▫ utc-time = (utcdate)T(utctime).(fraction)Z

• NPT - Normal Play Time▫ Absolute position from the beginning of the presentation.▫ npt=123.45-125

Page 7: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

InitiationInitiation

HandlingHandling

TerminationTermination

Page 8: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

OPTIONS – Request for information about the communication options available by

the Request-URI.

• CSeq – the request id, a response with the same id will be sent from the server.

•Media URL – the URL of the video.

•Client Player – the user agent of the client.

Media URLMedia URL

Client PlayerClient Player

Request IDRequest ID

Page 9: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

• All RTSP response codes are divided into 5 ranges (RFC 2326 7.1.1) :

1xx – Informational, 2xx – Success 3xx – Redirection, 4xx – Client Error, 5xx – Server Error.

CSeq has the same value as the request CSeq field.

• The server response will return the available methods that it supports.

It May contain any arbitrary data the server want to expose.

Response CodeResponse Code

Available Options

Available Options

Page 10: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

DESCRIBE is used to retrieve the description of the media URL and the session.

The description response MUST contain all media and streaming data needed in order to initialize the session.

Fields: Accept - Used to inform the server which description methods the client supports.

Session Description Protocol (SDP) is highly used.

Notice that CSeq field is increased by one.

Description readersDescription readers

Page 11: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

Description readersDescription readers

SDPSDP

The response will always return the details of the media.

SDP details will be next…

The media URL the response is referring toThe media URL the response is referring to

The description method usedThe description method used

The length of the SDP messageThe length of the SDP message

Page 12: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

GET_PARAMETER is used to retrieve information about the stream.

The request can be initiated from the Client or from the Server.

The request/response message body is left to server/client implementation.

The parameters can be: packets received, jitter, bps or any other relevant information about the

stream.

Page 13: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

SETUP is used to specify the transport details used to stream the media.

The request/response message body is left to server/client implementation.

The parameters can be: packets received, jitter, bps or any other relevant information about the

stream.

Transport protocolTransport protocol Unicast/MulticastUnicast/Multicast RTP/RTSP client media port

RTP/RTSP client media port

Track IDTrack ID

Page 14: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

SETUP response will contain the session ID.

For each track ( audio/video ) a different SETUP request will be made

After the response is received, a PLAY request can be made to start receiving the media stream.

Transport protocol

Transport protocol

Unicast/Multicastserver option

Unicast/Multicastserver option

Unicast destination ip

Unicast destination ip

Last gateway source ip

Last gateway source ip

The client port to receive

media data

The client port to receive

media data

The server port to receive

media data

The server port to receive

media data

Page 15: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

PLAY request tells the server to start send data through the streaming details defined in the

SETUP process.

PLAY request maybe queued so that a PLAY request arriving while a previous PLAY request is

still active is delayed until the first has been completed.

Normal Play TIme

Normal Play TIme

Page 16: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

Stream URLStream URL

PAUSE request tells the server to pause the streaming.

When the user will want to start the stream again he’ll send a PLAY request to the same URL.

The request may contain time information to handle when the pause will take effect.

Page 17: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

TEARDOWN stops the stream delivery for the URL specified.

Informs the server that the client is disconnecting from it.

The response will include only the response code.

Description readersDescription readers

Page 18: RTSP Analysis Wireshark

www.dsp-ip.comFast Forward Your Development

• RECORD: ▫ Initiates recording operation given a time

information and stream URL.

• REDIRECT: ▫ Server to Client request that informs the client he

needs to switch the server he connected to.The request will contain the new server URL.

• SET_PARAMETER: ▫ sends a request to change a value of the

presentation stream.The response code will contain the answer.

• ANNOUNCE: ▫ Can be initiated both by client/server. Informs the

recipient that the SDP table of the object has changed.