Forward Error Correction (FEC)

topics: Programming

A technique to recover the error occurring in data storage, data transfer, without having to retransmit the original data. This is mostly used in Deep Space communication, CD/DVD storage, udpcast, etc.

FEC works by adding redundant information to the original data, which can be used to reconstruct the lost or corrupted data. The amount of redundant information added depends on the level of error correction required.

There are a few different types of FEC (forward error correction), that works on different type of cases. Some of the common types of FEC are as follows:

  1. Block codes: In block codes, a group of bits is taken together and checked for errors. If an error is found, the entire group is retransmitted.
  2. Convolutional codes: In convolutional codes, each bit is encoded along with its neighbouring bits. This provides more redundancy and the ability to detect and correct errors in real-time.
  3. Turbo codes: Turbo codes are a type of convolutional code that uses multiple encoders and decoders to provide even greater error correction capabilities.
  4. Reed-Solomon codes: Reed-Solomon codes are used specifically for correcting errors in data stored on disks, CDs, and other digital media. They can correct errors on a byte-by-byte basis. This is useful in case of burst packet loss.

Overall, the choice of FEC depends on the application and the specific type of error that needs to be corrected.

Reed Solomon codes are used in situations where errors occur in bursts, such as in CD/DVD storage. These codes add extra parity bits to the data, allowing the receiver to recover the original data even if a few bits are lost due to a burst error.

Convolutional codes are used in situations where errors occur randomly, such as in wireless communication. These codes add redundancy by using a sliding window to encode the data, which allows the receiver to correct random errors in the received data.

By using both Reed Solomon and Convolutional codes, the chances of data loss due to errors can be minimized. However, this also means that more redundant information is added, which increases the amount of network bandwidth required for data transmission.

Other types of network coding

FEC libraries

Cli tools

Libraries

Cauchy Caterpillar

GitHub - catid/CauchyCaterpillar: Cauchy Caterpillar : O(N^2) Short-Window Streaming Erasure Code

This is something that superseds the shorthair thingy
GitHub - catid/shorthair: Shorthair : Generational Block Streaming Erasure Codes
There is a limit on data rate (< 2000 packets/second)
GitHub - catid/leopard: Leopard-RS : O(N Log N) MDS Reed-Solomon Block Erasure Code for Large Data

Wirehair

GitHub - catid/wirehair: Wirehair : O(N) Fountain Code for Large Data

Requirements

Tuning guides

FEC modes

Options

Error correction for UDP transmission? : r/learnpython
useful info on the implementation

the error distance must be below the group size at all times to prevent data loss. I would rather suggest to encode the RS data within the chunks to prevent multiple dropped packets in a row automatically resulting in data loss. Like with the reedsolomon library, that allows you to set the chunksize to the MTU of your network packet (I would go a little lower in case you're sending this over the internet, like 1300 or so). Then the amount of failed packets as a total counts, not in what pattern they appeared.

Generated Flashcards

#flashcards

What is Forward Error Correction? :: A technique to recover the error occurring in data storage, data transfer, without having to retransmit the original data.

What are Block codes? :: In block codes, a group of bits is taken together and checked for errors. If an error is found, the entire group is retransmitted.

What are Convolutional codes? :: In convolutional codes, each bit is encoded along with its neighbouring bits. This provides more redundancy and the ability to detect and correct errors in real-time.

What are Turbo Codes? :: Turbo codes are a type of convolutional code that uses multiple encoders and decoders to provide even greater error correction capabilities.

When do Reed Solomon Codes apply?:: Reed Solomon codes are used specifically for correcting errors in data stored on disks, CDs, and other digital media. They can correct errors on a byte-by-byte basis

Which type of FEC works on burst lost cases? :: Reed Solomon

Which type of FEC works on random packet lost cases? :: Convolutional code

What are the benefits of using both types of FEC together? :: Minimise chances of data loss

What are some drawbacks when using both types of FEC together?:: Incur more network bandwidth