You are on page 1of 17

5.

9
Protocols for the dat a link layer are con sid
ere d wit h inc rea sed com pl~ :i~ es first by
con sid erin g an ideal channel and the n by con
sid erin g a noisy_ chanp~l. ~ :" -s~ _ ~. ~;
No ise les s channel is an ass um ed ideal
cha nne l 1n wh ich no frames are
1dst, dup lica ted , or toir upt ed. T\YO pro
tocols are con sid ere d; ~One , wit h flow
con ttol and the oth er wfthbut flow control
.
. Error -· c·o ntr ol is not nee ded ' for an 1ideal
channel. : ... r-~-• , . . ,J·_ -,: r, . 1 r ("'\r l

- J ".r j .. J
- r I

5. 9.1 Unrestricted Simplex Protocol (U to pi a)


. He re th_e dat a are -restricted in one direction
1
. This unrealistic pro toc ol ass um es
i) Inf init ebu ffe rsp ace . • ·-:ri~i• .-,• ., . , - - ___ _
ii) No pr:,oc~s~ing time. '
• I - -
iii) Frames are ~ot los t or-d am age d in the transit.
iv) The ne~ ork layer clt bot h~ends. are_;~ l~a J
ys.r~,e;1dy.,
v) No err or and flow control restrictions.
-The pr6focofhas·two pro ced ure s,~ se~der, and a receiv
The re will be no sequence rtumbers'at id 'a.Ckrio er for the dat a link layer.
wledgemefits·.- ) :- - .~ - · :.-~,: -~
The sen der 's loop has three actions; Ge ttin
g the pac ket fro m _network layer,
fr~ te constru~ti_o n! and_frame._.tr~ ~~ ~~~io
pro oco1. ~:)nfo /ie}~ _~~ _t.~ ~; <:>nlX.:. ~e _u~ed pY this
, • _ "- - -- -• ~ , - 1
' ~·

The receiver dat a link lay~~,w ,tt$ ~9~}ne fr~! ,· 1z

the net wo rk layei;; _Soll.'\e, ~f tJ~~ prqcequr~s lle ~IJ iP~.t':1-.. .:{?~f~to~,i~ -p-~ss ~~ 0~ to
from-physical-layer. ~ ~~~deµ_,aJ'~i. Na1t-for-:~v ent , fraqie-amval,
. ',; -•J~- --- _ .• • \•: .,_;. SH - 'l :~·~ ·· _ ':-,: :,· . - • ,I
- - , ,
;f°i$UreS.~9~hows.thepr_oto5pl1¥ec!:1,~ ~~- .;, .• ·.) · I•: _-,. , • 1 1 • , , • "' • J_, 1
·-tr;_'·-· ,,· __ , : ,
_
-• .-
Da ta from the sender's net wo rk layer (N) is 1

framed. m, the_da~a link iay er (L) and


~ent ~9 ug p. the p1:1-ysical ~~ye~ (PfJ:),.pver Jhe
ideal comml;lilicati,on)ipkr. .. ,~ ;-:- ·
' ':' '
At the receiver, the physical layer receives th fr .
the data, arid. this data is delivered to the network layer
e ainer the
, ~ ' layer
data link ) deframes
'
Data link layers·l!S~ their physic I la . ·. . ,{
. _ _ -· , _. ·.'. -··,~· .~: fl · yers services like s1~aling, multiplexing.
I "Jl t.
·• I , ·I ;_
'

~nder. , rp ,,1,~. ,--::: i}


) Ji•, , L Receiver.- --: -.
I \ - :__,
I
;.,, 1 • • t · ' . ;. 11 i ,~ ~

I
N _, Getdata
I I
~I ) i I, , - fY ~i ·' ~ Deliver da~ · ~ ,
I -1 - - - - - + - - - - - l
d t ' ,_ d
I
: Frame ,• t ' / •1 I
L I formation .J • -oeframing L
~ - a - I
,., ,.:_ 1 J .· I

Send Receive
:r:1 A.
PH frame -- .. ·' _,. 'f frame .,... ,

I
-7 -
Data,frames -.-.n •. r,11 ., • .,-, ~ •
L_'
r1 '

· ·.: . fli : · -,==--==-,-,::::--==·-.. :·,.-


_1::::==::::;1 : : : 1=:::ii . "-'_,.._
,I ·.-;·- ·- ·, . - -•. -
-==~,~==:.:::==::....:===----,-.:__j
-:,.- ==~. ,-~
' . . ,- ' Ideal'coinm'.urtlttitio~lirik . ~ g .:
~ -:~:~' ~f ~.--::
, -::--
. :=-·-
I

Figure 5.15 Simple prot~col mechanisrri

5.9.2 Simplex Stop and Wait Protocof-,. :·,i _


Most unrealistic testiittibns' of :..thJ,)protocol are·· the-'ignored' processmg-: tfute. Here
the buffer -space is not infinite, btit the channel) ~.~J;Ji9J I fr1e~ ~d.simplex.~Flopq.ing of
the xeceiv,er with- data ds. to b~.preyented ·by,pr.oyiding _a feedba,ck~to.,tl}~isdi'4er. The
1
receiver sen~s.a d~y (acknowledgement) {rap;ie:,.to,fue sender cllld clft~1,re~eiviP,gJh.~
acknowledgement, fue next frame is sent. These type of protocols ar~;~aU,~d stop and
• - - -- - - r- - ----- -
~~ !' - - .I ' , .

The'sender-fetche·s -a pa€ket from network layer, constructs fram~and' then sends


the frame. Now-it waits -for-lthe acknowledgement frame and· then-fe~~hes the next
paalcket_ from the n~twork liJYer~Figure 5.16 shows the protocol flt w
an ysIS ;
~d \ime
·. - -- •· - •-
rr<_~\
• . . I
So · f-. -th- -··-· :· - ·-:I..::-:::- d . from-physical-layer, to:fietwork-layer, from-
netw k me o , e proceuures· ·, i use are,
• f t Even though 'da-i:a')., ·-·tram·c 1s
· · s·imp
· lex,
or -1ay~r, _to-physital-Iarier, wait- or-even . .. ifil ·r tiowl of flow. I

