18.3. Real-Time Media Transport ProtocolsIn real-time applications, a stream of data is sent at a constant rate. This data must be delivered to the appropriate application on the destination system, using real-time protocols. The most widely applied protocol for real-time transmission is the Real-Time Transport Protocol (RTP), including its companion version: Real-Time Control Protocol (RTCP). UDP cannot provide any timing information. RTP is built on top of the existing UDP stack. Problems with using TCP for real-time applications can be identified easily. Real-time applications may use multicasting for data delivery. As an end-toend protocol, TCP is not suited for multicast distribution. TCP uses a retransmission strategy for lost packets, which then arrive out of order. Real-time applications cannot afford these delays. TCP does not maintain timing information for packets. In real-time applications, this would be a requirement. 18.3.1. Real-Time Transport Protocol (RTP)The real-time transport protocol (RTP) provides some basic functionalities to real-time applications and includes some specific functions to each application. RTP runs on top of the transport protocol as UDP. As noted in Chapter 8, UDP is used for port addressing in the transport layer and for providing such transport-layer functionalities as reordering . RTP provides application-level framing by adding application-layer headers to datagrams. The application breaks the data into smaller units, called application data units (ADUs). Lower layers in the protocol stack, such as the transport layer, preserve the structure of the ADU. Real-time applications, such as voice and video, can tolerate a certain amount of packet loss and do not always require data retransmission. The mechanism RTP uses typically informs a source about the quality of delivery. The source then adapts its sending rate accordingly . If the rate of packet loss is very high, the source might switch to a lower-quality transmission, thereby placing less load on the network. A real-time application can also provide the data required for retransmission. Thus, recent data can be sent instead of retransmitted old data. This approach is more practical in voice and video applications. If a portion of an ADU is lost, the application is unable to process the data, and the entire ADU would have to be retransmitted. Real-Time Session and Data TransferThe TCP/IP and OSI models divide the network functionalities, based on a layered architecture. Each layer performs distinct functions, and the data flows sequentially between layers. The layered architecture may restrict the implementation on certain functions out of the layered order. Integrated layer processing dictates a tighter coupling among layers. RTP is used to transfer data among sessions in real time. A session is a logical connection between an active client and an active server and is defined by the following entities:
RTP uses two relays for data transmission. A relay is an intermediate system that acts as both a sender and a receiver. Suppose that two systems are separated by a firewall that prevents them from direct communication. A relay in this context is used to handle data flow between the two systems. A relay can also be used to convert the data format from a system into a form that the other system can process easily. Relays are of two types: mixer and translator . A mixer relay is an RTP relay that combines the data from two or more RTP entities into a single stream of data. A mixer can either retain or change the data format. The mixer provides timing information for the combined stream of data and acts as the source of timing synchronization. Mixers can be used to combine audio streams in real-time applications and can be used to service systems that may not be able to handle multiple RTP streams. The translator is a device that generates one or more RTP packets for each incoming RTP packet. The format of the outgoing packet may be different from that of the incoming packet. A translator relay can be used in video applications in which a high-quality video signal is converted to a lower-quality in order to service receivers that support a lower data rate. Such a relay can also be used to transfer packets between RTP entities separated by an application-level firewall. Translators can sometimes be used to transfer an incoming multicast packet to multiple destinations. RTP Packet HeaderRTP contains a fixed header and an application-specific variable-length header field. Figure 18.8 shows the RTP header format. The RTP header fields are:
Figure 18.8. Packet format for the real-time transport protocolOverall, the main segment of an RTP header includes 12 bytes and is appended to a packet being prepared for multimedia application. 18.3.2. Real-Time Control Protocol (RTCP)The Real-Time Transport Protocol (RTCP) also runs on top of UDP. RTCP performs several functions, using multicasting to provide feedback about the data quality to all session members. The session multicast members can thus get an estimate of the performance of other members in the current active session. Senders can send reports about data rates and the quality of data transmission. Receivers can send information about packet-loss rate, jitter variations, and any other problems they might encounter. Feedback from a receiver can also enable a sender to diagnose a fault. A sender can isolate a problem to a single RTP entity or a global problem by looking at the reports from all receivers. RTCP performs source identification . RTCP packets contain some information to identify the source of the control packet. The rate of RTCP packets must also be kept to less than 5 percent of the total session traffic. Thus, this protocol carries out "rate control" of RTCP packets. At the same time, all session members must be able to evaluate the performance of all other session members. As the number of active members in a session increases , the transmission rates of the control packets must be reduced. RTCP is also responsible for session control and can provide some session-control information, if necessary. Packet Type and FormatRTCP transmits control information by combining a number of RTCP packets in a single UDP datagram. The RTCP packet types are sender reports (SR), receiver reports (RR), source descriptor (SDES), goodbye (BYE), and application-specific types . Figure 18.9 shows some RTCP packet formats. The fields common to all packet types are as follows :
Figure 18.9. Format of the SR packet in RCTPFigure 18.9 also shows a typical format of a sender report. The report consists of the common header fields and a block of sender information. The sender report may also contain zero or more receiver report blocks, as shown in the figure. The fields in the sender information block are:
The SR packet includes zeros or more RR blocks. One receiver block is included for each sender from which the member has received data during the session. The RR block includes the following fields:
Receivers in RTCP can provide feedback about the quality of reception through a receiver report. A receiver that is also a sender during a session, it also sends the sender reports. 18.3.3. Estimation of Jitter in Real-Time TrafficThe jitter factor is a measure of the delay experienced by RTP packets in a given session. The average jitter can be estimated at the receiver. Let us define the following parameters at the receiver:
The difference interval d i is given by Equation 18.1
The estimated average jitter until the time of packet i arrival is given by Equation 18.2
where k is a normalizing coefficient. The interarrival jitter value indicated in the sender report provides useful information on network conditions to the sender and the receiver. The jitter value can be used as an estimate to calculate the variation of network congestion. RTP packet-sequence numbers are used to help a receiver sequence packets in order to recover lost packets. When packets arrive out of order at the receiver, the sequence number can be used to assemble data packets. Consider Figure 18.10. When certain packets are lost, the gaps are filled in with previously received data packets. As shown in the figure, packet D is replayed twice, since packet C is lost. This mechanism can help reduce the pips and clicks in voice signals owing to lost packets. This reconstructed data stream is sent to the receiver, with the lost packets replaced by previously received packets. This can significantly improve the latency. Figure 18.10. Missing voice packets and reconstructing the data stream
|