Thursday, October 7, 2010

Real Time Streaming Protocol (RTSP protocol)

RTSP is co-sponsored by the RealNetworks and Netscape, and the one to many application protocol defines how IP networks through the delivery of multimedia data. RTSP is located in the system structure on top of RTP and RTCP, which uses TCP or RTP for data transmission. Compared with the RTSP HTTP, HTTP send HTML, and RTP is the multimedia data transmission. HTTP request sent by the client, the server responds; use RTSP, the client and the server can request that the RTSP can be bidirectional.
Real Time Streaming Protocol (RTSP) is the application-level protocol to control real-time data transmission. RTSP provides an extensible framework to enable real-time data, such as audio and video, controlled, on-demand possible. Data sources include field data and the data stored in the clip. The agreement aims to control the multiple data transmission connections, for the selection of transmission channels, such as UDP, multicast UDP and TCP, provides a means for selection is based on the transmission mechanism of RTP method.
1 Introduction
1.1 Purpose
Real Time Streaming Protocol (RTSP) to create and control one or several time synchronization of continuous streaming. Despite the continuous media stream cross-flow and control is possible, usually it does not in itself sends a continuous stream. In other words, RTSP acts as a network media server remote control. RTSP connection is not bound to the transport layer connection, such as TCP. During the RTSP connection, RTSP user can turn on or off multiple reliable transport connections to the server to issue RTSP requests. In addition, you can use connectionless transport protocols such as UDP. RTSP stream flow control may be used RTP, RTSP operation but does not depend on the media used to carry a continuous transport mechanism. Real Time Streaming Protocol and in HTTP/1.1 syntax and operation is similar to HTTP extension mechanism so big can join RTSP. Supported Operating Agreement as follows:
To retrieve the media from the media server:
Users can submit a HTTP or other means demo description. If presentation is multicast, demo-style to include the multicast for continuous media address and port. If only a single broadcast presentation to the user, the user should be provided for security purposes address.
Media Server invited to enter the meeting:
Media server can be invited to participate in the ongoing session, or play back the media, or record a part, or all. This model is useful for distributed educational applications, meeting only a few turns at the remote control button.
The media added to the existing lecture:
If the server tells the user access to additional media content, on-site seminar is especially useful. If similar in HTTP/1.1, RTSP requests can be agents, channels and cache handling.

