 1/draftietfrmtbbfecrs00.txt 20060626 22:12:42.000000000 +0200
+++ 2/draftietfrmtbbfecrs01.txt 20060626 22:12:42.000000000 +0200
@@ 1,22 +1,22 @@
Reliable Multicast Transport J. Lacan
InternetDraft ENSICA/LAASCNRS
Expires: August 27, 2006 V. Roca
+Expires: December 25, 2006 V. Roca
INRIA
J. Peltotalo
S. Peltotalo
Tampere University of Technology
 February 23, 2006
+ June 23, 2006
ReedSolomon Forward Error Correction (FEC)
 draftietfrmtbbfecrs00.txt
+ draftietfrmtbbfecrs01.txt
Status of this Memo
By submitting this InternetDraft, each author represents that any
applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79.
InternetDrafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
@@ 27,246 +27,266 @@
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use InternetDrafts as reference
material or to cite them other than as "work in progress."
The list of current InternetDrafts can be accessed at
http://www.ietf.org/ietf/1idabstracts.txt.
The list of InternetDraft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.
 This InternetDraft will expire on August 27, 2006.
+ This InternetDraft will expire on December 25, 2006.
Copyright Notice
Copyright (C) The Internet Society (2006).
Abstract
This document describes a FullySpecified FEC scheme for the Reed
 Solomon forward error correction code and its application to reliable
 delivery of data objects on the packet erasure channel.
+ Solomon forward error correction code and its application to the
+ reliable delivery of data objects on the packet erasure channel.
 The ReedSolomon codes belong to the class of Maximum Distance
 Separable (MDS) codes, i.e, they enable a receiver to recover the k
 source symbols from any set of k received symbols.
+ ReedSolomon codes belong to the class of Maximum Distance Separable
+ (MDS) codes, i.e. they enable a receiver to recover the k source
+ symbols from any set of k received symbols.
 The implementation described here is compatible with the IPRfree
+ The implementation described here is compatible with the
implementation from Luigi Rizzo.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4
3. Definitions Notations and Abbreviations . . . . . . . . . . . 5
3.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 5
3.2. Notations . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3. Abbreviations . . . . . . . . . . . . . . . . . . . . . . 6
4. Formats and Codes . . . . . . . . . . . . . . . . . . . . . . 7
 4.1. FEC Payload IDs . . . . . . . . . . . . . . . . . . . . . 7
 4.2. FEC Object Transmission Information . . . . . . . . . . . 7
 4.2.1. Mandatory Elements . . . . . . . . . . . . . . . . . . 7
 4.2.2. Common Elements . . . . . . . . . . . . . . . . . . . 7
+ 4.1. FEC Payload ID . . . . . . . . . . . . . . . . . . . . . . 7
+ 4.2. FEC Object Transmission Information . . . . . . . . . . . 8
+ 4.2.1. Mandatory Elements . . . . . . . . . . . . . . . . . . 8
+ 4.2.2. Common Elements . . . . . . . . . . . . . . . . . . . 8
4.2.3. SchemeSpecific Elements . . . . . . . . . . . . . . . 8
 4.2.4. Encoding Format . . . . . . . . . . . . . . . . . . . 8
 5. Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . 10
 5.1. Determining the Maximum Source Block Length (B) . . . . . 10
 5.2. Determining the Number of Encoding Symbols of a Block . . 10
 6. ReedSolomon Codes . . . . . . . . . . . . . . . . . . . . . . 12
 6.1. Finite field . . . . . . . . . . . . . . . . . . . . . . . 12
 6.2. ReedSolomon Encoding Algorithm . . . . . . . . . . . . . 13
 6.2.1. Encoding Complexity . . . . . . . . . . . . . . . . . 14
 6.3. ReedSolomon Decoding Algorithm for the Erasure Channel . 14
 6.3.1. Decoding Complexity . . . . . . . . . . . . . . . . . 14
 6.4. Implementation . . . . . . . . . . . . . . . . . . . . . . 15
 6.4.1. Implementation for the Packet Erasure Channel . . . . 15
 7. Security Considerations . . . . . . . . . . . . . . . . . . . 17
 8. Intellectual Property . . . . . . . . . . . . . . . . . . . . 18
 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19
 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20
 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 21
 11.1. Normative References . . . . . . . . . . . . . . . . . . . 21
 11.2. Informative References . . . . . . . . . . . . . . . . . . 21
 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22
 Intellectual Property and Copyright Statements . . . . . . . . . . 23
+ 4.2.4. Encoding Format . . . . . . . . . . . . . . . . . . . 9
+ 5. Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . 11
+ 5.1. Determining the Maximum Source Block Length (B) . . . . . 11
+ 5.2. Determining the Number of Encoding Symbols of a Block . . 11
+ 6. ReedSolomon Codes Specification for the Erasure Channel . . . 13
+ 6.1. Finite Field . . . . . . . . . . . . . . . . . . . . . . . 13
+ 6.2. ReedSolomon Encoding Algorithm . . . . . . . . . . . . . 14
+ 6.2.1. Encoding Principles . . . . . . . . . . . . . . . . . 14
+ 6.2.2. Encoding Complexity . . . . . . . . . . . . . . . . . 15
+ 6.3. ReedSolomon Decoding Algorithm . . . . . . . . . . . . . 15
+ 6.3.1. Decoding Principles . . . . . . . . . . . . . . . . . 15
+ 6.3.2. Decoding Complexity . . . . . . . . . . . . . . . . . 16
+ 6.4. Implementation for the Packet Erasure Channel . . . . . . 16
+ 7. Security Considerations . . . . . . . . . . . . . . . . . . . 18
+ 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19
+ 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20
+ 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 21
+ 10.1. Normative References . . . . . . . . . . . . . . . . . . . 21
+ 10.2. Informative References . . . . . . . . . . . . . . . . . . 21
+ Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 23
+ Intellectual Property and Copyright Statements . . . . . . . . . . 24
1. Introduction
The use of Forward Error Correction (FEC) codes is a classical
solution to improve the reliability of multicast and broadcast
 transmissions. The [RFC3452] and [draftietfrmtfecbbrevised03]
 documents describe a general framework to use FEC in Content Delivery
 Protocols (CDP). The companion document [RFC3453] describes some
 applications of FEC codes for content delivery.
