http://en.wikipedia.org/wiki/Real-time_Transport_Protocol
bit offset | 0-1 | 2 | 3 | 4-7 | 8 | 9-15 | 16-31 | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Ver. | P | X | CC | M | PT | Sequence Number | |||||||||||||||||||||||||
32 | Timestamp | |||||||||||||||||||||||||||||||
64 | SSRC identifier | |||||||||||||||||||||||||||||||
96 | CSRC identifiers (optional) ... | |||||||||||||||||||||||||||||||
96+(CC×32) | Extension header (optional). | |||||||||||||||||||||||||||||||
96+(CC×32) + (X×((EHL+1)×32)) | Data |
The RTP header has a minimum size of 12 octets.
-
Ver.
- (2 bits) Indicates the version of the protocol. Current version is 2. P (Padding)
- (1 bit) Used to indicate if there are extra padding bytes at the end of the RTP packet. X (Extension)
- (1 bit) Indicates presence of an Extension header between standard header and payload data. CC (CSRC Count)
- (4 bits) Contains the number of CSRC identifiers that follow the fixed header. M (Marker)
- (1 bit) Used at the application level and is defined by a profile. If it is set, it means that the current data has some special relevance for the application. PT (Payload Type)
- (7 bits) Indicates the format of the payload and determines its interpretation by the application. See RTP profiles for the defined types. Sequence Number
- (16 bits) The sequence number increments by one for each RTP data packet sent, and may be used by the receiver to detect packet loss and to restore packet sequence. Timestamp
- (32 bits) The timestamp reflects the sampling instant of the first data in the RTP data packet. The sampling instant MUST be derived from a clock that increments monotonically and linearly in time to allow synchronization and jitter calculations. The resolution of the clock MUST be sufficient for the desired synchronization accuracy and for measuring packet arrival jitter (one tick per video frame is typically not sufficient). The clock frequency is dependent on the format of data carried as payload and is specified statically in the profile or payload format specification that defines the format, or MAY be specified dynamically for payload formats defined through non-RTP means. If RTP packets are generated periodically, the nominal sampling instant as determined from the sampling clock is to be used, not a reading of the system clock.By default the value is 0 which means it is infinite SSRC
- (32 bits) Synchronization source identifier uniquely identifies the source of a stream. CSRC
- Contributing source IDs enumerate contributing sources to a stream which has been generated from multiple sources. Extension header
- The first 32-bit word contains a profile specific identifier (16 bits) and a length specifier (16 bits) that indicates the length of the extension (EHL=extension header length) in 32-bit units, excluding the 32 bits of the extension header.