1 Streaming Media protocol
There are two main ways to transfer audio and video information on the Internet today: Download and streaming.
In the case of download, the user needs to download the entire media file locally before the media file can be played. Streaming refers to the pre-processing of multimedia (reducing quality and efficient compression) before transmission, and then using a caching system to ensure that the data is continuously and correctly transmitted. The use of streaming can be downloaded side-by-side to watch streaming programs, you can achieve online live, video conferencing and so on.
Currently, the protocols that support streaming media transmission are: real-time Transmission protocol RTP, real-time Transmission Control Protocol RTCP and real-time Streaming protocol RTSP (real-time streaming Protocol), etc., as shown in position 1 of the IP/TCP protocol.
Figure 1 Location of the streaming media protocol in the IP/TCP protocol
2 RTP/RTCP Protocol
The RTP protocol is the standard presented by Ieif, and the corresponding RFC document is RFC3550. As shown in 1, RTP provides end-to-end data transport for real-time applications, but does not provide any quality of service assurance, and the quality of service is provided by RTCP. From the application developer's point of view, RTP should be part of the application layer. At the sending end of the application, the developer must write the program code that is grouped with the RTP package, and then give the RTP packet to the UDP socket interface. At the receiving end, the RTP packet enters the application layer through the UDP socket interface, and the application data block is extracted from the RTP packet using the program code written by the developer.
RTP works by: When an application establishes a RTP session, the application determines a pair of destination transport addresses. Destination transport address consists of a network address and a pair of ports, there are two ports: one to the RTP packet, one to the RTCP packet, so that the RTP/RTCP data can be sent correctly. RTP data is sent to even-numbered UDP ports, and the corresponding control signals RTCP data to the adjacent odd UDP ports (even UDP port +1), which makes up a UDP port pair. The sending process for RTP is as follows, and the receiving process is the opposite.
1) The RTP protocol receives the streaming media information stream (such as H.263) from the upper layer, encapsulates the RTP packet, and RTCP receives the control information from the upper layer and encapsulates the RTCP control package.
2) RTP sends the RTP packet to the UDP port pair even port, and RTCP sends the RTCP control packet to the odd port in the UDP port pair.
RTP packets contain only RTP data, and control is provided by the RTCP protocol. RTP selects an unused even UDP port number between 1025 and 65535, while RTCP in the same session uses the next odd UDP port number. Port numbers 5004 and 5005 are used as the default port numbers for RTP and RTCP, respectively. The first 12 bytes of the RTP packet are shown in header format 2, which is required.
Figure 2RTP Header format for grouping
The main functions of the RTCP protocol are: monitoring and feedback of quality of service, synchronization between media, and identification of members in a multicast group. RTCP packets are also transmitted using UDP, but the RTCP does not encapsulate sound or video groupings. Multiple RTCP groupings can be encapsulated in a single UDP user datagram. The RTCP packet is periodically transmitted on-line, with a statistical report of the quality of service to the sending and receiving end.
RTCP contains five types of grouping
1) End grouping BYE means closing a data stream.
2) a specific app grouping app enables applications to define new grouping types.
3) The receiving End report packet RR is used to enable the receiving side to periodically report to all points in multicast mode.
4) The Send Side report group SR is used to enable the sending side to periodically report to all receivers in multicast mode.
5) Source Point Description Group SDEs gives a description of the participants in the session.
RTP/RTCP Protocol Introduction