0% found this document useful (0 votes)
15 views

Lecture 3

Chapter 3 discusses error detection, flow control, and error control in data transmission between a sender (A) and receiver (B). It explains the importance of error detection strategies, including Hamming distance and various techniques like parity bits and cyclic redundancy checks. The chapter emphasizes the need for acknowledgments and flow control to ensure reliable communication despite potential errors during data transmission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Lecture 3

Chapter 3 discusses error detection, flow control, and error control in data transmission between a sender (A) and receiver (B). It explains the importance of error detection strategies, including Hamming distance and various techniques like parity bits and cyclic redundancy checks. The chapter emphasizes the need for acknowledgments and flow control to ensure reliable communication despite potential errors during data transmission.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Chap.

3: Error Detection, Flow Control,


and Error Control
This corresponds to parts of Chapters 6 and 7 in the textbook by
Stallings (Many figures are taken from there) and Chapters 6 and 8
in textbook by Shay.

1. Introduction
Assume we have Sender (Source) A and Receiver
(Destination) B.
A B

Message 1

Message 2

Message 3

How does B know that it is receiving exactly the data sent by


A ? (Data has not been damaged on the way to B)

Answer: Error Detection

How does A know that the data it has sent has been
received by B and has not been damaged or lost on its way
to B ? and what should it do in that case ?

1
Answer: For Data received correctly (checked and found not
damaged), B should send an Acknowledgment (ACK) to A.
However, A cannot wait forever for an acknowledgment,
therefore after a certain amount of time A will timeout and
send its data again … (Error Control)

B may have very little resources (memory, CPU, etc.). How


does A know that B is ready to receive next data ?

Answer: Flow control

2. Error Detection
Two basic strategies for dealing with errors:

• One way to include enough redundant information


along with each block of data sent to enable to the
receiver to deduce what transmitted character must
have been. (Error correction).

• The other way is only to include enough redundancy


to allow the receiver to deduce that an error
occurred, but not which error and have it request a
retransmission. (Error detection).

2.1 Hamming Distance

A set of words Code


Code 1: {00, 01, 10, 11}
Code 2: {000, 111}

2
The number of bit positions in which two words differ is called the
Hamming distance between the two words.

The Hamming distance between two following words: 10001001


and 1010000, is 3.

How to determine the distance?

Take EXCLUSIVE OR of the words:

10001001
10100000
00101001

And then count the number of “1”s

Hamming distance of a code


Given a code, the Hamming distance of the code is the
minimum Hamming distance of all the Hamming distances
between any pair of words in the code.

Example of code:
w1: 10001001
w2: 10110001
w3: 10001010

w1 and w2: 3
w1 and w3: 2
w2 and w3: 5

Hamming distance = 2

3
Error detecting & Error correcting properties of a code
depend on its Hamming distance.

• To detect d errors, you need a distance (d + 1) code.

• To correct d errors, you need a distance (2d + 1) code.

Example: As a simple example of an error-correcting code,


consider a code with only 4 words:

{0000000000, 0000011111, 1111100000, 1111111111}

The code has a Hamming distance of 5, which means that it can


correct 1 bit error or 2 bits error. (assuming that no more than 2
errors have happened).

Error correction:
0000000000 1000000001, assuming that no more than 2
errors happened, I can find the original 0000000000

Error Detection:
0000000000 1111000000, I detect the error, but cannot
correct

0000000000 1111100000, cannot even detect it.

The overhead for error correction is too high …

4
2.2. Error Detection Techniques

Error-detection followed by retransmission is what is really


happening today in communications.

Some techniques:

• Parity Bit

• Longitudinal Redundancy Check (LRC)

• Cyclic Redundancy Check (CRC)

5
2.2.1 Parity bit

Consider a code in which a single parity bit is appended to the


code words.

For each word, the bit is chosen such that the number of 1 bits is
even (or odd).

This code has a distance 2


It can be used to detect single bit errors.

Example:

Consider the ASCII code: {0000000, 0000001…, 1111111}

Suppose the transmitter wants to transmit the following ASCII


character: 1110001;

Using odd parity, it will append 1 and transmit really 11100011;

The receiver examines the received sequence of bits; if the total


number of 1's is odd, it concludes that no error has occurred.

If one bit or any odd number of bits is damaged (change 1 to 0 or 0


to 1) during transmission (e.g., 11000011)
the receiver will detect an error.

But 11100011 00100011 (2 errors happened)


Cannot detect 2 errors or any even number of errors ….

Exercise:

Hamming Distance: Adding a parity bit to the ASCII code, what is


the hamming distance of the new code?

6
{00000001, 00000010…, 11111110}

Take a pair of words and check the hamming distance, and start
incrementally:
Take two words which are originally distant by 1 in the original code, (for instance
0000001 and 0000011):
The parity bits will be different for each word (for instance, 00000010 and 00000111)
and therefore the distance will become 2.

Let’s take two words in the original code which are distant by 2 and see what happens in
the new code:
The distance will remain 2 or increase, for sure.

… no need to consider distance of 3, etc., because it will always go higher and higher.

Therefore, I can conclude that the minimum distance is 2, and this is the Hamming
distance of the code.

You might also like