Lecture 5

staff.fisika.ui.ac.id

Lecture 5

Direct Link Networks

Adhi Harmoko S, M.Komp

1


Nodes

• general purpose computers

• dekstop workstation

• PC

CPU

Cache

Network

Adapter

to network

Memory

IO BUS

2


Link Layer

• Two nodes (hosts, sw elts) connected by a single link

• a physical medium carrying signals in the form of

electromagnetic wave

• binary data encoded signal

• Framing and packet format

• CO or CL service interface

• Reliability

• Flow control

3


• Link layer packet = frame

Link Layer - Framing

• Problem: how to recognize beginning and end of frame

• Three methods

• byte counting (DDCMP)

• byte stuffing/oriented (BISYNCH, IMP-IMP)

• bit stuffing/oriented (X.25 Level 2, 802.x)

4


Byte Counting

• Include count field giving number of bytes in frame

• Problem: what if byte field is corrupted

• Might be able to catch with CRC… but only if max

length assumed

SYN…Count Header Body

CRC

5


Byte Stuffing/Oriented

• Special characters used for control

• Must distinguish special characters when used for

control from when in data

• Use special data link escape character, DLE

• E.g., STX = start of text… use DLE STX when STX is in

data (stuff DLE before STX if it appears in data (also for

SOH, ETX,...)

• If DLE in data, send DLE DLE

6


Byte Stuffing Problems

• Dependence on fixed character set

• Must examine every byte of data on sending and

receiving (insert / remove DLE)

• Was used widely in IBM bisynch (at 9600bps)

7


Bit Stuffing/Oriented

• Frame beginning and end marked by special bit string

…. usually 01111110

• If 5 1’s in data to be sent, sender inserts 0

• If receiver sees 5 1’s check next bit(s)

• if 0, remove it (stuffed bit)

• if 10, end of frame marker (01111110)

• if 11, error (7 1’s cannot be in data)

• Can be done fast in hardware

FLAG Header Body …

CRC FLAG

8


Error Detection

Cyclic Redundancy Check (CRC)

• Bitwise binary arithmetic

0 + 0 = 1 + 1 = 0

0 + 1 = 1 + 0 = 1

• Addition and subtraction are same operation

• Example

11011000

+/- 10001001

01010001

9


CRC

• Represent n bit message as an n-1 degree polynomial

• Message M = 101101101

M(x) = x 8 + x 6 + x 5 + x 3 + x 2 + 1

• Special generator polynomial, C(x), degree k

• C(x) chosen to have special properties - this is key to

the method working well

10


CRC - Method

• Pad M with k 0s yielding M’ (k = deg C(x))

• Represent M’ as M’(x)

• R(x) = rem ( M’(x) / C(x))

• P = M’ + R (P(x) = M’(x) + R(x))

• Transmit P (P(x))

• At dest, receive P(x) + E(x)

• Compute rem (P(x) + E(x)) / C(x)

• If 0, either message rec ok or C(x) divides E(x)

• If not 0, then error in transmission

11


• Consider C(x) = x 3 + x 2 + 1

• M(x) = x 7 + x 4 + x 3 + x

• M’ = 10011010000

Shift Register

1 0 0 1

+ +

1010000

x 3 x 2 x 1 1

The shift register performs long division using bitwise

operations - M’ / C

12


Shift Register

• Consider C(x) = x 6 + x 5 + x 3 + x +1

• M’ = 10110110101000000

0101000000

1 + 0 1 + 1 0 + 1 + 1

x 6 x 5 x 4 x 3 x 2 x 1

The shift register performs long division using bitwise

operations - M’ / C

13


Shift Register CRC-CCITT

CCITT

14


Properties of C(x): Should not divide E(x) ) for

common errors

• Single bit errors

• non-zero x k , x 0 terms

• Double (2 consecutive) bit errors

• C(x) has factor with at least 3 terms

• Odd number errors: contains factor (x+1)

• consider E(x) with odd no. terms - so E(1) = 1

• but if (x+1) is factor of E, then E(1) = 0

• so if odd number of errors, E cannot have (x+1)

factor

15


More on C(x)

• Burst error - at least first and last bits of burst are in

error

• if length of burst is


Reliable Transmission

• When CRC detects error, frame discarded

• Corrected by link layer retransmission - ARQ

(Automatic Repeat reQuest)

• mechanisms include: frame sequence numbers,

acknowledgements (acks), negative acks (naks),

selective acks (sacks), timers / timeout

• often implemented by sliding window

• Also used by transport layer - but link impl simpler -

wire connects protocol entities

17

More magazines by this user
Similar magazines