+ transmissions. The [2] document describes a general framework to use
+ FEC in Content Delivery Protocols (CDP). The companion document [3]
+ describes some applications of FEC codes for content delivery.
 Recent FEC schemes like [draftietfrmtbbfecraptorobject03] and
 [draftietfrmtbbfecldpc01] proposed erasure codes based on
 sparse graphs/matrices. These codes are efficient in terms of CPU
 but not optimal in terms of correction capabilities, at least for
 small objects.
+ Recent FEC schemes like [6] and [7] proposed erasure codes based on
+ sparse graphs/matrices. These codes are efficient in terms of
+ processing but not optimal in terms of correction capabilities when
+ dealing with "small" objects.
 The FEC scheme presented in this document belongs to the class of
 MaximumDistance Separable codes, i.e., it is optimal in terms of
 erasure correction capability. In others words, it enables the
 receiver to recover the k source symbols from any set of k encoding
+ The FEC scheme described in this document belongs to the class of
+ Maximum Distance Separable codes that are optimal in terms of erasure
+ correction capability. In others words, it enables a receiver to
+ recover the k source symbols from any set of exactly k encoding
symbols. Even if the encoding/decoding complexity is larger than
 that of [draftietfrmtbbfecraptorobject03] or
 [draftietfrmtbbfecldpc01], this family of codes is very useful
 for applications sending small objects (e.g., for video and audio
 streaming).
+ that of [6] or [7], this family of codes is very useful.
 Indeed many applications dealing with content transmission or content
+ Many applications dealing with content transmission or content
storage already rely on packetbased ReedSolomon codes. In
 particular, many of them are derived from the implementation of Luigi
 Rizzo [RSRizzo]. This latter is compatible with the ReedSolomon
 codes specification of the present document.
+ particular, many of them use the ReedSolomon codec of Luigi Rizzo
+ [4]. The goal of the present document to specify an implementation
+ of ReedSolomon codes that is compatible with this codec.
2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
 document are to be interpreted as described in RFC 2119 [rfc2119].
+ document are to be interpreted as described in RFC 2119 [1].
3. Definitions Notations and Abbreviations
3.1. Definitions
This document uses the same terms and definitions as those specified
 in [draftietfrmtfecbbrevised03]. Additionally, it uses the
 following definitions:
+ in [2]. Additionally, it uses the following definitions:
Source symbol: unit of data used during the encoding process.
Encoding symbol: unit of data generated by the encoding process.
 Repair symbol: encoding symbols that are not source symbols.
+ Repair symbol: encoding symbol that is not a source symbol.
 Systematic code: a code in which the source symbols are part of
 the encoding symbols
+ Systematic code: FEC code in which the source symbols are part of
+ the encoding symbols.
Source block: a block of k source symbols that are considered
together for the encoding.
Encoding Symbol Group: a group of encoding symbols that are sent
 together, within the same packet, and whose relationships to the
 source object can be derived from a single Encoding Symbol ID.
+ together within the same packet, and whose relationships to the
+ source block can be derived from a single Encoding Symbol ID.
 Source Packet a data packet containing only source symbols.
+ Source Packet: a data packet containing only source symbols.
 Repair Packet a data packet containing only repair symbols.
+ Repair Packet: a data packet containing only repair symbols.
3.2. Notations
This document uses the following notations:
 L denotes the object transfer length in bytes
+ L denotes the object transfer length in bytes.
 k denotes the number of source symbols in a source block
+ k denotes the number of source symbols in a source block.
n_r denotes the number of repair symbols generated for a source
 block
+ block.
 n denotes the encoding block length, i.e., the number of encoding
 symbols generated for a source block. Then n = k+ n_r
+ n denotes the encoding block length, i.e. the number of encoding
+ symbols generated for a source block. Therefore: n = k + n_r.
 max_n Maximum Number of Encoding Symbols generated for any source
 block
+ max_n denotes the maximum number of encoding symbols generated for
+ any source block.
+
+ B denotes the maximum source block length in symbols, i.e. the
+ maximum number of source symbols per source block.
 B denotes the maximum source block length in symbols, i.e., the
 maximum number of source symbols per source block
N denotes the number of source blocks into which the object shall
 be partitioned
+ be partitioned.
 E denotes the encoding symbol length in bytes
+ E denotes the encoding symbol length in bytes.
 sz denotes the symbol size in units of m bit elements
+ S denotes the symbol size in units of m bit elements. When m = 8,
+ then S and E are equal.
 m defines the number of elements in the finite field, namely q 2^^m.
+ m defines the length of the elements in the finite field, in bits.
 G denotes the number of encoding symbols per group, i.e., the
 number of symbols sent in the same packet
+ q defines the number of elements in the finite field. We have: q
+ = 2^^m in this specification.
 rate denotes the socalled "code rate", i.e. the k/n ratio
