---
tags: Computer Network
---
# NCCUCS NET22 HW03
## R14
**True or false?**
### (a.)
**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.**
:::success
False
:::
### (b.)
**The size of the TCP rwnd never changes throughout the duration of the connection.**
:::success
False
:::
### (c.)
**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.**
:::success
True
:::
### (d.)
**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.**
:::success
False
:::
### (e.)
**The TCP segment has a field in its header for rwnd.**
:::success
True
:::
### (f.)
**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.**
:::success
False
:::
### (g.)
**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.**
:::success
False
:::
<br>
## 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.**
### (a.)
**How much data is in the first segment?**
:::success
Consider sequence numbers. First segment = 90, Second segment = 110, Data in the first segment = 110 - 90 = 20.
:::
### (b.)
**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?**
:::success
Consider the first segment is lost but the second segment arrives at B. In the acknowledgment that Host B sends to Host A, then the acknowledgment number will be first segment of sequence number, that is 90.
:::
<br>
## R16
**Consider the Telnet example discussed in Section 3.5. A few seconds after the user types the letter ‘C,’ the user types the letter ‘R.’ After typing the letter ‘R,’ how many segments are sent, and what is put in the sequence number and acknowledgment fields of the segments?**
:::success
\begin{array}{|l|l|l|}
\hline \text { Segment } & \text { Sequence number } & \text { Acknowledgment field } \\
\hline \text { First segment } & \text { seq }=43 & \mathrm{ack}=80 \\
\hline \text { Second segment } & \text { seq }=80 & \mathrm{ack}=44 \\
\hline \text { Third segment } & \text{ seq }=44 & \mathrm{ack}=81 \\
\hline
\end{array}
:::
<br>
## R19
****
:::success
TCP splitting has a shorter delay than a direct connection when:
$4 \times \mathrm{RTT}_{\mathrm{FE}}+\mathrm{RTT}_{\mathrm{BE}}+$ processing time $<4 \times \mathrm{RTT}+$ processing time
Assuming that the processing time is the same with and without TCP splitting, we have:
$4 \times \mathrm{RTT}_{\mathrm{FE}}+0.5 \times \mathrm{RTT}<4 \times \mathrm{RTT}$
Thus, TCP splitting has a shorter delay than a direct connection when $\mathrm{RTT}_{\mathrm{FE}}$ is below $7 / 8$ RTT.
:::
<br>
## P1
****
:::success
The well-known port for HTTP is 80 .
a. Source port: 33000 , destination port: 80 .
b. Source port: 80 , destination port: 33000 (they are inverted).
c. No, the HTTP protocol runs over a TCP connection.
d. Yes, if supported by the server (almost all web servers do).
:::
<br>
## P2
**Consider Figure 3.5. What are the source and destination port values in the segments flowing from the server back to the clients’ processes? What are the IP addresses in the network-layer datagrams carrying the transport-layer segments?**
:::success
Assume the IP addresses of the hosts A, B, and C are a, b, c, respectively. (Note that a, b, c are distinct.)
- To host A: Source port =80, source IP address = b, destination port = 26145, destination IP address = a
- To host C, left process: Source port =80, source IP address = b, dest port = 7532, destination IP address = c
- To host C, right process: Source port =80, source IP address = b, dest port = 26145, destination IP address = c
:::
<br>
## P3
**UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes: 01010011, 01100110, 01110100. What is the 1s complement of the sum of these 8-bit bytes? (Note that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are being asked to consider 8-bit sums.) Show all work. Why is it that UDP takes the 1s complement of the sum; that is, why not just use the sum? With the 1s complement scheme, how does the receiver detect errors? Is it possible that a 1-bit error will go undetected? How about a 2-bit error?**
:::success
Calculate the sum of the given 3 bytes.
Add first two bytes: 10111001
Now add the result with the 3rd byte: 100101101
Wrap around the extra bit: 00101110
Check sum: 11010001
The 1’s compliment of (sum) 00101110 is 11010001.
It is clear that the 1’s compliment and the checksum are the same.
User Datagram Protocol (UDP) uses the 1’s complement as it is same as the checksum of the sum.The checksum is used by the receiver to identify the errors in the segment. The receiver performs the following steps at the receiver end to identify the errors in the segment.
1. Add all the bytes including checksum.
2. Observe the sum.
- If it contains all 1’s then the segment has errors.
- If it contains 1 or more 0’s then the segment contains errors.
:::
<br>
## P4
****
:::success