Se d travel in both
frames _ .dii-edibns.
--'- This. protocol
. ,. ' d e"!5ure a receiver
, sends,. stn':1- temad sen s an - d so on.
n er sends, then the refeiver receives, .sen erv · 1 . · the main function in this
11alf duplex channel is more appropriate,. Flow, contro IS - . !
Protocol. . _____ . - - ---·· -- ----- - -
""'' -\ .
• • .I ,, ~
- - ....
- - -- l' ' • _,
- I. ,
.•,f,
Flow control mechariisin
,
.. . ,,
., Time analy~j~
A-, . . B
A B .
' I -At t =0, A starts r7 ;
Sending frame ~- - - - -- -- - ~
-@@@[!] -------- @A sends a frame
At t =tf, A compIte es I .. , _
I

Cl :,
I ·

I ACK I. --.. ----- BsendsACK transmission


.
frame ,
I ,
- °'.'- - ,- - ':' - - ,
_,I '
- At t =(tt +tP), B : - · :'·
@@(I] ___ ;? ___ _
, (.

@A sends a frame receives the frame~ _ ~ _ _ _ _ _ ·_ _ JD


---r----\
' ,. t B witholds ACK At t =(tt +!i,), B : - :
- ~ - - e • -

-•
• -
I
-
A waits for ACK Send ALK ~--- ::__ ~..:_p 1"

,____________
I - - - . - · • ••

At t =(tt +2tP), A !:.. ~_ :

receives ACK 0 !
1

_, !ACKI ------- ~ B releases ACK Utilization ,Efficiehcy


= t/ (tf +2tp)
@@ II] A sends next fr~e__·
..
_:-·. - ·- \ =Pi:_opagation time •

