RTP, RTCP protocol Learning-2015.04.15

Source: Internet
Author: User

Recently made video codec part, transmission using RTP protocol. Make a record of learning

1. Introduction

  The real-time Transport protocol (real-time Transport Protocol or abbreviated RTP) is a network transport protocol, which is a multimedia transmission by the IETF Working Group 1996 in RFC Published in 1889. RTP is defined as a transport protocol for transmitting real-time data, such as audio, video, analog data, and it is more focused on the real-time of data transmission than the traditional transport-layer protocol, which provides services including sequence number, time stamp, Transmission control and so on. RTP is typically used in conjunction with the Auxiliary Control Protocol RTCP, RTP is responsible for the transmission of real-time data, and RTCP is responsible for out-of-band management of RTP communications and sessions (such as traffic control, congestion control, session source management, etc.). RTP and RTCP are used together to optimize transmission efficiency with effective feedback and minimal overhead, making it ideal for transmitting real-time data on the web.

2. RTP protocol Level

  

It can be seen that RTP and UDP are located in the transport layer, real-time voice, video data after the analog-to-digital conversion and compression encoding processing, the RTP package is first sent to the RTP data unit, the RTP data unit is encapsulated as a UDP datagram, and then submitted down to IP encapsulation for IP packets. Here's a place to note: RTP packets contain only RTP data, and control is provided by another companion protocol, RTCP. RTP selects an unused even UDP port number between port numbers 1025 through 65535, while RTCP in the same session uses the next odd UDP port number. RTP typically works with RTCP, which sends RTCP messages during the RTP session for each participant cycle. The RTCP message contains packet loss statistics and network congestion information, which the server can use to dynamically change the transmission rate and even change the type of the payload. The RTCP message is also encapsulated as a UDP datagram for transmission.

3. RTP Protocol Encapsulation

  

Version (V): 2 bits

Indicates the RTP version number. The version number specified in the initial version of the Protocol 0,rfc3550 is 2.

Padding (P): 1 bit

If the bit is set, additional additional information is included at the end of the packet, and the last byte of the additional information represents the length of the extra additional information (including the byte itself). This field exists because some encryption mechanisms require a fixed-length block of data, or in order to transfer multiple RTP packets in a single underlying protocol data unit.

Extension (X): 1 bit

If the bit is set, there is an extension header after the fixed head, which is defined in RFC3550 5.3.1.

CSRC count (CC): 4 bits

The number of CSRC tags that exist after the head is fixed.

Marker (M): 1 bit

The function of this bit depends on the definition of the profile. Profile can change the length of the bit, but keep the marker and payload type Total length constant (8 bit altogether).

Payload Type (PT): 7 bits

The type of information that is tagged with the RTP packet, the standard type is listed in RFC3551. If the receiver does not recognize the type, the packet must be ignored.

Sequence Number:16 bits

Serial number, after each RTP packet is sent, the serial number is added 1, and the receiver can rearrange the packet order based on the serial number.

Timestamp:32 bits

Time stamp. Reflects the sampling time of the first byte in the packet carried by the RTP packet.

Ssrc:32 bits

The data source identity. Each data stream should have a different ssrc in the course of an RTP session.

CSRC list:0 to the items, each source identifies

The contribution data source identification. Only valid when there is mixer. such as a voice stream that combines multichannel voice streams into a single channel, the SSRC of each channel is listed here.

4, about the RTP class library.

Read some information on the Internet,. NET aspect to the RTP encapsulation to see a RTP.NET.DLL. There is a personal blog dedicated to this DLL, today just try to receive a bit, found that can receive data. When using this DLL, there was "additional information: the mixed-mode assembly was generated for the" v2.0.50727 "version of the runtime and cannot be loaded in the 4.0 runtime without additional information being configured. "Exception, the workaround is simple. Add under configuration in App. Config

<startup uselegacyv2runtimeactivationpolicy= "true" >
<supportedruntime version= "v4.0"/>
</startup>

5. Summary

(1) Some studies on the theory of RTP, I think it is still possible to understand the use of the above.

(2) The initial call RTP.NET.DLL, can receive the data

(3) The data sent is tested using the VLC Media Player tool

(4) There are a lot of references, but also extracts.

Record a little bit every day, you can progress a little bit ....

  

RTP, RTCP protocol learning -2015.04.15

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.