idnits 2.17.1 draft-ietf-payload-g7110-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 23, 2014) is 3412 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) -- Possible downref: Non-RFC (?) normative reference: ref. 'G.711.0' -- Possible downref: Non-RFC (?) normative reference: ref. 'G.711' -- Possible downref: Non-RFC (?) normative reference: ref. 'G.711-AP1' -- Possible downref: Non-RFC (?) normative reference: ref. 'G.711-A1' Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Ramalho, Ed. 3 Internet-Draft P. Jones 4 Intended status: Standards Track Cisco Systems 5 Expires: June 26, 2015 N. Harada 6 NTT 7 M. Perumal 8 Ericsson 9 L. Miao 10 Huawei Technologies 11 December 23, 2014 13 RTP Payload Format for G.711.0 14 draft-ietf-payload-g7110-04 16 Abstract 18 This document specifies the Real-Time Transport Protocol (RTP) 19 payload format for ITU-T Recommendation G.711.0. ITU-T Rec. G.711.0 20 defines a lossless and stateless compression for G.711 packet 21 payloads typically used in IP networks. This document also defines a 22 storage mode format for G.711.0 and a media type registration for the 23 G.711.0 RTP payload format. 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on June 26, 2015. 42 Copyright Notice 44 Copyright (c) 2014 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 60 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3 61 3. G.711.0 Codec Background . . . . . . . . . . . . . . . . . . 3 62 3.1. General Information and Use of the ITU-T G.711.0 Codec . 3 63 3.2. Key Properties of G.711.0 Design . . . . . . . . . . . . 4 64 3.3. G.711 Input Frames to G.711.0 Output Frames . . . . . . . 6 65 3.3.1. Multiple G.711.0 Output Frames per RTP Payload 66 Considerations . . . . . . . . . . . . . . . . . . . 8 67 4. RTP Header and Payload . . . . . . . . . . . . . . . . . . . 9 68 4.1. G.711.0 RTP Header . . . . . . . . . . . . . . . . . . . 9 69 4.2. G.711.0 RTP Payload . . . . . . . . . . . . . . . . . . . 10 70 4.2.1. Single G.711.0 Frame per RTP Payload Example . . . . 11 71 4.2.2. G.711.0 RTP Payload Definition . . . . . . . . . . . 11 72 4.2.2.1. G.711.0 RTP Payload Encoding Process . . . . . . 13 73 4.2.3. G.711.0 RTP Payload Decoding Process . . . . . . . . 13 74 4.2.4. G.711.0 RTP Payload for Multiple Channels . . . . . . 16 75 5. Payload Format Parameters . . . . . . . . . . . . . . . . . . 18 76 5.1. Media Type Registration . . . . . . . . . . . . . . . . . 18 77 5.2. Mapping to SDP Parameters . . . . . . . . . . . . . . . . 20 78 5.3. Offer/Answer Considerations . . . . . . . . . . . . . . . 21 79 5.4. SDP Examples . . . . . . . . . . . . . . . . . . . . . . 21 80 5.4.1. SDP Example 1 . . . . . . . . . . . . . . . . . . . . 21 81 5.4.2. SDP Example 2 . . . . . . . . . . . . . . . . . . . . 21 82 6. G.711.0 Storage Mode Conventions and Definition . . . . . . . 22 83 6.1. G.711.0 PLC Frame . . . . . . . . . . . . . . . . . . . . 22 84 6.2. G.711.0 Erasure Frame . . . . . . . . . . . . . . . . . . 23 85 6.3. G.711.0 Storage Mode Definition . . . . . . . . . . . . . 24 86 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 25 87 8. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 25 88 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 89 10. Security Considerations . . . . . . . . . . . . . . . . . . . 26 90 11. Congestion Control . . . . . . . . . . . . . . . . . . . . . 27 91 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 92 12.1. Normative References . . . . . . . . . . . . . . . . . . 27 93 12.2. Informative References . . . . . . . . . . . . . . . . . 28 94 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 96 1. Introduction 98 The International Telecommunication Union (ITU-T) Recommendation 99 G.711.0 [G.711.0] specifies a stateless and lossless compression for 100 G.711 packet payloads typically used in Voice over IP (VoIP) 101 networks. This document specifies the Real-Time Transport Protocol 102 (RTP) RFC 3550 [RFC3550] payload format and storage modes for this 103 compression. 105 2. Requirements Language 107 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 108 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 109 document are to be interpreted as described in RFC 2119 [RFC2119]. 111 3. G.711.0 Codec Background 113 ITU-T Recommendation G.711.0 [G.711.0] is a lossless and stateless 114 compression mechanism for ITU-T Recommendation G.711 [G.711] and thus 115 is not a "codec" in the sense of "lossy" codecs typically carried by 116 RTP. When negotiated end-to-end ITU-T Rec. G.711.0 is negotiated as 117 if it were a codec, with the understanding that ITU-T Rec. G.711.0 118 losslessly encoded the underlying (lossy) G.711 pulse code modulation 119 (PCM) sample representation of an audio signal. For this reason 120 ITU-T Rec. G.711.0 will be interchangeably referred to in this 121 document as a "lossless data compression algorithm" or a "codec", 122 depending on context. Within this document, individual G.711 PCM 123 samples will be referred to as "G.711 symbols" or just "symbols" for 124 brevity. 126 This section describes the ITU-T Recommendation G.711 [G.711] codec, 127 its properties, typical uses cases and its key design properties. 129 3.1. General Information and Use of the ITU-T G.711.0 Codec 131 ITU-T Recommendation G.711 is the benchmark standard for narrowband 132 telephony. It has been successful for many decades because of its 133 proven voice quality, ubiquity and utility. A new ITU-T 134 recommendation, G.711.0, has been established for defining a 135 stateless and lossless compression for G.711 packet payloads 136 typically used in VoIP networks. ITU-T Rec. G.711.0 is also known as 137 ITU-T Rec. G.711 Annex A [G.711-A1], as ITU-T Rec. G.711 Annex A is 138 effectively a pointer ITU-T Rec. G.711.0. Henceforth in this 139 document, ITU-T Rec. G.711.0 will simply be referred to as "G.711.0" 140 and ITU-T Rec. G.711 simply as "G.711". 142 G.711.0 may be employed end-to-end; in which case the RTP payload 143 format specification and use is nearly identical to the G.711 RTP 144 specification found in RFC 3551 [RFC3551]. The only significant 145 difference for G.711.0 is the required use of a dynamic payload type 146 (the static PT of 0 or 8 is presently almost always used with G.711 147 even though dynamic assignment of other payload types is allowed) and 148 the recommendation not to use Voice Activity Detection (see 149 Section 4.1). 151 G.711.0, being both lossless and stateless, may also be employed as a 152 lossless compression mechanism for G.711 payloads anywhere between 153 end systems which have negotiated use of G.711. Because the only 154 significance between the G.711 RTP payload format header and the 155 G.711.0 payload format header defined in this document is the payload 156 type, a G.711 RTP packet can be losslessly converted to a G.711.0 RTP 157 packet simply by compressing the G.711 payload (thus creating a 158 G.711.0 payload), changing the payload type to the dynamic value 159 desired and copying all the remaining G.711 RTP header fields into 160 the corresponding G.711.0 RTP header. In a similar manner, the 161 corresponding decompression of the G.711.0 RTP packet thus created 162 back to the original source G.711 RTP packet can be accomplished by 163 losslessly decompressing the G.711.0 payload back to the original 164 source G.711 payload, changing the payload type back to the payload 165 type of the original G.711 RTP packet and copying all the remaining 166 G.711.0 RTP header fields into the corresponding G.711 RTP header. 167 Negotiation specifics for this lossless G.711 payload compression for 168 RTP use case is not in scope for this document. 170 It is special to note that G.711.0, being both lossless and 171 stateless, can be employed multiple times (e.g., on multiple, 172 individual hops or series of hops) of a given flow with no 173 degradation of quality relative to end-to-end G.711. Stated another 174 way, multiple "lossless transcodes" from/to G.711.0/G.711 do not 175 affect voice quality as typically occurs with lossy transcodes to/ 176 from dissimilar codecs. 178 Lastly, it is expected that G.711.0 will be used as an archival 179 format for recorded G.711 streams. Therefore, a G.711.0 Storage Mode 180 Format is also included in this document. 182 3.2. Key Properties of G.711.0 Design 184 The fundamental design of G.711.0 resulted from the desire to 185 losslessly encode and compress frames of G.711 symbols independent of 186 what types of signals those G.711 frames contained. The primary 187 G.711.0 use case is for G.711 encoded, zero-mean, acoustic signals 188 (such as speech and music). 190 G.711.0 attributes are below: 192 A1 Compression for zero-mean acoustic signals: G.711.0 was designed 193 as its primary use case for the compression of G.711 payloads 194 that contained "speech" or other zero-mean acoustic signals. 195 G.711.0 obtains greater than 50% average compression in service 196 provider environments [ICASSP]. 198 A2 Lossless for any G.711 payload: G.711.0 was designed to be 199 lossless for any valid G.711 payload - even if the payload 200 consisted of apparently random G.711 symbols (e.g., a modem or 201 FAX payload). G.711.0 could be used for "aggregate 64 kbps 202 G.711 channels" carried over IP without explicit concern if a 203 subset of these channels happened to be carrying something 204 other than voice or general audio. To the extent that a 205 particular channel carried something other than voice or 206 general audio, G.711.0 ensured that it was carried losslessly, 207 if not significantly compressed. 209 A3 Stateless: Compression of a frame of G.711 symbols was only to be 210 dependent on that frame and not on any prior frame. Although 211 greater compression is usually available by observing a longer 212 history of past G.711 symbols, it was decided that the 213 compression design would be stateless to completely eliminate 214 error propagation common in many lossy codec designs (e.g., 215 ITU-T Rec. G.729 [G.729], ITU-T Rec. G.722 [G.722]). That is, 216 the decoding process need not be concerned about lost prior 217 packets because the decompression of a given G.711.0 frame is 218 not dependent on potentially lost prior G.711.0 frames. Owing 219 to this stateless property, the frames input to the G.711.0 220 encoder may be changed "on-the-fly" (a 5 ms encoding could be 221 followed by a 20 ms encoding). 223 A4 Self-describing: This property is defined as the ability to 224 determine how many source G.711 samples are contained within 225 the G.711.0 frame solely by information contained within the 226 G.711.0 frame. Generally, the number of source G.711 symbols 227 can be determined by decoding the initial octets of the 228 compressed G.711.0 frame (these octets are called "prefix 229 codes" in the standard) [ICASSP]. A G.711.0 decoder need not 230 know what ptime is, as it is able to decompress the G.711.0 231 frame presented to it without signaling knowledge. 233 A5 Accommodate G.711 payload sizes typically used in IP: G.711 input 234 frames of length typically found in VoIP applications represent 235 SDP ptimes (see RFC 4566 [RFC4566]) of 5 ms, 10 ms, 20 ms, 30 236 ms or 40 ms. Since the dominant sampling frequency for G.711 237 is 8000 samples per second, G.711.0 was designed to compress 238 G.711 input frames of 40, 80, 160, 240 or 320 samples. 240 A6 Bounded expansion: Since attribute A2 above requires G.711.0 to 241 be lossless for any payload (which could consist of any 242 combination of octets with each octet spanning the entire space 243 of 2^8 values), by definition there exists at least one 244 potential G.711 payload which must be "uncompressible". Since 245 the quantum of compression is an octet, the minimum expansion 246 of such an uncompressible payload was designed to be the 247 minimum possible of one octet. Thus G.711.0 "compressed" 248 frames can be of length one octet to X+1 octets, where X is the 249 size of the input G.711 frame in octets. G.711.0 can therefore 250 be viewed as a Variable Bit Rate (VBR) encoding in which the 251 size of the G.711.0 output frame is a function of the G.711 252 symbols input to it. 254 A7 Algorithmic delay: G.711.0 was designed to have the algorithmic 255 delay equal to the time represented by the number of samples in 256 the G.711 input frame (i.e., no "look-ahead"). 258 A8 Low Complexity: Less than 1.0 Weighted Million Operations Per 259 Second (WMOPS) average and low memory footprint (~5k octets 260 RAM, ~5.7k octets ROM and ~3.6 basic operations) [ICASSP] 261 [G.711.0]. 263 A9 Both A-law and mu-law supported: G.711 has two operating laws, 264 A-law and mu-law. These two laws are also known as PCMA and 265 PCMU in RTP applications RFC 3551 [RFC3551]. 267 These attributes generally make it trivial to compress a G.711 input 268 frame consisting of 40, 80, 160, 240 or 320 samples. After the input 269 frame is presented to a G.711.0 encoder, a G.711.0 "self-describing" 270 output frame is produced. The number of samples contained within 271 this frame is easily determined at the G.711.0 decoder by virtue of 272 attribute A4. The G.711.0 decoder can decode the G.711.0 frame back 273 to a G.711 frame by using only data within the G.711.0 frame. 275 Lastly we note that losing a G.711.0 encoded packet is identical in 276 effect of losing a G.711 packet (when using RTP); this is because a 277 G.711.0 payload, like the corresponding G.711 payload, is stateless. 278 Thus, it is anticipated that existing G.711 PLC mechanisms will be 279 employed when a G.711.0 packet is lost and an identical MOS 280 degradation relative to G.711 loss will be achieved. 282 3.3. G.711 Input Frames to G.711.0 Output Frames 284 G.711.0 is a lossless and stateless compression of G.711 frames. The 285 following figure depicts this where "A" is the process of G.711.0 286 encoding and "B" is the process of G.711.0 decoding. 288 1:1 Mapping from G.711 Input Frame to G.711.0 Output Frame 290 |--------------------------| A |------------------------------| 291 | G.711 Input Frame |----->| G.711.0 Output Frame | 292 | of X Octets | | containing 1 to X+1 Octets | 293 | (where X MUST be 40, 80, | | (precise value dependent on | 294 | 160, 240 or 320 octets) |<-----| G.711.0 ability to compress) | 295 |__________________________| B |______________________________| 297 Figure 1 299 Note that the mapping is 1:1 (lossless) in both directions, subject 300 to two constraints. The first constraint is that the input frame 301 provided to the G.711.0 encoder (process "A") has a specific number 302 of input G.711 symbols consistent with attribute A5 (40, 80, 160, 240 303 or 320 octets). The second constraint is that the companding law 304 used to create the G.711 input frame (A-law or mu-law) must be known, 305 consistent with attribute A9. 307 Subject to these two constraints, the input G.711 frame is processed 308 by the G.711.0 encoder ("process A") and produces a "self-describing" 309 G.711.0 output frame, consistent with attribute A4. Depending on the 310 source G.711 symbols, the G.711.0 output frame can contain anywhere 311 from 1 to X+1 octets, where X is the number of input G.711 symbols. 312 Compression results for virtually every zero-mean acoustic signal 313 encoded by G.711.0. 315 Since the G.711.0 output frame is "self-describing", a G.711.0 316 decoder (process "B") can losslessly reproduce the original G.711 317 input frame with only the knowledge of which companding law was used 318 (A-law or mu-law). The first octet of a G.711.0 frame is called the 319 "Prefix Code" octet; the value of this octet conveys how many G.711 320 symbols the decoder is to create from a given G.711.0 input frame. 321 The Prefix Code value of 0x00 is used to denote zero G.711 source 322 symbols, which allows the use of 0x00 as a payload padding octet (to 323 be described later). 325 Since G.711.0 was designed with typical G.711 payload lengths as a 326 design constraint (attribute A5), this lossless encoding can be 327 performed only with knowledge of the companding law being used. This 328 information is anticipated to be signaled in SDP and will be 329 described later in this document. 331 If the original inputs were known to be from a zero-mean acoustic 332 signal coded by G.711, an intelligent G.711.0 encoder could infer the 333 G.711 companding law in use (via G.711 input signal amplitude 334 histogram statistics). Likewise, an intelligent G.711.0 decoder 335 producing G.711 from the G.711.0 frames could also infer which 336 encoding law in use. Thus G.711.0 could be designed for use in 337 applications that have limited stream signaling between the G.711 338 endpoints (i.e., they only know "G.711 at 8k sampling is being used", 339 but nothing more). Such usage is not further described in this 340 document. Additionally, if the original inputs were known to come 341 from zero-mean acoustic signals, an intelligent G.711.0 encoder could 342 tell if the G.711.0 payload had been encrypted - as the symbols would 343 not have the distribution expected in either companding law and would 344 appear random. Such determination is also not further discussed in 345 this document. 347 It is easily seen that this process is 1:1 and that G.711.0 based 348 lossless compression can be employed multiple times, as the original 349 G.711 input symbols are always reproduced with 100% fidelity. 351 3.3.1. Multiple G.711.0 Output Frames per RTP Payload Considerations 353 As a general rule, G.711.0 frames containing more source G.711 354 symbols (from a given channel) will typically result in higher 355 compression, but there are exceptions to this rule. A G.711.0 356 encoder may choose to encode 20 ms of input G.711 symbols as: 1) a 357 single 20 ms G.711.0 frame, or 2) as two 10 ms G.711.0 frames, or 3) 358 any other combination of 5 ms or 10 ms G.711.0 frames - depending on 359 which encoding resulted in fewer bits. As an example, an intelligent 360 encoder might encode 20 ms of G.711 symbols as two 10 ms G.711.0 361 frames if the first 10 ms was "silence" and two G.711.0 frames took 362 fewer bits than any other possible encoding combination of G.711.0 363 frame sizes. 365 During the process of G.711.0 standardization it was recognized that 366 although it is sometimes advantageous to encode integer multiples of 367 40 G.711 symbols in whatever input symbol format resulted in the most 368 compression (as per above), the simplest choice is to encode the 369 entire ptime's worth of input G.711 symbols into one G.711.0 frame 370 (if the ptime supported it). This is especially so since the larger 371 number of source G.711 symbols typically resulted in the highest 372 compression anyway and there is added complexity in searching for 373 other possibilities (involving more G.711.0 frames) which were 374 unlikely to produce a more bit efficient result. 376 The design of ITU-T Rec. G.711.0 [G.711.0] foresaw the possibility of 377 multiple G.711.0 input frames in that the decoder was defined to 378 decode what it refers to as an incoming "bit stream". For this 379 specification, the bit stream is the G.711.0 RTP payload itself. 380 Thus, the decoder will take the G.711.0 RTP payload and will produce 381 an output frame containing the original G.711 symbols independent of 382 how many G.711.0 frames were present in it. Additionally, any number 383 of 0x00 padding octets placed between the G.711.0 frames will be 384 silently (and safely) ignored by the G.711.0 decoding process 385 Section 4.2.3). 387 To recap, a G.711.0 encoder may choose to encode incoming G.711 388 symbols into one or more than one G.711.0 frames and put the 389 resultant frame(s) into the G.711.0 RTP payload. Zero or more 0x00 390 padding octets may also be included in the G.711.0 RTP payload. The 391 G.711.0 decoder, being insensitive to the number of G.711.0 encoded 392 frames that are contained within it, will decode the G.711.0 RTP 393 payload into the source G.711 symbols. Although examples of single 394 or multiple G.711 frame cases will be illustrated in Section 4.2, the 395 multiple G.711.0 frame cases MUST be supported and there is no need 396 for negotiation (SDP or otherwise) required for it. 398 4. RTP Header and Payload 400 In this section we describe the precise format for G.711.0 frames 401 carried via RTP. We begin with RTP header description relative to 402 G.711, then provide two G.711.0 payload examples. 404 4.1. G.711.0 RTP Header 406 Relative to G.711 RTP headers, the utilization of G.711.0 does not 407 create any special requirements with respect to the contents of the 408 RTP packet header. The only significant difference is that the 409 payload type (PT) RTP header field MUST have a value corresponding to 410 the dynamic payload type assigned to the flow. This is in contrast 411 to most current uses of G.711 which typically use the static payload 412 assignment of PT = 0 (PCMU) or PT = 8 (PCMA) [RFC3551] even though 413 the negotiation and use of dynamic payload types is allowed for 414 G.711. With the exception of rare PT exhaustion cases, the existing 415 G.711 PT values of 0 and 8 MUST NOT be used for G.711.0 (helping to 416 avoid possible payload confusion with G.711 payloads). 418 Voice Activity Detection (VAD) SHOULD NOT be used when G.711.0 is 419 negotiated because G.711.0 obtains high compression during "VAD 420 silence intervals" and one of the advantages of G.711.0 over G.711 421 with VAD is the lack of any VAD-inducing artifacts in the received 422 signal. However, if VAD is employed, the Marker bit (M) MUST be set 423 in the first packet of a talkspurt (the first packet after a silence 424 period in which packets have not been transmitted contiguously as per 425 rules specified in [RFC3551] for G.711 payloads). This definition, 426 being consistent with the G.711 RTP VAD use, further allows lossless 427 transcoding between G.711 RTP packets and G.711.0 RTP packets as 428 described in Section 3.1. 430 With this introduction, the RTP packet header fields are defined as 431 follows: 433 V - As per [RFC3550] 435 P - As per [RFC3550] 437 X - As per [RFC3550] 439 CC - As per [RFC3550] 441 M - As per [RFC3550] and [RFC3551] 443 PT - The assignment of an RTP payload type for the format defined 444 in this memo is outside the scope of this document. The RTP 445 profiles in use currently mandate binding the payload type 446 dynamically for this payload format. 448 SN - As per [RFC3550] 450 timestamp - As per [RFC3550] 452 SSRC - As per [RFC3550] 454 CSRC - As per [RFC3550] 456 Where V (version bits), P (padding bit), X (extension bit), CC (CSRC 457 count), M (marker bit), PT (payload type), SN (sequence number), 458 timestamp, SSRC (synchronizing source) and CSRC (contributing 459 sources) are as defined in [RFC3550] and as typically used with 460 G.711. PT (payload type) is as defined in [RFC3551]. 462 4.2. G.711.0 RTP Payload 464 This section defines the G.711.0 RTP payload and illustrates it by 465 means of two examples. 467 The first example, in Section 4.2.1, depicts the case when it is 468 desired to carry only one G.711.0 frame in the RTP payload. This 469 case is expected to be the dominant use case and is shown separately 470 for the purposes of clarity. 472 The second example, in Section 4.2.2, depicts the general case when 473 it is desired to carry one or more G.711.0 frames in the RTP payload. 474 This is the actual definition of the G.711.0 RTP payload. 476 4.2.1. Single G.711.0 Frame per RTP Payload Example 478 This example depicts a single G.711.0 frame in the RTP payload. This 479 is expected to be the dominant RTP payload case for G.711.0, as the 480 G.711.0 encoding process supports the SDP packet times (ptime and 481 maxptime, see [RFC4566]) commonly used when G.711 is transported in 482 RTP. Additionally, as mentioned previously, larger G.711.0 frames 483 generally compress more effectively than a multiplicity of smaller 484 G.711.0 frames. 486 The following Figure illustrates the single G.711.0 frame per RTP 487 payload case. 489 Single G.711.0 Frame in RTP Payload Case 491 |-------------------|-------------------| 492 | One G.711.0 Frame | Zero or more 0x00 | 493 | | Padding Octets | 494 |___________________|___________________| 496 Figure 2 498 Encoding Process: A single G.711.0 frame is inserted into the RTP 499 payload. The amount of time represented by the G.711 symbols 500 compressed in the G.711.0 frame MUST correspond to the ptime signaled 501 for applications using SDP. Although generally not desired, padding 502 desired in the RTP payload after the G.711.0 frame MAY be created by 503 placing one or more 0x00 octets after the G.711.0 frame. Such 504 padding may be desired based on security considerations (see 505 Section 10). 507 Decoding Process: Passing the entire RTP payload to the G.711.0 508 decoder is sufficient for the G.711.0 decoder to create the source 509 G.711 symbols. Any padding inserted after the G.711.0 frame (i.e., 510 the 0x00 octets) present in the RTP payload is silently ignored by 511 the G.711.0 decoding process. The decoding process is fully 512 described in Section 4.2.3 below. 514 4.2.2. G.711.0 RTP Payload Definition 516 This section defines the G.711.0 RTP payload and illustrates the case 517 of when one or more G.711.0 frames are to be placed in the payload. 518 All G.711.0 RTP decoders MUST support the general case described in 519 this section (rationale presented previously in Section 3.3.1). 521 Note that since each G.711.0 frame is self-describing (see Attribute 522 A4 in Section 3.2), the individual G.711.0 frames in the RTP payload 523 need not represent the same duration of time (i.e., a 5 ms G.711.0 524 frame could be followed by a 20 ms G.711.0 frame). Owing to this, 525 the amount of time represented in the RTP payload MAY be any integer 526 multiple of 5 ms (as 5 ms is the smallest interval of time that can 527 be represented in a G.711.0 frame). 529 The following Figure illustrates the one or more G.711.0 frames per 530 RTP payload case where the number of G.711.0 frames placed in the RTP 531 payload is N. We note that when N is equal to 1 that this case is 532 identical to the previous example. 534 One or More G.711.0 Frames in RTP Payload Case 536 |----------|---------|----------|---------|----------------| 537 | First | Second | | Nth | Zero or more | 538 | G.711.0 | G.711.0 | ... | G.711.0 | 0x00 | 539 | Frame | Frame | | Frame | Padding Octets | 540 |__________|_________|__________|_________|________________| 542 Figure 3 544 We note here that when we have multiple G.711.0 frames that the 545 individual frames can be, and generally are, of different lengths. 546 The decoding process described in Section 4.2.3 is used to determine 547 the frame boundaries. 549 Encoding Process: One or more G.711.0 frames are placed in the RTP 550 payload simply by concatenating the G.711.0 frames together. The 551 amount of time represented by the G.711 symbols compressed in all the 552 G.711.0 frames in the RTP payload MUST correspond to the ptime 553 signaled for applications using SDP. Although not generally desired, 554 padding in the RTP payload SHOULD be placed after the last G.711.0 555 frame in the payload and MAY be created by placing one or more 0x00 556 octets after the last G.711.0 frame. Such padding may be desired 557 based on security considerations (see Section 10). Additional 558 encoding process details and considerations are specified later in 559 Section 4.2.2.1. 561 Decoding Process: As G.711.0 frames can be of varying length, the 562 payload decoding process described in Section 4.2.3 is used to 563 determine where the individual G.711.0 frame boundaries are. Any 564 padding octets inserted before or after any G.711.0 frame in the RTP 565 payload is silently (and safely) ignored by the G.711.0 decoding 566 process specified in Section 4.2.3. 568 4.2.2.1. G.711.0 RTP Payload Encoding Process 570 The ITU-T G.711.0 supports five possible input frame lengths: 40, 80, 571 160, 240, and 320 samples per frame and the rationale for choosing 572 those lengths was given in the description of property A5 in 573 Section 3.2. Assuming 8000 sample per second, these lengths 574 correspond to input frames representing 5 ms, 10 ms, 20 ms, 30 ms or 575 40 ms. So while the standard assumed the input "bit stream" 576 consisted of G.711 symbols of some integer multiple of 5 ms in 577 length, it did not specify exactly what frame lengths to use as input 578 to the G.711.0 encoder itself. The intent of this section is to 579 provide some guidance for the selection. 581 Consider a typical IETF use case of 20 ms (160 octets) of G.711 input 582 samples represented in a G.711.0 payload and signaled by using the 583 SDP parameter ptime. As described in Section 3.3.1, the simplest way 584 to encode these 160 octets is to pass the entire 160 octet to the 585 G.711.0 encoder, resulting in precisely one G.711.0 compressed frame, 586 and put that singular frame into the G.711.0 RTP payload. However, 587 neither the ITU-T G.711.0 standard nor this IETF payload format 588 mandates this. In fact 20 ms of input G.711 symbols can be encoded 589 as 1, 2, 3 or 4 G.711.0 frames in any one of six combinations (i.e., 590 {20ms}, {10ms:10ms}, {10ms:5ms:5ms}, {5ms:10ms:5ms}, {5ms:5ms:10ms}, 591 {5ms:5ms:5ms:5ms}) and any of these combinations would decompress 592 into the same source 160 G.711 octets. 594 Notwithstanding the above, we expect one of two encodings to be used 595 by implementers: the simplest possible (one 160 byte input to the 596 G.711.0 encoder which usually results in the highest compression) or 597 the combination of possible input frames to a G.711.0 encoder that 598 resulted in the highest compression for the payload. The explicit 599 mention of this issue in this IETF document was deemed important 600 because the ITU-T G.711.0 standard is silent on this issue and there 601 is a desire for this issue to be documented in a formal Standards 602 Development Organization (SDO) document (i.e., here). 604 4.2.3. G.711.0 RTP Payload Decoding Process 606 The G.711.0 decoding process is a standard part of G.711.0 bit stream 607 decoding and is implemented in the ITU-T Rec. G.711.0 reference code. 608 The decoding process algorithm described in this section is a slight 609 enhancement of the ITU-T reference code to explicitly accommodate RTP 610 padding (as described above). 612 Before describing the decoding, we note here that the largest 613 possible G.711.0 frame is created whenever the largest number of 614 G.711 symbols is encoded (320 from Section 3.2, property A5) and 615 these 320 symbols are "uncompressible" by the G.711.0 encoder. In 616 this case (via property A6 in Section 3.2) the G.711.0 output frame 617 will be 321 octets long. We also note that the value 0x00 chosen for 618 the optional padding cannot be the first octet of a valid ITU-T Rec. 619 G.711.0 frame (see [G.711.0]). We also note that whenever more than 620 one G.711.0 frame is contained in the RTP payload, the decoding of 621 the individual G.711.0 frames will occur multiple times. 623 For the decoding algorithm below, let N be the number of octets in 624 the RTP payload (i.e., excluding any RTP padding, but including any 625 RTP payload padding), let P equal the number of RTP payload octets 626 processed by the G.711.0 decoding process, let K be the number of 627 G.711 symbols presently in the output buffer, let Q be the number of 628 octets contained in the G.711.0 frame being processed and let "!=" 629 represent not equal to. The keyword "STOP" is used below to indicate 630 the end of the processing of G.711.0 frames in the RTP payload. The 631 algorithm below assumes an output buffer for the decoded G.711 source 632 symbols of length sufficient to accommodate the expected number of 633 G.711 symbols and an input buffer of length 321 octets. 635 G.711.0 RTP Payload Decoding Heuristic: 637 H1 Initialization of counters: Initialize P, the number of processed 638 octets counter, to zero. Initialize K, the counter for how 639 many G.711 symbols are in the output buffer, to zero. 640 Initialize N to the number of octets in the RTP payload 641 (including any RTP payload padding). Go to H2. 643 H2 Read internal buffer: Read min{320+1, (N-P)-1} octets into the 644 internal buffer from the (P+1) octet of the RTP payload. We 645 note at this point, N-P octets have yet to be processed and 646 that 320+1 octets is the largest possible G.711.0 frame. Also 647 note that in the common case of zero-based array indexing of a 648 uint8 array of octets, that this operation will read octets 649 from index P through index [min{320+1, (N-P)}] from the RTP 650 payload. Go to H3. 652 H3 Analyze the first octet in the internal buffer: If this octet 653 0x00 (a padding octet) go to H4, otherwise go to H5 (process a 654 G.711.0 frame). 656 H4 Process padding octet (no G.711 symbols generated): Increment the 657 processed packets counter by one (set P = P + 1). If the 658 result of this increment results in P >= N then STOP (as all 659 RTP Payload octets have been processed), otherwise go to H2. 661 H5 Process an individual G.711.0 frame (produce G.711 samples in the 662 output frame): Pass the internal buffer to the G.711.0 decoder. 663 The G.711.0 decoder will read the first octet (called the 664 "prefix code" octet in ITU-T Rec. G.711.0 [G.711.0]) to 665 determine the number of source G.711 samples M are contained in 666 this G.711.0 frame. The G.711.0 decoder will produce exactly M 667 G.711 source symbols (M can only have values of 0, 40, 80, 160, 668 240 or 320). If K = 0, these M symbols will be the first in 669 the output buffer and are placed at the beginning of the output 670 buffer. If K != 0, concatenate these M symbols with the prior 671 symbols in the output buffer (there are K prior symbols in the 672 buffer). Set K = K + M (as there are now this many G.711 673 source symbols in the output buffer). The G.711.0 decoder will 674 have consumed some number of octets, Q, in the internal buffer 675 to produce the M G.711 symbols. Increment the number of 676 payload octet processed counter by this quantity (set P = P + 677 Q). If the result of this increment results in P >= N then 678 STOP (as all RTP Payload octets have been processed), otherwise 679 go to H2. 681 At this point, the output buffer will contain precisely K G.711 682 source symbols which should correspond to the ptime signaled if SDP 683 was used and the encoding process was without error. If ptime was 684 signaled via SDP and the number of G.711 symbols in the output buffer 685 is other than what corresponds to ptime, the packet MUST be discarded 686 unless other system design knowledge allows for otherwise (e.g., 687 occasional 5 ms clock slips causing one more or one less G.711.0 688 frame than nominal to be in the payload). Lastly, due to the buffer 689 reads in H2 being bounded (to 321 octets or less), N being bounded to 690 the size of the G.711.0 RTP payload, and M being bounded to the 691 number of source G.711 symbols, there is no buffer overrun risk. 693 We also note, as an aside, that the algorithm above (and the ITU-T 694 G.711.0 reference code) accommodates padding octets (0x00) placed 695 anywhere between G.711.0 frames in the RTP payload as well as prior 696 to or after any or all G.711.0 frames. The ITU-T G.711.0 reference 697 code does not have Step H3 and H4 as separate steps (i.e., Step H5 698 immediately follows H2) at the added computational cost of some 699 additional buffer passing to/from the G.711.0 frame decoder 700 functions. That is the G.711.0 decoder in the reference code 701 "silently ignores" 0x00 padding octets at the beginning of what it 702 believes to be a G.711.0 encoded frame boundary. Thus Step H3 and 703 Step H4 above are an optimization over the reference code shown for 704 clarity. 706 If the decoder is at a playout endpoint location, this G.711 buffer 707 SHOULD be used in the same manner as a received G.711 RTP payload 708 would have been used (passed to a playout buffer, to a PLC 709 implementation, etc.). 711 4.2.4. G.711.0 RTP Payload for Multiple Channels 713 In this section we describe the use of multiple "channels" of G.711 714 data encoded by G.711.0 compression. 716 The dominant use of G.711 in RTP transport has been for single 717 channel use cases. For this case, the above G.711.0 encoding and 718 decoding process is used. However, the multiple channel case for 719 G.711.0 (a frame-based compression) is different from G.711 (a 720 sample-based encoding) and is described separately here. 722 RFC 3551 [RFC3551] provides guidelines for encoding audio channels 723 (Section 4) and for the ordering of the channels within the RTP 724 payload (Section 4.1). The ordering guidelines in RFC 3551, 725 Section 4.1 SHOULD be used unless an application-specific channel 726 ordering is more appropriate. 728 An implicit assumption in RFC 3551 is that all the channel data 729 multiplexed into a RTP payload MUST represent the same physical time 730 span. The case for G.711.0 is no different; the underlying G.711 731 data for all channels in a G.711.0 RTP payload MUST span the same 732 interval in time (e.g., the same "ptime" for a SDP-specified codec 733 negotiation). 735 RFC 3551 provides guidelines for sample-based encodings such as G.711 736 in Section 4.2. This guidance is tantamount to interleaving the 737 individual samples in that they SHOULD be packed in consecutive 738 octets. 740 RFC 3551 provides guidelines for frame-based encodings in which the 741 frames are interleaved. However, this guidance stems from the 742 assumption that "the frame size for frame-oriented codecs is a 743 given". However, this assumption is not valid for G.711.0 in that 744 individual consecutive G.711.0 frames (as per Section 4.2.2) can: 746 1) represent different time spans (e.g., two 5 ms G.711.0 frames 747 in lieu of one 10 ms G.711.0 frame), and 749 2) be of different lengths in octets (and typically are). 751 Therefore a different, but also simple, concatenation-based approach 752 is specified in this RFC. 754 For the multiple channel G.711.0 case, each G.711 channel is 755 independently encoded into one or more G.711.0 frames defined here as 756 a "G.711.0 channel superframe". Each one of these superframes is 757 identical to the multiple G.711.0 frame case illustrated in Figure 3 758 of Section 4.2.2 in which each superframe can have one or more 759 individual G.711.0 frames within it. Then each G.711.0 channel 760 superframe is concatenated - in channel order - into a G.711.0 RTP 761 payload. Then, if optional G.711.0 padding octets (0x00) are 762 desired, it is RECOMMENDED that these octets are placed after the 763 last G.711.0 channel superframe. As per above, such padding may be 764 desired based on security considerations (see Section 10). This is 765 depicted in the following Figure 4 below. 767 Multiple G.711.0 Channel Superframes in RTP Payload 769 |----------|---------|----------|---------|---------| 770 | First | Second | | Nth | Zero | 771 | G.711.0 | G.711.0 | ... | G.711.0 | or more | 772 | Channel | Channel | | Channel | 0x00 | 773 | Super- | Super- | | Super | Padding | 774 | Frame | Frame | | Frame | Octets | 775 |__________|_________|__________|_________|_________| 777 Figure 4 779 We note that although the individual superframes can be of different 780 lengths in octets (and usually are), that the number of G.711 source 781 symbols represented - in compressed form - in each channel superframe 782 is identical (since all the channels represent the identically same 783 time interval). 785 The G.711.0 decoder at the receiving end simply decodes the entire 786 G.711.0 (multiple channel) payload into individual G.711 symbols. If 787 M such G.711 symbols result and there were N channels, then the first 788 M/N G.711 samples would be from the first channel, the second M/N 789 G.711 samples would be from the second channel, and so on until the 790 Nth set of G.711 samples are found. Similarly, if the number of 791 channels was not known, but the payload "ptime" was known, one could 792 infer (knowing the sampling rate) how many G.711 symbols each channel 793 contained; then with this knowledge determine how many channels of 794 data were contained in the payload. When SDP is used, the number of 795 channels is known because the optional parameter is a MUST when there 796 is more than one channel negotiated (see Section 5.1). Additionally, 797 when SDP is used the parameter ptime is a RECOMMENDED optional 798 parameter. We note that if both parameters channels and ptime are 799 known that one could provide a check for the other and the converse. 800 Whichever algorithm is used to determine the number of channels, if 801 the length of the source G.711 symbols in the payload (M) is not an 802 integer multiple of the number of channels (N), then the packet 803 SHOULD be discarded. 805 Lastly we note that although any padding for the multiple channel 806 G.711.0 payload is RECOMMENDED to be placed at the end of the 807 payload, the G.711.0 decoding algorithm described in Section 4.2.3 808 will successfully decode the payload in Figure 4 if the 0x00 padding 809 octet is placed anywhere before or after any individual G.711.0 frame 810 in the RTP payload. The number of padding octets introduced at any 811 G.711.0 frame boundary therefore does not affect the number M of the 812 source G.711 symbols produced. Thus the decision for padding MAY be 813 made on a per-superframe basis. 815 5. Payload Format Parameters 817 This section defines the parameters that may be used to configure 818 optional features in the G.711.0 RTP transmission. 820 The parameters defined here are a part of the media subtype 821 registration for the G.711.0 codec. Mapping of the parameters into 822 Session Description Protocol (SDP) RFC 4566 [RFC4566] is also 823 provided for those applications that use SDP. 825 5.1. Media Type Registration 827 Type name: audio 829 Subtype name: G711-0 831 Required parameters: 833 clock rate: The RTP timestamp clock rate, which is equal to the 834 sampling rate. The typical rate used with G.711 encoding is 8000, 835 but other rates may be specified. The default rate is 8000. 837 complaw: This format specific parameter, specified on the "a=fmtp: 838 line", indicates the companding law (A-law or mu-law) employed. 839 This format specific parameter, as per RFC 4566 [RFC4566], is 840 given unchanged to the media tool using this format. The case- 841 insensitive values are "complaw=al" or "complaw=mu" are used for 842 A-law and mu-law, respectively. 844 Optional parameters: 846 channels: See RFC 4566 [RFC4566] for definition. Specifies how 847 many audio streams are represented in the G.711.0 payload and MUST 848 be present if the number of channels is greater than one. This 849 parameter defaults to 1 if not present (as per RFC 4566) and is 850 typically a non-zero small-valued positive integer. It is 851 expected that implementations that specify multiple channels will 852 also define a mechanism to map the channels appropriately within 853 their system design, otherwise the channel order specified in RFC 854 3551 [RFC3551] Section 4.1 will be assumed (e.g., left, right, 855 center, ... ). Similar to the usual interpretation in RFC 3551 856 [RFC3551], the number of channels SHALL be a non-zero positive 857 integer. 859 maxptime: See RFC 4566 [RFC4566] for definition. 861 ptime: See RFC 4566 [RFC4566] for definition. The inclusion of 862 "ptime" is RECOMMENDED and SHOULD be in the SDP unless there is an 863 application specific reason not to include it (e.g., an 864 application that has a variable ptime on a packet-by-packet 865 basis). For constant ptime applications, it is considered good 866 form to include "ptime" in the SDP for session diagnostic 867 purposes. For the constant ptime multiple channel case described 868 in Section 4.2.2, the inclusion of "ptime" can provide a desirable 869 payload check. 871 Encoding considerations: 873 This media type is framed binary data (see Section 4.8 in RFC 6838 874 [RFC6838]) compressed as per ITU-T Rec. G.711.0. 876 Security considerations: 878 See Section 10. 880 Interoperability considerations: none 882 Published specification: 884 ITU-T Rec. G.711.0 and RFC XXXX. 886 [ RFC Editor: please replace XXXXX with a reference to this RFC ] 888 Applications that use this media type: 890 Although initially conceived for VoIP, the use of G.711.0, like 891 G.711 before it, may find use within audio and video streaming 892 and/or conferencing applications for the audio portion of those 893 applications. 895 Additional information: 897 The following applies to stored-file transfer methods: 899 Magic numbers: #!G7110A\n or #!G7110M\n (for A-law or MU-law 900 encodings respectively, see Section 6). 902 File Extensions: None 904 Macintosh file type code: None 906 Object identifier or OIL: None 908 Person & email address to contact for further information: 910 Michael A. Ramalho or 912 Intended usage: COMMON 914 Restrictions on usage: 916 This media type depends on RTP framing, and hence is only defined 917 for transfer via RTP [RFC3550]. Transport within other framing 918 protocols is not defined at this time. 920 Author: Michael A. Ramalho 922 Change controller: 924 IETF Payload working group delegated from the IESG. 926 5.2. Mapping to SDP Parameters 928 The information carried in the media type specification has a 929 specific mapping to fields in the Session Description Protocol (SDP), 930 which is commonly used to describe a RTP session. When SDP is used 931 to specify sessions employing G.711.0, the mapping is as follows: 933 o The media type ("audio") goes in SDP "m=" as the media name. 935 o The media subtype ("G711-0") goes in SDP "a=rtpmap" as the 936 encoding name. 938 o The required parameter "rate" also goes in "a=rtpmap" as the clock 939 rate. 941 o The parameters "ptime" and "maxptime" go in the SDP "a=ptime" and 942 "a=maxptime" attributes, respectively. 944 o Remaining parameters go in the SDP "a=fmtp" attribute by copying 945 them directly from the media type string as a semicolon-separated 946 list of parameter=value pairs. 948 5.3. Offer/Answer Considerations 950 The following considerations apply when using the SDP offer/answer 951 RFC 3264 [RFC3264] mechanism to negotiate the "channels" attribute. 953 o If the offering endpoint specifies a value for the optional 954 channels parameter greater than one and the answering endpoint 955 both understands the parameter and cannot support that value 956 requested, the answer MUST contain the optional channels parameter 957 with the highest value it can support. 959 o If the offering endpoint specifies a value for the optional 960 channels parameter the answer MUST contain the optional channels 961 parameter unless the only value the answering endpoint can support 962 is one, in which case the answer MAY contain the optional channels 963 parameter with value of 1. 965 o If the offering endpoint specifies a value for the ptime parameter 966 that the answering endpoint cannot support, the answer MUST 967 contain the optional ptime parameter. 969 o If the offering endpoint specifies a value for the maxptime 970 parameter that the answering endpoint cannot support, the answer 971 MUST contain the optional maxptime parameter. 973 5.4. SDP Examples 975 The following examples illustrate how to signal G.711.0 via SDP. 977 5.4.1. SDP Example 1 979 m=audio RTP/AVP 98 980 a=rtpmap:98 G711-0/8000 981 a=fmtp:98 complaw=mu 983 In the above example the dynamic payload type 98 is mapped to G.711.0 984 via the "a=rtpmap" parameter. The mandatory "complaw" is on the 985 "a=fmtp" parameter line. Note that neither optional parameters 986 "ptime" nor "channels" is present; although it is generally good form 987 to include "ptime" in the SDP if the session is a constant ptime 988 session for diagnostic purposes. 990 5.4.2. SDP Example 2 992 The following example illustrates an offering endpoint requesting 2 993 channels, but the answering endpoint can only support (or render) one 994 channel. 996 Offer: 998 m=audio RTP/AVP 98 999 a=rtpmap:98 G711-0/8000/2 1000 a=ptime:20 1001 a=fmtp:98 complaw=al 1003 Answer: 1005 m=audio RTP/AVP 98 1006 a=rtpmap: 98 G711-0/8000/1 1007 a=ptime: 20 1008 a=fmtp:98 complaw=al 1010 In this example the offer had an optional channels parameter. The 1011 answer must have the optional channels parameter also unless the 1012 value in the answer is one. Shown here is when the answer explicitly 1013 contains the channels parameter (it need not have and it would be 1014 interpreted as one channel). As mentioned previously, it is 1015 considered good form to include "ptime" in the SDP for session 1016 diagnostic purposes if the session is a constant ptime session. 1018 6. G.711.0 Storage Mode Conventions and Definition 1020 The G.711.0 storage mode definition in this section is similar to 1021 many other IETF codecs (e.g., iLBC, EVRC-NW) and is essentially a 1022 concatenation of individual G.711.0 frames. 1024 We note that something must be stored for any G.711.0 frames that are 1025 not received at the receiving endpoint, no matter what the cause. In 1026 this section we describe two mechanisms, a "G.711.0 PLC Frame" and a 1027 "G.711.0 Erasure Frame". These G.711.0 PLC and G.711.0 Erasure 1028 Frames are described prior to the G.711.0 storage mode definition for 1029 clarity. 1031 6.1. G.711.0 PLC Frame 1033 When G.711 RTP payloads not received by a rendering endpoint a Packet 1034 Loss Concealment (PLC) mechanism is typically employed to "fill in" 1035 the missing G.711 symbols with something that is auditorially 1036 pleasing and thus the loss may be not noticed by a listener. Such a 1037 PLC mechanism for G.711 is specified in ITU-T Rec. G.711 - Appendix 1 1038 [G.711-AP1]. 1040 An natural extension when creating G.711.0 frames for storage 1041 environments is to employ such a PLC mechanism to create G.711 1042 symbols for the span of time in which G.711.0 payloads were not 1043 received - and then to compress the resulting "G.711 PLC symbols" via 1044 G.711.0 compression. The G.711.0 frame(s) created by such a process 1045 are called "G.711.0 PLC Frames". 1047 Since PLC mechanisms are designed to render missing audio data with 1048 the best fidelity and intelligibility, G.711.0 frames created via 1049 such processing is likely best for most recording situations (such as 1050 voicemail storage) unless there is a requirement not to fabricate 1051 (audio) data not actually received. 1053 After such PLC G.711 symbols have been generated and then encoded by 1054 a G.711.0 encoder, the resulting frames may be stored in G.711.0 1055 frame format. As a result, there is nothing to specify here - the 1056 G.711.0 PLC Frames are stored as if they were received by the 1057 receiving endpoint. In other words, PLC-generated G.711.0 frames 1058 appear as "normal" or "ordinary" G.711.0 frames in the storage mode 1059 file. 1061 6.2. G.711.0 Erasure Frame 1063 "Erasure Frames", or equivalently "Null Frames", have been designed 1064 for many frame-based codecs since G.711 was standardized. These 1065 null/erasure frames explicitly represent data from incoming audio 1066 that were either not received by the receiving system or represent 1067 data that a transmitting system decided not to send. Transmitting 1068 systems may choose not to send data for a variety of reasons (e.g., 1069 not enough wireless link capacity in radio-based systems) and can 1070 choose to send a "null frame" in lieu of the actual audio. It is 1071 also envisioned that erasure frames would be used in storage mode 1072 applications for specific archival purposes where there is a 1073 requirement not to fabricate audio data that was not actually 1074 received. 1076 Thus, a G.711.0 erasure frame is a representation of the amount of 1077 time in G.711.0 frames that were not received or not encoded by the 1078 transmitting system. 1080 Prior to defining a G.711.0 erasure frame it is beneficial to note 1081 what many G.711 RTP systems send when the endpoint is "muted". When 1082 muted, many of these systems will send an entire G.711 payload of 1083 either 0+ or 0- (i.e., one of the two levels closest to "analog zero" 1084 in either G.711 companding law). Next we note that a desirable 1085 property for a G.711.0 erasure frame is for "non G.711.0 Erasure 1086 Frame aware" endpoints to be able to playback a G.711.0 erasure frame 1087 with the existing G.711.0 ITU-T reference code. 1089 A G.711.0 Erasure Frame is defined as any G.711.0 frame for which the 1090 corresponding G.711 sample values are either the value 0++ or the 1091 value 0-- for the entirety of the G.711.0 frame. The levels of 0++ 1092 and 0-- are defined to be the two levels above or below analog zero, 1093 respectively. An entire frame of value 0++ or 0-- is expected to be 1094 extraordinarily rare when the frame was in fact generated by a 1095 natural signal, as analog inputs such as speech and music are zero- 1096 mean and are typically acoustically coupled to digital sampling 1097 systems. Note that the playback of a G.711.0 frame characterized as 1098 an erasure frame is auditorially equivalent to a muted signal (a very 1099 low value constant). 1101 These G.711.0 erasure frames can be reasonably characterized as null 1102 or erasure frames while meeting the desired playback goal of being 1103 decoded by the G.711.0 ITU-T reference code. Thus, similarly to 1104 G.711 PLC frames, the G.711.0 erasure frames appear as "normal" or 1105 "ordinary" G.711.0 frames in the storage mode format. 1107 6.3. G.711.0 Storage Mode Definition 1109 The storage format is used for storing G.711.0 encoded frames. The 1110 format for the G.711.0 storage mode file defined by this RFC is shown 1111 below. 1113 G.711.0 Storage Mode Format 1115 |---------------------------|----------|--------------| 1116 | Magic Number | | | 1117 | | Version | Concatenated | 1118 | "#!G7110A\n" (for A-law) | Octet | G.711.0 | 1119 | or | | Frames | 1120 | "#!G7110M\n" (for mu-law) | "0x00" | | 1121 |___________________________|__________|______________| 1123 Figure 5 1125 The storage mode file consists of a magic number and a version octet 1126 followed by the individual G.711.0 frames concatenated together. 1128 The magic number for G.711.0 A-law corresponds to the ASCII character 1129 string "#!G7110A\n", i.e., "0x23 0x21 0x47 0x37 0x31 0x31 0x30 0x41 1130 0x0A". Likewise, the magic number for G.711.0 MU-law corresponds to 1131 the ASCII character string "#!G7110M\n", i.e., "0x23 0x21 0x47 0x37 1132 0x31 0x31 0x4E 0x4D 0x0A". 1134 The version number octet allows for the future specification of other 1135 G.711.0 storage mode formats. The specification of other storage 1136 mode formats may be desirable as G.711.0 frames are of variable 1137 length and a future format may include an indexing methodology that 1138 would enable playout far into a long G.711.0 recording without the 1139 necessity of decoding all the G.711.0 frames since the beginning of 1140 the recording. Other future format specification may include support 1141 for multiple channels, metadata and the like. For these reasons it 1142 was determined that a versioning strategy was desirable for the 1143 G.711.0 storage mode definition specified by this RFC. This RFC only 1144 specifies Version 0 and thus the value of "0x00" MUST be used for the 1145 storage mode defined by this RFC. 1147 The G.711.0 codec data frames, including any necessary erasure or PLC 1148 frames, are stored in consecutive order concatenated together as 1149 shown in Section 4.2.2. As the Version 0 storage mode only supports 1150 a single channel, the RTP payload format supporting multiple channels 1151 defined in Section 4.2.4 is not supported in this storage mode 1152 definition. 1154 To decode the individual G.711.0 frames, the algorithm presented in 1155 Section 4.2.2 may be used to decode the individual G.711.0 frames. 1156 If the version octet is determined not to be zero, the remainder of 1157 the payload MUST NOT be passed to the G.711.0 decoder, as the ITU-T 1158 G.711.0 reference decoder can only decode concatenated G.711.0 frames 1159 and has not been designed to decode elements in yet to be specified 1160 future storage mode formats. 1162 7. Acknowledgements 1164 There have been many people contributing to G.711.0 in the course of 1165 its development. The people listed here deserve special mention: 1166 Takehiro Moriya, Claude Lamblin, Herve Taddei, Simao Campos, Yusuke 1167 Hiwasaki, Jacek Stachurski, Lorin Netsch, Paul Coverdale, Patrick 1168 Luthi, Paul Barrett, Jari Hagqvist, Pengjun (Jeff) Huang, John Gibbs, 1169 Yutaka Kamamoto, and Csaba Kos. The review and oversight by the IETF 1170 Payload Working Group chairs Ali Begen and Roni Even during the 1171 development of this RFC is appreciated. Additionally, the careful 1172 review by Richard Barnes and extensive review by David Black and the 1173 rest of the IESG is likewise very much appreciated. 1175 8. Contributors 1177 The authors thank everyone who have contributed to this document. 1178 The people listed here deserve special mention: Ali Begen, Roni Even, 1179 and Hadriel Kaplan. 1181 9. IANA Considerations 1183 One media type (audio/G711-0) has been defined and requires IANA 1184 registration in the media types registry. See Section 5.1 for 1185 details. 1187 10. Security Considerations 1189 RTP packets using the payload format defined in this specification 1190 are subject to the security considerations discussed in the RTP 1191 specification [RFC3550], and in any appropriate RTP profile (for 1192 example RFC 3551 [RFC3551] or [RFC4585]). This implies that 1193 confidentiality of the media streams is achieved by encryption; for 1194 example, through the application of SRTP [RFC3711]. Because the data 1195 compression used with this payload format is applied end-to-end, any 1196 encryption needs to be performed after compression. 1198 Note that the appropriate mechanism to ensure confidentiality and 1199 integrity of RTP packets and their payloads is very dependent on the 1200 application and on the transport and signaling protocols employed. 1201 Thus, although SRTP is given as an example above, other possible 1202 choices exist. 1204 Note that end-to-end security with either authentication, integrity 1205 or confidentiality protection will prevent a network element not 1206 within the security context from performing media-aware operations 1207 other than discarding complete packets. To allow any (media-aware) 1208 intermediate network element to perform its operations, it is 1209 required to be a trusted entity which is included in the security 1210 context establishment. 1212 G.711.0 has no known denial-of-service attacks due to decoding, as 1213 data posing as a desired G711.0 payload will be decoded into 1214 something (as per the decoding algorithm) with a finite amount of 1215 computation. This is due to the decompression algorithm having a 1216 finite worst-case processing path (no infinite computational loops 1217 are possible). We also note that the data read by the G.711.0 1218 decoder is controlled by the length of the individual encoded G.711.0 1219 frame(s) contained in the RTP payload. The decoding algorithm 1220 specified in Section 4.2.3 above ensures that the G.711.0 decoder 1221 will not read beyond the length of the internal buffer specified 1222 (which is in turn specified to be no greater than the largest 1223 possible G.711.0 frame of 321 octets). Therefore a G.711.0 payload 1224 does not carry "active content" that could impose malicious side- 1225 effects upon the receiver. 1227 G.711.0 is a variable bit rate (VBR) audio codec. There have been 1228 recent concerns with VBR speech codecs where a passive observer can 1229 identify phrases from a standard speech corpus by means of the 1230 lengths produced by the encoder even when the payload is encrypted 1231 [IEEE]. In this paper, it was determined that some code excited 1232 linear prediction (CELP) codecs would produce discrete packet lengths 1233 for some phonemes. And furthermore with the use of appropriately 1234 designed Hidden Markov Models (HMMs) that such a system could predict 1235 phrases with unexpected accuracy. One CELP codec studied, SPEEX, had 1236 the property that it produced 21 different packet lengths in its 1237 wideband mode and that these packet lengths probabilistically mapped 1238 to phonemes that a HMM system could be trained on. In this paper it 1239 was determined that a mitigation technique would be to pad the output 1240 of the encoder with random padding lengths to the effect: 1) that 1241 more discrete payload sizes would result, and 2) that the 1242 probabilistic mapping to phonemes would become less clear. As G.711 1243 is not a speech model based codec, neither is G.711.0. A G.711.0 1244 encoding, during talking periods, produces frames of varying frame 1245 lengths which are not likely to have a strong mapping to phonemes. 1246 Thus G.711.0 is not expected to have this same vulnerability. It 1247 should be noted that "silence" (only one value of G.711 in the entire 1248 G.711 input frame)" or "near silence" (only a few G.711 values) is 1249 easily detectable as G.711.0 frame lengths or one or a few octets. 1250 If one desires to mitigate for silence/non-silence detection, 1251 statistically variable padding should be added to G.711.0 frames that 1252 resulted in very small G.711.0 frames (less than about 20% of the 1253 symbols of the corresponding G.711 input frame). Methods of 1254 introducing padding in the G.711.0 payloads have been provided in the 1255 G.711.0 RTP payload definition in Section 4.2.2. 1257 11. Congestion Control 1259 The G.711 codec is a Constant Bit Rate (CBR) codec which does not 1260 have a means to regulate the bitrate. The G.711.0 lossless 1261 compression algorithm typically compresses the G.711 CBR stream into 1262 a lower bandwidth VBR stream. However, being lossless, it does not 1263 possess means of further reducing the bitrate beyond the 1264 G.711.0-based compression result. The G.711.0 RTP payloads can be 1265 made arbitrarily large by means of adding optional padding bytes 1266 (subject only to MTU limitations). 1268 Therefore, there are no explicit ways to regulate the bit-rate of the 1269 transmissions outlined in this RTP Payload format except by means of 1270 modulating the number of optional padding bytes in the RTP payload. 1272 12. References 1274 12.1. Normative References 1276 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1277 Requirement Levels", BCP 14, RFC 2119, March 1997. 1279 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1280 Description Protocol", RFC 4566, July 2006. 1282 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 1283 Specifications and Registration Procedures", BCP 13, RFC 1284 6838, January 2013. 1286 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1287 Jacobson, "RTP: A Transport Protocol for Real-Time 1288 Applications", STD 64, RFC 3550, July 2003. 1290 [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and 1291 Video Conferences with Minimal Control", STD 65, RFC 3551, 1292 July 2003. 1294 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 1295 "Extended RTP Profile for Real-time Transport Control 1296 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, July 1297 2006. 1299 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 1300 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 1301 RFC 3711, March 2004. 1303 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1304 with Session Description Protocol (SDP)", RFC 3264, June 1305 2002. 1307 [G.711.0] ITU-T G.711.0, , "Recommendation ITU-T G.711.0 - Lossless 1308 Compression of G.711 Pulse Code Modulation", September 1309 2009. 1311 [G.711] ITU-T G.711.0, , "Recommendation ITU-T G.711: Pulse Code 1312 Modulation (PCM) of Voice Frequencies", November 1988. 1314 [G.711-AP1] 1315 ITU-T G.711 Appendix 1, , "Recommendation G.711 1316 Appendix 1: A high quality low-complexity algorithm for 1317 packet loss concealment with G.711", September 1999. 1319 [G.711-A1] 1320 ITU-T G.711 Amendment 1, , "Recommendation ITU-T G.711 1321 Amendment 1 - Amendment 1: New Annex A on Lossless 1322 Encoding of PCM Frames", September 2009. 1324 12.2. Informative References 1326 [G.729] ITU-T G.729, , "Recommendation ITU-T G.729 - Coding of 1327 speech at 8 kbit/s using conjugate-structure algebraic- 1328 code-excited linear prediction (CS-ACELP)", January 2007. 1330 [G.722] ITU-T G.722, , "Recommendation ITU-T G.722 - 7 kHz audio- 1331 coding within 64 kbit/s", November 1988. 1333 [ICASSP] N. Harada, , Y. Yamamoto, , T. Moriya, , Y. Hiwasaki, , M. 1334 A. Ramalho, , L. Netsch, , Y. Stachurski, , Miao Lei, , H. 1335 Taddei, , and Q. Fengyan, "Emerging ITU-T Standard G.711.0 1336 - Lossless Compression of G.711 Pulse Code Modulation, 1337 International Conference on Acoustics Speech and Signal 1338 Processing (ICASSP), 2010, ISBN 978-1-4244-4244-4295-9", 1339 March 2010. 1341 [IEEE] C.V. Wright, , L. Ballard, , S.E. Coull, , F. Monrose, , 1342 and G.M. Masson, "Spot Me if You Can: Uncovering Spoken 1343 Phrases in Encrypted VoIP Conversations, IEEE Symposium on 1344 Security and Privacy, 2008, ISBN: 978-0-7695-3168-7", May 1345 2008. 1347 Authors' Addresses 1349 Michael A. Ramalho (editor) 1350 Cisco Systems, Inc. 1351 6310 Watercrest Way Unit 203 1352 Lakewood Ranch, FL 34202 1353 USA 1355 Phone: +1 919 476 2038 1356 Email: mramalho@cisco.com 1358 Paul E. Jones 1359 Cisco Systems, Inc. 1360 7025 Kit Creek Rd. 1361 Research Triangle Park, NC 27709 1362 USA 1364 Phone: +1 919 476 2048 1365 Email: paulej@packetizer.com 1367 Noboru Harada 1368 NTT Communications Science Labs. 1369 3-1 Morinosato-Wakamiya 1370 Atsugi, Kanagawa 243-0198 1371 JAPAN 1373 Phone: +81 46 240 3676 1374 Email: harada.noboru@lab.ntt.co.jp 1375 Muthu Arul Mozhi Perumal 1376 Ericsson 1377 Ferns Icon 1378 Doddanekundi, Mahadevapura 1379 Bangalore, Karnataka 560037 1380 India 1382 Phone: +91 9449288768 1383 Email: muthu.arul@gmail.com 1385 Lei Miao 1386 Huawei Technologies Co. Ltd 1387 Q22-2-A15R, Enviroment Protection Park 1388 No. 156 Beiqing Road 1389 HaiDian District 1390 Beijing 100095 1391 China 1393 Phone: +86 1059728300 1394 Email: lei.miao@huawei.com