Thursday, July 31, 2014

RTP Basics - Part II - RTP Packet structure


The real time media data is transmitted forms a RTP payload. RTP header contains information related to the payload e.g. source size, encoding type etc. The header structure will be defined a bit later. 



Since the RTP packet cannot be transmitted as is, it need to be placed in the UDP packet. And UDP packet needs to be sent inside an IP packet. In addition, to transfer the IP packet over the wires, we need to put that inside other packets which is very lower level. 

Below given is the detailed view of RTP header 




The fields are mainly 

version (V) : 2 bits 
This field identifies version of the RTP. the value is 2 upto RFC 1889

Padding ( P ): 1 bit 
IF the padding is set, the packet contains one or more padding octets at the end which are not part of payload. The last octet of the padding contains a count of how many padding octets should be ignored. The padding may be needed by some encryption algorithms with fixed block size or for carrying several RTP packets at a lower-layer protocol data unit. 

extension ( X ) : 1  bit 
IF the extension bit is set, the fixed header is followed by exactly one header extension. 

CSRC count (CC) : 4 bits 
The CSRC count contains the number of CSRC identifiers that follow the fixed header. 

marker (M) : 1 bit 
Marker bit is used for specific applications to serve the purpose of its own. This is mainly used for Application level framing 

Payload Type : (PT) 7 bits 
This field identifies the format (e.g. encoding) of the RTP payload that determines its interpreting by the application. This field is not intended for multiplexing separate media. 

Sequence number : 16bits 
The sequence number increase by 1 for each RTP data packet sent and may be used by the receiver to detect the packet loss and to restore the packet sequence. The initial value of this sequence is random (unpredictable) 

timestamp : 32 bits
 The timestamp reflects the sampling instant of the first octet in the RTP data packet. The sampling instant must be derived from a clock that increments moronically and linearly in time to allow synchronisation and jitter calculations. 

SSRC : 32 bits 
The SSRC field identifies the synchronisation source. this identifier is chosen randomly, with the intent that no two synchronisation sources within the same RTP session has the same SSRC identifier 

CSRC list : 0 to 15 items, 32 bits each
The CSRC list identifies the contributing sources for the payload contained in this packet. The number of identifiers in the given in the CC field. IF there are more than 15 contributors only 15 may be identified. CSRC identifiers are inserted by mixers, using the SSRC identifiers of contributing sources. 


References: 
http://www.siptutorial.net/RTP/header.html

No comments:

Post a Comment