0% found this document useful (0 votes)
14 views4 pages

TUTORIAL 2 (Module 2) Answer Key-1

The document provides answers to a tutorial on data link layer protocols, including bit stuffing, byte stuffing, error detection and correction using parity bits, Hamming encoding, and CRC. It details the processes of transmitting data with error-checking mechanisms and how to detect and correct errors in received data. Key examples illustrate the application of these concepts, including the generation of codewords and the use of CRC for error detection.

Uploaded by

Dhanya Ratheesh
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)
14 views4 pages

TUTORIAL 2 (Module 2) Answer Key-1

The document provides answers to a tutorial on data link layer protocols, including bit stuffing, byte stuffing, error detection and correction using parity bits, Hamming encoding, and CRC. It details the processes of transmitting data with error-checking mechanisms and how to detect and correct errors in received data. Key examples illustrate the application of these concepts, including the generation of codewords and the use of CRC for error detection.

Uploaded by

Dhanya Ratheesh
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/ 4

TUTORIAL 2 – MODULE 2 - ANSWER KEY

1. A bit string, 0111101111101111110, needs to be transmitted at the data link layer. If


the flag used is 01111110, what is the string actually transmitted after bit stuffing?
Ans- Insert FLAG bits to the head and tail end. Insert zero after 5 consecutive 1’s
appear in data
01111110 011110111110011111010 01111110
2. Consider the following character encoding used in a data link protocol:
A: 01000111 B: 11100011 FLAG:01111110 ESC:11100000
Show the bit sequence transmitted for the sequence: A B ESC FLAG for the following
cases
(1) Character count
(2) Flag bytes with byte stuffing
(3) Starting and ending flag bytes with bit stuffing
Ans-
(1) Character count
A B ESC FLAG is the data to be send. The count is 5 according to character count
method. Therefore, add character count as 5 in bits to the head of data ie; 5 A B
ESC FLAG
5 A B ESC FLAG
00000101 01000111 11100011 11100000 01111110
(2) Flag bytes with byte stuffing
Insert FLAG to head and tail end of data A B ESC FLAG. As per the rule of byte
stuffing,
Add ESC before the data ESC
Add ESC before the data FLAG
Therefore, FLAG A B ESC ESC ESC FLAG FLAG
FLAG A B ESC ESC ESC FLAG FLAG
01111110 01000111 11100011 11100000 11100000 11100000 01111110 01111110
(3) Starting and ending flag bytes with bit stuffing
Insert FLAG to head and tail end of data A B ESC FLAG. Insert zero after 5
consecutive 1’s appear in data.
FLAG A B ESC FLAG FLAG
01111110 01000111 110100011 111000000 011111010 01111110
3. The data bits=10010. Generate codeword. Show how the receiver detects and corrects
error in the received bit stream 10110.[Hint: Insert the parity bits (obtained while
generating the codeword) in the correct positions to the received data 10110]
Ans- To generate codeword
Byte of data = 10010
To calculate parity bits: _ _ 1 _ 001 _ 0
Position 1: _ _ 1 _ 001 _ 0
Check bits 1,3,5,7,9,11. Even parity, so 0 in position 1.
0 _ 1 _ 001 _ 0
Position 2: 0 _ 1 _ 001 _ 0
Check bits 2,3,6,7,10,11. Even parity, so 0 in position 2.
001 _ 001 _ 0
Position 4: 001 _ 001 _ 0
Check bits 4,5,6,7,12. Odd parity, so 1 in position 4.
0011001 _ 0
Position 8: 0011001 _ 0
Check bits 8,9,10,11,12. Even parity, so 0 in position 8.
001100100
So the code word sent is 001100100
Received bit stream: 10110
Adding parity bits (as determined above) to positions 1,2,4,8: 001101100
Received codeword: 001101100
Finding & fixing single bit error:
To calculate parity bits: 001101100
Position 1: 001101100
Check bits 1,3,5,7,9,11. Even parity, so 0 in position 1 is correct.
Position 2: 001101100
Check bits 2,3,6,7,10,11. Odd parity, so 0 in position 2 is incorrect.
Position 4: 001101100
Check bits 4,5,6,7,12. Even parity, so 1 in position 4 is incorrect.
Position 8: 001101100
Check bits 8,9,10,11,12. Even parity, so 0 in position 8 is correct.
Position 2 & 4 are incorrect. Adding these positions 6 is where the error occurred
& it can be corrected. 001101100.
4. The codeword 11110101101 is received using hamming encoding algorithm. What was
the original code sent
Ans-
Codeword received = 11110101101
Checking positions of parity bits
Position 1: _1110101101
Check bits 1,3,5,7,9,11. Odd parity, so 1 in position 1 is correct
Position 2: 1_110101101
Check bits 2,3,6,7,10,11. Odd parity, so 1 in position 2 is correct
Position 4: 111_0101101
Check bits 4,5,6,7,12. Odd parity, so 1 in position 4 is correct
Position 8: 1111010_101
Check bits 8,9,10,11,12. Even parity, so 1 in position 8 is wrong. It should be 0
Position 8 is where the error occurred.

Original code word sent is11110100101


Data is 1010101

5. What is CRC. If the generating polynomial for CRC code is x3+x+1 the message word
is 11010011101100. Determine the check bits and the encoded word. How does the
receiver know that an error has occurred? What is the result of the receiver’s CRC
calculations?
Ans-
CRC (Cyclic Redundancy Check) is an error-detecting code commonly used in digital
networks and storage devices to detect accidental changes to digital data. Blocks of data
entering these systems get a short check value attached, based on the remainder of a
polynomial division of their contents.
Message M= 11010011101100
Generator G= x3+x+1
=1011
Therefore, k=4
Degree = k-1 = 4-1=3 (check bits)
Add 3 zeros to M
So M= 11010011101100000
Divide 11010011101100000 by 1011
After Division using XOR,
remainder is 00100

Transmitted bit/Encoded bit =


11010011101100000 XOR 00100
= 11010011101100100

At the receiver side,


Divide 11010011101100100 by 1011

Remainder is 0.
Therefore, no error.

You might also like