You are on page 1of 33

Forward Error

Correction
Shimrit Tzur-David

School of Computer Science and


Engineering
Hebrew University of Jerusalem

1
Agenda
Introduction
The FEC algorithm
Implementation
Performance

2
Introduction
Loss of packets is a fact of life in computers networks.
The usual approach to recover from losses is to
retransmit missing packets on request. The presented
approach is to add an error recovery mechanism that
enable the receiver to recover all useful data without
sending explicit request for missing packets.
Such a mechanism can be implemented by applying a
redundant encoding to the source data, so that even in
presence of packet losses, sufficient information is
conveyed to the receiver to allow successful
reconstruction of the original data.
3
Multicast Communication
The possible lack of correlation between losses
at different receivers can cause severe
scalability problems.

It will be helpful if in this situation, the


receiver will enable to recover all useful data
without sending explicit requests for missing
packets.

4
The goal
The idea of this research is to show that under some
circumstances, incorporating error correction
schemes inside the TCP achieves better performance
than that of retransmission schemes.
Error correcting schemes for missing packets can be
classified as (k, n) schemes, where k is the number of
data packets in a FEC block and n is the number of all
the packets in the FEC block (including data packets
and the error correcting packets).

5
Agenda
Introduction
The FEC algorithm
Implementation
Performance

6
The FEC Algorithm
Implemented by applying a redundant
encoding to the source data.
In presence of packet losses, sufficient
information is conveyed to the receiver to
allow successful reconstruction of the original
data.
Such an encoding is called erasure code.

7
Erasure Code
The idea: encode a set of k source data packets
into a set of n > k encoded data packets.
Any subset of k encoded packets allow the
reconstruction of the original source.
Such a code is called an (n, k) erasure code.
The goal: produce the encoded packets given
arbitrary values for k and n and make the
encoding/decoding procedure sufficiently fast
for practical use.
8
Erasure Code – Cont.

9
A Simple Erasure Code
A polynomial of degree k-1 is completely
specified by its value in k different points.
Consider the source data packets as the
coefficients of a polynomial P of degree k-1.
The encoded packets are the values of P
computed in n different points.
The decoding: recover the coefficient of P given
its values in k points.
This code is called Vandermond code.
10
Systematic Codes
The transmission include a verbatim copy of
the source data.
No decoding effort is necessary in absence of
errors.
The Vandermond code is not systematic, but it
can be turned into a systematic code by simple
algebraic manipulations.

11
Systematic Codes – Cont.

- the coefficients
- the values of the polynomial

12
Vandermond matrix (G)

13
Systematic Codes – Cont.
Any minor of degree k extracted from this matrix is
invertible.
This property still holds if we do linear combinations
of the columns.
We can manipulate the matrix in such a way that the
upper k rows become the identity matrix.
After the transformation: G*X will give us -

 We have obtained a systematic code.

14
The encoding
The source data:
G is an (n,k) matrix, any subset of k rows of G, G`,
is an invertible matrix.

The sender sends , but the receiver gets y


which contains k values from it.

 The encoding data is:


15
The decoding
The original data can be reconstruct by using k
equations on the known values in y.

16
Agenda
Introduction
The FEC algorithm
Implementation
Performance

17
Implementation
End-to-end error correction should be addressed at the
transport layer, since it responsible for packet
reliability.
In the handshake process, the connection initiator add a
FEC flag inside the TCP options inside the ‘Syn’
packet.
If the receiver also knows how to deal with FEC, its
‘Syn-Ack’ packet will also contain the FEC flag.
The sender now knows that it can encode its data.

18
Sender
For each new packet, it adds the FEC header.
The FEC header contains n, k and the index of
the packet in the block.
It saves the packet payload in the FEC buffer.
It sends the packet.
When it sends a full data block (k packets), it
encodes the data using the data in FEC buffer,
creates the FEC packets and sends them as
well.
19
Sender – Pseudo Code
Sendmsg(buf){
while (length(buf) > 0)
create new packet
fec_index++
add fec header to packet {fec_index, k, n}
data_len=min(mss, length(buf))
take data_len bytes from buf and add to the payload
save payload in fec_buf
send packet

20
Sender – Pseudo Code – Cont.
if fec_index == k
for(i=k; i<n; i++)
fec_payload=encode(fec_buf,i)
create_fec_packet(fec_payload)
send fec packet
fec_index = 0;
}

21
Receiver
For each packet that it gets, it pulls the FEC
header.
If this is redundant FEC packet it throws its
payload, else it adds the packet to the FEC queue.
If this is a FEC packet, it doesn’t send its payload
to the application layer.
If there is a block with up to n-k missing packets,
it decodes it (using FEC queue), handles queues,
and sends the reconstructed data to the
application layer.
22
Receiver – Pseudo Code
dataqueue(packet){
get_fec_header (packet,fec_index, k, n)
If (!redundand && !exist)
add packet to fec_queue in the right order (by s.n.)
If (fec_index > k)
payload len = 0

23
Receiver – Pseudo Code – Cont.
for (i = 0; i < n - k; i++)
if there is a full block with ‘i’ holes
if i == 0
delete block from queue
break
else
payload[] = decode(fec_queue)
simulating receiving the missing
packets with the decoded payload
delete block from queue
break
}
24
Agenda
Introduction
The FEC algorithm
Implementation
Performance

25
Performance
The measurement were taken in the LAN, with
n=9 and k=8.
We compared the transferring time with files
in sizes: 50MB, 100MB, 150MB and 200MB.
We demonstrated packet loss by throwing the
picked packets at the receiver side.
We made the measurements with different loss
probabilities: 0.025, 0.05, 0.075, 0.01, 0.0125,
0.015, 0.0175, 0.02, 0.025, 0.03, 0.035, 0.04.
26
50MB File

27
100MB File

28
150MB File

29
200MB File

30
Conclusions
As we can see, all the graphs show better results until
the loss probability reaches to 3%.
In loss probability higher than 3%, the probability to
lose the FEC packets increases, in this case there is no
decoding process to reconstruct it.
The receiver can lose more than one packet in a
block, in this case it needs to wait until it gets one of
the missing packets (by retransmission).
If one of the FEC packets is lost, and another packet
in the next block is lost, we reconstruct the packet in
the next block, but we still can’t transfer the data to
the application layer.
31
TODO
The system should sense its traffic and if there
are losses in which the FEC is useful (and still
TCP friendly) turn it on.
If there is a high percentage of losses, turn off
the FEC algorithm.
The system should be able to handle change of
n and k during a connection.

32
THE END

33

You might also like