idnits 2.17.1 draft-ietf-payload-flexible-fec-scheme-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 31, 2016) is 2727 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: '0-14' is mentioned on line 607, but not defined == Missing Reference: '15-45' is mentioned on line 609, but not defined == Missing Reference: '46-108' is mentioned on line 612, but not defined == Missing Reference: 'RFCXXXX' is mentioned on line 951, but not defined ** Obsolete normative reference: RFC 3555 (Obsoleted by RFC 4855, RFC 4856) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** Downref: Normative reference to an Informational RFC: RFC 6709 -- Obsolete informational reference (is this intentional?): RFC 2326 (Obsoleted by RFC 7826) -- Obsolete informational reference (is this intentional?): RFC 2733 (Obsoleted by RFC 5109) -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) Summary: 3 errors (**), 0 flaws (~~), 6 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 PAYLOAD V. Singh 3 Internet-Draft callstats.io 4 Intended status: Standards Track A. Begen 5 Expires: May 4, 2017 Networked Media 6 M. Zanaty 7 Cisco 8 G. Mandyam 9 Qualcomm Innovation Center 10 October 31, 2016 12 RTP Payload Format for Flexible Forward Error Correction (FEC) 13 draft-ietf-payload-flexible-fec-scheme-03 15 Abstract 17 This document defines new RTP payload formats for the Forward Error 18 Correction (FEC) packets that are generated by the non-interleaved 19 and interleaved parity codes from a source media encapsulated in RTP. 20 These parity codes are systematic codes, where a number of repair 21 symbols are generated from a set of source symbols. These repair 22 symbols are sent in a repair flow separate from the source flow that 23 carries the source symbols. The non-interleaved and interleaved 24 parity codes which are defined in this specification offer a good 25 protection against random and bursty packet losses, respectively, at 26 a cost of decent complexity. Moreover, alternate FEC codes may be 27 used with the payload formats presented. The RTP payload formats 28 that are defined in this document address the scalability issues 29 experienced with the earlier specifications including RFC 2733, RFC 30 5109 and SMPTE 2022-1, and offer several improvements. Due to these 31 changes, the new payload formats are not backward compatible with the 32 earlier specifications, but endpoints that do not implement the 33 scheme can still work by simply ignoring the FEC packets. 35 Status of This Memo 37 This Internet-Draft is submitted in full conformance with the 38 provisions of BCP 78 and BCP 79. 40 Internet-Drafts are working documents of the Internet Engineering 41 Task Force (IETF). Note that other groups may also distribute 42 working documents as Internet-Drafts. The list of current Internet- 43 Drafts is at http://datatracker.ietf.org/drafts/current/. 45 Internet-Drafts are draft documents valid for a maximum of six months 46 and may be updated, replaced, or obsoleted by other documents at any 47 time. It is inappropriate to use Internet-Drafts as reference 48 material or to cite them other than as "work in progress." 49 This Internet-Draft will expire on May 4, 2017. 51 Copyright Notice 53 Copyright (c) 2016 IETF Trust and the persons identified as the 54 document authors. All rights reserved. 56 This document is subject to BCP 78 and the IETF Trust's Legal 57 Provisions Relating to IETF Documents 58 (http://trustee.ietf.org/license-info) in effect on the date of 59 publication of this document. Please review these documents 60 carefully, as they describe your rights and restrictions with respect 61 to this document. Code Components extracted from this document must 62 include Simplified BSD License text as described in Section 4.e of 63 the Trust Legal Provisions and are provided without warranty as 64 described in the Simplified BSD License. 66 Table of Contents 68 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 69 1.1. Parity Codes . . . . . . . . . . . . . . . . . . . . . . 3 70 1.1.1. Use Cases for 1-D FEC Protection . . . . . . . . . . 6 71 1.1.2. Use Cases for 2-D Parity FEC Protection . . . . . . . 8 72 1.1.3. Overhead Computation . . . . . . . . . . . . . . . . 9 73 2. Requirements Notation . . . . . . . . . . . . . . . . . . . . 9 74 3. Definitions and Notations . . . . . . . . . . . . . . . . . . 10 75 3.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 10 76 3.2. Notations . . . . . . . . . . . . . . . . . . . . . . . . 10 77 4. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 10 78 4.1. Source Packets . . . . . . . . . . . . . . . . . . . . . 10 79 4.2. Repair Packets . . . . . . . . . . . . . . . . . . . . . 10 80 5. Payload Format Parameters . . . . . . . . . . . . . . . . . . 16 81 5.1. Media Type Registration - Parity Codes . . . . . . . . . 16 82 5.1.1. Registration of audio/flexfec . . . . . . . . . . . . 17 83 5.1.2. Registration of video/flexfec . . . . . . . . . . . . 18 84 5.1.3. Registration of text/flexfec . . . . . . . . . . . . 19 85 5.1.4. Registration of application/flexfec . . . . . . . . . 21 86 5.2. Mapping to SDP Parameters . . . . . . . . . . . . . . . . 22 87 5.2.1. Offer-Answer Model Considerations . . . . . . . . . . 23 88 5.2.2. Declarative Considerations . . . . . . . . . . . . . 23 89 6. Protection and Recovery Procedures - Parity Codes . . . . . . 24 90 6.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 24 91 6.2. Repair Packet Construction . . . . . . . . . . . . . . . 24 92 6.3. Source Packet Reconstruction . . . . . . . . . . . . . . 26 93 6.3.1. Associating the Source and Repair Packets . . . . . . 26 94 6.3.2. Recovering the RTP Header . . . . . . . . . . . . . . 27 95 6.3.3. Recovering the RTP Payload . . . . . . . . . . . . . 29 96 6.3.4. Iterative Decoding Algorithm for the 2-D Parity FEC 97 Protection . . . . . . . . . . . . . . . . . . . . . 29 98 7. SDP Examples . . . . . . . . . . . . . . . . . . . . . . . . 31 99 7.1. Example SDP for Flexible FEC Protection with in-band SSRC 100 mapping . . . . . . . . . . . . . . . . . . . . . . . . . 32 101 7.2. Example SDP for Flex FEC Protection with explicit 102 signalling in the SDP . . . . . . . . . . . . . . . . . . 32 103 8. Congestion Control Considerations . . . . . . . . . . . . . . 32 104 9. Security Considerations . . . . . . . . . . . . . . . . . . . 33 105 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 106 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 34 107 12. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . 34 108 12.1. draft-ietf-payload-flexible-fec-scheme-03 . . . . . . . 34 109 12.2. draft-ietf-payload-flexible-fec-scheme-02 . . . . . . . 34 110 12.3. draft-ietf-payload-flexible-fec-scheme-01 . . . . . . . 34 111 12.4. draft-ietf-payload-flexible-fec-scheme-00 . . . . . . . 35 112 12.5. draft-singh-payload-1d2d-parity-scheme-00 . . . . . . . 35 113 12.6. draft-ietf-fecframe-1d2d-parity-scheme-00 . . . . . . . 35 114 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 35 115 13.1. Normative References . . . . . . . . . . . . . . . . . . 35 116 13.2. Informative References . . . . . . . . . . . . . . . . . 36 117 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 38 119 1. Introduction 121 This document defines new RTP payload formats for the Forward Error 122 Correction (FEC) that is generated by the non-interleaved and 123 interleaved parity codes from a source media encapsulated in RTP 124 [RFC3550]. These payload formats may also be used for other types of 125 FEC codes. The type of the source media protected by these parity 126 codes can be audio, video, text or application. The FEC data are 127 generated according to the media type parameters, which are 128 communicated out-of-band (e.g., in SDP). Furthermore, the 129 associations or relationships between the source and repair flows may 130 be communicated in-band or out-of-band. Situations where adaptivitiy 131 of FEC parameters is desired, the endpoint can use the in-band 132 mechanism, whereas when the FEC parameters are fixed, the endpoint 133 may prefer to negotiate them out-of-band. 135 The repair packets proposed in this document protect the source 136 stream packets that belong to the same RTP session. 138 1.1. Parity Codes 140 Both the non-interleaved and interleaved parity codes use the 141 eXclusive OR (XOR) operation to generate the repair symbols. In a 142 nutshell, the following steps take place: 144 1. The sender determines a set of source packets to be protected by 145 FEC based on the media type parameters. 147 2. The sender applies the XOR operation on the source symbols to 148 generate the required number of repair symbols. 150 3. The sender packetizes the repair symbols and sends the repair 151 packet(s) along with the source packets to the receiver(s) (in 152 different flows). The repair packets may be sent proactively or 153 on-demand. 155 Note that the source and repair packets belong to different source 156 and repair flows, and the sender must provide a way for the receivers 157 to demultiplex them, even in the case they are sent in the same 158 5-tuple (i.e., same source/destination address/port with UDP). This 159 is required to offer backward compatibility for endpoints that do not 160 understand the FEC packets (See Section 4). At the receiver side, if 161 all of the source packets are successfully received, there is no need 162 for FEC recovery and the repair packets are discarded. However, if 163 there are missing source packets, the repair packets can be used to 164 recover the missing information. Figure 1 and Figure 2 describe 165 example block diagrams for the systematic parity FEC encoder and 166 decoder, respectively. 168 +------------+ 169 +--+ +--+ +--+ +--+ --> | Systematic | --> +--+ +--+ +--+ +--+ 170 +--+ +--+ +--+ +--+ | Parity FEC | +--+ +--+ +--+ +--+ 171 | Encoder | 172 | (Sender) | --> +==+ +==+ 173 +------------+ +==+ +==+ 175 Source Packet: +--+ Repair Packet: +==+ 176 +--+ +==+ 178 Figure 1: Block diagram for systematic parity FEC encoder 180 +------------+ 181 +--+ X X +--+ --> | Systematic | --> +--+ +--+ +--+ +--+ 182 +--+ +--+ | Parity FEC | +--+ +--+ +--+ +--+ 183 | Decoder | 184 +==+ +==+ --> | (Receiver) | 185 +==+ +==+ +------------+ 187 Source Packet: +--+ Repair Packet: +==+ Lost Packet: X 188 +--+ +==+ 190 Figure 2: Block diagram for systematic parity FEC decoder 192 In Figure 2, it is clear that the FEC packets have to be received by 193 the endpoint within a certain amount of time for the FEC recovery 194 process to be useful. In this document, we refer to the time that 195 spans a FEC block, which consists of the source packets and the 196 corresponding repair packets, as the repair window. At the receiver 197 side, the FEC decoder should wait at least for the duration of the 198 repair window after getting the first packet in a FEC block, to allow 199 all the repair packets to arrive. (The waiting time can be adjusted 200 if there are missing packets at the beginning of the FEC block.) The 201 FEC decoder can start decoding the already received packets sooner; 202 however, it should not register a FEC decoding failure until it waits 203 at least for the duration of the repair window. 205 Suppose that we have a group of D x L source packets that have 206 sequence numbers starting from 1 running to D x L, and a repair 207 packet is generated by applying the XOR operation to every L 208 consecutive packets as sketched in Figure 3. This process is 209 referred to as 1-D non-interleaved FEC protection. As a result of 210 this process, D repair packets are generated, which we refer to as 211 non-interleaved (or row) FEC packets. 213 +--------------------------------------------------+ --- +===+ 214 | S_1 S_2 S3 ... S_L | + |XOR| = |R_1| 215 +--------------------------------------------------+ --- +===+ 216 +--------------------------------------------------+ --- +===+ 217 | S_L+1 S_L+2 S_L+3 ... S_2xL | + |XOR| = |R_2| 218 +--------------------------------------------------+ --- +===+ 219 . . . . . . 220 . . . . . . 221 . . . . . . 222 +--------------------------------------------------+ --- +===+ 223 | S_(D-1)xL+1 S_(D-1)xL+2 S_(D-1)xL+3 ... S_DxL | + |XOR| = |R_D| 224 +--------------------------------------------------+ --- +===+ 226 Figure 3: Generating non-interleaved (row) FEC packets 228 If we apply the XOR operation to the group of the source packets 229 whose sequence numbers are L apart from each other, as sketched in 230 Figure 4. In this case the endpoint generates L repair packets. 231 This process is referred to as 1-D interleaved FEC protection, and 232 the resulting L repair packets are referred to as interleaved (or 233 column) FEC packets. 235 +-------------+ +-------------+ +-------------+ +-------+ 236 | S_1 | | S_2 | | S3 | ... | S_L | 237 | S_L+1 | | S_L+2 | | S_L+3 | ... | S_2xL | 238 | . | | . | | | | | 239 | . | | . | | | | | 240 | . | | . | | | | | 241 | S_(D-1)xL+1 | | S_(D-1)xL+2 | | S_(D-1)xL+3 | ... | S_DxL | 242 +-------------+ +-------------+ +-------------+ +-------+ 243 + + + + 244 ------------- ------------- ------------- ------- 245 | XOR | | XOR | | XOR | ... | XOR | 246 ------------- ------------- ------------- ------- 247 = = = = 248 +===+ +===+ +===+ +===+ 249 |C_1| |C_2| |C_3| ... |C_L| 250 +===+ +===+ +===+ +===+ 252 Figure 4: Generating interleaved (column) FEC packets 254 1.1.1. Use Cases for 1-D FEC Protection 256 We generate one non-interleaved repair packet out of L consecutive 257 source packets or one interleaved repair packet out of D non- 258 consecutive source packets. Regardless of whether the repair packet 259 is a non-interleaved or an interleaved one, it can provide a full 260 recovery of the missing information if there is only one packet 261 missing among the corresponding source packets. This implies that 262 1-D non-interleaved FEC protection performs better when the source 263 packets are randomly lost. However, if the packet losses occur in 264 bursts, 1-D interleaved FEC protection performs better provided that 265 L is chosen large enough, i.e., L-packet duration is not shorter than 266 the observed burst duration. If the sender generates non-interleaved 267 FEC packets and a burst loss hits the source packets, the repair 268 operation fails. This is illustrated in Figure 5. 270 +---+ +---+ +===+ 271 | 1 | X X | 4 | |R_1| 272 +---+ +---+ +===+ 274 +---+ +---+ +---+ +---+ +===+ 275 | 5 | | 6 | | 7 | | 8 | |R_2| 276 +---+ +---+ +---+ +---+ +===+ 278 +---+ +---+ +---+ +---+ +===+ 279 | 9 | | 10| | 11| | 12| |R_3| 280 +---+ +---+ +---+ +---+ +===+ 282 Figure 5: Example scenario where 1-D non-interleaved FEC protection 283 fails error recovery (Burst Loss) 285 The sender may generate interleaved FEC packets to combat with the 286 bursty packet losses. However, two or more random packet losses may 287 hit the source and repair packets in the same column. In that case, 288 the repair operation fails as well. This is illustrated in Figure 6. 289 Note that it is possible that two burst losses may occur back-to- 290 back, in which case interleaved FEC packets may still fail to recover 291 the lost data. 293 +---+ +---+ +---+ 294 | 1 | X | 3 | | 4 | 295 +---+ +---+ +---+ 297 +---+ +---+ +---+ 298 | 5 | X | 7 | | 8 | 299 +---+ +---+ +---+ 301 +---+ +---+ +---+ +---+ 302 | 9 | | 10| | 11| | 12| 303 +---+ +---+ +---+ +---+ 305 +===+ +===+ +===+ +===+ 306 |C_1| |C_2| |C_3| |C_4| 307 +===+ +===+ +===+ +===+ 309 Figure 6: Example scenario where 1-D interleaved FEC protection fails 310 error recovery (Periodic Loss) 312 1.1.2. Use Cases for 2-D Parity FEC Protection 314 In networks where the source packets are lost both randomly and in 315 bursts, the sender ought to generate both non-interleaved and 316 interleaved FEC packets. This type of FEC protection is known as 2-D 317 parity FEC protection. At the expense of generating more FEC 318 packets, thus increasing the FEC overhead, 2-D FEC provides superior 319 protection against mixed loss patterns. However, it is still 320 possible for 2-D parity FEC protection to fail to recover all of the 321 lost source packets if a particular loss pattern occurs. An example 322 scenario is illustrated in Figure 7. 324 +---+ +---+ +===+ 325 | 1 | X X | 4 | |R_1| 326 +---+ +---+ +===+ 328 +---+ +---+ +---+ +---+ +===+ 329 | 5 | | 6 | | 7 | | 8 | |R_2| 330 +---+ +---+ +---+ +---+ +===+ 332 +---+ +---+ +===+ 333 | 9 | X X | 12| |R_3| 334 +---+ +---+ +===+ 336 +===+ +===+ +===+ +===+ 337 |C_1| |C_2| |C_3| |C_4| 338 +===+ +===+ +===+ +===+ 340 Figure 7: Example scenario #1 where 2-D parity FEC protection fails 341 error recovery 343 2-D parity FEC protection also fails when at least two rows are 344 missing a source and the FEC packet and the missing source packets 345 (in at least two rows) are aligned in the same column. An example 346 loss pattern is sketched in Figure 8. Similarly, 2-D parity FEC 347 protection cannot repair all missing source packets when at least two 348 columns are missing a source and the FEC packet and the missing 349 source packets (in at least two columns) are aligned in the same row. 351 +---+ +---+ +---+ 352 | 1 | | 2 | X | 4 | X 353 +---+ +---+ +---+ 355 +---+ +---+ +---+ +---+ +===+ 356 | 5 | | 6 | | 7 | | 8 | |R_2| 357 +---+ +---+ +---+ +---+ +===+ 359 +---+ +---+ +---+ 360 | 9 | | 10| X | 12| X 361 +---+ +---+ +---+ 363 +===+ +===+ +===+ +===+ 364 |C_1| |C_2| |C_3| |C_4| 365 +===+ +===+ +===+ +===+ 367 Figure 8: Example scenario #2 where 2-D parity FEC protection fails 368 error recovery 370 1.1.3. Overhead Computation 372 The overhead is defined as the ratio of the number of bytes belonging 373 to the repair packets to the number of bytes belonging to the 374 protected source packets. 376 Generally, repair packets are larger in size compared to the source 377 packets. Also, not all the source packets are necessarily equal in 378 size. However, if we assume that each repair packet carries an equal 379 number of bytes carried by a source packet, we can compute the 380 overhead for different FEC protection methods as follows: 382 o 1-D Non-interleaved FEC Protection: Overhead = 1/L 384 o 1-D Interleaved FEC Protection: Overhead = 1/D 386 o 2-D Parity FEC Protection: Overhead = 1/L + 1/D 388 where L and D are the number of columns and rows in the source block, 389 respectively. 391 2. Requirements Notation 393 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 394 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 395 document are to be interpreted as described in [RFC2119]. 397 3. Definitions and Notations 399 3.1. Definitions 401 This document uses a number of definitions from [RFC6363]. 403 3.2. Notations 405 o L: Number of columns of the source block. 407 o D: Number of rows of the source block. 409 o bitmask: Run-length encoding of packets protected by a FEC packet. 410 If the bit i in the mask is set to 1, the source packet number N + 411 i is protected by this FEC packet. Here, N is the sequence number 412 base, which is indicated in the FEC packet as well. 414 4. Packet Formats 416 This section defines the formats of the source and repair packets. 418 4.1. Source Packets 420 The source packets MUST contain the information that identifies the 421 source block and the position within the source block occupied by the 422 packet. Since the source packets that are carried within an RTP 423 stream already contain unique sequence numbers in their RTP headers 424 [RFC3550], we can identify the source packets in a straightforward 425 manner and there is no need to append additional field(s). The 426 primary advantage of not modifying the source packets in any way is 427 that it provides backward compatibility for the receivers that do not 428 support FEC at all. In multicast scenarios, this backward 429 compatibility becomes quite useful as it allows the non-FEC-capable 430 and FEC-capable receivers to receive and interpret the same source 431 packets sent in the same multicast session. 433 4.2. Repair Packets 435 The repair packets MUST contain information that identifies the 436 source block they pertain to and the relationship between the 437 contained repair symbols and the original source block. For this 438 purpose, we use the RTP header of the repair packets as well as 439 another header within the RTP payload, which we refer to as the FEC 440 header, as shown in Figure 9. 442 Note that all the source stream packets that are protected by a 443 particular FEC packet need to be in the same RTP session. 445 +------------------------------+ 446 | IP Header | 447 +------------------------------+ 448 | Transport Header | 449 +------------------------------+ 450 | RTP Header | __ 451 +------------------------------+ | 452 | FEC Header | \ 453 +------------------------------+ > RTP Payload 454 | Repair Symbols | / 455 +------------------------------+ __| 457 Figure 9: Format of repair packets 459 The RTP header is formatted according to [RFC3550] with some further 460 clarifications listed below: 462 o Marker (M) Bit: This bit is not used for this payload type, and 463 SHALL be set to 0. 465 o Payload Type: The (dynamic) payload type for the repair packets is 466 determined through out-of-band means. Note that this document 467 registers new payload formats for the repair packets (Refer to 468 Section 5 for details). According to [RFC3550], an RTP receiver 469 that cannot recognize a payload type must discard it. This 470 provides backward compatibility. If a non-FEC-capable receiver 471 receives a repair packet, it will not recognize the payload type, 472 and hence, will discard the repair packet. 474 o Sequence Number (SN): The sequence number has the standard 475 definition. It MUST be one higher than the sequence number in the 476 previously transmitted repair packet. The initial value of the 477 sequence number SHOULD be random (unpredictable, based on 478 [RFC3550]). 480 o Timestamp (TS): The timestamp SHALL be set to a time corresponding 481 to the repair packet's transmission time. Note that the timestamp 482 value has no use in the actual FEC protection process and is 483 usually useful for jitter calculations. 485 o Synchronization Source (SSRC): The SSRC value SHALL be randomly 486 assigned as suggested by [RFC3550]. This allows the sender to 487 multiplex the source and repair flows on the same port, or 488 multiplex multiple repair flows on a single port. The repair 489 flows SHOULD use the RTCP CNAME field to associate themselves with 490 the source flow. 492 In some networks, the RTP Source, which produces the source 493 packets and the FEC Source, which generates the repair packets 494 from the source packets may not be the same host. In such 495 scenarios, using the same CNAME for the source and repair flows 496 means that the RTP Source and the FEC Source MUST share the same 497 CNAME (for this specific source-repair flow association). A 498 common CNAME may be produced based on an algorithm that is known 499 both to the RTP and FEC Source [RFC7022]. This usage is compliant 500 with [RFC3550]. 502 Note that due to the randomness of the SSRC assignments, there is 503 a possibility of SSRC collision. In such cases, the collisions 504 MUST be resolved as described in [RFC3550]. 506 The format of the FEC header is shown in Figure 10. 508 0 1 2 3 509 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 510 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 511 |R|F| P|X| CC |M| PT recovery | length recovery | 512 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 513 | TS recovery | 514 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 515 | SSRCCount | reserved | 516 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 517 | SSRC_i | 518 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 519 | SN base_i |k| Mask [0-14] | 520 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 521 |k| Mask [15-45] (optional) | 522 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 523 |k| | 524 +-+ Mask [46-108] (optional) | 525 | | 526 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 527 | ... next in SSRC_i ... | 528 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 530 Figure 10: Format of the FEC header 532 The FEC header consists of the following fields: 534 o The R bit MUST be set to 1 to indicate a retransmission packet, 535 and MUST be set to 0 for repair packets. 537 o The F field (1 bit) indicates the type of the mask. Namely: 539 +---------------+-------------------------------------+ 540 | F bit | Use | 541 +---------------+-------------------------------------+ 542 | 0 | flexible mask | 543 | 1 | packets indicated by offset M and N | 544 +---------------+-------------------------------------+ 546 Figure 11: F-bit values 548 o The P, X, CC, M and PT recovery fields are used to determine the 549 corresponding fields of the recovered packets. 551 o The Length recovery (16 bits) field is used to determine the 552 length of the recovered packets. 554 o The TS recovery (32 bits) field is used to determine the timestamp 555 of the recovered packets. 557 o The SSRC count (8 bits) field describes the number of SSRCs 558 protected by the FEC packet. 0 is not a valid value, and the 559 packet MUST be ignored. 561 o The Reserved (24 bits) field are reserved for future use. It MUST 562 be set to zero by senders and ignored by receivers (see [RFC6709], 563 Section 4.2). 565 o The SSRC_i (32 bits) field describes the SSRC of the packets 566 protected by this particular FEC packet. If a FEC packet contains 567 protects multiple SSRCs (indicated by the SSRC Count > 1), there 568 will be multiple blocks of data containing the SSRC, SN base and 569 Mask fields. 571 o The SN base_i (16 bits) field indicates the lowest sequence 572 number, taking wrap around into account, of the source packets for 573 a particular SSSRC (indicated in SSRC_i) protected by this repair 574 packet. 576 o If the F-bit is set to 0, it represents that the source packets of 577 all the SSRCs protected by this particular repair packet are 578 indicated by using a flexible bitmask. Mask is a run-length 579 encoding of packets for a particular SSRC_i protected by the FEC 580 packet. Where a bit j set to 1 indicates that the source packet 581 with sequence number (SN base_i + j + 1) is protected by this FEC 582 packet. 584 o The k-bit in the bitmasks indicates if it is 15-, 46-, or a 585 109-bitmask. k=0 denotes that there is one more k-bit set, and 586 k=1 denotes that it is the last block of bit mask. While parsing 587 the header, the current count of the number of k-bit gives the 588 size of the bit mask v = count(k). Size of next bitmask = 589 2^(v+3)-1. 591 o Editor's note: If we limit the number of k-bits to 3, we could 592 essentially remove the last k-bit. 594 o 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 |0|0| P|X| CC |M| PT recovery | length recovery | 600 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 601 | TS recovery | 602 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 603 | SSRCCount | reserved | 604 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 605 | SSRC_i | 606 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 607 | SN base_i |k| Mask [0-14] | 608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 609 |k| Mask [15-45] (optional) | 610 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 611 |k| | 612 +-+ Mask [46-108] (optional) | 613 | | 614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 615 | ... next in SSRC_i ... | 616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 618 Figure 12: Protocol format for F=0 620 o If the F-bit is set to 1, it represents that the source packets of 621 all the SSRCs protected by this particular repair packet are 622 indicated by using fixed offsets. 624 0 1 2 3 625 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 626 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 627 |1|0| P|X| CC |M| PT recovery | length recovery | 628 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 629 | TS recovery | 630 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 631 | SSRCCount | reserved | 632 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 633 | SSRC_i | 634 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 635 | SN base_i | M (columns) | N (rows) | 636 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 638 Figure 13: Protocol format for F=1 640 Consequently, the following conditions occur for M and N values: 642 If M>0, N=0, is Row FEC, and no column FEC will follow 643 Hence, FEC = SN, SN+1, SN+2, ... , SN+(M-1), SN+M. 645 If M>0, N=1, is Row FEC, and column FEC will follow. 646 Hence, FEC = SN, SN+1, SN+2, ... , SN+(M-1), SN+M. 647 and more to come 649 If M>0, N>1, indicates column FEC of every M packet 650 in a group of N packets starting at SN base. 651 Hence, FEC = SN+(Mx0), SN+(Mx1), ... , SN+(MxN). 653 Figure 14: Interpreting the M and N field values 655 By setting R to 1, F to 1, this FEC protects only one packet, i.e., 656 the FEC payload carries just the packet indicated by SN Base_i, which 657 is effectively retransmitting the packet. 659 Note that the parsing of this packet is different. The sequence 660 number (SN base_i) replaces the length recovery in the FEC packet. 661 The SSRC_count which would be 1, M and N would be set to 0, and the 662 reserved bits from the FEC header are removed. By doing this, we 663 save 64 bits. 665 0 1 2 3 666 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 667 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 668 |1|1| P|X| CC |M| PT recovery | sequence number | 669 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 670 | timestamp | 671 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 672 | SSRC | 673 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 674 | Retransmission | 675 : payload : 676 | | 677 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 679 Figure 15: Protocol format for Retransmission 681 The details on setting the fields in the FEC header are provided in 682 Section 6.2. 684 It should be noted that a mask-based approach (similar to the ones 685 specified in [RFC2733] and [RFC5109]) may not be very efficient to 686 indicate which source packets in the current source block are 687 associated with a given repair packet. In particular, for the 688 applications that would like to use large source block sizes, the 689 size of the mask that is required to describe the source-repair 690 packet associations may be prohibitively large. The 8-bit fields 691 proposed in [SMPTE2022-1] indicate a systematized approach. Instead 692 the approach in this document uses the 8-bit fields to indicate 693 packet offsets protected by the FEC packet. The approach in 694 [SMPTE2022-1] is inherently more efficient for regular patterns, it 695 does not provide flexibility to represent other protection patterns 696 (e.g., staircase). 698 5. Payload Format Parameters 700 This section provides the media subtype registration for the non- 701 interleaved and interleaved parity FEC. The parameters that are 702 required to configure the FEC encoding and decoding operations are 703 also defined in this section. If no specific FEC code is specified 704 in the subtype, then the FEC code defaults to the parity code defined 705 in this specification. 707 5.1. Media Type Registration - Parity Codes 709 This registration is done using the template defined in [RFC6838] and 710 following the guidance provided in [RFC3555]. 712 Note to the RFC Editor: In the following sections, please replace 713 "XXXX" with the number of this document prior to publication as an 714 RFC. 716 5.1.1. Registration of audio/flexfec 718 Type name: audio 720 Subtype name: flexfec 722 Required parameters: 724 o rate: The RTP timestamp (clock) rate. The rate SHALL be larger 725 than 1000 Hz to provide sufficient resolution to RTCP operations. 726 However, it is RECOMMENDED to select the rate that matches the 727 rate of the protected source RTP stream. 729 o repair-window: The time that spans the source packets and the 730 corresponding repair packets. The size of the repair window is 731 specified in microseconds. 733 Optional parameters: 735 o L: indicates the number of columns of the source block that are 736 protected by this FEC block and it applies to all the source 737 SSRCs. L is a positive integer. 739 o D: indicates the number of rows of the source block that are 740 protected by this FEC block and it applies to all the source 741 SSRCs. D is a positive integer. 743 o ToP: indicates the type of protection applied by the sender: 0 for 744 1-D interleaved FEC protection, 1 for 1-D non-interleaved FEC 745 protection, and 2 for 2-D parity FEC protection. The ToP value of 746 3 is reserved for future uses. 748 Encoding considerations: This media type is framed (See Section 4.8 749 in the template document [RFC6838]) and contains binary data. 751 Security considerations: See Section 9 of [RFCXXXX]. 753 Interoperability considerations: None. 755 Published specification: [RFCXXXX]. 757 Applications that use this media type: Multimedia applications that 758 want to improve resiliency against packet loss by sending redundant 759 data in addition to the source media. 761 Fragment identifier considerations: None. 763 Additional information: None. 765 Person & email address to contact for further information: Varun 766 Singh and IETF Audio/Video Transport Payloads 767 Working Group. 769 Intended usage: COMMON. 771 Restriction on usage: This media type depends on RTP framing, and 772 hence, is only defined for transport via RTP [RFC3550]. 774 Author: Varun Singh . 776 Change controller: IETF Audio/Video Transport Working Group delegated 777 from the IESG. 779 Provisional registration? (standards tree only): Yes. 781 5.1.2. Registration of video/flexfec 783 Type name: video 785 Subtype name: flexfec 787 Required parameters: 789 o rate: The RTP timestamp (clock) rate. The rate SHALL be larger 790 than 1000 Hz to provide sufficient resolution to RTCP operations. 791 However, it is RECOMMENDED to select the rate that matches the 792 rate of the protected source RTP stream. 794 o repair-window: The time that spans the source packets and the 795 corresponding repair packets. The size of the repair window is 796 specified in microseconds. 798 Optional parameters: 800 o L: indicates the number of columns of the source block that are 801 protected by this FEC block and it applies to all the source 802 SSRCs. L is a positive integer. 804 o D: indicates the number of rows of the source block that are 805 protected by this FEC block and it applies to all the source 806 SSRCs. D is a positive integer. 808 o ToP: indicates the type of protection applied by the sender: 0 for 809 1-D interleaved FEC protection, 1 for 1-D non-interleaved FEC 810 protection, and 2 for 2-D parity FEC protection. The ToP value of 811 3 is reserved for future uses. 813 Encoding considerations: This media type is framed (See Section 4.8 814 in the template document [RFC6838]) and contains binary data. 816 Security considerations: See Section 9 of [RFCXXXX]. 818 Interoperability considerations: None. 820 Published specification: [RFCXXXX]. 822 Applications that use this media type: Multimedia applications that 823 want to improve resiliency against packet loss by sending redundant 824 data in addition to the source media. 826 Fragment identifier considerations: None. 828 Additional information: None. 830 Person & email address to contact for further information: Varun 831 Singh and IETF Audio/Video Transport Payloads 832 Working Group. 834 Intended usage: COMMON. 836 Restriction on usage: This media type depends on RTP framing, and 837 hence, is only defined for transport via RTP [RFC3550]. 839 Author: Varun Singh . 841 Change controller: IETF Audio/Video Transport Working Group delegated 842 from the IESG. 844 Provisional registration? (standards tree only): Yes. 846 5.1.3. Registration of text/flexfec 848 Type name: text 850 Subtype name: flexfec 852 Required parameters: 854 o rate: The RTP timestamp (clock) rate. The rate SHALL be larger 855 than 1000 Hz to provide sufficient resolution to RTCP operations. 857 However, it is RECOMMENDED to select the rate that matches the 858 rate of the protected source RTP stream. 860 o repair-window: The time that spans the source packets and the 861 corresponding repair packets. The size of the repair window is 862 specified in microseconds. 864 Optional parameters: 866 o L: indicates the number of columns of the source block that are 867 protected by this FEC block and it applies to all the source 868 SSRCs. L is a positive integer. 870 o D: indicates the number of rows of the source block that are 871 protected by this FEC block and it applies to all the source 872 SSRCs. D is a positive integer. 874 o ToP: indicates the type of protection applied by the sender: 0 for 875 1-D interleaved FEC protection, 1 for 1-D non-interleaved FEC 876 protection, and 2 for 2-D parity FEC protection. The ToP value of 877 3 is reserved for future uses. 879 Encoding considerations: This media type is framed (See Section 4.8 880 in the template document [RFC6838]) and contains binary data. 882 Security considerations: See Section 9 of [RFCXXXX]. 884 Interoperability considerations: None. 886 Published specification: [RFCXXXX]. 888 Applications that use this media type: Multimedia applications that 889 want to improve resiliency against packet loss by sending redundant 890 data in addition to the source media. 892 Fragment identifier considerations: None. 894 Additional information: None. 896 Person & email address to contact for further information: Varun 897 Singh and IETF Audio/Video Transport Payloads 898 Working Group. 900 Intended usage: COMMON. 902 Restriction on usage: This media type depends on RTP framing, and 903 hence, is only defined for transport via RTP [RFC3550]. 905 Author: Varun Singh . 907 Change controller: IETF Audio/Video Transport Working Group delegated 908 from the IESG. 910 Provisional registration? (standards tree only): Yes. 912 5.1.4. Registration of application/flexfec 914 Type name: application 916 Subtype name: flexfec 918 Required parameters: 920 o rate: The RTP timestamp (clock) rate. The rate SHALL be larger 921 than 1000 Hz to provide sufficient resolution to RTCP operations. 922 However, it is RECOMMENDED to select the rate that matches the 923 rate of the protected source RTP stream. 925 o repair-window: The time that spans the source packets and the 926 corresponding repair packets. The size of the repair window is 927 specified in microseconds. 929 Optional parameters: 931 o L: indicates the number of columns of the source block that are 932 protected by this FEC block and it applies to all the source 933 SSRCs. L is a positive integer. 935 o D: indicates the number of rows of the source block that are 936 protected by this FEC block and it applies to all the source 937 SSRCs. D is a positive integer. 939 o ToP: indicates the type of protection applied by the sender: 0 for 940 1-D interleaved FEC protection, 1 for 1-D non-interleaved FEC 941 protection, and 2 for 2-D parity FEC protection. The ToP value of 942 3 is reserved for future uses. 944 Encoding considerations: This media type is framed (See Section 4.8 945 in the template document [RFC6838]) and contains binary data. 947 Security considerations: See Section 9 of [RFCXXXX]. 949 Interoperability considerations: None. 951 Published specification: [RFCXXXX]. 953 Applications that use this media type: Multimedia applications that 954 want to improve resiliency against packet loss by sending redundant 955 data in addition to the source media. 957 Fragment identifier considerations: None. 959 Additional information: None. 961 Person & email address to contact for further information: Varun 962 Singh and IETF Audio/Video Transport Payloads 963 Working Group. 965 Intended usage: COMMON. 967 Restriction on usage: This media type depends on RTP framing, and 968 hence, is only defined for transport via RTP [RFC3550]. 970 Author: Varun Singh . 972 Change controller: IETF Audio/Video Transport Working Group delegated 973 from the IESG. 975 Provisional registration? (standards tree only): Yes. 977 5.2. Mapping to SDP Parameters 979 Applications that are using RTP transport commonly use Session 980 Description Protocol (SDP) [RFC4566] to describe their RTP sessions. 981 The information that is used to specify the media types in an RTP 982 session has specific mappings to the fields in an SDP description. 983 In this section, we provide these mappings for the media subtypes 984 registered by this document. Note that if an application does not 985 use SDP to describe the RTP sessions, an appropriate mapping must be 986 defined and used to specify the media types and their parameters for 987 the control/description protocol employed by the application. 989 The mapping of the media type specification for "non-interleaved- 990 parityfec" and "interleaved-parityfec" and their parameters in SDP is 991 as follows: 993 o The media type (e.g., "application") goes into the "m=" line as 994 the media name. 996 o The media subtype goes into the "a=rtpmap" line as the encoding 997 name. The RTP clock rate parameter ("rate") also goes into the 998 "a=rtpmap" line as the clock rate. 1000 o The remaining required payload-format-specific parameters go into 1001 the "a=fmtp" line by copying them directly from the media type 1002 string as a semicolon-separated list of parameter=value pairs. 1004 SDP examples are provided in Section 7. 1006 5.2.1. Offer-Answer Model Considerations 1008 When offering 1-D interleaved parity FEC over RTP using SDP in an 1009 Offer/Answer model [RFC3264], the following considerations apply: 1011 o Each combination of the L and D parameters produces a different 1012 FEC data and is not compatible with any other combination. A 1013 sender application may desire to offer multiple offers with 1014 different sets of L and D values as long as the parameter values 1015 are valid. The receiver SHOULD normally choose the offer that has 1016 a sufficient amount of interleaving. If multiple such offers 1017 exist, the receiver may choose the offer that has the lowest 1018 overhead or the one that requires the smallest amount of 1019 buffering. The selection depends on the application requirements. 1021 o The value for the repair-window parameter depends on the L and D 1022 values and cannot be chosen arbitrarily. More specifically, L and 1023 D values determine the lower limit for the repair-window size. 1024 The upper limit of the repair-window size does not depend on the L 1025 and D values. 1027 o Although combinations with the same L and D values but with 1028 different repair-window sizes produce the same FEC data, such 1029 combinations are still considered different offers. The size of 1030 the repair-window is related to the maximum delay between the 1031 transmission of a source packet and the associated repair packet. 1032 This directly impacts the buffering requirement on the receiver 1033 side and the receiver must consider this when choosing an offer. 1035 o There are no optional format parameters defined for this payload. 1036 Any unknown option in the offer MUST be ignored and deleted from 1037 the answer. If FEC is not desired by the receiver, it can be 1038 deleted from the answer. 1040 5.2.2. Declarative Considerations 1042 In declarative usage, like SDP in the Real-time Streaming Protocol 1043 (RTSP) [RFC2326] or the Session Announcement Protocol (SAP) 1044 [RFC2974], the following considerations apply: 1046 o The payload format configuration parameters are all declarative 1047 and a participant MUST use the configuration that is provided for 1048 the session. 1050 o More than one configuration may be provided (if desired) by 1051 declaring multiple RTP payload types. In that case, the receivers 1052 should choose the repair flow that is best for them. 1054 6. Protection and Recovery Procedures - Parity Codes 1056 This section provides a complete specification of the 1-D and 2-D 1057 parity codes and their RTP payload formats. 1059 6.1. Overview 1061 The following sections specify the steps involved in generating the 1062 repair packets and reconstructing the missing source packets from the 1063 repair packets. 1065 6.2. Repair Packet Construction 1067 The RTP header of a repair packet is formed based on the guidelines 1068 given in Section 4.2. 1070 The FEC header includes 12 octets (or upto 28 octets when the longer 1071 optional masks are used). It is constructed by applying the XOR 1072 operation on the bit strings that are generated from the individual 1073 source packets protected by this particular repair packet. The set 1074 of the source packets that are associated with a given repair packet 1075 can be computed by the formula given in Section 6.3.1. 1077 The bit string is formed for each source packet by concatenating the 1078 following fields together in the order specified: 1080 o The first 64 bits of the RTP header (64 bits). 1082 o Unsigned network-ordered 16-bit representation of the source 1083 packet length in bytes minus 12 (for the fixed RTP header), i.e., 1084 the sum of the lengths of all the following if present: the CSRC 1085 list, extension header, RTP payload and RTP padding (16 bits). 1087 By applying the parity operation on the bit strings produced from the 1088 source packets, we generate the FEC bit string. The FEC header is 1089 generated from the FEC bit string as follows: 1091 o The first (most significant) 2 bits in the FEC bit string are 1092 skipped. The MSK bits in the FEC header are set to the 1093 appropriate value, i.e., it depends on the chosen bitmask length. 1095 o The next bit in the FEC bit string is written into the P recovery 1096 bit in the FEC header. 1098 o The next bit in the FEC bit string is written into the X recovery 1099 bit in the FEC header. 1101 o The next 4 bits of the FEC bit string are written into the CC 1102 recovery field in the FEC header. 1104 o The next bit is written into the M recovery bit in the FEC header. 1106 o The next 7 bits of the FEC bit string are written into the PT 1107 recovery field in the FEC header. 1109 o The next 16 bits are skipped. 1111 o The next 32 bits of the FEC bit string are written into the TS 1112 recovery field in the FEC header. 1114 o The next 16 bits are written into the length recovery field in the 1115 FEC header. 1117 o Depending on the chosen MSK value, the bit mask of appropriate 1118 length will be set to the appropriate values. 1120 As described in Section 4.2, the SN base field of the FEC header MUST 1121 be set to the lowest sequence number of the source packets protected 1122 by this repair packet. When MSK represents a bitmask (MSK=00,01,10), 1123 the SN base field corresponds to the lowest sequence number indicated 1124 in the bitmask. When MSK=11, the following considerations apply: 1) 1125 for the interleaved FEC packets, this corresponds to the lowest 1126 sequence number of the source packets that forms the column, 2) for 1127 the non-interleaved FEC packets, the SN base field MUST be set to the 1128 lowest sequence number of the source packets that forms the row. 1130 The repair packet payload consists of the bits that are generated by 1131 applying the XOR operation on the payloads of the source RTP packets. 1132 If the payload lengths of the source packets are not equal, each 1133 shorter packet MUST be padded to the length of the longest packet by 1134 adding octet 0's at the end. 1136 Due to this possible padding and mandatory FEC header, a repair 1137 packet has a larger size than the source packets it protects. This 1138 may cause problems if the resulting repair packet size exceeds the 1139 Maximum Transmission Unit (MTU) size of the path over which the 1140 repair flow is sent. 1142 6.3. Source Packet Reconstruction 1144 This section describes the recovery procedures that are required to 1145 reconstruct the missing source packets. The recovery process has two 1146 steps. In the first step, the FEC decoder determines which source 1147 and repair packets should be used in order to recover a missing 1148 packet. In the second step, the decoder recovers the missing packet, 1149 which consists of an RTP header and RTP payload. 1151 In the following, we describe the RECOMMENDED algorithms for the 1152 first and second steps. Based on the implementation, different 1153 algorithms MAY be adopted. However, the end result MUST be identical 1154 to the one produced by the algorithms described below. 1156 Note that the same algorithms are used by the 1-D parity codes, 1157 regardless of whether the FEC protection is applied over a column or 1158 a row. The 2-D parity codes, on the other hand, usually require 1159 multiple iterations of the procedures described here. This iterative 1160 decoding algorithm is further explained in Section 6.3.4. 1162 6.3.1. Associating the Source and Repair Packets 1164 We denote the set of the source packets associated with repair packet 1165 p* by set T(p*). Note that in a source block whose size is L columns 1166 by D rows, set T includes D source packets plus one repair packet for 1167 the FEC protection applied over a column, and L source packets plus 1168 one repair packet for the FEC protection applied over a row. Recall 1169 that 1-D interleaved and non-interleaved FEC protection can fully 1170 recover the missing information if there is only one source packet 1171 missing in set T. If there are more than one source packets missing 1172 in set T, 1-D FEC protection will not work. 1174 6.3.1.1. Signaled in SDP 1176 The first step is associating the source and repair packets. If the 1177 endpoint relies entirely on out-of-band signaling (MSK=11, and 1178 M=N=0), then this information may be inferred from the media type 1179 parameters specified in the SDP description. Furthermore, the 1180 payload type field in the RTP header, assists the receiver 1181 distinguish an interleaved or non-interleaved FEC packet. 1183 Mathematically, for any received repair packet, p*, we can determine 1184 the sequence numbers of the source packets that are protected by this 1185 repair packet as follows: 1187 p*_snb + i * X_1 (modulo 65536) 1189 where p*_snb denotes the value in the SN base field of p*'s FEC 1190 header, X_1 is set to L and 1 for the interleaved and non-interleaved 1191 FEC packets, respectively, and 1193 0 <= i < X_2 1195 where X_2 is set to D and L for the interleaved and non-interleaved 1196 FEC packets, respectively. 1198 6.3.1.2. Using bitmasks 1200 When using fixed size bitmasks (16-, 48-, 112-bits), the SN base 1201 field in the FEC header indicates the lowest sequence number of the 1202 source packets that forms the FEC packet. Finally, the bits maked by 1203 "1" in the bitmask are offsets from the SN base and make up the rest 1204 of the packets protected by the FEC packet. The bitmasks are able to 1205 represent arbitrary protection patterns, for example, 1-D 1206 interleaved, 1-D non-interleaved, 2-D, staircase. 1208 6.3.1.3. Using M and N Offsets 1210 When value of M is non-zero, the 8-bit fields indicate the offset of 1211 packets protected by an interleaved (N>0) or non-interleaved (N=0) 1212 FEC packet. Using a combination of interleaved and non-interleaved 1213 FEC packets can form 2-D protection patterns. 1215 Mathematically, for any received repair packet, p*, we can determine 1216 the sequence numbers of the source packets that are protected by this 1217 repair packet are as follows: 1219 When N = 0: 1220 p*_snb, p*_snb+1,..., p*_snb+(M-1), p*_snb+M 1221 When N > 0: 1222 p*_snb, p*_snb+(Mx1), p*_snb+(Mx2),..., p*_snb+(Mx(N-1)), p*_snb+(MxN) 1224 6.3.2. Recovering the RTP Header 1226 For a given set T, the procedure for the recovery of the RTP header 1227 of the missing packet, whose sequence number is denoted by SEQNUM, is 1228 as follows: 1230 1. For each of the source packets that are successfully received in 1231 T, compute the 80-bit string by concatenating the first 64 bits 1232 of their RTP header and the unsigned network-ordered 16-bit 1233 representation of their length in bytes minus 12. 1235 2. For the repair packet in T, compute the FEC bit string from the 1236 first 80 bits of the FEC header. 1238 3. Calculate the recovered bit string as the XOR of the bit strings 1239 generated from all source packets in T and the FEC bit string 1240 generated from the repair packet in T. 1242 4. Create a new packet with the standard 12-byte RTP header and no 1243 payload. 1245 5. Set the version of the new packet to 2. Skip the first 2 bits 1246 in the recovered bit string. 1248 6. Set the Padding bit in the new packet to the next bit in the 1249 recovered bit string. 1251 7. Set the Extension bit in the new packet to the next bit in the 1252 recovered bit string. 1254 8. Set the CC field to the next 4 bits in the recovered bit string. 1256 9. Set the Marker bit in the new packet to the next bit in the 1257 recovered bit string. 1259 10. Set the Payload type in the new packet to the next 7 bits in the 1260 recovered bit string. 1262 11. Set the SN field in the new packet to SEQNUM. Skip the next 16 1263 bits in the recovered bit string. 1265 12. Set the TS field in the new packet to the next 32 bits in the 1266 recovered bit string. 1268 13. Take the next 16 bits of the recovered bit string and set the 1269 new variable Y to whatever unsigned integer this represents 1270 (assuming network order). Convert Y to host order. Y 1271 represents the length of the new packet in bytes minus 12 (for 1272 the fixed RTP header), i.e., the sum of the lengths of all the 1273 following if present: the CSRC list, header extension, RTP 1274 payload and RTP padding. 1276 14. Set the SSRC of the new packet to the SSRC of the source RTP 1277 stream. 1279 This procedure recovers the header of an RTP packet up to (and 1280 including) the SSRC field. 1282 6.3.3. Recovering the RTP Payload 1284 Following the recovery of the RTP header, the procedure for the 1285 recovery of the RTP payload is as follows: 1287 1. Append Y bytes to the new packet. 1289 2. For each of the source packets that are successfully received in 1290 T, compute the bit string from the Y octets of data starting with 1291 the 13th octet of the packet. If any of the bit strings 1292 generated from the source packets has a length shorter than Y, 1293 pad them to that length. The padding of octet 0 MUST be added at 1294 the end of the bit string. Note that the information of the 1295 first 8 octets are protected by the FEC header. 1297 3. For the repair packet in T, compute the FEC bit string from the 1298 repair packet payload, i.e., the Y octets of data following the 1299 FEC header. Note that the FEC header may be 12, 16, 32 octets 1300 depending on the length of the bitmask. 1302 4. Calculate the recovered bit string as the XOR of the bit strings 1303 generated from all source packets in T and the FEC bit string 1304 generated from the repair packet in T. 1306 5. Append the recovered bit string (Y octets) to the new packet 1307 generated in Section 6.3.2. 1309 6.3.4. Iterative Decoding Algorithm for the 2-D Parity FEC Protection 1311 In 2-D parity FEC protection, the sender generates both non- 1312 interleaved and interleaved FEC packets to combat with the mixed loss 1313 patterns (random and bursty). At the receiver side, these FEC 1314 packets are used iteratively to overcome the shortcomings of the 1-D 1315 non-interleaved/interleaved FEC protection and improve the chances of 1316 full error recovery. 1318 The iterative decoding algorithm runs as follows: 1320 1. Set num_recovered_until_this_iteration to zero 1322 2. Set num_recovered_so_far to zero 1324 3. Recover as many source packets as possible by using the non- 1325 interleaved FEC packets as outlined in Section 6.3.2 and 1326 Section 6.3.3, and increase the value of num_recovered_so_far by 1327 the number of recovered source packets. 1329 4. Recover as many source packets as possible by using the 1330 interleaved FEC packets as outlined in Section 6.3.2 and 1331 Section 6.3.3, and increase the value of num_recovered_so_far by 1332 the number of recovered source packets. 1334 5. If num_recovered_so_far > num_recovered_until_this_iteration 1335 ---num_recovered_until_this_iteration = num_recovered_so_far 1336 ---Go to step 3 1337 Else 1338 ---Terminate 1340 The algorithm terminates either when all missing source packets are 1341 fully recovered or when there are still remaining missing source 1342 packets but the FEC packets are not able to recover any more source 1343 packets. For the example scenarios when the 2-D parity FEC 1344 protection fails full recovery, refer to Section 1.1.2. Upon 1345 termination, variable num_recovered_so_far has a value equal to the 1346 total number of recovered source packets. 1348 Example: 1350 Suppose that the receiver experienced the loss pattern sketched in 1351 Figure 16. 1353 +---+ +---+ +===+ 1354 X X | 3 | | 4 | |R_1| 1355 +---+ +---+ +===+ 1357 +---+ +---+ +---+ +---+ +===+ 1358 | 5 | | 6 | | 7 | | 8 | |R_2| 1359 +---+ +---+ +---+ +---+ +===+ 1361 +---+ +---+ +===+ 1362 | 9 | X X | 12| |R_3| 1363 +---+ +---+ +===+ 1365 +===+ +===+ +===+ +===+ 1366 |C_1| |C_2| |C_3| |C_4| 1367 +===+ +===+ +===+ +===+ 1369 Figure 16: Example loss pattern for the iterative decoding algorithm 1371 The receiver executes the iterative decoding algorithm and recovers 1372 source packets #1 and #11 in the first iteration. The resulting 1373 pattern is sketched in Figure 17. 1375 +---+ +---+ +---+ +===+ 1376 | 1 | X | 3 | | 4 | |R_1| 1377 +---+ +---+ +---+ +===+ 1379 +---+ +---+ +---+ +---+ +===+ 1380 | 5 | | 6 | | 7 | | 8 | |R_2| 1381 +---+ +---+ +---+ +---+ +===+ 1383 +---+ +---+ +---+ +===+ 1384 | 9 | X | 11| | 12| |R_3| 1385 +---+ +---+ +---+ +===+ 1387 +===+ +===+ +===+ +===+ 1388 |C_1| |C_2| |C_3| |C_4| 1389 +===+ +===+ +===+ +===+ 1391 Figure 17: The resulting pattern after the first iteration 1393 Since the if condition holds true, the receiver runs a new iteration. 1394 In the second iteration, source packets #2 and #10 are recovered, 1395 resulting in a full recovery as sketched in Figure 18. 1397 +---+ +---+ +---+ +---+ +===+ 1398 | 1 | | 2 | | 3 | | 4 | |R_1| 1399 +---+ +---+ +---+ +---+ +===+ 1401 +---+ +---+ +---+ +---+ +===+ 1402 | 5 | | 6 | | 7 | | 8 | |R_2| 1403 +---+ +---+ +---+ +---+ +===+ 1405 +---+ +---+ +---+ +---+ +===+ 1406 | 9 | | 10| | 11| | 12| |R_3| 1407 +---+ +---+ +---+ +---+ +===+ 1409 +===+ +===+ +===+ +===+ 1410 |C_1| |C_2| |C_3| |C_4| 1411 +===+ +===+ +===+ +===+ 1413 Figure 18: The resulting pattern after the second iteration 1415 7. SDP Examples 1417 This section provides two SDP [RFC4566] examples. The examples use 1418 the FEC grouping semantics defined in [RFC5956]. 1420 7.1. Example SDP for Flexible FEC Protection with in-band SSRC mapping 1422 In this example, we have one source video stream and one FEC repair 1423 stream. The source and repair streams are multiplexed on different 1424 SSRCs. The repair window is set to 200 ms. 1426 v=0 1427 o=mo 1122334455 1122334466 IN IP4 fec.example.com 1428 s=FlexFEC minimal SDP signalling Example 1429 t=0 0 1430 m=video 30000 RTP/AVP 96 98 1431 c=IN IP4 143.163.151.157 1432 a=rtpmap:96 VP8/90000 1433 a=rtpmap:98 flexfec/90000 1434 a=fmtp:98; repair-window=200ms 1436 7.2. Example SDP for Flex FEC Protection with explicit signalling in 1437 the SDP 1439 In this example, we have one source video stream (ssrc:1234) and one 1440 FEC repair streams (ssrc:2345). We form one FEC group with the 1441 "a=ssrc-group:FEC-FR 1234 2345" line. The source and repair streams 1442 are multiplexed on different SSRCs. The repair window is set to 200 1443 ms. 1445 v=0 1446 o=ali 1122334455 1122334466 IN IP4 fec.example.com 1447 s=2-D Parity FEC with no in band signalling Example 1448 t=0 0 1449 m=video 30000 RTP/AVP 100 110 1450 c=IN IP4 233.252.0.1/127 1451 a=rtpmap:100 MP2T/90000 1452 a=rtpmap:110 flexfec/90000 1453 a=fmtp:110 L:5; D:10; ToP:2; repair-window:200000 1454 a=ssrc:1234 1455 a=ssrc:2345 1456 a=ssrc-group:FEC-FR 1234 2345 1458 8. Congestion Control Considerations 1460 FEC is an effective approach to provide applications resiliency 1461 against packet losses. However, in networks where the congestion is 1462 a major contributor to the packet loss, the potential impacts of 1463 using FEC SHOULD be considered carefully before injecting the repair 1464 flows into the network. In particular, in bandwidth-limited 1465 networks, FEC repair flows may consume most or all of the available 1466 bandwidth and consequently may congest the network. In such cases, 1467 the applications MUST NOT arbitrarily increase the amount of FEC 1468 protection since doing so may lead to a congestion collapse. If 1469 desired, stronger FEC protection MAY be applied only after the source 1470 rate has been reduced [I-D.singh-rmcat-adaptive-fec]. 1472 In a network-friendly implementation, an application SHOULD NOT send/ 1473 receive FEC repair flows if it knows that sending/receiving those FEC 1474 repair flows would not help at all in recovering the missing packets. 1475 However, it MAY still continue to use FEC if considered for bandwidth 1476 estimation instead of speculatively probe for additional capacity 1477 [Holmer13][Nagy14]. It is RECOMMENDED that the amount of FEC 1478 protection is adjusted dynamically based on the packet loss rate 1479 observed by the applications. 1481 In multicast scenarios, it may be difficult to optimize the FEC 1482 protection per receiver. If there is a large variation among the 1483 levels of FEC protection needed by different receivers, it is 1484 RECOMMENDED that the sender offers multiple repair flows with 1485 different levels of FEC protection and the receivers join the 1486 corresponding multicast sessions to receive the repair flow(s) that 1487 is best for them. 1489 Editor's note: Additional congestion control considerations regarding 1490 the use of 2-D parity codes should be added here. 1492 9. Security Considerations 1494 RTP packets using the payload format defined in this specification 1495 are subject to the security considerations discussed in the RTP 1496 specification [RFC3550] and in any applicable RTP profile. The main 1497 security considerations for the RTP packet carrying the RTP payload 1498 format defined within this memo are confidentiality, integrity and 1499 source authenticity. Confidentiality is achieved by encrypting the 1500 RTP payload. Integrity of the RTP packets is achieved through a 1501 suitable cryptographic integrity protection mechanism. Such a 1502 cryptographic system may also allow the authentication of the source 1503 of the payload. A suitable security mechanism for this RTP payload 1504 format should provide confidentiality, integrity protection, and at 1505 least source authentication capable of determining if an RTP packet 1506 is from a member of the RTP session. 1508 Note that the appropriate mechanism to provide security to RTP and 1509 payloads following this memo may vary. It is dependent on the 1510 application, transport and signaling protocol employed. Therefore, a 1511 single mechanism is not sufficient, although if suitable, using the 1512 Secure Real-time Transport Protocol (SRTP) [RFC3711] is recommended. 1513 Other mechanisms that may be used are IPsec [RFC4301] and Transport 1514 Layer Security (TLS) [RFC5246] (RTP over TCP); other alternatives may 1515 exist. 1517 10. IANA Considerations 1519 New media subtypes are subject to IANA registration. For the 1520 registration of the payload formats and their parameters introduced 1521 in this document, refer to Section 5. 1523 11. Acknowledgments 1525 Some parts of this document are borrowed from [RFC5109]. Thus, the 1526 author would like to thank the editor of [RFC5109] and those who 1527 contributed to [RFC5109]. 1529 Thanks to Bernard Aboba , Rasmus Brandt , Roni Even , Stefan Holmer , 1530 Jonathan Lennox , and Magnus Westerlund for providing valuable 1531 feedback on earlier versions of this draft. 1533 12. Change Log 1535 Note to the RFC-Editor: please remove this section prior to 1536 publication as an RFC. 1538 12.1. draft-ietf-payload-flexible-fec-scheme-03 1540 FEC packet format changed as per discussions in IETF96, Berlin. 1542 Removed section on non-parity codes and flexfec-raptor. 1544 12.2. draft-ietf-payload-flexible-fec-scheme-02 1546 FEC packet format changed as per discussions in IETF94, Tokyo. 1548 Added section on non-parity codes. 1550 Registration of application/flexfec-raptor. 1552 12.3. draft-ietf-payload-flexible-fec-scheme-01 1554 FEC packet format changed as per discussions in IETF93, Prague. 1556 Replaced non-interleaved-parityfec and interleaved-parity-fec with 1557 flexfec. 1559 SDP simplified for the case when association to RTP is made in the 1560 FEC header and not in the SDP. 1562 12.4. draft-ietf-payload-flexible-fec-scheme-00 1564 Initial WG version, based on draft-singh-payload-1d2d-parity-scheme- 1565 00. 1567 12.5. draft-singh-payload-1d2d-parity-scheme-00 1569 This is the initial version, which is based on draft-ietf-fecframe- 1570 1d2d-parity-scheme-00. The following are the major changes compared 1571 to that document: 1573 o Updated packet format with 16-, 48-, 112- bitmask. 1575 o Updated the sections on: repair packet construction, source packet 1576 construction. 1578 o Updated the media type registration and aligned to RFC6838. 1580 12.6. draft-ietf-fecframe-1d2d-parity-scheme-00 1582 o Some details were added regarding the use of CNAME field. 1584 o Offer-Answer and Declarative Considerations sections have been 1585 completed. 1587 o Security Considerations section has been completed. 1589 o The timestamp field definition has changed. 1591 13. References 1593 13.1. Normative References 1595 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1596 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 1597 RFC2119, March 1997, 1598 . 1600 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1601 with Session Description Protocol (SDP)", RFC 3264, DOI 1602 10.17487/RFC3264, June 2002, 1603 . 1605 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1606 Jacobson, "RTP: A Transport Protocol for Real-Time 1607 Applications", STD 64, RFC 3550, DOI 10.17487/RFC3550, 1608 July 2003, . 1610 [RFC3555] Casner, S. and P. Hoschka, "MIME Type Registration of RTP 1611 Payload Formats", RFC 3555, DOI 10.17487/RFC3555, July 1612 2003, . 1614 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1615 Description Protocol", RFC 4566, DOI 10.17487/RFC4566, 1616 July 2006, . 1618 [RFC5956] Begen, A., "Forward Error Correction Grouping Semantics in 1619 the Session Description Protocol", RFC 5956, DOI 10.17487/ 1620 RFC5956, September 2010, 1621 . 1623 [RFC6363] Watson, M., Begen, A., and V. Roca, "Forward Error 1624 Correction (FEC) Framework", RFC 6363, DOI 10.17487/ 1625 RFC6363, October 2011, 1626 . 1628 [RFC6709] Carpenter, B., Aboba, B., Ed., and S. Cheshire, "Design 1629 Considerations for Protocol Extensions", RFC 6709, DOI 1630 10.17487/RFC6709, September 2012, 1631 . 1633 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 1634 Specifications and Registration Procedures", BCP 13, RFC 1635 6838, DOI 10.17487/RFC6838, January 2013, 1636 . 1638 [RFC7022] Begen, A., Perkins, C., Wing, D., and E. Rescorla, 1639 "Guidelines for Choosing RTP Control Protocol (RTCP) 1640 Canonical Names (CNAMEs)", RFC 7022, DOI 10.17487/RFC7022, 1641 September 2013, . 1643 13.2. Informative References 1645 [Holmer13] 1646 Holmer, S., Shemer, M., and M. Paniconi, "Handling Packet 1647 Loss in WebRTC", Proc. of IEEE International Conference on 1648 Image Processing (ICIP 2013) , 9 2013. 1650 [I-D.singh-rmcat-adaptive-fec] 1651 Varun, V., Nagy, M., Ott, J., and L. Eggert, "Congestion 1652 Control Using FEC for Conversational Media", draft-singh- 1653 rmcat-adaptive-fec-03 (work in progress), March 2016. 1655 [Nagy14] Nagy, M., Singh, V., Ott, J., and L. Eggert, "Congestion 1656 Control using FEC for Conversational Multimedia 1657 Communication", Proc. of 5th ACM Internation Conference on 1658 Multimedia Systems (MMSys 2014) , 3 2014. 1660 [RFC2326] Schulzrinne, H., Rao, A., and R. Lanphier, "Real Time 1661 Streaming Protocol (RTSP)", RFC 2326, DOI 10.17487/ 1662 RFC2326, April 1998, 1663 . 1665 [RFC2733] Rosenberg, J. and H. Schulzrinne, "An RTP Payload Format 1666 for Generic Forward Error Correction", RFC 2733, DOI 1667 10.17487/RFC2733, December 1999, 1668 . 1670 [RFC2974] Handley, M., Perkins, C., and E. Whelan, "Session 1671 Announcement Protocol", RFC 2974, DOI 10.17487/RFC2974, 1672 October 2000, . 1674 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 1675 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 1676 RFC 3711, DOI 10.17487/RFC3711, March 2004, 1677 . 1679 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 1680 Internet Protocol", RFC 4301, DOI 10.17487/RFC4301, 1681 December 2005, . 1683 [RFC5109] Li, A., Ed., "RTP Payload Format for Generic Forward Error 1684 Correction", RFC 5109, DOI 10.17487/RFC5109, December 1685 2007, . 1687 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1688 (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/ 1689 RFC5246, August 2008, 1690 . 1692 [SMPTE2022-1] 1693 SMPTE 2022-1-2007, , "Forward Error Correction for Real- 1694 Time Video/Audio Transport over IP Networks", 2007. 1696 Authors' Addresses 1698 Varun Singh 1699 CALLSTATS I/O Oy 1700 Runeberginkatu 4c A 4 1701 Helsinki 00100 1702 Finland 1704 Email: varun.singh@iki.fi 1705 URI: http://www.callstats.io/ 1707 Ali Begen 1708 Networked Media 1709 Konya 1710 Turkey 1712 Email: ali.begen@networked.media 1714 Mo Zanaty 1715 Cisco 1716 Raleigh, NC 1717 USA 1719 Email: mzanaty@cisco.com 1721 Giridhar Mandyam 1722 Qualcomm Innovation Center 1723 5775 Morehouse Drive 1724 San Diego, CA 92121 1725 USA 1727 Phone: +1 858 651 7200 1728 Email: mandyam@qti.qualcomm.com