:::
<br>
## P9
**Give a trace of the operation of protocol rdt3.0 when data packets and acknowledgment packets are garbled. Your trace should be similar to that used in Figure 3.16.**
:::success
Figure illustrating data sent by the sender is corrupted:

Figure illustrating ACK sent by the receiver is corrupted:

:::
<br>
## P15
**Consider the cross-country example shown in Figure 3.17. How big would the window size have to be for the channel utilization to be greater than 98 percent? Suppose that the size of a packet is 1,500 bytes, including both header fields and data.**
:::success

:::
<br>
## P19
****
:::success

:::
<br>
## P22
**Consider the GBN protocol with a sender window size of 4 and a sequence number range of 1,024. Suppose that at time t, the next in-order packet that the receiver is expecting has a sequence number of k. Assume that the medium does not reorder messages.**
### (a.)
**a. What are the possible sets of sequence numbers inside the sender’s window at time(t)?**
:::success
N = Window size = 4
Range of sequence number = 1024
Case 1: Assume receiver is $k$ and acknowledged all the $k$-1 packets. The sender's window will be in the range of $[k, k+N-1]$ sequence numbers.
Case 2: If the sender's window will be in the range of [ $k-N, k-1]$ sequence numbers. The sender's window will be in the range of $[k-N, k-1]$ sequence numbers. So, the possible sets of sequence numbers inside the sender's window at time $t$ are in the range $[k-N, k]$.
:::
### (b.)
**What are all possible values of the ACK field in all possible messages currently propagating back to the sender at time(t)?**
:::success
The acknowledgement(ACK) field will be $[ k-N, k-1]$. The sender sent all the $k-N$ packets ACK less than the $n-N-1$ ACK.
So, all possible values of the ACK field in all messages currently range between $k-N-1$ and $k-1$.
:::
<br>
## P25
****
:::danger
:::
<br>
## P26
**Consider transferring an enormous file of L bytes from Host A to Host B. Assume an MSS of 536 bytes.**
### (a.)
**What is the maximum value of L such that TCP sequence numbers are not exhausted? Recall that the TCP sequence number field has 4 bytes.**
:::success
The size of TCP sequence number field = 4 bytes = 32 bits.
The maximum file size sent from Host A to Host B representable by $2^{32}$
$$
\begin{aligned}
& =2^2 \times 2^{30} \text { bytes } \\
& =2^2 \text { Gbytes } \\
& =4 \text { Gbytes }
\end{aligned}
$$
:::
### (b.)
**For the L you obtain in (a), find how long it takes to transmit the file. Assume that a total of 66 bytes of transport, network, and data-link header are added to each segment before the resulting packet is sent out over a 155 Mbps link. Ignore flow control and congestion control so A can pump out the segments back to back and continuously.**
:::success
Maximum segment size (MSS) = 536 bytes.
Segments data $=2^{32} / 536 =8012999$.
Total header fields = 66 bytes.
Total number of bytes through the $155 \mathrm{Mbps}$ link $=8012999 \times 66$ bytes $=528857934$ bytes
Transmitted data $=\left(2^{32}+528857934\right) = 4.824 \times 10^9 \text { bytes }$
Transmit time $=\frac{4.824 \times 10^9 \times 8 \text { bits }}{155 \times 10^6 \mathrm{bps}} \approx 249$ seconds
:::
<br>
## P27
**Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 126. Suppose Host A then sends two segments to Host B back-to-back. The first and second segments contain 80 and 40 bytes of data, respectively. In the first segment, the sequence number is 127, the source port number is 302, and the destination port number is 80. Host B sends an acknowledgment whenever it receives a segment from Host A.**
### (a.)
**In the second segment sent from Host A to B, what are the sequence number, source port number, and destination port number?**
:::success
Sequence number = first segment of sequence number + destination port number = 127 + 80 = 207
Source port number = 302
Destination port number= 80
:::
### (b.)
**If the first segment arrives before the second segment, in the acknowledgment of the first arriving segment, what is the acknowledgment number, the source port number, and the destination port number?**
:::success
Acknowledgement number= 207
Source port number = 80
Destination port number= 302
:::
### (c.)
**If the second segment arrives before the first segment, in the acknowledgment of the first arriving segment, what is the acknowledgment number?**
:::success
Acknowledgement number = 127
:::
### (d.)
**Suppose the two segments sent by A arrive in order at B. The first acknowledgment is lost and the second acknowledgment arrives after the first timeout interval. Draw a timing diagram, showing these segments and all other segments and acknowledgments sent. (Assume there is no additional packet loss.) For each segment in your figure, provide the sequence number and the number of bytes of data; for each acknowledgment that you add, provide the acknowledgment number.**
:::success