B Sends WACK (wait {or ,ACK) . tt = Frame transmission time


WACK I 1 ' •i

- - .
(

A waits for ACK


B releases ACK
I ACK ~• - - - - - - - -~ • ·
1
[E) --------- F A Sends next £ram~- · · . _ ·,. '
Figure 5.16 Simplex stop and_wait, p~otocol (low mechanism
•Figure 5.17 shows-the protocol mechanism. .· : · . _ · , .· · ·
-, As compared to the figure 5.15, the traffic is present oh the .forward channel for
data•transfer as well as on the reverse:channel-for-- the acknowledgement~-ACK.
· Sender ·· 1 • · • · ·: Receiver , - · · ., j •

N Get data ,, p~liver~datc! - N;


f , ,..,,,.

L. Frame ·r ._ ,
formation
~' ~


'
I
...
eceive Send I l
ec_~_iye ·: Send PH
PH - I ;

CK , frame .am~. A~K


- - i
c:::::j~ Data frame_~
I '

Ideal communication link,

ACK Frame
111( c::=i
Figure 5.17 simple stop and wa.1t .
protocolmechanism
5.9.3 Simplex_Pr()tOc()l'for_~·Noisy:Channel (Stop
and Wait ARQ)~u·. ' .,. l I'; ., . I -·· • ' ,,

'{'his protocol eru:ures error control as well as


flow control. Frame may be lost or damaged
the communication ~h ~e l. ~a ma ~e d_~a me in
can be detected a~ the receiver by checksum
l ading to retransrmss1on. A timer 1~ used.
i: cori:ectly tr~~~e~ ~d ~~ a~knowle~,g~in
the fim~_o~t~r~tran~~~~1?n 1s done.
If the.acknowledgment is recei~ed the frame
ent for a_,damaged frame rece~tion. After
The above s,a1d tim_e~ arr ~g ~m ~n t m~y lea
~ 1
_,, .. • ' • . ·,
1
•• • _

~ to duplicate frames received due to 1


vwous factors. ,. . 1i , : ' ltj • I , :
1 ' ,(' •1 r ..

' i) ) Ackno'V~edge~e~t fr~me lost co~ •

ple tel i: ::,


ii) Routing problem for the acknowledgem
ent frame.
, Once the timer .is out, thf data link layer_
sends once .again the ·same frame.(which
has already reached the destination correctly)
; Hem~e, th~ link,Iayer.,has·to ensure that no
combination of transmission errors lead·,to dup
licate packet_,deliyere.d to network layer.•
A 1-bit"sequence number (SN) is normally
used in the header·-0£ the transmitted
frames. Normally a frame is.given a.SN 'O'
and $e next frame is given the SN 'lf; then.th
next SN :o' and so ohJThe retransmitted fram e
e~arriving at the' receiverwill .have the same
SN. Duplicate frames arrival will have the
same SN ·and .areidiscard~& Frame with the
correct SN is accepted and.passed onto ·the' net
work layer of the destinatio11 machine..
Protocols using the above said procedure
are called PAR (Positive acknowledgement
with retransmismoh) or ARQ (Automatic retr
ansmission-or repeat request). -The datitt:raffic
this protocol is simplex, but the frames trav in
el in both directions. Ha lf~uplex"'charinel ~ mo
appropriate. Premature time outs are to be avo re
ided, otherwise duplicate fr.ame 'are'sent.
Figure 5.18 illustrates the protocol mechanis
m.

Sender _ R~ eiv er
N,
· i I ' ,. • r;
' ' ( ,I • ~
' ..
Get dat a ~ (" ,., I , 1 i0eli\rer dafa ·' ·· •·.N
. ·:·: C • ,. ,·,; ,< i i "), 1

L J, . t .. J., ;
', · Def •.
rarmng
~

I• I ~
I .
•l •• ece ve Se d .;
PH. ,,... ·ame ·;·, Ac K,
frame· : .: PH . . L•
:r l •
· fSecj_no ' J
' j •

__
,,,, ii ' }
I•
J..- -

· · Da ta frames ···-'
l ~ C
I.

L ~ -~••~ ~- -~ --: ~: ;-: :"" i:: ,T ~~ E< ~~ .' ,t

Practical co ~~ ca tio n ~ • I' ' •r

· · ' d,.
• .-_. · . , •· ~
~igur~ .,.1& Stop an "Xv ait-ARQ·rproto~ol m~h9!U~ll! '. . ,
·· d d -.. ~e· next-frame-to-send, frame-expAN. ed.
Some,'of the .a dditional proce µres use_ tu i f f ·
fr - ·•
to reac.h the receiver j , ...
'"'"
- · ~
, • ' • , -. . ·, · ~ ., · • f •
The timer has to be set to .allow'enough time for the -~ e · . . _. , . ' recewer
process time for the worst case, and time for acknowledgement to propagate back.
t ,, I

-, ' I'" , • '


-1 '
I ,I

' r I : ~ ,\ \ • , ' : • I f • • : , ,- •

.." • • • • \/ 1 • , , : , • • - J , • r •1 • •- -' . ' • • ., ... :

5. 9.~4 '. . Sliding·Window Protocols·. :-· · 0


1
. •· ; .· -- · •':··,

0·.~11~~~ir.f:_ti?.~-~4·~o~
-In::the:earlier pr~tocol~ di~c-us~~~i," data '& ~es ,~~;~ ,ril?Y~~.·
f1Ck,no:w~e4ge~eni, ll) th~} ~_try~~ ~~~c.tion. F1;1ll .~up~~x. s_y~~e~}s ~of econ<?~c~. as the
bandwidth of the reverse channel (for an acknowledgement) 1s nearly ,wasted _(full
capacity is not utilized). Buffer util!~ati?n.~~ p~s~,~~l~ ,wit~ .~~_gl~_. ~ir-~~!t _(~~pl~~) with
data frame in the forward direction internuxed with acknowledgement m the reverse
direction. . 1 · · > r - : , ,, r .• ,.., ,. ;_ . : .. i:: ·,;_... . ·t >1 . .

· · , : ·1nsliding·1vmdow ·flow contr'oI:tnechani~tn, multiple data frames at~ tt~mitted


withoutwaitirr~fot acknowledgement fo,r in<;lividual data frames. Thls •is knowntas-piggy
backing. 1A~send~ a message to \If.': B' ,does nofserid~c1ny frame exclusively·for sending
ack:ritowledgementsr but.ilses a rhessageiframe goiµg . froni.f :B' fo :-A\ ,Here. the delayed
acknowleclgeinerit is attached to an:.outgoing data,frame (~eparate ·:conttollrame is not
. sent). rThe piggyback field·needs ,a few·.bits,in the frame.header ahd hence :the·available
channel bandwidth is well utilized.·How, long· the ,data link layer.·has--itO -wait.is :one of
the issues.(_The synchronization is needed to,face any combiq.ationi_of garbled frame, lost
ficlll!e an4 pr,e m"ture time puts. '. . : :_, j ,,_. ~' ·'._ ·•' ---1 ' : - .• ' ' _.-..... ·;_. ., : : r • -,_ • '

·, _SUding window,protoq>l~.t~kes ~ar~ qf q1o~t,of the_qbove,:5aidJ)rpqlem.s.1)1ey are


robust ~d work inall.conditipns .. ,i. ~. J": · ._: ,: ,,.-r . , , 1, . . '.-l .. - ·i._i :~ 1, ,.- • · . • · ,. _. •
Three protocols~a,re q.i~cuss~d.,. .. ·,, ,,. ··: .. , -., _ _.--,: , ,;t '.·), . '.: _ -,..,., 1 r .,:i

5. 9.4.1 Sequence Numbering of the Frames


All data frames -are giv~h·a seqpence number from 'O' to a ~a-ximunfnumber which
is a bina~y nu~ber 0£ a _fix~4 number of bits. Maximum is (2n- ·1).~nd the _s~~uences
is re peat e d w.1·th·m .the window.
start again
· h
from.J:he-begtnrung
d . . sequence number
..-No
1
·;: , .wait s 1d1ng window protocol
n=l. 1s t ,e , stop, an . • t·~,
. 5oph,_1s 1c~Le "' d ·r vers10 i ns use ~
arb1trary n . . __ ~I 1 .
. ,; · ,, ·- . . ,
The sender has a set of ~equence- numbers to the penru•tte:d·"-- --- -- -: ·di
Mame~ an1 , J:uese
falls j.~
· · - · • d. ·'i
within the,sendµig ~1n ow. The receiving window 1·s mam . d, ·at th-e receiver
• t ame • ·: to the-
•1
set of frames 1t 1s pernutted to accept. The windows·
· bl

i.

·· • .
, ize ~las no restrictions. 1.~,ey
·.:n..•
· c
an be
fixed orvana e. ;
The sequence number within the sender's ,w ind - : ·· - , b t yet
not acknowledged. The new packet arrivhlg is ~v-e-n tohw.r_epre~ent~.frames s:e nt ~bet
· · o· e next high t n·ce nu.1~•
and the upper edge of window.is advanced b . . . es seque . .
1th
the lower edge is advanced· by one. Th~ · .Yd <?_ne. w. acknowledgement coming~
. , '
frames. The sender needs n buffers to hold
. r·· win ow mamtains
.
t f
a IS 0 _ unac
knowledge r
unacknowledged frames.
, I

