coding and error control chapter 8. coping with data transmission errors three approaches error...
TRANSCRIPT
![Page 1: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/1.jpg)
Coding and Error Control
Chapter 8
![Page 2: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/2.jpg)
Coping with Data Transmission Errors
Three approaches Error detection codes
Detects the presence of an error Typically used in conjunction with ARQ
Automatic repeat request (ARQ) protocols Block of data with error is discarded Transmitter retransmits that block of data
Error correction codes, or forward correction codes (FEC) Designed to detect and correct errors Frequently used in wireless transmission since
High error rate Retransmission schemes are highly inefficient
![Page 3: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/3.jpg)
Error Detection Probabilities
Pb : Probability of single bit error (BER)
P1 : Probability that a frame arrives with no bit errors
P2 : Probability that a frame arrives with one or more errors
F: frame length, number of bits per frame P1 ?
P2 ?
![Page 4: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/4.jpg)
Error Detection Probabilities With no error detection
F = Number of bits per frame
What happens to the probability of successful transmission if the probability of a single bit error increases?
What happens to the probability of successful transmission if the frame length increases?
12
1
1
1
PP
PP Fb
![Page 5: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/5.jpg)
Error Detection Probabilities
P1 when Pb .
P1 when F .
![Page 6: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/6.jpg)
Error Detection Probabilities The probability that a frame arrives with no bit
errors (P1) decreases when the probability of a single bit error increases.
The probability that a frame arrives with no bit errors (P1) decreases with increasing frame length; the longer the frame, the more bits it has and the
higher the probability that one of these is in error.
![Page 7: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/7.jpg)
Error Detection Process Transmitter
For a given frame, an error-detecting code (check bits) is calculated from data bits
Check bits are appended to data bits Typically, the data block of length k bits The error detecting code of length (n-k) << k
Receiver Separates incoming frame into data bits (k) and check bits
(n-k) Performs the same calculation on data bits to find out
the check bits from received data bits Compares calculated check bits against received check bits Detected error occurs if mismatch
![Page 8: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/8.jpg)
![Page 9: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/9.jpg)
Parity Check Simplest error detection scheme Parity bit appended to a block of data Even parity
Added bit ensures an even number of 1s Odd parity
Added bit ensures an odd number of 1s Example, 7-bit character [1110001]
Even parity [11100010] Odd parity [11100011]
![Page 10: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/10.jpg)
Parity Check Odd parity
Receiver examines the received character and if the total number of 1 is odd, assumes no errors.
If one bit is erroneously inverted, can the receiver detect the error?
In which cases, the receiver will not be able to detect the error?
The use of the parity bit is not foolproof, as noise impulses are often long enough to destroy more than one bit, particularly at high data rates.
![Page 11: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/11.jpg)
Parity Check Odd parity
Receiver examines the received character and if the total number of 1 is odd, assumes no errors.
If one bit is erroneously inverted during transmission then the receiver will detect an error
if two (or any even number) of bits are inverted due to error, an undetected error occurs.
The use of the parity bit is not foolproof, as noise impulses are often long enough to destroy more than one bit, particularly at high data rates.
![Page 12: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/12.jpg)
Cyclic Redundancy Check (CRC) One of the most common and the most powerful Transmitter
For a k-bit block of data, transmitter generates an (n-k)-bit frame check sequence (FCS)
Resulting frame of n bits is exactly divisible by predetermined number
Receiver Divides incoming frame by the same predetermined
number If no remainder, assumes no error
![Page 13: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/13.jpg)
CRC using modulo 2 Arithmetic The modulo 2 arithmetic of a digital addition is
simply an XOR
The modulo 2 arithmetic of a digital multiplication is simply an AND
?
1010
1111
?
11
11001
![Page 14: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/14.jpg)
CRC using Modulo 2 Arithmetic Parameters:
T = n-bit frame to be transmitted D = k-bit block of data; the first k bits of T F = (n – k)-bit FCS; the last (n – k) bits of
T P = pattern of n–k+1 bits; this is the
predetermined divisor Q = Quotient R = Remainder
What are the known parameters and what are the unknown ones
![Page 15: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/15.jpg)
CRC using Modulo 2 Arithmetic start by adding (n-k) zeros at the
end of D such that you have a new block of length n
Dividing 2n-kD by P gives quotient and remainder R
Use remainder R as FCS
RDT kn 2
Dkn 2
![Page 16: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/16.jpg)
CRC using Modulo 2 Arithmetic For T/P to have no remainder, start with
Divide 2n-kD by P gives quotient and remainder
Use remainder as FCS
FDT kn 2
P
RQ
P
Dkn
2
RDT kn 2
![Page 17: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/17.jpg)
CRC using Modulo 2 Arithmetic Does R cause T/P have no remainder?
Substituting,
No remainder, so T is exactly divisible by P
P
R
P
D
P
RD
P
T knkn
22
QP
RRQ
P
R
P
RQ
P
T
![Page 18: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/18.jpg)
Example Message D = 1010001101 (10 bits)
Pattern P = 110101 (6 bits)
FCS R = To be calculated (5 bits)
n = ? ; k = ? ; n-k = ? Multiply D by 2n-k
Divide D * 2n-k by P
![Page 19: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/19.jpg)
Example
![Page 20: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/20.jpg)
![Page 21: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/21.jpg)
CRC using Polynomials All values expressed as polynomials
Dummy variable X with binary coefficients
XRXDXXT
XP
XRXQ
XP
XDX
kn
kn
![Page 22: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/22.jpg)
CRC using Polynomials Message D = 1010001101 (10 bits) =>
D(X) = X9 + X7 + X3+ X2 +1 Pattern P = 110101 (6 bits)
P(X) = X5 + X4 + X2 +1 FCS R(X) = To be calculated (5 bits) n = ? ; k = ? ; n-k = ? Multiply D(X) by Xn-k
Divide D(X) * Xn-k by P(X)
![Page 23: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/23.jpg)
![Page 24: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/24.jpg)
CRC using Polynomials Widely used versions of P(X)
CRC–12 X12 + X11 + X3 + X2 + X + 1
CRC–16 X16 + X15 + X2 + 1
CRC – CCITT X16 + X12 + X5 + 1
CRC – 32 X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 + X8 + X7 + X5 + X4 + X2 +
X + 1
![Page 25: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/25.jpg)
Wireless Transmission Errors Error detection requires retransmission Detection inadequate for wireless applications
Error rate on wireless link can be high, results in a large number of retransmissions
For satellite links, the propagation delay is very long compared to transmission time.
=> Inefficient system Error correction is more suitable
![Page 26: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/26.jpg)
Block Error Correction Codes Transmitter
Forward error correction (FEC) encoder maps each k-bit block into an n-bit block codeword
Codeword is transmitted; analog for wireless transmission During transmission, the signal is subject to noise, which
may produce bit errors in the signal. Receiver
Incoming signal is demodulated Block passed through an FEC decoder
![Page 27: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/27.jpg)
Forward Error Correction Process
![Page 28: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/28.jpg)
FEC Decoder Outcomes No errors present
Codeword produced by decoder matches original codeword
Decoder detects and corrects bit errors Decoder detects but cannot correct bit errors;
reports uncorrectable error Decoder detects no bit errors, though errors
are present, typically rare
![Page 29: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/29.jpg)
Block Code Principles Hamming distance – for 2 n-bit binary sequences, the number of
different bits
E.g., v1=011011;
E.g., v2=110001;
d(v1, v2)=3 Suppose we wish to transmit blocks of data of length k bits. Instead of transmitting each block as k bits, we map each k-bit
sequence into a unique n-bit codeword.
![Page 30: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/30.jpg)
Block Code Principles For k=2 and n=5
Received : 00100=> Is it a valid codeword? What can you conclude? Can it be corrected? Give the hamming distance between 00100 and each possible
codeword !
![Page 31: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/31.jpg)
Block Code Principles For k=2 and n=5 Received : 00100=> not a valid codeword=>error Can it be corrected? Notice that
1 bit change to transform the valid codeword 00000 into 00100 2 bits changes to transform 00111 into 00100 3 bits changes to transform 11110 to 00100 4 bits changes to transform 11001 into 00100 d(00000, 00100)=1; d(00111, 00100)=2; d(11110, 00100)=3;
d(11001, 00100)=3 => Rule : For invalid codeword, choose the closest (minimum
distance) valid codeword
![Page 32: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/32.jpg)
Block Code Principles For a code consisting of the valid codewords w1 , w2 ,…,
ws , the minimum distance dmin of the code is defined as:
The maximum number of guaranteed correctable errors t
The number of errors that can be detected is
2
1mindt
1min dt
jiji
wwdd ,minmin
![Page 33: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/33.jpg)
Convolutional Codes Defined by 3 parameters
(n, k, K) code Input processes k bits produces an Output of n bits for every k input bits
So far, this is the same as the block code
k and n generally very small Have a memory characterized by K = constraint factor
The current n-bit output of (n, k, K) code depends on: Current block of k input bits Previous K-1 blocks of k input bits Example; (n, k, K) = (2,1,3)??
![Page 34: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/34.jpg)
Convolutional EncoderConvolutional code can be represented using a finite state machineThe machine has 2k(K-1) statesThe length of each state is (K-1)The transition from one state to another is determined by
the most recent input of k bits produces n output bits
![Page 35: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/35.jpg)
Convolutional Codes (n, k, K) = (2,1,3) The initial state of the machine
corresponds to the all-zeros state. For our example (Figure 8.9b)
there are 4 states, one for each possible pair of values for the last two bits.
The next input bit causes a transition and produces an output of two bits.
![Page 36: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/36.jpg)
Convolutional Codes
For example, if the last two bits were 10 (It-1= 1, It-2 = 0) and the next bit is 1 (It = 1), What is the current state ? What is the next state ?
What is the output O1 O2? O1 = It-2 XOR It-1 XOR It
O2 = It-2 XOR It
![Page 37: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/37.jpg)
Convolutional Codes
For example, if the last two bits were 10 (It-1= 1, It-2 = 0) and the next bit is 1 (It = 1), current state is state b (10) and the next state is d (11).
The output is O1 = It-2 XOR It-1 XOR It = 0 XOR 1 XOR 1 = 0
O2 = It-2 XOR It = 0 XOR 1 = 1
![Page 38: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/38.jpg)
Convolutional Codes The current state is 11, The input is 0
What is the next state ? What is the output?
![Page 39: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/39.jpg)
The path: a-b-c-b-d-c-a-a
![Page 40: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/40.jpg)
Decoding Trellis diagram – expanded encoder diagram
showing the time sequence For example: the path a-b-c-b-d-c-a-a Which output is produced by this path? Which input generates this output? Is a-c a valid path? Is it possible that you receive 00 11 11??
![Page 41: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/41.jpg)
Decoding Trellis diagram – expanded encoder diagram
Any valid output is defined by a path through the trellis
For example: the path a-b-c-b-d-c-a-a produces the output 11 10 00 01 01 11 00 and was generated by the input 1011000
If an invalid path occurs such as a-c then the decoder attempts error correction
![Page 42: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/42.jpg)
Decoding Viterbi code – error correction algorithm
Compares received sequence with all possible transmitted sequences
Algorithm chooses path through trellis whose coded sequence differs from received sequence in the fewest number of places
Once a valid path is selected as the correct path,
the decoder can recover the input data bits from the output code bits
![Page 43: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/43.jpg)
Decoding Viterbi code – error correction algorithm
Suppose, you receive 11 10 11 01 10 11 00 Is it a valid output? What is the closer path?
![Page 44: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/44.jpg)
Automatic Repeat Request
Mechanism used in data link control and transport protocols
Relies on use of an error detection code (such as CRC)
ARQ is closely related to Flow Control
![Page 45: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/45.jpg)
Flow Control
● Why invented ?● Differences in machine performance: A may send data to B much
faster than B can receive. Or B may be shared by many processes and cannot consume data received at the rate that A sends.
● Data may be lost at B due to lack of buffer space – waste of resources !
● What does it do ?● Flow control prevents buffer overflow at receiver
● How does it work ?● Sliding window
● Credits
![Page 46: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/46.jpg)
Flow Control Assures that transmitting entity does not overwhelm a
receiving entity with data
Protocols with flow control mechanism allow multiple PDUs in transit at the same time
PDUs arrive in same order they’re sent
Sliding-window flow control Transmitter maintains list (window) of sequence numbers
allowed to send Receiver maintains list allowed to receive
![Page 47: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/47.jpg)
Flow Control
● flow control is the process of managing the rate of data transmission between two nodes
● In order to prevent a fast sender from outrunning a slow receiver.
● It provides a mechanism for the receiver to control the transmission speed, so that the receiving node is not overwhelmed with data from transmitting node.
● Flow control should be distinguished from congestion control, which is used for controlling the flow of data when congestion has actually occurred
● Flow control is important because it is possible for a sending computer to transmit information at a faster rate than the destination computer can receive and process it.
● This can happen if the receiving computers have a heavy traffic load in comparison to the sending computer, or if the receiving computer has less processing power than the sending computer.
![Page 48: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/48.jpg)
![Page 49: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/49.jpg)
● On the example, packets are numbered 0, 1, 2, ..
● The sliding window principle works as follows:
● a window size W is defined. In this example it is fixed. In general, it may vary based on messages sent by the receiver. The sliding window principle requires that, at any time: number of unacknowledged packets at the receiver <= W
● the maximum send window, also called offered window is the set of packet numbers for packets that either have been sent but are not (yet) acknowledged or have not been sent but may be sent.
● the usable window is the set of packet numbers for packets that may be sent for the first time. The usable window is always contained in the maximum send window.
Sliding window
![Page 50: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/50.jpg)
● the lower bound of the maximum send window is the smallest packet number that has been sent and not acknowledged
● the maximum window slides (moves to the right) if the acknowledgement for the packet with the lowest number in the window is received
● A sliding window protocol is a protocol that uses the sliding window principle. With a sliding window protocol, W is the maximum number of packets that the receiver needs to buffer in the re-sequencing (= receive) buffer.
Sliding window
![Page 51: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/51.jpg)
![Page 52: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/52.jpg)
● The previous slide shows an example of ARQ protocol, which uses the following details:
● 1. window size = 4 packets;
● 2. Acknowledgements are positive and are cumulative, i.e. indicate the highest
packet number up to which all packets were correctly received
● 3. Loss detection is by timeout at sender
● 4. When a loss is detected, the source starts retransmitting packets from the last acknowledged packet (this is called Go Back n).
● Q. Is it possible with this protocol that a packet is retransmitted whereas it was correctly received?
![Page 53: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/53.jpg)
● The previous slide shows an example of ARQ protocol, which uses the following details:
● 1. window size = 4 packets;
● 2. Acknowledgements are positive and are cumulative, i.e. indicate the highest
packet number up to which all packets were correctly received
● 3. Loss detection is by timeout at sender
● 4. When a loss is detected, the source starts retransmitting packets from the last acknowledged packet (this is called Go Back n).
● Q. Is it possible with this protocol that a packet is retransmitted whereas it was correctly received?
● A. Yes, for several reasons
● 1. If an ack is lost
● 2. If packet n is lost and packet n+ 1 is not
![Page 54: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/54.jpg)
END
![Page 55: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/55.jpg)
An Example of ARQ Protocol with Go Back N andNegative Acks
![Page 56: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/56.jpg)
The previous slide shows an example of ARQ protocol, which uses the following details:
1. window size = 4 packets; 2. Acknowledgements are positive or negative and are
cumulative. A positive ack indicates that packet n was received as well as all packets before it. A negative ack indicates that all packets up to n were received but a packet after it was lost
3. Loss detection is either by timeout at sender or by reception of negative ack.
4. When a loss is detected, the source starts retransmitting packets from the last acknowldeged packet (Go Back n).
Q. What is the benefit of this protocol compared to the previous? A. If the timer T1 cannot be set very accurately, the previous
protocol may wait for a long time before detecting a loss. This protocol reacts more rapidly.
![Page 57: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/57.jpg)
END
![Page 58: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/58.jpg)
Error Control Requirements Error detection
Receiver detects errors and discards PDUs Positive acknowledgement
Destination returns acknowledgment of received, error-free PDUs
Retransmission after timeout Source retransmits unacknowledged PDU
Negative acknowledgement and retransmission Destination returns negative acknowledgment to PDUs
in error
![Page 59: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/59.jpg)
Go-back-N ARQ Acknowledgments
RR = receive ready (no errors occur) REJ = reject (error detected)
Contingencies Damaged PDU Damaged RR Damaged REJ
![Page 60: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/60.jpg)
Appendix
![Page 61: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/61.jpg)
Error Detection Process
![Page 62: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/62.jpg)
CRC using Digital Logic Dividing circuit consisting of:
XOR gates Up to n – k XOR gates Presence of a gate corresponds to the presence of a
term in the divisor polynomial P(X) A shift register
String of 1-bit storage devices Register contains n – k bits, equal to the length of
the FCS
![Page 63: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/63.jpg)
Digital Logic CRC
![Page 64: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/64.jpg)
Error Detection Probabilities Definitions
Pb : Probability of single bit error (BER)
P1 : Probability that a frame arrives with no bit errors
P2 : While using error detection, the probability that a frame arrives with one or more undetected errors
P3 : While using error detection, the probability that a frame arrives with one or more detected bit errors but no undetected bit errors
![Page 65: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/65.jpg)
Error Detection Probabilities With no error detection
F = Number of bits per frame
0
1
1
3
12
1
P
PP
PP Fb
![Page 66: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/66.jpg)
Block Code Principles Hamming distance – for 2 n-bit binary sequences,
the number of different bits E.g., v1=011011; v2=110001; d(v1, v2)=3
Redundancy – ratio of redundant bits to data bits Code rate – ratio of data bits to total bits Coding gain – the reduction in the required Eb/N0 to
achieve a specified BER of an error-correcting coded system
![Page 67: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/67.jpg)
Hamming Code Designed to correct single bit errors Family of (n, k) block error-correcting codes with
parameters: Block length: n = 2m – 1 Number of data bits: k = 2m – m – 1 Number of check bits: n – k = m Minimum distance: dmin = 3
Single-error-correcting (SEC) code SEC double-error-detecting (SEC-DED) code
![Page 68: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/68.jpg)
Hamming Code Process Encoding: k data bits + (n -k) check bits Decoding: compares received (n -k) bits
with calculated (n -k) bits using XOR Resulting (n -k) bits called syndrome word Syndrome range is between 0 and 2(n-k)-1 Each bit of syndrome indicates a match (0) or
conflict (1) in that bit position
![Page 69: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/69.jpg)
Cyclic Codes Can be encoded and decoded using linear
feedback shift registers (LFSRs) For cyclic codes, a valid codeword (c0, c1, …, cn-1),
shifted right one bit, is also a valid codeword (cn-1, c0, …, cn-2)
Takes fixed-length input (k) and produces fixed-length check code (n-k) In contrast, CRC error-detecting code accepts arbitrary
length input for fixed-length check code
![Page 70: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/70.jpg)
BCH Codes For positive pair of integers m and t, a (n, k)
BCH code has parameters: Block length: n = 2m – 1 Number of check bits: n – k £ mt Minimum distance:dmin ³ 2t + 1
Correct combinations of t or fewer errors Flexibility in choice of parameters
Block length, code rate
![Page 71: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/71.jpg)
Reed-Solomon Codes Subclass of nonbinary BCH codes Data processed in chunks of m bits, called
symbols An (n, k) RS code has parameters:
Symbol length: m bits per symbol Block length: n = 2m – 1 symbols = m(2m – 1) bits Data length: k symbols Size of check code: n – k = 2t symbols = m(2t) bits Minimum distance: dmin = 2t + 1 symbols
![Page 72: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/72.jpg)
Block Interleaving Data written to and read from memory in different
orders Data bits and corresponding check bits are
interspersed with bits from other blocks At receiver, data are deinterleaved to recover
original order A burst error that may occur is spread out over a
number of blocks, making error correction possible
![Page 73: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/73.jpg)
Block Interleaving
![Page 74: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/74.jpg)
Flow Control Reasons for breaking up a block of data
before transmitting: Limited buffer size of receiver Retransmission of PDU due to error requires
smaller amounts of data to be retransmitted On shared medium, larger PDUs occupy
medium for extended period, causing delays at other sending stations
![Page 75: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/75.jpg)
Flow Control
![Page 76: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/76.jpg)
Modulo 2 Arithmetic Modulo 2 Arithmetic
Arithmetic system where every result is taken modulo 2.
(10+5)%2 = 1 (2*8)%2 = 0 In short, the result of the operation is 1 if the result is
odd, and 0 if the result is even.
![Page 77: Coding and Error Control Chapter 8. Coping with Data Transmission Errors Three approaches Error detection codes Detects the presence of an error Typically](https://reader030.vdocument.in/reader030/viewer/2022032708/56649e865503460f94b88fa3/html5/thumbnails/77.jpg)
Error Control Mechanisms to detect and correct
transmission errors Types of errors:
Lost PDU : a PDU fails to arrive Damaged PDU : PDU arrives with errors