:::
<br>
## P28
**Host A and B are directly connected with a 100 Mbps link. There is one TCP connection between the two hosts, and Host A is sending to Host B an enor- mous file over this connection. Host A can send its application data into its TCP socket at a rate as high as 120 Mbps but Host B can read out of its TCP receive buffer at a maximum rate of 50 Mbps. Describe the effect of TCP flow control.**
:::success
The effect of TCP flow control:
If host A faster tahn host B sending data then buffer fill up is start. If the buffer filled completely then send data from host B to host A untile the remove buffer data and intimate to continue sending data or not.
Then filled again buffer then repeat the process from host A to host B.
:::
<br>
## P29
**SYN cookies were discussed in Section 3.5.6.**
### (a.)
**Why is it necessary for the server to use a special initial sequence number in the SYNACK?**
:::success
The server uses special initial sequence number (that is obtained from the hash of source and destination IPs and ports) in order to defend itself against SYN FLOOD attack.
:::
### (b.)
**Suppose an attacker knows that a target host uses SYN cookies. Can the attacker create half-open or fully open connections by simply sending an ACK packet to the target? Why or why not?**
:::success
No, the attacker cannot create half-open or fully open connections by simply sending and ACK packet to the target.
Half-open connections are not possible since a server using SYN cookies does not maintain connection variables and buffers for any connection before full connections are established.
For establishing fully open connections, an attacker should know the special initial sequence number corresponding to the (spoofed) source IP address from the attacker.
This sequence number requires the "secret" number that each server uses.
Since the attacker does not know this secret number, she cannot guess the initial sequence number.
:::
### (c.)
**Suppose an attacker collects a large amount of initial sequence numbers sent by the server. Can the attacker cause the server to create many fully open connections by sending ACKs with those initial sequence numbers? Why?**
:::success
No, the sever can simply add in a time stamp in computing those initial sequence numbers and choose a time to live value for those sequence numbers, and discard expired initial sequence numbers even if the attacker replay them.
:::
<br>
## P31
**Suppose that the five measured SampleRTT values (see Section 3.5.3) are 106 ms, 120 ms, 140 ms, 90 ms, and 115 ms. Compute the EstimatedRTT after each of these SampleRTT values is obtained, using a value of α = 0.125 and assuming that the value of EstimatedRTT was 100 ms just before the first of these five samples were obtained. Compute also the DevRTT after each sample is obtained, assuming a value of β = 0.25 and assuming the value of DevRTT was 5 ms just before the first of these five samples was obtained. Last, compute the TCP TimeoutInterval after each of these samples is obtained.**
:::success

