You are on page 1of 28

Review for Chapter 3

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

Answer:
An application developer may not want its 
application to use TCP’s congestion control, which 
can throttle the application’s sending rate at times 
of congestion. Often, designers of IP telephony 
and IP videoconference applications choose to 
run their applications over UDP because they 
want to avoid TCP’s congestion control. Also, 
some applications do not need the reliable data 
transfer provided by TCP.
R5.Is it possible for an application to enjoy reliable data transfer even when 
the application runs over UDP? If so, how?

Answer:
Yes. The application developer can put reliable data transfer into the 
application layer protocol. This would require a significant amount of work 
and debugging, however.
R6.Consider a TCP connection between Host A and Host B. Suppose that the 
TCP segments traveling from Host A to Host B have source port number x and  
destination port number y. What are the source and destination port numbers 
for the segments traveling from Host B to Host A?

Answer:
Source port number y and destination port number x.
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 ?

Answer:
Yes, both segments will be directed to the same socket. For each received 
segment, at the socket interface, the operating system will provide the 
process with the IP addresses to determine the origins of the individual 
segments.
R8.Suppose that a Web sever 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 an Host C? If they are being passed through different sockets ,do 
both of the sockets have port 80? Discuss and explain. 

Answer:
For each persistent connection, the Web server creates a separate 
“connection socket”. Each connection socket is identified with a four‐
tuple: (source IP address, source port number, destination IP address, 
destination port number). When host C receives and IP datagram, it 
examines these four fields in the datagram/segment to determine to 
which socket it should pass the payload of the TCP segment. Thus, the 
requests from A and B pass through different sockets. The identifier 
for both of these sockets has 80 for the destination port; however, the 
identifiers for these sockets have different values for source IP 
addresses. Unlike UDP, when the transport layer passes a TCP 
segment’s payload to the application process, it does not specify the 
source IP address, as this implicitly specified by the socket identifier.
R14. 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 had 
sequence number 110.
a. How much data is in the first segment?
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? 

Answer:
• 20 bytes 
• ack number = 90
R15. True or false?
a. The size of the TCP RcvWindow never changes throughout the 
duration of the connection.
b. 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.
c. 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  
d. The TCP segment has a field in its header for RcvWindow.
e. 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.
f. Suppose that the last sampleRTT in a TCP connection is equal to 
1sec. The current value of Timeout Interval for the connection 
will necessarily be > or = 1 sec.
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 id necessarily 42.
Answer:
a) False
b) true
c) false
d) true 
e) false 
f) false 
g) false
P1.Suppose Client A initiates a Telnet session with 
Server S. At about the same time ,Client B 
also initiates a Telnet session with Server S. 
Provide possible source and destination port 
numbers for
a. The segments sent from A to S. 
b. The segments sent from B to S.
c. The segments sent from S to A.
d. The segments sent from S to B.
e. If A and B are different hosts, is it possible 
that the source port number in the segments 
from A to S is the same as that from B to S?
f. Hoe about if they are the same host?
Answer:

e) Yes.
f) No.
P5. 
a. Suppose you have the following 2 
bytes:01001010 and 01111001.What is the 1s 
complement of sum of these 2 bytes?

b. Suppose you have the following 2 
bytes:11110101 and 01101110. What is the 1s 
complement of sum of these 2 bytes?