+ G denotes the number of encoding symbols per group, i.e. the
+ number of symbols sent in the same packet.
 a^^b denotes a raised to the power b
+ GM denotes the Generator Matrix of a ReedSolomon code.
 a^^1 denotes the inverse of a
+ rate denotes the "code rate", i.e. the k/n ratio.
 I_k denotes the k*k identity matrix
+ a^^b denotes a raised to the power b.
+
+ a^^1 denotes the inverse of a.
+
+ I_k denotes the k*k identity matrix.
3.3. Abbreviations
This document uses the following abbreviations:
 ESI Encoding Symbol ID
+ ESI stands for Encoding Symbol ID.
 RS ReedSolomon
+ FEC OTI stands for FEC Object Transmission Information.
 MDS Maximum Distance Separable code
+ RS stands for ReedSolomon.
 GF(q) finite field (A.K.A. Galois Field) with q elements
+ MDS stands for Maximum Distance Separable code.
+
+ GF(q) denotes a finite field (A.K.A. Galois Field) with q
+ elements. We assume that q = 2^^m in this document.
4. Formats and Codes
4.1. FEC Payload IDs
+4.1. FEC Payload ID
The FEC Payload ID is composed of the Source Block Number and the
 Encoding Symbol ID:
+ Encoding Symbol ID. The length of these two fields depends on the
+ parameter m (which is transmitted in the FEC OTI) as follows :
 o The Source Block Number (16 bit field) identifies from which
+ o The Source Block Number (32m bit field) identifies from which
source block of the object the encoding symbol(s) in the payload
 is (are) generated. There is a maximum of 2^^16 blocks per
+ is (are) generated. There are a maximum of 2^^(32m) blocks per
object.
 o The Encoding Symbol ID (16 bit field) identifies which specific
 encoding symbol generated from the source block is carried in the
 packet payload. There is a maximum of 2^^16 encoding symbols per
 block. The first k values (0 to k1) identify source symbols, the
 remaining nk values identify repair symbols.
+ o The Encoding Symbol ID (m bit field) identifies which specific
+ encoding symbol(s) generated from the source block is(are) carried
+ in the packet payload. There are a maximum of 2^^m encoding
+ symbols per block. The first k values (0 to k  1) identify
+ source symbols, the remaining nk values identify repair symbols.
 There MUST be exactly one FEC Payload ID per packet. In case of an
 Encoding Symbol Group, when multiple encoding symbols are sent in the
 same packet, the FEC Payload ID refers to the first symbol of the
 packet. The other symbols can be deduced from the ESI of the first
 symbol by incrementing sequentially the ESI.
+ There MUST be exactly one FEC Payload ID per source or repair packet.
+ In case of an Encoding Symbol Group, when multiple encoding symbols
+ are sent in the same packet, the FEC Payload ID refers to the first
+ symbol of the packet. The other symbols can be deduced from the ESI
+ of the first symbol by incrementing sequentially the ESI.
+
+ The format of the FEC Payload ID for m = 8 and m = 16 is illustrated
+ in Figure 1 and Figure 2 respectively.
0 1 2 3
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
+++++++++++++++++++++++++++++++++
  Source Block Number (16 bits)  Encoding Symbol ID (16 bits) 
+  Source Block Number (328=24 bits)  Enc. Symb. ID 
+++++++++++++++++++++++++++++++++
 Figure 1: FEC Payload ID encoding format for FEC Encoding ID XX
+ Figure 1: FEC Payload ID encoding format for m = 8 (default)
+
+ 0 1 2 3
+ 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
+ +++++++++++++++++++++++++++++++++
+  Src Block Nb (3216=16 bits)  Enc. Symbol ID (m=16 bits) 
+ +++++++++++++++++++++++++++++++++
+
+ Figure 2: FEC Payload ID encoding format for m = 16
4.2. FEC Object Transmission Information
4.2.1. Mandatory Elements
o FEC Encoding ID: the FullySpecified FEC Scheme described in this
 document use the FEC Encoding ID XX.
+ document uses FEC Encoding ID XX.
4.2.2. Common Elements
 The following elements MUST be defined with the present FEC Scheme:
+ The following elements MUST be defined with the present FEC scheme:
o TransferLength (L): a nonnegative integer indicating the length
of the object in bytes. There are some restrictions on the
maximum TransferLength that can be supported:
 max_transfer_length = 2^^16 * B * E
+ max_transfer_length = 2^^(32m) * B * E
 For instance, if B = 2^^81 (because the codec operates on a
 finite field with 2^^8 elements), and if E = 1024 bytes, then the
 maximum transfer length is 2^^34 bytes (i.e., a bit more than 17
 Giga Bytes). For larger objects, it is expected that other FEC
 codes (e.g., LDPC codes) or another ReedSolomon FEC Scheme with a
 larger Source Block Number field in the FEC Payload ID be used.