The operation of the flow control mec


Sending end maintains -a window of
the window till acknowled ged. ,
. . .
18
.
tarns~
·
:,illustrate'dd.rJJthe figure 5.19.
ed size. A ~opy of the .£rame·is retained _in

, .
Receiver
B .1 •
If r I l .' lb

, • ,l A J I)

..

___ 1 _ _ _ _ _ _ _ _ _ .:_ _ _ _

□ - --- - - ~

RNR-9 --- - - - RNR-9
,,,. -; -- - - ..

~ , · f.fF1sIF14'l•F13IF12 IFn IF10IF911


., _ _ _ _ _ _ _ _ _ ____________ J

Wait for RR
RR-9 RR-9
I
!
Winqow.
r - - - - - - ., - _ ...., - - - - - - - - - _.... ~ ~ ,: ;
JI
:·I /' I
., _ _ _ _ _ _ _
I I
_ , -...
11 l
IF Fl~-1~91: i
---------. J ·'
J

' . . !J
• I (

,,'
.
J :q .. -·.): }
,,,
• : . -, r ,- ( ,_ l , . ·; -i
• ' .J ·,) Jff
• J
Fi~e·5~19 ~lpw· co~~ot ~fcJ;tanispi . fr ". •
.. -d
I ,

. ' / II! f ••

''
RR-N -.Ack with N-the ~u~ber of next fraqie ~xpept~d to rec_eive. ~ '~
(N 1) . i . . , • I
- frames are acknowled ged.
J

1• • • •• . , , .,

tetn Receiv~r n~t ready (RNR) ackno~ledg ement- is used to ,stgp ,!:he trans~ ssion
P0 rarily. RNR- means acknowled gement up to 8. RR_. Receive ready;
9
,~~
s the w i n d o ude
After receiving · !, ft 1eduetnent, A w as s h o w n
ac... 0
. s . Ac
frame!! upto F, \e dgetnentfrotn n
~
without waitin .,. an sen
g fur acknO W • .
..
s.9 .s Go-1ack-N ~
. ,. th t Q protoc
ound trip propa ol
\n
re the earlier p gation delay
ception of acrokntoco,s, e r (for transmis
owledgeme!'t) sion and for th
crucial in view
is neglect':'1•
c . · i.n
e ~ .ca_ses, th
e round-trip .
of delay ise
i) Efficiency . ·1
ii) 13andwidth_u ·
Example: R o ~ \ilizatlon. ·
d trip propagati
(depending on L ~n delay in sa
EO, MEO, or ge tellite link ran
msec round trip osynchronous ge from 20 to
propil.gation de orbit). Consid
e
540 ms
complete frame la y. A 1 000 bit frame ne r 50 K bp s channel w i t h
transmjis' sion. eds (1000/50 ~
,. . ..
K b p s ) = 20 msec 10
R efer to figure 5 ·
.2.Q ... f. .

Frame sender I

\ --·- \" ' .. Receiver


\
.__ . . 1t=O
' ., I
► t
I.
\ ..

t- 2 0 m s e c
r
-• L ► t
I

F \ - . ·:1_. ' , ''20


_... ;_ ' +2 . ,... -
l ~ e 5.20 Ex 50 p s e c ) . i"
.J.

- \ ample .
Ac 1
a c k n l kdn o ~ le d g ~ m e n t ·. ·.
~. l r. •

