You are on page 1of 48

PART III

Data Link Layer

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Position of the data-link layer

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Data link layer duties

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

LLC and MAC sublayers

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

IEEE standards for LANs

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Chapters
Chapter 10 Error Detection and Correction
Chapter 11 Data Link Control and Protocols
Chapter 12 Point-To-Point Access
Chapter 13 Multiple Access
Chapter 14 Local Area Networks
Chapter 15 Wireless LANs
Chapter 16 Connecting LANs
Chapter 17 Cellular Telephone and Satellite Networks
Chapter 18 Virtual Circuit Switching
McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Chapter 10

Error Detection
and
Correction
McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Note:
Data can be corrupted during
transmission. For reliable
communication, errors must be
detected and corrected.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

10.1 Types of Error

Single-Bit Error
Burst Error

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Note:
In a single-bit error, only one bit in the
data unit has changed.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

10.1

McGraw-Hill

Single-bit error

The McGraw-Hill Companies, Inc., 2004

Note:
A burst error means that 2 or more bits
in the data unit have changed.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

10.2

McGraw-Hill

Burst error of length 5

The McGraw-Hill Companies, Inc., 2004

10.2 Detection
Redundancy
Parity Check
Cyclic Redundancy Check (CRC)
Checksum
McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Note:
Error detection uses the concept of
redundancy, which means adding
extra bits for detecting errors at the
destination.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

10.3

McGraw-Hill

Redundancy

The McGraw-Hill Companies, Inc., 2004

10.4

McGraw-Hill

Detection methods

The McGraw-Hill Companies, Inc., 2004

10.5

McGraw-Hill

Even-parity concept

The McGraw-Hill Companies, Inc., 2004

Note:
In parity check, a parity bit is added to
every data unit so that the total
number of 1s is even
(or odd for odd-parity).

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Example 1
Supposethesenderwantstosendthewordworld.In
ASCIIthefivecharactersarecodedas
1110111 1101111 1110010 1101100 1100100
Thefollowingshowstheactualbitssent
1110111011011110111001001101100011001001

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Example 2
NowsupposethewordworldinExample1isreceivedby
thereceiverwithoutbeingcorruptedintransmission.
11101110110111101110010011011000
11001001
Thereceivercountsthe1sineachcharacterandcomesup
withevennumbers(6,6,4,4,4).Thedataareaccepted.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Example 3
NowsupposethewordworldinExample1iscorrupted
duringtransmission.
11111110110111101110110011011000
11001001
Thereceivercountsthe1sineachcharacterandcomesup
withevenandoddnumbers(7,6,5,4,4).Thereceiver
knowsthatthedataarecorrupted,discardsthem,andasks
forretransmission.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Note:
Simple parity check can detect all
single-bit errors. It can detect burst
errors only if the total number of
errors in each data unit is odd.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

10.6

McGraw-Hill

Two-dimensional parity

The McGraw-Hill Companies, Inc., 2004

Example 4
Supposethefollowingblockissent:
10101001001110011101110111100111
10101010

However,itishitbyaburstnoiseoflength8,andsome
bitsarecorrupted.
10100011100010011101110111100111
10101010

Whenthereceivercheckstheparitybits,someofthebits
donotfollowtheevenparityruleandthewholeblockis
The McGraw-Hill Companies, Inc., 2004
McGraw-Hill

Note:
In two-dimensional parity check, a
block of bits is divided into rows and a
redundant row of bits is added to the
whole block.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

10.7

McGraw-Hill

CRC generator and checker

The McGraw-Hill Companies, Inc., 2004

10.8

McGraw-Hill

Binary division in a CRC generator

The McGraw-Hill Companies, Inc., 2004

10.9

McGraw-Hill

Binary division in CRC checker

The McGraw-Hill Companies, Inc., 2004

10.10

McGraw-Hill

A polynomial

The McGraw-Hill Companies, Inc., 2004

10.11 A polynomial representing a divisor

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Table 10.1 Standard polynomials

McGraw-Hill

Name

Polynomial

Application

CRC-8

x8 + x2 + x + 1

ATM header

CRC-10

x10 + x9 + x5 + x4 + x 2 + 1

ATM AAL

ITU-16

x16 + x12 + x5 + 1

HDLC

ITU-32

x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10


+ x8 + x7 + x5 + x4 + x2 + x + 1

LANs

The McGraw-Hill Companies, Inc., 2004

Example 5
Itisobviousthatwecannotchoosex(binary10)orx2+x
(binary110)asthepolynomialbecausebotharedivisible
byx.However,wecanchoosex+1(binary11)because
itisnotdivisiblebyx,butisdivisiblebyx+1.Wecan
alsochoosex2+1(binary101)becauseitisdivisibleby
x+1(binarydivision).

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Example 6
TheCRC12
x12+x11+x3+x+1
whichhasadegreeof12,willdetectallbursterrors
affectinganoddnumberofbits,willdetectallburst
errorswithalengthlessthanorequalto12,andwill
detect,99.97percentofthetime,bursterrorswitha
lengthof12ormore.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

10.12

McGraw-Hill

Checksum

The McGraw-Hill Companies, Inc., 2004

10.13

McGraw-Hill

Data unit and checksum

The McGraw-Hill Companies, Inc., 2004

Note:
The sender follows these steps:
The unit is divided into k sections, each of n bits.
All sections are added using ones complement to get
the sum.
The sum is complemented and becomes the checksum.
The checksum is sent with the data.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Note:
The receiver follows these steps:
The unit is divided into k sections, each of n bits.
All sections are added using ones complement to get
the sum.
The sum is complemented.
If the result is zero, the data are accepted: otherwise,
rejected.
McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Example 7
Supposethefollowingblockof16bitsistobesentusinga
checksumof8bits.
1010100100111001
Thenumbersareaddedusingonescomplement
10101001
00111001

Sum 11100010
Checksum00011101
Thepatternsentis101010010011100100011101
McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Example 8
NowsupposethereceiverreceivesthepatternsentinExample7
andthereisnoerror.
101010010011100100011101
Whenthereceiveraddsthethreesections,itwillgetall1s,which,
aftercomplementing,isall0sandshowsthatthereisnoerror.
10101001
00111001
00011101
Sum

11111111

Complement

00000000meansthatthepatternisOK.

McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Example 9
Nowsupposethereisabursterroroflength5thataffects4bits.
101011111111100100011101
Whenthereceiveraddsthethreesections,itgets
10101111
11111001
00011101
PartialSum111000101
Carry
Sum

1
11000110

Complement00111001thepatterniscorrupted.
McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

10.3 Correction

Retransmission
Forward Error Correction
Burst Error Correction
McGraw-Hill

The McGraw-Hill Companies, Inc., 2004

Table 10.2 Data and redundancy bits

McGraw-Hill

Number of
data bits
m

Number of
redundancy bits
r

Total
bits
m+r

10

11

The McGraw-Hill Companies, Inc., 2004

10.14

McGraw-Hill

Positions of redundancy bits in Hamming code

The McGraw-Hill Companies, Inc., 2004

10.15

McGraw-Hill

Redundancy bits calculation

The McGraw-Hill Companies, Inc., 2004

10.16

McGraw-Hill

Example of redundancy bit calculation

The McGraw-Hill Companies, Inc., 2004

10.17

McGraw-Hill

Error detection using Hamming code

The McGraw-Hill Companies, Inc., 2004

10.18

McGraw-Hill

Burst error correction example

The McGraw-Hill Companies, Inc., 2004

You might also like