Lecture 3
Lecture 3
1. Introduction
Assume we have Sender (Source) A and Receiver
(Destination) B.
A B
Message 1
Message 2
Message 3
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)
2. Error Detection
Two basic strategies for dealing with errors:
2
The number of bit positions in which two words differ is called the
Hamming distance between the two words.
10001001
10100000
00101001
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.
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
4
2.2. Error Detection Techniques
Some techniques:
• Parity Bit
5
2.2.1 Parity bit
For each word, the bit is chosen such that the number of 1 bits is
even (or odd).
Example:
Exercise:
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.