+ For instance, for m = 8, for B = 2^^8  1 (because the codec
+ operates on a finite field with 2^^8 elements) and if E = 1024
+ bytes, then the maximum transfer length is approximately equal to
+ 2^^42 bytes (i.e. 4 Tera Bytes). Similarly, for m = 16, for B =
+ 2^^16  1 and if E = 1024 bytes, then the maximum transfer length
+ is also approximately equal to 2^^42 bytes. For larger objects,
+ another FEC scheme, with a larger Source Block Number field in the
+ FEC Payload ID, could be defined. Another solution consists in
+ fragmenting large objects into smaller objects, each of them
+ complying with the above limits.
o EncodingSymbolLength (E): a nonnegative integer indicating the
length of each encoding symbol in bytes.
o MaximumSourceBlockLength (B): a nonnegative integer indicating
the maximum number of source symbols in a source block.
o MaxNumberofEncodingSymbols (max_n): a nonnegative integer
indicating the maximum number of encoding symbols generated for
any source block.
@@ 278,89 +298,92 @@
The following element MUST be defined with the present FEC Scheme.
It contains two distinct pieces of information:
o G: a nonnegative integer indicating the number of encoding
symbols per group used for the object. The default value is 1,
meaning that each packet contains exactly one symbol. When no G
parameter is communicated to the decoder, then this latter MUST
assume that G = 1.
 o Finite Field size parameter, m: The m parameter defines the finite
 field size equal to q = p^^m elements. The default value is m 8. When no finite field size parameter is communicated to the
 decoder, then this latter MUST assume that m = 8.
+ o Finite Field parameter, m: The m parameter is the length of the
+ finite field elements, in bits. It also characterizes the number
+ of elements in the finite field: q = 2^^m elements. The default
+ value is m = 8. When no finite field size parameter is
+ communicated to the decoder, then this latter MUST assume that m =
+ 8.
4.2.4. Encoding Format
This section shows two possible encoding formats of the above FEC
 OTI. The present document does not specify when or how these
 encoding formats should be used.
+ OTI. The present document does not specify when one encoding format
+ or the other should be used.
4.2.4.1. Using the General EXT_FTI Format
The FEC OTI binary format is the following, when the EXT_FTI
 mechanism is used.
+ mechanism is used (e.g. within the ALC [8] or NORM [9] protocols).
0 1 2 3
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
+++++++++++++++++++++++++++++++++
 HET = 64  HEL  
+++++++++++++++++ +
 TransferLength (L) 
+++++++++++++++++++++++++++++++++
 m  G  Encoding Symbol Length (E) 
+++++++++++++++++++++++++++++++++
 Max Source Block Length (B)  Max Nb Enc. Symbols (max_n) 
+++++++++++++++++++++++++++++++++
 Figure 2: EXT_FTI Header Format
+ Figure 3: EXT_FTI Header Format
4.2.4.2. Using the FDT Instance (FLUTE specific)
When it is desired that the FEC OTI be carried in the FDT Instance of
 a FLUTE session, the following XML elements must be described for the
 associated object:

 o FECOTITransferlength
+ a FLUTE session [10], the following XML attributes must be described
+ for the associated object:
 o FECOTIEncodingSymbolLength
+ o FECOTITransferLength (L)
 o FECOTIMaximumSourceBlockLength
+ o FECOTIEncodingSymbolLength (E)
+ o FECOTIMaximumSourceBlockLength (B)
 o FECOTIMaxNumberofEncodingSymbols
+ o FECOTIMaxNumberofEncodingSymbols (max_n)
 o FECOTINumberEncodingSymbolsperGroup (optional)
+ o FECOTINumberofEncodingSymbolsperGroup (optional) (G)
 o FECOTIFiniteFieldSizeParameter (optional)
+ o FECOTIFiniteFieldParameter (optional) (m)
 When no finite field size parameter is to be carried in the FEC OTI,
 the sender simply omits the FECOTIFiniteFieldSizeParameter
 element.
+ When no G parameter is to be carried in the FEC OTI, the sender
+ simply omits the FECOTINumberofEncodingSymbolsperGroup
+ attribute. When no Finite Field parameter is to be carried in the
+ FEC OTI, the sender simply omits the FECOTIFiniteFieldParameter
+ attribute.
5. Procedures
 This section defines procedures for FEC Encoding ID XX.

5.1. Determining the Maximum Source Block Length (B)
The finite field size parameter, m, defines the number of non zero
 elements in this field, q = 2^^m1. Note that q is also the
 theoretical maximum number of encoding symbols that can be produced
 for a source block. For instance, when m = 8 (default):
+ elements in this field which is equal to: q  1 = 2^^m  1. Note
+ that q  1 is also the theoretical maximum number of encoding symbols
+ that can be produced for a source block. For instance, when m = 8
+ (default):
 max1_B = 2^^81
+ max1_B = 2^^8  1 = 255
Additionally, a codec MAY impose other limitations on the maximum
block size. Yet it is not expected that such limits exist when using
 m = 8 (default). This decision SHOULD be clarified at implementation
 time, when the target use case is known. This results in a max2_B
 limitation.
+ the default m = 8 value. This decision SHOULD be clarified at
+ implementation time, when the target use case is known. This results
+ in a max2_B limitation.
Then, B is given by:
B = min(max1_B, max2_B)
Note that this calculation is only required at the coder, since the B
parameter is communicated to the decoder through the FEC OTI.
5.2. Determining the Number of Encoding Symbols of a Block
@@ 368,95 +391,98 @@
determine the actual number of encoding symbols for a given block.
AT A SENDER:
Input:
B: Maximum source block length, for any source block. Section 5.1
explains how to determine its value.
k: Current source block length. This parameter is given by the
 source blocking algorithm.
+ block partitioning algorithm.
 rate: FEC code rate, which is given by the user (e.g., when
 starting a FLUTE sending application) for a given use case. It is
 expressed as a floating point value.
+ rate: FEC code rate, which is given by the user (e.g. when
+ starting a FLUTE sending application). It is expressed as a
+ floating point value.
Output:
max_n: Maximum number of encoding symbols generated for any source
block

