Download presentation
Presentation is loading. Please wait.
1
CIS 725 Data Link Layer
2
Flow Control Producer-consumer problem Sliding window protocol
- Go Back N - Selective retransmission
3
Go Back N na x x x x ns 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
4
R:: nr = 1 do S ? (D,x) if nr = x then deliver(D); nr++ S ! Ack(nr) od
5
Acks sent but not yet received
nr na ns ns <= na + W outstanding data packets ns na nr W = 3 d1 1 d2 2 d3 3 a2 a3 d4 d5
6
Cumulative Acks ns na nr W = 3 d1 1 d2 2 d3 3 a2 a3 d4 d5
7
- Alternative: Timeout per message
d,1 d,1 d,2 d,3 a,2 a,3 d,4 d,2 d,3 a,2 start timer start timer a,2 start timer timeout d,1 start timer d,5 d,2 - 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
A ------------------B Bandwidth =108 bytes/sec RTD = 2 msecs
2msecs * 105 bytes 1 packet = 1000 bytes W = 200 W will also depend on buffer space at the receiver d,2 a,2 Timeout interval = 2msecs d,W
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.