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.
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:
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.
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.
tcp.port==554
.rtsp.status >= 400
.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 |
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 |
In the following screenshot you see a typical RTSP stream:
The typical RTSP stream is processed in the following order:
In the following screenshot, we see how the stream is broken down:
The process for the breakdown of the stream is as follows:
18.216.190.182