n: Number of encoding symbols generated for this source block
Algorithm:
max_n = floor(B / rate);
 if (max_n >= 2^^m) then return an error ("invalid code rate");
+ if (max_n > 2^^m  1) then return an error ("invalid code rate");
n = floor(k * max_n / B);
AT A RECEIVER:
Input:
 B Extracted from the received FEC OTI
+ B: Extracted from the received FEC OTI
 max_n Extracted from the received FEC OTI
+ max_n: Extracted from the received FEC OTI
 k Given by the source blocking algorithm
+ k: Given by the block partitioning algorithm
Output:
n
Algorithm:
n = floor(k * max_n / B);
Note that a ReedSolomon decoder does not need to know the n value.
Therefore the receiver part of the "nalgorithm" is not necessary
from the ReedSolomon decoder point of view. Yet a receiving
application using the ReedSolomon FEC scheme will sometimes need to
know the value of n used by the sender, for instance for memory
 management optimizations. To that purpose, all the needed
 information is carried in the FEC OTI.
+ management optimizations. To that purpose, the FEC OTI carries all
+ the parameters needed for a receiver to execute the above algorithm.
6. ReedSolomon Codes
+6. ReedSolomon Codes Specification for the Erasure Channel
 ReedSolomon (RS) codes form a special class of linear block codes,
 which offer maximum erasure correction capability. A [n,k]RS code
 encodes a sequence of k source elements defined over a finite field
 GF(q) into a sequence of n encoding elements, where n is upperbounded
 by q1. The implementation described in this document is based on a
 generator matrix built from a Vandermonde matrix put into systematic
 form.
+ ReedSolomon (RS) codes are linear block codes. They also belong to
+ the class of MDS codes. A [n,k]RS code encodes a sequence of k
+ source elements defined over a finite field GF(q) into a sequence of
+ n encoding elements, where n is upper bounded by q  1. The
+ implementation described in this document is based on a generator
+ matrix built from a Vandermonde matrix put into systematic form.
6.1. Finite field
+ Section 6.1 to Section 6.3 specify the [n,k]RS codes when applied to
+ mbit elements, and Section 6.4 the use of [n,k]RS codes when
+ applied to symbols composed of several mbit elements, which is the
+ target of this specification.
+
+6.1. Finite Field
A finite field GF(q) is defined as a finite set of q elements which
 have a structure of field. It contains necessarily q = p^^m
 elements, where p is a prime number. With packet erasure channels, p
 is always set to 2. The elements of the field GF(2^^m) can be
 represented by polynomials with binary coefficients (i.e., over
 GF(2)) of degree less than m. The polynomials can be associated to
 binary vectors of length m. For example, the vector (11001)
 represents the polynomial 1 + x + x^^4. This representation is often
 called polynomial representation. The addition between two elements
 is defined as the addition of binary polynomials in GF(2) and the
 multiplication is the multiplication modulo a given irreducible
 (i.e., nonfactorizable) polynomial of degree m with coefficients in
 GF(2).
+ has a structure of field. It contains necessarily q = p^^m elements,
+ where p is a prime number. With packet erasure channels, p is always
+ set to 2. The elements of the field GF(2^^m) can be represented by
+ polynomials with binary coefficients (i.e. over GF(2)) of degree less
+ than m. The polynomials can be associated to binary vectors of
+ length m. For example, the vector (11001) represents the polynomial
+ 1 + x + x^^4. This representation is often called polynomial
+ representation. The addition between two elements is defined as the
+ addition of binary polynomials in GF(2) and the multiplication is the
+ multiplication modulo a given irreducible polynomial over GF(2) of
+ degree m with coefficients in GF(2). Note that all the roots of this
+ polynomial are in GF(2^^m) but not in GF(2).
 Since a finite field GF(2^^m) is completely characterized by the
 irreducible polynomial, we propose the following polynomials to
+ A finite field GF(2^^m) is completely characterized by the
+ irreducible polynomial. The following polynomials are chosen to
represent the field GF(2^^m), for m varying from 2 to 16:
m = 2, "111" (1+x+x^^2)
m = 3, "1101", (1+x+x^^3)
m = 4, "11001", (1+x+x^^4)
m = 5, "101001", (1+x^^2+x^^5)
@@ 474,268 +500,293 @@
m = 12, "1100101000001", (1+x+x^^4+x^^6+x^^12)
m = 13, "11011000000001", (1+x+x^^3+x^^4+x^^13)
m = 14, "110000100010001", (1+x+x^^6+x^^10+x^^14)
m = 15, "1100000000000001", (1+x+x^^15)
m = 16, "11010000000010001", (1+x+x^^3+x^^12+x^^16)
 For implementation issues, these polynomials are also primitive
 elements of GF(2^^m), i.e., any element of GF(2^^m) can be expressed
 as a power of a root of this polynomial. These polynomials also
 contain the minimum number of monomials.
+ In order to facilitate the implementation, these polynomials are also
+ primitive. This means that any element of GF(2^^m) can be expressed
+ as a power of a given root of this polynomial. These polynomials are
+ also chosen so that they contain the minimum number of monomials.
6.2. ReedSolomon Encoding Algorithm
 The encoding algorithm produces a vector of n encoding elements
 e=(e_0, ..., e_(n1)) over GF(2^^m) from a source vector of k
 elements s=(s_0, ..., s_(k1) ) over GF(2^^m).
+6.2.1. Encoding Principles
 The linear codes can be encoded by multiplying the source vector by a
 generator matrix Gm of k rows and n columns over GF(2^^m). Thus: e s * Gm. The definition of the generator matrix completely
 characterizes the code.
