3
http://www.uandiStar.org http://www.uandiStar.org DATA LINK LAYER Packetizing Addressing Media Access Control Flow Control Error Control 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 CPS 422 Computer Networks THE PERSPECTIVE Faisal Amjad CPS 422 DATA LINK LAYER Faisal Amjad CPS 422 Data can be corrupted during transmission, for reliable communication errors must be detected and corrected ERROR DETECTION AND CORRECTION Faisal Amjad CPS 422 Faisal Amjad CPS 422 TYPES OF ERROR ERROR DETECTION SINGLE – BIT ERRORS 1-BIT ERROR One error detection mechanism could be the transmission of all data units, TWICE. Error detection uses the concept of BURST ERRORS SENT RECEIVED Length of Burst Error (5-bits) SENT “Redundancy”, which means adding extra bits to data for detecting errors at dest. The receiver puts the entire stream [data + redundancy] through a checking function If the bit stream passes checking criteria, Bits corrupted by burst error the data unit is accepted and redundant bits discarded. RECEIVED Faisal Amjad CPS 422 Faisal Amjad CPS 422

Computer Network No4 Data Link Layer From APCOMS [ UandiStar ]

Embed Size (px)

DESCRIPTION

Computer Networks

Citation preview

Page 1: Computer Network No4 Data Link Layer From APCOMS [ UandiStar ]

http://www.uandiStar.org

http://www.uandiStar.org

DATA LINK LAYER

Packetizing Addressing

Media Access Control

Flow Control Error Control

0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0

0 0 1 0 0 0 0 0

0 0 0 0 1 0 1 0

CPS 422Computer Networks

THE PERSPECTIVEFaisal Amjad CPS 422

DATA LINK LAYER

Faisal Amjad CPS 422

Data can be corrupted during transmission, forreliable communication errors must be detectedand corrected

ERROR DETECTION ANDCORRECTION

Faisal Amjad CPS 422 Faisal Amjad CPS 422

TYPES OF ERROR ERROR DETECTION

‰ SINGLE – BITERRORS 1-BIT ERROR

‰ One error detection mechanism could bethe transmission of all data units, TWICE.

‰ Error detection uses the concept of

‰ BURSTERRORS

SENT RECEIVED

Length of Burst Error (5-bits)SENT

“Redundancy”, which means adding extrabits to data for detecting errors at dest.

‰ The receiver puts the entire stream [data+ redundancy] through a checking function

‰ If the bit stream passes checking criteria,Bits corrupted by burst error the data unit is accepted and redundant

bits discarded.RECEIVED

Faisal Amjad CPS 422 Faisal Amjad CPS 422

Page 2: Computer Network No4 Data Link Layer From APCOMS [ UandiStar ]

http://www.uandiStar.org

http://www.uandiStar.org

1 0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 1 0 1 1 1 1 0 0 0 1 0 1

1 0 0 0 1 0 1 10 0 1 0 1 1 1 0

1 0 0 0 1 0 0 0

parit

y

ERROR DETECTION (Contd…)

‰ Types of error detectiontechniques

o Parity Checkƒ Simpleƒ Two-Dimensional

o Cyclic Redundancy Check (CRC)o Checksum

Simple Parity Check

‰ A redundant “Parity-bit” added toevery data unit

‰ In “Even” parity, the total number of1s

including the parity bit must be even.‰ In “Odd” parity, the total number of

1sincluding the parity bit must be Odd

Faisal Amjad CPS 422 Faisal Amjad CPS 422

Two-Dimensional Parity Check‰ Block of bits is organized in a table

(rows and columns)‰ Parity bits for each row and each

columncalculated and appended to the end ofrespective row/column.

Original data

1 0 1 0 0 1 1 0

1 0 0 0 1 0 1 1

0 0 1 0 1 1 1 0

Row

1 0 0 0 1 0 1 1

1 0 0 0 1 0 0 0

Column parity

Transmitted data

1 0 1 0 0 1 1 0

1 0 0 0 1 0 1 1

Faisal Amjad CPS 422 Faisal Amjad CPS 422

Cyclic Redundancy Check (CRC)‰ Based on “binary Division”‰ A sequence of redundant bits, called the CRC

Remainder or simply “CRC” is appended to theend of data unit.

‰ Resulting data unit becomes exactly divisibleby a second, “predetermined” binary numbercalled the “Divisor”.

Faisal Amjad CPS 422

CRC – Process‰ A string of n 0s (zeros) appended to the

data unit.‰ The divisor is n+1 bits long.‰ Elongated data unit is divided by the divisor,

using binary division. Remainder of this processis the CRC.

‰ The CRC replaces the n 0s appended earlier atthe beginning, and bit stream transmitted.

‰ The CRC may consist of all 0s.‰ The receiver divides the received stream by

the Divisor. If remainder is all 0s, no erroroccurred

Faisal Amjad CPS 422

Page 3: Computer Network No4 Data Link Layer From APCOMS [ UandiStar ]

http://www.uandiStar.org

http://www.uandiStar.org

Rec

eive

rSe

nder

CRC - Generation1 1 1 1 0 1 Quotient

Pre-determinedDivisor 1 1 0

11 0 0 1 0 0 0 0 0 Extra 0s1 1 0 1

1 0 0 01 1 0 1

1 0 1 01 1 0 1

1 1 1 01 1 0 1

0 1 10

0 0 00

1 1 0 01 1 0 1

CRC - Checking

Similar process – Remainder must be all 0s, for data tobe correct

CRC Divisor is represented as a polynomial e.g. in ourexample its equivalent polynomial is x3 + x2 + 1(1101)

0 0 1 Remainder / CRC

Original Data

Original Data + CRC

1 0 0 1 0 01 0 0 1 0 0 0 0 1

Faisal Amjad CPS 422 Faisal Amjad CPS 422

CHECKSUM Checksum - GenerationOriginal data

Faisal Amjad CPS 422

‰ Steps atSender

1 0 1 0 1 00

0 0 1 1 1 0 0

o The unit is divided into k sections, each n bits longo All sections are added using “1’s Compliment”o The resulting sum is complemented which becomes

the “Checksum”o Checksum is transmitted with the data. Transmitted data

1 0 1 0 1 0 010 0 1 1 1 0 0 11 1 1 0 0 0 100 0 0 1 1 1 01

Sum

Checksum

‰ Steps at Receivero The unit is divided into k sections, each n bits longo All sections are added using “1’s Compliment”o The resulting sum is complementedo If the result is zero, data is accepted.

1 0 1 0 1 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 01

1 0 1 0 1 0 0 10 0 1 1 1 0 0 10 0 0 1 1 1 0 1

Faisal Amjad CPS 422

1 1 1 1 1 1 110 0 0 0 0 0 00

Sum

Complement

ASSIGNMENT # 2‰ Write a note on the performance of fol:

o Simple Parity checko Two-Dimensional parity checko CRCo Checksum

Faisal Amjad CPS 422