Professional Documents
Culture Documents
Feedback: Using special control frames. To ensure reliable delivery is to provide the sender with some feedback.
Data Frame
Sender
Receiver
Timers : Hardware troubles may cause special control frames to vanish completely and the receiver will not react at all. Sequence Numbers : To outgoing frames, to prevent receiver from accepting the same frame two or more times, and pass it to the network layer more than once. To help receiver distinguish retransmissions from originals.
EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields Error detection not 100% reliable! protocol may miss some errors, but rarely larger EDC field yields better detection and correction
Transmission errors : generated by physical processes, errors on some media tend to come in bursts rather than singly. Disadvantage: They are much harder to detect and correct than isolated errors. Advantage: Isolated Errors : every packet would be in error
n=m+r There are 2n possible codewords and 2m possible data messages. Hamming distance between codewords: min d(C1,C2)=number of (same bit position) bits which differ d(10010010,00010001)=3 If two codewords are a hamming distance d apart, it will require d single-bit errors to convert one into the other.
In most data transmission applications, all 2m possible data messages are legal, but due to the way the check bits are computed, not all 2n possible codewords are used. Given the algorithm for computing the check bits, it is possible to construct a complete list of codewords, and from this list find the two codewords whose Hamming distance is minimum. This distance is the Hamming distance of the complete code.
<2d+1
radius=d bits
2d+1
Parity check is a code with distance 2. Therefore, it can detect single-bit error. Consider a code with only 4 valid codewords: 0000000000, 0000011111, 1111100000, 1111111111 This code has a distance of 5, which means that it can detect 4 bit errors and correct double errors. If the codeword 0000000111 arrives and we know at most two bits are in error, the receiver knows that the original must have been 0000011111. If, however, a triple error changes 0000000000 into 0000000111, the error will not be corrected properly.
A 1-bit error correcting code (Hamming code) m data bits r check bits
n=m+r Each of the 2m legal messages has n illegal codewords at a distance 1 from it. Thus each of the 2m legal messages requires n+1 bit patterns dedicated to it. Therefore, ( n + 1)2 m 2 n
( m + r + 1)2 m 2 m+ r ( m + r + 1) 2 r
There is a lower limit on the number of check bits needed to correct single errors. In practice, it can be achieved using a method due to Hamming. The bits of codewords are numbered consecutively, starting with bit 1 at the left end. The bits that are power of 2 (1, 2, 4, 8, ) are check bits. The rest are filled up with the data bits. Each check bit forces the parity of some collection of bits, including itself, to be even (or odd).
Error-detecting Codes
error control: error detection or error correction? assume error rate=1/106 data=1000 bits error detecting check bits: 1 bit (e.g. parity check) error correcting check bits: 10 bits (e.g. Hamming code) retransmission In 103 packets: error detecting overhead=103+1001=2001 bits error correcting overhead=10*103 bits=10000 bits
3. A Simplex Protocol for Noisy Channel sequence numbers (to number packets and ACKs) P(1) P(2) time-out P(1) P(1) error receiver ACK new receiver ACK old
sender
sender
If there is no sequence number for packets, the receiver can not distinguish between these two cases.
4 4
A potential failure The sender cannot tell whether this ACK is for P(1) or P(2) if not numbered. sender time-out P(1) P(2) P(1) error receiver ACK ACK ACKs must also be numbered.
4 5
3. A Simplex Protocol for Noisy Channel Protocols in which the sender waits for a positive acknowledgement before advancing to the next data item are often called PAR (Positive Acknowledgement with Retransmission) or ARQ (Automatic Repeat reQuest).
Although it can handle lost frames by timing out, it requires the timeout interval to be long enough to prevent premature timeouts. If the sender times out early, while the acknowledgement is still on the way, it will send a duplicate.