1.2 Protocol Features
RTSP characteristics are as follows:
Scalability:
New methods and parameters can easily add RTSP.
Easy to resolve:
By standard HTTP or MIME RTSP desorption parses.
Safety:
RTSP uses web security mechanisms.
Independent of the transmission:
RTSP can use the unreliable datagram protocol (UDP), reliable datagram protocol (RDP), such as application-level reliability to achieve, you can use a reliable stream protocol.
Multi-server support:
Each stream can be placed on different servers, the client automatically with a few different servers, concurrency control connection establishment, the media synchronization in transport layer implementation.
Recording equipment control:
Agreement can control recording and playback equipment.
Flow control and separation of meeting:
Session initiation protocol only required to provide, or can be used to create a unique session identification number. Special circumstances, SIP or H.323
Can be used to invite the server to join.
Suitable for professional applications:
Through SMPTE time scale, RTSP supports frame-level accuracy, allow remote digital editing
Demo description neutral:
Agreement did not impose a special presentation or meta file format type can be used for transmission; However, presentation description must contain at least one RTSP URI.
Proxy and firewall friendly:
Agreement may be processing the application and transport layer firewall. Firewalls need to understand the SETUP method to open a UDP stream "gap."
HTTP-friendly:
Here, RTSP wise use of HTTP, thus allowing the present structure can be reused. Structure including the Internet Content Selection Platform (PICS). In most cases, control of the continuous media requires server state, RTSP not only add to the HTTP method.
The appropriate server control:
If a user starts a stream, he must also stop a stream.
Transfer coordination;
Actual processing of continuous media streams, the user can coordinate transmission method.
Performance Coordination:
Basic features, such as invalid, there must be some clean mechanism for users to decide which method did not take effect. This allows the user to make the appropriate user interface.
1.3 Extended RTSP
Since not all media servers have the same functionality, media servers, the request is necessary to support different sets. RTSP can be extended in three ways as follows, where to change the order of:
A new parameter expansion. If users need to reject notice and method of extension does not support the requirements of the tags on the join section.
Adding a new method. If the recipient does not understand the information request, return error code 501 (not yet implemented), the sender should not try this approach. Users can use the OPTIONS method to query the server to support the method. Server to use public response header lists the supported methods.
Define a new version of protocol that allows to change all the parts. (In addition to protocol version number location)
1.4 Operation Mode
Each presentation and media stream can be identified RTSP URL. Demonstrate the composition of the entire presentation with the media attribute defined by a presentation description file. Using HTTP or other means users can see this file, it is not necessary to save the media server.
To illustrate, suppose presentation describes a number of presentations described, each of which demonstrates to maintain a public timeline. To simplify the description, and without loss of generality, assume that description does include a demo presentation. Presentation can contain multiple media streams. In addition to the media parameters, the network destination address and port also needs to decide. Distinguish between several modes of operation the following:
Unicast:
The port number to the user to select the media sent to the RTSP request source.
Multicast, server chooses address:
Select Media Server multicast address and port, which is commonly used live or quasi-demand approach.
Multicast, the user selects the address:
If the server to join the ongoing multicast session, multicast address, port and key is given by the conference description.
1.5 RTSP status
RTSP control stream sent through a separate agreement with the control channel. For example, RTSP control through TCP connection, and data flow through the UDP. Therefore, even if the media server does not receive the request, the data will continue to send. In connection lifetime, a single media stream can be different TCP connection request in order to control. Therefore, the server needs to maintain the flow and RTSP requests can contact the connection status. RTSP and state in many ways irrelevant, but the following methods in the definition of the allocation of server resources and application of flow plays an important role:
SETUP:
Allocation of resources to flow to the server, start the RTSP connection.
PLAY AND RECORD:
Start SETUP distribution of stream data transmission.
PAUSE:
Temporary stop the stream, without releasing server resources.
TEARDOWN:
Free flow of resources, RTSP connection stops.
Identification method uses the connection state of the first section of RTSP RTSP connection identification, in response to SETUP requests, the server connection
Then generate connection identifier.

1.6 Relationship with other agreements
RTSP and HTTP in the functional overlap, and the HTTP interaction is reflected in the initial contact with streaming content through the web page. The current protocol specification aims to allow the realization of the web server and media server RTSP difference between the delivery point. For example, the presentation description can be retrieved through the HTTP and RTSP, which reduces the transmission from the browser, but also to allow independent RTSP server and the user failure to rely on HTTP.
However, RTSP and HTTP essential difference is that the data is sent to different agreements. HTTP protocol is asymmetric, the user makes a request, the server response. RTSP, the media can request the user and the server, and the requests are stateless; in a long time after confirmation request, can set parameters to control the media stream. Reuse of HTTP functionality is good, at least in two aspects, namely security and proxies. Requirements are very close to the cache, agents, and authorized the use of HTTP feature is valuable.
When most real-time media using RTP as the transport protocol, RTSP is not tied to RTP. RTSP assumes the existence presentation description format that contain several media streams can be a demonstration of static and temporary properties.

2 protocol parameters