+ Let s = (s_0, ..., s_{k1}) be a source vector of k elements over
+ GF(2^^m). Let e = (e_0, ..., e_{n1}) be the corresponding encoding
+ vector of n elements over GF(2^^m). Being a linear code, encoding is
+ performed by multiplying the source vector by a generator matrix, GM,
+ of k rows and n columns over GF(2^^m). Thus:
 Let us consider that: n = 2^^m  1 and: 0 < k <= n. Let us denote
 alpha a primitive element of GF(2^^m) (i.e., any element of GF(2^^m)
 can be expressed as a power of alpha).
+ e = s * GM.
 The generator matrix is build from a k*nVandermonde matrix denoted
 by V_{k,n}. The entries of V_{k,n} are v_{i,j} = alpha^^(i*j), where
 0 <= i <= k  1 and 0 <= j <= n  1. This matrix generates a MDS
 code. However, it is not systematic as required by most of network
 applications. To obtain a systematic matrix, the simplest solution
 is to consider the matrix V_{k,k} formed by the first k columns of
 V_{k,n} then to invert it and to multiply this inverse by V_{k,n}.
+ The definition of the generator matrix completely characterizes the
+ RS code.
+
+ Let us consider that: n = 2^^m  1 and: 0 < k <= n. Let us denote
+ alpha the primitive element of GF(2^^m) chosen in the list of
+ Section 6.1 for the corresponding value of m. Let us consider a
+ Vandermonde matrix of k rows and n columns, denoted by V_{k,n}, and
+ built as follows: the {i, j} entry of V_{k,n} is v_{i,j} =
+ alpha^^(i*j), where 0 <= i <= k  1 and 0 <= j <= n  1. This matrix
+ generates a MDS code. However, this MDS code is not systematic,
+ which is a problem for many networking applications. To obtain a
+ systematic matrix (and code), the simplest solution consists in
+ considering the matrix V_{k,k} formed by the first k columns of
+ V_{k,n}, then to invert it and to multiply this inverse by V_{k,n}.
Clearly, the product V_{k,k}^^1 * V_{k,n} contains the identity
 matrix I_k on its first k columns and generates a MDS code.
+ matrix I_k on its first k columns, meaning that the first k encoding
+ elements are equal to source elements. Besides the associated code
+ keeps the MDS property.
 The product V_{k,k}^^1 * V_{k,n} is denoted by Gm and is the
 generator matrix of the code considered in this document.
+ Therefore, the generator matrix of the code considered in this
+ document is:
 Note that, for practical applications, the length of the code can be
 shortened to k <= n' < n by considering the submatrix formed by the
 n' first columns of Gm.
+ GM = (V_{k,k}^^1) * V_{k,n}
6.2.1. Encoding Complexity
+ Note that, in practice, the [n,k]RS code can be shortened to a
+ [n',k]RS code, where k <= n' < n, by considering the submatrix
+ formed by the n' first columns of GM.
 The encoding process can be done by first precomputing G and by
 multiplying the source vector by Gm. The complexity is one
 multiplication s*Gm, where Gm is a k*(nk) matrix. The complexity of
 the vectormatrix multiplication is then k*(nk) (i.e., k operations
 per repair element).
+6.2.2. Encoding Complexity
 The encoding can also be processed by first computing the product s*
 V_{k,k}^^1 and then by multiplying the result by V_{k,n}. The
+ Encoding can be performed by first precomputing GM and by
+ multiplying the source vector (k elements) by GM (k rows and n
+ columns). The complexity of the precomputation of the generator
+ matrix can be estimated as the complexity of the multiplication of
+ the inverse of a Vandermonde matrix by nk vectors (i.e. the last nk
+ columns of V_{k,n}). Since the complexity of the inverse of a k*k
+ Vandermonde matrix by a vector is O(k * log^^2(k)), the generator
+ matrix can be computed in 0((nk)* k * log^^2(k)) operations. When
+ the genarator matrix is precomputed, the encoding needs k operations
+ per repair element (vectormatrix multiplication).
+
+ Encoding can also be performed by first computing the product s *
+ V_{k,k}^^1 and then by multiplying the result with V_{k,n}. The
multiplication by the inverse of a square Vandermonde matrix is known
 as the interpolation problem and its complexity is O(k log^^2 (k)).
+ as the interpolation problem and its complexity is O(k * log^^2 (k)).
The multiplication by a Vandermonde matrix, known as the multipoint
 evaluation problem, requires O((nk) log(k)) by using Fast Fourier
 Transform, as explained in [fastMatrixvectorMultiplication]. The
 total complexity of this encoding algorithm is then O(k/(nk) log^^2
 (k)+ log(k)) operations per repair symbol.
+ evaluation problem, requires O((nk) * log(k)) by using Fast Fourier
+ Transform, as explained in [11]. The total complexity of this
+ encoding algorithm is then O((k/(nk)) * log^^2(k) + log(k))
+ operations per repair element.
6.3. ReedSolomon Decoding Algorithm for the Erasure Channel
+6.3. ReedSolomon Decoding Algorithm
+
+6.3.1. Decoding Principles
The ReedSolomon decoding algorithm for the erasure channel allows
the recovery of the k source elements from any set of k received
elements. It is based on the fundamental property of the generator
 matrix which is such that any k*ksubmatrix is invertible (see
 [MWS]). The first step of the decoding consists in extracting the
 k*k submatrix of the generator matrix obtained by considering the
 columns corresponding to the received symbols. Indeed, since any
 encoding element is obtained by multiplying the source vector by one
 column of the generator matrix, the received vector of k encoding
 symbols can be considered as the result of the multiplication of the
 source vector by a k*k submatrix of the generator matrix. Since this
+ matrix which is such that any k*ksubmatrix is invertible (see [5]).
+ The first step of the decoding consists in extracting the k*k
+ submatrix of the generator matrix obtained by considering the columns
+ corresponding to the received elements. Indeed, since any encoding
+ element is obtained by multiplying the source vector by one column of
+ the generator matrix, the received vector of k encoding elements can
+ be considered as the result of the multiplication of the source
+ vector by a k*k submatrix of the generator matrix. Since this
submatrix is invertible, the second step of the algorithm is to
invert this matrix and to multiply the received vector by the
obtained matrix to recover the source vector.
6.3.1. Decoding Complexity
+6.3.2. Decoding Complexity
The decoding algorithm described previously includes the matrix
inversion and the vectormatrix multiplication. With the classical
GaussJordan algorithm, the matrix inversion requires O(k^^3)
operations and the vectormatrix multiplication is performed in
O(k^^2) operations.
This complexity can be improved by considering that the received
 submatrix of Gm is the product between the inverse of a Vandermonde
+ submatrix of GM is the product between the inverse of a Vandermonde
matrix (V_(k,k)^^1) and another Vandermonde matrix (denoted by V'
which is a submatrix of V_(k,n)). The decoding can be done by
multiplying the received vector by V'^^1 (interpolation problem with
 complexity O( k log^^2(k)) ) then by V_{k,k} (multipoint evaluation
 with complexity O( k log(k)) ). The global decoding complexity is
 then O(log^^2(k)) operations per source symbol.

