Selection of transmission layer protocols for digital video Networks

Source: Internet
Author: User

1. Introduction

Digital video transmission is a communication method that people use vision to obtain information. Compared with other information transmission methods, digital video transmission is accurate, intuitive, and efficient. Due to the large amount of information transmitted by digital videos and limited bandwidth, the compression and encoding of videos, selection of transmission channels and network protocols, and IP multicast technology (IP Multicast) software Implementation Based on the Windows operating platform has become a key technology in network-based digital video transmission applications. Among them, the choice of transmission channels and network protocols is crucial, it will directly affect the real-time performance of digital video transmission and the quality of the video image received by the client after transmission through the network.
Figure 1 shows the basic network-based digital video transmission model. This article will analyze the selection of network transmission protocols for network-based digital video transmission applications.

2. network transmission protocol selection is concentrated on the transport layer

We know that the OSI (Open System Interconnection) network reference model developed by ISO divides the network into seven layers, which are listed in the following order: physical Layer, data link layer, network layer, transmission layer, Session Layer, presentation layer, and application layer. The functions of each layer are independent of each other. The functions implemented by each layer are transparent to the previous layer, and each layer only cares about the services provided by the next layer.

Physical Layer tasks transmit bit streams transparently. data link layer tasks transmit frame-based data without errors on the lines between two adjacent nodes through various protocols, their functions have been solidified by the transmission media and network card and cannot be changed through programming. Therefore, the two layers do not need to be considered during programming. The task at the network layer is to select an appropriate route, to package and transfer data, Netware uses the IPX protocol at this layer, while UNIX and Windows use the IP protocol. The task at the transport layer is to best utilize network resources based on the characteristics of subnets, in addition, it establishes a transmission connection for the two hosts in a reliable and economical way to transmit packets transparently. At this layer, Netware uses the SPX protocol, while Windows uses the TCP/UDP protocol, UNIX uses the TCP protocol. The Session Layer task is used to determine the transmission mode of information between the interconnected hosts, namely, full duplex, half duplex, and ticket. Generally, this parameter is not considered in the LAN; the task of the presentation layer is to format the transmitted data andCodeConversion is generally used for communication between different machines, so there is no such problem between computers, so this layer does not need to be considered; the task at the application layer is to determine the nature of communication between processes to meet users' needs. It is a programming task, but there is no need to make protocol selection. From this point of view, in order to ensure the real-time and image quality of digital video transmission based on the network, the choice of transport layer protocol is the key to the entire design and implementation.

The Internet uses two transmission protocols on the IP layer: one is the transmission control protocol TCP (Transmission Control Protocol), which is a connection-oriented network protocol; another is the user data Datagram Protocol (UDP), which is a connectionless network protocol. Figure 2 shows the concept hierarchy of networks:
Before analyzing and comparing the transport layer protocols, we need to understand the concepts of "connection-oriented" and "No connection. Connection-oriented service is the abstraction of the telephone system service model, that is, every complete data transmission must go through the process of establishing, using, and terminating a connection. During data transmission, each data group uses a connection ID instead of a destination address ). Essentially, a connection is a pipe, and the data sent and received are not only in the same order, but also in the same content. TCP provides connection-oriented virtual circuit services.

The connectionless service is the abstraction of the postal system service. Each group carries a complete Destination Address and each group is transmitted independently in the system. The connectionless service does not guarantee the order of groups. It does not recover and retransmit group errors, and does not guarantee the transmission reliability. UDP provides the connectionless datagram service.

3. TCP is not suitable for transmitting video and audio data in real time

The IP network has been widely used in various scenarios. Among them, the TCP/IP protocol is the industrial standard for the interconnection and communication of Operating Systems in heterogeneous networks. The system is built on TCP/IP to broaden its application scope. However, the pure TCP/IP protocol has been difficult to adapt to the requirements of video and audio communication, especially continuous media streams (such as video streams) communication. TCP is a connection-oriented protocol used to provide virtual circuit services for ordered and reliable data transmission on various networks. Its retransmission mechanism and congestion control mechanism are not suitable for real-time video and audio transmission.

