(1) Introduction to concepts
RTP (Real-Time Transport Protocol) is defined as a transmission protocol for transmitting real-time data, such as audio, video, and analog data, compared with the traditional high-reliability data transmission transport layer protocol, it focuses more on real-time data transmission, services provided by this Protocol include data sequence numbers, time tags, and transmission control. RTP usually works with the auxiliary control protocol RTCP. RTP is only responsible for real-time data transmission, RTCP (RTP control ptotocol) provides out-of-band management for RTP communication and sessions (such as traffic control, congestion control, and session source management ).
(2) RTP/RTCP protocol layers and Encapsulation
RTP is located on the transport layer (usually UDP). Under the application, real-time voice and video data are first sent to RTP as RTP data units after Analog-to-analog conversion and compression encoding, the RTP data unit is encapsulated as a UDP datagram, and then submitted to the IP address as an IP packet.
RTP groups only contain RTP data, while control is provided by another supporting protocol RTCP. RTP selects an unused even UDP port number between the port number 1025 and the port number 65535, And the RTCP in the same session uses the next odd UDP port number. RTP usually works with RTCP. During an RTP session, each participant sends an RTCP message periodically. RTCP messages contain Packet Loss Statistics and network congestion information of sent data, which can be used by the server to dynamically change the transmission rate. RTCP messages are also encapsulated as UDP datagram for transmission. The RTCP protocol processor defines five types of packets: RR: Cycler report; SR:
Sender report; sdes: source description items; bye: indicates end of participant; app: application specific functions. They are used to receive, analyze, generate, and send control packets.
(3) RTP Header Information
Version (V): 2 bits, indicating the RTP version number. The initial version of the protocol is 0, and the version number specified in rfc3550 is 2.
Padding (P): 1 bit. If this bit is set, additional information is included at the end of the packet, the last byte of the additional information indicates the length of the additional information (including the byte itself ). This field exists because some encryption mechanisms require fixed-length data blocks, or to transmit multiple RTP packages in an underlying protocol data unit.
Extension (x): 1 bit. If this bit is set, an extension header exists behind the Fixed Header. The format is defined in rfc3550 5.3.1.
CSRC count (CC): 4 bits, the number of CSRC tags after the Fixed Header.
Marker (m): 1 bit. The function of this bit depends on the definition of profile. Profile can change the length of this bit, but keep the total length of marker and payload type unchanged (8 bits in total ).
Payload type (PT): 7 bits, which indicates the type of information carried by RTP packet. Standard types are listed in rfc3551. If the receiver cannot recognize this type, the packet must be ignored.
Sequence Number: 16 bits, serial number. After each RTP packet is sent, the serial number is added with 1. the receiver can rearrange the packet sequence according to the serial number.
Timestamp: 32 bits, timestamp. Indicates the sampling time of the first byte in the information packet carried by RTP packet.
SSRC: 32 bits, data source ID. Each data stream in an RTP session should have a different SSRC.
CSRC list: 0 to 15 items. Each source ID is 32 bits, which contributes to the data source ID. It is valid only when mixer exists. For example, if a multi-channel speech stream is merged into a single-channel speech stream, the SSRC of each original audio channel is listed here.
(4) RTSP
The RTSP (Real Time Streaming Protocol) Protocol defines how to effectively transmit multimedia data over an IP network. It is a multimedia description protocol from a client to a server. For details, see rfc2326. RTSP is an application layer protocol that is very similar to HTTP. Each release and media file is also defined as RTSP upl. The publishing information of a media file is written into a file called a media publishing file, which will be described later. The description of this file includes the encoder, language, rtsp uls, address, and port number with several other parameters. The published file can be obtained by email or HTTP on the client.
RTSP protocol features: RTSP is an application layer protocol, designed together with RTP and RSVP for full streaming services. RTSP is flexible and can be used on multiple operating systems. It allows clients to interact with service platforms of different vendors. RTSP is based on RTP and RTCP in the architecture. It uses RTP for data transmission and transfers streaming media data to the client over the network. RTSP can maintain a fixed connection between your computer and the transmission stream service server. It is used to communicate with viewers and Unicast (unicast) servers and also allows two-way communication. Viewers can communicate with streaming media servers. RTSP provides operations similar to "VCR", such as pause, fast forward, reverse, and jump. The resource object operated can be a live stream or a storage segment. RTSP is set and also provides the selection of transmission channels, such as UDP or multi-point UDP.
(5) Resource Reservation Protocol (RSVP)
The RSVP (resorce Reservation Protocol) Resource Reservation Protocol is not a routing protocol, but a signaling protocol in an IP network. It is combined with the routing protocol to achieve the quality of service (QoS) for network transmission). RSVP was proposed to support Internet integrated services. This is a technology that solves the QoS (Service Quality) Problem in IP communication and is used to ensure Point-to-End transmission bandwidth.
RSVP is a significant step forward for IP routers to provide better service quality. Traditionally, an IP router is only responsible for group forwarding and knows the address of the neighboring router through the routing protocol. RSVP, like the signaling protocol of the circuit switching system, provides quality assurance for each node (IP router) through which a data stream is notified.
(6) Conclusion
We have discussed four Protocols related to real-time data transmission:
A. RTP is a real-time data transmission protocol. It provides time marks, serial numbers, and other methods to ensure the processing time during real-time data transmission. It relies on RVSP to ensure the quality of service.
B. RTCP is the control part of RTP and is used to ensure service quality and manage members.
C. RTSP is used to start and guide streaming media data from the Streaming Media Server. It can also be called the "online video recorder control protocol". It provides remote control, and the specific data transmission is handed over to RTP.
D. RSVP is the Resource Reservation Protocol on the Internet. It uses RSVP to reserve some network resources (that is, bandwidth), which can provide QoS for streaming media transmission to a certain extent. Just like TCP's re-transmission and sliding windows.
Http://my.oschina.net/hundre/blog/12855 ()