计算机网络原理习题讲解 下载本文

内容发布更新时间 : 2024/11/9 4:05:04星期一 下面是文章的全部内容请认真阅读。

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 acknowledgmens 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 1 sec. The current value of Timeoutrnterval for the connection will necessarily be>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 is necessarily 42.

A: a) false; b) false; need consider retransmit packet

c) false; d) true; e) false; f) false; g) false;

10. (教材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. How about if they are the same host? A:

11. (教材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 datagram carrying the transport-layer segments?

A: Suppose 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, dest port = 26145, dest IP address = a ? To host C, left process: Source port =80, source IP address = b, dest port = 7532, dest IP

address = c

? To host C, right process: Source port =80, source IP address = b, dest port = 26145, dest

IP address = c 12. (教材P19)Answer true or false to the following questions and briefly justify your answer: a. With the SR protocol, it is possible for the sender to receive an ACK for a packet that falls outside of its current window

b. With GBN, it is possible for the sender to receive an ACK for a packet that falls outside of its current window.

c. The alternating-bit protocol is the same as the SR protocol with a sender and receiver window size of 1.

d. The alternating-bit protocol is the same as the GBN protocol with a sender and receiver window size of 1.

Answer:

a) True. Suppose the sender has a window size of 3 and sends packets 1, 2, 3 at t0 . At t1

(t1 > t0) the receiver ACKS 1, 2, 3. At t2 (t2 > t1) the sender times out and resends 1, 2, 3. At t3 the receiver receives the duplicates and re-acknowledges 1, 2, 3. At t4 the sender receives the ACKs that the receiver sent at t1 and advances its window to 4, 5, 6. At t5 the sender receives the ACKs 1, 2, 3 the receiver sent at t2 . These ACKs are outside its window.

b) True. By essentially the same scenario as in (a). c) True.

d) True. Note that with a window size of 1, SR, GBN, and the alternating bit protocol are

functionally equivalent. The window size of 1 precludes the possibility of out-of-order packets (within the window). A cumulative ACK is just an ordinary ACK in this situation, since it can only refer to the single packet within the window.

13. (教材P24)Host A and 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 acknowledgement 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?

b. If the first segment arrives before the second segment, in the acknowledgement 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 acknowledgement 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 acknowledgement is lost and the second acknowledgement 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 acknowledgement that you add, provide the acknowledgement 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. d)

14. (教材P25)Host A and B are directly connected with a 200 Mbps link. There is one TCP

connection between the two hosts, and Host A is sending to Host B an enormous file over this connection. Host A can send application data into the link at 100 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.

Answer: Host A sends data into the receive buffer faster than Host B can remove data from the buffer. The receive buffer fills up at a rate of roughly 50Mbps. When the buffer is full, Host B signals to Host A to stop sending data by setting RcvWindow = 0. Host A then stops sending until it receives a TCP segment with RcvWindow > 0. Host A will thus repeatedly stop and start sending as a function of the RcvWindow values it receives from Host B. On average, the long-term rate at which Host A sends data to Host B as part of this connection is no more than 50Mbps.

15. (教材P30)In Section 3.5.4, we saw that TCP waits until it has received three duplicate ACKs

before performing a fast retransmit. Why do you think the TCP designers chose not to perform a fast retransmit after the first duplicate ACK for a segment is received?

Answer: Suppose packets n, n+1, and n+2 are sent, and that packet n is received and ACKed. If packets n+1 and n+2 are reordered along the end-to-end-path (i.e., are received in the order n+2, n+1) then the receipt of packet n+2 will generate a duplicate ack for n and would trigger a retransmission under a policy of waiting only for second duplicate ACK for retransmission. By waiting for a triple duplicate ACK, it must be the case that two???three packets after packet n are correctly received, while n+1 was not received. The designers of the triple duplicate ACK scheme probably felt that waiting for two packets (rather than 1) was the right tradeoff between triggering a quick retransmission when needed, but not retransmitting prematurely in the face of packet reordering.

16. (教材P34)Consider the following plot of TCP window size as a function of time.

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 congestion avoidance 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 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 Threshold?

Answer:

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.