The TCP/IP protocol was initially designed to provide non-real-time data services. The IP protocol is responsible for data transmission between hosts without error detection or error correction. Therefore, data is often lost or out of order. To ensure reliable data transmission, people use the TCP protocol for IP data transmission to improve the error detection and Error Correction capabilities at the receiving end. When packet loss or errors are detected, the sender is required to resend the packet, which inevitably leads to transmission latency and network bandwidth consumption. Therefore, traditional TCP/IP protocols provide poor ability to transmit real-time audio and video data. Of course, TCP is also an option when transmitting the video and audio data used for playback. If there is enough buffer and enough network bandwidth, it is also possible to transmit close to real-time video and audio over TCP. However, if the packet loss rate is high and the network condition is poor, it is almost impossible to use the TCP protocol for video or audio communication.

TCP and other reliable transport layer protocols such as xtp are not suitable for real-time video/audio transmission, mainly due to the following reasons:

3.1 TCP retransmission mechanism

We know that in TCP/IP, when the sender finds data loss, it will require re-transmission of the lost data packet. However, this requires one or more cycles (according to the fast retransmission mechanism of TCP/IP, this requires three additional frame latencies ), this retransmission is almost disastrous for video and audio data communication with high real-time requirements, because the receiver has to wait for the arrival of retransmission data, this results in latency and breakpoint (audio discontinuous or video solidification, etc ).

3.2 TCP congestion control mechanism

TCP's congestion control mechanism reduces its congestion window when detecting packet loss. On the other hand, the number (Bit Rate) produced by audio and video in a specific encoding method cannot be changed suddenly. Correct congestion control should be to change the encoding method of audio and video information, and adjust the frame rate or image width of video information.

3.3 TCP packet header size

Another drawback that TCP is not suitable for real-time video/audio transmission is that its packet header is larger than that of UDP. The TCP packet header is 40 bytes, while the UDP packet header is only 12 bytes. In addition, these reliable transport layer protocols cannot provide time stamps and encoding and decoding information, which is precisely the application of the receiver (client ).ProgramRequired. Therefore, TCP is not suitable for real-time transmission of audio and video information.

3.4 slow startup speed

Even if the network is in good running status and there is no packet loss, a connection needs to be established because of TCP startup. Therefore, it takes a long time to initialize the network, in a real-time video/audio transmission application, the minimum latency is what we expect.

Therefore, TCP is not suitable for transmitting real-time audio and video data. To achieve real-time transmission of audio and video data, we need to seek other channels.
4. RTP protocol is suitable for real-time video and audio transmission.

RTP (Real-time transport protocol)/RTCP (Real-Time Transport Control Protocol) is an application-oriented transport layer protocol, it does not provide any guarantee of Transmission reliability and traffic congestion control mechanism. It is a transmission protocol designed by IETF (Internet Engineering Task Force) for real-time video and audio transmission. The RTP protocol is located on top of the UDP protocol and is functionally independent of the following transport layer (UDP) and network layer, but cannot exist as a layer separately, generally, the lower layer UDP protocol is used to multicast (Multicast) or Unicast (unicast) real-time audio and video data, so as to realize the transmission of multi-point or single-point audio and video data.

UDP is a connectionless Datagram Delivery Service. Although it is not as reliable as TCP, it cannot guarantee the quality of service (QoS) of the real-time video/audio transmission service ), RTCP is required to monitor data transmission and service quality in real time. However, because UDP transmission latency is lower than TCP, it can be well matched with audio and video streams. Therefore, in practical applications, RTP, RTCP, and UDP are used for audio and video media while TCP is used for data and control signaling transmission.

The RTP protocol is designed to provide services for a specific application. In fact, the implementation of the RTP protocol has been integrated into the application. RTP has no connection concept. It can be established either on the underlying connection-oriented protocol or on the underlying connection-oriented protocol. Therefore, RTP is independent of the transport layer. The RTP protocol consists of two parts: the data packet (RTP packet) and the control packet (RTCP ).

