计算机网络实验3TCP实验

更新时间:2024-04-05 20:07:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

计算机网络实验报告三

TCP实验

1. What is the IP address and TCP port number used by the client computer (source) that is transferring the file to gaia.cs.umass.edu? To answer this question, it’s probably easiest to select an HTTP message and explore the details of the TCP packet used to carry this HTTP message, using the “details of the selected packet header window” (refer to Figure 2 in the “Getting Started with Wireshark” Lab if you’re uncertain about the Wireshark windows).

答:client computer (source):IP address:192.168.1.102 TCP port number:1161

2. What is the IP address of gaia.cs.umass.edu? On what port number is it sending and receiving TCP segments for this connection?

答:the IP address of gaia.cs.umass.edu:IP address:128.119.245.12 port number:80

3. If you have been able to create your own trace, answer the following question:What is the IP address and TCP port number used by your client computer(source) to transfer the file to gaia.cs.umass.edu? 答:My client computer: IP address:10.2.136.30

-1-

4. What is the sequence number of the TCP SYN segment that is used to initiate theTCP connection between the client computer and gaia.cs.umass.edu? What is it in the segment that identifies the segment as a SYN segment? 答:sequence number:0 ;syn 被设置为1说明是syn段。

5. What is the sequence number of the SYNACK segment sent by gaia.cs.umass.edu to the client computer in reply to the SYN? What is the value of the ACKnowledgement field in the SYNACK segment? How did gaia.cs.umass.edu determine that value? What is it in the segment that identifies the segment as a SYNACK segment?

答:The sequence number of the SYNACK segment sent by gaia.cs.umass.edu is:0; SYNACK segment 中 ACKnowledgement 的值为1;

-2-

ACKnowledgement number的值为SYN消息中sequence number加上1所得; SYN 和Acknowledgement f都置为1说明这是一个SYNACK segment.

6. What is the sequence number of the TCP segment containing the HTTP POST command? Note that in order to find the POST command, you’ll need to dig into the packet content field at the bottom of the Wireshark window, looking for a segment with a “POST” within its DATA field.

答:第四号报文段是包含 HTTP POST 命令的TCP segment.且报文段的序列号为1.

-3-

7. Consider the TCP segment containing the HTTP POST as the first segment in the TCP connection. What are the sequence numbers of the first six segments in theTCP connection (including the segment containing the HTTP POST)?At what time was each segment sent? When was the ACK for each segment received?Given the difference between when each TCP segment was sent, and when itsacknowledgement was received, what is the RTT value for each of the sixsegments? What is the EstimatedRTT value (see page 249 in text) after thereceipt of each ACK? Assume that the value of the EstimatedRTT is equal tothe measured RTT for the first segment, and then is computed using theEstimatedRTT equation on page 249 for all subsequent segments.Note: Wireshark has a nice feature that allows you to plot the RTT foreach of the TCP segments sent. Select a TCP segment in the “listing ofcaptured packets” window that is being sent from the client to thegaia.cs.umass.edu server. Then select: Statistics->TCP Stream Graph->Round Trip Time Graph.

Segment 1

-4-

Segment 2

Segment 3

Segment 4

Segment 5

-5-

Segment 6

答:前6个报文段为No.4,5,7,8,10,11. 对应的ACK分别为 No.6,9,12,14,15,16.

前6个报文段截图如下:

报文段的序列号为每个报文段的首字节加1,所以序列号为: Segment 1 sequence number:1 Segment 2 sequence number:566 Segment 3 sequence number:2026 Segment 4 sequence number:3486 Segment 5 sequence number:4946 Segment 6 sequence number:6406

报文段的发送时间和相应ACK 的到达时间如下表:: Segment 1

Send time 0.026477 ACK received time 0.053937 -6-

RTT seconds 0.02746 Segment 2 Segment 3 Segment 4 Segment 5 Segment 6 0.041737 0.054026 0.054690 0.077405 0.078157 0.077294 0.124085 0.169118 0.217299 0.267802 0.035557 0.070059 0.11443 0.13989 0.18964 EstimatedRTT=0.875* EstimatedRTT+0.125*SampleRTT 接受到报文段1之后的EstimatedRTT为:

EstimatedRTT=RTT for segment 1=0.02746 second 接受到报文段2之后的EstimatedRTT为:

EstimatedRTT=0.875*0.02764+0.125*0.035557=0.0285 sencond 接受到报文段3之后的EstimatedRTT为:

EstimatedRTT=0.875*0.0285+0.125*0.070059=0.0337 second 接受到报文段4之后的EstimatedRTT为:

EstimatedRTT=0.875*0.0337+0.125*0.11443=0.0438 second 接受到报文段5之后的EstimatedRTT为:

EstimatedRTT=0.875*0.0438+0.125*0.13989= 0.0558 second 接受到报文段6之后的EstimatedRTT为:

EstimatedRTT=0.875*0.0558+0.125*0.18964= 0.0725 second 8. What is the length of each of the first six TCP segments?

答:前6个段的长度分别为:565、1460、1460、1460、1460、1460字节。

9. What is the minimum amount of available buffer space advertised at the received for the entire trace? Does the lack of receiver buffer space ever throttle the sender?

-7-

答:接收方通知给发送方的最低窗口大小为5840字节,即在服务器端传回的第一个ACK中的窗口大小。接收方的窗口大小没有抑制发送方的传输速率,因为窗口大小从5840逐步增加到62780,窗口大小始终大于发送方发送的分组的容量。

10. Are there any retransmitted segments in the trace file? What did you check for (in the trace) in order to answer this question?

答:没有,从TCP报文段的序列号中可以得出以上结论。从上图中的时间—序号图可以看出,从源端发往目的端的序号逐渐递增,如果这其中有重传的报文段,则其序号中应该有小于其临近的分组序号的分组,在图中未看到这样的分组,所以没有被重传的分组。

-8-

11. How much data does the receiver typically acknowledge in an ACK? Can you identify cases where the receiver is ACKing every other received segment ? 答: 右下图得,接收方在一个ACK确认的数据大小一般为1460字节。

The Acknowledged sequence number and the Acknowledged data: ACK 1 ACK 2 ACK 3 ACK 4 ACK 5 ACK 6 ACK 7 ACK 8 ACK 9 ACK 10 ACK 11

Acknowledged sequence number 566 2026 3486 4946 6406 7866 9013 10473 11933 13393 14853 Acknowledged data 566 1460 1460 1460 1460 1460 1147 1460 1460 1460 1460

报文段确认数据为2920bytes=1460*2 bytes,即129541-12621=2920.

12. What is the throughput (bytes transferred per unit time) for the TCP connection? Explain how you calculated this value.

-9-

答:TCP 吞吐量计算很大程度上取决于所选内容的平均时间。作为一个普通的吞吐量计算,在这问题上,选择整个连接的时间作为平均时间段。然后,此TCP 连接的平均吞吐量为总的传输数据与总传输时间的比值。传输的数据总量为TCP 段第一个序列号(即第4 段的1 字节)和最后的序列号的ACK (第202 段的164091个字节)之间的差值。因此,总数据是 164091-1 = 164090 字节。整个传输时间是第一个 TCP 段(即4号段0.026477 秒)的时间和最后的 ACK(即第202 段5.455830秒) 时间的差值。因此,总传输时间是5.455830-0.026477 = 5.4294 秒。因此,TCP 连接的吞吐量为164090/5.4294 = 30.222 KByte/sec

13. Use the Time-Sequence-Graph(Stevens) plotting tool to view the sequence number versus time plot of segments being sent from the client to the gaia.cs.umass.edu server. Can you identify where TCP’s slow start phase begins and ends, and where congestion avoidance takes over? Comment on ways in which the measured data differs from the idealized behavior of TCP that we’ve studied in the text.

答:慢启动阶段即从HTTP POST 报文段发出时开始,但是无法判断什么时候慢启动结束,拥塞避免阶段开始。慢启动阶段和拥塞避免阶段的鉴定取决于发送方拥塞窗口的大小。拥塞窗口的大小并不能从时间—序号图(time-sequence-graph)直接获得。然而在一个发送方中未被确认的数据量(即in flight 数据量)不会超过CongWin(拥塞窗口)和RcvWindow(接收窗口)中的最小值,即LastByteSend-LastByteAcked<=min{CongWin,RcvWindow}。同时,在第9题中看到,接收方通告给发送方的窗口大小并没有遏制发送速率。因此,未被确认的数据量(即in flight 数据量),是由拥塞窗口决定的,所以通过发出而未被确认的数据量(即in flight 数据量),我们可以估计拥塞窗口大小的下界。

下表列出了部分in flight 数据量,从表中可以看出拥塞窗口的下界>=8192(因为in flight data 从未超过8192)。 但是,从第10题(即从时间—序号图)得,没有分组丢失(不管是超时,还是三个冗余ACK),因此无法判断什么时候慢启动结束,拥塞避免阶段开始。

-10-

Type Data Data ACK Data Data ACK Data Data ACK Data ACK ACK ACK ACK Data Data Data Data Data Data ACK ACK ACK ACK ACK ACK Data Data Data Data Data Data ACK ACK

No. 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 Seq. 1 566 2026 3486 4946 6406 7866 9013 10473 11933 13393 14853 16313 17205 18665 20125 21585 23045 24505 ACKed seq. 566 2026 3486 4096 6006 7866 9013 10473 11933 13393 14853 16313 17205 18665 20125 -11-

