 Hello, and welcome to the session on TCP flow control. At the end of this session, students will be able to uniquely identify the phases in TCP flow control. Windows in TCP, TCP uses two windows, same window and receive window, for each direction of data transfer, which means four windows for a bi-directional communication. However, to make this session simple, we assume that the communication is only unidirectional, that is from client to the server. Same window and receive window. Now, the figure shows an example of a same window. The window shown in this figure is of size 100 bytes. Normally, it is thousands of bytes. The figure shows how a same window opens, closes and shrinks. The same window in TCP is similar to one used with the selective repeat protocol, but with some differences. The first difference is that nature of entities related to the window. The window in TCP numbers of bytes, actual transmission in TCP occurs segment by segment. The variables that controls the window are expressed in bytes. The second difference is that TCP can store data, receive from the processes and send them later. Here, we assume that the sending TCP is capable of sending segments of data as soon as it receives them from its process. Another difference is the number of timers. The selective repeat protocol may use several timers for each packet sent, but the TCP protocol uses only one timer. Now the receive window. Figure shows an example of receive window. The window shows here is of size 100 bytes, normally thousands of bytes. The figure also shows how the receive window opens and closes, but in practice the window should never shrinks. There are two differences here. The first difference is that TCP allows the receiving process to pull data at its own pace. This means that the part of allocated buffer at the receiver may be occupied by the bytes that have been received and acknowledged, but are waiting to be pulled by receiving process. The receive window size is then always smaller or equal to the buffer size as in shown figure. The receiver window size determines the number of bytes that receive window can accept from the sender before being overwhelmed. The second difference is the way of acknowledgments used in the TCP protocol. Now the flow control. Flow control balances the rate of producer creates the data with the rate a consumer can use data. TCP separates flow control from error control. Figure shows unidirectional data transfer between sender and receiver. Figure shows the data travel from sending process down to the sending TCP from the sending TCP to the receiving TCP from the receiving TCP up to the receiving process that is path 1, 2 and 3 as shown in figure. Flow control feedbacks are travelling from the receiving TCP to the sending TCP and from the sending TCP up to the sending processes that is path 4 and 5. Most of the implementation of TCP do not provide flow control feedback from the receiving process to the receiving TCP. Flow control feedback from the sending TCP to the sending process that is path 5 is achieved through simple rejection of data sending TCP when it windows is full. This means that the flow control concentrates on the feedback sent from the receiving TCP to the sending TCP that is path 4. Open and closing window to achieve flow control TCP forces the sender and the receiver to adjust their window size. Although the size of the buffer of the both parties is fixed when the connection is established the receive window closes. Closes means moves its left wall to right and when more bytes arrive from the sender it opens means moves the window right wall to the right. When more bytes are pulled by the process. The opening closing and shrinking of the send window is controlled by the receiver. The send window closes when a new acknowledgement allows it to do so. The send window opens when it receives window size advertised by the receiver allows it to do so. A scenario figure shows a simple example of unidirectional data transfer from client to the server. Assume that no segment is corrupt lost or duplicate or arrive out of order. Eight segments are exchanged between the client and server. The first segment is from the client to the server that is sy segment to request connection. The client announces its initial sequence number 100 when this segment arrives at the server it allocates a buffer size of 800 and sets its window to cover the whole buffer that is the receiver window size equal to 800. The second segment is from server to the client this is an ack plus sy segment. The segment uses ack number is equal to 101 to show that it expects to receive bytes starting from 101. The third segment is ack segment from the client to the server after the client has set the window with size 800 the process pushes 200 bytes of data the TCP numbers these bytes 101 to 300 it then creates a segment and send it to the server. The segment shows the starting of number as 101 and the segment carries 200 bytes. When the segment is received at the server the bytes are stored and the receive window closes to show that the next byte expected is byte 301. The fifth segment is feedback from the server to the client the server acknowledgments bytes up to and including 300 expecting to receive byte 301. The segment also carries the size of the receive window after decrease it to the 600. The client after receiving this segment and acknowledged bytes from the its window and closes it window to show that the next byte to send is 301. The segment 6 is sent the client after its process pushes 300 more bytes. The segment defines sequence number as 301 and contains 300 bytes. When this segment arrives at the server the server stores them but it has reduced its window size after its process has pulled 100 bytes of data the window closes from left for the amount of 300 bytes but opens from the right for the amount of 100 bytes. The result is that the size is only reduced 200 bytes the receiver window size is now 400 bytes. In segment 7 the server acknowledges the receipt of data and announces that the window size is 400. When this segment arrives at the client the client has no choice but to reduce its window again and set window size to the value of receiver window 400 advertised by the server. Segment 8 is also from the server after its process has pulled another 200 bytes. Its window size increases the new receiver window is now 600. The segment informs the client that the server still expected byte 601 and the server window size has expanded to 600. Here the sending of this segment depends on the policy imposed by the implementation. Shrinking window the receipt window cannot shrink but the same window can shrink if the receiver defines a value for receiver window that results in shrinking the window. Some implementation do not allow the shrinking of the same window. The limitation does not allow the right wall of the same window to move to the left. New acknowledgement plus new receiver window is greater than or equal to last acknowledgement number plus last receiver window. The left side of the inequality represents the new position of the right wall with respect to the sequence number space. The right side shows the old position of the right wall. The relationship shows that the right wall should not move to the left. Now the example. The part A of the figure shows the value of last acknowledgement and receiver window. Part B shows the situation in which the center has sent bytes 206 to 214. The byte 206 to 209 are acknowledged. The new advertisement defines the new value of the receiver window as 4. When the same window shrinks it creates a problem. The receiver forces to maintain the right hand wall of the window to be shown in a part A because the receiver does not know which of the bytes 210 to 217 has already been sent. One way to prevent this situation is to let the receiver postpone its feedback until enough buffer locations are available in it. Here pause the video and attempt the MCQ. The answer is B. Now attempt the second MCQ. Here the answer is B. Here are my references.