3 RTSP message
RTSP is a text-based protocol, using ISO 10646 character set, using UTF-8 encoding scheme. CRLF line to interrupt, but the receiver itself can explain the trip to CR and LF terminator. The agreement enables text-based ways to increase self-described optional parameters easier. As the number of parameters and commands a lower frequency, efficiency did not attract attention. If carefully examined, the text is easy to deal with scripting languages (such as: Tcl, Visual Basic and Perl) implementation of the prototype.
10646 character set character set to avoid sensitive switch, but the application is not visible. RTCP also uses this encoding scheme. Significant bit with the ISO 8859-1 character said that if 100001x 10xxxxxx.. RTSP messages can be carried by any low-level transport protocol.
Request including the method, the method of its role in the further description of the object and method arguments. Method can also be designed for the server side need only a small amount or no state maintenance. When information contained in the message body, message body length as factors:
Regardless of whether the entity in the first section of information does not include information the total body response to the first paragraph of information and blank lines after the end of the first.
In case of the first paragraph content length, its value in bytes, said message body length. If not there the first paragraph, and its value is zero.
Server closes the connection.
Note: RTSP does not currently support the HTTP/1.1 "block" transfer encoding, content length header needed. If the return to an appropriate length of presentation descriptions, even dynamically generated, so no need to block transmission code, the server should be able to determine its length. Any entity, even if the content length must be, and the length did not explicitly given, the rules ensure reasonable behavior.
Server from the user to request information included in the first line source approach, the source identification and protocol version used. RTSP defines additional status codes, but does not define any HTTP code.
4 entities
If the request method or response status is not coded limit, request and response information can be transferred entity, the entity by the entity headers and body composition questions, and some respond to only include the entity header. In this, according to whom the sending entity, who receives entities, sender and recipient refer to the user and server, respectively.
Optional entity body of the first custom entity meta-information, if there is no physical body, that the request identifies the resource. Extension header mechanism allows additional entity defined in the first paragraph, without changing the agreement, but these sections can not assume that the receiver can recognize. Identification of the first paragraph should not be ignored by the receiver, and let the agent forwarding.
5 connections
RTSP requests can be transmitted in several different ways:
1, persistent transport connection for multiple request / response transmission.
2, each request / response transmission of a connection.
3, no connection mode.
Type of transport connection is defined by the RTSP URI. Of the "rtsp" scheme requiring continuous connection; and "rtspu" program, call the RTSP request, without a connection.
Unlike HTTP, RTSP allows the media server, the user sends a request to the media. However, this support only when a persistent connection, otherwise there is no reliable way to reach the media server user, this is a request from the media server through the firewall, the only way to spread the user.
6 method definition
Method of notation of resources to perform the method, it is case sensitive. New methods can be defined in the future, but can not begin with $.
Some firewalls may require the design and other environmental RTSP server into the methods and flow data. Because client and server into operation will enable complex, and impose additional costs, unless it is necessary, should be avoided. Insert binary data transmission only when RTSP only be used by TCP. Streaming data (such as RTP packets) encapsulated with a ASCII dollar sign followed by a one byte channel identification, followed by the length of binary data package, the two-byte integer. Followed by stream data, not CRLF, but including high-level protocol headers. Each $ block contains a high-level protocol data unit.
When the transfer is selected as RTP, RTCP messages are also inserted into the server through the TCP connection. By default, RTCP packets higher than the RTP channel sent on the first available channel. Client may explicitly request another RTCP packet channel, which can be transmitted by specifying the parameters of the two head into the channels to do so. When two or more streams cross, in order to achieve synchronization, you need to RTCP. And this is when the network connection settings need to be controlled via TCP through the RTP / RTCP provides a convenient way possible, on the UDP transport.
7 pipelining
Supports persistent connections or no connection to their clients may request queue. Server receives the request must be issued the same order of response. If the request is not sent to the multicast group, the recipient to confirm the request, if there is no confirmation message, the sender can be more than one round-trip time (RTT) after the re-send the same message.
Estimated RTT in TCP, the initial value of 500 ms. Finally, the measured application cache RTT, the initial value for future connections. Such as using a reliable transport protocol RTSP, the request does not allow re-issued, RTSP application in turn dependent on the reliability of low-level transport provider. If two low-level reliable transmission (such as TCP and RTSP) application of retransmission requests, each packet loss may result in two retransmissions. As the transmission stack on the first attempt to reach those who received the application layer will not be sent before the retransmission, the receiver can not make full use of application-layer retransmissions. Such as packet loss caused by the obstruction of different retransmission layers will block further deterioration. When the header is used to avoid the retransmission ambiguity problem, to avoid dependence on the cone algorithm. CSeq header of each request to carry a serial number, each send a different request, it plus one. If not recognized and re-issued as a request, the request must carry the original serial number.
Implementation of the system must support the RTSP TCP transport RTSP, and support for UDP. On UDP and TCP, RTSP server's default port is 554. Many purposes the same RTSP packets are packaged into a single low-level PDU or TCP streams. RTSP with RTP and RTCP data packets cross. Unlike HTTP, RTSP message must contain a Content-Length header, regardless of when information contained load. Otherwise, RTSP packets to the end of a blank line, followed by the last header

No comments:

Post a Comment