in flight data 565 2025 1460 2920 4380 2920 4380 5840 4380 5527 4917 3007 1147 0 1460 2920 4380 5840 7300 8192 6732 5272 3812 2352 892 0 1460 2920 4380 5840 7300 8192 6732 5272 ACK ACK ACK ACK Data Data Data Data Data Data ACK ACK ACK ACK ACK Data Data Data Data Data Data ACK ACK ACK ACK Data Data Data Data Data Data ACK ACK ACK Data Data Data Data Data Data ACK ACK ACK

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 25397 26857 28317 29777 31237 32697 33589 35049 36509 37969 39429 40889 41781 43241 44701 46161 47621 49081 49973 51433 52893 54353 55813 57273 21585 23045 24505 25397 26857 28317 29777 31237 33589 35049 37969 40889 41781 44701 47621 49973 52893 55813 58165 -12-

3812 2352 892 0 1460 2920 4380 5840 7300 8192 6732 5272 3812 1752 0 6732 5272 3812 2352 892 0 6732 3812 892 0 1460 2920 4380 5840 7300 8192 5272 2352 0 1460 2920 4380 5840 7300 8192 5272 2352 0 Data 81 58165 1460 TCP的发送方会试探性的发送数据(即慢启动阶段),如果太多的数据使网络拥塞了,那么发送方会根据AIMD算法进行调整。但是在实际中,TCP的行为主要依赖于应用程序怎么设计。在这次抓包中,在发送方还可以发送数据的时候,已经没有数据可发了。在web应用中,有些web对象比较小,在慢启动还没有结束之前,传送就结束啦,因此,传送小的web对象受到TCP慢启动阶段的影响,导致较长的延迟。

14. Answer each of two questions above for the trace that you have gathered when you transferred a file from your computer to gaia.cs.umass.edu。

答:慢启动阶段即从HTTP POST 报文段发出时开始,但是无法判断什么时候慢启动结束,拥塞避免阶段开始。慢启动阶段和拥塞避免阶段的鉴定取决于发送方拥塞窗口的大小。拥塞窗口的大小并不能从时间—序号图(time-sequence-graph)直接获得。然而在一个发送方中未被确认的数据量(即in flight 数据量)不会超过CongWin(拥塞窗口)和RcvWindow(接收窗口)中的最小值,即LastByteSend-LastByteAcked<=min{CongWin,RcvWindow}。同时,在第9题中看到,接收方通告给发送方的窗口大小并没有遏制发送速率。因此,未被确认的数据量(即in flight 数据量),是由拥塞窗口决定的,所以通过发出而未被确认的数据量

(即in flight 数据量),我们可以估计拥塞窗口大小的下界。

下表列出了部分in flight 数据量,从表中可以看出拥塞窗口的下界>=9015(因为in flight data 从未超过9015)。 但是,从第10题(即从时间—序号图)得,没有分组丢失(不管是超时,还是三个冗余ACK),因此无法判断什么时候慢启动结束,拥塞避免阶段开始。 Type No. Seq. ACKed seq. in flight data Data Data ACK Data Data ACK Data Data ACK Data ACK ACK ACK ACK Data Data Data Data Data Data ACK 16 17 19 20 21 22 23 24 33 34 35 36 37 38 39 40 41 42 43 44 49 1 824 2284 3744 5204 6664 8124 9016 10476 11936 13396 14856 16316 824 2284 3744 5204 6664 8124 9016 10476 823 2283 1460 3743 5203 1460 6663 8123 6663 9015 7555 6096 1147 0 1460 2920 4380 5840 7300 8192 6732 -13-

ACK ACK ACK ACK ACK Data Data Data Data Data Data ACK ACK ACK ACK ACK ACK Data Data Data Data Data Data ACK ACK ACK ACK ACK Data Data Data 50 51 52 53 54 55 56 57 58 59 60 62 63 64 65 66 67 68 69 70 71 72 73 75 76 77 78 79 80 81 … 17208 18668 20128 21588 23048 24508 25400 26860 28320 29780 31240 32700 33592 35052 … 11936 13396 14856 16316 17208 18668 20128 21588 23048 24508 25400 26860 28320 32700 29780 33592 … 5272 3812 2352 892 0 1460 2920 4380 5840 7300 8192 6732 5272 3812 2352 892 0 1460 2920 4380 5840 7300 8192 6732 5272 3812 1752 0 1460 2920 … -14-

TCP的发送方会试探性的发送数据(即慢启动阶段),如果太多的数据使网络拥塞了,那么发送方会根据AIMD算法进行调整。但是在实际中,TCP的行为主要依赖于应用程序怎么设计。在这次抓包中,在发送方还可以发送数据的时候,已经没有数据可发了。在web应用中,有些web对象比较小,在慢启动还没有结束之前,传送就结束啦,因此,传送小的web对象受到TCP慢启动阶段的影响,导致较长的延迟。

-15-

本文来源:https://www.bwwdw.com/article/zeor.html

Top