RTP/RTCP protocol

Source: Internet
Author: User

Warning: The original page of this article http://www.cnblogs.com/moonvan/archive/2011/09/11/2173448.html

On the basis of a slight modification, if there is infringement, please notify the deletion, thank you!

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 Transport Protocol), real-time Transmission Control Protocol RTCP (real-time

Transport Control Protocol) and real-time Streaming protocol RTSP (real-time streaming Protocol), the location of such protocols in the IP/TCP protocol

Shown

Figure 1 Location of the streaming media protocol in the IP/TCP protocol

Figure 2 TCP/IP model and the corresponding protocols for each layer

RTP/RTCP protocol

RTP protocol

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 grouped in the RTP package and

The RTP packet is given to the UDP Jack interface. At the receiving end, the RTP packet enters the application layer through the UDP socket interface, and the program code written by the developer is used to group the RTP

To extract the application data block.

RTP working mechanism: When an application establishes a RTP session, the application determines a pair of destination transport addresses. Destination transfer address consists of a network address and a pair of port groups

Into, 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 signal RTCP data to the adjacent odd UDP port (even UDP port +1), which constitutes 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, and at the same time it

The RTCP in the conversation uses the next odd UDP port number. Port numbers 5004 and 5005 are used as the default port numbers for RTP and RTCP, respectively. RTP Packet Header Format 3

The first 12 bytes are required.

Figure 3 The header format of the RTP packet

RTCP Protocol

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 packets can be encapsulated in a UDP user datagram

In The RTCP packet is periodically sent online, with a statistical report on the quality of service delivered to and from the 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.