:::
<br>
## P32
****
:::danger
:::
<br>
## P34
**What is the relationship between the variable SendBase in Section 3.5.4 and the variable LastByteRcvd in Section 3.5.5?**
:::success
At any given time t, SendBase-1 is the sequence number of the last byte that the sender knows has been received correctly, and in order, at the receiver. The actually last byte received (correctly and in order) at the receiver at time $t$ may be greater if there are acknowledgements in the pipe. Thus
$$
\text{SendBase-1} \leq \text { LastByteRvcd }
$$
:::
<br>
## P35
**What is the relationship between the variable LastByteRcvd in Section 3.5.5 and the variable $y$ in Section 3.5.4?**
:::success
At time t, the sender receives an acknowledgement with value $y$, the sender knows for sure that the receiver has received everything up through $y$-1. The actual last byte received (correctly and in order) at the receiver at time $t$ may be greater if $y \leq$ SendBase or if there are other acknowledgements in the pipe. Thus
$$
\text {y-1} \leq \text { LastByteRvcd }
$$
:::
<br>
## P37
**Compare GBN, SR, and TCP (no delayed ACK). Assume that the timeout values for all three protocols are sufficiently long such that 5 consecutive data segments and their corresponding ACKs can be received (if not lost in the channel) by the receiving host (Host B) and the sending host (Host A) respectively. Suppose Host A sends 5 data segments to Host B, and the 2nd segment (sent from A) is lost. In the end, all 5 data segments have been correctly received by Host B.**
### (a.)
**How many segments has Host A sent in total and how many ACKs has Host B sent in total? What are their sequence numbers? Answer this question for all three protocols.**
:::success
For GBN :
- A primarily sent 5 segments and later re-sent 4 segments, so A total sends 9 segements.
- A sends 9 segments: 123452345
- B sends 8 ACKs: 11112345
For SR :
- A sent 5 segments 1,2,3,4,5 and later re-sent only one segment: 2, so A total sends 6 segements.
- A sends 6 segments: 123452
- B sends 5 ACKs: 13452
For TCP :
- A sent 5 segments: 1,2,3,4,5 and later re-sent only one segment: 2, so, A total sends 6 segements.
- A sends 6 segments: 123452
- B sends 5 ACKs: 22226
:::
### (b.)
**If the timeout values for all three protocol are much longer than 5 RTT, then which protocol successfully delivers all five data segments in shortest time interval?**
:::success
If the timeout values for all three protocol are much longer than 5 RTTs, then TCP protocol successfully delivers all five data segments in shortest time interval. The reason is that TCP uses fast retransmit without waiting time.
:::
<br>
## P39
****
:::success
Rate of socket send data $\quad=\lambda_{\text {out }}$ bytes $/ \mathrm{sec}$
Rate of network layer send data $=\lambda_{\text {out }}^{\prime}$ bytes $/ \mathrm{sec}$.
Rate of application send original data $=\lambda_{\text {in }}$ bytes $/$ sec.
Rate of transport layer sending data $=\lambda_{\text {in }}^{\prime}$ bytes $/ \mathrm{sec}$
Take the condition that the arrival rate $=\frac{R}{2}$.
The arrival rate $\frac{R}{2}$ is the maximum departure rate of the packets effecting out of the queue. Every third packet or more packets are retransmitted if the arrival rate increases. So, the successfully delivered data throughput will not increase beyond $\lambda_{\text {out }}$.
The maximum value of $\lambda_{\text {out }}=\frac{\left(\frac{R}{2}\right)}{2}=\frac{R}{4}$.
So, the forwarded twice on average from the router to the receive $\frac{R}{4}$ packets.
:::
<br>
## P40
**Consider Figure 3.58. 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.**
### (a.)
**Identify the intervals of time when TCP slow start is operating.**
:::success
The intervals of time 1 to 6 and 23 to 26.
:::
### (b.)
**Identify the intervals of time when TCP congestion avoidance is operating.**
:::success
The intervals of time 6 to 23.
:::
### (c.)
**After the 16th transmission round, is segment loss detected by a triple duplicate ACK or by a timeout?**
:::success
After the 16th transmission round, the segment loss is detected by a triple duplicate ACK.
:::
### (d.)
**After the 22nd transmission round, is segment loss detected by a triple duplicate ACK or by a timeout?**
:::success
After the 22nd transmission round, the segment loss is detected by timeout.
:::
### (e.)
**What is the initial value of ssthresh at the first transmission round?**
:::success
The initial value of ssthresh at the first transmission round 32.
:::
### (f.)
**What is the value of ssthresh at the 18th transmission round?**
:::success
The value of ssthresh at the 18th transmission round is 21.
:::
### (g.)
**What is the value of ssthresh at the 24th transmission round?**
:::success
The value of ssthresh at the 24th transmission round is 13.
:::
### (h.)
**During what transmission round is the 70th segment sent?**
:::success
The transmission round is the 70th segment sent is 7.
:::
### (i.)
**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?**
:::success
If a packet loss is detected after the 26th round by the receipt of a triple duplicate ACK, then the value is 4.
:::
### (j.)
**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?**
:::success
Suppose TCP Tahoe is used (instead of TCP Reno), and assume that triple duplicate ACKs are received at the 16th round. Then the ssthresh and the congestion window size at the 19th round is 1 and transmission round is 21.
:::
### (k.)
**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?**
:::success
Suppose TCP Tahoe is used, and there is a timeout event at 22nd round, then the packets have been sent out from 17th round till 22nd round(inclusive) is 52.
:::
<br>
## P44
**Consider sending a large file from a host to another over a TCP connection that has no loss.**
### (a.)
**Suppose TCP uses AIMD for its congestion control without slow start. Assuming cwnd increases by 1 MSS every time a batch of ACKs is received and assuming approximately constant round-trip times, how long does it take for cwnd increase from 6 MSS to 12 MSS (assuming no loss events)?**
:::success
The below steps are take for cwnd to increase from 6 MSS to 12 MSS:
- 1 RTTs to 7 MSS.
- 2 RTTs to 8 MSS.
- 3 RTTs to 9 MSS.
- 4 RTTs to 10 MSS.
- 5 RTTs to 11MSS.
- 6 RTTs to 12 MSS.
:::
### (b.)
**What is the average throughout (in terms of MSS and RTT) for this connection up through time = 6 RTT?**
:::success
Connection up through time = 6 RTT
Average throughout (in terms of MSS and RTT) =(6+7+8+9+10+11)/6 = 8.5 MSS/RTT
:::
<br>
## P45
****
:::success

