Sunteți pe pagina 1din 151

EC3023 COMPUTER NETWORKS Lecture 2: The Data Link Layer

1/23/2014

2: Data Link Layer

2-1

Layering E a!"#e: the $nternet


Each #ayer take% &ata 'r(! a)(*e a&&% hea&er in'(r!ati(n t( create ne+ &ata unit ,"r(t(c(# &ata unit PDU"a%%e% ne+ &ata unit t( #ayer )e#(+ source
M Ht M Hn Ht M Hl Hn Ht M

destination application Ht transport Hn Ht network Hl Hn Ht link physical


M M M M message segment datagram frame

application transport network link physical

1/23/2014

2: Data Link Layer

2-2

$nternet Pr(t(c(# .rchitecture


The TCP/$P "r(t(c(# %uite i% the )a%i% '(r the net+(rk% that +e ca## the $nternet0 The TCP/$P %uite ha% '(ur #ayer%: .""#icati(n1 Tran%"(rt1 Net+(rk1 an& ,Data- Link Layer0 C(!"uter% ,h(%t%i!"#e!ent a## '(ur #ayer%0 R(uter% ,gate+ay%- (n#y ha*e the )(tt(! t+( #ayer%0
Application Layer Transport Layer Network Layer (Data) Link Layer

telnet, ftp, email

TCP, UDP

IP, ICMP, IGMP

Device Drivers

Physical Layer (not our focus)


1/23/2014 2: Data Link Layer 2-3

source
message segment
Ht M M M M

Enca"%u#ati(n

datagram Hn Ht frame Hl Hn Ht

applicatio n transport network link physical

link physical switch

destination
M Ht Hn Ht Hl Hn Ht M M M

applicatio n transport network link physical

Hn Ht Hl Hn Ht

M M

network link physical

Hn Ht

router

1/23/2014

2: Data Link Layer

1.4 2-4

Layering: #(gica# c(!!unicati(n

Each #ayer: &i%tri)ute& 2entitie%3 i!"#e!ent #ayer 'uncti(n% at each n(&e entitie% "er'(r! acti(n%1 e change !e%%age% +ith "eer%
1/23/2014

application transport network link physical application transport network link physical network link physical

application transport network link physical

application transport network link physical

2: Data Link Layer

2-5

Layering: #(gica# c(!!unicati(n


data application transport transport network link physical application transport network link physical ack data network link physical data application transport transport network link physical

E0g0: tran%"(rt take &ata 'r(! a"" a&& a&&re%%ing1 re#ia)i#ity check in'( t( '(r! 2%eg!ent%3 %en& %eg!ent% t( "eer +ait '(r "eer 1/23/2014 t( ack recei"t

application transport network link physical

2: Data Link Layer

2-6

Layering: "hy%ica# c(!!unicati(n

data application transport network link physical application transport network link physical network link physical data application transport network link physical

application transport network link physical

1/23/2014

2: Data Link Layer

2-7

Path (' a +e) "age re4ue%t an& enca"%u#ati(n

1/23/2014

2: Data Link Layer

2-8

Ty"e% (' Packet5 Packet5%+itche& net+(rk%


&atagra! net+(rk ,a0k0a0 CLN-:
&e%tinati(n a&&re%% &eter!ine% ne t h("
r(ute% !ay change &uring %e%%i(n E0g01 the $nternet

*irtua# circuit net+(rk ,a0k0a0 CON-:


each "acket carrie% tag ,*irtua# circuit $D-1 tag &eter!ine% ne t h(" 'i e& "ath &eter!ine& at ca## %etu" ti!e1 re!ain% 'i e& thru ca## r(uter% !aintain "er5ca## %tate E0g01 .TM1 6ra!e Re#ay1 7528

1/23/2014

2: Data Link Layer

2-9

9irtua# circuit net+(rk


PS1
Incoming interface Incoming VC # Outgoing interface Outgoing VC #

B A 1 PS1 3 2 PS2

1 2 3 1
-

12 63 7 97
-

3 1 2 3
-

22 18 17

PS3
87
-

PS4

1/23/2014

2: Data Link Layer

2-10

The Data Link Layer

O*er*ie+:
#ink #ayer %er*ice% 6ra!ing err(r &etecti(n : c(rrecti(n !u#ti"#e acce%% "r(t(c(#% ,!e&iu! %haringL.N techn(#(gy #ink #ayer a&&re%%ing : .RP hu)%1 )ri&ge%1 %+itche% %"eci'ic #ink #ayer techn(#(gie%: Ethernet $EEE ;020<< L.N

1/23/2014

2: Data Link Layer

2-11

Link Layer: %etting the c(nte t

1/23/2014

2: Data Link Layer

2-12

Link Layer: %etting the c(nte t


two physica y connecte! !e"ices# host-router$ router-router$ host-host unit of !ata# frame imp emente! in %a!apter& e'g'$ (C)CI* car!$ +thernet car! typica y inc u!es# ,*)$ -.( chips$ host /us interface$ an! in0 interface

M Ht M Hn Ht M Hl Hn Ht M

application transport network link physical

data link Protocol (frames) phys. Link (bits) adapter card

network link physical

Hl Hn Ht M frame
2: Data Link Layer 2-13

1/23/2014

Link Layer Ser*ice%


1raming$ in0 access# encapsu ate !atagram into frame - a!!ing hea!er$ trai er imp ement channe access if share! me!ium$ 2physica a!!resses3 use! in frame hea!ers to i!entify source$ !est 4 !ifferent from I( a!!ress5 ,e ia/ e !e i"ery /etween two physica y connecte! !e"ices# Imp emente! at mu tip e ayers - 6in0$ 7ransport$ an! *pp ication 6ayers (rincip es are the same at a ayers - -ifferent *,8 schemes se !om use! on ow /it error in0 9fi/er$ some twiste! pair: wire ess in0s# high error rates 4 8# why /oth in0- e"e an! en!-en! re ia/i ity;

1/23/2014

2: Data Link Layer

2-14

Link Layer Ser*ice% ,c(nt001 ow Contro # pacing /etween sen!er an! recei"er 9 earne! in 7ransport ayer: +rror -etection# errors cause! /y signa attenuation$ noise' recei"er !etects presence of errors# 4 signa s sen!er for retransmission or !rops frame +rror Correction# recei"er i!entifies an! corrects /it error9s: without resorting to retransmission
1/23/2014 2: Data Link Layer 2-15

N(&e%

N(&e% are ('ten genera# "ur"(%e c(!"uter% (r +(rk %tati(n% Can )e en& h(%t% (r can )e c(n'igure& t( )e r(uter% Each n(&e c(nnect% t( the net+(rk *ia a net+(rk a&a"t(r0The a&a"t(r %it% (n the %y%te! $/O )u% an& &e#i*er% &ata )et+een +(rk%tati(n=% !e!(ry an& net+(rk #ink0 . %('t+are !(&u#e running (n the +(rk %tati(n ,&e*ice &ri*er- !anage% the a&a"t(r

1/23/2014

2: Data Link Layer

2-16

Link Layer: Implementation


Implemented in adapter e.g., PCMCIA card, Ethernet card typically includes: RAM, DSP chips, host bus interface, and link interface

M Ht Hn Ht Hl Hn Ht

application M transport network M link M physical

data link protocol

network link physical

Hl Hn Ht M frame

phys. link adapter card


1/23/2014

2: Data Link Layer

2-17

Adaptors Communicating
datagram sending node frame adapter link layer protocol frame adapter rcving node

link layer implemented in adaptor (aka NIC)


Ethernet card, PCMCI card, 802.11 card

receiving side
looks for errors, rdt, flow control, etc extracts datagram, passes to rcving node

sending side:

encapsulates datagram in adapter is semiautonomous a frame adds error checking bits, link & physical layers rdt, flow control, etc.
2: Data Link Layer 2-18

1/23/2014

Link Layer Adapter

1/23/2014

2: Data Link Layer

2-19

Direct Link ,P(int5 ,P(int5t(5 t(5P(int- Net+(rk%

Si!"#e%t net+(rk "(%%i)#e1 c(n%i%ting (' t+( h(%t% an& (ne #ink L((k int( &i''erent 'uncti(n% at the #ink #e*e#
Enc(&ing 6ra!ing Err(r &etecti(n/c(rrecti(n Re#ia)#e &e#i*ery Me&ia acce%% c(ntr(#

Host A

physical Link

Host B

1/23/2014

2: Data Link Layer

2-20

Enc(&ing
Ma" )inary )it% int( %igna#% E a!"#e: L(+ %igna# re"re%ent% a 01 high %igna# re"re%ent% a < N(nReturn5t(5>er( ,NR>-

Pr()#e!: L(ng "eri(&% (' %i#ence ,?er(- (r high %igna#% are "(%%i)#e
C#(ck rec(*ery ,recei*er #(%e% c#(ck %ynchr(ni?ati(n-

1/23/2014

2: Data Link Layer

Enc(&ing: M(re Sche!e%


NR> $n*erte& ,NR>$-: S+itch 'r(! current %tate t( re"re%ent a < Manche%ter: 7OR the )it %trea! +ith the c#(ck

1/23/2014

2: Data Link Layer

2-22

@A/8A Enc(&ing Sche!e


Enc(&e @5)it %y!)(#% int( 85)it c(&e% 2@ %y!)(#% !u%t )e !a""e& t( 2@ c(&e+(r&% (ut (' the "(%%i)#e 28 Each c(&e+(r& ha% n( !(re than (ne %tarting ?er(1 an& n( !(re than t+( trai#ing ?er(% N( !(re than 35c(n%e4uti*e ?er(% Then u%e NR>$ t( %(#*e the c(n%ecuti*e <% "r()#e! ;0B e''iciency ,< )it i% (*erhea&1/23/2014

2: Data Link Layer

2-23

E a!"#e (' @A/8A Enc(&ing


@5)it &ata %y!)(# 85)it c(&e <<<< <<<1 <<1< <<11 <1<< <1<1 <11< <111 1111< <1<<1 1<1<< 1<1<1 <1<1< <1<11 <111< <1111 @5)it &ata %y!)(# 85)it c(&e 1<<< 1<<1 1<1< 1<11 11<< 11<1 111< 1111 1<<1< 1<<11 1<11< 1<111 11<1< 11<11 111<< 111<1

1/23/2014

2: Data Link Layer

2-24

6ra!ing
The "r(ce%% (' gr(u"ing )it% int( 'ra!e% ,!e%%age% (r "acket%Ty"ica##y i!"#e!ente& )y the net+(rk a&a"t(r Why 'ra!e%C

1/23/2014

2: Data Link Layer

Ayte5 Ayte 5Oriente& 6ra!ing


A$SDNC: Ainary %ynchr(n(u% c(!!unicati(n
6ra!e i% a c(##ecti(n (' )yte% Nee& t( in&icate the )eginning an& en& (' a 'ra!e Sentine# character% are u%e&

SDN: Synchr(ni?ati(n character SOE: Start (' hea&er ST71 ET7: Start (' te t1 En& (' te t CRC: Cyc#ic re&un&ancy check AEF$N Marker )it %trea! can a""ear in the 'ra!e
1/23/2014 2: Data Link Layer 2-26

Ayte5 Ayte 5c(unting 6ra!ing


$nc#u&e the G (' )yte% in the 'ra!e a% a 'ie#& in the hea&er Digita# Data C(!!unicati(n% Pr(t(c(# ,DDCMP-

C(unt: S"eci'ie% G (' )yte% in the )(&y CRC en%ure% that c(unt 'ie#& i% n(t c(rru"te&
1/23/2014 2: Data Link Layer 2-27

Ait5 Ait 5(riente& 6ra!ing


Eigh5Le*e# Data Link C(ntr(# ,EDLC-

Aeginning/en& (' 'ra!e1 '#ag: 0<<<<<<0 $n%tea& (' in%erting )yte% &( )it %tu''ing Sen&er a&&% a 0 a'ter 'i*e c(n%ecuti*e <% Recei*er re!(*e% ?er( a'ter 'i*e <%

1/23/2014

2: Data Link Layer

2-28

E a!"#e (' Ait5 Ait5%tu''ing


Sen&er <<<<<<0<<<<<<<<<<<0<<<<<0

0 0 0 Recei*er 0 <<<<<0<0<<<<<0<<<<<0<0<<<<<00
Length (' 'ra!e 9aria)#e1 &e"en&% (n the &ata We can ca#cu#ate an& ("ti!i?e the (*erhea& (' )it %tu''ing

1/23/2014

2: Data Link Layer

2-29

Ait Err(r% in a Link


Ty"e% (' err(r%
$%(#ate& err(r%: Ait err(r% that &( n(t a''ect (ther )it% Aur%t err(r%: . c#u%ter (' )it% in +hich a nu!)er (' err(r% (ccur

Aur%t err(r% increa%e +ith &ata rate


<H% (' i!"u#%e n(i%e (r 'a&ing e''ect +i## a''ect
.t !(%t 2 )it% +hen &ata rate i% <M)"% .t !(%t <0< )it% +hen &ata rate i% <00M)"%
1/23/2014 2: Data Link Layer 2-30

E(+ O'ten &( Err(r% OccurC


Let t+( in&e"en&ent e*ent% ha*e "r()a)i#ity "1 4 Pr()a)i#ity (' either e*ent i%: < 5 ,< 5 "-,< 5 4- I " J 4 K "4 L " J 41 '(r "1 4 %!a## AER I <05M1 an& a 'i#e i% <0@ #(ng1 then the "r()a)i#ity (' a %ing#e err(r i% <0@ <05M I <053 Pr()a)i#ity (' e act#y t+( err(r%0 6(r t+( )it% i1 N the "r()a)i#ity (' err(r i% <05M <05M T(ta# G (' "air%:
104 4 4 7 ( ) = 10 10 1 / 2 5 10 2

Pr()a)i#ity (' t+( err(r%: 8

<0M

<05<@ I 8

<05M
2: Data Link Layer 31

1/23/2014

Dea#ing +ith Err(r%


Recei*er !u%t )e a+are that an err(r (ccurre& in a 'ra!e Nee& t( ha*e an err(r &etecti(n !echani%! Recei*er !u%t recei*e the c(rrect 'ra!e T+( "(%%i)#e %trategie% .&& in'(r!ati(n re&un&ancy t( c(rrect err(r% ,err(r c(rrecting c(&e%.%k %en&er t( re5%en& 'ra!e ,retran%!i%%i(n %trategie%$n "ractice )(th are e!"#(ye&
1/23/2014 2: Data Link Layer 32

Err(r Detecti(n
EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking may include header fields Error detection not !""# reliable$ protocol may miss some errors but rarely larger EDC field yields better detection and correction

1/23/2014

2: Data Link Layer

2-33

Err(r Detecti(n
Sing#e "arity check%
.""en& a %ing#e "arity )it at en& (' 'ra!e0 Parity i% < i' G (' (ne% i% (&&1 an& ?er( (ther+i%e E a!"#e: 0 < < 0 < 0 < 0 < < 0 0 "arity Sing#e "arity check can &etect any (&& G (' err(r% Cann(t te## +here the err(r t((k "#ace (r h(+ !any (ccurre& N(t u%e'u# '(r )ur%t err(r%
1/23/2014 2: Data Link Layer 2-34

$nternet check%u!
%oal& detect 'errors( (e)g) flipped bits) in transmitted segment Sen&er:
treat %eg!ent c(ntent% a% %e4uence (' <O5)it integer% check%u!: a&&iti(n ,<=% c(!"#e!ent %u!- (' %eg!ent c(ntent% %en&er "ut% check%u! *a#ue int( UDP check%u! 'ie#&
1/23/2014

Recei*er:
c(!"ute check%u! (' recei*e& %eg!ent check i' c(!"ute& check%u! e4ua#% check%u! 'ie#& *a#ue: NO 5 err(r &etecte& DES 5 n( err(r &etecte&0 P0

5:Data DataLink 2: Link Layer

2-35

Cyc#ic Re&un&ancy Check ,CRC*!! 0 re!un!ant /its on a n-/it message


-esign goa 0==n so that o"erhea! is ow +>amp e# 32-/it C,C a!e?uate for 12$<<< /its 91$@<<: /ytes

,epresent 9nA1:-/it messages as n !egree po ynomia s +>amp e# 1<<11<1< maps to >7 A >B A >3 A >1 7he /its of the message to /e transmitte! /ecome the coefficients of the po ynomia
1/23/2014 2: Data Link Layer 36

P(#yn(!ia# .rith!etic
.ny "(#yn(!ia# A, - i% &i*i%i)#e )y a "(#yn(!ia# C, - i' &eg,A- Q &eg,C- C, - i% ca##e& the &i*i%(r $' C, - an& A, - are (' the %a!e &egree1 the re!ain&er i% ()taine& )y %u)tracting C, - 'r(! A, M(&u#( 2 arith!etic1 %u)tracti(n i% an 7OR ("erati(n )et+een c(e''icient% E a!"#e A, - I 3 J <1 C, - I 3 J 2 J < Re!ain&er: R, - I 2 A, - I <00<1 C, - I<<0<1 R, - I 0<00 ,7OR (' A, -1 C, -2: Data Link Layer 2-37

1/23/2014

CRC Ca#cu#ati(n
F(a#: 6(r !e%%age M, -1 an& &i*i%(r C, -1 c(n%truct "(#yn(!ia# P, - that i% &i*i%i)#e )y C, C, - kn(+n t( )(th %en&er an& recei*er Pr(ce%%:
Ste" <: !u#ti"#y M, - )y k ,a&& k ?er(% at the en& (' !e%%agean& ()tain T, - 0 k i% the &egree (' C, -0 Ste" 2: Di*i&e T, - )y C, Ste" 3: Su)tract the re!ain&er R, - 'r(! T, -0 Ste" @: O)tain P, - I M, -RR, - &i*i%i)#e )y C, -

1/23/2014

2: Data Link Layer

2-38

E a!"#e: CRC Ca#cu#ati(n


M I <00<<0<01 C, - I
3

J<

T, - I <00<<0<0 R 000 R, - I <0< P, - I <00<<0<0 R <0<

1/23/2014

2: Data Link Layer

2-39

Se#ecti(n (' C, Ait err(r% can )e %een a% a "(#yn(!ia# E, - a&&e& t(

P, Err(r re!ain% un&etecte& i' E, - i% &i*i%i)#e )y C, Sing#e5)it err(r%: E, - I


i1 k1 0

c(e''icient% are

n(n?er(1 a## %ing#e5)it err(r% &etecte& D(u)#e5)it err(r%: C, - ha% a 'act(r +ith at #ea%t 3 ter!% O&& nu!)er err(r%: C, - c(ntain% the 'act(r , J<-

1/23/2014

2: Data Link Layer

2-40

C(!!(n#y U%e& CRC%


CRC C,C-8 C,C-1< C,C-12 C,C-16 C,C-CCI77 C,C-32

C, >8 A >2 A > A 1 >1< A >9 A >@ A >B A > A 1 >12 A >11 A >3 A >2 A 1 >16 A >1@ A >2 A 1 >16 A >12 A >@ A 1 >32 A >26 A >23 A >22 A >16 A >12 A >11 A >1< A >8 A >7 A >@ A >B A >2 A > A1

1/23/2014

2: Data Link Layer

2-41

Mu#ti"#e .cce%% "r(t(c(#%


%ing#e %hare& c(!!unicati(n channe# (n#y (ne n(&e can %en& %ucce%%'u##y at a ti!e $' !(re than t+( n(&e% tran%!it 'ra!e% at the %a!e ti!e1 +e %ay a c(##i%i(n ha% (ccurre& n(ne (' the recei*ing n(&e% can !ake any %en%e .## 'ra!e% in*(#*e& in the c(##i%i(n are #(%t an& the channe# ti!e i% +a%te& Main cha##enge: h(+ t( c((r&inate the acce%% (' !u#ti"#e %en&ing n(&e%C Me&ia acce%% c(ntr(# "r()#e!

!u#ti"#e acce%% "r(t(c(#:


.#%( ca##e& M.C "r(t(c(# &i%tri)ute& a#g(rith! that &eter!ine% h(+ %tati(n% %hare channe#1 i0e01 &eter!ine +hen %tati(n can tran%!it c(!!unicati(n a)(ut channe# %haring !u%t u%e channe# it%e#'S
1/23/2014 2: Data Link Layer 2-42

M.C Pr(t(c(#%: a ta (n(!y Three )r(a& c#a%%e%: Channe# Partiti(ning &i*i&e channe# int( %!a##er 2"iece%3 ,ti!e %#(t%1 're4uencya##(cate "iece t( n(&e '(r e c#u%i*e u%e Ran&(! .cce%% a##(+ c(##i%i(n% 2rec(*er3 'r(! c(##i%i(n% 2Taking turn%3 tight#y c((r&inate %hare& acce%% t( a*(i& c(##i%i(n%

Goal: efficient, fair, simple, decentrali ed


1/23/2014 2: Data Link Layer 2-43

Channe# Partiti(ning M.C "r(t(c(#%


Thi% channe# %haring "r(ce%% i% kn(+n a% !u#ti"#e ing in +ire& c(!!unicati(n %y%te!% ,TDM1 6DM %tu&ie& in cha"ter <-1 an& !u#ti"#e acce%% in +ire#e%% &igita# c(!!unicati(n%0 Three )a%ic c#a%%e%: 6DM.: in&i*i&ua# u%er% are i&enti'ie& )y a%%igning &i''erent 're4uency %#(t% TDM.: u%er% are gi*en &i''erent ti!e %#(t%T e0g01 FSM &igita# ce##u#ar %y%te! CDM.: u%er% are gi*en the %a!e ti!e an& genera# 're4uency %#(t%1 an& are i&enti'ie& )y &i''erent c(&e%T e0g01 $S5U8 &igita# ce##u#ar %y%te! C(!)inati(n% (' the a)(*e
2: Data Link Layer

1/23/2014

2-44

1/23/2014

2: Data Link Layer

2-45

Ran&(! .cce%% Pr(t(c(#%


When n(&e ha% "acket t( %en&
tran%!it at 'u## channe# &ata rate R0 n( a "ri(ri c((r&inati(n a!(ng n(&e%

t+( (r !(re tran%!itting n(&e% 2c(##i%i(n31 ran&(! acce%% M.C "r(t(c(# %"eci'ie%:
h(+ t( &etect c(##i%i(n% h(+ t( rec(*er 'r(! c(##i%i(n% ,e0g01 *ia &e#aye& retran%!i%%i(n%-

E a!"#e% (' ran&(! acce%% M.C "r(t(c(#%:


%#(tte& .LOE. .LOE. CSM.1 CSM./CD1 CSM./C.
1/23/2014 5: DataLink Layer 2-46

S#(tte& .LOE.
.%%u!"ti(n% a## 'ra!e% %a!e %i?e ti!e i% &i*i&e& int( e4ua# %i?e %#(t%1 ti!e t( tran%!it < 'ra!e n(&e% %tart t( tran%!it 'ra!e% (n#y at )eginning (' %#(t% n(&e% are %ynchr(ni?e& i' 2 (r !(re n(&e% tran%!it in %#(t1 a## n(&e% &etect c(##i%i(n
1/23/2014

O"erati(n +hen n(&e ()tain% 're%h 'ra!e1 it tran%!it% in ne t %#(t n( c(##i%i(n1 n(&e can %en& ne+ 'ra!e in ne t %#(t i' c(##i%i(n1 n(&e retran%!it% 'ra!e in each %u)%e4uent %#(t +ith "r()0 " unti# %ucce%%
2: Data Link Layer 2-47

Ran&(! .cce%% M.C "r(t(c(#% 5 S#(tte& .#(ha


. n(&e tran%!it% at ran&(! ,ie1 n( a "ri(ry c((r&inati(n a!(ng n(&e%- at 'u## channe# &ata rate R0 Ti!e i% &i*i&e& int( e4ua# %i?e %#(t% ,I 'u## 'ra!e %i?ea 're%h 'ra!e i% tran%!itte& at the )eginning (' the ne t %#(t i' c(##i%i(n (ccur% ,a%%u!e channe# 'ee&)ack1 e0g01 the recei*er in'(r!% the %(urce (' a c(##i%i(n-1 the %(urce retran%!it% the 'ra!e at each %#(t +ith "r()a)i#ity "1 unti# %ucce%%'u#0 Succe%% ,S-1 C(##i%i(n ,C-1 E!"ty ,E- %#(t% $% S5.LOE. channe# uti#i?ati(n e''icientCT i% it 'u##y &ecentra#i?e&C

1/23/2014

2: Data Link Layer

2-48

S#(tte& .#(ha e''iciency


Efficiency is the long*run fraction of successful slots when there are many nodes each with many frames to send

1/23/2014

5: DataLink Layer

2-49

E''iciency (' %#(tte& .LOE.


6(r %i!"#icity (' the &eri*ati(n1 +e a%%u!e that each n(&e a#+ay% ha% a 'ra!e t( %en& an& that the n(&e tran%!it% +ith "r()a)i#ity " '(r a 're%h 'ra!e a% +e## a% '(r a c(##i&e& 'ra!e $' there are N %tati(n%1 an& each tran%!it% in each %#(t +ith "r()a)i#ity "1 the "r()a)i#ity (' %ucce%%'u# tran%!i%%i(n S i%:

S I Pr() ,e act#y (ne tran%!it%- I N " ,<5"- ,N5<T( ()tain !a i!u! e''iciency1 O"ti!a# *a#ue (' " : " I </N 6(r e a!"#e1 i' NI21 S!a I 08 6(r N *ery #arge (ne 'in&% SI </e ,a""r( i!ate#y1 03M2: Data Link Layer

1/23/2014

2-50

Pure .LOE.
S#(tte& .LOE. re4uire% %#(t %ynchr(ni?ati(n . %i!"#er *er%i(n1 "ure .LOE.1 &(e% n(t re4uire %#(t% . n(&e tran%!it% a 're%h 'ra!e i!!e&iate#yT retran%!it% a c(##i&e& 'ra!e i!!e&iate#y +ith "r() " (r a'ter a 'ra!e &urati(n +ith "r() ,<5"C(##i%i(n "r()a)i#ity increa%e% ,'ra!e can c(##i&e +ith (ther 'ra!e% +hich are tran%!itte& +ithin a +in&(+ t+ice a% #arge a% in S5.#(haframe sent at t" collides with other frames sent in +t"* ! t",!Thr(ugh"ut i% re&uce& )y (ne ha#'1 i0e01 SI </2e

1/23/2014

2: Data Link Layer

2-51

.%%u!"ti(n% (' Pure .#(ha


Cew arri"a s of pac0ets at each host are transmitte! imme!iate y *rri"a s are (oisson with tota rate D If a pac0et is in"o "e! in a co ision it is retransmitte! after a ran!om perio! of time' Co!e /ecomes /ac0 ogge! ,ecei"ers pro"i!es fee!/ac0 on recei"e! pac0et to imp ement the co ision !etection 9we 0now a co ision happene!: Co /uffering# * /ac0 ogge! no!e !oes not /uffer any arri"ing pac0ets Or the set of no!es accessing the me!ium is infinite
1/23/2014 2: Data Link Layer 2-52

C(##i%i(n% Occurence
Packet% arri*a#: P(i%%(n +ith rate F V W "acket%/t0

t t1 t2 t3 t4
retransmission 9u#nera)#e "eri(&: 2t

t5

collision

1/23/2014

2: Data Link Layer

2-53

.#(ha Thr(ugh"ut
Pr()a)i#ity that k 'ra!e% are generate& +ithin the unit (' ti!e t k e Gt (Gt ) G k e G , P [N (t ) = k ] = P [N (1 ) = k ] = k! k! Pr()a)i#ity that n( tra''ic i% generate& +ithin 2t

P [N (2 ) = 0 ] = e 2 G

.#(ha thr(ugh"ut: .rri*a# rate ti!e% %ucce%% "r()a)i#ity S = Ge 2 G


1/23/2014 2: Data Link Layer 2-54

Pure *%0 S#(tte& .#(ha

1/23/2014

2: Data Link Layer

2-55

CSM. ,Carrier Sen%e Mu#ti"#e .cce%%CSM.: #i%ten )e'(re tran%!it: $' channe# %en%e& i&#e: tran%!it entire 'ra!e $' channe# %en%e& )u%y1 &e'er tran%!i%%i(n

Eu!an ana#(gy: &(n=t interru"t (ther%S

1/23/2014

5: DataLink Layer

2-56

Carrier %en%e !u#ti"#e acce%% ,CSM.CSM.: #i%ten )e'(re tran%!it0 $' channe# i% %en%e& )u%y1 &e'er tran%!i%%i(n Per%i%tent CSM.: retry i!!e&iate#y +ith "r()a)i#ity " +hen channe# )ec(!e% i&#e ,thi% !ay cau%e in%ta)i#ityN(n "er%i%tent CSM.: retry a'ter ran&(! inter*a# N(te: c(##i%i(n% !ay %ti## e i%t1 %ince t+( %tati(n% !ay %en%e the channe# i&#e at the %a!e ti!e $n ca%e (' c(##i%i(n1 the entire 'ra!e tran%!i%%i(n ti!e i% +a%te&
1/23/2014 2: Data Link Layer 2-57

CSM. c(##i%i(n%
spatial layout of nodes

collisions can still occur&


propagation delay means two nodes may not hear each other.s transmission

collision& note&

entire packet transmission time wasted role of distance / propagation delay in determining collision probability

1/23/2014

2: Data Link Layer

2-58

CSM./CD ,C(##i%i(n Detecti(nCSM./CD: carrier %en%ing an& &e'erra# #ike in CSM.0 Aut1 c(##i%i(n% are &etecte& +ithin a 'e+ )it ti!e%0 Tran%!i%%i(n i% then a)(rte&1 re&ucing the channe# +a%tage c(n%i&era)#y0 Ty"ica##y1 "er%i%tent retran%!i%%i(n i% i!"#e!ente& C(##i%i(n &etecti(n i% ea%y in +ire& L.N% ,e0g01 Ethernet-: !ea%ure %igna# %trength%1 c(!"are tran%!itte&1 recei*e& %igna#% C(##i%i(n &etecti(n &i''icu#t in +ire#e%% L.N% ,recei*er %hut ('' +hi#e tran%!itting1 t( a*(i& &a!aging it +ith e ce%% "(+erCSM./CD can a""r(ach channe# uti#i?ati(n I< in L.N% ,#(+ rati( (' "r("agati(n (*er "acket tran%!i%%i(n ti!e1/23/2014 2: Data Link Layer 2-59

CSM.5 CSM. 5CD

1/23/2014

2: Data Link Layer

2-60

C(!"ari%(n (' Pr(t(c(#%

1/23/2014

2: Data Link Layer

2-61

2Taking Turn%3 M.C "r(t(c(#%


Channe# "artiti(ning M.C "r(t(c(#% can %hare the channe# 'air#yT )ut a %ing#e %tati(n cann(t u%e it a## Ran&(! acce%% M.C "r(t(c(#% a##(+ a %ing#e u%er 'u## channe# rateT )ut cann(t %hare the channe# 'air#y ,in 'act1 ca"ture i% ('ten ()%er*e&Taking Turn% M.C "r(t(c(#% achie*e )(th 'airne%% an& 'u## rate1 at the e "en%e (' %(!e e tra c(ntr(# (*erhea& ,a- P(##ing: a Ma%ter %tati(n (n a L.N in turn 2in*ite%3 the %#a*e %tati(n% t( tran%!it their 'ra!e% ,u" t( a Ma -0 Pr()#e!%: Re4ue%t t( Sen&/C#ear t( Sen& (*erhea&1 "(##ing &e#ay1 %ing#e "(int (' 'ai#ure ,Ma%ter,)- T(ken "a%%ing: the c(ntr(# t(ken i% "a%%e& 'r(! (ne n(&e t( the ne t %e4uentia##yT can a##e*iate the #atency an& !a%ter "r()#e!T %ti##1 "r()#e!% %uch a% rec(*ery 'r(! #(%t t(ken1 etc0

1/23/2014

2: Data Link Layer

2-62

2Taking Turn%3 M.C "r(t(c(#%


P(##ing: !a%ter n(&e 2in*ite%3 %#a*e n(&e% t( tran%!it in turn c(ncern%:
"(##ing (*erhea& #atency %ing#e "(int (' 'ai#ure ,!a%ter-

0oken passing& control token passed from one node to ne1t se2uentially) token message concerns&
token overhead latency single point of failure (token)

1/23/2014

2: Data Link Layer

2-63

Ethernet
2&(!inant3 +ire& L.N techn(#(gy: 'ir%t +i&e#y u%e& L.N techn(#(gy Si!"#er1 chea"er than t(ken L.N% an& .TM Ke"t u" +ith %"ee& race: <0 M)"% K <0 F)"%

Metcalfe.s Ethernet sketch

1/23/2014

2: Data Link Layer

2-64

Ethernet u%e% CSM./CD


N( %#(t% a&a"ter &(e%n=t tran%!it i' it %en%e% that %(!e (ther a&a"ter i% tran%!itting1 that i%1 carrier %en%e tran%!itting a&a"ter a)(rt% +hen it %en%e% that an(ther a&a"ter i% tran%!itting1 that i%1 c(##i%i(n &etecti(n
1/23/2014

Ae'(re atte!"ting a retran%!i%%i(n1 a&a"ter +ait% a ran&(! ti!e1 that i%1 ran&(! acce%%

2: Data Link Layer

2-65

Ethernet CSM./CD a#g(rith!


@0 $' a&a"ter &etect% <0 .&a"t(r recei*e% an(ther tran%!i%%i(n &atagra! 'r(! net #ayer +hi#e tran%!itting1 : create% 'ra!e a)(rt% an& %en&% Na! 20 $' a&a"ter %en%e% %igna# channe# i&#e1 it %tart% t( 80 .'ter a)(rting1 a&a"ter tran%!it 'ra!e0 $' it enter% e "(nentia# %en%e% channe# )u%y1 )ack('': a'ter the !th +ait% unti# channe# i&#e c(##i%i(n1 a&a"ter an& then tran%!it% ch((%e% a K at ran&(! 30 $' a&a"ter tran%!it% 'r(! entire 'ra!e +ith(ut !5<Y0 .&a"ter X01<121P12 &etecting an(ther +ait% KZ8<2 )it ti!e% tran%!i%%i(n1 the an& return% t( Ste" 2 a&a"ter i% &(ne +ith 'ra!e S
1/23/2014 2: Data Link Layer 2-66

Ethernet .cce%% "r(t(c(# : CSM./CD


.: %en%e% channe#1 i' i&#e then X tran%!it an& !(nit(r the channe#T
3f detect another transmission then 4 abort and send 5am signal6 update 7 collisions6 delay as re2uired by e1ponential backoff algorithm6 goto 8 9 else 4done with the frame6 set collisions to :ero9

Y e#%e X+ait unti# (ng(ing tran%!i%%i(n i% (*er an& g(t( .Y


ca##e& <5"er%i%tent ,%"ecia# ca%e (' "5"er%i%tent1/23/2014 2: Data Link Layer 2-67

C(##i%i(n Detecti(n
+>amp e Co!e *3s message reaches no!e E at time 7 Co!e E3s message reaches no!e * at time 27 1or no!e * to !etect a co ision$ no!e * must sti /e transmitting at time 27

$EEE ;0203
4 27 is /oun!e! to @1'2ms 4 *t 1<)/ps @1'2ms F @12/ or 6B F @12/ or 6BE 4 (ac0et ength shou ! /e greater than 6BE Gam after co ision +nsures that a hosts notice the co ision
1/23/2014 2: Data Link Layer 2-68

C(##i%i(n Detecti(n

1/23/2014

2: Data Link Layer

2-69

Retran%!i%%i(n
How ong shou ! a host wait to retry after a co ision; Ihat happens if the host waits too ong; J Iaste! /an!wi!th Ihat happens if the host !oesn3t wait ong enough; J )ore co isions +thernet .o ution Einary e>ponentia /ac0off 4 )a>imum /ac0off !ou/ es with each fai ure

1/23/2014

2: Data Link Layer

2-70

Ethernet=% CSM./CD ,!(re[a! Signa#: !ake %ure a## (ther tran%!itter% are a+are (' c(##i%i(nT @; )it% Ait ti!e: 0< !icr(%ec '(r <0 M)"% Ethernet T '(r KI<0231 +ait ti!e i% a)(ut 80 !%ec E "(nentia# Aack('': F(a#: a&a"t retran%!i%%i(n atte!"t% t( e%ti!ate& current #(a&
hea*y #(a&: ran&(! +ait +i## )e #(nger

'ir%t c(##i%i(n: ch((%e K 'r(! X01<YT &e#ay i% KZ 8<2 )it tran%!i%%i(n ti!e% a'ter %ec(n& c(##i%i(n: ch((%e K 'r(! X01<1213YP a'ter ten c(##i%i(n%1 ch((%e K 'r(! X01<12131@1P1<023Y
2: Data Link Layer 2-71

1/23/2014

C(##i%i(n%
W(r%t ca%e %cenari( ,a- . %en&% a 'ra!e at ti!e t ,)- .=% 'ra!e arri*e% at A at ti!e tJ& ,c- A )egin% tran%!itting at ti!e tJ& an& c(##i&e% +ith .=% 'ra!e ,&- A=% runt 'ra!e arri*e% . at ti!e tJ 2&
1/23/2014

(a)

(b)

(c)

(d)

2: Data Link Layer

2-72

CSM./CD e''iciency
T"r(" I !a "r(" )et+een 2 n(&e% in L.N ttran% I ti!e t( tran%!it !a 5%i?e 'ra!e

efficiency =

1 1 + 5t prop / ttrans

E''iciency g(e% t( < a% t"r(" g(e% t( 0 F(e% t( < a% ttran% g(e% t( in'inity Much )etter than .LOE.1 )ut %ti## &ecentra#i?e&1 %i!"#e1 an& chea" M(re &etai#% a)(ut \Ethernet= #ater

1/23/2014

2: Data Link Layer

2-73

Re#ia)#e Data Tran%'er


1un!amenta s of *utomatic ,epeat re8uest 9*,8: a gorithms * fami y of a gorithms that pro"i!e re ia/i ity through retransmission *,8 a gorithms 9simp e to comp e>: 4 stop-an!-wait 4 s i!ing win!ow go-back-n selective repeat * ternati"e# forwar! error correction 91+C:
1/23/2014 2: Data Link Layer 2-74

7ermino ogy
*c0now e!gement 9*CK: ,ecei"er te s the sen!er when a frame is recei"e! 4 .e ecti"e ac0now e!gement 9.*CK: Specifies set of frames received 4 Cumu ati"e ac0now e!gement 9*CK: Have received specified frame and all previous 4 Cegati"e ac0now e!gement 9C*K: Receiver refuses to accept frame now, e.g., when out of buffer space 7imeout 97O: 4 .en!er !eci!es the frame 9or *CK: was ost 4 .en!er can try again
1/23/2014 2: Data Link Layer 2-75

.ut(!atic Re"eat Re4ue%t Sche!e%: St(" an& Wait


Easic i!ea# .en!er * transmits a pac0et$ then wait If frame is error -free$ E sen!s ac0now e!gement 9*CK:$ e se$ E sen!s a negati"e ac0now e!gement 9C*CK: .en!er * sen!s ne>t pac0et or retransmit when it recei"es *CK or C*CK (ro/ em 1# *CKLC*CK cou ! get ost too5 .o ution# 7imer at sen!er5 Ihen no!e * times out$ it retransmits the pac0et
1/23/2014 2: Data Link Layer 2-76

1/23/2014

2: Data Link Layer

2-77

1/23/2014

2: Data Link Layer

2-78

1/23/2014

2: Data Link Layer

2-79

1/23/2014

2: Data Link Layer

2-80

St(" an& Wait .R]: Sy%te! State $n'(r!ati(n

1/23/2014

2: Data Link Layer

2-81

St("5an& St("5 an&5 5+ait (r a#ternating a#ternating5 5)it "r(t(c(#

1/23/2014

2: Data Link Layer

2-82

St(" an& Wait Pr(t(c(# C(nt&00

1/23/2014

2: Data Link Layer

2-83

St(" an& Wait Pr(t(c(# .#g(rith! at %en&er ,n(&e .,+ith initia# c(n&iti(n SNI01: *ccept pac0et from higher ayer when a"ai a/ eM assign num/er .C to it 2: 7ransmit pac0et .C in frame with se?uence # .C 3: Iait for an error free frame from E if recei"e! an! it contains ,CN.C in the re?uest # fie !$ set .C to ,C an! go to 1 if not recei"e! within gi"en time$ go to 2

1/23/2014

2: Data Link Layer

2-84

St(" an& Wait .#g(rith! at recei*er ,n(&e A,+ith initia# c(n&iti(n RNI01: Ihene"er an error-free frame is recei"e! from *

with a se?uence # e?ua to ,C$ re ease recei"e! pac0et to higher ayer an! increment ,C'
2:

*t ar/itrary times$ /ut within /oun!e! !e ay after recei"ing any error free frame from *$ transmit a frame to * containing ,C in the re?uest # fie !'

1/23/2014

2: Data Link Layer

2-85

St(" an& Wait Pr(t(c(# C(nt&00


(oor performance e>amp e# 1 O/ps in0$ 1@ ms en!-to-en! prop' !e ay$ 1KE pac0et# ! #$b " # microsec %&''( b)sec

transmit

"

# microsec fraction of time " " &.&&&%. ;tili:ation " * " sender b,sy sendin+&.&&# msec

1KE p0t e"ery 3< msec -N 330ELsec throughput o"er 1 O/ps in0 networ0 protoco imits use of physica resources5

1/23/2014

2: Data Link Layer

2-86

Stop and Wait Protocol: Efficiency


No loss or bit-errors! U= tframe tprop Data = Data Ack Ack U Light in vacuum = 300 m/s Distance/Speed of Signal = Light in fiber Frame size /Bit rate = 200 m/s Distance Bit rate Electricity = = 250 m/s Frame size Speed of Signal
2: Data Link Layer 2-87

tframe 2tprop+tframe 1 2 + 1

tprop tframe

1/23/2014

E''iciency ,Uti#i?ati(n-: M(re E a!"#e%


Sate##ite Link: Pr("agati(n De#ay t"r(" I 2M0 !% 6ra!e Si?e I @000 )it% I 800 )yte% Data rate I 8O k)"% t'ra!e I @/8O I M< !% I t"r("/t'ra!e I 2M0/M< I 30; U I </,2J<- I 00<2 ,t(( #(+ SSSh(rt Link ,eg: L.N-: < k! I 8 %1 RateI<0 M)"%1 6ra!eI800 )yte% t'ra!eI @k/<0MI @00 %
It"r("/t'ra!eI8/@00I000<2 UI</,2J<-I 00U; ,greatS-

Note: no loss or bit-errors!


2: Data Link Layer 2-88

1/23/2014

Pr()#e! +ith St(" an& Wait .R]


.top an! Iait *,8 /ecomes inefficient when the propagation !e ay is greater than the frame transmission time 1or e>amp e$ consi!er 1<<< /it frame transmission o"er a channe with ,77 F B<ms an! a in0 of spee! 1'@)/ps' 7he num/er of /its that can /e transmitte! o"er this channe in B< ms is e?ua to 6<$<<< /its' Howe"er$ .top an! Iait *,8 can transmit on y one frame 91<<< /its: in this perio!' 7his is /ecause the transmitter has to wait for the *CK /efore procee!ing with other transmissions
1/23/2014 2: Data Link Layer 2-89

-e ay > Ean!wi!th (ro!uct - ,e"isite!


*mount of !ata in %pipe& channe F pipe !e ay F ength /an!wi!th F area of a cross section /an!wi!th > !e ay pro!uct F "o ume How many /its the sen!er must transmit /efore the first /it arri"es at the recei"er if the sen!er 0eeps the pipe fu

1/23/2014

2: Data Link Layer

2-90

Stop-and-Wait Protocol Efficiency: with packet error P=Probability of biterror = Tprop/Tframe U=Tframe/[Nr(Tframe+2Tprop)] = 1/[Nr(1+2)] Nr= i Pi-1(1-P) =1/(1-P) U=(1-P)/(1+2) Ack
2: Data Link Layer

Tf Tp Nak

Nak

1/23/2014

2-91

Pi"e#ine& "r(t(c(#%
(ipe ining# sen!er a ows mu tip e$ %in-f ight&$ yetto-/e-ac0now e!ge! p0ts I!ea# * ow sen!er to transmit mu tip e p0ts /efore recei"ing an *CK$ there/y kee"ing the "i"e 'u##' 7here is an upper imit on the num/er of outstan!ing 9un-*CKe!: p0ts a owe!'
Sender Receiver

Time

* so ca e! %#i&ing +in&(+ protoco s 7wo generic forms# go-Eac0-C$ se ecti"e repeat


1/23/2014 2: Data Link Layer 2-92

F(5 F( 5Aack Aack5 5N .R]


.top an! Iait is inefficient when propagation !e ay is arger
than the pac0et transmission time Can on y sen! one pac0et per roun!-trip time Oo Eac0 C a ows the transmission of new pac0ets /efore ear ier ones are ac0now e!ge! Oo /ac0 C uses a win!ow mechanism where the sen!er can sen! pac0ets that are within a %win!ow& 9range: of pac0ets 7he win!ow a!"ances as ac0now e!gements for ear ier pac0ets are recei"e!

1/23/2014

2: Data Link Layer

2-93

F(5 F( 5Aack Aack5 5N .R]


(ac0ets for a in0 from * to E are num/ere! se?uentia y$ an! this se?uence num/er .C is sent in the hea!er of the frame containing the pac0et' .e"era successi"e pac0ets can /e sent without waiting for the ne>t pac0et to /e re?ueste!' ,ecei"er accepts pac0ets on y in the correct or!er an! sen!s re?uest num/ers ,C /ac0 to *M the effect of a gi"en re?uest ,C is to ac0now e!ge a pac0ets prior to ,C an! to re?uest transmission of pac0et ,C'
1/23/2014 2: Data Link Layer 2-94

1/23/2014

2: Data Link Layer

2-95

1/23/2014

2: Data Link Layer

2-96

1/23/2014

2: Data Link Layer

2-97

F(5 F( 5Aack Aack5 5N .R]


7he go /ac0 num/er C in a go /ac0 C protoco is a parameter that !etermines how many successi"e pac0ets can /e sent in the a/sence of a re?uest for a new pac0et' .pecifica y$ no!e * is not a owe! to sen! pac0et i AC /efore i has /een ac0now e!ge!' If i is the most recent y recei"e! re?uest from no!e E$ there is a Pwin!owP of n pac0ets$ from i to i AC-1$ that the transmitter is a owe! to sen!' *s successi"e y higher-num/ere! re?uests are recei"e! from E$ this win!ow s i!es upwar!M thus go /ac0 C protoco s are often ca e! s i!ing win!ow *,8 protoco s'
2: Data Link Layer 2-98

1/23/2014

F(5 F( 5Aack Aack5 5N

(ipe ine! proce!ure# processing of frame #1 happens e"en /efore the successfu reception of frame #< 9Cew tas0 /egin /efore the comp etion of o ! tas0: Ihen frame #3 un!ergoes transmission error$ recei"er ignores frame #3 an! a su/se?uent frames Ihen the transmission of current win!ow is o"er$ the transmitter %go /ac0 n& frames an! retransmit a the frames starting from frame #3
1/23/2014 2: Data Link Layer 2-99

1/23/2014

2: Data Link Layer

2-100

1/23/2014

2: Data Link Layer

2-101

St(" an& Wait an& F(5 F(5Aack Aack5 5N

1/23/2014

2: Data Link Layer

2-102

F(5 F( 5Aack Aack5 5N


7he transmitter has a Pwin!owP of C pac0ets that can /e sent without ac0now e!gements 7his win!ow ranges from the ast "a ue of ,C o/taine! from the recei"er 9!enote! as .Cmin: to .CminAC-1 Ihen the transmitter reaches the en! of its win!ow$ or times out$ it goes /ac0 an! retransmits pac0et .Cmin 6et .Cmin /e the sma est num/er pac0et not yet *CKe! 6et .Cma> /e the num/er of the ne>t pac0et to /e accepte! from the higher ayer 9i'e'$ the ne>t new pac0et to /e transmitte!:
1/23/2014 2: Data Link Layer 2-103

1/23/2014

2: Data Link Layer

2-104

F(5 F( 5Aack Aack5 5N


6ower imit of transmitter win!ow# .Cmin Qpper imit# .CminAC-1 *s successi"e y higher-num/ere! re?uests are recei"e! from E$ this win!ow s i!es upwar! *t the recei"er$ when a goo! pac0et arri"es 9C,C successfu : an! if .C F ,C$ it is accepte!' ,ecei"er then increments ,C an! informs the sen!er' *t the sen!er$ when ,C arri"es$ it assumes that a the frames prior to ,C ha"e /een successfu y !e i"ere!'
1/23/2014 2: Data Link Layer 2-105

F(5 F(5Aack Aack5 5N Sen&er Ru#e%


.Cmin F <M .Cma> F < 4 ,epeat the fo owing J If .Cma> = .Cmin A C 9entire win!ow not yet sent: .en! pac0et .Cma> M .Cma> F .Cma> A 1M9up!ate the upper e!ge of win!ow:: J If pac0et arri"es from recei"er with ,C N .Cmin .Cmin F ,CM - If .Cmin = .Cma> 9there are sti some unac0now e!ge! pac0ets: an! sen!er cannot sen! any new pac0ets Choose some pac0et /etween .Cmin an! .Cma> an! re-sen! it 7he ast ru e says that when you cannot sen! any new pac0ets you shou ! re-sen! an o ! 9not yet *CKe!: pac0et 7here may /e two reasons for not /eing a/ e to sen! a new pac0et Cothing new from higher ayer Iin!ow e>pire! 9.Cma> F .Cmin A C : Co set ru e on which pac0et to re-sen!

1/23/2014

2: Data Link Layer

2-106

F( Aack N: Recei*er Ru#e%


,C F <M 4 ,epeat the fo owing steps# J Ihen a goo! pac0et arri"es an! if .C F ,C 4 *ccept pac0et 4 Increment ,C F ,C A1 *t regu ar inter"a s sen! an *CK pac0et with ,C ,ecei"er reRect a pac0ets with .C not e?ua to ,C

1/23/2014

2: Data Link Layer

2-107

N(te% (n FAN
,e?uires no /uffering of pac0ets at the recei"er .en!er must /uffer up to C pac0ets whi e waiting for their *CK .en!er must re-sen! entire win!ow in the e"ent of an error (ac0ets can /e num/ere! mo!u o ) where ) N C
Eecause at most C pac0ets can /e sent simu taneous y

,ecei"er can on y accept pac0ets in or!er


,ecei"er must !e i"er pac0ets in or!er to higher ayer Cannot accept pac0et iA1 /efore pac0et i 7his remo"es the nee! for /uffering 7his intro!uces the nee! to re-sen! the entire win!ow upon error
1/23/2014 2: Data Link Layer 2-108

N(te% (n FAN
7he maRor pro/ em with Oo Eac0 C is the nee! to resen! the entire win!ow when an error occurs' 7his is !ue to the fact that the recei"er can on y accept pac0ets in or!er Oo-Eac0-C can reco"er from missing frames Eut '''' It is wastefu 5 If there are errors$ the sen!er wi spen! time retransmitting frames the recei"er has a rea!y seen5

1/23/2014

2: Data Link Layer

2-109

Se#ecti*e Re"eat
recei"er in!i"i!ua y ac0now e!ges a correct y recei"e! p0ts /uffers p0ts$ as nee!e!$ for e"entua in-or!er !e i"ery to upper ayer sen!er on y resen!s p0ts for which *CK not recei"e! sen!er timer for each un*CKe! p0t sen!er win!ow C consecuti"e se? #3s again imits se? #s of sent$ un*CKe! p0ts

1/23/2014

2: Data Link Layer

2-110

1/23/2014

2: Data Link Layer

2-111

Se#ecti*e re"eat: %en&er1 recei*er +in&(+%

1/23/2014

2: Data Link Layer

2-112

Se#ecti*e re"eat in acti(n

1/23/2014

2: Data Link Layer

2-113

1/23/2014

2: Data Link Layer

2-114

1/23/2014

2: Data Link Layer

2-115

F( Aack N +ith !(&u#u% ! V N


Cum/er of /its that can /e use! to represent the se?uence num/er is a ways finite' m /its wi gi"e a se?uence num/er space e?ua to 2Sm Ihen error free frame arri"es$ recei"er must /e a/ e to unam/iguous y !etermine which frame has arri"e! since the se?uence num/er wrap aroun! when the count reaches 2Sm ,ecei"er can !etermine the correct frame if the win!ow siTe is ess than 2Sm if the se?uence num/er .C an! the re?uest num/er ,C are sent mo!u o m$ for some m strict y greater than the go /ac0 num/er C$ the correctness of go /ac0 C is maintaine! *ssumption# frames !o not get out of or!er on the in0s'
1/23/2014 2: Data Link Layer 2-116

Frame from node A to B; Frame is generated at time t1 and received at t2

1/23/2014

2: Data Link Layer

2-117

F( Aack N +ith !(&u#u% ! V N


6et no!e * sen!s pac0et num/er .C with se?uence num/er mo!u o m$ an! et sn !enote .C mo! m' 7he go /ac0 C a gorithm at E has to /e mo!ifie! as# If an error-free frame is recei"e! from * containing a se?uence num/er sn e?ua to ,C mo! m$ re ease the recei"e! pac0et to the higher ayer an! increment ,C' .ince m N C$ from the pre"ious e?n$ sn F ,C mo! m wi /e satisfie! if an! on y if the pac0et num/er .C is e?ua to ,CM thus the a gorithm sti wor0s correct y 9i'e'$ when mo! m operation is use!:
1/23/2014 2: Data Link Layer 2-118

F( Aack N: Se4 nu!)er (r&inary integer%

/e0t consider the orderin- of arri1in- re2,est n,mbers (,sin- ordinary inte-ers) relati1e to the window at node 3.

1/23/2014

2: Data Link Layer

2-119

F( Aack N +ith !(&u#u% ! V N


6et E sen! rn F ,C mo! m' 7he go /ac0 C a gorithm at * has to /e mo!ifie! as# If an error-free frame is recei"e! from E containing rn n(t e4ua# t( .Cmin mo! m$ then increment .Cmin unti rn F .Cmin mo! m' Eecause of the range of ,C $ we see that it is sufficient to sen! re?uest num/ers mo!u o m' * the "aria/ es such as .Cmin $ .Cma> $ an! ,C can /e num/ere! mo!u o m$ an! the a gorithm can /e !emonstrate! to wor0 correct y for m N C'
1/23/2014 2: Data Link Layer 2-120

SR] +ith !(&u#u% ! 2N


In .,8$ no!e E accepts pac0ets anywhere in the range ,C to ,C A n - I' *ssume that frames !o not get out of or!er on the in0s 1rame recei"e! at no!e E at time t2 an! that the frame was generate! at no!e * at time t1' 7he se?uence num/er .C in the recei"e! frame must satisfy

Co!e E has to !istinguish "a ues of .C in the entire range of a/o"e +?n'' 7his means that the mo!u us m must satisfy m N 2n$ for se ecti"e repeat'
1/23/2014 2: Data Link Layer 2-121 2-121

L(ca# .rea Net+(rk% ,L.N%-

* computer nLw that is concentrate! in a geographica area 9e'g'$ in a /ui !ing or in a uni" campus:

+thernets# emp oy the C.)*LC- protoco M 1<)/ps 9I+++ 8<2'3:$ 1ast +-net 91<<)/ps:$ Oiga/it +-net 91$<<< )/ps:M /y far the most popu ar 6*C techno ogy 7o0en ,ings# I+++ 8<2'@ 9IE) to0en ring:$ up to 16)/psM 1--I 91i/er -istri/ute! -ata Interface:$ for Campus an! )etro connecti"ity$ up to 2<< stations$ at 1<<)/ps'
1/23/2014 2: Data Link Layer 2-122

L.N .&&re%%e%
32-/it I( a!!ress#
networ0- ayer a!!ress
use! to get !atagram to !estination networ0 9reca I( networ0 !efinition:

6*C 9or )*C or physica : a!!ress#


use! to get !atagram from one interface to another physica y-connecte! interface 9same networ0: B8 /it )*C a!!ress 9for most 6*Cs: /urne! in the a!apter ,O)
1/23/2014 2: Data Link Layer 2-123

C(nt00
)*C a!!ress a ocation a!ministere! /y I+++ manufacturer /uys portion of )*C a!!ress space 9to assure uni?ueness: *na ogy# 9a: )*C a!!ress# i0e .ocia .ecurity Cum/er 9/: I( a!!ress# i0e posta a!!ress )*C f at a!!ress FN porta/i ity can mo"e 6*C car! from one 6*C to another I( hierarchica a!!ress CO7 porta/ e !epen!s on networ0 to which one attaches
1/23/2014 2: Data Link Layer 2-124

Reca## ear#ier r(uting &i%cu%%i(n


.tarting at *$ gi"en I( !atagram a!!resse! to E# oo0 up net' a!!ress of E$ fin! E on same net' as * #ink #ayer %en& &atagra! t( A in%i&e #ink5#ayer 'ra!e
frame dest, so,rce address 46s M37 36s M37 addr addr

223.1.1.1 223.1.1.2 223.1.1.4 223.1.2.9 223.1.2.1

4
223.1.1.3 223.1.3.1 223.1.3.27

223.1.2.2 223.1.3.2

data-ram so,rce, dest address 36s 8P addr 46s 8P addr data-ram

8P payload

frame
1/23/2014 2: Data Link Layer 2-125

.RP: .&&re%% Re%(#uti(n Pr(t(c(#


9,estion: how to determine M37 address of 4 -i1en 46s 8P address: +ach I( no!e 9Host$ ,outer: on 6*C has *,( mo!u e$ ta/ e *,( 7a/ e# I(L)*C a!!ress mappings for some 6*C no!es
= I( a!!ressM )*C a!!ressM 776N = UUUUUUUUUU'' N

776 97ime 7o 6i"e:# time after which a!!ress mapping wi /e forgotten 9typica y 2< min:
1/23/2014 2: Data Link Layer 2-126

.RP "r(t(c(#
* 0nows EVs I( a!!ress$ wants to earn physica a!!ress of E * /roa!casts *,( ?uery p0t$ containing EVs I( a!!ress a machines on 6*C recei"e *,( ?uery E recei"es *,( pac0et$ rep ies to * with its 9EVs: physica ayer a!!ress * caches 9sa"es: I(-to-physica a!!ress pairs unti information /ecomes o ! 9times out: soft state# information that times out 9goes away: un ess refreshe!
1/23/2014 2: Data Link Layer 2-127

Ethernet
History !e"e ope! /y Wero> (*,C in mi!-197<s roots in * oha pac0et-ra!io networ0 stan!ar!iTe! /y Wero>$ -+C$ an! Inte in 1978 simi ar to I+++ 8<2'3 stan!ar! .imp er$ cheaper than to0en 6*Cs an! *7) Kept up with spee! race# 1<$ 1<<$ 1<<< )/ps 6ength# 2@<<m 9@<<m segments with B repeaters:

Problem: Distributed algorithm that provides fair access

Metcalfe6s 5theret sketch

1/23/2014

2: Data Link Layer

2-128

Ethernet 6ra!e Structure


.en!ing a!apter encapsu ates I( !atagram 9or other networ0 ayer protoco pac0et: in Ethernet 'ra!e
,Digita#5$nte#57er( 1 D$7 Ethernet %tan&ar&64 Preamble 48 Dest addr 48 Src addr 16 Type Body 32 CRC

Slightly diff from 802.3

(ream/ e# 7 /ytes with pattern 1<1<1<1< fo owe! /y one /yte with pattern 1<1<1<11 use! to synchroniTe recei"er$ sen!er c oc0 rates

1/23/2014

2: Data Link Layer

2-129

Ethernet 6ra!e Structure ,!(re*!!resses# uni?ue$ B8-/it 96 /ytes: unicast a!!ress assigne! to each a!aptor frame is recei"e! /y a a!apters on a 6*C an! !roppe! if a!!ress !oes not match e>amp e# 8#<#2/#eB#/1#2 /roa!cast# a 1s mu ticast# first /it is 1 7ype# in!icates the higher ayer protoco $ most y I( /ut others may /e supporte! such as Co"e I(W an! *pp e7a 0: Eo!y 9pay oa!:# B6 to 1@<< Eytes 9 ower /oun! frame siTe 6B /ytes 9B6A18: J @1'2 s roun! trip !e ay of 2@<< m of ca/ e: C,C# chec0e! at recei"er$ if error is !etecte!$ the frame is simp y !roppe!

1/23/2014

2: Data Link Layer

2-130

Ethernet Techn(#(gie%: <0Aa%e2


1<# 1<)/psM 2# un!er 2<< meters ma> ca/ e ength Ease# /ase /an! transmissionM )anchester co!ing thin coa>ia ca/ e in a /us topo ogy

repeaters use! to connect up to mu tip e segments repeater repeats /its it hears on one interface to its other interfaces# physica ayer !e"ice on y5
1/23/2014 2: Data Link Layer 2-131

<0Aa%eT an& <00Aa%eT


1<L1<< )/ps rateM atter ca e! %fast ethernet& 7 stan!s for 7wiste! (air Hu/ to which no!es are connecte! /y twiste! pair$ thus %star topo ogy& C.)*LC- imp emente! at hu/ )a> !istance from no!e to Hu/ is 1<< meters Hu/ can !isconnect %Ra//ering& a!apter Hu/ can gather monitoring information$ statistics for !isp ay to 6*C a!ministrators

1/23/2014

2: Data Link Layer

2-132

Figa)it ,<000M)"%- Ethernet


8<2'3T stan!ar! .tan!ar! +thernet frame format Eac0war! compati/ e with 1<Ease7 an! 1<<Ease7 * ows for point-to-point in0s as we as share! /roa!cast channe s point-to-point in0s use switches an! /roa!cast channe s use hu/s Qses C.)*LC- for share! /roa!cast channe s 9ma> !istance /etween no!es se"ere y restricte!$ 2@m AA: * ows for fu !up e> operation at 1O/ps in /oth !irections for pointto-point in0s .tar topo ogy i0e 1<Ease7 an! 1<<Ease7 O1 or cat @ Q7( ca/ e

1/23/2014

2: Data Link Layer

2-133

Eu)% 5 <
Phy%ica# Layer &e*ice%: e%%entia##y re"eater% ("erating at )it #e*e#%: re"eat recei*e& )it% (n (ne inter'ace t( a## (ther inter'ace% Eu)% can )e arrange& in a hierarchy ,(r !u#ti5 tier &e%ign-1 +ith )ack)(ne hu) at it% t("

1/23/2014

2: Data Link Layer

2-134

Eu)% 5 2
Each c(nnecte& L.N re'erre& t( a% L.N %eg!ent Eu)% &( n(t i%(#ate c(##i%i(n &(!ain%: n(&e !ay c(##i&e +ith any n(&e re%i&ing at any %eg!ent in L.N Eu) .&*antage%:

%i!"#e1 ine "en%i*e &e*ice Mu#ti5tier "r(*i&e% grace'u# &egra&ati(n: "(rti(n% (' the L.N c(ntinue t( ("erate i' (ne hu) !a#'uncti(n% e ten&% !a i!u! &i%tance )et+een n(&e "air% ,<00! "er Eu)1/23/2014 2: Data Link Layer 2-135

Eu) #i!itati(n%
Sing#e c(##i%i(n &(!ain re%u#t% in n( increa%e in !a thr(ugh"ut

!u#ti5tier thr(ugh"ut %a!e a% %ing#e %eg!ent thr(ugh"ut


$n&i*i&ua# L.N re%tricti(n% "(%e #i!it% (n nu!)er (' n(&e% in %a!e c(##i%i(n &(!ain an& (n t(ta# a##(+e& ge(gra"hica# c(*erage Cann(t c(nnect &i''erent Ethernet ty"e% ,e0g01 <0Aa%eT an& <00)a%eT-

1/23/2014

2: Data Link Layer

2-136

S+itch

Link Layer &e*ice%: ("erate (n Ethernet 'ra!e%1 e a!ining 'ra!e hea&er an& %e#ecti*e#y '(r+ar&ing 'ra!e )a%e& (n it% &e%tinati(n Ari&ge i%(#ate% c(##i%i(n &(!ain% %ince it )u''er% 'ra!e% When 'ra!e i% t( )e '(r+ar&e& (n %eg!ent1 )ri&ge u%e% CSM./CD t( acce%% %eg!ent an& tran%!it

1/23/2014

2: Data Link Layer

2-137

Forwarding
! < = switch

hub

hub

hub

How do determine onto which >8? segment to forward frame@ >ooks like a routing problem)))
1/23/2014 2: Data Link Layer 2-138

Self learning
A switch has a switch table entry in switch table: (MAC Address, Interface, Time Stamp) stale entries in table dropped (TTL can be 60 min) switch learns which hosts can be reached through which interfaces when frame received, switch learns location of sender: incoming LAN segment records sender/location pair in switch table

1/23/2014

2: Data Link Layer

2-139

Filtering/Forwarding
When switch receives a frame: index switch table using MAC dest address if entry found for destination then{ if dest on segment from which frame arrived then drop the frame else forward the frame on interface indicated } else flood

forward on all but the interface on which the frame arrived


1/23/2014 2: Data Link Layer 2-140

Switch example
Suppose C sends frame to D
switch < 8 A C hub D E = hub B hub 3 % H address interface 8 A E % ! ! < =

Switch receives frame from from C


notes in bridge table that C is on interface 1 because D is not in table, switch forwards frame into interfaces 2 and 3

frame received by D
1/23/2014 2: Data Link Layer 2-141

Switch: traffic isolation


switch installation breaks subnet into LAN segments switch filters packets: same-LAN-segment frames not usually forwarded onto other LAN segments segments become separate collision domains
switch collision domain hub hub hub

1/23/2014

collision domain

collision domain

2: Data Link Layer

2-142

S+itch

a&*antage%:

$%(#ate% c(##i%i(n &(!ain% re%u#ting in higher t(ta# !a thr(ugh"ut1 an& &(e% n(t #i!it the nu!)er (' n(&e% n(r ge(gra"hica# c(*erage Can c(nnect &i''erent ty"e Ethernet %ince it i% a %t(re an& '(r+ar& &e*ice Tran%"arent: n( nee& '(r any change t( h(%t% L.N a&a"ter%
1/23/2014 2: Data Link Layer 2-143

Institutional network
to e1ternal network router switch mail server web server

3C subnet
hub

hub

hub

1/23/2014

2: Data Link Layer

2-144

Switches vs. Routers


both store-and-forward devices
routers: network layer devices (examine network layer headers) switches are link layer devices

routers maintain routing tables, implement routing algorithms switches maintain switch tables, implement filtering, learning algorithms

1/23/2014 1/23/2014 2: Data Link Layer 2-145

$EEE ;020<< Wire#e%% L.N


I+++ 8<2'11# !efines physica ayer an! )*C ayer Ean!wi!th I+++8<2'11/# operates in un icense! ra!io spectrum at 2'BOHTM spee! up to 11)/ps 93<<m: X 2 )/ps /eyon! 3<<m I+++8<2'11a# operates in un icense! ra!io spectrum aroun! @OHTM spee! up to @B)/ps 9@<m: I+++8<2'11g# operates in un icense! ra!io spectrum at 2'BOHTM spee! up to @B)/ps (hysica ayer -irect se?uence sprea! spectrum 9-...: 1re?uency hopping sprea! spectrum 91H..: !iffuse! infrare! Orthogona 1-) 9O1-): )*C protoco # CSM./C. 9co ision *"oi!ance:

1/23/2014

2: Data Link Layer

2-146

$EEE ;020<< ,c(nt00un icense! fre?uency spectrum# 9<<)hT$ 2'BOhT Aa%ic Ser*ice Set ,ASS- 9a'0'a' %ce &: contains# wire ess hosts access point 9*(:# /ase station E..3s com/ine! to form !istri/ution system 9-.: .& h(c net+(rk# I+++ 8<2'11 stations can !ynamica y form networ0 without *(
.& h(c net+(rk

1/23/2014

2: Data Link Layer

2-147

$EEE ;020<< M.C Pr(t(c(#: CSM./C.


sen!er - if sense channe i! e for D$6S sec' then transmit entire frame 9no co ision !etection: -if sense channe /usy then e>ponentia /ac0off recei"er# -if recei"e! OK then return *CK after S$6S Others# !efer access for C*V time units 98<2'11 frame has transmission time fie !:
1/23/2014

N.9# Cetwor0 * ocation Vector D$6S# Distributed Inter Frame Space S$6S# Short Inter Frame Space
2: Data Link Layer 2-148

Ei&&en Ter!ina# : E "(%e& N(&e Pr()#e!%

hi!!en termina s# *$ C cannot hear each other !ue to o/stac es$ signa attenuation resu ts in co isions at E +>pose! no!e# E *$ C hears it an! wi not sen! to - e"en if it is OK to !o so
1/23/2014 2: Data Link Layer 2-149

C(##i%i(n .*(i&ance: RTS5 RTS5CTS e change


e>p icit channe reser"ation sen!er# sen! short ,7.$ re?uest to sen! recei"er# rep y with short C7.$ c ear to sen! Ceigh/orsU 4 see C7.# 0eep ?uiet 4 see ,7. /ut not C7.# o0 to transmit Co isions sti possi/ e5 4 no co isions !etection 4 .en!ers 0now when they !on3t recei"e C7. 4 e>ponentia /ac0off
1/23/2014 2: Data Link Layer 2-150

C(nt00
Impro"e! performance un!er /oth hi!!en termina an! e>pose! no!e cases ,7. an! C7. short# co isions ess i0e y$ of shorter !uration en! resu t simi ar to co ision !etection I+++ 8<2'11 a ows# C.)* C.)*LC*# reser"ations po ing from *(
2: Data Link Layer

1/23/2014

2-151

S-ar putea să vă placă și