RFC 3047

RTP Payload Format for ITU-T Recommendation G.722.1

๐Ÿ“… published January 2001, from ietf

RFC 3047: RTP Payload Format for ITU-T Recommendation G.722.1 โœจ

Okay bestie, here's the title block tea ๐Ÿซถ. This is RFC 3047 by P. Luthi (that's Patrick Luthi, from PictureTel ๐ŸŽ€). It's a Standards Track doc dated January 2001 ๐Ÿ“…, part of the Network Working Group ๐ŸŒธ. The header doesn't list anything it obsoletes or updates, so it's standing on its own ๐Ÿ’….

Status of This Memo โœจ

This is an Internet standards track protocol for the Internet community, and it's literally asking for discussion and suggestions for improvements ๐Ÿ—ฃ๏ธ. For the standardization state and status of this protocol, check the current "Internet Official Protocol Standards" (STD 1) ๐Ÿ“œ. Distribution of this memo is unlimited ๐ŸŒˆ.

Copyright (C) The Internet Society (2001). All Rights Reserved. ๐ŸŽ€

Abstract ๐Ÿงš

ITU-T Recommendation G.722.1 is a wide-band audio codec ๐ŸŽถ, and it runs at one of two selectable bit rates, 24kbit/s or 32kbit/s. This doc describes the payload format for putting G.722.1 generated bit streams inside an RTP packet ๐Ÿ“ฆ. It also covers the necessary details for using G.722.1 with MIME and SDP ๐Ÿ’œ.

1. Conventions used in this document ๐Ÿ“

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC-2119 [6]. These are the caps words that really matter, so read them like a rule ๐Ÿ”ฅ.

2. Overview of ITU-T Recommendation G.722.1 ๐ŸŒŸ

G.722.1 is a low complexity coder ๐Ÿง . It compresses 50Hz - 7kHz audio signals into one of two bit rates, 24 kbit/s or 32 kbit/s ๐ŸŽง.

The coder may be used for speech, music and other types of audio ๐ŸŽต. It's giving versatile.

Some of the applications it's suitable for are:

  • Real-time communications such as videoconferencing and telephony.
  • Streaming audio
  • Archival and messaging

A fixed frame size of 20 ms is used โฑ๏ธ, and for any given bit rate the number of bits in a frame is a constant. Consistency is everything ๐Ÿ’–.

3. RTP payload format for G.722.1 ๐ŸŽ€

G.722.1 uses 20 ms frames and a sampling rate clock of 16 kHz โฐ. So the RTP timestamp MUST be in units of 1/16000 of a second. The RTP payload for G.722.1 has the format shown in Figure 1 ๐Ÿฆ‹. No additional header specific to this payload format is required, so it's super lean ๐Ÿ“.

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                      RTP Header [3]                           |
   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
   |                                                               |
   +                 one or more frames of G.722.1                 |
   |                             ....                              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Figure 1: RTP payload for G.722.1

The encoding and decoding algorithm can change the bit rate at any 20ms frame boundary ๐Ÿ”„. The catch is that no bit rate change notification is provided in-band with the bit stream ๐Ÿ™ˆ. So a separate out-of-band method is REQUIRED to indicate the bit rate (see section 6 for an example of signaling bit rate information using SDP). For the payload format specified here, the bit rate MUST remain constant for a particular payload type value. An application MAY switch bit rates from packet to packet by defining two payload type values and switching between them ๐Ÿ’….

The assignment of an RTP payload type for this new packet format is outside the scope of this document, and it will not be specified here ๐Ÿ™…โ€โ™€๏ธ. It is expected that the RTP profile for a particular class of applications will assign a payload type for this encoding. If that is not done, then a payload type in the dynamic range shall be chosen ๐Ÿงš.

The number of bits within a frame is fixed. Inside that fixed frame, G.722.1 uses variable length coding (e.g., Huffman coding) to represent most of the encoded parameters [2] ๐Ÿงฉ. All variable length codes are transmitted in order from the left most (most significant - MSB) bit to the right most (least significant - LSB) bit, see [2] for more details.

The use of Huffman coding means it is not possible to identify the various encoded parameters/fields contained within the bit stream without first completely decoding the entire frame ๐Ÿ˜ญ. Lowkey a whole mood.