of thoewtim .
e is blockincgk etht isiss m o b ta in:·e-·d- , af ,
e gement pa
bandwidth is g all). 5()\l..) out o te r· (20+2
. . Goback-N
ainfully u ~ ~
sliding prot
: ~ ~e ,ana·w:t'8
st~p
ff 520 ms 5, 0..+, 25
~) nu.lh.secon
~ ~-for P!opa ds (Note:
inefficiency. . admg to pOQr gation
l efficit!n /?. o ~ c
H
arge number (le re the s e quenceocol P+Ovide .ol or 4% of th an~ 96%
e available
tr"'.'"'!"t contin n the previOUs p(S f N)
·( ~ u m b
s s o lu ti cy
o n .
to .
of W equal theuously up to -w ~r~col SN er field is.wid t he above . -
round-trip tr a n fii, said problem
s . ~ e s befo ld is 1-l\it,~ enough to
ill For ex~p
le;w = 520 /20 te blocki '. represent a fair of
= d e
~
";,s:o~ ~ e _w ). Th ly
i~out mste e sender is allowed to
w have am
e m u tted t· v e d a n d th e a c k n l ad of '1'. Th
o cont ti• nue trallS o .d t t = 520 msec e best choice
th
P e exam I . . m i · ·
w e. g e ments ,g
t. h {
u p to
P e consid~
d '= 26).ss at 20 ll\S
' e:a.c..k n
,
w in dow
· 10n o,•f £:ram / s w~e'n it neeces m te ·
, o w1e' dgem e-nt•foi fraJI\e 'O
d s
· :- ( M. · 1
rvaax:uTnhe ~ d e '
u m w m c ior is
w s~tzweafo
ysr
,I
5•9,5.1 Pipe Uning ·
fhe above technique is:known as pipe li_
ning. .
Lef the channel capacity be 'b' bps fr . I • • '
· , ame SJ.Ze 't' b"1 ·
L/b sec'= time required for single frame trans .. . ts and round trip delay 'R'sec. Tuer
'-~e is received ~dafter (L/b + R) sec th knnus~ion. Aft~~ ~/b + R/2) ·sec, the completE
upu• .J.
~d
st0P. ~ ~ ,
. . • ,

0
~ , '. _

.t ' , . · .
/
wait protocol the line utilizati _ L
e ac owledgem t ·
· · ,•
. , ·
ts{ecj_ved by the sender. Fo1
u !)n - /b (Ll,b + R) = - - . For L =r= bR efficien ·
G
will be 50 ¼and <SO% for L< bR. With pipe linin th lin L +Rb -. · · ' ,9 1
• • .

. _. .-. ,. ~ . e e can be kept busy. 1 _ . , •

5. 9.f2 . ':Pr~~~,m~ Wit~ ripe ,Lini~g


~en th~ ~ommurµcaqon ch~els is,unreliabl~ or noisy, a fram~ may.be 1 st 0 ~ d~g;J
9
in the nuddle of a long stream of frames. The receiver has to discard th d
h t b • • d~ -
. e amage name
and the sender as o e mtimated. There are two approaches.

In this approach,-- the receiver discards all subsequent ·-frames . (afte.r the error)
with no acknowl~dgeme~t s for the discarded frames. After the sender's time runs
out, the sender retransmit all unacknowledged frames in .order, starting with the
damaged or lost one. This ,causes wastage of bandwidth when the error-rate is high.
The effect of an _error (E}·is shown in the figure 5.21 when t)le receiver window
size is 1 • -
·
-
, - -·
• !.. :-
-- • •"' ' .. _{

Sender-...

· Receiver . · ► .
'· ' , Fra~s,~~sccif ' aa yer ,
.' ' • , • , ., > • I
E~br' ·
(

.
1
Time ➔ , 1·
-• • I

· • . -· . .- · (.E) illustrated
. £ t f an error
Figure 5.21 Efiec -o , '. ~ I • . • ,

· · ·• ·' - . epts frames in order


. ·~ ~ .,. . . - . ing Iinldayer ace d ·procedures
In . N) the rece1v .• Iibrar}' events an .
~d fr Pipelining protocol (Go:.back- , d some of the
atnes following an.error are distarde . .
us ed are ne tw ork layer-ready,
enable-network-layer, and ·disab
le-network-layer lo
en for ce flow co ntr ol.
Buffering is ne ed ed in this
protocoL , After ·
an err or, ·the ·. sen · \
ret ran sm it all una~knowledged• de r has lo
frames at a lat er : stage.- The!;E
ret ain ed ~ the y are acc ep ted ' fra me s are •to be \
by the receiver. W ith a~ kn ow I
. for frame N, previous . frame l~d ge_me11t ·.coming ,.in I

~ (,N-1), (N_-2),.... Fe autom<\!


Mu l~p le timers are ne ed ed (on ically _ac~()Wledged,
e pe r, _o uts t~ dm g fra ~e ) _ as
mu ltip le ou tst an din g frames. , Th the p~ ot~ ol has
ese tim ers •are sim ula ted
.. . m so .. ftw are us ing a singe 1
h ard wa re clock. 1 .. • . • ; • - • · ----
Fig ure 5.22 illu str ate s Goback-N '
. ~ co mp are d to stop-and wait ¥Q AR Q me ch an ism .
tra ns it m the for wa rd dir ect ion protacol, ~s protoco~ ha s,!Jlultip
an d mu ltip le ac kn ow led ?e me nt le·!'ames in
Sto p-a nd -w ait ARQ pro toc ol is a 11:1- the rev ers e direction:
- 1 . special case of Go ba ck -N pro toc
- •
. ' . ... . "· ol wi th the wi nd ow siz
W l
'~ I • • _! .
e ' . . • \ ' ) • '
• I

Sender Receiver
~
...J . ., .
N Get da ta De liv et'da ta

L Frame
formatio . ,.. L
t \_ - • "~ '
Receive ·· Send - - -1' i · · ·· -·
• ,.._ • _ l '-~"' ; ... l

• r PH AC K - 'frame '
\ I
·e nd
f"' --~ · · t ·
rq AC K ~ PH ~ .-1'
I •.

Da taf.--.am
r ,--_:_es__ no l '

.._. _... ..L. i...JI\ I 11- _,j_ __.__ ...J

- ·AC
• K Frames ' ·~ ·
,- 1 1 / ·ACI K no
1
- 1· 1 I 1- I r1 1
Practical communic~tionliink · .
_.
Fi ~< 5.22 Go bacli;:N ARQ p~o~
~ol.mes:h~sm
, . ;
5. 9.7 Selective Repe_at Slid·ing w •i'
- . .
Th e sec on d ap pro ach for ha nd lin
_.. ·· ., , . - _- 1n d
- --~o w. .
Prot _o.1
oc
rep eat . Goback-N protocol ha s pog err or ht th
or b and . e pre sen ce, of pipe_ lin . .
lin e qu ali ty. In thi s protocol fra wi dth m· · - - -~ ing is called selecttv e
mes
rec eiv er bu ffe rs the frame fol,low are no t d"u iza tio n if err ors are mo re du e to poor
ing a t isc ard ed aft er an err or is detect Th
on ly the err on eo us frame (an d 1 ed. e5
no t allos. or dam.aged fra ~~ an d
ap pro ac h ne ed s receiver window its SU the sen de r retransinit
~ layer memory. Frames wi thi n th :' . an 1 an d
lar g th ccessars as in .Go. back
-N protocol). '
'fhi
pre ced ing on"!' are deliver,e d to.the he nc e req uir e lar ge amounts of dat
·n ~~ ~w are accepted an d bu ffe a
. . red qntil all t)ie
. . ay errof !h e rece~ver. -
''
pr
·
5 23 illustra tes the effect of an. error wh th is
.F
·m1re · - -- en f
e receiver window size
lb -:-
Time ou t intervaJ .
.,· '
T: ', f 1- '- 4
l

,, I -. I I I
I ,,
- - -- - -! I
• Send er ,
.J <i
! -
, 1f
-,,,
n. ,
,1f
,~.,-- - t l -,,,
" •illl.1 ! . ,

~~ t:( ?~
, r •r 9' l-
,-, 'l •
◄, Receiver

ta~-~ -a;~d -, -
Bufkfe1r~E-by ~~ - -- - · ne
- Hez:i pack
- et
- ~ ·2 t~ 6~ ep

lin .tworl layer
Error ayer- .. -- -- -- . _to • I '\ • ,r •

, ~
. · ' , •· •
I
-- . - - .lJ
J , j_.' .\;,, nt e 1

~ _ __ - . -- - - -
-- ~ '--~ _!--;·--:_ ,·-=- ~ -- =~ -- .1_ · _ _:
-- -- - .

-re effe ct_o hJ


r.
h ~ o r for the protocol
tJ
Figure 5.23 illustrafing- ,.. ._ , •.
..,- •
.... .... . , . . • .:,1-" • .

, i' •
otQCol. Figure 5 2 4
..._ - · • I c· 1
I r • ') •
~ ~ , I
f°)
d'
r
to th e G o
7

bl
,
lck- N
.
pi
• • 1
•' - I- (

Complex as compare
, ,:, •· ' ' 1 • '")
[

This J'rotOCol is m o re _
,m ed ia t) is ~ ,, . c . , .. ,; :" t w : ,,· ..:..- , ,r
showsfl!lleictive :r;e~J:
AR Q protoco) . -r;,, ·· '-• ,-_- . n· ,,-,;-
c- •,v ., ., .,
' • •
, · •• ; ,·,, ~ • , ••· :, ,iJ·-{" •.--; • ,... · ,
-- ·. ' r •
~~ . -n r,, J
· J • . I..., •- ' ·,
1
) L j' y- j
~Red'eiver-. -,it1:,
Sender _,..

N
N Get da ta

r • J link C K no -r'-. ·hI ·m


~t io p

Practical co m m ur uc RQ, protoc0l-mec ams .


igur_e 5.24 .Selecti,_ve re-peat A
------
-F r:-- ;••; x i:.1
~ --S-') r
~ ':
.,,,.
ti·: ·,
-
1·-J
,;
1'--. •·
,..
' L,
J.
. , •
. • ,..; '··: ; ·:,, • •: { ·'.;

~
• : .
• i • ._

otocOIS, 'In this


• ·,) L ..<' r
.,, I •

