CMPE 150/L - Fall'17 Sample questions #4 solution 1. Why is it said that TCP exhibits a "sawtooth" behavior? TCP is known for its sawtooth behavior due to the way its congestion window varies with time, which is a function of TCP’s congestion control. When TCP enters steady state, its congestion window increases linearly as acknowledgements are received. When a packet loss is detected, TCP cuts its congestion window in half immediately. This variation of the congestion window over time when plotted in a graph has a sawtooth shape. 2. TCP assumes that packet loss is an indication of congestion. (a) Is that a reasonable assumption when applied to the Internet? Why or why not? One can argue that this assumption is a reasonable one when considering the Internet since packet losses due to transmission errors are relatively rare, as the Internet has become quite reliable as far as its underlying communication infrastructure. Furthermore, reliability implemented by data-link layer protocols also help recover from eventual transmission errors. (b) Is that a reasonable assumption for networks that use wireless links? Why or why not? In the case of wireless networks (especially in the case of multi-hop wireless links) transmission errors may occur more often. Therefore, in these environments, assuming that losses are always due to congestion is no longer valid and may cause significant performance deterioration. 3. Why is it said that flow control is about the receiver while congestion control is about the network? Flow control is the process of adjusting the sender’s rate of data transmission to prevent a fast sender from overwhelming a slow receiver. Thus, the sender’s rate is adjusted according to the receiver’s ability to receive data. Congestion control, on the other hand, adjusts the sender’s rate as a function of the network’s current capacity such that the sender does not send more data than the network can handle which would result in network congestion. 4. In TCP, the sender's window size is set based on flow- and congestion control mechanisms. Explain how this is accomplished. The TCP sender’s window, swnd, is a function of both the congestion window, cwnd, and the receiver’s window, rwnd. cwnd is defined by TCP’s congestion control mechanism while rwnd, by TCP’s flow control mechanism. swnd is set as follows: swnd = min(cwnd, rwnd) 5. TCP is a "window-based" protocol. There are 3 main "windows" that regulate the operation of the TCP sender. (a) List these three windows and describe their function. Sender’s window (swnd), Receiver’s window (rwnd) and Contention window (cwnd) (b) Describe how their values are set. swnd: described in question 5 above rwnd: announced at beginning of connection and can be updated by receiver during the connection. cwnd: starts as 1 segment, doubles every RTT during slow start, increases by one every RTT during congestion avoidance, cut by half in case of loss. In case of timeout, goes down to 1 segment. 6. Suppose that a TCP connection has just been established between 2 end points. How long (in RTTs) does it take to transfer a 9KByte file, assuming that the TCP segment is 1KByte? Assume that SSTHRESH is 64KBytes and no losses occur. A --- SYN ---> B 1RTT A <-SYN ACK--- B window =1 A - ACK 1KB -> B 2RTT A <--- ACK---- B window = 2 A --- 2KB ---> B 3RTT A <--- ACK---- B window = 4 A --- 4KB ---> B 4RTT A <--- ACK---- B window = 8 A --- 8KB ---> B 5RTT A <--- ACK---- B window = 16 5RTTs