Using kodo, developers can easily integrate erasure correcting codes to meet their specific needs.
The kodo software library implements a wide range of erasure correcting codes ranging from novel codes such as Random Linear Network Codes to traditional codes such as Reed-Solomon.
Kodo is cross-platform which makes it easy to deploy your code on a variety of chips and platforms.

Low Delay Communication

Using kodo’s erasure correcting code algorithms, redundancy can be injected into the packet transport and thereby enabling receivers to quickly recover from packet loss and avoid costly round-trip-times (RTT) incurred by relying on traditional acknowledgment based scheme used in protocols such as TCP.

Increase Communication Reliability

Using the erasure correcting codes provided by kodo, device to device communication can be made robust in scenarios with high loss probability. This is accomplished by sending encoded redundancy that is statistically more likely to be useful for the receiver. In scenarios where packets are passed through a multi hop network, recoding of the packets can be used for obtaining even bigger gains.

Improve Storage Robustness

With kodo it is possible to build storage systems which are more robust towards data loss due to, e.g., failing hard drives. This is accomplished by using erasure correcting codes to encode the existing data and restore the original data. Our partner company, Chocolate Cloud is working with that solution.

How it works

Decoding a cat

This video shows an encoding and decoding of a picture. The left side shows the state of the decoding, here the cat will eventually appear. On the right side the "coding vector" is shown. The coding vector is a representation of how the data is combined. When using a block encoder, as in this example, the encoding is performed over a generation of data. A generation is a collection of symbols, each symbol is a set number of bytes. In this example the generation is the complete picture of the cat. Each symbol is exactly the number of bytes which is needed for each row of pixels in the picture. Initially each row is printed uncoded, this mode is called systematic mode. In some cases the row is not printed, this indicates that the row had somehow been lost. After attempting to print each row, we start to print encoded data instead. This can be seen as a row of static noise at first, and then slowly as the decoding progresses, the static noise becomes the missing parts of the picture.

Code Samples

Encoder

This example contains some semi-pseudocode which shows the most basic part of the encoder API.

#include <kodo/encoder.hpp>
#include <kodo/generator/random_uniform.hpp>

int main()
{
    // Pick the number of symbols to encode.
    auto symbols = 150;
    
    // Pick the size of each symbol in bytes
    auto symbol_bytes = 1400;

    // Calculate the size of the block in bytes
    auto block_bytes = symbols * symbol_bytes;

    // Create and configure encoder and generator
    kodo::encoder encoder(kodo::finite_field::binary8);
    encoder.configure(symbols);

    kodo::generator::random_uniform generator(field);
    generator.configure(encoder.symbols());

    // Allocate storage for the symbol, coefficients, and the data to encode.
    uint8_t* symbol = malloc(symbol_bytes);
    uint8_t* coefficients = malloc(generator.max_coefficients_bytes());
    uint8_t* data_in = malloc(block_bytes);

    // Assign the data buffer to the encoder
    encoder.set_symbols_storage(data_in, block_bytes, symbol_bytes);

    while (!enough)
    {
        // The RLNC code is rateless, which means that it can generate an
        // infinite number of coded packets.        
        generator.generate(coefficients);
        auto encoded_size = encoder.encode_symbol(symbol, coefficients);

        handle_encoded_data(symbol, encoded_size, coefficients);
    }
}

Decoder

This example contains some semi-pseudocode which shows the most basic part of the decoder API.

#include <kodo/decoder.hpp>

int main()
{
    // Pick the number of symbols to decode.
    auto symbols = 150;
    
    // Pick the size of each symbol in bytes
    auto symbol_bytes = 1400;

    // Calculate the size of the block in bytes
    auto block_bytes = symbols * symbol_bytes;

    // Create and configure decoder
    kodo::decoder decoder(kodo::finite_field::binary8);
    decoder.configure(symbols);

    while (!decoder.is_complete())
    {
        auto symbol = [receive encoded symbol];
        uint8_t* data = symbol.data;
        std::size_t size = symbol.size;
        uint8_t* coefficients = [receive coefficients];
        decoder.decode_symbol(data, size coefficients);
    }
}

Contact

If you want to know more, please leave us a message and we will contact you.

Contact