c. 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.
Answer :
(a) Adding the two bytes gives 10011101. Taking the one’s complement gives 
01100010
(b) Adding the two bytes gives 00011110; the one’s complement gives 11100001.
(c) first byte = 00110101 ; second byte = 01101000.
P21. Consider the GBN and SR protocols. Suppose the sequence number 
space is of size k. what is the largest allowable sender window that will avoid 
the occurrence of problems such as that in Figure 3.27 for each of these 
protocols?
Answer:
P23. Consider transferring an enormous file of L 
bytes from Host A to Host B. Assume an MSS of 1,460 
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.
b. For the L you obtain in (a), find how long it take 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 100 Mbps link . Ignore flow control and 
congestion control so A can pimp out the segment 
back to back and continuously. 
Answer:
P24. Host A and Host B are communicating over a TCP connection ,and Host B has 
already received from A all bytes up through byte 358. Suppose Host A then 
sends two segments to Host B back‐to‐back. The first and second segments 
contain 50 and 80 bytes of data, respectively. In the first segment, the sequence 
number is 359, the source port number is 1028, and the destination port number 
is 80. Host B sends an ack 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 pot number?
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?
c. If the second segment arrives before the first segment, in the acknowledgment of 
the first arriving segment, what is the acknowledgment number?
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 acknowledgements 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. 
Answer :
a. In the second segment from Host A to B, the sequence number is 
409, source port number is 1028 and destination port number is 
80.
b. If the first segment arrives before the second, in the 
acknowledgement of the first arriving segment, the 
acknowledgement number is 409, the source port number is 80 
and the destination port number is 1028.
c. If the second segment arrives before the first segment, in the
acknowledgement of the first arriving segment, the acknowledgement
number is 359, indicating that it is still waiting for bytes 359 and 
onwards.
P34. 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.
b. Identify the intervals of time when TCP slow start is operating.
c. After the 16th transmission round, is segment loss detected by a 
triple duplicate ACK or by a timeout
d. After the 22nd transmission round, is segment loss detected by a 
triple duplicate ACK or by a timeout
e. What is the initial value of threshold at the first transmission round?
f. what is the value of threshold at the 18th transmission round
g. what is the value of threshold at the 24th transmission round
h. During what transmission round is the 70th segment sent?
i. Assuming a pkt 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 threshold?
a) TCP slowstart is operating in the intervals [1,6] and 
[23,26]
b) TCP congestion advoidance is operating in the 
intervals [6,16] and [17,22]
c) After the 16th transmission round, packet loss is 
recognized by a triple duplicate ACK.  If there was a 
timeout, the congestion window size would have 
dropped to 1.
d) After the 22nd transmission round, segment loss is 
detected due to timeout, and hence the congestion 
window size is set to 1.
e) The threshold is initially 32, since it is at this 
window size that slowtart stops and congestion 
avoidance begins.
f) The threshold is set to half the value of the congestion window when 
packet loss is detected. When loss is detected during transmission round 
16, the congestion windows size is 42. Hence the threshold is 21 during 
the 18th transmission round.
g) The threshold is set to half the value of the congestion window when 
packet loss is detected. When loss is detected during transmission round 
22, the congestion windows size is 26. Hence the threshold is 13 during 
the 24th transmission round.
h) During the 1st transmission round, packet 1 is sent; packet 2‐3 are sent 
in the 2nd transmission round; packets 4‐7 are sent in the 3rd 
transmission round; packets 8‐15 are sent in the 4th transmission round; 
packets16‐31 are sent in the 5th transmission round; packets 32‐63 are 
sent in the 6th transmission round; packets 64 – 97 are sent in the 7th 
transmission round.  Thus packet 70 is sent in the 7th transmission round.
i) The congestion window and threshold will be set to half the current 
value of the congestion window when the loss occurred. Thus the new 
values of the threshold and window will be 4.
P36.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 
CongWin 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 CongWin to increase 
from 1MSS to 8 MSS (assuming no loss 
events)?
b. What is the average throughout (in terms of 
MSS and RTT) for this connection up through 
time = 7 RTT?
Answer :
• It takes 1 RTT to increase CongWin to 2 
MSS; 2 RTTs to increase to 3 MSS; 3 RTTs
to increase to 4 MSS; 4 RTTs to increase to 5
MSS; …and 7 RTTs to increase to 8 MSS.

b) In the first RTT 1 MSS was sent; in the second 
RTT 2 MSS was sent; in the third RTT 3 MSS was 
sent; in the forth RTT 4 MSS was sent;... Thus, up to time 7 
RTT, 
1+2+3+4+5+6+7 = 28 MSS were sent (and acknowledged).
Thus, once can say that the average throughout up to
time 7 RTT was (28 MSS)/(7RTT) = 4 MSS/RTT.
bytes _ sent
average _ rate 
duration
1
MSS
L 2MSS
  (1)
W
RTT L *W * RTT
2
1 8
L W  (2)
3 2 3 3L
W  W
8 4
According to (1) and (2), thus
MSS 1.22MSS
average_rate  
2 RTT L
L * RTT
3

You might also like