NanoPing Forward Erasure Correction (FEC) Algorithms
NanoPing supports multiple Forward Erasure Correction (FEC) components designed to mitigate packet loss by introducing redundancy into the data stream. FEC works by adding “repair packets” that can reconstruct lost data without requiring retransmissions, improving reliability in lossy network environments.
The FEC algorithms described here operate with a fixed repair rate. This means the amount of repair data is constant and does not adapt to real-time network conditions. For adaptive FEC, consider using RAFT, a transport protocol provided in NanoPing that dynamically adjusts redundancy based on observed packet loss.
Supported Algorithms
Rely (Sliding Window RLNC)
The Rely encoder and decoder use Steinwurf’s sliding window Random Linear Network Coding (RLNC), which is ideal for bursty or irregular traffic patterns.
Use Case: Suitable for low-latency, real-time applications with variable traffic rates.
Configuration Parameters:
timeout
(ms): Maximum time to wait for missing packets before decoding.release_in_order
(bool): Ensures in-order delivery of packets (increases latency).repair_time_window
(ms): Time window over which repair packets are calculated.repair_target_rate
(float): Ratio of repair packets to source packets (e.g.,0.1
for 10%).max_payloads
: Max number of payloads buffered for encoding.
Example: With a repair_target_rate
of 0.1 and repair_time_window
of 75ms, the encoder creates 10% repair packets for the source packets received within each 75ms window.
RLNC (Block-Based Random Linear Coding)
RLNC provides fixed-block random linear coding, generating a predictable number of repair packets per block.
Use Case: Best suited for consistent data flows where low latency is not critical.
Configuration Parameters:
symbols
: Number of source packets per block.repair
: Number of repair packets added per block.
Example: A configuration of symbols = 10
and repair = 2
adds 2 repair packets after every 10 source packets.
Reed-Solomon
Reed-Solomon is a classic erasure correction code with fixed-block encoding. It is widely used and offers strong correction capabilities.
Use Case: Effective in scenarios with stable and predictable traffic patterns.
Configuration Parameters:
symbols
: Number of source packets per block.repair
: Number of repair packets to generate per block.
Note: Higher values of symbols
and repair
improve resilience but increase overhead and latency.
Parity 2D
The Parity 2D encoder performs row/column-based parity coding using XOR. It creates a grid of packets and adds one parity packet per row and column.
Use Case: Primarily for legacy or broadcast applications with fixed packet matrices.
Configuration Parameters:
rows
: Number of rows in the matrix.columns
: Number of columns in the matrix.
Example: A 5x5 matrix (5 rows, 5 columns) produces 10 parity packets (one per row and column). This method is simple but less powerful than RLNC or Reed-Solomon.
Choosing the Right FEC
Algorithm | Best For | Latency | Flexibility | Overhead | Adaptive Support |
---|---|---|---|---|---|
Rely (Sliding) | Real-time, bursty traffic | Low | High | Moderate | No |
RLNC (Block) | Steady traffic | Moderate | Medium | Moderate | No |
Reed-Solomon | Reliable bulk transfers | High | Low | High | No |
Parity 2D | Broadcast / Legacy systems | Low | Low | Moderate | No |
RAFT1 | Dynamic, loss-variable networks | Low | High | Variable | Yes |
Footnotes
-
RAFT is not an FEC algorithm itself, but a transport protocol provided by NanoPing that implements adaptive Forward Erasure Correction using real-time feedback from the network. Internally it is using a RLNC sliding window FEC algorithm. ↩