Top Banner
ECE453 – Introduction to Computer Networks Lecture 4 – Data Link Layer (I)
17

ECE453 – Introduction to Computer Networks

Jan 04, 2016

Download

Documents

Arnaldo Cruz

ECE453 – Introduction to Computer Networks. Lecture 4 – Data Link Layer (I). Design Issues. Provide a well-defined service interface Group bits (PHY) into frames (DL) Deal with transmission errors Regulate the flow of frames. M. H. H. H. H. H. H. H. H. H. t. t. l. t. n. l. t. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ECE453 – Introduction to Computer Networks

ECE453 – Introduction to Computer Networks

Lecture 4 – Data Link Layer (I)

Page 2: ECE453 – Introduction to Computer Networks

Design Issues

Provide a well-defined service interfaceGroup bits (PHY) into frames (DL)Deal with transmission errorsRegulate the flow of frames

Page 3: ECE453 – Introduction to Computer Networks

phys. link

Link Layer: Setting the Context

two physically connected devices: host-router, router-router, host-host

unit of data: frameProtocols implemented in “adapter”application

transportnetwork

linkphysical

networklink

physical

M

M

M

M

Ht

HtHn

HtHnHl MHtHnHl

frame

data linkprotocol

adapter card

Page 4: ECE453 – Introduction to Computer Networks

Link Layer – The Logical & Physical Flows

Page 5: ECE453 – Introduction to Computer Networks

FramingCharacter countFlag bytes with byte stuffingStarting and ending flags with bit stuffing

Page 6: ECE453 – Introduction to Computer Networks

Framing – Byte Stuffing

Tightly tied to the used of 8-bit characters

Page 7: ECE453 – Introduction to Computer Networks

Framing – Bit Stuffing

Flag pattern: 01111110Sender stuff: add 0 after 11111Receiver destuff: delete 0 after 11111

Page 8: ECE453 – Introduction to Computer Networks

Error Detection and Correction1

Use redundancy Error detection and retransmission

Over low error rate media Error correction

Over high error rate media

Page 9: ECE453 – Introduction to Computer Networks

The Hamming DistanceCodewords (n bits): message (m bits) + check bits (r bits)Complete list of codewords?Hamming distance: the number of positions in which two codewords differHamming distance of the complete code: two codewords with the minimum Hamming distanceTo detect d errors, Hamming distance of the code: (d+1)To correct d errors, Hamming distance of the code: (2d+1)

Page 10: ECE453 – Introduction to Computer Networks

Parity Bit

Even parityOdd parity

A code with a single parity bit has a Hamming distance of ???It can be used to detect ??? errors

Page 11: ECE453 – Introduction to Computer Networks

Example

0000000000000001111111111000001111111111

The code has a Hamming distance of ???It can detect ??? errorsIt can correct ??? errors

Arrival Original0000000111 00000111110000000111 0000000000

Page 12: ECE453 – Introduction to Computer Networks

The Hamming Code

Theorem: Given a code with m message bits and r check bits (n=m+r) which allows all single errors to be corrected, the lower limit on r is (m+r+1)<=2r

Hamming code (the bits that are power of 2 are check bits, others are message bits, each check bit forces the parity of some collection of bits, including itself)

Can only correct single bit error

Page 13: ECE453 – Introduction to Computer Networks

Example - Hamming Code

10010000

Page 14: ECE453 – Introduction to Computer Networks

How to Correct Burst Errors

Uses kr check bits to make blocks of km data bits immune to a single burst error of length k or less

Page 15: ECE453 – Introduction to Computer Networks

Error Detecting Code - I

x x x x x x x ox x x x x x x ox x x x x x x ox x x x x x x ox x x x x x x ox x x x x x x ox x x x x x x oo o o o o o o o

Page 16: ECE453 – Introduction to Computer Networks

Error-Detecting Codes

Polynomial code (CRC – Cyclic Redundancy Check)

Generator polynomial G(x)

Message polynomial M(x) Method: append a

checksum of r bits to the end of M(x) such that the appended polynomial T(x) is divisible by G(x)Q(x) … R(x) = xrM(x)/G(x)

T(x) = xrM(x) + R(x)

Page 17: ECE453 – Introduction to Computer Networks

More on Polynomial Code

Single error detection?Double error detection?No polynomial with an odd number of terms is divisible by x+1A polynomial code with r check bits will detect all burst errors of length <=r

Burst error: at least the first and the last bits of a bit stream are wrong

Hardware implementation: shifted register circuitInternational standard of G(x)

X32+x26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+X1+1