For the purposes of packetizing the bit stream in RTP, it is only necessary to consider the sequence of bits as output by the G.722.1 encoder, and to present the same sequence to the decoder. The payload format described here maintains this sequence โœจ.

When operating at 24 kbit/s, 480 bits (60 octets) are produced per frame. When operating at 32 kbit/s, 640 bits (80 octets) are produced per frame. So both bit rates allow for octet alignment without the need for padding bits ๐Ÿ™Œ.

Figure 2 illustrates how the G.722.1 bit stream MUST be mapped into an octet aligned RTP payload ๐Ÿ—บ๏ธ.

An RTP packet SHALL only contain G.722.1 frames of the same bit rate ๐Ÿšซ.

   first bit                                          last bit
   transmitted                                     transmitted
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                         |
   + sequence of bits (480 or 640) generated by the          |
   |            G.722.1 encoder for transmission             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


   |           |           |                     |           |
   |           |           |     ...             |           |
   |           |           |                     |           |


   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... +-+-+-+-+-+-+-+-+-+-+-+-+
   |MSB...  LSB|MSB...  LSB|                     |MSB...  LSB|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... +-+-+-+-+-+-+-+-+-+-+-+-+
     RTP         RTP                               RTP
     octet 1     octet 2                           octet
                                                   60 or 80

     Figure 2:  The G.722.1 encoder bit stream is split into
                a sequence of octets (60 or 80 depending on
                the bit rate), and each octet is in turn
                mapped into an RTP octet.

The ITU-T standardized bit rates for G.722.1 are 24 kbit/s and 32kbit/s ๐ŸŽฏ. But the coding algorithm itself can run at any user specified bit rate (not just 24 and 32kbit/s) while still maintaining an audio bandwidth of 50 Hz to 7 kHz ๐Ÿคฏ. This rate change is accomplished by a linear scaling of the codec operation, which gives frames with size in bits equal to 1/50 of the corresponding bit rate ๐Ÿ“.

When operating at non-standard rates, the payload format MUST follow the guidelines illustrated in Figure 2 ๐Ÿ“‹. It is RECOMMENDED that values in the range 16000 to 32000 be used, and that any value MUST be a multiple of 400. This keeps octet alignment, so you don't need (undefined) padding bits for each frame if it's not octet aligned ๐Ÿ™ˆ. For example, a bit rate of 16.4 kbit/s results in a frame of size 328 bits or 41 octets, which are mapped into RTP per Figure 2 ๐Ÿฐ.

3.1 Multiple G.722.1 frames in a RTP packet ๐Ÿ“

More than one G.722.1 frame may be included in a single RTP packet by a sender ๐Ÿ“จ.

Senders have the following additional restrictions:

  • SHOULD NOT include more G.722.1 frames in a single RTP packet than will fit in the MTU of the RTP transport protocol.
  • All frames contained in a single RTP packet MUST be of the same length. That is, they MUST have the same bit rate (octets per frame).
  • Frames MUST NOT be split between RTP packets.

It is RECOMMENDED that the number of frames contained within an RTP packet be consistent with the application. For example, in a telephony application where delay is important, the fewer frames per packet, the lower the delay. For a delay insensitive streaming or messaging application, many frames per packet would be acceptable ๐Ÿ“ž๐ŸŽฌ.

3.2 Computing the number of G.722.1 frames ๐Ÿงฎ

Information describing the number of frames contained in an RTP packet is not transmitted as part of the RTP payload ๐Ÿ™ƒ. The only way to determine the number of G.722.1 frames is to count the total number of octets within the RTP packet, then divide the octet count by the number of expected octets per frame. That's either 60 or 80 per frame, for 24 kbit/s and 32 kbit/s respectively ๐Ÿง .

4. MIME registration of G.722.1 ๐Ÿ“ฎ