pr
P;ggybackirlg (

"\ • \• ! f

S,M ~'d h'eciidn al


Also refer! o
5,9,8 cy of
the 1 trol
daintafofri-m
om
atB nA
ioto ount
abca
efficien so carry the co~
Piggybacking is used to im p ro v e th 1 t o Bcan aly a frame carrymg
A
a gd at a fr om
PProach, a frame carryin In the sa
ames to
mearwriave' d or loSt frQ
oml mec
frco · hanism.
llieoi1!i"ed or lost frames fr o m B. the
als in G o-back0N AR pro
~ three·sco at io n ab o ~ t
ntrol inform gybacking
Figu .25 sh ow s the
pig
No de , B
I~ T · N od e, ~ I •·

De liv er
Deliver Get Get
N data , da ta , data N
Seq n~
data ~ ·
LD~e-~
, -. i--
. -~ _- ... - - 1 7
, '~ -__ , ,- ~e - , ,J L
L Framing · b k d , fra mi ng : , Franung
,._1 Piggy ac . e,,
framing . --. ' "frame.; . . ' , _i.
r I
' . •~•
~. '' .
I

✓ •••
~: ,,. -. r

Receive
,, .,
• .Receive Send ·
1

I ·Send ,.
PH frame ,. . fraine · · ,- ... · (' l , ,. fraIJ\e' "' . _1' ,,. lra m.e PH
L➔.....----~--1_ - . - - . Piggy oac}<ed ·· : ~ , c _✓ 1
:_ ~ ; '.'.

fr ~e s
'
-it .,__,...;.·~· - .--r j-'i I
'~ . ' II I . . I !I I I I J[J 'j . .•
1 · • · l.
).11:1
Practical communication lin
k
-I I T ,, ' t I II
r' . ' . f',. •
. ,
, ' l .. ' . ' Piggy backed frames . • ~: .. ;~, -· . ~ . '- .J =' .=. !. (
w .

F i~ e 5.25 ~f_ggyb~cking ~ :Go


-b ac k- N -~ R ~ P! ot oc~_l m ec
_h ~~m ; 1r
Ea ch no de (A an d B) ha s tw o
wind'ows on e fo r se nd in g an
wi th timers. These wi nd ow d th e ot he r '.for -t eceiving
s op er ate wi th th re e ev en ts;
Sa me alg or ith m is µs ed -for bo Re qu es t, ar riv al, an d time-o
th nodes. ut.
r -
. ! I· __l , ,,
, I ---- i
5.9.9 Protocol ·Performance/lssu L , .,, i ' .·-. ,'. I
1

On e of th e ~ ajor ·protocol
es .
1
.
• :.-: · ...- - -i
performance cr ite rio n is in \.. ~ j &.
'l

efficiency. Var io us ~flow mech fin di ng .t!te. :,~b-an ne l, utilization


... .,.
I l •I
~
anisms ar e considered.
l
; :.
i~
I I • ~
t -- . -~·
,. , ··•• f J ....,._;

5. 9. 9.1 ;Stqp-and-Wa!f_A~Q - -, .'i.: : tJ.


~

A ha lf- du pl ex po ~t -to -p oi nt
__erotocol~· -- - - . .J
ch an ne l/ line is considerecf-t o de
ter mi rie th e efficiency.
i St ati on ·l -·- , - · · St ati
on ~ ' - · ;
- ---1 g 7 ,,,, - .·. l
. .. -=r s i
· L. 1. J ~
i :.: - • ;- - -:--~

- . _.. 11111 · ., .

, ·. i ~:d · . ►I
' .
Th e se qu en ce of se nd in g fra
mes (f1, f2 .... .., fN) of a lo ng m
51 se nd s frame f ; 5 se nd s·,~ es sa ge is gi ve n below.
1 2 Ack.; · : - . ~ 1 , , • ~.
.,$1 se nd s fr ~~f ; 5 se nd s .., r
• • .. • , , , (:

2 2 ~ ~c k. . ..
.
' ' ~ , I •, , •r ' :1 l• ,i ' ,
l. ; i"

ff > •

l..

I r

,I:- •
sends frame fN; S2sends an Ack. _ .
51
d the d t ., - .
ot T be the tota l tim e to sen NT
1
d . th a a. Then'T - t
Jfo
ack now ledgem ent - F. where TF is th~ time tak
sei1d one tram e an rec eiv e e
. . , en o
::: [ t + tf + tproc + tp + t Ack+ t ]
TF P proc
........ (5.14)
Where tP = Propagation time from s to S 2
==Distance, d/ vel.ocity of propagati on, v•
t ==Time to transnut one frame. _.
t::: Length of frame in bits /
Data rate m· bpsr
. . . ·
t = Processtpg time at each station tor t ·
· ea<;: to an inco ming frame.
proe = Time to tra nsm it at ·Ack
tA~ •
} ·. ·
t and tAck can be neglected as t is relative y sma11 and ,ACK frame is very small
Compared to a data·frame. . proc
, _
Tlie nNT F = T = N (2tP + tf) 5 5
link or cha nne l, U = N(t ,) · .... :... ( .l )
Maxim um uti liz ati on/ effi ciency of the
_ N(2tp +tr ) .
U= ( 1 ) · _ · ........ (5.16)
2a + I ·

......... (5.17)
Where a = tP/ tf
In practice, actual utilization will be less due
to
i) Overhead bits in the frame, and
ii) Approximation ma de in neglecting tproc
and tAck.

