Troubleshooting RTSP

RTSP is an application-layer control protocol that is used for the control of a single or multiple time-synchronized streams of continuous media such as audio and video. The purpose of RTSP is to provide control over remote media servers. It is used when we click on Play, Pause, and so on, and can be used also to invite a new media server for viewing on the screen, for example, for a conference. While RTSP is the control protocol, the streaming itself is usually carried out by RTP—which carries the data—and RTCP —used for the monitoring of the data transfer.

The RTSP standard (RFC2326) does not define any transport protocol, but most implementations use TCP. RTSP is commonly used while watching IPTV. In this recipe we will learn how to monitor and troubleshoot these streams.

Getting ready

RTSP monitoring should be used in cases in which you experience transmission disturbances; for example, problems with the media player control or cases with connectivity problems to a server. RTSP works as illustrated in the following diagram:

Getting ready

When monitoring a stream, we can have problems with RTP/RTCP (discussed earlier in the chapter), HTTP (discussed in Chapter 10, HTTP and DNS), or even TCP problems (discussed in Chapter 9, UDP/TCP Analysis). In this recipe we will talk about RTSP (the center line with long dashes in the preceding diagram).

The web server and the media servers can be on single or multiple physical servers, or on different virtual machines. The functionality in any case is as presented.

How to do it...

To find problems with RTSP, connect the instance of Wireshark with port mirror to the client experiencing the problems, and in the case of multiple clients, connect it to a mutual link or to the server.

  1. To view all RTSP traffic, filter the packets with TCP port 554; the filter for this is tcp.port==554.

    Tip

    The filter tcp.port == 554 gives us all traffic over this port, while filter rtsp only gives us packets in which Wireshark is recognized as an RTSP header.

  2. To view RTSP requests and responses, navigate to RTSP | Packet Counter from the Statistics menu as described earlier in this chapter. Error responses are those with code values that are higher than 400.
    How to do it...
  3. Look for RTSP response codes that are 4xx or higher. To do so, you can configure the display filter rtsp.status >= 400.

How it works...

As with SIP (which is used for signaling, while RTP is used for the transport of the media), the streams controlled by RTSP may use any transport protocol; in many cases, they also use RTP. The protocol is intentionally similar in syntax and operation to HTTP and uses the same syntax.

The most common RTSP methods (commands) are (C-Client, S-Server):

Command

Direction

Function

OPTIONS

C to S or S to C

Determines capabilities of server/client

DESCRIBE

C to S

Gets description of media stream

ANNOUNCE

C to S or S to C

Announces a new session's description

SETUP

C to S

Creates a media session

PLAY

C to S

Starts media delivery

RECORD

C to S

Starts media recording

PAUSE

C to S

Pauses media delivery

REDIRECT

S to C

Redirects to another server

TEARDOWN

S to C

Performs immediate teardown

The response categories are:

Code series

Type

Meaning

1xx

Informational

Request received, continue with processing

2xx

Success

The action was successfully received, understood, and accepted

3xx

Redirection

Further action must be taken in order to complete the request

4xx

Client error

The request contains bad syntax or cannot be fulfilled

5xx

Server error

The server failed to fulfill an apparently valid request

There's more...

In the following screenshot you see a typical RTSP stream:

There's more...

The typical RTSP stream is processed in the following order:

  1. A DESCRIBE request is sent to the server, asking to retrieve the description of a presentation or media object identified by the request URL from that server, and the server replies with 200 OK.
  2. A GET_PARAMETER request retrieves the parameter value of a presentation or stream specified in the URI.
  3. A SETUP request is sent to open the audio stream and is confirmed with 200 OK.
  4. A SETUP request is sent to open the audio stream and is confirmed with 200 OK.
  5. A PLAY request is sent to the server to start playing the stream.
  6. A SET_PARAMETER request is sent to the server to set a parameter value for a presentation or stream specified by the URI.
  7. The stream starts to play with RTP.

In the following screenshot, we see how the stream is broken down:

There's more...

The process for the breakdown of the stream is as follows:

  1. SET_PARAMETER is sent to the server to set a parameter value for a presentation or stream specified by the URI.
  2. A second SET_PARAMETER request is sent to the server.
  3. The TEARDOWN command is sent to close the connection.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.190.182