Documente Academic
Documente Profesional
Documente Cultură
Hema A Murthy
sender Receiver
Fra
me
a ck
Timeout
a ck a ck
Timeout Fra
me
Fra
me
Timeout a ck
a ck
sender Receiver
Fra
me
a ck
Fra
me
Timeout
a ck
Services
• Sender Process
• Receiver Process
• Service primitives
– sv = Send(buf, Size, srcSAP, destSAP)
– rv = Receive(buf, Size, srcSAP, destSAP)
Sender process:
Tx
art
/ st
nd Sending
s e
L n
DL u r
e t
Idle x /r
d T
En
Receiver Process:
Rx
ar t
/ st
ecv Receiving
L R
D L
tu rn
Idle / re
R x
d
En
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
Unrestricted Simplex
• Transport Layer – message
• Network Layer – packetises
• packet – send to Data Link Layer
• Data Link Layer - frames and transmits
– Fast sender slow receiver
– Sender swamps receiver
Solution
• Slow down sender
– insert delay in sender (device drivers for
plotters, printers)
• Use feed back from receiver
– send only after acknowledgement is received.
Fra
me
0
0
Timeout a ck
Sender Receiver
Fra
me
0
a ck 0
Fra
me
0
Timeout
0
a ck
Basically require that the sender and receiver take care of all these
situation.
Sequence number:
Header includes sequence number
How good is the bandwidth usage with the stop and wait protocol?
- Example: 1.5 Mbps link
- RTT – 0.045 s
Propagation delay:
- delay * BW = 67.5 kbps
= delay BW product
- volume of a link
delay
BW
delay * BW = volume
How many bits fit in the pipe?
Suppose frame size is 1 KB
maximum sending rate:
(bits / frame) / (time / frame)
Sender Process: Tx
t
/ s tar
n d sending
L Se
D L
m e o ut
Idle Ti end of Tx
ta r tTx
s
Ack
Y / return await
t Tx
/ s tar
What if spurious ----reply nd sending
L Se
DL meout
T i
Tx
Idle start End Tx
Y / return
..
N/d
i s
ack ?
ca rd
Ack await
t Tx
s tar
/ sending
end
L S
x
DL
rt T
Sta
Idle Y / Fa
il
. End Tx
numTries > max Tries
t
..
Timeou
Y / return N / discar
d
MakeAFrame(buffer, s)
SendToPhysLayer(s)
DLLState ← Sending
else
error
endif
Sending: if event = EndTx then
DLLState ←AwaitAck
endif
AwaitAck: if event = TimeOut then
increment numTries
if numTries > MaxTries then
Indian Institute of Technology Madras
← Idle
Computer Networks Prof. Hema A Murthy
DLLState
DLLReturn ← Fail
else
SendToPhysLayer(s)
DLLState ← Sendif
endif
else if event = EndRcv then
if isAck and SegNo = ExpectedNo then
DLLState ← Idle
send Success to upper layer
else
discard ack
DLLstate ← AwaitAck
endif
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
endif
end case
wait for Event( )
endwhile Rx
art
/ s t
e cv
R Await
D LL frame
Rx
t
/ s tar Await
ecv
R frame
L L
D
t/
.
Idle e o u End Rx / start Tx (ack)
Tim il
Fa new
Send Y
fram N
e to NW
L an d
goto
Idle
else
error
endif
Sending: if event = EndTx then
DLLState ← Idle
endif
endcase
wait for An event( )
endwhile