g Wi~dow. ·Pr.qt~cols · · ~
5.9.9.2 · ·s1;~;n_
s on -·
In sliding window protocols, the-efficiency: depend
i) Window size, W and
ii) The val~e of a= tP/ tr · ·: . . .-
Afull d upIex por•nt - t o - ,po t link/ cha 1s considered.

_ -nnel
· Station 2 '
Station 1
rn I◄ d
·m ·
...i

Let the stat;ion S sta rt transmissiort at time: t


0

·- The performanc~ is considered for two ca~es.


+.1 ) has exhausted its window. ·This
· i) W > (2a 5
fra me f reache s. S1 befor~ S t and the utilization will be uni ty
The AC K for .
. i ·ss1on from i . ·
. .
leads to con tin uou s transllll
i.e. U =1.
ii) W < (2a + 1)
'1~uous1y as th e w in do w s bat sl w·1iI J...
m it , t T he ut
cona..u.m i · ati'on ca n e sta
·11z . te(! asue
5 rmsediate po . .
. n i canno.t tr an
The statio · ·· ' '
exhausted at some mte
I
'
," J ' t

U = WI (2a + 1). W > (2a + 1) ) . .


U=l .
I I .
· ·········•(5.1s)
W ·w< (2a + ,·1) . , l

= -- -
B) ·t ca n .b e se en th at ' th e efficiency is lllore,101
(2a + · 1) . (5 ·16 ) an d (5
. .1 ,, 1 , · • - · ·
Fr om eq ua tio ns 1

ol . . . pa re pr ac tic al ut ili za tio n factors


sliding w inrodo w protoc e ad de d to co m . ., l •

Error co nt l fu nc tio ns ar
Th ree ARQ schemes ar e co ns id er ed . . m· e·r· ror .
· g1e frame 1s · ·:
Let Pb e th e prob abili··ty th at a sm
r I ••

,I I

i) St op -a nd -w ai t pr ot oc ol
U = (l - P)/ (1 :r 2a)
• 1 J l .
. • .......... (5.19)

ii) G o- ba ck -N A R Q Protocol
U= (l -P )/ (1 + 2aP) W > (2a + 1)} . ~ .........(5.20)
= W (1 - P)/ [2a + 1) (1 - W
P) J · W < (2a + 1)

otocol . . ,·
iii) Se le ct iv e reject A R Q Pr
W > (2 a + 1) )
U = (I - P) .... ..... (5.21)
W <( 2a + 1)
= W (1 - P) / (2a + 1)
, .(5.19)'. (;5
_ ,20), an d (5 ;2 1) ar e sa m e, . ,
N ot e: i) When P = 0, equa
tions (5.16)
at A R Q an d G o- b. ic k- N A RQ protocols for
repe
ii) With W = 1, the selEictive op -m d-w ai t pr ot 9c ol . ,. .
W < (2a + 1) reduces to st
~me,~. s~~ ; B .t data to the moon. What 1s the smallest pos .
.
A 1.5 Mbps link is used to transIIU . ·on? The distance between earth and ths1h1e &~II,
· us transmiss1 · e ·•1e
size that allows conttnuo d h eed of light is 3 x 108 m/ sec. · llloot\ .
approximately 375,000 kms an t e sp - . , ~

Solution
3 "
375, 000 x 1.0 m = 1.25 sec
3 x i 0s m I sec
Propagation delay time, tr =