:::
<br>
## P46
**Consider that only a single TCP (Reno) connection uses one 10Mbps link which does not buffer any data. Suppose that this link is the only congested link between the sending and receiving hosts. Assume that the TCP sender has a huge file to send to the receiver, and the receiver’s receive buffer is much larger than the congestion window. We also make the following assumptions: each TCP segment size is 1,500 bytes; the two-way propagation delay of this connection is 150 msec; and this TCP connection is always in congestion avoidance phase, that is, ignore slow start.**
### (a.)
**What is the maximum window size (in segments) that this TCP connection can achieve?**
:::success
The maximum window size: 10^6*0.15/(8*1.5*10^3) = 125. Therefore, the maximum window size is 125 segments.
:::
### (b.)
**What is the average window size (in segments) and average throughput (in bps) of this TCP connection?**
:::success
Average window size is 2*W/3 = 84 segments and average throughput is 84*1500*8/0.15 = 6.72 Mbps
:::
### (c.)
**How long would it take for this TCP connection to reach its maximum window again after recovering from a packet loss?**
:::success
It would take 84/2*0.15 = 6.03 sec.
:::
<br>
## P47
**Consider the scenario described in the previous problem. Suppose that the 10Mbps link can buffer a finite number of segments. Argue that in order for the link to always be busy sending data, we would like to choose a buffer size that is at least the product of the link speed C and the two-way propagation delay between the sender and the receiver.**
:::success
Let W denote max window size. Let S denote the buffer size.
If the window size reaches W, then a loss occurs, then the sender will cut its congestion window size by half, and waits for the ACKs for W/2 outstanding packets before it starts sending data segments again.
In order to make sure the link always busying sending data, we need to let the link busy sending data in the period W/(2*C) (this is the time interval where the sender is waiting for the ACKs for the W/2 outstanding packets).
Thus, S/C must be no less than W/(2*C), that is, S>=W/2.
Let Tp denote the one-way propagation delay between the sender and the receiver. When the window size reaches the minimum W/2 and the buffer is empty, we need to make sure the link is also busy sending data. Thus, we must have W/2/(2Tp)>=C, thus, W/2>=C * 2Tp. Thus, S>=C * 2Tp.
:::
<br>
## P48
**Repeat Problem 46, but replacing the 10 Mbps link with a 10 Gbps link. Note that in your answer to part c, you will realize that it takes a very long time for the congestion window size to reach its maximum window size after recovering from a packet loss. Sketch a solution to solve this problem.**
:::success
(a.) Repeat Problem 43, but replacing the 10 Mbps link with a 10 Gbps link.
The congestion window size to reach its maximum window size after recovering from a packet loss = 2200msec.
(b.) Yes
(c.) Yes
(d.) No
:::
<br>
## P49
**Let T (measured by RTT) denote the time interval that a TCP connection takes to increase its congestion window size from W/2 to W, where W is the maximum congestion window size. Argue that T is a function of TCP’s average throughput.**
:::success

