2.2.2 ASF Packet Error Correction Data

ASF packets that are transmitted by using the MSB Protocol SHOULD use error correction.<3> If error correction is used, it MUST be done as follows: A parity packet is computed by performing a byte-wise exclusive OR (XOR) operation on some number of consecutive ASF packets. The number of ASF packets that are used to compute the parity packet is referred to as the span.

The span of the parity packet SHOULD be 10. The span of a parity packet MUST be at least 1 and MUST NOT be more than 15. The server SHOULD NOT use a larger span for any parity packet than what was specified by the Default Ecc parameter, if any, in the .nsc file.

The XOR operation that forms the parity packet is computed on the entire ASF packet, except the Error Correction Flags field and the Error Correction Data field of the ASF packet header. These two fields usually occupy the first three bytes of the ASF packet header. For more information about the ASF packet header, see [ASF] section 5.2.1.

Although Error Correction Data is a variable-size field, when error correction is used, all ASF packets in the span MUST have an Error Correction Data field of the same size.

In the parity packet, the Error Correction Flags field and the Error Correction Data field MUST be set in accordance to the rules specified in this section. The remainder of the parity packet MUST consist entirely of the parity data computed through the XOR operation.

If the ASF packets in a span are of variable size, the parity packet MUST be as large as the largest packet in the span. Zero-byte padding MUST be added to the end of the ASF packets, if needed, during the XOR operation, to ensure that the XOR operation is performed on packets of equal size.

The parity packet MUST be transmitted directly following the last packet in the span. As an example, if the span is 10, it means that the eleventh MSB packet will contain an ASF packet that consists of parity data.

If error correction is used for at least some ASF packets, the Error Correction Present bit in the Error Correction Flags field of the ASF header MUST be set to 1. The ASF packets that contain parity data MUST have the Opaque Data Present bit set to 1. That bit MUST be set to 0 on all nonparity ASF packets.

If error correction is not used for an ASF packet and the Error Correction Data field is present in that ASF packet, the 4-bit Type field MUST be set to 0. If error correction is used for an ASF packet, the Error Correction Data field MUST be present, and the Type field MUST be set to 2 for parity packets and to 1 for packets that are not parity packets.

The 4-bit Number field MUST be set to 0 if error correction is not used and the field is present. If error correction is used for an ASF packet, this field MUST be present and it SHOULD be set to the sequence number of the ASF packet in the span. The first ASF packet in the span is number 1. If the span is 10, the last packet in the span has number 10, and the parity packet has number 11. Alternatively, the server MAY set the Number field to 1 in all ASF packets when error correction is used.

The 8-bit Cycle field MUST be set to 0 if error correction is not used and the field is present. If error correction is used, all packets that belong to the same span, including the parity packet, are considered to belong to the same cycle. The Cycle field MUST be set to the same number for all packets that belong to the same cycle, and it MUST be incremented by one for each cycle. The first cycle SHOULD be number 0, but MAY be chosen randomly. For example, if the span is 10, this means that the first 11 ASF packets have the Cycle field set to 0. The next 11 packets have the Cycle field set to 1, and so on.