Here's the registration info, bestie ๐Ÿ’–:

  • MIME media type name: audio
  • MIME subtype: G7221
  • Required parameters:
    • bitrate: the data rate for the audio bit stream. This parameter is necessary because the bit rate is not signaled within the G.722.1 bit stream. At the standard G.722.1 bit rates, the value MUST be either 24000 or 32000. If using the non-standard bit rates, then it is RECOMMENDED that values in the range 16000 to 32000 be used, and that any value MUST be a multiple of 400 (this maintains octet alignment and does not then require (undefined) padding bits for each frame if not octet aligned).
  • Optional parameters:
    • ptime: RECOMMENDED duration of each packet in milliseconds.
  • Encoding considerations: This type is only defined for transfer via RTP as specified in a Work in Progress.
  • Security Considerations: See Section 6 of RFC 3047.
  • Interoperability considerations: none
  • Published specification: See ITU-T Recommendation G.722.1 [2] for encoding algorithm details.
  • Applications which use this media type: Audio and video streaming and conferencing tools
  • Additional information: none
  • Person & email address to contact for further information: Patrick Luthi, Luthip@pictel.com
  • Intended usage: COMMON
  • Author/Change controller:
    • Author: Patrick Luthi
    • Change controller: IETF AVT Working Group

5. SDP usage of G.722.1 ๐ŸŽถ

When conveying information by SDP [5], the encoding name SHALL be "G7221" (the same as the MIME subtype) ๐Ÿ’…. An example of the media representation in SDP for describing G.722.1 at 24000 bits/sec might be:

m=audio 49000 RTP/AVP 121
a=rtpmap:121 G7221/16000
a=fmtp:121 bitrate=24000

where "bitrate" is a variable that may take on values of 24000 or 32000 at the standard rates, or values from 16000 to 32000 (and MUST be an integer multiple of 400) at the non-standard rates ๐ŸŒˆ.

6. Security Considerations ๐Ÿ”๐Ÿ’–

okay bestie, this section is SO important so pay attention ๐Ÿ‘€โœจ RTP packets that use this payload format are subject to the security considerations in the RTP spec [3], plus any appropriate RTP profile ๐ŸŽ€. So like, confidentiality of the media streams is achieved by encryption ๐Ÿ”’. And the compression here is applied end-to-end, so you can encrypt after compressing and there's no conflict between the two ๐Ÿ’…. Iconic, no notes.

Now the DoS vibes ๐Ÿ˜ฌ. Some encodings use compression that puts a non-uniform load on the receiver. Like, an attacker can sneak pathological datagrams into the stream that are super complex to decode and totally overload the receiver ๐Ÿ’€. BUT this encoding doesn't show any significant non-uniformity, so we're safe on that front ๐Ÿซถ.

And then there's the general IP thing ๐ŸŒ. A receiver can get overloaded just from receiving too many packets, whether they're wanted or not. Network-layer authentication can be used to drop packets from unwanted sources, but the processing cost of the authentication itself might be too high ๐Ÿ˜ญ. In multicast, pruning specific sources may be added in future versions of IGMP [7] and in multicast routing protocols so a receiver can pick which sources get to reach it ๐Ÿฆ‹.

7. References ๐Ÿ“š

  1. Bradner, S., "The Internet Standards Process -- Revision 3", BCP 9, RFC 2026, October 1996.
  2. ITU-T Recommendation G.722.1, available online from the ITU bookstore at http://www.itu.int.
  3. Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson, "RTP: A Transport Protocol for real-time applications", RFC 1889, January 1996. (Updated by a Work in Progress.)
  4. Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996.
  5. Handley, M. and V. Jacobson, "SDP: Session Description Protocol", RFC 2327, April 1998.
  6. Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  7. Deering, S., "Host Extensions for IP Multicasting", STD 5, RFC 1112, August 1989.

8. Acknowledgments ๐Ÿ™๐ŸŒธ

the author wants to thank Tony Crossman for starting this G.722.1 packetization work and for writing the first draft ๐Ÿซถ. The author also thanks Steve Casner and Colin Perkins for their super valuable feedback and helpful comments ๐Ÿ’œ.

9. Author's Address ๐Ÿ“ฎ

Patrick Luthi PictureTel Corporation 100 Minuteman Road Andover, MA 01810 USA

Phone: +1 (978) 292 4354 EMail: luthip@pictel.com

Copyright (C) The Internet Society (2001). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement ๐Ÿ’Œ

Funding for the RFC Editor function is currently provided by the Internet Society โœจ.

๐Ÿ“ฆ where this page comes from