The RTP packet consists of the packet header and data. As shown in RTP Header Format 3, the 12 bytes starting with the Fixed Header message header appear in each RTP packet, and the csrc id list only appears when the mixer is inserted.
Through the structure of the RTP packet header, we noticed that there is no "length" field in the RTP packet, because RTP handed over the data segmentation task to the underlying protocol UDP for processing, data is segmented by UDP protocol, and several UDP data packets are formed for transmission.

The RTP protocol carries real-time data, and serves as another protocol supporting the RTCP protocol. RTCP is the control protocol of RTP. It is used to monitor the service quality and the ongoing participants will transmit information, and it runs independently on the underlying protocol. According to the protocol, RTP and RTCP use different network port numbers, RTP selects an even number, and RTCP selects the port number of the next odd number. RTCP is a message sent from the receiving direction. It monitors the network service quality, communication bandwidth, and information transmitted online, and sends the information to the sender. The RTCP package periodically sends messages to all members in the same multicast network.

There are five types of RTCP packets: Sr (Send Report), RR (receive report), sdes (source description), (bye indicates label), and app (application-specific function ). RTCP Message 4.
The basic practice of RTCP is to periodically communicate with all participants in the session and send control packets using the same mechanism as packet distribution and transmission. Like RTP, RTCP also requires lower-layer protocols to provide multiplexing means (for example, UDP must provide different port numbers for reuse ). The main functions of RTCP are as follows:

1. Data transmission quality feedback and QoS Detection

All receivers report their recent receipt to all senders, this information includes the maximum sequence number of the received packets, the number of lost packets, the number of unordered packets, and the timestamp used to estimate the transmission latency. The information reflects the current network condition, and the sender automatically adjusts the transmission rate after receiving the information.

2. synchronization between different media Sets

For example, in the video and audio transmission service, the RTP source may have several media (such as video and audio) that need to be transmitted, the synchronization between these different media depends on the clock information contained in the RTCP and the relevant RTP timestamp information.

3. display the ID of the session participant on the session user interface

The RTP message provides the SSRC field for source identification. However, further descriptions of session participants are required. The source description (SEDS) in the rtcp message provides a detailed description of the session participants, including the name, address, and e-mail. It mainly provides more considerate support for conference and television. Of course, the multicast mode for multiple video servers also provides a good solution.

We know that the continuity of video streams and audio streams on the timeline requires real-time network transmission and high bandwidth, while allowing certain data error rates and data loss rates in transmission. Since RTP itself does not have an independent transmission capability, it must be combined with the low-layer network protocol to complete the data transmission service. Due to the poor relevance between video and audio on the timeline, and the real-time data is higher than its reliability, the RTP/RTCP protocol is used for media (video and audio) over UDP) stream encapsulation, packaging, and synchronization can minimize the network transmission latency of digital audio and video signals.

Based on the detailed analysis of RTP and RTCP packets, we can conclude that compared with TCP, RTP provides a transmission mechanism that is more suitable for real-time video and audio information.

5. Conclusion

If the receiving end and the sending end are in the same LAN, TCP can also achieve better performance in satisfying the real-time performance of video transmission due to full bandwidth guarantee, the video transmission performance of TCP and UDP-based RTP is not much different. Because the bandwidth in the LAN is not the main contradiction, the latency of video data transmission is mainly reflected in the processing latency, which is determined by the processing capability of the processor and the processing mechanism used. At this time, the multi-thread multi-buffer Mechanism Based on Event processing is superior. However, when video data is transmitted in the Wide Area Network, the transmission performance is greatly dependent on the available bandwidth. Because TCP is a connection-oriented transport layer protocol, its retransmission mechanism and congestion control mechanism, the network condition will be deteriorated further, resulting in disastrous latency. At the same time, in this network environment, when the video data transmitted through TCP is re-built and played back at the receiving end, the breakpoint is very obvious, which is obviously intermittent, real-time transmission and transmission quality cannot be guaranteed. Relatively speaking, the real-time and quality of video data transmitted using RTP is much better. (End)

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.