At 1.5 Mbps with a propaga tion delay of 1.25 s~c, the number of bits that can~
transmit ted= (1.25 sec) (1.5 x 106 bits/ se~) =_1.875 M bits._ . .
All frames having data~ 1.875._Megabits allow continu ous transnussion.

Computer A uses stop-and-wait ARQ protocol to send packet to compute r B. A and Bare
separated by a distance of 4000 kms. ·
i) How long does it take compute r A to receive acknow le?geme nt for a packet)
ii) · How long does it take for compute r B to receive a packet of size 1000 bytes
if the throughp ut is 100 Mbps?·Assume the speed to be the velocity of lighl
Neglect other delays.
\..
1
I
'
I

Solution
I •
i) Computer A takes round trip propaga tion; delay of
2t to receive the
acknowle~gement (Other delays a~e assumed to be negligible)
4000 X 103 ffi ]
2t-2 [ - -8 - - I
1

P- 3 x 10 m / sec
' I, . I j

= 26.67ms ec • I• ~

ii) Frame/p acket transmission time t


, f
= (8 x 1000)bits · ·_
6
100 x 10 bits; sec = 80 µsec ·
I

B receives the packet in (t ' ·


-1
- 3415 µsec .
P+tf) sec= 26 ·6
. 2
msec + 80 µsec ½
annel is operating' at 4800 bps and th
Ac~e o:ununum frame size for stop-and:~:; ~:gation delay is 20 insec. What should
t,e .
ef{ictency.? . w control to get 50%o link u til"izati" on

solution · ·
· channel u_tilization efficiency, U = tr -o 5
2tp + ti - ·

0.5 =( 2x 2oxt~o-' + t, ) . .,

• t = 40 msec
.. f ·, I ,.
Minimum frame size= (tf) (Data rate)
= (40 x 10-Jsec) (48~0 bps)] = 192 bits
For frame size> 192 bits, stop-and-wait protocol is 50%efficient.
• ' ·'. • .. .1

.I • . .

A3000 km long T-1 Trunk is used to' tr~ mit 64.~;tet fram~~ Go~back~N ARQ ~;hlg
protocol. If the propagation speed is 6 µsec/ , how many bits should the sequence
number be? /km · ..,,,

Solution
Propagation tim, tP = (6 x 10-6 sec/km) 3000 km~ 18 mse~ , ..
1
T-1 Carrier bit rate =·1.544 Mbps ·· :-· ~ .
Frame _transmission time, tf = 64 x 8 = 0.332 msec . _ . , · •
6
l.544X 10 . . .
_Full frame is received at.the end of (t/ 2~) secs. ,._ .' ) _ .msec .
· . . af (0 332+18+18 - · 36 332
1.e. The acknowledgem ent_.1s recerv;ed, te! · · d te 36.332 msec.
The sender should have enough Wlf} ow . d space to accommo a
• ' ,
W· . , - (36.332) Frames are needed to fill the link.
1
th a frame taking 0.332 msec, 0.332 ·
36.332 . .
7
~ 323 == 113 Frames, 2 = 128 . )
. . (27<113 .
F . , / nee numbers.
ram.es needs atleast 7 bits for the seque
( ~Cl~p,~ . the maxi mum size of the send and receiv e Windo
. . \Vs
Using Sbits equen cenum bers, what is .
for the follow ing protocols? ··
i) Stop- and-w ait ARQ
ii) Go-ba ck-N ARQ
iii) Selective repea t ARQ
,-

Solution
i) Size of send wind ow = 1, size of receiv e wind ~w ~ 1
ii) Send windo w size = 25- 1 = 31 receiv e wind ow size = 1
iii) Send windo w size = receiv e wind ow size = 2 s-i = 16

Exa
of data, how
A system uses stop-a nd-wa it ARQ protoc ol. If each packe t carrie s 1000 bits
sourc e and the
long does it take to send 1 millio n bits of data if the distan ce betw een the
destin ation is 5000 km and the propa gation speed is 2 x 10 m/ ~r Assu me
8 that no data or
contro l frame is lost or dama ged cl!1d negle ct other delay s? ,
{
:s i (
I ~ • ~

Solution
1000
Frame transm ission time, tf = - - - - = 1 msec
1,000,000
; • 3 .
Propa gation time, ~= , SOOO x IO m ~ '25 · ·
2x 108 ml sec msec.
TACK= 0, ~ for ACK = 25 msec ' ·; " ·'
•I · t .

_
Ack for one frame is received after (t£·,..2~) sec =(1 +2x25) msec = 51 msec
'v '
Total numb er of packe ts= {000, 000/1 000 = 100() J ., - ._,:

Total delay for 1000 Packets = {l000><Sl) · ._ :.· ,· , , rr r '


msec = 51 sec.
_j • . I - -' j.
a a _,,
6) If th e fra m e size is 960 bi ts on a satelli!e
ch an ne l op er at in g at 960 kbpS, w ha t
m ax im um lin k ut ili za tio n for th e follo is the
wing?
i) St op -a nd -w ai t ARQ protocol.
ii) Sl id in g w in do w pr ot oc ol w ith w
in do w siz es 7, ~27, 255. ,
A ss um e th e pr op ag at io n de la y to be 27
0 msec. ,
. [Ans: i) 0.185%; i~) 1.254%, 23.38.%, 47
7) A se nd in g sta tio n tra ns m its frames of .17%]
10 kilo by te s lo ng at 4 M bp s ov er a lin k
ro un d tri p tim e of 40 msec. Fi nd th e m with
in im um va lu e of th e tim e ou t tim e. Al
th e effective da ta ra te an d th er eb y th e so find
efficiency. ·

You might also like