cleanup doc index; make format similar to website
[platform/upstream/libvorbis.git] / doc / draft-ietf-avt-vorbis-rtp-00.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
3 <?rfc toc="yes" ?>
4 <?rfc compact='yes'?>
5
6 <rfc ipr="full3667" docName="RTP Payload Format for Vorbis Encoded Audio">
7
8 <front>
9 <title>draft-ietf-avt-vorbis-rtp-00</title>
10
11 <author initials="P" surname="Kerr" fullname="Phil Kerr">
12 <organization>Xiph.Org</organization>
13 <address>
14 <email>phil@plus24.com</email>
15 <uri>http://www.xiph.org/</uri>
16 </address>
17 </author>
18
19 <date day="31" month="January" year="2005" />
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 <t>This document describes an RTP payload format for transporting Vorbis encoded audio.  It details the RTP encapsulation 
31 mechanism for raw Vorbis data and details the delivery mechanisms for the decoder probability model, referred to as a 
32 codebook, metadata and other setup information.</t>
33
34 <t>
35 Also included within the document are the necessary details for the use of Vorbis with MIME and Session Description Protocol 
36 (SDP).
37 </t>
38
39 </abstract>
40
41 <note title="Editors Note">
42 <t>
43 All references to RFC XXXX are to be replaced by references to the RFC number of this memo, when published.
44 </t>
45 </note>
46
47 </front>
48
49 <middle>
50
51 <section anchor="Introduction" title="Introduction">
52
53 <t>
54 Vorbis is a general purpose perceptual audio codec intended to allow maximum encoder flexibility, thus allowing it to scale 
55 competitively over an exceptionally wide range of bitrates.   At the high quality/bitrate end of the scale (CD or DAT rate 
56 stereo, 16/24 bits), it is in the same league as MPEG-2 and MPC. Similarly, the 1.0 encoder can encode high-quality CD and 
57 DAT rate stereo at below 48k bits/sec without resampling to a lower rate.   Vorbis is also intended for lower and higher sample 
58 rates (from 8kHz telephony to 192kHz digital masters) and a range of channel representations (monaural, polyphonic, stereo, 
59 quadraphonic, 5.1, ambisonic, or up to 255 discrete channels).
60 </t>
61
62 <t>
63 Vorbis encoded audio is generally encapsulated within an Ogg format bitstream <xref target="rfc3533"></xref>, which provides 
64 framing and synchronization.  For the purposes of RTP transport, this layer is unnecessary, and so raw Vorbis packets are used 
65 in the payload.
66 </t>
67
68 <section anchor="Terminology" title="Terminology">
69
70 <t>
71 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" 
72 in this document are to be interpreted as described in RFC 2119 <xref target="rfc2119"></xref>.
73 </t>
74
75 </section>
76 </section>
77
78 <section anchor="Payload Format" title="Payload Format">
79
80 <t>
81 For RTP based transportation of Vorbis encoded audio the standard RTP header is followed by a 5 octet payload header, then the 
82 payload data.  The payload headers are used to associate the Vorbis data with its associated decoding codebooks as well as 
83 indicating if the following packet contains fragmented Vorbis data and/or the the number of whole Vorbis data frames.  The 
84 payload data contains the raw Vorbis bitstream information.
85 </t>
86
87 <section anchor="RTP Header" title="RTP Header">
88
89 <t>
90 The format of the RTP header is specified in <xref target="rfc3550"></xref> and shown in Figure 1.  This payload format uses the fields of the header in a manner consistent with that specification. 
91 </t>
92
93 <t>
94 <figure anchor="RTP Header Figure" title="RTP Header">
95 <artwork><![CDATA[
96     0                   1                   2                   3
97     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
98    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
99    |V=2|P|X|  CC   |M|     PT      |       sequence number         |
100    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
101    |                           timestamp                           |
102    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
103    |           synchronization source (SSRC) identifier            |
104    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
105    |            contributing source (CSRC) identifiers             |
106    |                              ...                              |
107    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
108 ]]></artwork>
109 </figure>
110 </t>
111
112 <t>
113 The RTP header begins with an octet of fields (V, P, X, and CC) to support specialized RTP uses (see <xref target="rfc3550">
114 </xref> and <xref target="rfc3551"></xref> for details). For Vorbis RTP, the following values are used.
115 </t>
116
117 <t>
118 Version (V): 2 bits</t>
119 <t>
120 This field identifies the version of RTP. The version used by this specification is two (2).
121 </t>
122
123 <t>
124 Padding (P): 1 bit</t>
125 <t>
126 Padding MAY be used with this payload format according to section 5.1 of <xref target="rfc3550"></xref>.  
127 </t>
128
129 <t>
130 Extension (X): 1 bit</t>
131 <t>
132 The Extension bit is used in accordance with <xref target="rfc3550"></xref>.
133 </t>
134
135 <t>
136 CSRC count (CC): 4 bits</t>
137 <t>
138 The CSRC count is used in accordance with <xref target="rfc3550"></xref>.
139 </t>
140
141 <t>
142 Marker (M): 1 bit</t>
143 <t>
144 Set to zero.  Audio silence suppression not used.  This conforms to section 4.1 of <xref target="vorbis-spec-ref"></xref>.
145 </t>
146
147 <t>
148 Payload Type (PT): 7 bits</t>
149 <t>
150 An RTP profile for a class of applications is expected to assign a payload type for this format, or a dynamically allocated 
151 payload type SHOULD be chosen which designates the payload as Vorbis.
152 </t>
153
154 <t>
155 Sequence number: 16 bits</t>
156 <t>
157 The sequence number increments by one for each RTP data packet sent, and may be used by the receiver to detect packet loss and
158 to restore packet sequence. This field is detailed further in <xref target="rfc3550"></xref>.
159 </t>
160
161 <t>
162 Timestamp: 32 bits</t>
163 <t>
164 A timestamp representing the sampling time of the first sample of the first Vorbis packet in the RTP packet.  The clock frequency 
165 MUST be set to the sample rate of the encoded audio data and is conveyed out-of-band as a SDP attribute.
166 </t>
167
168 <t>
169 SSRC/CSRC identifiers: </t>
170 <t>
171 These two fields, 32 bits each with one SSRC field and a maximum of 16 CSRC fields, are as defined in <xref target="rfc3550">
172 </xref>.  
173 </t>
174
175 </section>
176
177 <section anchor="Payload Header" title="Payload Header">
178
179 <t>
180 After the RTP Header section the following five octets are the Payload Header.  This header is split into a number of bitfields 
181 detailing the format of the following payload data packets.
182 </t>
183
184 <figure anchor="Payload Header Figure" title="Payload Header">
185 <artwork><![CDATA[
186     0                   1                   2                   3
187     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
188    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
189    |                          Codebook Ident                       |
190    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
191    |C|F|VDT|# pkts.|
192    +-+-+-+-+-+-+-+-+
193 ]]></artwork>
194 </figure>
195
196 <t>
197 Codebook Ident: 32 bits</t>
198 <t>
199 This 32 bit field is used to associate the Vorbis data to a decoding Codebook. It is created by making a CRC32 checksum 
200 of the codebook required to decode the particular Vorbis audio stream.
201 </t>
202
203 <t>
204 Continuation (C): 1 bit</t>
205 <t>
206 Set to one if this is a continuation of a fragmented packet.
207 </t>
208
209 <t>
210 Fragmented (F): 1 bit</t>
211 <t>
212 Set to one if the payload contains complete packets or if it contains the last fragment of a fragmented packet. 
213 </t>
214
215 <t>
216 Vorbis Data Type (VDT): 2 bits</t>
217 <t>
218 This field sets the packet payload type for the Vorbis data.  There are currently four type of Vorbis payloads. 
219 </t>
220
221 <vspace blankLines="1" />
222 <list style="empty">
223 <t>      0 = Raw Vorbis payload</t>
224 <t>      1 = Vorbis Setup payload</t>
225 <t>      2 = Vorbis Codebook payload</t>
226 <t>      3 = Vorbis Metadata payload</t>
227 </list>
228
229 <t>
230 The last 4 bits are the number of complete packets in this payload.  This provides for a maximum number of 15 Vorbis 
231 packets in the payload.  If the packet contains fragmented data the number of packets MUST be set to 0.
232 </t>
233
234 </section>
235
236 <section anchor="Payload Data" title="Payload Data">
237
238 <t>
239 Raw Vorbis packets are unbounded in length currently, although at some future point there will likely be a practical 
240 limit placed on them.  Typical Vorbis packet sizes are from very small (2-3 bytes) to quite large (8-12 kilobytes).  
241 The reference implementation <xref target="libvorbis"></xref> typically produces packets less than ~800 bytes, except for the
242 codebook header packets which are ~4-12 kilobytes.  Within an RTP context the maximum Vorbis packet size, including the 
243 RTP and payload headers, SHOULD be kept below the path MTU to avoid packet fragmentation.  
244 </t>
245
246 <figure anchor="Payload Data Figure" title="Payload Data Header">
247 <artwork><![CDATA[
248     0                   1                   2                   3
249     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
250    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
251    |            length             |       vorbis packet data     ..  
252    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
253 ]]></artwork>
254 </figure>
255
256 <t>
257 Each Vorbis payload packet starts with a two octet length header, which is used to represent the size of the following 
258 data payload, followed by the raw Vorbis data.
259 </t>
260
261 <t>
262 For payloads which consist of multiple Vorbis packets the payload data consists of the packet length followed by the 
263 packet data for each of the Vorbis packets in the payload.
264 </t>
265
266 <t>
267 The Vorbis packet length header is the length of the Vorbis data block only and does not count the length field.
268 </t>
269
270 <t>
271 The payload packing of the Vorbis data packets SHOULD follow the guidelines set-out in <xref target="rfc3551"></xref> 
272 where the oldest packet occurs immediately after the RTP packet header.
273 </t>
274
275 <t>
276 Channel mapping of the audio is in accordance with BS. 775-1 ITU-R <xref target="775itu"></xref>.
277 </t>
278
279 </section>
280
281 <section anchor="Example RTP Packet" title="Example RTP Packet">
282
283 <t>
284 Here is an example RTP packet containing two Vorbis packets.
285 </t>
286
287 <t>
288 RTP Packet Header:
289 </t>
290
291 <figure anchor="Example Header Packet (RTP Headers)" title="Example Packet (RTP Headers)">
292 <artwork><![CDATA[
293     0                   1                   2                   3
294     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
295    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
296    | 2 |0|0|  0    |0|      PT     |       sequence number         |
297    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
298    |               timestamp (in sample rate units)                |
299    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
300    |           synchronisation source (SSRC) identifier            |
301    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
302    |            contributing source (CSRC) identifiers             |
303    |                              ...                              |
304    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
305 ]]></artwork>
306 </figure>
307
308 <t>
309 Payload Data:
310 </t>
311
312 <figure anchor="Example Packet (Payload Data)" title="Example Packet (Payload Data)">
313 <artwork><![CDATA[
314     0                   1                   2                   3
315     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
316    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
317    |                        Codebook Ident                         |
318    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
319    |0|1| 0 | 2 pks |             length            | vorbis data  ..
320    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
321    ..                        vorbis data                           |
322    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
323    |            length             |   next vorbis packet data    ..
324    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
325    ..                        vorbis data                           |
326    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
327 ]]></artwork>
328 </figure>
329
330 <t>
331 The payload data section of the RTP packet starts with the 32 bit Codebook Ident field followed by the one octet 
332 configuration header, which has the number of Vorbis frames set to 2.  Each of the Vorbis data frames is prefixed by the two 
333 octet length field.
334 </t>
335
336 </section>
337 </section>
338
339 <section anchor="Frame Packetizing" title="Frame Packetizing">
340
341 <t>
342 Each RTP packet contains either one complete Vorbis packet, one Vorbis packet fragment, or an integer number of complete Vorbis 
343 packets (up to a max of 15 packets, since the number of packets is defined by a 4 bit value).
344 </t>
345
346 <t>
347 Any Vorbis data packet that is less than path MTU SHOULD be bundled in the RTP packet with as many Vorbis packets as will 
348 fit, up to a maximum of 15.  Path MTU is detailed in <xref target="rfc1063"></xref> and <xref target="rfc1981"></xref>.
349 </t>
350
351 <t>
352 If a Vorbis packet is larger than 65535 octets it MUST be fragmented.  A fragmented packet has a zero in the last four bits 
353 of the payload header.  Each fragment after the first will also set the Continued (C) bit to one in the payload header.  The 
354 RTP packet containing the last fragment of the Vorbis packet will have the Fragmented (F) bit set to one.  To maintain the 
355 correct sequence for fragmented packet reception the timestamp field of fragmented packets MUST be the same as the first 
356 packet sent, with the sequence number incremented as normal for the subsequent RTP packets.
357 </t>
358
359 <section anchor="Example Fragmented Vorbis Packet" title="Example Fragmented Vorbis Packet">
360
361 <t>
362 Here is an example fragmented Vorbis packet split over three RTP packets.  Each packet contains the standard RTP headers as 
363 well as the 5 octet Vorbis headers.
364 </t>
365
366 <figure anchor="Example Fragmented Packet (Packet 1)" title="Example Fragmented Packet (Packet 1)">
367 <artwork><![CDATA[
368    Packet 1:
369
370     0                   1                   2                   3
371     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
372    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
373    |V=2|P|X|  CC   |M|     PT      |           1000                |
374    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
375    |                             xxxxx                             |
376    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
377    |           synchronization source (SSRC) identifier            |
378    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
379    |            contributing source (CSRC) identifiers             |
380    |                              ...                              |
381    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
382    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
383    |                        Codebook Ident                         |
384    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
385    |0|0| 0 |      0|             length            | vorbis data  ..
386    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
387    ..                        vorbis data                           |
388    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
389 ]]></artwork>
390 </figure>
391
392 <t>
393 In this packet the initial sequence number is 1000 and the timestamp is xxxxx.  The Continuation (C) bit is set to one, 
394 indicating it is not the continuation of a fragmented bit, and the Fragmentation (F) is set to 0 indicating it is a fragmented 
395 packet.  The number of packets field is set to 0, and as the payload is raw Vorbis data the VDT field is set to 0.
396 </t>
397
398 <figure anchor="Example Fragmented Packet (Packet 2)" title="Example Fragmented Packet (Packet 2)">
399 <artwork><![CDATA[
400    Packet 2:
401
402     0                   1                   2                   3
403     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
404    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
405    |V=2|P|X|  CC   |M|     PT      |           1001                |
406    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
407    |                             xxxxx                             |
408    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
409    |           synchronization source (SSRC) identifier            |
410    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
411    |            contributing source (CSRC) identifiers             |
412    |                              ...                              |
413    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
414    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
415    |                        Codebook Ident                         |
416    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
417    |1|0| 0 |      0|             length            | vorbis data  ..
418    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
419    ..                        vorbis data                           |
420    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
421 ]]></artwork>
422 </figure>
423
424 <t>
425 The C bit is set to 1 and the number of packets field is set to 0.  For large Vorbis fragments there can be several of these type 
426 of payload packets.  The maximum packet size SHOULD be no greater than the path MTU, including all RTP and payload headers.  The 
427 sequence number has been incremented by one but the timestamp field remains the same as the initial packet.
428 </t>
429
430 <figure anchor="Example Fragmented Packet (Packet 3)" title="Example Fragmented Packet (Packet 3)">
431 <artwork><![CDATA[
432    Packet 3:
433
434     0                   1                   2                   3
435     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
436    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
437    |V=2|P|X|  CC   |M|     PT      |           1002                |
438    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
439    |                             xxxxx                             |
440    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
441    |           synchronization source (SSRC) identifier            |
442    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
443    |            contributing source (CSRC) identifiers             |
444    |                              ...                              |
445    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
446    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
447    |                        Codebook Ident                         |
448    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
449    |1|1| 0 |      0|             length            | vorbis data  ..
450    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
451    ..                        vorbis data                           |
452    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
453 ]]></artwork>
454 </figure>
455
456 <t>
457 This is the last Vorbis fragment packet.  The C and F bits are set and the packet count remains set to 0.  As in the previous 
458 packets the timestamp remains set to the first packet in the sequence and the sequence number has been incremented.
459 </t>
460 </section>
461
462 <section anchor="Packet Loss" title="Packet Loss">
463
464 <t>
465 As there is no error correction within the Vorbis stream, packet loss will result in a loss of signal.  Packet loss is more of an 
466 issue for fragmented Vorbis packets as the client will have to cope with the handling of the C and F flags.  If we use the 
467 fragmented Vorbis packet example above and the first packet is lost the client SHOULD detect that the next packet has the packet
468 count field set to 0 and the C bit is set and MUST drop it.  The next packet, which is the final fragmented packet, SHOULD 
469 be dropped in the same manner, or buffered.  Feedback reports on lost and dropped packets MUST be sent back via RTCP.
470 </t>
471
472 <t>
473 If a particular multicast session has a large number of participants care must be taken to prevent an RTCP feedback implosion, 
474 <xref target="rtcp-feedback"></xref>, in the event of packet loss from a large number of participants.
475 </t>
476
477 <t>
478 Loss of any of the configuration headers, detailed below, is dealt with in the Loss of Configuration Headers Section later.
479 </t>
480
481 </section>
482 </section>
483
484 <section anchor="Configuration Headers" title="Configuration Headers">
485
486 <t>
487 Unlike other mainstream audio codecs Vorbis has no statically configured probability model, instead it packs all entropy decoding
488 configuration, VQ and Huffman models into a self-contained codebook.  This codebook block also requires additional identification 
489 information detailing the number of audio channels, bitrates and other information used to initialise the Vorbis stream.
490 </t>
491
492 <t>
493 To decode a Vorbis stream three configuration header blocks are needed.  The first header indicates the sample and bitrates, the 
494 number of channels and the version of the Vorbis encoder used.  The second header contains the decoders probability model, or 
495 codebook and the third header details stream metadata.
496 </t>
497
498 <t>
499 As the RTP stream may change certain configuration data mid-session there are two different methods for delivering this 
500 configuration data to a client, in-band and SDP which is detailed below.  SDP delivery is used to set-up an initial
501 state for the client application and in-band is used to change state during the session.  The changes may be due to 
502 different metadata or codebooks as well as different bitrates of the stream.
503 </t>
504
505 <t>
506 Out of the two delivery vectors the use of an SDP attribute to indicate an URI where the configuration and codebook data 
507 can be obtained is preferred as they can be fetched reliably using TCP.  The in-band codebook delivery SHOULD 
508 only be used in situations where the link between the client is unidirectional or if the SDP-based information is not available. 
509 </t>
510
511 <t>
512 Synchronizing the configuration and codebook headers to the RTP stream is critical.  The 32 bit Codebook Ident field is used 
513 to indicate when a change in the stream has taken place.  The client application MUST have in advance the correct configuration 
514 and codebook headers and if the client detects a change in the Ident value and does not have this information it MUST NOT 
515 decode the raw Vorbis data.
516 </t>
517
518 <section anchor="In-band Header Transmission" title="In-band Header Transmission">
519
520 <t>
521 The three header data blocks are sent in-band with the packet type bits set to match the payload type.  Normally the codebook 
522 and configuration headers are sent once per session if the stream is an encoding of live audio, as typically 
523 the encoder state will not change, but the encoder state can change at the boundary of chained Vorbis audio files.  Metadata 
524 can be sent at the start as well as any time during the life of the session.  Clients MUST be capable of dealing with periodic 
525 re-transmission of the configuration headers.
526 </t>
527
528 <section anchor="Setup Header" title="Setup Header">
529
530 <t>
531 A Vorbis Setup header is indicated with the payload type field set to 1.
532 The Vorbis version MUST be set to zero to comply with this document.  The fields Sample Rate, Bitrate Maximum/Nominal/Minimum 
533 and Num Audio Channels are set in accordance with <xref target="vorbis-spec-ref"></xref> with the bsz fields above referring 
534 to the blocksize parameters.  The framing bit is not used for RTP transportation and so applications constructing Vorbis files 
535 MUST take care to set this if required.
536 </t>
537
538 <figure anchor="Setup Header Figure" title="Setup Header">
539 <artwork><![CDATA[
540     0                   1                   2                   3
541     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
542    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
543    |V=2|P|X|  CC   |M|     PT      |             xxxx              |
544    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
545    |                             xxxxx                             |
546    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
547    |           synchronization source (SSRC) identifier            |
548    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
549    |            contributing source (CSRC) identifiers             |
550    |                              ...                              |
551    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
552    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
553    |                          Codebook Ident                       |
554    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555    |0|1| 2 |      1| bsz 0 | bsz 1 |       Num Audio Channels      |
556    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
557    |                        Vorbis Version                         |
558    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
559    |                       Audio Sample Rate                       |
560    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
561    |                        Bitrate Maximum                        |
562    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
563    |                        Bitrate Nominal                        |
564    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
565    |                        Bitrate Minimum                        |
566    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
567 ]]></artwork>
568 </figure>
569
570 </section>
571
572 <section anchor="Codebook Header" title="Codebook Header">
573
574 <t>
575 If the payload type field is set to 2, this indicates the packet contains Codebook data.
576 </t>
577
578 <t>
579 The configuration information detailed below MUST be completely intact, as a client can not decode a stream with an 
580 incomplete or corrupted codebook set.
581 </t>
582
583 <t>
584 A 16 bit codebook length field precedes the codebook datablock.  The length field  allows for codebooks to be up to 64K 
585 in size.  Packet fragmentation, as per the Vorbis data, MUST be performed if the codebooks size exceeds path MTU.  The 
586 Codebook Ident field MUST be set to match the associated codebook needed to decode the Vorbis stream.
587 </t>
588
589 <t>
590 The Codebook Ident is the CRC32 checksum of the codebook and is used to detect a corrupted codebook as well as associating 
591 it with its Vorbis data stream.  This Ident value MUST NOT be set to the value of the current stream if this header is being 
592 sent before the boundary of the chained file has been reached.  If a checksum failure is detected then this is considered to 
593 be a failure and MUST be reported to the client application.
594 </t>
595
596 <figure anchor="Codebook Header Figure" title="Codebook Header">
597 <artwork><![CDATA[
598     0                   1                   2                   3
599     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
600    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
601    |V=2|P|X|  CC   |M|     PT      |             xxxx              |
602    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
603    |                             xxxxx                             |
604    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
605    |           synchronization source (SSRC) identifier            |
606    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
607    |            contributing source (CSRC) identifiers             |
608    |                              ...                              |
609    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
610    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
611    |                           Codebook Ident                      |
612    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
613    |0|1| 2 |      1|           Codebook Length                     |
614    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
615    |    length     |           Codebook                           ..
616    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
617    ..                          Codebook                            |
618    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
619 ]]></artwork>
620 </figure>
621
622
623 <section anchor="Codebook CRC32 Generation" title="Codebook CRC32 Generation">
624
625 <t>
626 In order for different implementations of Vorbis RTP clients and servers to interoperate with each other a common format 
627 for the production of the CRC32 hash is required.  The polynomial is X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0.
628 </t>
629
630 <t>
631 The following C code function SHOULD be used by implementations, if not then the code responsible for generating the CRC32 
632 value MUST use the polynomial function above.
633 </t>
634
635 <artwork><![CDATA[
636 unsigned int crc32 (int length, unsigned char *crcdata)
637 {
638     int index, loop;
639     unsigned int byte, crc, mask;
640  
641     index = 0;
642     crc = 0xFFFFFFFF;
643  
644     while (index < length) {
645         byte = crcdata [index];
646         crc = crc ^ byte;
647  
648         for (loop = 7; loop >= 0; loop--) {
649             mask = -(crc & 1);
650             crc = (crc >> 1) ^ (0xEDB88320 & mask);
651         }
652         index++;
653     }
654     return ~crc;
655 }
656 ]]></artwork>
657
658
659 </section>
660 </section>
661
662 <section anchor="Metadata Header" title="Metadata Header">
663
664 <t>
665 With the payload type flag set to 3, this indicates that the packet contain the comment metadata, such as artist name, track title 
666 and so on.  These metadata messages are not intended to be fully descriptive but to offer basic track/song information.  This 
667 message MUST be sent at the start of the stream, together with the setup and codebook headers, even if it contains no information.  
668 During a session the metadata associated with the stream may change from that specified at the start, e.g. a live concert 
669 broadcast changing acts/scenes, so clients MUST have the ability to receive Metadata header blocks.  Details on the format of the 
670 comments can be found in the Vorbis documentation <xref target="v-comment"></xref>.
671 </t>
672
673 <t>
674 The format for the data takes the form of a 32 bit codec vendors name length field followed by the name encoded in UTF-8.  The 
675 next 32 bit field denotes the number of user comments. Each of the user comments is prefixed by a 32 bit length field followed by 
676 the comment text.   
677 </t>
678
679 <figure anchor="Metadata Header Figure" title="Metadata Header">
680 <artwork><![CDATA[
681     0                   1                   2                   3
682     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
683    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
684    |V=2|P|X|  CC   |M|     PT      |             xxxx              |
685    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
686    |                             xxxxx                             |
687    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
688    |           synchronization source (SSRC) identifier            |
689    +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
690    |            contributing source (CSRC) identifiers             |
691    |                              ...                              |
692    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
693    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
694    |                          Codebook Ident                       |
695    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
696    |0|1| 3 |      1|          Vendor string length                 |
697    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
698    |    length     |          Vendor string                       ..
699    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
700    |                    User comments list length                  |
701    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
702    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
703    |                       User comment length                     |
704    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
705    |                          User comment                        ..
706    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
707    ..                         User comment                         |
708    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
709 ]]></artwork>
710 </figure>
711
712 </section>
713 </section>
714
715 <section anchor="Packed Headers Delivery" title="Packed Headers Delivery"> 
716
717 <t>
718 As mentioned above the RECOMMENDED delivery vector for Vorbis configuration data is via an SDP attribute as this retrieval method 
719 can be performed using a reliable transport protocol.  
720 </t>
721
722 <figure anchor="Packed Headers Overview Figure" title="Packed Headers Overview">
723 <artwork><![CDATA[
724    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
725    |                     Number of packed headers                  |
726    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
727    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
728    |                          Packed header                        |
729    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
730    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
731    |                          Packed header                        |
732    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
733 ]]></artwork>
734 </figure>
735
736 <t>
737 As the RTP headers are not required for this method of delivery the 
738 structure of the configuration data is slightly different.  The packed header starts with a 32 bit count field which details the number of packed headers that are contained in the bundle.  Next is the packed header payload for each chained Vorbis file.
739 </t>
740
741 <figure anchor="Packed Headers Detail Figure" title="Packed Headers Detail">
742 <artwork><![CDATA[
743     0                   1                   2                   3
744     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
745    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
746    |                         Header Length                         |
747    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
748    |                        Codebook Ident                         |
749    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
750    |                         Setup Header                         ..
751    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
752    ..                        Setup Header                          |
753    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
754    |                        Codebook Header                       ..
755    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
756    ..                       Codebook Header                        |
757    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
758    |                        Metadata Header                       ..
759    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
760    ..                       Metadata Header                        |
761    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
762 ]]></artwork>
763 </figure>
764
765 <t>The key difference between the in-band format is there is no need for the payload header octet and Codebook Ident field.  
766 Below are examples of the packed headers format.
767 </t>
768
769 <figure anchor="Packed Setup Header Figure" title="Packed Setup Header">
770 <artwork><![CDATA[
771     0                   1                   2                   3
772     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
773    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
774    |0|1| 2 |      1| bsz 0 | bsz 1 |       Num Audio Channels      |
775    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
776    |                        Vorbis Version                         |
777    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
778    |                       Audio Sample Rate                       |
779    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
780    |                        Bitrate Maximum                        |
781    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
782    |                        Bitrate Nominal                        |
783    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
784    |                        Bitrate Minimum                        |
785    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
786 ]]></artwork>
787 </figure>
788
789 <t>
790 The alignment of the packed Setup Header is slightly different from the RTP payload type as the payload header is not used.
791 </t>
792
793 <figure anchor="Packed Codebook Header Figure" title="Packed Codebook Header">
794 <artwork><![CDATA[
795     0                   1                   2                   3
796     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
797    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
798    |                        Codebook Length                        |
799    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
800    |                           Codebook                           ..
801    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
802    ..                          Codebook                            |
803    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
804 ]]></artwork>
805 </figure>
806
807 <t>
808 The packed Codebook header also has a slightly different structure to that of the RTP payload type.  The Codebook Ident field that 
809 is normally part of this structure is moved to the second field of the overall packed structure.
810 </t>
811
812 <figure anchor="Packed Metadata Header Figure" title="Packed Metadata Header">
813 <artwork><![CDATA[
814     0                   1                   2                   3
815     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
816    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
817    |                      Vendor string length                     |
818    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
819    |                         Vendor string                         |
820    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
821    |                    User comments list length                  |
822    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
823    |                User comment length / User comment            ..
824    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
825 ]]></artwork>
826 </figure>
827
828 <t>
829 The packed Metadata header also as a slightly different structure to that of the RTP payload type with the payload header not being used.
830
831 </t>
832
833 <section anchor="Packed Headers IANA Considerations" title="Packed Headers IANA Considerations"> 
834
835 <t>
836 The following IANA considerations MUST only be applied to the packed headers.
837 </t>
838
839 <t>
840 MIME media type name: audio
841 </t>
842 <t>
843 MIME subtype: vorbis-config
844 </t>
845
846 <t>
847 Required Parameters:</t><t>
848 None.
849 </t>
850
851 <t>
852 Optional Parameters: </t><t>
853 None.
854 </t>
855
856 <t>
857 Encoding considerations:</t><t>
858 This type is only defined for transfer via HTTP as specified in RFC XXXX.
859 </t>
860
861 <t>
862 Security Considerations:</t><t>
863 See Section 6 of RFC 3047.
864 </t>
865
866 <t>
867 Interoperability considerations: none
868 </t>
869
870 <t>
871 Published specification:</t>
872 <t>See RFC XXXX for details.</t>
873
874 <t>
875 Applications which use this media type:</t><t>
876 Vorbis encoded audio, configuration data.
877 </t>
878
879 <t>
880 Additional information: none
881 </t>
882
883 <t>
884 Person &amp; email address to contact for further information:</t><t>
885 Phil Kerr: &lt;phil@plus24.com&gt;
886 </t>
887
888 <t>
889 Intended usage: COMMON
890 </t>
891
892 <t>Author/Change controller:</t>
893 <t>Author: Phil Kerr</t>
894 <t>Change controller: IETF AVT Working Group</t>
895
896
897 </section>
898 </section>
899
900
901
902 <section anchor="Codebook Caching" title="Codebook Caching"> 
903
904 <t>
905 Codebook caching allows clients that have previously connected to a stream to re-use the associated codebooks and configuration 
906 data.  When a client receives a codebook it may store it locally and can compare the CRC32 key with that of the new stream and 
907 begin decoding before it has received any of the headers.
908 </t>   
909
910 </section>
911
912 <section anchor="Loss of Configuration Headers" title="Loss of Configuration Headers"> 
913
914 <t>
915 Unlike the loss of raw Vorbis payload data, loss of a configuration header can lead to a situation where it will not be possible 
916 to successfully decode the stream.  
917 </t>
918
919 <t>
920 Out of the three headers, loss of either the Codebook or Setup headers MUST result in the halting of stream decoding.  
921 Loss of the Metadata header SHOULD NOT be regarded as fatal for decoding.  Loss of any of the headers SHOULD be reported to the 
922 client as well as a loss report sent via RTCP.
923 </t>
924
925
926
927 </section>
928 </section>
929
930 <section anchor="IANA Considerations" title="IANA Considerations"> 
931
932 <t>
933 MIME media type name: audio
934 </t>
935 <t>
936 MIME subtype: vorbis
937 </t>
938
939 <t>
940 Required Parameters:</t><t>
941 header indicates the URI of the decoding configuration headers.
942 </t>
943
944 <t>
945 Optional Parameters: </t><t>
946 None.
947 </t>
948
949 <t>
950 Encoding considerations:</t><t>
951 This type is only defined for transfer via RTP as specified 
952 in RFC XXXX.
953 </t>
954
955 <t>
956 Security Considerations:</t><t>
957 See Section 6 of RFC 3047.
958 </t>
959
960 <t>
961 Interoperability considerations: none
962 </t>
963
964 <t>
965 Published specification:</t>
966 <t>See the Vorbis documentation <xref target="vorbis-spec-ref"></xref> for details.</t>
967
968 <t>
969 Applications which use this media type:</t><t>
970 Audio streaming and conferencing tools
971 </t>
972
973 <t>
974 Additional information: none
975 </t>
976
977 <t>
978 Person &amp; email address to contact for further information:</t><t>
979 Phil Kerr: &lt;phil@plus24.com&gt;
980 </t>
981
982 <t>
983 Intended usage: COMMON
984 </t>
985
986 <t>Author/Change controller:</t>
987 <t>Author: Phil Kerr</t>
988 <t>Change controller: IETF AVT Working Group</t>
989
990 <section anchor="Mapping MIME Parameters into SDP" title="Mapping MIME Parameters into SDP"> 
991
992 <t>
993 The information carried in the MIME media type specification has a specific mapping to fields in the Session Description 
994 Protocol (SDP) <xref target="rfc2327"></xref>, which is commonly used to describe RTP sessions.  When SDP is used to specify 
995 sessions the mapping are as follows:
996 </t>
997
998 <vspace blankLines="1" />
999 <list style="symbols">
1000
1001 <t>The MIME type ("audio") goes in SDP "m=" as the media name.</t>
1002 <vspace blankLines="1" />
1003
1004 <t>The MIME subtype ("VORBIS") goes in SDP "a=rtpmap" as the encoding name.</t>
1005 <vspace blankLines="1" />
1006
1007 <t>The parameter "rate" also goes in "a=rtpmap" as clock rate.</t>
1008 <vspace blankLines="1" />
1009
1010 <t>The parameter "channels" also goes in "a=rtpmap" as channel count.</t>
1011 <vspace blankLines="1" />
1012
1013 <t>The parameter "header" goes in the SDP "a=fmpt" attribute.</t>
1014 </list>
1015
1016
1017 <t>
1018 If the stream comprises chained Vorbis files the configuration and codebook headers for each file SHOULD be packaged together 
1019 and passed to the client using the headers attribute if all the files to be played are known in advance.  
1020 </t>
1021
1022 <t>
1023 The Vorbis configuration specified in the header attribute MUST contain all of the configuration data and codebooks needed for 
1024 the life of the session.  
1025 </t>
1026
1027 <t>
1028 The port value is specified by the server application bound to the address specified in the c attribute.  The bitrate value 
1029 and channels specified in the rtpmap attribute MUST match the Vorbis sample rate value.  An example is found below.
1030 </t>
1031
1032 <vspace blankLines="1" />
1033 <list style="empty">
1034 <t>c=IN IP4/6 </t>
1035 <t>m=audio  RTP/AVP 98</t>
1036 <t>a=rtpmap:98 VORBIS/44100/2</t>
1037 <t>a=fmtp:98 header=&lt;URL of configuration header&gt; </t>
1038 </list>
1039
1040 <t>
1041 Note that the payload format (encoding) names are commonly shown in upper case.  MIME subtypes are commonly shown in lower 
1042 case.  These names are case-insensitive in both places.  Similarly, parameter names are case-insensitive both in MIME types and 
1043 in the default mapping to the SDP a=fmtp attribute.  The exception regarding case sensitivity is the configuration header URL 
1044 which MUST be regarded as being case sensitive.
1045 </t>
1046
1047 <t>
1048 The answer to any offer, <xref target="rfc3264"></xref>, MUST NOT change the URL specified in the header attribute. 
1049 </t>
1050
1051 </section> 
1052 </section>
1053
1054
1055 <section anchor="Congestion Control" title="Congestion Control"> 
1056
1057 <t>
1058 Vorbis clients SHOULD send regular receiver reports detailing congestion.  A mechanism for dynamically downgrading the stream, 
1059 known as bitrate peeling, will allow for a graceful backing off of the stream bitrate.  This feature is not available at present
1060 so an alternative would be to redirect the client to a lower bitrate stream if one is available.  
1061 </t>
1062
1063 <t>
1064 If a particular multicast session has a large number of participants care must be taken to prevent an RTCP feedback implosion, 
1065 <xref target="rtcp-feedback"></xref>, in the event of congestion.
1066 </t>
1067
1068 </section> 
1069
1070 <section anchor="Security Considerations" title="Security Considerations"> 
1071 <t>
1072 RTP packets using this payload format are subject to the security considerations discussed in the RTP specification 
1073 <xref target="rfc3550"></xref>.  This implies that the confidentiality of the media stream is achieved by using
1074 encryption.  Because the data compression used with this payload format is applied end-to-end, encryption may be performed on the 
1075 compressed data.  Where the size of a data block is set care MUST be taken to prevent buffer overflows in the client applications.
1076 </t>
1077
1078 </section> 
1079
1080 <section anchor="Acknowledgments" title="Acknowledgments"> 
1081
1082 <t>
1083 This document is a continuation of draft-moffitt-vorbis-rtp-00.txt.  The MIME type section is a continuation of 
1084 draft-short-avt-rtp-vorbis-mime-00.txt
1085 </t>
1086
1087 <t>
1088 Thanks to the AVT, Ogg Vorbis Communities / Xiph.org including Steve Casner, Aaron Colwell, Ross Finlayson, Fluendo, Ramon Garcia, 
1089 Pascal Hennequin, Ralph Giles, Tor-Einar Jarnbjo, Colin Law, John Lazzaro, Jack Moffitt, Christopher Montgomery, 
1090 Colin Perkins, Barry Short, Mike Smith, Michael Sparks, Magnus Westerlund.
1091 </t>
1092
1093 </section> 
1094
1095 </middle>
1096
1097 <back>
1098
1099 <references title="Normative References">
1100
1101 <reference anchor="rfc3533">
1102 <front>
1103 <title>The Ogg Encapsulation Format Version 0</title>
1104 <author initials="S." surname="Pfeiffer" fullname="Silvia Pfeiffer"></author>
1105 </front>
1106 <seriesInfo name="RFC" value="3533" />
1107 </reference>
1108
1109 <reference anchor="rfc2119">
1110 <front>
1111 <title>Key words for use in RFCs to Indicate Requirement Levels </title>
1112 <author initials="S." surname="Bradner" fullname="Scott Bradner"></author>
1113 </front>
1114 <seriesInfo name="RFC" value="2119" />
1115 </reference>   
1116
1117 <reference anchor="rfc3550">
1118 <front>
1119 <title>RTP: A Transport Protocol for real-time applications</title>
1120 <author initials="H." surname="Schulzrinne" fullname=""></author>
1121 <author initials="S." surname="Casner" fullname=""></author>
1122 <author initials="R." surname="Frederick" fullname=""></author>
1123 <author initials="V." surname="Jacobson" fullname=""></author>
1124 </front>
1125 <seriesInfo name="RFC" value="3550" />
1126 </reference> 
1127
1128 <reference anchor="rfc3551">
1129 <front>
1130 <title>RTP Profile for Audio and Video Conferences with Minimal Control.</title>
1131 <author initials="H." surname="Schulzrinne" fullname=""></author>
1132 <author initials="S." surname="Casner" fullname=""></author>
1133 </front>
1134 <date month="July" year="2003" />
1135 <seriesInfo name="RFC" value="3551" />
1136 </reference> 
1137   
1138 <reference anchor="rfc2327">
1139 <front>
1140 <title>SDP: Session Description Protocol</title>
1141 <author initials="M." surname="Handley" fullname="Mark Handley"></author>
1142 <author initials="V." surname="Jacobson" fullname="Van Jacobson"></author>
1143 </front>
1144 <seriesInfo name="RFC" value="2327" />
1145 </reference>   
1146
1147 <reference anchor="rfc1063">
1148 <front>
1149 <title>Path MTU Discovery</title>
1150 <author initials="J." surname="Mogul et al." fullname="J. Mogul et al."></author>
1151 </front>
1152 <seriesInfo name="RFC" value="1063" />
1153 </reference>   
1154
1155 <reference anchor="rfc1981">
1156 <front>
1157 <title>Path MTU Discovery for IP version 6</title>
1158 <author initials="J." surname="McCann et al." fullname="J. McCann et al."></author>
1159 </front>
1160 <seriesInfo name="RFC" value="1981" />
1161 </reference>   
1162
1163 <reference anchor="rfc3264">
1164 <front>
1165 <title>An Offer/Answer Model with Session Description Protocol (SDP)</title>
1166 <author initials="J." surname="Rosenberg" fullname="Jonathan Rosenberg"></author>
1167 <author initials="H." surname="Schulzrinne" fullname="Henning Schulzrinne"></author>
1168 </front>
1169 <seriesInfo name="RFC" value="3264" />
1170 </reference>   
1171
1172 <reference anchor="rtcp-feedback">
1173 <front>
1174 <title>Extended RTP Profile for RTCP-based Feedback (RTP/AVPF)</title>
1175 <author initials="J." surname="Ott" fullname="Joerg Ott"></author>
1176 <author initials="S." surname="Wenger" fullname="Stephan Wenger"></author>
1177 <author initials="N." surname="Sato" fullname="Noriyuki Sato"></author>
1178 <author initials="C." surname="Burmeister" fullname="Carsten Burmeister"></author>
1179 <author initials="J." surname="Rey" fullname="Jose Rey"></author>
1180 </front>
1181 <seriesInfo name="Internet Draft" value="(draft-ietf-avt-rtcp-feedback-11: Work in progress)" />
1182 </reference>   
1183
1184
1185 </references>
1186
1187 <references title="Informative References">
1188 <reference anchor="libvorbis">
1189 <front>
1190 <title>libvorbis: Available from the Xiph website, http://www.xiph.org</title>
1191 </front>
1192 </reference>   
1193
1194 <reference anchor="vorbis-spec-ref">
1195 <front>
1196 <title>Ogg Vorbis I specification:  Codec setup and packet decode.  Available from the Xiph website, http://www.xiph.org</title>
1197 </front>
1198 </reference>   
1199   
1200 <reference anchor="v-comment">
1201 <front>
1202 <title>Ogg Vorbis I specification:  Comment field and header specification.  Available from the Xiph website, 
1203 http://www.xiph.org</title>
1204 </front>
1205 </reference>   
1206
1207 <reference anchor="775itu">
1208 <front>
1209 <title>ITU (1992-1994) ITU-R Recommendation BS. 775-1 Multi-channel stereophonic sound system with or without accompanying 
1210 picture. International Telecommunications Union.  Available from the ITU website, http://www.itu.int</title>
1211 </front>
1212 </reference>   
1213   
1214 </references>
1215 </back>
1216 </rfc>