Docsity

Homework Assignment 2, Assignments of Computer Networks

Toggle sidebar
bg1
1
Homework 2
Introduction to Networks and Their
Applications
Question 1 (UDP vs TCP) โ€“ 10 points
Give two reasons why an application might choose UDP over TCP, and two reasons why it
might choose TCP over UDP. Your reasons should be tied to concrete service properties
(e.g., reliability, ordering, connection setup, congestion control).
Question 2 (Go-Back-N and Selective Repeat) โ€“ 15 points
1) Explain the main idea of Go-Back-N (GBN) and Selective Repeat (SR).
2) Compare GBN and SR in terms of required receiver buffering and bandwidth efficiency.
Question 3 (TCP basic) โ€“ 15 points
1) TCP sequence numbers identify a byte index in the byte stream (the first byte carried in
the segment), rather than a โ€œsegment number.โ€ Explain why TCP is designed this way.
2) In the TCP header, why do we need both a Sequence Number field and an ACK Number
field?
Question 4 (TCP Receiver ACK Generation) โ€“ 20 points
Assume 1) the TCP receiver initially expects byte 100 (so the expected sequence
number is 100), 2) the delayed ACK timer is 500ms, and 3) at most one segment can
have ACK pending at the receiver. We have the following events:
1) At ๐‘ก=0 ms, receiver gets a segment: Seq = 100, data length = 10 bytes.
2) At ๐‘ก=120 ms, receiver gets a segment: Seq = 110, data length = 5 bytes.
3) At ๐‘ก=130 ms, receiver gets a segment: Seq = 125, data length = 10 bytes.
4) At ๐‘ก=200 ms, receiver gets a segment: Seq = 115, data length = 10 bytes.
Questions: For each event, state the action taken by the receiver. Write the ACK
number if an ACK is sent by the receiver.
Question 5 (TCP) โ€“ 20 points
Consider host A is sending TCP segments to host B (cumulative ACK). Please fill in the
numbers in the figure below.
pf3

Partial preview of the text

Download Homework Assignment 2 and more Assignments Computer Networks in PDF only on Docsity!

Homework 2

Introduction to Networks and Their

Applications

Question 1 (UDP vs TCP) โ€“ 10 points

Give two reasons why an application might choose UDP over TCP, and two reasons why it might choose TCP over UDP. Your reasons should be tied to concrete service properties (e.g., reliability, ordering, connection setup, congestion control).

Question 2 (Go-Back-N and Selective Repeat) โ€“ 15 points

  1. Explain the main idea of Go-Back-N (GBN) and Selective Repeat (SR).
  2. Compare GBN and SR in terms of required receiver buffering and bandwidth efficiency.

Question 3 (TCP basic) โ€“ 15 points

  1. TCP sequence numbers identify a byte index in the byte stream (the first byte carried in the segment), rather than a โ€œsegment number.โ€ Explain why TCP is designed this way.
  2. In the TCP header, why do we need both a Sequence Number field and an ACK Number field?

Question 4 (TCP Receiver ACK Generation) โ€“ 20 points

Assume 1) the TCP receiver initially expects byte 100 (so the expected sequence number is 100), 2) the delayed ACK timer is 500ms, and 3) at most one segment can have ACK pending at the receiver. We have the following events:

  1. At ๐‘ก=0 ms, receiver gets a segment: Seq = 100, data length = 10 bytes.
  2. At ๐‘ก=120 ms, receiver gets a segment: Seq = 110, data length = 5 bytes.
  3. At ๐‘ก=130 ms, receiver gets a segment: Seq = 125, data length = 10 bytes.
  4. At ๐‘ก=200 ms, receiver gets a segment: Seq = 115, data length = 10 bytes. Questions: For each event, state the action taken by the receiver. Write the ACK number if an ACK is sent by the receiver.

Question 5 (TCP) โ€“ 20 points

Consider host A is sending TCP segments to host B (cumulative ACK). Please fill in the numbers in the figure below.

Question 6 (Congestion Control) โ€“ 20 points Assume a TCP sender applies AIMD as the congestion control algorithm. The congestion window ๐‘๐‘ค๐‘›๐‘‘ is measured in MSS (maximum segment size) and is updated once per RTT. At the beginning of RTT ๐‘ก, the senderโ€™s window is ๐‘๐‘ค๐‘›๐‘‘(๐‘ก). Assume cwnd ( 1 )= 1 MSS an initial ssthresh = 16 MSS. The following loss events occur: ๏‚ท At the end of RTT 7, a loss is detected by triple duplicate ACK. ๏‚ท At the end of RTT 11, a loss is detected by timeout. ๏‚ท After that, there are no further losses until RTT 18. Question: Write the value of cwnd ( t ) for RTT t = 1 , 2 ,โ€ฆ , 16. t cwnd ( t )