28.12.2013 Views

Serial Programming - upload.wikimedia....

Serial Programming - upload.wikimedia....

Serial Programming - upload.wikimedia....

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Error Correction Methods<br />

(Some people think of "streaming" as one big packet the size of the window using "stop-andwait"<br />

protocol, divided into smaller "sub-packets").<br />

8.2.1 Selective Repeat ARQ<br />

w:Selective Repeat ARQ 4<br />

A selective repeat ARQ system is a kind of streaming ARQ.<br />

But instead of the receiver only handling 1 packet at a time, and discarding all packets<br />

higher or lower than the one it is looking for, the receiver tries to keep a copy of all packets<br />

it receives in a window of its own, and negotiates with the sender to try to resend *only*<br />

the erroneous packets.<br />

8.3 FEC<br />

If you have only one-way communication, you are forced to use Forward Error Correction,<br />

sometimes called EDAC (Error Detection And Correction).<br />

You transmit the data, then (instead of a CRC) you transmit "check bits" that are calculated<br />

from the data.<br />

... NASA space probes ... compact disks ...<br />

The simplest kind is "repeat the message".<br />

If I send the same packet twice, and noise only corrupts one of them, *and* the receiver can<br />

tell which one was corrupted, then no data was lost. If I send the same packet 3 times, and<br />

noise corrupts any one of them, then the receiver can do "best 2 out of 3". The "check bits"<br />

are 2 copies of the data bits. In fact, noise could corrupt a little bit of *all three* of them,<br />

and you could still extract all the data -- align the 3 packets next to each other, and do<br />

"best 2 out of 3" for every bit. As long as there were only a few bits of noise in each packet,<br />

and the noise was in a different place in each packet, all the data can be recovered.<br />

... (put picture here) ...<br />

There are some very clever kinds of FEC (Hamming codes, Reed-Solomon codes) that can<br />

correct all kinds of common errors better than "best 2 out of 3", and only require the same<br />

number of "check bits" as there are data bits.<br />

8.4 Pretend It Never Happened<br />

A sender often streams audio and video live, in real-time.<br />

What should a receiver do when a packet gets mangled ?<br />

4 http://en.wikipedia.org/wiki/Selective%20Repeat%20ARQ<br />

118

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!