6.4. Implementation
+ complexity O( k * log^^2(k)) ) then by V_{k,k} (multipoint evaluation
+ with complexity O(k * log(k))). The global decoding complexity is
+ then O(log^^2(k)) operations per source element.
6.4.1. Implementation for the Packet Erasure Channel
+6.4. Implementation for the Packet Erasure Channel
 In a packet erasure channel, each packet is either received correctly
 or erased. The location of the erased packets in the sequence of
 packets must be known. The following specification describes the use
 of ReedSolomon codes for generating redundant packets from k source
 packets and to recover the source packets from k received packets.
+ In a packet erasure channel, each packet (and symbol(s) since packets
+ contain G >= 1 symbols) is either received correctly or erased. The
+ location of the erased symbols in the sequence of symbols must be
+ known. The following specification describes the use of ReedSolomon
+ codes for generating redundant symbols from k source symbols and to
+ recover the source symbols from any set of k received symbols.
The k source symbols of a source block are assumed to be composed of
 sz mbit elements. Each mbit element is associated to an element of
+ S mbit elements. Each mbit element is associated to an element of
the finite field GF(2^^m) through the polynomial representation
 (Section 6.1). If some of the source symbols contain less than sz
+ (Section 6.1). If some of the source symbols contain less than S
elements, they are virtually padded with zero elements (it can be the
case for the last symbol of the last block of the object).
 The encoding processing produces nk repair symbols of sz elements by
 encoding each of the sz encoding vectors from the sz source vectors
 (Figure 3). The jth source vector is composed of the jth element
 of each of the source symbols. Similarly, the jth encoding vector
 is composed of the jth element of each encoding symbol.
+ The encoding process produces nk repair symbols of size S mbit
+ elements, the k source symbols being also part of the n encoding
+ symbols (Figure 4). These repair symbols are created mbit element
+ per mbit element. More specifically, the jth source vector is
+ composed of the jth element of each of the source symbols.
+ Similarly, the jth encoding vector is composed of the jth element
+ of each encoding symbol.
  
            
+ 0            
     *  generator  =     
      matrix      
       Gm      
+       GM      
source    
vector         >      
j  / 
     /     
     encoding     
     vector     
     j     
         
          
+ S1          
 
k source symbols n encoding symbols
+ (source + repair)
 Figure 3: Packet encoding scheme

 An asset of this scheme is that the loss of some of encoding symbols
 produce the same erasure pattern for each of the sz encoding vectors.
+ Figure 4: Packet encoding scheme
+ An asset of this scheme is that the loss of some encoding symbols
+ produces the same erasure pattern for each of the S encoding vectors.
It follows that the matrix inversion must be done only once and will
 be used by all the sz encoding vectors. For large sz, this
 complexity cost of the inversion becomes negligible compared to the
 sz matrixvector multiplications.
+ be used by all the S encoding vectors. For large S, this matrix
+ inversion cost becomes negligible in front of the S matrixvector
+ multiplications.
 Another asset is that repair symbols can be produced on demand, e.g.,
 depending on the observed erasures on the channel. The only
 constraint is the finite field size (see Section 6.1)
+ Another asset is that the nk repair symbols can be produced on
+ demand. For instance, a sender can start by producing a limited
+ number of repair symbols and later on, depending on the observed
+ erasures on the channel, decide to produce additional repair symbols,
+ up to the nk upper limit. Indeed, to produce the repair symbol e_j,
+ where k <= j < n, it is sufficient to multiply the S source vectors
+ with column j of GM.
7. Security Considerations
The security considerations for this document are the same as that of
 [RFC3452].

8. Intellectual Property

 To the best of our knowledge, there is no patent or patent
 application identified as being used in the ReedSolomon FEC scheme.
 Yet other flavors of ReedSolomon codes and associated techniques MAY
 be covered by Intellectual Property Rights.
