idnits 2.17.1 draft-ietf-rmt-bb-fec-rs-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 19. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 823. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 834. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 841. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 847. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (December 22, 2006) is 6332 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- == Outdated reference: A later version (-07) exists of draft-ietf-rmt-fec-bb-revised-04 == Outdated reference: A later version (-09) exists of draft-ietf-rmt-bb-fec-raptor-object-04 == Outdated reference: A later version (-08) exists of draft-ietf-rmt-bb-fec-ldpc-04 == Outdated reference: A later version (-10) exists of draft-ietf-rmt-pi-alc-revised-03 == Outdated reference: A later version (-14) exists of draft-ietf-rmt-pi-norm-revised-03 == Outdated reference: A later version (-16) exists of draft-ietf-rmt-flute-revised-02 Summary: 1 error (**), 0 flaws (~~), 7 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Reliable Multicast Transport J. Lacan 3 Internet-Draft ENSICA/LAAS-CNRS 4 Intended status: Experimental V. Roca 5 Expires: June 25, 2007 INRIA 6 J. Peltotalo 7 S. Peltotalo 8 Tampere University of Technology 9 December 22, 2006 11 Reed-Solomon Forward Error Correction (FEC) 12 draft-ietf-rmt-bb-fec-rs-02.txt 14 Status of this Memo 16 By submitting this Internet-Draft, each author represents that any 17 applicable patent or other IPR claims of which he or she is aware 18 have been or will be disclosed, and any of which he or she becomes 19 aware will be disclosed, in accordance with Section 6 of BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF), its areas, and its working groups. Note that 23 other groups may also distribute working documents as Internet- 24 Drafts. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 The list of current Internet-Drafts can be accessed at 32 http://www.ietf.org/ietf/1id-abstracts.txt. 34 The list of Internet-Draft Shadow Directories can be accessed at 35 http://www.ietf.org/shadow.html. 37 This Internet-Draft will expire on June 25, 2007. 39 Copyright Notice 41 Copyright (C) The IETF Trust (2006). 43 Abstract 45 This document describes a Fully-Specified FEC scheme for the Reed- 46 Solomon forward error correction code and its application to the 47 reliable delivery of data objects on the packet erasure channel. 49 Reed-Solomon codes belong to the class of Maximum Distance Separable 50 (MDS) codes, i.e. they enable a receiver to recover the k source 51 symbols from any set of k received symbols. 53 The implementation described here is compatible with the 54 implementation from Luigi Rizzo. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 59 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 60 3. Definitions Notations and Abbreviations . . . . . . . . . . . 6 61 3.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 6 62 3.2. Notations . . . . . . . . . . . . . . . . . . . . . . . . 6 63 3.3. Abbreviations . . . . . . . . . . . . . . . . . . . . . . 7 64 4. Formats and Codes . . . . . . . . . . . . . . . . . . . . . . 8 65 4.1. FEC Payload ID . . . . . . . . . . . . . . . . . . . . . . 8 66 4.2. FEC Object Transmission Information . . . . . . . . . . . 9 67 4.2.1. Mandatory Elements . . . . . . . . . . . . . . . . . . 9 68 4.2.2. Common Elements . . . . . . . . . . . . . . . . . . . 9 69 4.2.3. Scheme-Specific Elements . . . . . . . . . . . . . . . 9 70 4.2.4. Encoding Format . . . . . . . . . . . . . . . . . . . 10 71 5. Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . 12 72 5.1. Determining the Maximum Source Block Length (B) . . . . . 12 73 5.2. Determining the Number of Encoding Symbols of a Block . . 12 74 6. Reed-Solomon Codes Specification for the Erasure Channel . . . 14 75 6.1. Finite Field . . . . . . . . . . . . . . . . . . . . . . . 14 76 6.2. Reed-Solomon Encoding Algorithm . . . . . . . . . . . . . 15 77 6.2.1. Encoding Principles . . . . . . . . . . . . . . . . . 15 78 6.2.2. Encoding Complexity . . . . . . . . . . . . . . . . . 16 79 6.3. Reed-Solomon Decoding Algorithm . . . . . . . . . . . . . 16 80 6.3.1. Decoding Principles . . . . . . . . . . . . . . . . . 16 81 6.3.2. Decoding Complexity . . . . . . . . . . . . . . . . . 17 82 6.4. Implementation for the Packet Erasure Channel . . . . . . 17 83 7. Security Considerations . . . . . . . . . . . . . . . . . . . 19 84 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 85 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 21 86 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 22 87 10.1. Normative References . . . . . . . . . . . . . . . . . . . 22 88 10.2. Informative References . . . . . . . . . . . . . . . . . . 22 89 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 24 90 Intellectual Property and Copyright Statements . . . . . . . . . . 25 92 1. Introduction 94 The use of Forward Error Correction (FEC) codes is a classical 95 solution to improve the reliability of multicast and broadcast 96 transmissions. The [2] document describes a general framework to use 97 FEC in Content Delivery Protocols (CDP). The companion document [3] 98 describes some applications of FEC codes for content delivery. 100 Recent FEC schemes like [6] and [7] proposed erasure codes based on 101 sparse graphs/matrices. These codes are efficient in terms of 102 processing but not optimal in terms of correction capabilities when 103 dealing with "small" objects. 105 The FEC scheme described in this document belongs to the class of 106 Maximum Distance Separable codes that are optimal in terms of erasure 107 correction capability. In others words, it enables a receiver to 108 recover the k source symbols from any set of exactly k encoding 109 symbols. Even if the encoding/decoding complexity is larger than 110 that of [6] or [7], this family of codes is very useful. 112 Many applications dealing with content transmission or content 113 storage already rely on packet-based Reed-Solomon codes. In 114 particular, many of them use the Reed-Solomon codec of Luigi Rizzo 115 [4]. The goal of the present document to specify an implementation 116 of Reed-Solomon codes that is compatible with this codec. 118 2. Terminology 120 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 121 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 122 document are to be interpreted as described in RFC 2119 [1]. 124 3. Definitions Notations and Abbreviations 126 3.1. Definitions 128 This document uses the same terms and definitions as those specified 129 in [2]. Additionally, it uses the following definitions: 131 Source symbol: unit of data used during the encoding process. 133 Encoding symbol: unit of data generated by the encoding process. 135 Repair symbol: encoding symbol that is not a source symbol. 137 Systematic code: FEC code in which the source symbols are part of 138 the encoding symbols. 140 Source block: a block of k source symbols that are considered 141 together for the encoding. 143 Encoding Symbol Group: a group of encoding symbols that are sent 144 together within the same packet, and whose relationships to the 145 source block can be derived from a single Encoding Symbol ID. 147 Source Packet: a data packet containing only source symbols. 149 Repair Packet: a data packet containing only repair symbols. 151 3.2. Notations 153 This document uses the following notations: 155 L denotes the object transfer length in bytes. 157 k denotes the number of source symbols in a source block. 159 n_r denotes the number of repair symbols generated for a source 160 block. 162 n denotes the encoding block length, i.e. the number of encoding 163 symbols generated for a source block. Therefore: n = k + n_r. 165 max_n denotes the maximum number of encoding symbols generated for 166 any source block. 168 B denotes the maximum source block length in symbols, i.e. the 169 maximum number of source symbols per source block. 171 N denotes the number of source blocks into which the object shall 172 be partitioned. 174 E denotes the encoding symbol length in bytes. 176 S denotes the symbol size in units of m-bit elements. When m = 8, 177 then S and E are equal. 179 m defines the length of the elements in the finite field, in bits. 181 q defines the number of elements in the finite field. We have: q 182 = 2^^m in this specification. 184 G denotes the number of encoding symbols per group, i.e. the 185 number of symbols sent in the same packet. 187 GM denotes the Generator Matrix of a Reed-Solomon code. 189 rate denotes the "code rate", i.e. the k/n ratio. 191 a^^b denotes a raised to the power b. 193 a^^-1 denotes the inverse of a. 195 I_k denotes the k*k identity matrix. 197 3.3. Abbreviations 199 This document uses the following abbreviations: 201 ESI stands for Encoding Symbol ID. 203 FEC OTI stands for FEC Object Transmission Information. 205 RS stands for Reed-Solomon. 207 MDS stands for Maximum Distance Separable code. 209 GF(q) denotes a finite field (A.K.A. Galois Field) with q 210 elements. We assume that q = 2^^m in this document. 212 4. Formats and Codes 214 4.1. FEC Payload ID 216 The FEC Payload ID is composed of the Source Block Number and the 217 Encoding Symbol ID. The length of these two fields depends on the 218 parameter m (which is transmitted in the FEC OTI) as follows : 220 o The Source Block Number (field of size 32-m bits) identifies from 221 which source block of the object the encoding symbol(s) in the 222 payload is (are) generated. There are a maximum of 2^^(32-m) 223 blocks per object. 225 o The Encoding Symbol ID (field of size m bits) identifies which 226 specific encoding symbol(s) generated from the source block 227 is(are) carried in the packet payload. There are a maximum of 228 2^^m encoding symbols per block. The first k values (0 to k - 1) 229 identify source symbols, the remaining n-k values identify repair 230 symbols. 232 There MUST be exactly one FEC Payload ID per source or repair packet. 233 In case of an Encoding Symbol Group, when multiple encoding symbols 234 are sent in the same packet, the FEC Payload ID refers to the first 235 symbol of the packet. The other symbols can be deduced from the ESI 236 of the first symbol by incrementing sequentially the ESI. 238 The format of the FEC Payload ID for m = 8 and m = 16 is illustrated 239 in Figure 1 and Figure 2 respectively. 241 0 1 2 3 242 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 243 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 244 | Source Block Number (32-8=24 bits) | Enc. Symb. ID | 245 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 247 Figure 1: FEC Payload ID encoding format for m = 8 (default) 249 0 1 2 3 250 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 251 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 252 | Src Block Nb (32-16=16 bits) | Enc. Symbol ID (m=16 bits) | 253 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 255 Figure 2: FEC Payload ID encoding format for m = 16 257 4.2. FEC Object Transmission Information 259 4.2.1. Mandatory Elements 261 o FEC Encoding ID: the Fully-Specified FEC Scheme described in this 262 document uses FEC Encoding ID 2. 264 4.2.2. Common Elements 266 The following elements MUST be defined with the present FEC scheme: 268 o Transfer-Length (L): a non-negative integer indicating the length 269 of the object in bytes. There are some restrictions on the 270 maximum Transfer-Length that can be supported : 272 max_transfer_length = 2^^(32-m) * B * E 274 For instance, for m = 8, for B = 2^^8 - 1 (because the codec 275 operates on a finite field with 2^^8 elements) and if E = 1024 276 bytes, then the maximum transfer length is approximately equal to 277 2^^42 bytes (i.e. 4 Tera Bytes). Similarly, for m = 16, for B = 278 2^^16 - 1 and if E = 1024 bytes, then the maximum transfer length 279 is also approximately equal to 2^^42 bytes. For larger objects, 280 another FEC scheme, with a larger Source Block Number field in the 281 FEC Payload ID, could be defined. Another solution consists in 282 fragmenting large objects into smaller objects, each of them 283 complying with the above limits. 285 o Encoding-Symbol-Length (E): a non-negative integer indicating the 286 length of each encoding symbol in bytes. 288 o Maximum-Source-Block-Length (B): a non-negative integer indicating 289 the maximum number of source symbols in a source block. 291 o Max-Number-of-Encoding-Symbols (max_n): a non-negative integer 292 indicating the maximum number of encoding symbols generated for 293 any source block. 295 Section 5 explains how to derive the values of each of these 296 elements. 298 4.2.3. Scheme-Specific Elements 300 The following element MUST be defined with the present FEC Scheme. 301 It contains two distinct pieces of information: 303 o G: a non-negative integer indicating the number of encoding 304 symbols per group used for the object. The default value is 1, 305 meaning that each packet contains exactly one symbol. When no G 306 parameter is communicated to the decoder, then this latter MUST 307 assume that G = 1. 309 o Finite Field parameter, m: The m parameter is the length of the 310 finite field elements, in bits. It also characterizes the number 311 of elements in the finite field: q = 2^^m elements. The default 312 value is m = 8. When no finite field size parameter is 313 communicated to the decoder, then this latter MUST assume that m = 314 8. 316 4.2.4. Encoding Format 318 This section shows two possible encoding formats of the above FEC 319 OTI. The present document does not specify when one encoding format 320 or the other should be used. 322 4.2.4.1. Using the General EXT_FTI Format 324 The FEC OTI binary format is the following, when the EXT_FTI 325 mechanism is used (e.g. within the ALC [8] or NORM [9] protocols). 327 0 1 2 3 328 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 329 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 330 | HET = 64 | HEL | | 331 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 332 | Transfer-Length (L) | 333 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 334 | m | G | Encoding Symbol Length (E) | 335 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 336 | Max Source Block Length (B) | Max Nb Enc. Symbols (max_n) | 337 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 339 Figure 3: EXT_FTI Header Format 341 4.2.4.2. Using the FDT Instance (FLUTE specific) 343 When it is desired that the FEC OTI be carried in the FDT Instance of 344 a FLUTE session [10], the following XML attributes must be described 345 for the associated object: 347 o FEC-OTI-FEC-Encoding-ID 349 o FEC-OTI-Transfer-Length (L) 350 o FEC-OTI-Encoding-Symbol-Length (E) 352 o FEC-OTI-Maximum-Source-Block-Length (B) 354 o FEC-OTI-Max-Number-of-Encoding-Symbols (max_n) 356 o FEC-OTI-Scheme-Specific-Info 358 The FEC-OTI-Scheme-Specific-Info contains the string resulting from 359 the Base64 encoding (in the XML Schema xs:base64Binary sense) of the 360 following value: 362 0 1 363 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 364 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 365 | m | G | 366 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 368 Figure 4: FEC OTI Scheme Specific Information to be Included in the 369 FDT Instance 371 When no m parameter is to be carried in the FEC OTI, the m field is 372 set to 0 (which is not a valid seed value). Otherwise the m field 373 contains a valid value as explained in Section 4.2.3. Similarly, 374 when no G parameter is to be carried in the FEC OTI, the G field is 375 set to 0 (which is not a valid seed value). Otherwise the G field 376 contains a valid value as explained in Section 4.2.3. When neither m 377 nor G are to be carried in the FEC OTI, then the sender simply omits 378 the FEC-OTI-Scheme-Specific-Info attribute. 380 After Base64 encoding, the 2 bytes of the FEC OTI Scheme Specific 381 Information are transformed into a string of 4 printable characters 382 (in the 64-character alphabet) and added to the FEC-OTI-Scheme- 383 Specific-Info attribute. 385 5. Procedures 387 5.1. Determining the Maximum Source Block Length (B) 389 The finite field size parameter, m, defines the number of non zero 390 elements in this field which is equal to: q - 1 = 2^^m - 1. Note 391 that q - 1 is also the theoretical maximum number of encoding symbols 392 that can be produced for a source block. For instance, when m = 8 393 (default): 395 max1_B = 2^^8 - 1 = 255 397 Additionally, a codec MAY impose other limitations on the maximum 398 block size. Yet it is not expected that such limits exist when using 399 the default m = 8 value. This decision MUST be clarified at 400 implementation time, when the target use case is known. This results 401 in a max2_B limitation. 403 Then, B is given by: 405 B = min(max1_B, max2_B) 407 Note that this calculation is only required at the coder, since the B 408 parameter is communicated to the decoder through the FEC OTI. 410 5.2. Determining the Number of Encoding Symbols of a Block 412 The following algorithm, also called "n-algorithm", explains how to 413 determine the actual number of encoding symbols for a given block. 415 AT A SENDER: 417 Input: 419 B: Maximum source block length, for any source block. Section 5.1 420 explains how to determine its value. 422 k: Current source block length. This parameter is given by the 423 block partitioning algorithm. 425 rate: FEC code rate, which is given by the user (e.g. when 426 starting a FLUTE sending application). It is expressed as a 427 floating point value. 429 Output: 431 max_n: Maximum number of encoding symbols generated for any source 432 block 433 n: Number of encoding symbols generated for this source block 435 Algorithm: 437 max_n = floor(B / rate); 439 if (max_n > 2^^m - 1) then return an error ("invalid code rate"); 441 n = floor(k * max_n / B); 443 AT A RECEIVER: 445 Input: 447 B: Extracted from the received FEC OTI 449 max_n: Extracted from the received FEC OTI 451 k: Given by the block partitioning algorithm 453 Output: 455 n 457 Algorithm: 459 n = floor(k * max_n / B); 461 Note that a Reed-Solomon decoder does not need to know the n value. 462 Therefore the receiver part of the "n-algorithm" is not necessary 463 from the Reed-Solomon decoder point of view. Yet a receiving 464 application using the Reed-Solomon FEC scheme will sometimes need to 465 know the n value used by the sender, for instance for memory 466 management optimizations. To that purpose, the FEC OTI carries all 467 the parameters needed for a receiver to execute the above algorithm. 469 6. Reed-Solomon Codes Specification for the Erasure Channel 471 Reed-Solomon (RS) codes are linear block codes. They also belong to 472 the class of MDS codes. A [n,k]-RS code encodes a sequence of k 473 source elements defined over a finite field GF(q) into a sequence of 474 n encoding elements, where n is upper bounded by q - 1. The 475 implementation described in this document is based on a generator 476 matrix built from a Vandermonde matrix put into systematic form. 478 Section 6.1 to Section 6.3 specify the [n,k]-RS codes when applied to 479 m-bit elements, and Section 6.4 the use of [n,k]-RS codes when 480 applied to symbols composed of several m-bit elements, which is the 481 target of this specification. 483 6.1. Finite Field 485 A finite field GF(q) is defined as a finite set of q elements which 486 has a structure of field. It contains necessarily q = p^^m elements, 487 where p is a prime number. With packet erasure channels, p is always 488 set to 2. The elements of the field GF(2^^m) can be represented by 489 polynomials with binary coefficients (i.e. over GF(2)) of degree 490 lower or equal than m-1. The polynomials can be associated to binary 491 vectors of length m. For example, the vector (11001) represents the 492 polynomial 1 + x + x^^4. This representation is often called 493 polynomial representation. The addition between two elements is 494 defined as the addition of binary polynomials in GF(2) and the 495 multiplication is the multiplication modulo a given irreducible 496 polynomial over GF(2) of degree m with coefficients in GF(2). Note 497 that all the roots of this polynomial are in GF(2^^m) but not in 498 GF(2). 500 A finite field GF(2^^m) is completely characterized by the 501 irreducible polynomial. The following polynomials are chosen to 502 represent the field GF(2^^m), for m varying from 2 to 16: 504 m = 2, "111" (1+x+x^^2) 506 m = 3, "1101", (1+x+x^^3) 508 m = 4, "11001", (1+x+x^^4) 510 m = 5, "101001", (1+x^^2+x^^5) 512 m = 6, "1100001", (1+x+x^^6) 514 m = 7, "10010001", (1+x^^3+x^^7) 515 m = 8, "101110001", (1+x^^2+x^^3+x^^4+x^^8) 517 m = 9, "1000100001", (1+x^^4+x^^9) 519 m = 10, "10010000001", (1+x^^3+x^^10) 521 m = 11, "101000000001", (1+x^^2+x^^11) 523 m = 12, "1100101000001", (1+x+x^^4+x^^6+x^^12) 525 m = 13, "11011000000001", (1+x+x^^3+x^^4+x^^13) 527 m = 14, "110000100010001", (1+x+x^^6+x^^10+x^^14) 529 m = 15, "1100000000000001", (1+x+x^^15) 531 m = 16, "11010000000010001", (1+x+x^^3+x^^12+x^^16) 533 In order to facilitate the implementation, these polynomials are also 534 primitive. This means that any element of GF(2^^m) can be expressed 535 as a power of a given root of this polynomial. These polynomials are 536 also chosen so that they contain the minimum number of monomials. 538 6.2. Reed-Solomon Encoding Algorithm 540 6.2.1. Encoding Principles 542 Let s = (s_0, ..., s_{k-1}) be a source vector of k elements over 543 GF(2^^m). Let e = (e_0, ..., e_{n-1}) be the corresponding encoding 544 vector of n elements over GF(2^^m). Being a linear code, encoding is 545 performed by multiplying the source vector by a generator matrix, GM, 546 of k rows and n columns over GF(2^^m). Thus: 548 e = s * GM. 550 The definition of the generator matrix completely characterizes the 551 RS code. 553 Let us consider that: n = 2^^m - 1 and: 0 < k <= n. Let us denote by 554 alpha the root of the primitive polynomial of degree m chosen in the 555 list of Section 6.1 for the corresponding value of m. Let us 556 consider a Vandermonde matrix of k rows and n columns, denoted by 557 V_{k,n}, and built as follows: the {i, j} entry of V_{k,n} is v_{i,j} 558 = alpha^^(i*j), where 0 <= i <= k - 1 and 0 <= j <= n - 1. This 559 matrix generates a MDS code. However, this MDS code is not 560 systematic, which is a problem for many networking applications. To 561 obtain a systematic matrix (and code), the simplest solution consists 562 in considering the matrix V_{k,k} formed by the first k columns of 563 V_{k,n}, then to invert it and to multiply this inverse by V_{k,n}. 564 Clearly, the product V_{k,k}^^-1 * V_{k,n} contains the identity 565 matrix I_k on its first k columns, meaning that the first k encoding 566 elements are equal to source elements. Besides the associated code 567 keeps the MDS property. 569 Therefore, the generator matrix of the code considered in this 570 document is: 572 GM = (V_{k,k}^^-1) * V_{k,n} 574 Note that, in practice, the [n,k]-RS code can be shortened to a 575 [n',k]-RS code, where k <= n' < n, by considering the sub-matrix 576 formed by the n' first columns of GM. 578 6.2.2. Encoding Complexity 580 Encoding can be performed by first pre-computing GM and by 581 multiplying the source vector (k elements) by GM (k rows and n 582 columns). The complexity of the pre-computation of the generator 583 matrix can be estimated as the complexity of the multiplication of 584 the inverse of a Vandermonde matrix by n-k vectors (i.e. the last n-k 585 columns of V_{k,n}). Since the complexity of the inverse of a k*k- 586 Vandermonde matrix by a vector is O(k * log^^2(k)), the generator 587 matrix can be computed in 0((n-k)* k * log^^2(k)) operations. When 588 the genarator matrix is pre-computed, the encoding needs k operations 589 per repair element (vector-matrix multiplication). 591 Encoding can also be performed by first computing the product s * 592 V_{k,k}^^-1 and then by multiplying the result with V_{k,n}. The 593 multiplication by the inverse of a square Vandermonde matrix is known 594 as the interpolation problem and its complexity is O(k * log^^2 (k)). 595 The multiplication by a Vandermonde matrix, known as the multipoint 596 evaluation problem, requires O((n-k) * log(k)) by using Fast Fourier 597 Transform, as explained in [11]. The total complexity of this 598 encoding algorithm is then O((k/(n-k)) * log^^2(k) + log(k)) 599 operations per repair element. 601 6.3. Reed-Solomon Decoding Algorithm 603 6.3.1. Decoding Principles 605 The Reed-Solomon decoding algorithm for the erasure channel allows 606 the recovery of the k source elements from any set of k received 607 elements. It is based on the fundamental property of the generator 608 matrix which is such that any k*k-submatrix is invertible (see [5]). 609 The first step of the decoding consists in extracting the k*k 610 submatrix of the generator matrix obtained by considering the columns 611 corresponding to the received elements. Indeed, since any encoding 612 element is obtained by multiplying the source vector by one column of 613 the generator matrix, the received vector of k encoding elements can 614 be considered as the result of the multiplication of the source 615 vector by a k*k submatrix of the generator matrix. Since this 616 submatrix is invertible, the second step of the algorithm is to 617 invert this matrix and to multiply the received vector by the 618 obtained matrix to recover the source vector. 620 6.3.2. Decoding Complexity 622 The decoding algorithm described previously includes the matrix 623 inversion and the vector-matrix multiplication. With the classical 624 Gauss-Jordan algorithm, the matrix inversion requires O(k^^3) 625 operations and the vector-matrix multiplication is performed in 626 O(k^^2) operations. 628 This complexity can be improved by considering that the received 629 submatrix of GM is the product between the inverse of a Vandermonde 630 matrix (V_(k,k)^^-1) and another Vandermonde matrix (denoted by V' 631 which is a submatrix of V_(k,n)). The decoding can be done by 632 multiplying the received vector by V'^^-1 (interpolation problem with 633 complexity O( k * log^^2(k)) ) then by V_{k,k} (multipoint evaluation 634 with complexity O(k * log(k))). The global decoding complexity is 635 then O(log^^2(k)) operations per source element. 637 6.4. Implementation for the Packet Erasure Channel 639 In a packet erasure channel, each packet (and symbol(s) since packets 640 contain G >= 1 symbols) is either correctly received or erased. The 641 location of the erased symbols in the sequence of symbols must be 642 known. The following specification describes the use of Reed-Solomon 643 codes for generating redundant symbols from the k source symbols and 644 to recover the source symbols from any set of k received symbols. 646 The k source symbols of a source block are assumed to be composed of 647 S m-bit elements. Each m-bit element is associated to an element of 648 the finite field GF(2^^m) through the polynomial representation 649 (Section 6.1). If some of the source symbols contain less than S 650 elements, they are virtually padded with zero elements (it can be the 651 case for the last symbol of the last block of the object). 653 The encoding process produces n-k repair symbols of size S m-bit 654 elements, the k source symbols being also part of the n encoding 655 symbols (Figure 5). These repair symbols are created m-bit element 656 per m-bit element. More specifically, the j-th source vector is 657 composed of the j-th element of each of the source symbols. 658 Similarly, the j-th encoding vector is composed of the j-th element 659 of each encoding symbol. 661 n 662 +-+-+----+-+ +---------------+ +-+-+-----------+-+ 663 0 | | | | | | | | | | | | 664 | | | | | * | generator | = | | | | | 665 | | | | | | matrix | | | | | | 666 | | | | | | GM | | | | | | 667 source +--------------+ | (k x n) | +---------------------+ 668 vector | | | | | | | +---------------+ ->| | | | | | | 669 j +--------------+ / +---------------------+ 670 | | | | | / | | | | | 671 | | | | | encoding | | | | | 672 | | | | | vector | | | | | 673 | | | | | j | | | | | 674 | | | | | | | | | | 675 S-1 | | | | | | | | | | 676 +-+-+----+-+ +-+-+-----------+-+ 677 k source symbols n encoding symbols 678 (source + repair) 680 Figure 5: Packet encoding scheme 682 An asset of this scheme is that the loss of some encoding symbols 683 produces the same erasure pattern for each of the S encoding vectors. 684 It follows that the matrix inversion must be done only once and will 685 be used by all the S encoding vectors. For large S, this matrix 686 inversion cost becomes negligible in front of the S matrix-vector 687 multiplications. 689 Another asset is that the n-k repair symbols can be produced on 690 demand. For instance, a sender can start by producing a limited 691 number of repair symbols and later on, depending on the observed 692 erasures on the channel, decide to produce additional repair symbols, 693 up to the n-k upper limit. Indeed, to produce the repair symbol e_j, 694 where k <= j < n, it is sufficient to multiply the S source vectors 695 with column j of GM. 697 7. Security Considerations 699 The security considerations for this document are the same as that of 700 [2]. 702 8. IANA Considerations 704 Values of FEC Encoding IDs and FEC Instance IDs are subject to IANA 705 registration. For general guidelines on IANA considerations as they 706 apply to this document, see [2]. This document assigns the Fully- 707 Specified FEC Encoding ID 2 under the ietf:rmt:fec:encoding name- 708 space to "Reed-Solomon Codes". 710 9. Acknowledgments 712 The authors want to thank Luigi Rizzo for comments on the subject and 713 for the design of the reference Reed-Solomon codec. 715 10. References 717 10.1. Normative References 719 [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement 720 Levels", RFC 2119. 722 [2] Watson, M., Luby, M., and L. Vicisano, "Forward Error 723 Correction (FEC) Building Block", 724 draft-ietf-rmt-fec-bb-revised-04.txt (work in progress), 725 September 2006. 727 [3] Luby, M., Vicisano, L., Gemmell, J., Rizzo, L., Handley, M., 728 and J. Crowcroft, "The Use of Forward Error Correction (FEC) in 729 Reliable Multicast", RFC 3453, December 2002. 731 10.2. Informative References 733 [4] Rizzo, L., "Reed-Solomon FEC codec (revised version of July 734 2nd, 1998), available at 735 http://info.iet.unipi.it/~luigi/vdm98/vdm980702.tgz", 736 July 1998. 738 [5] Mac Williams, F. and N. Sloane, "The Theory of Error Correcting 739 Codes", North Holland, 1977 . 741 [6] Luby, M., Shokrollahi, A., Watson, M., and T. Stockhammer, 742 "Raptor Forward Error Correction Scheme", Internet 743 Draft draft-ietf-rmt-bb-fec-raptor-object-04 (work in 744 progress), June 2006. 746 [7] Roca, V., Neumann, C., and D. Furodet, "Low Density Parity 747 Check (LDPC) Forward Error Correction", 748 draft-ietf-rmt-bb-fec-ldpc-04.txt (work in progress), 749 December 2006. 751 [8] Luby, M., Watson, M., and L. Vicisano, "Asynchronous Layered 752 Coding (ALC) Protocol Instantiation", 753 draft-ietf-rmt-pi-alc-revised-03.txt (work in progress), 754 April 2006. 756 [9] Adamson, B., Bormann, C., Handley, M., and J. Macker, 757 "Negative-acknowledgment (NACK)-Oriented Reliable Multicast 758 (NORM) Protocol", draft-ietf-rmt-pi-norm-revised-03.txt (work 759 in progress), September 2006. 761 [10] Paila, T., Walsh, R., Luby, M., Lehtonen, R., and V. Roca, 762 "FLUTE - File Delivery over Unidirectional Transport", 763 draft-ietf-rmt-flute-revised-02.txt (work in progress), 764 August 2006. 766 [11] Gohberg, I. and V. Olshevsky, "Fast algorithms with 767 preprocessing for matrix-vector multiplication problems", 768 Journal of Complexity, pp. 411-427, vol. 10, 1994 . 770 Authors' Addresses 772 Jerome Lacan 773 ENSICA/LAAS-CNRS 774 1, place Emile Blouin 775 Toulouse 31056 776 France 778 Email: jerome.lacan@ensica.fr 779 URI: http://dmi.ensica.fr/auteur.php3?id_auteur=5 781 Vincent Roca 782 INRIA 783 655, av. de l'Europe 784 Zirst; Montbonnot 785 ST ISMIER cedex 38334 786 France 788 Email: vincent.roca@inrialpes.fr 789 URI: http://planete.inrialpes.fr/~roca/ 791 Jani Peltotalo 792 Tampere University of Technology 793 P.O. Box 553 (Korkeakoulunkatu 1) 794 Tampere FIN-33101 795 Finland 797 Email: jani.peltotalo@tut.fi 798 URI: http://atm.tut.fi/mad 800 Sami Peltotalo 801 Tampere University of Technology 802 P.O. Box 553 (Korkeakoulunkatu 1) 803 Tampere FIN-33101 804 Finland 806 Email: sami.peltotalo@tut.fi 807 URI: http://atm.tut.fi/mad 809 Full Copyright Statement 811 Copyright (C) The IETF Trust (2006). 813 This document is subject to the rights, licenses and restrictions 814 contained in BCP 78, and except as set forth therein, the authors 815 retain all their rights. 817 This document and the information contained herein are provided on an 818 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 819 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 820 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 821 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 822 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 823 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 825 Intellectual Property 827 The IETF takes no position regarding the validity or scope of any 828 Intellectual Property Rights or other rights that might be claimed to 829 pertain to the implementation or use of the technology described in 830 this document or the extent to which any license under such rights 831 might or might not be available; nor does it represent that it has 832 made any independent effort to identify any such rights. Information 833 on the procedures with respect to rights in RFC documents can be 834 found in BCP 78 and BCP 79. 836 Copies of IPR disclosures made to the IETF Secretariat and any 837 assurances of licenses to be made available, or the result of an 838 attempt made to obtain a general license or permission for the use of 839 such proprietary rights by implementers or users of this 840 specification can be obtained from the IETF on-line IPR repository at 841 http://www.ietf.org/ipr. 843 The IETF invites any interested party to bring to its attention any 844 copyrights, patents or patent applications, or other proprietary 845 rights that may cover technology that may be required to implement 846 this standard. Please address the information to the IETF at 847 ietf-ipr@ietf.org. 849 Acknowledgment 851 Funding for the RFC Editor function is provided by the IETF 852 Administrative Support Activity (IASA).