BYUBRIGHAM YOUNG UNIVERSITY
Computer Science
CS 460 Computer Communications and Networking
Archive

Homework #3

Review Questions (not graded, do not turn in)

  1. Kurose & Ross, Chapter 3, Review Question R4.

    Describe why an application developer might choose to run an application over UDP rather than TCP.

  2. Kurose & Ross, Chapter 3, Review Question R7.

    Suppose a process in Host C has a UDP socket with port number 6789. Suppose both Host A and Host B each send a UDP segment to Host C with destination port number 6789. Will both of these segments be directed to the same socket at Host C? If so, how will the process at Host C know that these two segments originated from two different hosts?

  3. Kurose & Ross, Chapter 3, Review Question R8.

    Suppose that a Web server runs in Host C on port 80. Suppose this Web server uses persistent connections, and is currently receiving requests from two different Hosts, A and B. Are all of the requests being sent through the same socket at Host C? If they are being passed through different sockets, do both of the sockets have port 80? Discuss and explain.

  4. Kurose & Ross, Chapter 3, Review Question R14.

    True or false?

    1. Host A is sending Host B a large file over a TCP connection. Assume Host B has no data to send Host A. Host B will not send acknowledgments to Host A because Host B cannot piggyback the acknowledgments on data.
    2. The size of the TCP rwnd never changes throughout the duration of the connection.
    3. Suppose Host A is sending Host B a large file over a TCP connection. The number of unacknowledged bytes that A sends cannot exceed the size of the receive buffer.
    4. Suppose Host A is sending a large file to Host B over a TCP connection. If the sequence number for a segment of this connection is m, then the sequence number for the subsequent segment will necessarily be m + 1.
    5. The TCP segment has a field in its header for rwnd.
    6. Suppose that the last SampleRTT in a TCP connection is equal to 1 sec. The current value of TimeoutInterval for the connection will necessarily be >= 1 sec.
    7. Suppose Host A sends one segment with sequence number 38 and 4 bytes of data over a TCP connection to Host B. In this same segment the acknowledgment number is necessarily 42.
  5. Kurose & Ross, Chapter 3, Review Question R15.

    Suppose Host A sends two TCP segments back to back to Host B over a TCP connection. The first segment has sequence number 90; the second has sequence number 110.

    1. How much data is in the first segment?
    2. Suppose that the first segment is lost but the second segment arrives at B. In the acknowledgment that Host B sends to Host A, what will be the acknowledgment number?
  6. Kurose & Ross, Chapter 3, Review Question R17.

    Suppose two TCP connections are present over some bottleneck link of rate R bps. Both connections have a huge file to send ( in the same direction over the bottleneck link). The transmissions of the files start at the same time. What transmission rate would TCP like to give to each of the connections?

  7. Answer the following with regard to the TCP variables cwnd and ssthresh. What is slow start? What is additive increase? What happens when a TCP sender detects congestion? Copy Figure 3.53 and indicate an example of each of these events on the graph.
  8. A UDP application and TCP application share the same link. Why is it possible for UDP to get a larger share of the link's bandwidth?

Problems (10 points each)

  1. Kurose & Ross, Chapter 3, Problem P4.
    1. Suppose you have the following 2 bytes: 01011100 and 01010110. What is the 1s complement of the sum of these 2 bytes?
    2. Suppose you have the following 2 bytes: 11011010 and 00110110. What is the 1s complement of the sum of these 2 bytes?
    3. For the bytes in part (a), give an example where one bit is flipped in each of the 2 bytes and yet the 1s complement doesn't change.
  2. Kurose & Ross, Chapter 3, Problem P12.

    Consider the rdt 3.0 protocol (stop-and-wait). Draw a diagram showing that if the network connection between the sender and receiver can reorder messages (that is, that two messages propagating in the medium between the sender and receiver can be reordered), then the alternating-bit protocol will not work correctly (make sure you clearly identify the sense in which it will not work correctly). Your diagram should have the sender on the left and the receiver on the right, with the time axis running down the page, showing data (D) and acknowledgment (A) message exchange. Make sure you indicate the sequence number associated with any data or acknowledgment segment.

  3. Kurose & Ross, Chapter 3, Problem P13.

    Consider a reliable data transfer protocol that uses only negative acknowledgments. Suppose the sender sends data only infrequently. Would a NAK-only protocol be preferable to a protocol that uses ACKs? Why? Now suppose the sender has a lot of data to send and the end-to-end connection experiences few losses. In this second case, would a NAK-only protocol be preferable to a protocol that uses ACKs? Why?

  4. Kurose & Ross, Chapter 3, Problem P22.

    Answer true or false to the following questions and briefly justify your answer:

    1. With the SR protocol, it is possible for the sender to receive an ACK for a packet that falls outside of its current window.
    2. With GBN, it is possible for the sender to receive an ACK for a packet that falls outside of its current window.
    3. The alternating-bit protocol is the same as the SR protocol with a sender and receiver window size of 1.
    4. The alternating-bit protocol is the same as the GBN protocol with a sender and receiver window size of 1.
  5. Kurose & Ross, Chapter 3, Problem P37.

    Consider the following figure:

    TCP trace

    Assuming TCP Reno is the protocol experiencing the behavior shown above, answer the following questions. In all cases, you should provide a short discussion justifying your answer.

    1. Identify the intervals of time when TCP slow start is operating.
    2. Identify the intervals of time when TCP congestion avoidance is operating.
    3. After the 16th transmission round, is segment loss detected by a triple duplicate ACK or by a timeout?
    4. After the 22nd transmission round, is segment loss detected by a triple duplicate ACK or by a timeout?
    5. What is the initial value of ssthresh at the first transmission round?
    6. What is the value of ssthresh at the 18th transmission round?
    7. What is the value of ssthresh at the 24th transmission round?
    8. During what transmission round is the 70th segment sent?
    9. Assuming a packet loss is detected after the 26th round by the receipt of a triple duplicate ACK, what will be the values of the congestion window size and of ssthresh?
    10. Suppose TCP Tahoe is used (instead of TCP Reno), and assume that triple duplicate ACKs are received at the 16th round. What are the ssthresh and the congestion window size at the 19th round?
    11. Again suppose TCP Tahoe is used, and there is a timeout event at 22nd round. How many packets have been sent out from 17th round till 22nd round, inclusive?
  6. Kurose & Ross, Chapter 3, Problem P38.

    Refer to the figure below, which illustrates the convergence of TCP's AIMD algorithm:

    TCP convergence

    Suppose that instead of a multiplicative decrease, TCP decreased the window size by a constant amount. Would the resulting AIAD algorithm converge to an equal share algorithm? Justify your answer using a diagram similar to the one shown above.

  7. Kurose & Ross, Chapter 3, Problem P51.

    In our discussion of TCP congestion control in Section 3.7, we implicitly assumed that the TCP sender always had data to send. Consider now the case that the TCP sender sends a large amount of data and then goes idle (since it has no more data to send) at t1. TCP remains idle for a relatively long period of time and then wants to send more data at t2 . What are the advantages and disadvantages of having TCP use the cwnd and ssthresh values from t1 when starting to send data at t2? What alternative would you recommend? Why?