Real-time Transport Protocol (RTP) is the protocol designed to handle real-time traffic on the Internet. RTP does not have a delivery mechanism (multicasting, port numbers, and so on); it must be used with UDP. RTP stands between UDP and the application program. Fig. 1 shows the format of the RTP packet header.
- Ver. This 2-bit field defines the version number. The current version
is 2.
- P. This 1-bit field, if set to 1, indicates the presence of padding
at the end of the packet. In this case, the value of the last byte in
the padding defines the length of the padding. Padding is the norm if
a packet is encrypted. There is no padding if the value of the P
field is 0.
- X. This 1-bit field, if set to 1, indicates an extra extension header
between the basic header and the data. There is no extra extension
header if the value of this field is 0.
- Contributor count. This 4-bit field indicates the number of
contributors. Note that we can have a maximum of 15 contributors
because a 4-bit field only allows a number between 0 and 15.
- M. This 1-bit field is a marker used by the application to indicate,
for example, the end of its data.
- Payload type. This 7-bit field indicates the type of the payload.
Several payload types have been defined so far.
We list some common applications in Table 1.
- Sequence number. This field is 16 bits in length. It is used to
number the RTP packets. The sequence number of the first packet is
chosen randomly; it is incremented by 1 for each subsequent packet.
The sequence number is used by the receiver to detect lost or out of
order packets.
- Timestamp. This is a 32-bit field that indicates the time
relationship between packets. The timestamp for the first packet is a
random number. For each succeeding packet, the value is the sum of
the preceding timestamp plus the time the first byte is produced
(sampled). The value of the clock tick depends on the application.
For example, audio applications normally generate chunks of 160
bytes; the clock tick for this application is 160. The timestamp for
this application increases 160 for each RTP packet.
- Synchronization source identifier. If there is only one source, this
32-bit field defines the source. However, if there are several
sources, the mixer is the synchronization source and the other
sources are contributors. The value of the source identifier is a
random number chosen by the source. The protocol provides a strategy
in case of conflict (two sources start with the same sequence
number).
- Contributor identifier. Each of these 32-bit identifiers (a maximum
of 15) defines a source. When there is more than one source in a
session, the mixer is the synchronization source and the remaining
sources are the contributors.