:::
<br>
## P50
**Consider a simplified TCP’s AIMD algorithm where the congestion window size is measured in number of segments, not in bytes. In additive increase, the congestion window size increases by one segment in each RTT. In multiplica- tive decrease, the congestion window size decreases by half (if the result is not an integer, round down to the nearest integer). Suppose that two TCP connections, C1 and C2 , share a single congested link of speed 30 segments per second. Assume that both C1 and C2 are in the congestion avoidancephase. Connection C1 ’s RTT is 50 msec and connection C2’s RTT is 100 msec. Assume that when the data rate in the link exceeds the link’s speed, all TCP connections experience data segment loss.**
### (a.)
**If both C1 and C 2 at time t 0 have a congestion window of 10 segments, what are their congestion window sizes after 1000 msec?**
:::success
C1’s and C2’s window sizes are both 1 segment each.
:::
### (b.)
**In the long run, will these two connections get the same share of the band-width of the congested link?**
:::success
In the long run, these two connections will not get the same share of the band-width of the congested link because C1’s bandwidth share is roughly twice as that of C2’s, because C1 has shorter RTT, only half of that of C2, so C1 can adjust its window size twice as fast as C2. According to the above table, for every cycle has 200msec.
:::
<br>
## P51
**Consider the network described in the previous problem. Now suppose that the two TCP connections, C1 and C2, have the same RTT of 100 msec. Suppose that at time t0 , C1’s congestion window size is 15 segments but C2’s congestion window size is 10 segments.**
### (a.)
**What are their congestion window sizes after 2200msec?**
:::success
Congestion window size of C1’s is 15 segments and congestion window size of C2’s is 10 segments.
:::
### (b.)
**In the long run, will these two connections get about the same share of the bandwidth of the congested link?**
:::success
These two TCP connections will not get the same share of the bandwidth of the congested link in the long run.
:::
### (c.)
**We say that two connections are synchronized, if both connections reach their maximum window sizes at the same time and reach their minimum window sizes at the same time. In the long run, will these two connections get synchronized eventually? If so, what are their maximum window sizes?**
:::success
The maximum window size is 2. So, these two TCP connections will get synchronized at the window sizes is 2.
:::
### (d.)
**Will this synchronization help to improve the utilization of the shared link? Why? Sketch some idea to break this synchronization.**
:::success
This synchronization will not help to improve the utilization of the shared link because two TCP connections will act as a single link. The window size is varying between minimum and maximum.
An idea to break the synchronization is to add finite buffer to the link and randomly drop the packets in the buffer before buffer overflow.This is caused to different connections cut their window sizes at different times.
:::
<br>
## P52
**Consider a modification to TCP’s congestion control algorithm. Instead of additive increase, we can use multiplicative increase. A TCP sender increases its window size by a small positive constant a (0 < a < 1) whenever it receives a valid ACK. Find the functional relationship between loss rate L and maximum congestion window W. Argue that for this modified TCP, regardless of TCP’s average throughput, a TCP connection always spends the same amount of time to increase its congestion window size from W/2 to W.**
:::success
The total number of segments(S) sent out during the interval when TCP changes its window size from w/2 up to and includes w.
S = w/2 +(w/2)*(1+a)+(w/2)*(1+a)^2 +(w/2)*(1+a)^3 +(w/2)*(1+a)^4 + . . .+ (w/2)*(1+a)^n
The Loss rate is derived by L = 1/S = (2a)/ (w*(2a+1)).
The TCP takes time to increase its window size from w/2 to w is calculated by n*RTT = log(1+a) 2 * RTT
This is independent of TCP’s average throughput.
TCP’s average throughput is derived by
Throughput B = MSS*S/((n+1)*RTT) = MSS/(L*(k+1)*RTT)
Note that the derived throughput is different from original throughput.
:::
<br>
## P53
**In our discussion of TCP futures in Section 3.7, we noted that to achieve a throughput of 10 Gbps, TCP could only tolerate a segment loss probability of 2*10^-10 (or equivalently, one loss event for every 5,000,000,000 segments). Show the derivation for the values of 2*10 ^-10 (1 out of 5,000,000) for the RTT and MSS values given in Section 3.7. If TCP needed to support a 100 Gbps connection, what would the tolerable loss be?**
:::success
For 10Gbps:
Bandwidth $(B)=10 \mathrm{Gbps}=10 \times 10^{9} \mathrm{bps}=10^{10} \mathrm{bps}$
MaximumSegmentSize $($ MSS $)=1500$ bytes $=1500 \times$ 8 bits
Round Trip Time $($ RTT $)=100 \mathrm{~ms}=100 \times 10^{-3} \mathrm{sec}=0.1 \mathrm{sec}$
Average bandwidth or throughput $=\frac{1.22 \times M S S}{R T T \sqrt{L}}$
$$
\begin{aligned}
B & =\frac{1.22 \times M S S}{R T T \sqrt{L}} \\
\sqrt{L} & =\frac{1.22 \times M S S}{R T T \times B} \\
L & =\left(\frac{1.22 \times M S S}{R T T \times B}\right)^2
\end{aligned}
$$
Substitute the values of MSS, B and RTT in the above formula.
$$
\begin{aligned}
L & =\left(\frac{1.22 \times M S S}{R T T \times B}\right)^2 \\
& =\left(\frac{1.22 \times 1500 \times 8}{0.1 \times 10^{10}}\right)^2 \\
& =\left(\frac{14640}{10^9}\right)^2 \\
& =(0.00001464)^2 \\
& =0.0000000002143296 \\
& =2.14 \times 10^{-10}
\end{aligned}
$$
Hence, the tolerable loss $\mathrm{L}$ will be $2.14 \times 10^{-10}$ or $2 \times 10^{-10}$ (approx).
For 100Gbps:
Bandwidth $(B)=100 \mathrm{Gbps}=100 \times 10^{10} \mathrm{bps}=10^{11} \mathrm{bps}$
Maximum Segment Size $(M S S)=1500$ bytes $=1500 \times 8$ bits
Round Trip Time $(R T T)=100 \mathrm{~ms}=100 \times 10^{-3} \mathrm{sec}=0.1 \mathrm{sec}$
Average throughput (or) bandwidth $(B)=\frac{1.22 \times M S S}{R T T \sqrt{L}}$
$$
\begin{aligned}
B & =\frac{1.22 \times M S S}{R T T \sqrt{L}} \\
\sqrt{L} & =\frac{1.22 \times M S S}{R T T \times B} \\
L & =\left(\frac{1.22 \times M S S}{R T T \times B}\right)^2
\end{aligned}
$$
Substitute the values of MSS, B and RTT in the above formula.
$$
\begin{aligned}
L & =\left(\frac{1.22 \times M S S}{R T T \times B}\right)^2 \\
& =\left(\frac{1.22 \times 1500 \times 8}{0.1 \times 10^{11}}\right)^2 \\
& =\left(\frac{14640}{10^{10}}\right)^2 \\
& =(0.000001464)^2 \\
& =0.000000000002143296 \\
& =2.14 \times 10^{-12}
\end{aligned}
$$
Hence, the tolerable loss $\mathrm{L}$ will be $2.14 \times 10^{-12}$ or $2 \times 10^{-12}$ (approximately).
:::
<br>
## P56
****
:::success

:::