* TCP uses
Selective Repeat ARQ protocol as sliding window mechanisms.
* TCP also
applies flow control by dynamically advertising the window size (flow control is
the mechanism of regulating the traffic between two points and is used to
prevent the sender from overwhelming the receiver with too much data.
* In each TCP
segment, the receiver specifies in the receive window field the amount
of additional received data (in bytes) that it is willing to buffer for the
connection.
* The sending
host can send only up to that amount of data before it must wait for an acknowledgment
and window update from the receiving host.
Figure:-TCP
Window flow control
The above figure
illustrates an example for TCP Window flow control
* Suppose at
time t0, the TCP module in host B advertised a window of 2048 and expected next
byte received to have a sequence number 2000. This advertised window size
allows host A to transmit upto 2048 bytes of unacknowledged data.
* At time t1,
host A has only assumed 1024 bytes to transmits all the data starting with sequence
number 2000, and this TCP entity also advertises a window of size 1024 bytes to
host B and next byte expected to have a sequence number 1.
* When the
segment arrives, host B chooses to delay the acknowledgement for piggybacking
(the technique of temporarily delaying outgoing acknowledgments so that they
can be looked onto the next outgoing data frame is known as piggybacking). Meanwhile
at t2, host A has another 1024 bytes of data and transmits it. After the transmission,
A’s sending window closes completely. It is not allowed to transmit any more data
until an acknowledgment comes back.
* At time t3,
host B has 128 bytes of data to transmit. Host B simply piggybacks the acknowledgment
(ACK=4048) to the data segment. at this time also host B also advertises the
window size of 512 bytes (because of some other connection the window size may
shrink).
* When host A
receives the segment, at time t4, assume that host A has nearly 2048 bytes of
data, but it is allowed only 512 bytes. Like this, window advertisement
dynamically controls the flow of data from one host to another and it prevents
the receiver buffer from being overrun.
0 comments