fixes addressing Spencer Dawkins <spencer@mcsr-labs.org> comments
[platform/upstream/libvorbis.git] / doc / draft-ietf-avt-rtp-vorbis-08.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
3 <?rfc toc="yes" ?>
4 <?rfc compact='yes'?>
5
6 <rfc ipr="full3978" docName="RTP Payload Format for Vorbis Encoded Audio">
7
8 <front>
9 <title>draft-ietf-avt-rtp-vorbis-08</title>
10
11 <author initials="L" surname="Barbato" fullname="Luca Barbato">
12 <organization>Xiph.Org</organization>
13 <address>
14 <email>lu_zero@gentoo.org</email>
15 <uri>http://www.xiph.org/</uri>
16 </address>
17 </author>
18
19 <date day="28" month="Oct" year="2007" />
20
21 <area>General</area>
22 <workgroup>AVT Working Group</workgroup>
23 <keyword>I-D</keyword>
24
25 <keyword>Internet-Draft</keyword>
26 <keyword>Vorbis</keyword>
27 <keyword>RTP</keyword>
28
29 <abstract>
30
31 <t>
32 This document describes an RTP payload format for transporting Vorbis encoded
33 audio. It details the RTP encapsulation mechanism for raw Vorbis data and 
34 details the delivery mechanisms for the decoder probability model, referred to
35 as a codebook and other setup information.
36 </t>
37
38 <t>
39 Also included within this memo are media type registrations, and the details
40 necessary for the use of Vorbis with the Session Description Protocol (SDP).
41 </t>
42
43 </abstract>
44
45 <note title="Editors Note">
46 <t>
47 All references to RFC XXXX are to be replaced by references to the RFC number
48 of this memo, when published.
49 </t>
50 </note>
51
52 </front>
53
54 <middle>
55
56 <section anchor="Introduction" title="Introduction">
57
58 <t>
59 Vorbis is a general purpose perceptual audio codec intended to allow 
60 maximum encoder flexibility, thus allowing it to scale competitively 
61 over an exceptionally wide range of bitrates. At the high 
62 quality/bitrate end of the scale (CD or DAT rate stereo, 16/24 bits), it 
63 is in the same league as MPEG-4 AAC.
64 Vorbis is also intended for lower and higher sample rates (from 
65 8kHz telephony to 192kHz digital masters) and a range of channel 
66 representations (monaural, polyphonic, stereo, quadraphonic, 5.1, 
67 ambisonic, or up to 255 discrete channels).
68 </t>
69
70 <t>
71 Vorbis encoded audio is generally encapsulated within an Ogg format bitstream
72 <xref target="rfc3533"></xref>, which provides framing and synchronization.
73 For the purposes of RTP transport, this layer is unnecessary, and so raw Vorbis
74 packets are used in the payload.
75 </t>
76
77 <section anchor="Terminology" title="Terminology">
78
79 <t>
80 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" 
81 in this document are to be interpreted as described in RFC 2119 <xref target="rfc2119"></xref>.
82 </t>
83
84 </section>
85 </section>
86
87 <section anchor="Payload Format" title="Payload Format">
88
89 <t>
90 For RTP based transport of Vorbis encoded audio the standard RTP header is
91 followed by a 4 octets payload header, then the payload data. The payload
92 headers are used to associate the Vorbis data with its associated decoding
93 codebooks as well as indicating if the following packet contains fragmented
94 Vorbis data and/or the number of whole Vorbis data frames. The payload data
95 contains the raw Vorbis bitstream information. There are 3 types of Vorbis
96 payload data, an RTP packet MUST contain just one of them at a time.
97 </t>
98
99 <section anchor="RTP Header" title="RTP Header">
100
101 <t>
102 The format of the RTP header is specified in <xref target="rfc3550"></xref>
103 and shown in Figure <xref target="RTP Header Figure"/>.  This payload format
104 uses the fields of the header in a manner consistent with that specification.
105 </t>
106
107 <t>
108 <figure anchor="RTP Header Figure" title="RTP Header">
109 <artwork><![CDATA[
110     0                   1                   2                   3
111     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
112    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
113    |V=2|P|X|  CC   |M|     PT      |       sequence number         |
114    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
115    |                           timestamp                           |
116    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
117    |           synchronization source (SSRC) identifier            |
118    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
119    |            contributing source (CSRC) identifiers             |
120    |                              ...                              |
121    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
122 ]]></artwork>
123 </figure>
124 </t>
125
126 <t>
127 The RTP header begins with an octet of fields (V, P, X, and CC) to support
128 specialized RTP uses (see <xref target="rfc3550"></xref> and 
129 <xref target="rfc3551"></xref> for details). For Vorbis RTP, the following
130 values are used.
131 </t>
132
133 <t>
134 Version (V): 2 bits</t>
135 <t>
136 This field identifies the version of RTP. The version used by this
137 specification is two (2).
138 </t>
139
140 <t>
141 Padding (P): 1 bit</t>
142 <t>
143 Padding MAY be used with this payload format according to section 5.1 of
144 <xref target="rfc3550"></xref>.
145 </t>
146
147 <t>
148 Extension (X): 1 bit</t>
149 <t>
150 The Extension bit is used in accordance with <xref target="rfc3550"></xref>.
151 </t>
152
153 <t>
154 CSRC count (CC): 4 bits</t>
155 <t>
156 The CSRC count is used in accordance with <xref target="rfc3550"></xref>.
157 </t>
158
159 <t>
160 Marker (M): 1 bit</t>
161 <t>
162 Set to zero.  Audio silence suppression not used.  This conforms to section 4.1
163 of <xref target="vorbis-spec-ref"></xref>.
164 </t>
165
166 <t>
167 Payload Type (PT): 7 bits</t>
168 <t>
169 An RTP profile for a class of applications is expected to assign a payload type
170 for this format, or a dynamically allocated payload type SHOULD be chosen which
171 designates the payload as Vorbis.
172 </t>
173
174 <t>
175 Sequence number: 16 bits</t>
176 <t>
177 The sequence number increments by one for each RTP data packet sent, and may be
178 used by the receiver to detect packet loss and to restore packet sequence. This
179 field is detailed further in <xref target="rfc3550"></xref>.
180 </t>
181
182 <t>
183 Timestamp: 32 bits</t>
184 <t>
185 A timestamp representing the sampling time of the first sample of the first
186 Vorbis packet in the RTP packet. The clock frequency MUST be set to the sample
187 rate of the encoded audio data and is conveyed out-of-band (e.g. as an SDP parameter).
188 </t>
189
190 <t>
191 SSRC/CSRC identifiers: </t>
192 <t>
193 These two fields, 32 bits each with one SSRC field and a maximum of 16 CSRC
194 fields, are as defined in <xref target="rfc3550">
195 </xref>.  
196 </t>
197
198 </section>
199
200 <section anchor="Payload Header" title="Payload Header">
201
202 <t>
203 The 4 octets following the RTP Header section are the Payload Header. This
204 header is split into a number of bitfields detailing the format of the
205 following payload data packets.
206 </t>
207
208 <figure anchor="Payload Header Figure" title="Payload Header">
209 <artwork><![CDATA[
210     0                   1                   2                   3
211     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
212    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
213    |                     Ident                     | F |VDT|# pkts.|
214    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
215 ]]></artwork>
216 </figure>
217
218 <t>
219 Ident: 24 bits</t>
220 <t>
221 This 24 bit field is used to associate the Vorbis data to a decoding
222 Configuration. It is stored as network byte order integer.
223 </t>
224
225 <t>
226 Fragment type (F): 2 bits</t>
227 <t>
228 This field is set according to the following list
229 </t>
230 <vspace blankLines="1" />
231 <list style="empty">
232 <t>      0 = Not Fragmented</t>
233 <t>      1 = Start Fragment</t>
234 <t>      2 = Continuation Fragment</t>
235 <t>      3 = End Fragment</t>
236 </list>
237
238 <t>
239 Vorbis Data Type (VDT): 2 bits</t>
240 <t>
241 This field specifies the kind of Vorbis data stored in this RTP packet. There
242 are currently three different types of Vorbis payloads. Each packet MUST contain only a single type of Vorbis payload (e.g. you must not aggregate configuration and comment payload in the same packet)
243 </t>
244
245 <vspace blankLines="1" />
246 <list style="empty">
247 <t>      0 = Raw Vorbis payload</t>
248 <t>      1 = Vorbis Packed Configuration payload</t>
249 <t>      2 = Legacy Vorbis Comment payload</t>
250 <t>      3 = Reserved</t>
251 </list>
252
253 <t> The packets with a VDT of value 3 MUST be ignored </t>
254
255 <t>
256 The last 4 bits represent the number of complete packets in this payload. This
257 provides for a maximum number of 15 Vorbis packets in the payload. If the
258 packet contains fragmented data the number of packets MUST be set to 0.
259 </t>
260
261 </section>
262
263 <section anchor="Payload Data" title="Payload Data">
264
265 <t>
266 Raw Vorbis packets are currently unbounded in length, application profiles will
267 likely define a practical limit. Typical Vorbis packet sizes range from very
268 small (2-3 bytes) to quite large (8-12 kilobytes). The reference implementation
269 <xref target="libvorbis"></xref> typically produces packets less than ~800
270 bytes, except for the setup header packets which are ~4-12 kilobytes. Within an
271 RTP context, to avoid fragmentation, the Vorbis data packet size SHOULD be kept
272 sufficiently small so that after adding the RTP and payload headers, the
273 complete RTP packet is smaller than the path MTU.
274 </t>
275
276 <figure anchor="Payload Data Figure" title="Payload Data Header">
277 <artwork><![CDATA[
278     0                   1                   2                   3
279     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
280    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
281    |            length             |       vorbis packet data     ..
282    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
283 ]]></artwork>
284 </figure>
285
286 <t>
287 Each Vorbis payload packet starts with a two octet length header, which is used
288 to represent the size in bytes of the following data payload, followed by the
289 raw Vorbis data padded to the nearest byte boundary, as explained by the <xref target="vorbis-spec-ref">vorbis specification</xref>. The length value is stored
290 as network byte order integer.
291 </t>
292
293 <t>
294 For payloads which consist of multiple Vorbis packets the payload data consists
295 of the packet length followed by the packet data for each of the Vorbis packets
296 in the payload.
297 </t>
298
299 <t>
300 The Vorbis packet length header is the length of the Vorbis data block only and
301 does not include the length field.
302 </t>
303
304 <t>
305 The payload packing of the Vorbis data packets MUST follow the guidelines
306 set-out in <xref target="rfc3551"></xref> where the oldest Vorbis packet occurs
307 immediately after the RTP packet header. Subsequent Vorbis packets, if any, MUST
308 follow in temporal order.
309 </t>
310
311 <t>
312 Channel mapping of the audio is in accordance with the
313 <xref target="vorbis-spec-ref">Vorbis I Specification</xref>.
314 </t>
315
316 </section>
317
318 <section anchor="Example RTP Packet" title="Example RTP Packet">
319
320 <t>
321 Here is an example RTP packet containing two Vorbis packets.
322 </t>
323
324 <figure anchor="Example Raw Vorbis Packet" title="Example Raw Vorbis Packet">
325 <artwork><![CDATA[
326     0                   1                   2                   3
327     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
328    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
329    | 2 |0|0|  0    |0|      PT     |       sequence number         |
330    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
331    |               timestamp (in sample rate units)                |
332    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
333    |           synchronisation source (SSRC) identifier            |
334    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
335    |            contributing source (CSRC) identifiers             |
336    |                              ...                              |
337    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
338    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
339    |                     Ident                     | 0 | 0 | 2 pks |
340    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
341    |            length             |          vorbis data         ..
342    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
343    ..                        vorbis data                           |
344    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
345    |            length             |   next vorbis packet data    ..
346    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
347    ..                        vorbis data                          ..
348    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
349    ..               vorbis data                    |
350    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
351 ]]></artwork>
352 </figure>
353
354 <t>
355 The payload data section of the RTP packet begins with the 24 bit Ident field
356 followed by the one octet bitfield header, which has the number of Vorbis
357 frames set to 2.  Each of the Vorbis data frames is prefixed by the two octets
358 length field. The Packet Type and Fragment Type are set to 0. The Configuration
359 that will be used to decode the packets is the one indexed by the ident value.
360 </t>
361
362 </section>
363 </section>
364
365
366
367 <section anchor="Configuration Headers" title="Configuration Headers">
368
369 <t>
370 Unlike other mainstream audio codecs Vorbis has no statically 
371 configured probability model. Instead, it packs all entropy decoding 
372 configuration, Vector Quantization and Huffman models into a data block
373 that must be transmitted to the decoder along with the compressed data.
374 A decoder also requires information detailing the number of audio 
375 channels, bitrates and similar information to configure itself for a 
376 particular compressed data stream. These two blocks of information are 
377 often referred to collectively as the "codebooks" for a Vorbis stream,
378 and are nominally included as special "header" packets at the start 
379 of the compressed data. In addition,
380 the <xref target="vorbis-spec-ref">Vorbis I specification</xref>
381 requires the presence of a comment header packet which gives simple
382 metadata about the stream, but this information is not required for 
383 decoding the frame sequence.
384 </t>
385
386 <t>
387 Thus these two codebook header packets must be received by the decoder before
388 any audio data can be interpreted. These requirements pose problems in RTP,
389 which is often used over unreliable transports.
390 </t>
391
392 <t>
393 Since this information must be transmitted reliably and, as the RTP 
394 stream may change certain configuration data mid-session, there are 
395 different methods for delivering this configuration data to a 
396 client, both in-band and out-of-band which is detailed below. SDP 
397 delivery is typically used to set up an initial state for the client 
398 application. The changes may be due to different codebooks as well as 
399 different bitrates of the stream.
400 </t>
401
402 <t>
403 The delivery vectors in use can be specified by an SDP attribute to indicate the
404 method and the optional URI where the Vorbis
405 <xref target="Packed Configuration">Packed Configuration</xref> Packets could
406 be fetched. Different delivery methods MAY be advertised for the same session.
407 The in-band Configuration delivery SHOULD be considered as baseline,
408 out-of-band delivery methods that don't use RTP will not be described in this
409 document. For non chained streams, the recommended Configuration delivery
410 method is inline the <xref target="Packed Configuration">Packed Configuration</xref> in the SDP as explained in the <xref target="Mapping Media Type Parameters into SDP"> IANA considerations</xref>.
411 </t>
412
413 <t>
414 The 24 bit Ident field is used to map which Configuration will be used to
415 decode a packet. When the Ident field changes, it indicates that a change in
416 the stream has taken place. The client application MUST have in advance the
417 correct configuration and if the client detects a change in the Ident value and
418 does not have this information it MUST NOT decode the raw Vorbis data
419 associated until it fetches the correct Configuration.
420 </t>
421
422 <section anchor="In-band Header Transmission" title="In-band Header Transmission">
423
424 <t>
425 The <xref target="Packed Configuration">Packed Configuration</xref> Payload is
426 sent in-band with the packet type bits set to match the Vorbis Data Type.
427 Clients MUST be capable of dealing with fragmentation and periodic
428 <xref target="rfc4588">re-transmission of</xref> the configuration headers.
429 </t>
430
431 <section anchor="Packed Configuration" title="Packed Configuration">
432
433 <t>
434 A Vorbis Packed Configuration is indicated with the Vorbis Data Type field set
435 to 1. Of the three headers defined in the
436 <xref target="vorbis-spec-ref">Vorbis I specification</xref>, the
437 Identification and the Setup MUST be packed as they are, while the comment header MAY be replaced with a dummy one. The packed configuration follows a generic way to store xiph codec configurations: The first field stores the number of the following packets minus one (count field), the next ones represent the size of the headers (length fields), the headers immediately follow the list of length fields. The size of the last header is implicit.
438 The count and the length fields are encoded using the following logic: the data is in network byte order, every byte has the most significant bit used as flag and the following 7 used to store the value. The first N bit are to be taken, where N is number of bits needed to represent the value, taken modulo 7, and stored in
439 the first byte.
440 If there are more bits, the flag bit is set to 1 and the subsequent 7bit are stored in the following byte, if there are remaining bits set the flag to 1 and the same procedure is repeated. The ending byte has the flag bit set to 0. In order to decode it is enough to iterate over the bytes until the flag bit set to 0, for every byte the data is added to the accumulated value multiplied by 128.
441 The headers are packed in the same order they are present in ogg: Identification, Comment, Setup.</t>
442
443 <figure anchor="Packed Configuration Figure" title="Packed Configuration Figure">
444 <artwork><![CDATA[
445     0                   1                   2                   3
446     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
447    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
448    |V=2|P|X|  CC   |M|     PT      |             xxxx              |
449    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
450    |                             xxxxx                             |
451    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
452    |           synchronization source (SSRC) identifier            |
453    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
454    |            contributing source (CSRC) identifiers             |
455    |                              ...                              |
456    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
457    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
458    |                      Ident                    | 1 | 0 |      0|
459    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
460    |           length              | n. of headers |    length1    |
461    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
462    |    length2    |                  Identification              ..
463    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
464    ..                        Identification                       ..
465    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
466    ..                        Identification                       ..
467    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
468    ..                        Identification                       ..
469    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
470    ..               Identification                 |    Comment   ..
471    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
472    ..                            Comment                          ..
473    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
474    ..                            Comment                          ..
475    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
476    ..                            Comment                          ..
477    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
478    ..           Comment            |             Setup            ..
479    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
480    ..                            Setup                            ..
481    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
482    ..                            Setup                            ..
483    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
484 ]]></artwork>
485 </figure>
486
487 <t>The Ident field is set with the value that will be used by the Raw Payload
488 Packets to address this Configuration. The Fragment type is set to 0 since the
489 packet bears the full Packed configuration, the number of packet is set to 1.</t>
490 </section>
491 </section>
492
493 <section anchor="Out of Band Transmission" title="Out of Band Transmission">
494
495 <t>
496 This section, as stated above, does not cover all the possible out-of-band
497 delivery methods since they rely on different protocols and are linked to
498 specific applications. The following packet definition SHOULD be used in
499 out-of-band delivery and MUST be used when Configuration is inlined in the SDP.
500 </t>
501
502 <section anchor="Packed Headers" title="Packed Headers"> 
503
504 <t>
505 As mentioned above the RECOMMENDED delivery vector for Vorbis configuration
506 data is via a retrieval method that can be performed using a reliable transport
507 protocol. As the RTP headers are not required for this method of delivery the
508 structure of the configuration data is slightly different. The packed header
509 starts with a 32 bit (network byte ordered) count field which details the number of
510 packed headers that are contained in the bundle. Next is the Packed header
511 payload for each chained Vorbis stream.
512 </t>
513
514 <figure anchor="Packed Headers Overview Figure" title="Packed Headers Overview">
515 <artwork><![CDATA[
516    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
517    |                     Number of packed headers                  |
518    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
519    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
520    |                          Packed header                        |
521    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
522    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
523    |                          Packed header                        |
524    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
525 ]]></artwork>
526 </figure>
527
528 <t>
529 Since the Configuration Ident and the Identification Header are fixed length
530 there is only a 2 byte length tag to define the length of the packed headers.
531 </t>
532
533 <figure anchor="Packed Headers Detail Figure" title="Packed Headers Detail">
534 <artwork><![CDATA[
535     0                   1                   2                   3
536     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
537    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
538    |                   Ident                       |    length    ..
539    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
540    ..              | n. of headers |    length1    |    length2   ..
541    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
542    ..              |             Identification Header            ..
543    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
544    .................................................................
545    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
546    ..              |         Comment Header                       ..
547    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
548    .................................................................
549    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550    ..                        Comment Header                        |
551    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
552    |                          Setup Header                        ..
553    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
554    .................................................................
555    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
556    ..                         Setup Header                         |
557    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
558 ]]></artwork>
559 </figure>
560 <t>
561 The key difference between the in-band format and this one, is that there is no
562 need for the payload header octet. In this figure the comment has a size bigger
563 than 127 bytes.
564 </t>
565 </section>
566
567 </section>
568
569 <section anchor="Loss of Configuration Headers" title="Loss of Configuration Headers"> 
570
571 <t>
572 Unlike the loss of raw Vorbis payload data, loss of a configuration header can
573 lead to a situation where it will not be possible to successfully decode the
574 stream.
575 </t>
576
577 <t>
578 Loss of Configuration Packets results in the halting of stream decoding.
579 </t>
580
581 </section>
582
583 </section>
584
585 <section anchor="Comment Headers" title="Comment Headers">
586
587 <t>
588 With the Vorbis Data Type flag set to 2, this indicates that the packet contain
589 the comment metadata, such as artist name, track title and so on. These
590 metadata messages are not intended to be fully descriptive but to offer basic
591 track/song information. Clients MAY ignore it completely. The details on the
592 format of the comments can be found in the <xref target="vorbis-spec-ref">Vorbis documentation</xref>.
593 </t>
594 <figure anchor="Comment Packet Figure" title="Comment Packet">
595 <artwork><![CDATA[
596     0                   1                   2                   3
597     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
598    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
599    |V=2|P|X|  CC   |M|     PT      |             xxxx              |
600    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
601    |                             xxxxx                             |
602    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
603    |           synchronization source (SSRC) identifier            |
604    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
605    |            contributing source (CSRC) identifiers             |
606    |                              ...                              |
607    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
609    |                      Ident                    | 0 | 2 |      1|
610    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
611    |            length             |            Comment           ..
612    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
613    ..                           Comment                           ..
614    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
615    ..                           Comment                            |
616    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
617 ]]></artwork>
618 </figure>
619
620 <t>
621 The 2 bytes length field is necessary since this packet could be fragmented.
622 </t>
623
624 </section>
625 <section anchor="Frame Packetization" title="Frame Packetization">
626
627 <t>
628 Each RTP packet contains either one Vorbis packet fragment, or an integer
629 number of complete Vorbis packets (up to a maximum of 15 packets, since the
630 number of packets is defined by a 4 bit value).
631 </t>
632
633 <t>
634 Any Vorbis data packet that is less than path MTU SHOULD be bundled in the RTP
635 packet with as many Vorbis packets as will fit, up to a maximum of 15, except
636 when such bundling would exceed an application's desired transmission latency.
637 Path MTU is detailed in <xref target="rfc1191"></xref> and <xref target="rfc1981"></xref>.
638 </t>
639
640 <t>
641 A fragmented packet has a zero in the last four bits of the payload header.
642 The first fragment will set the Fragment type to 1. Each fragment after the
643 first will set the Fragment type to 2 in the payload header.  The RTP packet
644 containing the last fragment of the Vorbis packet will have the Fragment type
645 set to 3.  To maintain the correct sequence for fragmented packet reception
646 the timestamp field of fragmented packets MUST be the same as the first packet
647 sent, with the sequence number incremented as normal for the subsequent RTP
648 packets. The length field shows the fragment length.
649 </t>
650
651 <section anchor="Example Fragmented Vorbis Packet" title="Example Fragmented Vorbis Packet">
652
653 <t>
654 Here is an example fragmented Vorbis packet split over three RTP packets.
655 Each packet contains the standard RTP headers as well as the 4 octets Vorbis
656 headers.
657 </t>
658
659 <figure anchor="Example Fragmented Packet (Packet 1)" title="Example Fragmented Packet (Packet 1)">
660 <artwork><![CDATA[
661    Packet 1:
662
663     0                   1                   2                   3
664     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
665    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
666    |V=2|P|X|  CC   |M|     PT      |           1000                |
667    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
668    |                            12345                              |
669    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
670    |           synchronization source (SSRC) identifier            |
671    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
672    |            contributing source (CSRC) identifiers             |
673    |                              ...                              |
674    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
675    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
676    |                       Ident                   | 1 | 0 |      0|
677    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
678    |             length            |            vorbis data       ..
679    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
680    ..                        vorbis data                           |
681    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
682 ]]></artwork>
683 </figure>
684
685 <t>
686 In this packet the initial sequence number is 1000 and the timestamp is 12345.  The Fragment type is set to 1, the number of packets field is set to 0, and as
687 the payload is raw Vorbis data the VDT field is set to 0.
688 </t>
689
690 <figure anchor="Example Fragmented Packet (Packet 2)" title="Example Fragmented Packet (Packet 2)">
691 <artwork><![CDATA[
692    Packet 2:
693
694     0                   1                   2                   3
695     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
696    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
697    |V=2|P|X|  CC   |M|     PT      |           1001                |
698    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
699    |                             12345                             |
700    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
701    |           synchronization source (SSRC) identifier            |
702    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
703    |            contributing source (CSRC) identifiers             |
704    |                              ...                              |
705    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
706    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
707    |                       Ident                   | 2 | 0 |      0|
708    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
709    |             length            |          vorbis data         ..
710    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
711    ..                        vorbis data                           |
712    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
713 ]]></artwork>
714 </figure>
715
716 <t>
717 The Fragment type field is set to 2 and the number of packets field is set to 0.
718 For large Vorbis fragments there can be several of this type of payload 
719 packets. The maximum packet size SHOULD be no greater than the path MTU,
720 including all RTP and payload headers. The sequence number has been incremented
721 by one but the timestamp field remains the same as the initial packet.
722 </t>
723
724 <figure anchor="Example Fragmented Packet (Packet 3)" title="Example Fragmented Packet (Packet 3)">
725 <artwork><![CDATA[
726    Packet 3:
727
728     0                   1                   2                   3
729     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
730    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
731    |V=2|P|X|  CC   |M|     PT      |           1002                |
732    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
733    |                             12345                             |
734    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
735    |           synchronization source (SSRC) identifier            |
736    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
737    |            contributing source (CSRC) identifiers             |
738    |                              ...                              |
739    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
740    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
741    |                      Ident                    | 3 | 0 |      0|
742    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
743    |             length            |          vorbis data         ..
744    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
745    ..                        vorbis data                           |
746    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
747 ]]></artwork>
748 </figure>
749
750 <t>
751 This is the last Vorbis fragment packet.  The Fragment type is set to 3 and the
752 packet count remains set to 0. As in the previous packets the timestamp remains
753 set to the first packet in the sequence and the sequence number has been
754 incremented.
755 </t>
756 </section>
757
758 <section anchor="Packet Loss" title="Packet Loss">
759
760 <t>
761 As there is no error correction within the Vorbis stream, packet loss will
762 result in a loss of signal. Packet loss is more of an issue for fragmented
763 Vorbis packets as the client will have to cope with the handling of the
764 Fragment Type. In case of loss of fragments the client MUST discard all the
765 remaining Vorbis fragments and decode the incomplete packet. If we use the
766 fragmented Vorbis packet example above and the first RTP packet is lost the
767 client MUST detect that the next RTP packet has the packet count field set
768 to 0 and the Fragment type 2 and MUST drop it.
769 The next RTP packet, which is the final fragmented packet, MUST be dropped in
770 the same manner.
771 If the missing RTP packet is the last, the received two fragments will be kept
772 and the incomplete Vorbis packet decoded.
773 </t>
774
775 <t>
776 Loss of any of the Configuration fragment will result in the loss of the full
777 Configuration packet with the result detailed in the <xref target="Loss of Configuration Headers">Loss of Configuration Headers</xref> section.
778 </t>
779
780 </section>
781 </section>
782 <section anchor="IANA Considerations" title="IANA Considerations"> 
783
784 <vspace blankLines="1" />
785 <list style="hanging">
786 <t hangText="Type name:"> audio </t>
787 <vspace blankLines="1" />
788
789 <t hangText="Subtype name:"> vorbis </t>
790 <vspace blankLines="1" />
791
792 <t hangText="Required parameters:">
793
794 <vspace blankLines="1" />
795
796 <list style="hanging">
797 <t hangText="rate:"> indicates the RTP timestamp clock rate as described in <xref target="rfc3551">RTP Profile for Audio and Video Conferences with Minimal Control.</xref>
798 </t>
799 <vspace blankLines="1" />
800
801 <t hangText="channels:"> indicates the number of audio channels as described in <xref target="rfc3551">RTP Profile for Audio and Video Conferences with Minimal Control.</xref>
802 </t>
803
804 <vspace blankLines="1" />
805
806 <t hangText="delivery-method:"> indicates the delivery methods in use, the possible values are: inline, in_band, out_band, MAY be included multiple times
807 </t>
808
809 <vspace blankLines="1" />
810
811 <t hangText="configuration:"> the <xref target="rfc3548">base64</xref> representation of the <xref target="Packed Headers">Packed Headers</xref>. It MUST follow the associated delivery-method parameter ("inline").
812 </t>
813 </list>
814 </t>
815
816 <vspace blankLines="1" />
817
818 <t hangText="Optional parameters:">
819
820 <vspace blankLines="1" />
821
822 <list style="hanging">
823 <t hangText="configuration-uri:"> the <xref target="rfc3986">URI</xref> of
824 the configuration headers in case of out of band transmission.
825 In the form of "scheme://path/to/resource/", depending on the specific
826 method, a single configuration packet could be retrived by its Ident number, or
827 multiple packets could be aggregated in a single stream. 
828 Non hierarchical protocols MAY point to a resource using their specific
829 syntax.
830 </t>
831 </list>
832 </t>
833
834 <vspace blankLines="1" />
835
836 <t hangText="Encoding considerations:">
837 <vspace blankLines="1" />
838 This media type is framed and contains binary data.
839 </t>
840
841 <vspace blankLines="1" />
842
843 <t hangText="Security considerations:">
844 <vspace blankLines="1" />
845 See Section 10 of RFC XXXX.</t>
846
847 <vspace blankLines="1" />
848 <t hangText="Interoperability considerations:">
849 <vspace blankLines="1" />
850 None</t>
851
852 <vspace blankLines="1" />
853 <t hangText="Published specification:">
854
855 <vspace blankLines="1" />
856 RFC XXXX [RFC Editor: please replace by the RFC number of  this memo, when published]
857 <vspace blankLines="1" />
858 Ogg Vorbis I specification:  Codec setup and packet decode. Available from the Xiph website, http://www.xiph.org
859 </t>
860
861 <vspace blankLines="1" />
862
863 <t hangText="Applications which use this media type:">
864 <vspace blankLines="1"/>
865 Audio streaming and conferencing tools </t>
866
867 <vspace blankLines="1" />
868
869 <t hangText="Additional information:">
870 <vspace blankLines="1" />
871 None </t>
872
873 <vspace blankLines="1" />
874
875 <t hangText="Person &amp; email address to contact for further information:">
876
877 <vspace blankLines="1" />
878
879 Luca Barbato: &lt;lu_zero@gentoo.org&gt;<br/>
880 IETF Audio/Video Transport Working Group
881
882 </t>
883
884 <vspace blankLines="1" />
885
886 <t hangText="Intended usage:">
887 <vspace blankLines="1" />
888 COMMON</t>
889
890 <vspace blankLines="1" />
891
892 <t hangText="Restriction on usage:">
893 <vspace blankLines="1" />
894 This media type depends on RTP framing, and hence is only defined for transfer via <xref target="rfc3550">RTP</xref></t>
895
896 <vspace blankLines="1" />
897
898 <t hangText="Author:">
899 <vspace blankLines="1"/>Luca Barbato</t>
900
901 <vspace blankLines="1" />
902
903 <t hangText="Change controller:">
904 <vspace blankLines="1"/>IETF AVT Working Group delegated from the IESG</t>
905
906 <vspace blankLines="1" />
907 </list>
908
909 <section anchor="Packed Headers IANA Considerations" title="Packed Headers IANA Considerations"> 
910
911 <t>
912 The following IANA considerations MUST only be applied to the packed headers.
913 </t>
914
915 <vspace blankLines="1" />
916
917 <list style="hanging">
918 <t hangText="Type name:"> audio </t>
919
920 <vspace blankLines="1" />
921
922 <t hangText="Subtype name:"> vorbis-config </t>
923
924 <vspace blankLines="1" />
925
926 <t hangText="Required parameters:">
927 <vspace blankLines="1" />
928 None
929 </t>
930
931 <vspace blankLines="1" />
932
933 <t hangText="Optional parameters:">
934 <vspace blankLines="1" />
935 None
936 </t>
937
938 <vspace blankLines="1" />
939
940 <t hangText="Encoding considerations:">
941 <vspace blankLines="1" />
942 This media type contains binary data.
943 </t>
944
945 <vspace blankLines="1" />
946
947 <t hangText="Security considerations:">
948 <vspace blankLines="1" />
949 See Section 10 of RFC XXXX.
950 </t>
951
952 <vspace blankLines="1" />
953
954 <t hangText="Interoperability considerations:">
955 <vspace blankLines="1" />
956 None
957 </t>
958
959 <vspace blankLines="1" />
960
961 <t hangText="Published specification:">
962 <vspace blankLines="1" />
963 RFC XXXX [RFC Editor: please replace by the RFC number of  this memo,
964        when published]
965 </t>
966
967 <vspace blankLines="1" />
968
969 <t hangText="Applications which use this media type:">
970 <vspace blankLines="1" />
971 Vorbis encoded audio, configuration data.
972 </t>
973
974 <vspace blankLines="1" />
975
976 <t hangText="Additional information:"> 
977 <vspace blankLines="1" />
978 None
979 </t>
980
981 <vspace blankLines="1" />
982
983 <t hangText="Person &amp; email address to contact for further information:">
984 <vspace blankLines="1" />
985 Luca Barbato: &lt;lu_zero@gentoo.org&gt;
986 <vspace blankLines="0" />
987 IETF Audio/Video Transport Working Group
988 </t>
989
990 <vspace blankLines="1" />
991
992 <t hangText="Intended usage:">
993 COMMON
994 </t>
995
996 <vspace blankLines="1" />
997
998 <t hangText="Restriction on usage:">
999 <vspace blankLines="1" />
1000 This media type doesn't depend on the transport.
1001 </t>
1002
1003 <vspace blankLines="1" />
1004
1005 <t hangText="Author:">
1006 <vspace blankLines="1" />
1007 Luca Barbato</t>
1008
1009 <vspace blankLines="1" />
1010
1011 <t hangText="Change controller:">
1012 <vspace blankLines="1" />
1013 IETF AVT Working Group delegated from the IESG</t>
1014 </list>
1015
1016 </section>
1017
1018 </section>
1019
1020 <section anchor="SDP related considerations" title="SDP related considerations">
1021 <t>
1022 The following paragraphs define the mapping of the parameters described in the IANA considerations section and their usage in the <xref target="rfc3264">Offer/Answer Model</xref>.
1023 </t>
1024
1025 <section anchor="Mapping Media Type Parameters into SDP" title="Mapping Media Type Parameters into SDP"> 
1026
1027 <t>
1028 The information carried in the Media Type specification has a
1029 specific mapping to fields in the <xref target="rfc4566">Session Description
1030 Protocol (SDP)</xref>, which is commonly used to describe RTP sessions.
1031 When SDP is used to specify sessions the mapping are as follows:
1032 </t>
1033
1034 <vspace blankLines="1" />
1035 <list style="symbols">
1036
1037 <t>The type name ("audio") goes in SDP "m=" as the media name.</t>
1038 <vspace blankLines="1" />
1039
1040 <t>The subtype name ("vorbis") goes in SDP "a=rtpmap" as the encoding name.</t>
1041 <vspace blankLines="1" />
1042
1043 <t>The parameter "rate" also goes in "a=rtpmap" as clock rate.</t>
1044 <vspace blankLines="1" />
1045
1046 <t>The parameter "channels" also goes in "a=rtpmap" as channel count.</t>
1047 <vspace blankLines="1" />
1048
1049 <t>The mandated parameters "delivery-method" and "configuration" MUST be
1050 included in the SDP "a=fmtp" attribute.</t>
1051 <vspace blankLines="1" />
1052
1053 <t>The optional parameter "configuration-uri", when present, MUST be included
1054 in the SDP "a=fmtp" attribute and MUST follow the delivery-method that applies.</t>
1055
1056 </list>
1057
1058 <t>
1059 If the stream comprises chained Vorbis files and all of them are known in
1060 advance, the Configuration Packet for each file SHOULD be passed to the client
1061 using the configuration attribute.
1062 </t>
1063
1064 <t>
1065 The URI specified in the configuration-uri attribute MUST point to a location
1066 where all of the Configuration Packets needed for the life of the session
1067 reside.
1068 </t>
1069
1070 <t>
1071 The port value is specified by the server application bound to the address
1072 specified in the c= line. The bitrate value and channels specified in the
1073 rtpmap attribute MUST match the Vorbis sample rate value.  An example is found
1074 below.
1075 </t>
1076
1077 <section anchor="SDP Example" title="SDP Example">
1078 <t>The following example shows a basic SDP single stream. The first
1079 configuration packet is inlined in the SDP, other configurations could be
1080 fetched at any time from the URIs provided. The inline
1081 <xref target="rfc3548">base64</xref> configuration string is folded in this
1082 example due to RFC line length limitations.</t>
1083
1084 <list style="empty">
1085 <t>c=IN IP4 192.0.2.1</t>
1086 <t>m=audio  RTP/AVP 98</t>
1087 <t>a=rtpmap:98 vorbis/44100/2</t>
1088 <t>a=fmtp:98 delivery-method=inline; configuration=AAAAAZ2f4g9NAh4aAXZvcmJpcwA...; delivery-method=out_band; configuration-uri=rtsp://path/to/the/resource; delivery-method=out_band; configuration-uri=http://another/path/to/resource/;</t>
1089 </list>
1090 </section>
1091
1092
1093 <t>
1094 Note that the payload format (encoding) names are commonly shown in upper case.
1095 Media Type subtypes are commonly shown in lower case. These names are
1096 case-insensitive in both places.  Similarly, parameter names are
1097 case-insensitive both in Media Type types and in the default mapping to the SDP
1098 a=fmtp attribute. The exception regarding case sensitivity is the
1099 configuration-uri URI which MUST be regarded as being case sensitive. The
1100 a=fmtp line is a single line even if it is shown as multiple lines in this
1101 document for clarity.
1102 </t>
1103
1104 </section>
1105
1106 <section anchor="Usage with the SDP Offer/Answer Mode" title="Usage with the SDP Offer/Answer Model">
1107
1108 <t>
1109 The only parameter negotiable is the delivery method. All the others are
1110 declarative: the offer, as described in <xref target="rfc3264">An Offer/Answer
1111 Model Session Description Protocol</xref>, may contain a large number of
1112 delivery methods per single fmtp attribute, the answerer MUST remove every
1113 delivery-method and configuration-uri not supported. All the parameters MUST
1114 not be altered on answer otherwise.
1115 </t>
1116
1117 </section>
1118
1119 </section>
1120
1121 <section anchor="Congestion Control" title="Congestion Control"> 
1122
1123 <t>
1124 Vorbis clients SHOULD send regular receiver reports detailing congestion. A
1125 mechanism for dynamically downgrading the stream, known as bitrate peeling,
1126 will allow for a graceful backing off of the stream bitrate. This feature is
1127 not available at present so an alternative would be to redirect the client to
1128 a lower bitrate stream if one is available.
1129 </t>
1130
1131 </section> 
1132
1133 <section anchor="Examples" title="Examples">
1134
1135 <t>
1136 The following examples are common usage patterns that MAY be applied in such
1137 situations, the main scope of this section is to explain better usage of the
1138 transmission vectors.
1139 </t>
1140
1141 <section anchor="Stream Radio" title="Stream Radio">
1142
1143 <t>This is one of the most common situation: one single server streaming
1144 content in multicast, the clients may start a session at random time. The
1145 content itself could be a mix of live stream, as the webjockey's voice, and stored
1146 streams as the music she plays.</t>
1147
1148 <t>In this situation we don't know in advance how many codebooks we will use.
1149 The clients can join anytime and users expect to start listening to the content
1150 in a short time.</t>
1151
1152 <t>On join the client will receive the current Configuration necessary to
1153 decode the current stream inlined in the SDP so that the decoding will start
1154 immediately after.</t>
1155
1156 <t>When the streamed content changes the new Configuration is sent in-band
1157 before the actual stream and the Configuration that has to be sent inline in
1158 the SDP updated. Since the in-band method is unreliable, an out of band
1159 fallback is provided.</t>
1160
1161 <t>The client MAY choose to fetch the Configuration from the alternate source
1162 as soon as it discovers a Configuration packet got lost in-band or use
1163 <xref target="RFC3611">selective retransmission</xref>, if the server supports
1164 the feature.</t>
1165
1166 <t>A serverside optimization would be to keep an hash list of the
1167 Configurations per session to avoid packing all of them and send the same
1168 Configuration with different Ident tags</t>
1169
1170 <t>A clientside optimization would be to keep a tag list of the Configurations
1171 per session and don't process configuration packets already known.</t>
1172
1173 </section>
1174 </section>
1175
1176 <section anchor="Security Considerations" title="Security Considerations"> 
1177 <t>
1178 RTP packets using this payload format are subject to the security
1179 considerations discussed in the RTP specification 
1180 <xref target="rfc3550"></xref>.  This implies that the confidentiality of the
1181 media stream is achieved by using encryption. Because the data compression used
1182 with this payload format is applied end-to-end, encryption may be performed on
1183 the compressed data. Additional care MAY be needed for delivery methods that
1184 point to external resources, using secure protocols to fetch the configuration
1185 payloads. Where the size of a data block is set, care MUST be taken to prevent
1186 buffer overflows in the client applications.
1187 </t>
1188
1189 </section> 
1190
1191 <section anchor="Acknowledgments" title="Acknowledgments"> 
1192
1193 <t>
1194 This document is a continuation of draft-moffitt-vorbis-rtp-00.txt and
1195 draft-kerr-avt-vorbis-rtp-04.txt.  The Media Type declaration is a
1196 continuation of draft-short-avt-rtp-vorbis-mime-00.txt.
1197 </t>
1198
1199 <t>
1200 Thanks to the AVT, Ogg Vorbis Communities / Xiph.org including Steve Casner,
1201 Aaron Colwell, Ross Finlayson, Fluendo, Ramon Garcia, Pascal Hennequin, Ralph
1202 Giles, Tor-Einar Jarnbjo, Colin Law, John Lazzaro, Jack Moffitt, Christopher
1203 Montgomery, Colin Perkins, Barry Short, Mike Smith, Phil Kerr, Michael Sparks,
1204 Magnus Westerlund, David Barrett, Silvia Pfeiffer, Stefan Ehmann, Alessandro
1205 Salvatori. Politecnico di Torino (LS)³/IMG Group in particular Federico
1206 Ridolfo, Francesco Varano, Giampaolo Mancini, Dario Gallucci, Juan Carlos De Martin.
1207 </t>
1208
1209 </section> 
1210
1211 </middle>
1212
1213 <back>
1214
1215 <references title="Normative References">
1216
1217 <reference anchor="rfc2119">
1218 <front>
1219 <title>Key words for use in RFCs to Indicate Requirement Levels </title>
1220 <author initials="S." surname="Bradner" fullname="Scott Bradner"></author>
1221 </front>
1222 <seriesInfo name="RFC" value="2119" />
1223 </reference>   
1224
1225 <reference anchor="rfc3550">
1226 <front>
1227 <title>RTP: A Transport Protocol for real-time applications</title>
1228 <author initials="H." surname="Schulzrinne" fullname=""></author>
1229 <author initials="S." surname="Casner" fullname=""></author>
1230 <author initials="R." surname="Frederick" fullname=""></author>
1231 <author initials="V." surname="Jacobson" fullname=""></author>
1232 </front>
1233 <seriesInfo name="STD" value="64"/>
1234 <seriesInfo name="RFC" value="3550" />
1235 </reference> 
1236
1237 <reference anchor="rfc3551">
1238 <front>
1239 <title>RTP Profile for Audio and Video Conferences with Minimal Control.</title>
1240 <author initials="H." surname="Schulzrinne" fullname=""></author>
1241 <author initials="S." surname="Casner" fullname=""></author>
1242 </front>
1243 <date month="July" year="2003" />
1244 <seriesInfo name="STD" value="65"/>
1245 <seriesInfo name="RFC" value="3551" />
1246 </reference> 
1247
1248 <reference anchor='rfc3986'>
1249 <front>
1250 <title abbrev='URI Generic Syntax'>Uniform Resource Identifier (URI): Generic Syntax</title>
1251 <author initials='T.' surname='Berners-Lee' fullname='Tim Berners-Lee'>
1252 </author>
1253 <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
1254 </author>
1255 <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
1256 </author>
1257 </front>
1258 <date year='2005' month='January' />
1259 <seriesInfo name="STD" value="66"/>
1260 <seriesInfo name='RFC' value='3986' />
1261 </reference>
1262
1263 <reference anchor='rfc4566'>
1264 <front>
1265 <title>SDP: Session Description Protocol</title>
1266 <author initials='M.' surname='Handley' fullname='M. Handley'>
1267 <organization /></author>
1268 <author initials='V.' surname='Jacobson' fullname='V. Jacobson'>
1269 <organization /></author>
1270 <author initials='C.' surname='Perkins' fullname='C. Perkins'>
1271 <organization /></author>
1272 <date year='2006' month='July' />
1273 </front>
1274 <seriesInfo name='RFC' value='4566' />
1275 <format type='TXT' octets='108820' target='ftp://ftp.isi.edu/in-notes/rfc4566.txt' />
1276 </reference>
1277
1278 <reference anchor='rfc1191'>
1279 <front>
1280 <title>Path MTU discovery</title>
1281 <author initials='J.' surname='Mogul' fullname='Jeffrey Mogul'>
1282 <organization>Digital Equipment Corporation (DEC) , Western Research Laboratory</organization>
1283 <address>
1284 <email>mogul@decwrl.dec.com</email></address></author>
1285 <author initials='S.' surname='Deering' fullname='Steve Deering'>
1286 <organization>Xerox Palo Alto Research Center</organization>
1287 <address>
1288 <email>deering@xerox.com</email></address></author>
1289 <date year='1990' day='1' month='November' />
1290 </front>
1291 <seriesInfo name='RFC' value='1191' />
1292 <format type='TXT' octets='47936' target='ftp://ftp.isi.edu/in-notes/rfc1191.txt' />
1293 </reference>
1294
1295 <reference anchor="rfc1981">
1296 <front>
1297 <title>Path MTU Discovery for IP version 6</title>
1298 <author initials="J." surname="McCann et al." fullname="J. McCann et al."></author>
1299 </front>
1300 <seriesInfo name="RFC" value="1981" />
1301 </reference>   
1302
1303 <reference anchor="rfc3264">
1304 <front>
1305 <title>An Offer/Answer Model with Session Description Protocol (SDP)</title>
1306 <author initials="J." surname="Rosenberg" fullname="Jonathan Rosenberg"></author>
1307 <author initials="H." surname="Schulzrinne" fullname="Henning Schulzrinne"></author>
1308 </front>
1309 <seriesInfo name="RFC" value="3264" />
1310 </reference>   
1311
1312 <reference anchor="rfc3548">
1313 <front>
1314 <title>The Base16, Base32, and Base64 Data Encodings</title>
1315 <author initials="S." surname="Josefsson" fullname="Simon Josefsson"></author>
1316 </front>
1317 <seriesInfo name="RFC" value="3548" />
1318 </reference>
1319
1320 <reference anchor="vorbis-spec-ref">
1321 <front>
1322 <title>Ogg Vorbis I specification:  Codec setup and packet decode.  Available from the Xiph website, http://www.xiph.org</title>
1323 </front>
1324 </reference>
1325
1326 </references>
1327
1328 <references title="Informative References">
1329
1330 <reference anchor="rfc3533">
1331 <front>
1332 <title>The Ogg Encapsulation Format Version 0</title>
1333 <author initials="S." surname="Pfeiffer" fullname="Silvia Pfeiffer"></author>
1334 </front>
1335 <seriesInfo name="RFC" value="3533" />
1336 </reference>
1337
1338 <reference anchor="libvorbis">
1339 <front>
1340 <title>libvorbis: Available from the Xiph website, http://www.xiph.org</title>
1341 </front>
1342 </reference>   
1343
1344 <reference anchor="RFC3611">
1345 <front>
1346 <title>RTP Control Protocol Extended Reports (RTCP XR)</title>
1347 <author initials="T." surname="Friedman" fullname="T. Friedman" />
1348 <author initials="R." surname="Caceres" fullname="R. Caceres" />
1349 <author initials="A." surname="Clark" fullname="A. Clark" />
1350 <date year="2003" month="November"/>
1351 </front>
1352 <seriesInfo name="RFC" value="3611"/>
1353 </reference>
1354 <reference anchor='rfc4588'>
1355 <front>
1356 <title>RTP Retransmission Payload Format</title>
1357 <author initials='J.' surname='Rey' fullname='J. Rey'>
1358 <organization /></author>
1359 <author initials='D.' surname='Leon' fullname='D. Leon'>
1360 <organization /></author>
1361 <author initials='A.' surname='Miyazaki' fullname='A. Miyazaki'>
1362 <organization /></author>
1363 <author initials='V.' surname='Varsa' fullname='V. Varsa'>
1364 <organization /></author>
1365 <author initials='R.' surname='Hakenberg' fullname='R. Hakenberg'>
1366 <organization /></author>
1367 <date year='2006' month='July' />
1368 </front>
1369 <seriesInfo name='RFC' value='4588' />
1370 <format type='TXT' octets='76630' target='ftp://ftp.isi.edu/in-notes/rfc4588.txt' />
1371 </reference>
1372 </references>
1373 </back>
1374 </rfc>