+ [2].
9. IANA Considerations
+8. IANA Considerations
Values of FEC Encoding IDs and FEC Instance IDs are subject to IANA
registration. For general guidelines on IANA considerations as they
 apply to this document, see [draftietfrmtfecbbrevised03]. This
 document assigns the FullySpecified FEC Encoding ID XX under the
 ietf:rmt:fec:encoding namespace to "ReedSolomon Codes".

10. Acknowledgments
+ apply to this document, see [2]. This document assigns the Fully
+ Specified FEC Encoding ID XX under the ietf:rmt:fec:encoding name
+ space to "ReedSolomon Codes".
11. References
+9. Acknowledgments
11.1. Normative References
+ The authors want to thank Luigi Rizzo for comments on the subject and
+ for the design of the reference ReedSolomon codec.
 [RFC3452] Luby, M., "Forward Error Correction (FEC) Building Block",
 RFC 3452, December 2002.
+10. References
 [RFC3453] Luby, M., "The Use of Forward Error Correction (FEC) in
 Reliable Multicast", RFC 3453, December 2002.
+10.1. Normative References
 [draftietfrmtfecbbrevised03]
 Watson, M., Luby, M., and L. Vicisano, "Forward Error
 Correction (FEC) Building Block",
 draftietfrmtfecbbrevised03.txt (work in progress),
 January 2006.
+ [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement
+ Levels", RFC 2119.
 [rfc2119] Bradner, S., "Key words for use in RFCs to Indicate
 Requirement Levels", RFC 2119.
+ [2] Watson, M., Luby, M., and L. Vicisano, "Forward Error Correction
+ (FEC) Building Block", draftietfrmtfecbbrevised03.txt
+ (work in progress), January 2006.
11.2. Informative References
+ [3] Luby, M., Vicisano, L., Gemmell, J., Rizzo, L., Handley, M., and
+ J. Crowcroft, "The Use of Forward Error Correction (FEC) in
+ Reliable Multicast", RFC 3453, December 2002.
 [MWS] Mac Williams, F. and N. Sloane, "The Theory of Error
 Correcting Codes", North Holland, 1977 .
+10.2. Informative References
 [RSRizzo]
 Rizzo, L., "New version of the FEC code (revised 2 july
 98), available at
+ [4] Rizzo, L., "ReedSolomon FEC codec (revised version of July
+ 2nd, 1998), available at
http://info.iet.unipi.it/~luigi/vdm98/vdm980702.tgz",
July 1998.
 [draftietfrmtbbfecldpc01]
 Roca, V., Neumann, C., and D. Furodet, "Low Density Parity
+ [5] Mac Williams, F. and N. Sloane, "The Theory of Error Correcting
+ Codes", North Holland, 1977 .
+
+ [6] Luby, M., Shokrollahi, A., Watson, M., and T. Stockhammer,
+ "Raptor Forward Error Correction Scheme", Internet
+ Draft draftietfrmtbbfecraptorobject03 (work in
+ progress), October 2005.
+
+ [7] Roca, V., Neumann, C., and D. Furodet, "Low Density Parity
Check (LDPC) Forward Error Correction",
draftietfrmtbbfecldpc01.txt (work in progress),
March 2006.
 [draftietfrmtbbfecraptorobject03]
 Luby, M., "Raptor Forward Error Correction Scheme",
 Internet Draft (draftietfrmtbbfecraptorobject03 :
 work in progress), October 2005.
+ [8] Luby, M., Watson, M., and L. Vicisano, "Asynchronous Layered
+ Coding (ALC) Protocol Instantiation",
+ draftietfrmtpialcrevised03.txt (work in progress),
+ April 2006.
 [fastMatrixvectorMultiplication]
 Gohberg, I. and V. Olshevsky, "Fast algorithms with
+ [9] Adamson, B., Bormann, C., Handley, M., and J. Macker,
+ "Negativeacknowledgment (NACK)Oriented Reliable Multicast
+ (NORM) Protocol", draftietfrmtpinormrevised01.txt (work
+ in progress), March 2006.
+
+ [10] Paila, T., Walsh, R., Luby, M., Lehtonen, R., and V. Roca,
+ "FLUTE  File Delivery over Unidirectional Transport",
+ draftietfrmtfluterevised01.txt (work in progress),
+ January 2006.
+
+ [11] Gohberg, I. and V. Olshevsky, "Fast algorithms with
preprocessing for matrixvector multiplication problems",
Journal of Complexity, pp. 411427, vol. 10, 1994 .
Authors' Addresses
Jerome Lacan
ENSICA/LAASCNRS
1, place Emile Blouin
Toulouse 31056
France
Email: jerome.lacan@ensica.fr
 URI:
+ URI: http://dmi.ensica.fr/auteur.php3?id_auteur=5
Vincent Roca
INRIA
655, av. de l'Europe
Zirst; Montbonnot
ST ISMIER cedex 38334
France
Email: vincent.roca@inrialpes.fr
URI: http://planete.inrialpes.fr/~roca/
Jani Peltotalo
Tampere University of Technology
P.O. Box 553 (Korkeakoulunkatu 1)
Tampere FIN33101
Finland
Email: jani.peltotalo@tut.fi
 URI:
+ URI: http://atm.tut.fi/mad
Sami Peltotalo
Tampere University of Technology
P.O. Box 553 (Korkeakoulunkatu 1)
Tampere FIN33101
Finland
Email: sami.peltotalo@tut.fi
 URI:
+ URI: http://atm.tut.fi/mad
Intellectual Property Statement
The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights. Information
on the procedures with respect to rights in RFC documents can be