TCP SlidingWindows06
TCP SlidingWindows06
Lecture material taken from Computer Networks A Systems Approach, Third Ed.,Peterson and Davie, Morgan Kaufmann, 2003.
Advanced Computer Networks : TCP Sliding Windows 1
Sliding Windows
Normally a data link layer concept. Our interest is understanding the TCP mechanism at the transport layer. Each frame is assigned a sequence number: SeqNum. The sender maintains three variables: send window size (SWS), last ACK received (LAR), and last Frame sent (LFS).
Advanced Computer Networks : TCP Sliding Windows 2
Sender Variables
SWS :: the upper bound on the number of outstanding frames (not ACKed) the sender can transmit. LAR :: the sequence number of the last ACK received. LFS :: the sequence number of the last frame sent.
Advanced Computer Networks : TCP Sliding Windows 3
Sender Invariant
LFS LAR SWS
SWS
LAR
LFS
Sender Window
An arriving ACK LAR moves right 1 sender can send one more frame. Associate a timer with each frame the sender transmits. Sender retransmits the frame if the timer times out. Sender buffer :: up to SWS frames.
Advanced Computer Networks : TCP Sliding Windows 5
Receiver Variables
Receiver window size (RWS) :: the upper bound on the number of out-of-order frames the receiver is willing to accept. Largest acceptable frame (LAF) :: the sequence number of the largest acceptable frame. Last frame received (LFR) :: the sequence number of the last frame received.
Advanced Computer Networks : TCP Sliding Windows 6
Receiver Invariant
LAF LFR RWS
RWS
LFR
LAF
Receiver Window
When a frame arrives with SeqNum:
If (SeqNum LFR or SeqNum > LAF) the frame is discarded because it is outside the window. If (LFR < SeqNum LAF) the frame is accepted.
Write bytes
Read bytes
Segment
Segment
Segment
Transmit segments
13
Sending application
TCP
LastBy teSent
LastBy teRcv d
Figure 5.8 Relationship between TCP Send Buffer and TCP Receive Buffer
Advanced Computer Networks : TCP Sliding Windows 14
16
18
or use EffectiveWindow:
EffectiveWindow = AdvertisedWindow (LastByteSent LastByteAcked)
19
2. LastByteWritten LastByteAcked MaxSendBuffer equality here send buffer is full!! TCP sender process must block the sender application.
Advanced Computer Networks : TCP Sliding Windows 20
21