400 likes | 546 Views
Erasure Codes for Reliable Communication Protocols. Presented by Sen Yang Based on L.Rizzo’s paper and online resource . Effective Erasure Codes for Reliable Computer Communication Protocols. Outline. Motivation Math Algorithm Applications .
E N D
Erasure Codes for Reliable Communication Protocols Presented by Sen Yang Based on L.Rizzo’spaper and online resource. Effective Erasure Codes for Reliable Computer Communication Protocols
Outline • Motivation • Math • Algorithm • Applications
Automatic Repeat reQuest (ARQ) • ACK and timeouts • Receiver sends ACK when it receives packet • Sender waits for ACK and times out
Example • Alice wants to send her phone number (555629) to Bob via internet.
Internet not good • However, the internet transmission are not good: • 1. Half of all the messages gets lost. • 2. Messages longer than 5 characters are illegal. • 3. It is very expensive .
Encode Process • Alice is very smart, she design the following rules to send the messages
Step 1 • Alice breaks her phone number up into two parts a = 555, b = 629 • sends 2 messages "A = 555" and "B = 629“ to Bob. • Bob might miss them!
Encode Process • Alice constructs a linear function • f(i)= a + (b-a)(i-1) • such that • f(1) =555 and f(2)=629.
Encode Process • How to construct it? • Solve the linear equations and find • a=555, b-a=74 • Therefore, a=555, b=629
Step 2 • Alice computes the values f(3), f(4), and f(5) and then also transmits three redundant messages: • "C = 703", "D = 777" and "E = 851".
Receive & lose • Now suppose Bob only receives "D = 777" and "E = 851".
Bob’s homework • Before the transmission , Bob knows that the form of f(k) is • f(i)= a + (b-a)(i-1) , • where a and bare the two parts of the phone number.
Decode • Now he can use f(4) and f(5) to find a and b. • f(4) = a+ (b-a)(4-1)=777 • f(5)= a+ (b-a)(5-1)=851
Decode • Solve linear equations! Easy.
Advanced tools • In real world, we need advanced mathematical tools, such as matrices and finite field, to perform encode &decode • Some mathematics are in order.
Finite field • Finite Field is a field which only has finite elements . • Z/2Z={0,1} • Z/pZ={0,1,….p-1} , where p is a prime. • called Prime fields.
Classify • Each finite field is of size where p must be a prime. • In CS, p=2 is very useful. • Now, let p=2, k=2.
Classify • Can you construct a field of size 4? • Any idea? • How about Z/4Z? Why?
Two problems -1 • When considering software implementations, twominor difficulties in using a prime field: • 1.) with the exception of p = 2, field elements require > bits to be represented. • Causes a slight inefficiency in the encoding of data
Two problems -2 • 2.) modulo operation on sums and multiplications are expensive. • Why ? • Eg: In Z/5Z: • 2+4=2 • 2*4= 3
How to overcome ? • Any finite field has a generator, denoted g. • Eg. In Z/5Z, let’s consider the power of 2: • 1, 2, 4, 3,
generator • Express any non-zero element x as • X= , • g is the generator • some positive integer
generator • multiplication and division can be computed as follows: • xy = , • Where stands for "a modulo b“ • q is the size of the finite field.
generator • If the size of field not too large, we make tables to record • operations in extension fields with p = 2 can be extremely fast and simple to implement
Vandermonde • The determinant of a square Vandermonde matrix (where m = n) can be expressed as
Encode • Source data: • G: n x k Vandermondematrix, • y= Gx
Decode • y’ : k components of y available at the receiver. • G’ : matrix corresponding to y’. • y’= G’x • x = Hy’ , H is the inverse.
Big data • XORing Elephants: Novel Erasure Codes for Big Data. • Use erasure code to reduce the large storage overhead of three-replicated systems