Flow control in TCPTCP header fields related to flow control and error controlTCP header fields - Sequence NumberSliding Window Flow ControlSliding Window: “Window Closes”Sliding Window: “Window Opens”Sliding Window: “Window Shrinks”Sliding Window: ExampleTCP error controlMalathi VeeraraghavanOriginals by Jörg Liebeherr1Flow control in TCP• End-to-end control across a path possibly passing through multiple networks (internet transport protocol)• Flow Control: How to prevent receiver buffer overflows?• Flow Control in TCP• Window-based flow control• Called sliding window flow controlMalathi VeeraraghavanOriginals by Jörg Liebeherr2TCP header fields related to flow control and error control•Three fields of interest to error control and flow control in the TCP header•The interpretation of the AckNo and Window size fields:•The sender of the TCP segment with the Ack Number field set to “AckNo” and Window size field set to “Win” is communicating to the far end that it is ready to receive new data with SeqNo= AckNo, AckNo+1, …., AckNo+Win-1•Receiver can acknowledge data without opening the window•Receiver can change the window size without acknowledging dataMalathi VeeraraghavanOriginals by Jörg Liebeherr3TCP header fields - Sequence Number•Sequence Number (SeqNo):–Sequence number is 32 bits long. –So the range of SeqNo is 0 <= SeqNo <= 232 -1 4.3 Gbyte –The sequence number identifies the byte in the stream of data from the sending TCP to the receiving TCP that the first byte of data in this segment represents.–Initial Sequence Number (ISN) of a connection is set during connection establishmentMalathi VeeraraghavanOriginals by Jörg Liebeherr4Sliding Window Flow Control1 2 3 4 5 6 7 8 9 10 11Advertised windowsent but notacknowledgedcan be sentUSABLEWINDOWsent andacknowledgedcan't send• Sliding Window Protocol is performed at the byte level:•Here: Sender can transmit sequence numbers 6,7,8.Malathi VeeraraghavanOriginals by Jörg Liebeherr5Sliding Window: “Window Closes”1 2 3 4 5 6 7 8 9 10 111 2 3 4 5 6 7 8 9 10 11Transmit Byte 61 2 3 4 5 6 7 8 9 10 11AckNo = 5, Win = 4is received• Transmission of a single byte (with SeqNo = 6) and acknowledgement is received (AckNo = 5, Win=4):Malathi VeeraraghavanOriginals by Jörg Liebeherr6Sliding Window: “Window Opens”1 2 3 4 5 6 7 8 9 10 111 2 3 4 5 6 7 8 9 10 11AckNo = 5, Win = 6is received• Acknowledgement is received that enlarges the window to the right (AckNo = 5, Win=6):• A receiver opens a window when TCP buffer empties (meaning that data is delivered to the application).Malathi VeeraraghavanOriginals by Jörg Liebeherr7Sliding Window: “Window Shrinks”1 2 3 4 5 6 7 8 9 10 111 2 3 4 5 6 7 8 9 10 11AckNo = 5, Win = 3is received• Acknowledgement is received that reduces the window from the right (AckNo = 5, Win=3):• Shrinking a window should not be used - Host requirements RFC strongly discourages thisMalathi VeeraraghavanOriginals by Jörg Liebeherr8Sliding Window: ExampleMalathi VeeraraghavanOriginals by Jörg Liebeherr9TCP error control•Cumulative ACKs are used•In popular implementations, an ACK-every-other-segment strategy is used•Sender keeps an associated timeout value for segments sent. If an ACK is not received before the timer times out, it resends the segment•Retransmission scheme is Go-Back-N ARQ•But Selective repeat along with Selective ACKs have been added as extensions•Piggybacking of ACKs on data segments is indeed used.•If there is no data to send before a delayed-ACK timer expires, a zero-payload segment is sent as an
View Full Document