idnits 2.17.1 draft-ietf-payload-flexible-fec-scheme-06.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 (March 5, 2018) is 2245 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 587, but not defined == Missing Reference: '15-45' is mentioned on line 589, but not defined == Missing Reference: '46-109' is mentioned on line 592, but not defined == Missing Reference: 'RFCXXXX' is mentioned on line 926, but not defined == Unused Reference: 'RFC6709' is defined on line 1605, but no explicit reference was found in the text ** 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 (~~), 7 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 PAYLOAD M. Zanaty 3 Internet-Draft Cisco 4 Intended status: Standards Track V. Singh 5 Expires: September 6, 2018 callstats.io 6 A. Begen 7 Networked Media 8 G. Mandyam 9 Qualcomm Innovation Center 10 March 5, 2018 12 RTP Payload Format for Flexible Forward Error Correction (FEC) 13 draft-ietf-payload-flexible-fec-scheme-06 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 FEC repair 21 packets are generated from a set of source packets. These repair 22 packets are sent in a redundancy RTP stream separate from the source 23 RTP stream that carries the source packets. RTP source packets that 24 were lost in transmission can be reconstructed using the source and 25 repair packets that were received. The non-interleaved and 26 interleaved parity codes which are defined in this specification 27 offer a good protection against random and bursty packet losses, 28 respectively, at a cost of decent complexity. The RTP payload 29 formats that are defined in this document address the scalability 30 issues experienced with the earlier specifications including RFC 31 2733, RFC 5109 and SMPTE 2022-1, and offer several improvements. Due 32 to these changes, the new payload formats are not backward compatible 33 with the earlier specifications, but endpoints that do not implement 34 this specification can still work by simply ignoring the FEC repair 35 packets. 37 Status of This Memo 39 This Internet-Draft is submitted in full conformance with the 40 provisions of BCP 78 and BCP 79. 42 Internet-Drafts are working documents of the Internet Engineering 43 Task Force (IETF). Note that other groups may also distribute 44 working documents as Internet-Drafts. The list of current Internet- 45 Drafts is at https://datatracker.ietf.org/drafts/current/. 47 Internet-Drafts are draft documents valid for a maximum of six months 48 and may be updated, replaced, or obsoleted by other documents at any 49 time. It is inappropriate to use Internet-Drafts as reference 50 material or to cite them other than as "work in progress." 52 This Internet-Draft will expire on September 6, 2018. 54 Copyright Notice 56 Copyright (c) 2018 IETF Trust and the persons identified as the 57 document authors. All rights reserved. 59 This document is subject to BCP 78 and the IETF Trust's Legal 60 Provisions Relating to IETF Documents 61 (https://trustee.ietf.org/license-info) in effect on the date of 62 publication of this document. Please review these documents 63 carefully, as they describe your rights and restrictions with respect 64 to this document. Code Components extracted from this document must 65 include Simplified BSD License text as described in Section 4.e of 66 the Trust Legal Provisions and are provided without warranty as 67 described in the Simplified BSD License. 69 Table of Contents 71 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 72 1.1. Parity Codes . . . . . . . . . . . . . . . . . . . . . . 4 73 1.1.1. 1-D Non-interleaved (Row) FEC Protection . . . . . . 5 74 1.1.2. 1-D Interleaved (Column) FEC Protection . . . . . . . 5 75 1.1.3. Use Cases for 1-D FEC Protection . . . . . . . . . . 6 76 1.1.4. 2-D (Row and Column) FEC Protection . . . . . . . . . 8 77 1.1.5. Overhead Computation . . . . . . . . . . . . . . . . 9 78 2. Requirements Notation . . . . . . . . . . . . . . . . . . . . 9 79 3. Definitions and Notations . . . . . . . . . . . . . . . . . . 10 80 3.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 10 81 3.2. Notations . . . . . . . . . . . . . . . . . . . . . . . . 10 82 4. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 10 83 4.1. Source Packets . . . . . . . . . . . . . . . . . . . . . 10 84 4.2. Repair Packets . . . . . . . . . . . . . . . . . . . . . 10 85 5. Payload Format Parameters . . . . . . . . . . . . . . . . . . 16 86 5.1. Media Type Registration - Parity Codes . . . . . . . . . 16 87 5.1.1. Registration of audio/flexfec . . . . . . . . . . . . 16 88 5.1.2. Registration of video/flexfec . . . . . . . . . . . . 18 89 5.1.3. Registration of text/flexfec . . . . . . . . . . . . 19 90 5.1.4. Registration of application/flexfec . . . . . . . . . 20 91 5.2. Mapping to SDP Parameters . . . . . . . . . . . . . . . . 22 92 5.2.1. Offer-Answer Model Considerations . . . . . . . . . . 22 93 5.2.2. Declarative Considerations . . . . . . . . . . . . . 23 94 6. Protection and Recovery Procedures - Parity Codes . . . . . . 23 95 6.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 23 96 6.2. Repair Packet Construction . . . . . . . . . . . . . . . 24 97 6.3. Source Packet Reconstruction . . . . . . . . . . . . . . 25 98 6.3.1. Associating the Source and Repair Packets . . . . . . 26 99 6.3.2. Recovering the RTP Header . . . . . . . . . . . . . . 27 100 6.3.3. Recovering the RTP Payload . . . . . . . . . . . . . 28 101 6.3.4. Iterative Decoding Algorithm for the 2-D Parity FEC 102 Protection . . . . . . . . . . . . . . . . . . . . . 29 103 7. SDP Examples . . . . . . . . . . . . . . . . . . . . . . . . 31 104 7.1. Example SDP for Flexible FEC Protection with in-band SSRC 105 mapping . . . . . . . . . . . . . . . . . . . . . . . . . 31 106 7.2. Example SDP for Flex FEC Protection with explicit 107 signalling in the SDP . . . . . . . . . . . . . . . . . . 31 108 8. Congestion Control Considerations . . . . . . . . . . . . . . 32 109 9. Security Considerations . . . . . . . . . . . . . . . . . . . 33 110 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 33 111 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 33 112 12. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . 33 113 12.1. draft-ietf-payload-flexible-fec-scheme-05 . . . . . . . 34 114 12.2. draft-ietf-payload-flexible-fec-scheme-03 . . . . . . . 34 115 12.3. draft-ietf-payload-flexible-fec-scheme-02 . . . . . . . 34 116 12.4. draft-ietf-payload-flexible-fec-scheme-01 . . . . . . . 34 117 12.5. draft-ietf-payload-flexible-fec-scheme-00 . . . . . . . 34 118 12.6. draft-singh-payload-1d2d-parity-scheme-00 . . . . . . . 34 119 12.7. draft-ietf-fecframe-1d2d-parity-scheme-00 . . . . . . . 35 120 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 35 121 13.1. Normative References . . . . . . . . . . . . . . . . . . 35 122 13.2. Informative References . . . . . . . . . . . . . . . . . 36 123 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 37 125 1. Introduction 127 This document defines new RTP payload formats for the Forward Error 128 Correction (FEC) that is generated by the non-interleaved and 129 interleaved parity codes from a source media encapsulated in RTP 130 [RFC3550]. The type of the source media protected by these parity 131 codes can be audio, video, text or application. The FEC data are 132 generated according to the media type parameters, which are 133 communicated out-of-band (e.g., in SDP). Furthermore, the 134 associations or relationships between the source and repair RTP 135 streams may be communicated in-band or out-of-band. For situations 136 where adaptivitiy of FEC parameters is desired, the endpoint can use 137 the in-band mechanism, whereas when the FEC parameters are fixed, the 138 endpoint may prefer to negotiate them out-of-band. 140 The Redunadncy RTP Stream [RFC7656] repair packets proposed in this 141 document protect the Source RTP Stream packets that belong to the 142 same RTP session. 144 1.1. Parity Codes 146 Both the non-interleaved and interleaved parity codes use the 147 eXclusive OR (XOR) operation to generate the repair packets. In a 148 nutshell, the following steps take place: 150 1. The sender determines a set of source packets to be protected by 151 FEC based on the media type parameters. 153 2. The sender applies the XOR operation on the source packets to 154 generate the required number of repair packets. 156 3. The sender sends the repair packet(s) along with the source 157 packets, in different RTP streams, to the receiver(s). The 158 repair packets may be sent proactively or on-demand based on RTCP 159 feedback messages such as NACK [RFC4585]. 161 At the receiver side, if all of the source packets are successfully 162 received, there is no need for FEC recovery and the repair packets 163 are discarded. However, if there are missing source packets, the 164 repair packets can be used to recover the missing information. 165 Figure 1 and Figure 2 describe example block diagrams for the 166 systematic parity FEC encoder and 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 repair packets have to be 193 received by the endpoint within a certain amount of time for the FEC 194 recovery process to be useful. In this document, we refer to the 195 time that spans a FEC block, which consists of the source packets and 196 the corresponding repair packets, as the repair window. At the 197 receiver side, the FEC decoder SHOULD buffer source and repair 198 packets at least for the duration of the repair window, to allow all 199 the repair packets to arrive. The FEC decoder can start decoding the 200 already received packets sooner; however, it should not register a 201 FEC decoding failure until it waits at least for the duration of the 202 repair window. 204 1.1.1. 1-D Non-interleaved (Row) FEC Protection 206 Suppose that we have a group of D x L source packets that have 207 sequence numbers starting from 1 running to D x L, and a repair 208 packet is generated by applying the XOR operation to every L 209 consecutive packets as sketched in Figure 3. This process is 210 referred to as 1-D non-interleaved FEC protection. As a result of 211 this process, D repair packets are generated, which we refer to as 212 non-interleaved (or row) FEC repair packets. 214 +--------------------------------------------------+ --- +===+ 215 | S_1 S_2 S3 ... S_L | + |XOR| = |R_1| 216 +--------------------------------------------------+ --- +===+ 217 +--------------------------------------------------+ --- +===+ 218 | S_L+1 S_L+2 S_L+3 ... S_2xL | + |XOR| = |R_2| 219 +--------------------------------------------------+ --- +===+ 220 . . . . . . 221 . . . . . . 222 . . . . . . 223 +--------------------------------------------------+ --- +===+ 224 | S_(D-1)xL+1 S_(D-1)xL+2 S_(D-1)xL+3 ... S_DxL | + |XOR| = |R_D| 225 +--------------------------------------------------+ --- +===+ 227 Figure 3: Generating non-interleaved (row) FEC repair packets 229 1.1.2. 1-D Interleaved (Column) FEC Protection 231 If we apply the XOR operation to the group of the source packets 232 whose sequence numbers are L apart from each other, as sketched in 233 Figure 4. In this case the endpoint generates L repair packets. 234 This process is referred to as 1-D interleaved FEC protection, and 235 the resulting L repair packets are referred to as interleaved (or 236 column) FEC repair packets. 238 +-------------+ +-------------+ +-------------+ +-------+ 239 | S_1 | | S_2 | | S3 | ... | S_L | 240 | S_L+1 | | S_L+2 | | S_L+3 | ... | S_2xL | 241 | . | | . | | | | | 242 | . | | . | | | | | 243 | . | | . | | | | | 244 | S_(D-1)xL+1 | | S_(D-1)xL+2 | | S_(D-1)xL+3 | ... | S_DxL | 245 +-------------+ +-------------+ +-------------+ +-------+ 246 + + + + 247 ------------- ------------- ------------- ------- 248 | XOR | | XOR | | XOR | ... | XOR | 249 ------------- ------------- ------------- ------- 250 = = = = 251 +===+ +===+ +===+ +===+ 252 |C_1| |C_2| |C_3| ... |C_L| 253 +===+ +===+ +===+ +===+ 255 Figure 4: Generating interleaved (column) FEC repair packets 257 1.1.3. Use Cases for 1-D FEC Protection 259 A sender may generate one non-interleaved repair packet out of L 260 consecutive source packets or one interleaved repair packet out of D 261 non-consecutive source packets. Regardless of whether the repair 262 packet is a non-interleaved or an interleaved one, it can provide a 263 full recovery of the missing information if there is only one packet 264 missing among the corresponding source packets. This implies that 265 1-D non-interleaved FEC protection performs better when the source 266 packets are randomly lost. However, if the packet losses occur in 267 bursts, 1-D interleaved FEC protection performs better provided that 268 L is chosen large enough, i.e., L-packet duration is not shorter than 269 the observed burst duration. If the sender generates non-interleaved 270 FEC repair packets and a burst loss hits the source packets, the 271 repair operation fails. This is illustrated in Figure 5. 273 +---+ +---+ +===+ 274 | 1 | X X | 4 | |R_1| 275 +---+ +---+ +===+ 277 +---+ +---+ +---+ +---+ +===+ 278 | 5 | | 6 | | 7 | | 8 | |R_2| 279 +---+ +---+ +---+ +---+ +===+ 281 +---+ +---+ +---+ +---+ +===+ 282 | 9 | | 10| | 11| | 12| |R_3| 283 +---+ +---+ +---+ +---+ +===+ 285 Figure 5: Example scenario where 1-D non-interleaved FEC protection 286 fails error recovery (Burst Loss) 288 The sender may generate interleaved FEC repair packets to combat with 289 the bursty packet losses. However, two or more random packet losses 290 may hit the source and repair packets in the same column. In that 291 case, the repair operation fails as well. This is illustrated in 292 Figure 6. Note that it is possible that two burst losses may occur 293 back-to-back, in which case interleaved FEC repair packets may still 294 fail to recover the lost data. 296 +---+ +---+ +---+ 297 | 1 | X | 3 | | 4 | 298 +---+ +---+ +---+ 300 +---+ +---+ +---+ 301 | 5 | X | 7 | | 8 | 302 +---+ +---+ +---+ 304 +---+ +---+ +---+ +---+ 305 | 9 | | 10| | 11| | 12| 306 +---+ +---+ +---+ +---+ 308 +===+ +===+ +===+ +===+ 309 |C_1| |C_2| |C_3| |C_4| 310 +===+ +===+ +===+ +===+ 312 Figure 6: Example scenario where 1-D interleaved FEC protection fails 313 error recovery (Periodic Loss) 315 1.1.4. 2-D (Row and Column) FEC Protection 317 In networks where the source packets are lost both randomly and in 318 bursts, the sender ought to generate both non-interleaved and 319 interleaved FEC repair packets. This type of FEC protection is known 320 as 2-D parity FEC protection. At the expense of generating more FEC 321 repair packets, thus increasing the FEC overhead, 2-D FEC provides 322 superior protection against mixed loss patterns. However, it is 323 still possible for 2-D parity FEC protection to fail to recover all 324 of the lost source packets if a particular loss pattern occurs. An 325 example scenario is illustrated in Figure 7. 327 +---+ +---+ +===+ 328 | 1 | X X | 4 | |R_1| 329 +---+ +---+ +===+ 331 +---+ +---+ +---+ +---+ +===+ 332 | 5 | | 6 | | 7 | | 8 | |R_2| 333 +---+ +---+ +---+ +---+ +===+ 335 +---+ +---+ +===+ 336 | 9 | X X | 12| |R_3| 337 +---+ +---+ +===+ 339 +===+ +===+ +===+ +===+ 340 |C_1| |C_2| |C_3| |C_4| 341 +===+ +===+ +===+ +===+ 343 Figure 7: Example scenario #1 where 2-D parity FEC protection fails 344 error recovery 346 2-D parity FEC protection also fails when at least two rows are 347 missing a source and the FEC packet and the missing source packets 348 (in at least two rows) are aligned in the same column. An example 349 loss pattern is sketched in Figure 8. Similarly, 2-D parity FEC 350 protection cannot repair all missing source packets when at least two 351 columns are missing a source and the FEC packet and the missing 352 source packets (in at least two columns) are aligned in the same row. 354 +---+ +---+ +---+ 355 | 1 | | 2 | X | 4 | X 356 +---+ +---+ +---+ 358 +---+ +---+ +---+ +---+ +===+ 359 | 5 | | 6 | | 7 | | 8 | |R_2| 360 +---+ +---+ +---+ +---+ +===+ 362 +---+ +---+ +---+ 363 | 9 | | 10| X | 12| X 364 +---+ +---+ +---+ 366 +===+ +===+ +===+ +===+ 367 |C_1| |C_2| |C_3| |C_4| 368 +===+ +===+ +===+ +===+ 370 Figure 8: Example scenario #2 where 2-D parity FEC protection fails 371 error recovery 373 1.1.5. Overhead Computation 375 The overhead is defined as the ratio of the number of bytes belonging 376 to the repair packets to the number of bytes belonging to the 377 protected source packets. 379 Generally, repair packets are larger in size compared to the source 380 packets. Also, not all the source packets are necessarily equal in 381 size. However, if we assume that each repair packet carries an equal 382 number of bytes carried by a source packet, we can compute the 383 overhead for different FEC protection methods as follows: 385 o 1-D Non-interleaved FEC Protection: Overhead = 1/L 387 o 1-D Interleaved FEC Protection: Overhead = 1/D 389 o 2-D Parity FEC Protection: Overhead = 1/L + 1/D 391 where L and D are the number of columns and rows in the source block, 392 respectively. 394 2. Requirements Notation 396 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 397 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 398 document are to be interpreted as described in [RFC2119]. 400 3. Definitions and Notations 402 3.1. Definitions 404 This document uses a number of definitions from [RFC6363]. 406 3.2. Notations 408 o L: Number of columns of the source block. 410 o D: Number of rows of the source block. 412 o bitmask: Run-length encoding of packets protected by a FEC packet. 413 If the bit i in the mask is set to 1, the source packet number N + 414 i is protected by this FEC packet. Here, N is the sequence number 415 base, which is indicated in the FEC packet as well. 417 4. Packet Formats 419 This section defines the formats of the source and repair packets. 421 4.1. Source Packets 423 The source packets MUST contain the information that identifies the 424 source block and the position within the source block occupied by the 425 packet. Since the source packets that are carried within an RTP 426 stream already contain unique sequence numbers in their RTP headers 427 [RFC3550], we can identify the source packets in a straightforward 428 manner and there is no need to append additional field(s). The 429 primary advantage of not modifying the source packets in any way is 430 that it provides backward compatibility for the receivers that do not 431 support FEC at all. In multicast scenarios, this backward 432 compatibility becomes quite useful as it allows the non-FEC-capable 433 and FEC-capable receivers to receive and interpret the same source 434 packets sent in the same multicast session. 436 4.2. Repair Packets 438 The repair packets MUST contain information that identifies the 439 source block they pertain to and the relationship between the 440 contained repair packets and the original source block. For this 441 purpose, we use the RTP header of the repair packets as well as 442 another header within the RTP payload, which we refer to as the FEC 443 header, as shown in Figure 9. 445 Note that all the source stream packets that are protected by a 446 particular FEC packet need to be in the same RTP session. 448 +------------------------------+ 449 | IP Header | 450 +------------------------------+ 451 | Transport Header | 452 +------------------------------+ 453 | RTP Header | 454 +------------------------------+ ---+ 455 | FEC Header | | 456 +------------------------------+ | RTP Payload 457 | Repair Payload | | 458 +------------------------------+ ---+ 460 Figure 9: Format of repair packets 462 The RTP header is formatted according to [RFC3550] with some further 463 clarifications listed below: 465 o Marker (M) Bit: This bit is not used for this payload type, and 466 SHALL be set to 0. 468 o Payload Type: The (dynamic) payload type for the repair packets is 469 determined through out-of-band means. Note that this document 470 registers new payload formats for the repair packets (Refer to 471 Section 5 for details). According to [RFC3550], an RTP receiver 472 that cannot recognize a payload type must discard it. This 473 provides backward compatibility. If a non-FEC-capable receiver 474 receives a repair packet, it will not recognize the payload type, 475 and hence, will discard the repair packet. 477 o Sequence Number (SN): The sequence number has the standard 478 definition. It MUST be one higher than the sequence number in the 479 previously transmitted repair packet. The initial value of the 480 sequence number SHOULD be random (unpredictable, based on 481 [RFC3550]). 483 o Timestamp (TS): The timestamp SHALL be set to a time corresponding 484 to the repair packet's transmission time. Note that the timestamp 485 value has no use in the actual FEC protection process and is 486 usually useful for jitter calculations. 488 o Synchronization Source (SSRC): The SSRC value for each repair 489 stream SHALL be randomly assigned as suggested by [RFC3550]. This 490 allows the sender to multiplex the source and repair RTP streams 491 on the same port, or multiplex multiple repair streams on a single 492 port. The repair streams SHOULD use the RTCP CNAME field to 493 associate themselves with the source stream. 495 In some networks, the RTP Source, which produces the source 496 packets and the FEC Source, which generates the repair packets 497 from the source packets may not be the same host. In such 498 scenarios, using the same CNAME for the source and repair RTP 499 streams means that the RTP Source and the FEC Source MUST share 500 the same CNAME (for this specific source-repair stream 501 association). A common CNAME may be produced based on an 502 algorithm that is known both to the RTP and FEC Source [RFC7022]. 503 This usage is compliant with [RFC3550]. 505 Note that due to the randomness of the SSRC assignments, there is 506 a possibility of SSRC collision. In such cases, the collisions 507 MUST be resolved as described in [RFC3550]. 509 The format of the FEC header is shown in Figure 10. 511 0 1 2 3 512 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 513 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 514 |R|F| P|X| CC |M| PT recovery | length recovery | 515 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 516 | TS recovery | 517 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 518 | SN base_i |k| Mask [0-14] | 519 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 520 |k| Mask [15-45] (optional) | 521 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 522 | | 523 + Mask [46-109] (optional) | 524 | | 525 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 526 | ... next SN base and Mask for CSRC_i in CSRC list ... | 527 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 529 Figure 10: Format of the FEC header 531 The FEC header consists of the following fields: 533 o The R bit MUST be set to 1 to indicate a retransmission packet, 534 and MUST be set to 0 for repair packets. 536 o The F field (1 bit) indicates the type of the mask. Namely: 538 +---------------+-------------------------------------+ 539 | F bit | Use | 540 +---------------+-------------------------------------+ 541 | 0 | flexible mask | 542 | 1 | packets indicated by offset M and N | 543 +---------------+-------------------------------------+ 545 Figure 11: F-bit values 547 o The P, X, CC, M and PT recovery fields are used to determine the 548 corresponding fields of the recovered packets. 550 o The Length recovery (16 bits) field is used to determine the 551 length of the recovered packets. 553 o The TS recovery (32 bits) field is used to determine the timestamp 554 of the recovered packets. 556 o The CSRC_i (32 bits) field describes the SSRC of the packets 557 protected by this particular FEC packet. If a FEC packet contains 558 protects multiple SSRCs (indicated by the CSRC Count > 1), there 559 will be multiple blocks of data containing the SN base and Mask 560 fields. 562 o The SN base_i (16 bits) field indicates the lowest sequence 563 number, taking wrap around into account, of the source packets for 564 a particular SSSRC (indicated in CSRC_i) protected by this repair 565 packet. 567 o If the F-bit is set to 0, it represents that the source packets of 568 all the SSRCs protected by this particular repair packet are 569 indicated by using a flexible bitmask. Mask is a run-length 570 encoding of packets for a particular CSRC_i protected by the FEC 571 packet. Where a bit j set to 1 indicates that the source packet 572 with sequence number (SN base_i + j + 1) is protected by this FEC 573 packet. 575 o The k-bit in the bitmasks indicates if it is 15-, 46-, or a 576 110-bitmask. k=1 denotes that another mask follows, and k=0 577 denotes that it is the last block of bit mask. 579 o 580 0 1 2 3 581 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 582 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 583 |0|0| P|X| CC |M| PT recovery | length recovery | 584 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 585 | TS recovery | 586 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 587 | SN base_i |k| Mask [0-14] | 588 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 589 |k| Mask [15-45] (optional) | 590 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 591 | | 592 + Mask [46-109] (optional) | 593 | | 594 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 595 | ... next SN base and Mask for CSRC_i in CSRC list ... | 596 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 598 Figure 12: Protocol format for F=0 600 o If the F-bit is set to 1, it represents that the source packets of 601 all the SSRCs protected by this particular repair packet are 602 indicated by using fixed offsets. 604 0 1 2 3 605 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 606 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 607 |1|0| P|X| CC |M| PT recovery | length recovery | 608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 609 | TS recovery | 610 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 611 | SN base_i | M (columns) | N (rows) | 612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 614 Figure 13: Protocol format for F=1 616 Consequently, the following conditions occur for M and N values: 618 If M>0, N=0, is Row FEC, and no column FEC will follow 619 Hence, FEC = SN, SN+1, SN+2, ... , SN+(M-1), SN+M. 621 If M>0, N=1, is Row FEC, and column FEC will follow. 622 Hence, FEC = SN, SN+1, SN+2, ... , SN+(M-1), SN+M. 623 and more to come 625 If M>0, N>1, indicates column FEC of every M packet 626 in a group of N packets starting at SN base. 627 Hence, FEC = SN+(Mx0), SN+(Mx1), ... , SN+(MxN). 629 Figure 14: Interpreting the M and N field values 631 By setting R to 1, F to 1, this FEC protects only one packet, i.e., 632 the FEC payload carries just the packet indicated by SN Base_i, which 633 is effectively retransmitting the packet. 635 Note that the parsing of this packet is different. The sequence 636 number (SN base_i) replaces the length recovery in the FEC packet. 637 The CSRC Count (CC) which would be 1, M and N would be set to 0, and 638 the reserved bits from the FEC header are removed. By doing this, we 639 save 64 bits. 641 0 1 2 3 642 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 643 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 644 |1|1| P|X| CC |M| PT recovery | sequence number | 645 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 646 | timestamp | 647 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 648 | SSRC | 649 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 650 | Retransmission | 651 : payload : 652 | | 653 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 655 Figure 15: Protocol format for Retransmission 657 The details on setting the fields in the FEC header are provided in 658 Section 6.2. 660 It should be noted that a mask-based approach (similar to the ones 661 specified in [RFC2733] and [RFC5109]) may not be very efficient to 662 indicate which source packets in the current source block are 663 associated with a given repair packet. In particular, for the 664 applications that would like to use large source block sizes, the 665 size of the mask that is required to describe the source-repair 666 packet associations may be prohibitively large. The 8-bit fields 667 proposed in [SMPTE2022-1] indicate a systematized approach. Instead 668 the approach in this document uses the 8-bit fields to indicate 669 packet offsets protected by the FEC packet. The approach in 670 [SMPTE2022-1] is inherently more efficient for regular patterns, it 671 does not provide flexibility to represent other protection patterns 672 (e.g., staircase). 674 5. Payload Format Parameters 676 This section provides the media subtype registration for the non- 677 interleaved and interleaved parity FEC. The parameters that are 678 required to configure the FEC encoding and decoding operations are 679 also defined in this section. If no specific FEC code is specified 680 in the subtype, then the FEC code defaults to the parity code defined 681 in this specification. 683 5.1. Media Type Registration - Parity Codes 685 This registration is done using the template defined in [RFC6838] and 686 following the guidance provided in [RFC3555]. 688 Note to the RFC Editor: In the following sections, please replace 689 "XXXX" with the number of this document prior to publication as an 690 RFC. 692 5.1.1. Registration of audio/flexfec 694 Type name: audio 696 Subtype name: flexfec 698 Required parameters: 700 o rate: The RTP timestamp (clock) rate. The rate SHALL be larger 701 than 1000 Hz to provide sufficient resolution to RTCP operations. 702 However, it is RECOMMENDED to select the rate that matches the 703 rate of the protected source RTP stream. 705 o repair-window: The time that spans the source packets and the 706 corresponding repair packets. The size of the repair window is 707 specified in microseconds. 709 Optional parameters: 711 o L: indicates the number of columns of the source block that are 712 protected by this FEC block and it applies to all the source 713 SSRCs. L is a positive integer. 715 o D: indicates the number of rows of the source block that are 716 protected by this FEC block and it applies to all the source 717 SSRCs. D is a positive integer. 719 o ToP: indicates the type of protection applied by the sender: 0 for 720 1-D interleaved FEC protection, 1 for 1-D non-interleaved FEC 721 protection, and 2 for 2-D parity FEC protection. The ToP value of 722 3 is reserved for future uses. 724 Encoding considerations: This media type is framed (See Section 4.8 725 in the template document [RFC6838]) and contains binary data. 727 Security considerations: See Section 9 of [RFCXXXX]. 729 Interoperability considerations: None. 731 Published specification: [RFCXXXX]. 733 Applications that use this media type: Multimedia applications that 734 want to improve resiliency against packet loss by sending redundant 735 data in addition to the source media. 737 Fragment identifier considerations: None. 739 Additional information: None. 741 Person & email address to contact for further information: Varun 742 Singh and IETF Audio/Video Transport Payloads 743 Working Group. 745 Intended usage: COMMON. 747 Restriction on usage: This media type depends on RTP framing, and 748 hence, is only defined for transport via RTP [RFC3550]. 750 Author: Varun Singh . 752 Change controller: IETF Audio/Video Transport Working Group delegated 753 from the IESG. 755 Provisional registration? (standards tree only): Yes. 757 5.1.2. Registration of video/flexfec 759 Type name: video 761 Subtype name: flexfec 763 Required parameters: 765 o rate: The RTP timestamp (clock) rate. The rate SHALL be larger 766 than 1000 Hz to provide sufficient resolution to RTCP operations. 767 However, it is RECOMMENDED to select the rate that matches the 768 rate of the protected source RTP stream. 770 o repair-window: The time that spans the source packets and the 771 corresponding repair packets. The size of the repair window is 772 specified in microseconds. 774 Optional parameters: 776 o L: indicates the number of columns of the source block that are 777 protected by this FEC block and it applies to all the source 778 SSRCs. L is a positive integer. 780 o D: indicates the number of rows of the source block that are 781 protected by this FEC block and it applies to all the source 782 SSRCs. D is a positive integer. 784 o ToP: indicates the type of protection applied by the sender: 0 for 785 1-D interleaved FEC protection, 1 for 1-D non-interleaved FEC 786 protection, and 2 for 2-D parity FEC protection. The ToP value of 787 3 is reserved for future uses. 789 Encoding considerations: This media type is framed (See Section 4.8 790 in the template document [RFC6838]) and contains binary data. 792 Security considerations: See Section 9 of [RFCXXXX]. 794 Interoperability considerations: None. 796 Published specification: [RFCXXXX]. 798 Applications that use this media type: Multimedia applications that 799 want to improve resiliency against packet loss by sending redundant 800 data in addition to the source media. 802 Fragment identifier considerations: None. 804 Additional information: None. 806 Person & email address to contact for further information: Varun 807 Singh and IETF Audio/Video Transport Payloads 808 Working Group. 810 Intended usage: COMMON. 812 Restriction on usage: This media type depends on RTP framing, and 813 hence, is only defined for transport via RTP [RFC3550]. 815 Author: Varun Singh . 817 Change controller: IETF Audio/Video Transport Working Group delegated 818 from the IESG. 820 Provisional registration? (standards tree only): Yes. 822 5.1.3. Registration of text/flexfec 824 Type name: text 826 Subtype name: flexfec 828 Required parameters: 830 o rate: The RTP timestamp (clock) rate. The rate SHALL be larger 831 than 1000 Hz to provide sufficient resolution to RTCP operations. 832 However, it is RECOMMENDED to select the rate that matches the 833 rate of the protected source RTP stream. 835 o repair-window: The time that spans the source packets and the 836 corresponding repair packets. The size of the repair window is 837 specified in microseconds. 839 Optional parameters: 841 o L: indicates the number of columns of the source block that are 842 protected by this FEC block and it applies to all the source 843 SSRCs. L is a positive integer. 845 o D: indicates the number of rows of the source block that are 846 protected by this FEC block and it applies to all the source 847 SSRCs. D is a positive integer. 849 o ToP: indicates the type of protection applied by the sender: 0 for 850 1-D interleaved FEC protection, 1 for 1-D non-interleaved FEC 851 protection, and 2 for 2-D parity FEC protection. The ToP value of 852 3 is reserved for future uses. 854 Encoding considerations: This media type is framed (See Section 4.8 855 in the template document [RFC6838]) and contains binary data. 857 Security considerations: See Section 9 of [RFCXXXX]. 859 Interoperability considerations: None. 861 Published specification: [RFCXXXX]. 863 Applications that use this media type: Multimedia applications that 864 want to improve resiliency against packet loss by sending redundant 865 data in addition to the source media. 867 Fragment identifier considerations: None. 869 Additional information: None. 871 Person & email address to contact for further information: Varun 872 Singh and IETF Audio/Video Transport Payloads 873 Working Group. 875 Intended usage: COMMON. 877 Restriction on usage: This media type depends on RTP framing, and 878 hence, is only defined for transport via RTP [RFC3550]. 880 Author: Varun Singh . 882 Change controller: IETF Audio/Video Transport Working Group delegated 883 from the IESG. 885 Provisional registration? (standards tree only): Yes. 887 5.1.4. Registration of application/flexfec 889 Type name: application 891 Subtype name: flexfec 893 Required parameters: 895 o rate: The RTP timestamp (clock) rate. The rate SHALL be larger 896 than 1000 Hz to provide sufficient resolution to RTCP operations. 897 However, it is RECOMMENDED to select the rate that matches the 898 rate of the protected source RTP stream. 900 o repair-window: The time that spans the source packets and the 901 corresponding repair packets. The size of the repair window is 902 specified in microseconds. 904 Optional parameters: 906 o L: indicates the number of columns of the source block that are 907 protected by this FEC block and it applies to all the source 908 SSRCs. L is a positive integer. 910 o D: indicates the number of rows of the source block that are 911 protected by this FEC block and it applies to all the source 912 SSRCs. D is a positive integer. 914 o ToP: indicates the type of protection applied by the sender: 0 for 915 1-D interleaved FEC protection, 1 for 1-D non-interleaved FEC 916 protection, and 2 for 2-D parity FEC protection. The ToP value of 917 3 is reserved for future uses. 919 Encoding considerations: This media type is framed (See Section 4.8 920 in the template document [RFC6838]) and contains binary data. 922 Security considerations: See Section 9 of [RFCXXXX]. 924 Interoperability considerations: None. 926 Published specification: [RFCXXXX]. 928 Applications that use this media type: Multimedia applications that 929 want to improve resiliency against packet loss by sending redundant 930 data in addition to the source media. 932 Fragment identifier considerations: None. 934 Additional information: None. 936 Person & email address to contact for further information: Varun 937 Singh and IETF Audio/Video Transport Payloads 938 Working Group. 940 Intended usage: COMMON. 942 Restriction on usage: This media type depends on RTP framing, and 943 hence, is only defined for transport via RTP [RFC3550]. 945 Author: Varun Singh . 947 Change controller: IETF Audio/Video Transport Working Group delegated 948 from the IESG. 950 Provisional registration? (standards tree only): Yes. 952 5.2. Mapping to SDP Parameters 954 Applications that are using RTP transport commonly use Session 955 Description Protocol (SDP) [RFC4566] to describe their RTP sessions. 956 The information that is used to specify the media types in an RTP 957 session has specific mappings to the fields in an SDP description. 958 In this section, we provide these mappings for the media subtypes 959 registered by this document. Note that if an application does not 960 use SDP to describe the RTP sessions, an appropriate mapping must be 961 defined and used to specify the media types and their parameters for 962 the control/description protocol employed by the application. 964 The mapping of the media type specification for "non-interleaved- 965 parityfec" and "interleaved-parityfec" and their parameters in SDP is 966 as follows: 968 o The media type (e.g., "application") goes into the "m=" line as 969 the media name. 971 o The media subtype goes into the "a=rtpmap" line as the encoding 972 name. The RTP clock rate parameter ("rate") also goes into the 973 "a=rtpmap" line as the clock rate. 975 o The remaining required payload-format-specific parameters go into 976 the "a=fmtp" line by copying them directly from the media type 977 string as a semicolon-separated list of parameter=value pairs. 979 SDP examples are provided in Section 7. 981 5.2.1. Offer-Answer Model Considerations 983 When offering 1-D interleaved parity FEC over RTP using SDP in an 984 Offer/Answer model [RFC3264], the following considerations apply: 986 o Each combination of the L and D parameters produces a different 987 FEC data and is not compatible with any other combination. A 988 sender application may desire to offer multiple offers with 989 different sets of L and D values as long as the parameter values 990 are valid. The receiver SHOULD normally choose the offer that has 991 a sufficient amount of interleaving. If multiple such offers 992 exist, the receiver may choose the offer that has the lowest 993 overhead or the one that requires the smallest amount of 994 buffering. The selection depends on the application requirements. 996 o The value for the repair-window parameter depends on the L and D 997 values and cannot be chosen arbitrarily. More specifically, L and 998 D values determine the lower limit for the repair-window size. 999 The upper limit of the repair-window size does not depend on the L 1000 and D values. 1002 o Although combinations with the same L and D values but with 1003 different repair-window sizes produce the same FEC data, such 1004 combinations are still considered different offers. The size of 1005 the repair-window is related to the maximum delay between the 1006 transmission of a source packet and the associated repair packet. 1007 This directly impacts the buffering requirement on the receiver 1008 side and the receiver must consider this when choosing an offer. 1010 o There are no optional format parameters defined for this payload. 1011 Any unknown option in the offer MUST be ignored and deleted from 1012 the answer. If FEC is not desired by the receiver, it can be 1013 deleted from the answer. 1015 5.2.2. Declarative Considerations 1017 In declarative usage, like SDP in the Real-time Streaming Protocol 1018 (RTSP) [RFC2326] or the Session Announcement Protocol (SAP) 1019 [RFC2974], the following considerations apply: 1021 o The payload format configuration parameters are all declarative 1022 and a participant MUST use the configuration that is provided for 1023 the session. 1025 o More than one configuration may be provided (if desired) by 1026 declaring multiple RTP payload types. In that case, the receivers 1027 should choose the repair stream that is best for them. 1029 6. Protection and Recovery Procedures - Parity Codes 1031 This section provides a complete specification of the 1-D and 2-D 1032 parity codes and their RTP payload formats. 1034 6.1. Overview 1036 The following sections specify the steps involved in generating the 1037 repair packets and reconstructing the missing source packets from the 1038 repair packets. 1040 6.2. Repair Packet Construction 1042 The RTP header of a repair packet is formed based on the guidelines 1043 given in Section 4.2. 1045 The FEC header includes 12 octets (or upto 28 octets when the longer 1046 optional masks are used). It is constructed by applying the XOR 1047 operation on the bit strings that are generated from the individual 1048 source packets protected by this particular repair packet. The set 1049 of the source packets that are associated with a given repair packet 1050 can be computed by the formula given in Section 6.3.1. 1052 The bit string is formed for each source packet by concatenating the 1053 following fields together in the order specified: 1055 o The first 64 bits of the RTP header (64 bits). 1057 o Unsigned network-ordered 16-bit representation of the source 1058 packet length in bytes minus 12 (for the fixed RTP header), i.e., 1059 the sum of the lengths of all the following if present: the CSRC 1060 list, extension header, RTP payload and RTP padding (16 bits). 1062 By applying the parity operation on the bit strings produced from the 1063 source packets, we generate the FEC bit string. The FEC header is 1064 generated from the FEC bit string as follows: 1066 o The first (most significant) 2 bits in the FEC bit string are 1067 skipped. The MSK bits in the FEC header are set to the 1068 appropriate value, i.e., it depends on the chosen bitmask length. 1070 o The next bit in the FEC bit string is written into the P recovery 1071 bit in the FEC header. 1073 o The next bit in the FEC bit string is written into the X recovery 1074 bit in the FEC header. 1076 o The next 4 bits of the FEC bit string are written into the CC 1077 recovery field in the FEC header. 1079 o The next bit is written into the M recovery bit in the FEC header. 1081 o The next 7 bits of the FEC bit string are written into the PT 1082 recovery field in the FEC header. 1084 o The next 16 bits are skipped. 1086 o The next 32 bits of the FEC bit string are written into the TS 1087 recovery field in the FEC header. 1089 o The next 16 bits are written into the length recovery field in the 1090 FEC header. 1092 o Depending on the chosen MSK value, the bit mask of appropriate 1093 length will be set to the appropriate values. 1095 As described in Section 4.2, the SN base field of the FEC header MUST 1096 be set to the lowest sequence number of the source packets protected 1097 by this repair packet. When MSK represents a bitmask (MSK=00,01,10), 1098 the SN base field corresponds to the lowest sequence number indicated 1099 in the bitmask. When MSK=11, the following considerations apply: 1) 1100 for the interleaved FEC repair packets, this corresponds to the 1101 lowest sequence number of the source packets that forms the column, 1102 2) for the non-interleaved FEC repair packets, the SN base field MUST 1103 be set to the lowest sequence number of the source packets that forms 1104 the row. 1106 The repair packet payload consists of the bits that are generated by 1107 applying the XOR operation on the payloads of the source RTP packets. 1108 If the payload lengths of the source packets are not equal, each 1109 shorter packet MUST be padded to the length of the longest packet by 1110 adding octet 0's at the end. 1112 Due to this possible padding and mandatory FEC header, a repair 1113 packet has a larger size than the source packets it protects. This 1114 may cause problems if the resulting repair packet size exceeds the 1115 Maximum Transmission Unit (MTU) size of the path over which the 1116 repair stream is sent. 1118 6.3. Source Packet Reconstruction 1120 This section describes the recovery procedures that are required to 1121 reconstruct the missing source packets. The recovery process has two 1122 steps. In the first step, the FEC decoder determines which source 1123 and repair packets should be used in order to recover a missing 1124 packet. In the second step, the decoder recovers the missing packet, 1125 which consists of an RTP header and RTP payload. 1127 In the following, we describe the RECOMMENDED algorithms for the 1128 first and second steps. Based on the implementation, different 1129 algorithms MAY be adopted. However, the end result MUST be identical 1130 to the one produced by the algorithms described below. 1132 Note that the same algorithms are used by the 1-D parity codes, 1133 regardless of whether the FEC protection is applied over a column or 1134 a row. The 2-D parity codes, on the other hand, usually require 1135 multiple iterations of the procedures described here. This iterative 1136 decoding algorithm is further explained in Section 6.3.4. 1138 6.3.1. Associating the Source and Repair Packets 1140 We denote the set of the source packets associated with repair packet 1141 p* by set T(p*). Note that in a source block whose size is L columns 1142 by D rows, set T includes D source packets plus one repair packet for 1143 the FEC protection applied over a column, and L source packets plus 1144 one repair packet for the FEC protection applied over a row. Recall 1145 that 1-D interleaved and non-interleaved FEC protection can fully 1146 recover the missing information if there is only one source packet 1147 missing in set T. If there are more than one source packets missing 1148 in set T, 1-D FEC protection will not work. 1150 6.3.1.1. Signaled in SDP 1152 The first step is associating the source and repair packets. If the 1153 endpoint relies entirely on out-of-band signaling (MSK=11, and 1154 M=N=0), then this information may be inferred from the media type 1155 parameters specified in the SDP description. Furthermore, the 1156 payload type field in the RTP header, assists the receiver 1157 distinguish an interleaved or non-interleaved FEC packet. 1159 Mathematically, for any received repair packet, p*, we can determine 1160 the sequence numbers of the source packets that are protected by this 1161 repair packet as follows: 1163 p*_snb + i * X_1 (modulo 65536) 1165 where p*_snb denotes the value in the SN base field of p*'s FEC 1166 header, X_1 is set to L and 1 for the interleaved and non-interleaved 1167 FEC repair packets, respectively, and 1169 0 <= i < X_2 1171 where X_2 is set to D and L for the interleaved and non-interleaved 1172 FEC repair packets, respectively. 1174 6.3.1.2. Using bitmasks 1176 When using fixed size bitmasks (16-, 48-, 112-bits), the SN base 1177 field in the FEC header indicates the lowest sequence number of the 1178 source packets that forms the FEC packet. Finally, the bits maked by 1179 "1" in the bitmask are offsets from the SN base and make up the rest 1180 of the packets protected by the FEC packet. The bitmasks are able to 1181 represent arbitrary protection patterns, for example, 1-D 1182 interleaved, 1-D non-interleaved, 2-D, staircase. 1184 6.3.1.3. Using M and N Offsets 1186 When value of M is non-zero, the 8-bit fields indicate the offset of 1187 packets protected by an interleaved (N>0) or non-interleaved (N=0) 1188 FEC packet. Using a combination of interleaved and non-interleaved 1189 FEC repair packets can form 2-D protection patterns. 1191 Mathematically, for any received repair packet, p*, we can determine 1192 the sequence numbers of the source packets that are protected by this 1193 repair packet are as follows: 1195 When N = 0: 1196 p*_snb, p*_snb+1,..., p*_snb+(M-1), p*_snb+M 1197 When N > 0: 1198 p*_snb, p*_snb+(Mx1), p*_snb+(Mx2),..., p*_snb+(Mx(N-1)), p*_snb+(MxN) 1200 6.3.2. Recovering the RTP Header 1202 For a given set T, the procedure for the recovery of the RTP header 1203 of the missing packet, whose sequence number is denoted by SEQNUM, is 1204 as follows: 1206 1. For each of the source packets that are successfully received in 1207 T, compute the 80-bit string by concatenating the first 64 bits 1208 of their RTP header and the unsigned network-ordered 16-bit 1209 representation of their length in bytes minus 12. 1211 2. For the repair packet in T, compute the FEC bit string from the 1212 first 80 bits of the FEC header. 1214 3. Calculate the recovered bit string as the XOR of the bit strings 1215 generated from all source packets in T and the FEC bit string 1216 generated from the repair packet in T. 1218 4. Create a new packet with the standard 12-byte RTP header and no 1219 payload. 1221 5. Set the version of the new packet to 2. Skip the first 2 bits 1222 in the recovered bit string. 1224 6. Set the Padding bit in the new packet to the next bit in the 1225 recovered bit string. 1227 7. Set the Extension bit in the new packet to the next bit in the 1228 recovered bit string. 1230 8. Set the CC field to the next 4 bits in the recovered bit string. 1232 9. Set the Marker bit in the new packet to the next bit in the 1233 recovered bit string. 1235 10. Set the Payload type in the new packet to the next 7 bits in the 1236 recovered bit string. 1238 11. Set the SN field in the new packet to SEQNUM. Skip the next 16 1239 bits in the recovered bit string. 1241 12. Set the TS field in the new packet to the next 32 bits in the 1242 recovered bit string. 1244 13. Take the next 16 bits of the recovered bit string and set the 1245 new variable Y to whatever unsigned integer this represents 1246 (assuming network order). Convert Y to host order. Y 1247 represents the length of the new packet in bytes minus 12 (for 1248 the fixed RTP header), i.e., the sum of the lengths of all the 1249 following if present: the CSRC list, header extension, RTP 1250 payload and RTP padding. 1252 14. Set the SSRC of the new packet to the SSRC of the source RTP 1253 stream. 1255 This procedure recovers the header of an RTP packet up to (and 1256 including) the SSRC field. 1258 6.3.3. Recovering the RTP Payload 1260 Following the recovery of the RTP header, the procedure for the 1261 recovery of the RTP payload is as follows: 1263 1. Append Y bytes to the new packet. 1265 2. For each of the source packets that are successfully received in 1266 T, compute the bit string from the Y octets of data starting with 1267 the 13th octet of the packet. If any of the bit strings 1268 generated from the source packets has a length shorter than Y, 1269 pad them to that length. The padding of octet 0 MUST be added at 1270 the end of the bit string. Note that the information of the 1271 first 8 octets are protected by the FEC header. 1273 3. For the repair packet in T, compute the FEC bit string from the 1274 repair packet payload, i.e., the Y octets of data following the 1275 FEC header. Note that the FEC header may be 12, 16, 32 octets 1276 depending on the length of the bitmask. 1278 4. Calculate the recovered bit string as the XOR of the bit strings 1279 generated from all source packets in T and the FEC bit string 1280 generated from the repair packet in T. 1282 5. Append the recovered bit string (Y octets) to the new packet 1283 generated in Section 6.3.2. 1285 6.3.4. Iterative Decoding Algorithm for the 2-D Parity FEC Protection 1287 In 2-D parity FEC protection, the sender generates both non- 1288 interleaved and interleaved FEC repair packets to combat with the 1289 mixed loss patterns (random and bursty). At the receiver side, these 1290 FEC packets are used iteratively to overcome the shortcomings of the 1291 1-D non-interleaved/interleaved FEC protection and improve the 1292 chances of full error recovery. 1294 The iterative decoding algorithm runs as follows: 1296 1. Set num_recovered_until_this_iteration to zero 1298 2. Set num_recovered_so_far to zero 1300 3. Recover as many source packets as possible by using the non- 1301 interleaved FEC repair packets as outlined in Section 6.3.2 and 1302 Section 6.3.3, and increase the value of num_recovered_so_far by 1303 the number of recovered source packets. 1305 4. Recover as many source packets as possible by using the 1306 interleaved FEC repair packets as outlined in Section 6.3.2 and 1307 Section 6.3.3, and increase the value of num_recovered_so_far by 1308 the number of recovered source packets. 1310 5. If num_recovered_so_far > num_recovered_until_this_iteration 1311 ---num_recovered_until_this_iteration = num_recovered_so_far 1312 ---Go to step 3 1313 Else 1314 ---Terminate 1316 The algorithm terminates either when all missing source packets are 1317 fully recovered or when there are still remaining missing source 1318 packets but the FEC repair packets are not able to recover any more 1319 source packets. For the example scenarios when the 2-D parity FEC 1320 protection fails full recovery, refer to Section 1.1.4. Upon 1321 termination, variable num_recovered_so_far has a value equal to the 1322 total number of recovered source packets. 1324 Example: 1326 Suppose that the receiver experienced the loss pattern sketched in 1327 Figure 16. 1329 +---+ +---+ +===+ 1330 X X | 3 | | 4 | |R_1| 1331 +---+ +---+ +===+ 1333 +---+ +---+ +---+ +---+ +===+ 1334 | 5 | | 6 | | 7 | | 8 | |R_2| 1335 +---+ +---+ +---+ +---+ +===+ 1337 +---+ +---+ +===+ 1338 | 9 | X X | 12| |R_3| 1339 +---+ +---+ +===+ 1341 +===+ +===+ +===+ +===+ 1342 |C_1| |C_2| |C_3| |C_4| 1343 +===+ +===+ +===+ +===+ 1345 Figure 16: Example loss pattern for the iterative decoding algorithm 1347 The receiver executes the iterative decoding algorithm and recovers 1348 source packets #1 and #11 in the first iteration. The resulting 1349 pattern is sketched in Figure 17. 1351 +---+ +---+ +---+ +===+ 1352 | 1 | X | 3 | | 4 | |R_1| 1353 +---+ +---+ +---+ +===+ 1355 +---+ +---+ +---+ +---+ +===+ 1356 | 5 | | 6 | | 7 | | 8 | |R_2| 1357 +---+ +---+ +---+ +---+ +===+ 1359 +---+ +---+ +---+ +===+ 1360 | 9 | X | 11| | 12| |R_3| 1361 +---+ +---+ +---+ +===+ 1363 +===+ +===+ +===+ +===+ 1364 |C_1| |C_2| |C_3| |C_4| 1365 +===+ +===+ +===+ +===+ 1367 Figure 17: The resulting pattern after the first iteration 1369 Since the if condition holds true, the receiver runs a new iteration. 1370 In the second iteration, source packets #2 and #10 are recovered, 1371 resulting in a full recovery as sketched in Figure 18. 1373 +---+ +---+ +---+ +---+ +===+ 1374 | 1 | | 2 | | 3 | | 4 | |R_1| 1375 +---+ +---+ +---+ +---+ +===+ 1377 +---+ +---+ +---+ +---+ +===+ 1378 | 5 | | 6 | | 7 | | 8 | |R_2| 1379 +---+ +---+ +---+ +---+ +===+ 1381 +---+ +---+ +---+ +---+ +===+ 1382 | 9 | | 10| | 11| | 12| |R_3| 1383 +---+ +---+ +---+ +---+ +===+ 1385 +===+ +===+ +===+ +===+ 1386 |C_1| |C_2| |C_3| |C_4| 1387 +===+ +===+ +===+ +===+ 1389 Figure 18: The resulting pattern after the second iteration 1391 7. SDP Examples 1393 This section provides two SDP [RFC4566] examples. The examples use 1394 the FEC grouping semantics defined in [RFC5956]. 1396 7.1. Example SDP for Flexible FEC Protection with in-band SSRC mapping 1398 In this example, we have one source video stream and one FEC repair 1399 stream. The source and repair streams are multiplexed on different 1400 SSRCs. The repair window is set to 200 ms. 1402 v=0 1403 o=mo 1122334455 1122334466 IN IP4 fec.example.com 1404 s=FlexFEC minimal SDP signalling Example 1405 t=0 0 1406 m=video 30000 RTP/AVP 96 98 1407 c=IN IP4 143.163.151.157 1408 a=rtpmap:96 VP8/90000 1409 a=rtpmap:98 flexfec/90000 1410 a=fmtp:98; repair-window=200ms 1412 7.2. Example SDP for Flex FEC Protection with explicit signalling in 1413 the SDP 1415 In this example, we have one source video stream (ssrc:1234) and one 1416 FEC repair streams (ssrc:2345). We form one FEC group with the 1417 "a=ssrc-group:FEC-FR 1234 2345" line. The source and repair streams 1418 are multiplexed on different SSRCs. The repair window is set to 200 1419 ms. 1421 v=0 1422 o=ali 1122334455 1122334466 IN IP4 fec.example.com 1423 s=2-D Parity FEC with no in band signalling Example 1424 t=0 0 1425 m=video 30000 RTP/AVP 100 110 1426 c=IN IP4 233.252.0.1/127 1427 a=rtpmap:100 MP2T/90000 1428 a=rtpmap:110 flexfec/90000 1429 a=fmtp:110 L:5; D:10; ToP:2; repair-window:200000 1430 a=ssrc:1234 1431 a=ssrc:2345 1432 a=ssrc-group:FEC-FR 1234 2345 1434 8. Congestion Control Considerations 1436 FEC is an effective approach to provide applications resiliency 1437 against packet losses. However, in networks where the congestion is 1438 a major contributor to the packet loss, the potential impacts of 1439 using FEC SHOULD be considered carefully before injecting the repair 1440 streams into the network. In particular, in bandwidth-limited 1441 networks, FEC repair streams may consume most or all of the available 1442 bandwidth and consequently may congest the network. In such cases, 1443 the applications MUST NOT arbitrarily increase the amount of FEC 1444 protection since doing so may lead to a congestion collapse. If 1445 desired, stronger FEC protection MAY be applied only after the source 1446 rate has been reduced. 1448 In a network-friendly implementation, an application SHOULD NOT send/ 1449 receive FEC repair streams if it knows that sending/receiving those 1450 FEC repair streams would not help at all in recovering the missing 1451 packets. However, it MAY still continue to use FEC if considered for 1452 bandwidth estimation instead of speculatively probe for additional 1453 capacity [Holmer13][Nagy14]. It is RECOMMENDED that the amount of 1454 FEC protection is adjusted dynamically based on the packet loss rate 1455 observed by the applications. 1457 In multicast scenarios, it may be difficult to optimize the FEC 1458 protection per receiver. If there is a large variation among the 1459 levels of FEC protection needed by different receivers, it is 1460 RECOMMENDED that the sender offers multiple repair streams with 1461 different levels of FEC protection and the receivers join the 1462 corresponding multicast sessions to receive the repair stream(s) that 1463 is best for them. 1465 9. Security Considerations 1467 RTP packets using the payload format defined in this specification 1468 are subject to the security considerations discussed in the RTP 1469 specification [RFC3550] and in any applicable RTP profile. The main 1470 security considerations for the RTP packet carrying the RTP payload 1471 format defined within this memo are confidentiality, integrity and 1472 source authenticity. Confidentiality is achieved by encrypting the 1473 RTP payload. Integrity of the RTP packets is achieved through a 1474 suitable cryptographic integrity protection mechanism. Such a 1475 cryptographic system may also allow the authentication of the source 1476 of the payload. A suitable security mechanism for this RTP payload 1477 format should provide confidentiality, integrity protection, and at 1478 least source authentication capable of determining if an RTP packet 1479 is from a member of the RTP session. 1481 Note that the appropriate mechanism to provide security to RTP and 1482 payloads following this memo may vary. It is dependent on the 1483 application, transport and signaling protocol employed. Therefore, a 1484 single mechanism is not sufficient, although if suitable, using the 1485 Secure Real-time Transport Protocol (SRTP) [RFC3711] is recommended. 1486 Other mechanisms that may be used are IPsec [RFC4301] and Transport 1487 Layer Security (TLS) [RFC5246] (RTP over TCP); other alternatives may 1488 exist. 1490 10. IANA Considerations 1492 New media subtypes are subject to IANA registration. For the 1493 registration of the payload formats and their parameters introduced 1494 in this document, refer to Section 5. 1496 11. Acknowledgments 1498 Some parts of this document are borrowed from [RFC5109]. Thus, the 1499 author would like to thank the editor of [RFC5109] and those who 1500 contributed to [RFC5109]. 1502 Thanks to Bernard Aboba , Rasmus Brandt , Roni Even , Stefan Holmer , 1503 Jonathan Lennox , and Magnus Westerlund for providing valuable 1504 feedback on earlier versions of this draft. 1506 12. Change Log 1508 Note to the RFC-Editor: please remove this section prior to 1509 publication as an RFC. 1511 12.1. draft-ietf-payload-flexible-fec-scheme-05 1513 FEC packet format changed as per discussions in IETF97, Seoul. 1515 12.2. draft-ietf-payload-flexible-fec-scheme-03 1517 FEC packet format changed as per discussions in IETF96, Berlin. 1519 Removed section on non-parity codes and flexfec-raptor. 1521 12.3. draft-ietf-payload-flexible-fec-scheme-02 1523 FEC packet format changed as per discussions in IETF94, Tokyo. 1525 Added section on non-parity codes. 1527 Registration of application/flexfec-raptor. 1529 12.4. draft-ietf-payload-flexible-fec-scheme-01 1531 FEC packet format changed as per discussions in IETF93, Prague. 1533 Replaced non-interleaved-parityfec and interleaved-parity-fec with 1534 flexfec. 1536 SDP simplified for the case when association to RTP is made in the 1537 FEC header and not in the SDP. 1539 12.5. draft-ietf-payload-flexible-fec-scheme-00 1541 Initial WG version, based on draft-singh-payload-1d2d-parity-scheme- 1542 00. 1544 12.6. draft-singh-payload-1d2d-parity-scheme-00 1546 This is the initial version, which is based on draft-ietf-fecframe- 1547 1d2d-parity-scheme-00. The following are the major changes compared 1548 to that document: 1550 o Updated packet format with 16-, 48-, 112- bitmask. 1552 o Updated the sections on: repair packet construction, source packet 1553 construction. 1555 o Updated the media type registration and aligned to RFC6838. 1557 12.7. draft-ietf-fecframe-1d2d-parity-scheme-00 1559 o Some details were added regarding the use of CNAME field. 1561 o Offer-Answer and Declarative Considerations sections have been 1562 completed. 1564 o Security Considerations section has been completed. 1566 o The timestamp field definition has changed. 1568 13. References 1570 13.1. Normative References 1572 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1573 Requirement Levels", BCP 14, RFC 2119, 1574 DOI 10.17487/RFC2119, March 1997, 1575 . 1577 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1578 with Session Description Protocol (SDP)", RFC 3264, 1579 DOI 10.17487/RFC3264, June 2002, 1580 . 1582 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1583 Jacobson, "RTP: A Transport Protocol for Real-Time 1584 Applications", STD 64, RFC 3550, DOI 10.17487/RFC3550, 1585 July 2003, . 1587 [RFC3555] Casner, S. and P. Hoschka, "MIME Type Registration of RTP 1588 Payload Formats", RFC 3555, DOI 10.17487/RFC3555, July 1589 2003, . 1591 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1592 Description Protocol", RFC 4566, DOI 10.17487/RFC4566, 1593 July 2006, . 1595 [RFC5956] Begen, A., "Forward Error Correction Grouping Semantics in 1596 the Session Description Protocol", RFC 5956, 1597 DOI 10.17487/RFC5956, September 2010, 1598 . 1600 [RFC6363] Watson, M., Begen, A., and V. Roca, "Forward Error 1601 Correction (FEC) Framework", RFC 6363, 1602 DOI 10.17487/RFC6363, October 2011, 1603 . 1605 [RFC6709] Carpenter, B., Aboba, B., Ed., and S. Cheshire, "Design 1606 Considerations for Protocol Extensions", RFC 6709, 1607 DOI 10.17487/RFC6709, September 2012, 1608 . 1610 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 1611 Specifications and Registration Procedures", BCP 13, 1612 RFC 6838, DOI 10.17487/RFC6838, January 2013, 1613 . 1615 [RFC7022] Begen, A., Perkins, C., Wing, D., and E. Rescorla, 1616 "Guidelines for Choosing RTP Control Protocol (RTCP) 1617 Canonical Names (CNAMEs)", RFC 7022, DOI 10.17487/RFC7022, 1618 September 2013, . 1620 13.2. Informative References 1622 [Holmer13] 1623 Holmer, S., Shemer, M., and M. Paniconi, "Handling Packet 1624 Loss in WebRTC", Proc. of IEEE International Conference on 1625 Image Processing (ICIP 2013) , 9 2013. 1627 [Nagy14] Nagy, M., Singh, V., Ott, J., and L. Eggert, "Congestion 1628 Control using FEC for Conversational Multimedia 1629 Communication", Proc. of 5th ACM Internation Conference on 1630 Multimedia Systems (MMSys 2014) , 3 2014. 1632 [RFC2326] Schulzrinne, H., Rao, A., and R. Lanphier, "Real Time 1633 Streaming Protocol (RTSP)", RFC 2326, 1634 DOI 10.17487/RFC2326, April 1998, 1635 . 1637 [RFC2733] Rosenberg, J. and H. Schulzrinne, "An RTP Payload Format 1638 for Generic Forward Error Correction", RFC 2733, 1639 DOI 10.17487/RFC2733, December 1999, 1640 . 1642 [RFC2974] Handley, M., Perkins, C., and E. Whelan, "Session 1643 Announcement Protocol", RFC 2974, DOI 10.17487/RFC2974, 1644 October 2000, . 1646 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 1647 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 1648 RFC 3711, DOI 10.17487/RFC3711, March 2004, 1649 . 1651 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 1652 Internet Protocol", RFC 4301, DOI 10.17487/RFC4301, 1653 December 2005, . 1655 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 1656 "Extended RTP Profile for Real-time Transport Control 1657 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, 1658 DOI 10.17487/RFC4585, July 2006, 1659 . 1661 [RFC5109] Li, A., Ed., "RTP Payload Format for Generic Forward Error 1662 Correction", RFC 5109, DOI 10.17487/RFC5109, December 1663 2007, . 1665 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1666 (TLS) Protocol Version 1.2", RFC 5246, 1667 DOI 10.17487/RFC5246, August 2008, 1668 . 1670 [RFC7656] Lennox, J., Gross, K., Nandakumar, S., Salgueiro, G., and 1671 B. Burman, Ed., "A Taxonomy of Semantics and Mechanisms 1672 for Real-Time Transport Protocol (RTP) Sources", RFC 7656, 1673 DOI 10.17487/RFC7656, November 2015, 1674 . 1676 [SMPTE2022-1] 1677 SMPTE 2022-1-2007, "Forward Error Correction for Real-Time 1678 Video/Audio Transport over IP Networks", 2007. 1680 Authors' Addresses 1682 Mo Zanaty 1683 Cisco 1684 Raleigh, NC 1685 USA 1687 Email: mzanaty@cisco.com 1689 Varun Singh 1690 CALLSTATS I/O Oy 1691 Runeberginkatu 4c A 4 1692 Helsinki 00100 1693 Finland 1695 Email: varun.singh@iki.fi 1696 URI: http://www.callstats.io/ 1697 Ali Begen 1698 Networked Media 1699 Konya 1700 Turkey 1702 Email: ali.begen@networked.media 1704 Giridhar Mandyam 1705 Qualcomm Innovation Center 1706 5775 Morehouse Drive 1707 San Diego, CA 92121 1708 USA 1710 Phone: +1 858 651 7200 1711 Email: mandyam@qti.qualcomm.com