Download presentation
Presentation is loading. Please wait.
Published byJemima Cassandra Williams Modified over 9 years ago
1
CIS 725 Data Link Layer
2
Flow Control Producer-consumer problem Sliding window protocol - Go Back N - Selective retransmission
3
Go Back N S:: ns = 1; na = 1 do ns < na + W /\ avail(nl_buff) /\ sbuff[ns] = null sbuff[ns] = nl_buff; R!(sbuff[ns],ns); ns++ [] sbuff[ns] != null R ! (sbuff[ns],ns); ns++ [] R ? ack(s) if s > na then na = s [] timeout ns = na od ns na x x x x
4
R:: nr = 1 do S ? (D,x) if nr = x then deliver(D); nr++ S ! Ack(nr) od
5
nans nr ns <= na + W outstanding data packets Acks sent but not yet received W = 3 d1 d2 d3 a2 d4 d5 a3 ns na nr1 3 1 2 1 4 1 4 2 5 2 1 2 3
6
W = 3 d1 d2 d3 a2 d4 d5 a3 ns na nr1 3 1 2 1 4 1 5 1 1 2 3 Cumulative Acks
7
d,1 d,2 d,3 a,2 d,1 d,2 start timer timeout d,1 d,2 d,3 a,2 a,3 d,4 d,5 start timer - Alternative: Timeout per message
8
Go Back N S:: ns = 1; na = 1 do ns < na + W /\ avail(nl_buff) /\ sbuff[ns] = null sbuff[n] = nl_buff; R!(sbuff[ns],ns); ns++; if ns = na + W then start timer [] sbuff[ns] != null R ! (sbuff[ns],ns); ns++ [] R ? ack(s) if s > na then na = s; cancel timer [] timeout ns = na od
9
d,1 d,2 d,W a,2 A ------------------B -Bandwidth =10 8 bytes/sec -RTD = 2 msecs - 2msecs ---- 2* 10 5 bytes - 1 packet = 1000 bytes - W = 200 -W will also depend on buffer space at the receiver Timeout interval = 2msecs
12
Selective Retransmission Retransmit only those packets the lost packets
13
Selective Retransmission S:: ns = 1; na = 1 do ns < na + W /\ avail(nl_buff) /\ sbuff[ns] = null sbuff[n] = nl_buff; R!(sbuff[ns],ns); ns++ [] R ? nack(s, bitmap) na = s; for (0 <= i < W) if bitmap[i] then R! (sbuff[s+i], s+i); [] timeout R ! (sbuf[na], na) od
14
R:: nr = 1 do S ? (D,x) rbuff[x] = D; recd[x] = true; if x != nr then S !nack(nr, bitmap) [] recd[nr] deliver(rbuff[nr]); nr++ od
15
R:: nr = 1 do S ? (D,x) rbuff[x] = D; recd[x] = true; if x != nr then S !nack(nr, bitmap) [] recd[nr] deliver(rbuff[nr]); nr++ od
16
Receiver timeout R:: nr = 1 do S ? (D,x) rbuff[x] = D; recd[x] = true; [] timeout S !nack(nr, bitmap) [] recd[nr] deliver(rbuff[nr]); nr++ od
18
Receiver based Windows S:: ns = 1; na = 1 do : [] R ? Ack(s,x) W = x; if s > na then na = s od
19
R:: nr = 1 do S ? (D,x) if nr = x then deliver(D); nr++; compute W; S ! ack(nr, W); od
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.