2023年12月11日发(作者:)

计算机网络实验报告一

班级:智能1401

姓名:蒙寿伟

学号:2

一、HTTP

1. The Basic HTTP GET/response interaction

实验步骤:

up your web browser.

2. Start up the Ethereal packet sniffer, as described in the Introductory lab (but don’t

yet begin packet capture). Enter “http” (just the letters, not the quotation marks)

in the display-filter-specification window, so that only captured HTTP messages

will be displayed later in the packet-listing window. (We’re only interested in the

HTTP protocol here, and don’t want to see the clutter of all captured packets).

3. Wait a bit more than one minute (we’ll see why shortly), and then begin Ethereal

packet capture.

4. Enter the following to your browser

/ethereal-labs/

Your browser should display the very simple, one-line HTML file.

5. Stop Ethereal packet capture.

实验结果:

1. Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the

server running?

结果:我的浏览器HTTP的版本是1.1,服务器的HTTP版本是1.1

2. What languages (if any) does your browser indicate that it can accept to the

server?

结果:

浏览器可以接受的语言版本:

zh-Hans-CN,zh-Hans;q=0.8,en-US;q=0.5,en;q=0.3

3. What is the IP address of your computer? Of the server?

结果:电脑的IP地址为192.168.1.8 服务器IP为: 128.119.245.12

1

4. What is the status code returned from the server to your browser?

结果:状态代码是200(请求成功)

5. When was the HTML file that you are retrieving last modified at the server?

结果:Last-Modified: Tue, 18 Apr 2017 05:59:01 GMTrn

6. How many bytes of content are being returned to your browser?

结果:返回到浏览器的内容的字节126

7. By inspecting the raw data in the packet content window, do you see any headers

within the data that are not displayed in the packet-listing window? If so, name

one 通过检查数据包内容窗口中的原始数据,您会看到任何标题在数据包列表窗口中未显示的数据中? 如果是这样,找出一个。

结果:没有。

2. The HTTP CONDITIONAL GET/response interaction

实验步骤:

• Start up your web browser, and make sure your browser’s cache is cleared, as

2 discussed above.

• Start up the Ethereal packet sniffer

• Enter the following URL into your browser

/ethereal-labs/

Your browser should display a very simple five-line HTML file.

• Quickly enter the same URL into your browser again (or simply select the refresh

button on your browser)

• Stop Ethereal packet capture, and enter “http” in the display-filter-specification

window, so that only captured HTTP messages will be displayed later in the

packet-listing window.

• (Note:

If you are unable to run Ethereal on a live network connection, you can

use the http-ethereal-trace-2 packet trace to answer the questions below; see

footnote 1. This trace file was gathered while performing the steps above on one

of the author’s computers.)

实验结果:

8. Inspect the contents of the first HTTP GET request from your browser to the

server. Do you see an “IF-MODIFIED-SINCE” line in the HTTP GET?

结果:第一次HTTP GET没有看到“IF-MODIFIED-SINCE”

9. Inspect the contents of the server response. Did the server explicitly return the

contents of the file? How can you tell?

检查服务器响应的内容。 服务器是否显式返回文件的内容? 你怎么知道?

结果:返回内容:

3 10. Now inspect the contents of the second HTTP GET request from your browser to

the server. Do you see an “IF-MODIFIED-SINCE:” line in the HTTP GET? If

so, what information follows the “IF-MODIFIED-SINCE:” header?

客户端第二次请求此URL时,根据 HTTP 协议的规定,浏览器会向服务器传送

If-Modified-Since 报头

结果:有“IF-MODIFIED-SINCE:”,内容是:If-Modified-Since: Sat, 22 Apr 2017

05:59:01 GMTrn

11. What is the HTTP status code and phrase returned from the server in response to

this second HTTP GET? Did the server explicitly return the contents of the file?

Explain.

答案:状态码和相应状态信息的值为302 Moved Temporarily。代表的意思是新的URL应该被视为临时性的替代。

3. Retrieving Long Documents

4 实验步骤:

• Start up your web browser, and make sure your browser’s cache is cleared, as

discussed above.

• Start up the Ethereal packet sniffer

• Enter the following URL into your browser

/ethereal-labs/

Your browser should display the rather lengthy US Bill of Rights.

• Stop Ethereal packet capture, and enter “http” in the display-filter-specification

window, so that only captured HTTP messages will be displayed.

• (Note:

If you are unable to run Ethereal on a live network connection, you can

use the http-ethereal-trace-3 packet trace to answer the questions below; see

footnote 1. This trace file was gathered while performing the steps above on one

of the author’s computers.)

实验结果:

12. How many HTTP GET request messages were sent by your browser?

结果:2个GET请求

13. How many data-containing TCP segments were needed to carry the single HTTP

response?需要多少数据包含TCP片段来承载单个HTTP响应?

结果:4个

14. What is the status code and phrase associated with the response to the HTTP GET

request?

答案:状态码和短语是200 OK:表示请求成功,信息包含在响应的报文中。

5 15. Are there any HTTP status lines in the transmitted data associated with a

TCPinduced “Continuation”?

结果:有,对于一个大的HTML文件会被TCP分为若干个独立的包。

4. HTML Documents with Embedded Objects

实验步骤:

• Start up your web browser, and make sure your browser’s cache is cleared, as

discussed above.

• Start up the Ethereal packet sniffer

• Enter the following URL into your browser

/ethereal-labs/

Your browser should display a short HTML file with two images. These two

images are referenced in the base HTML file. That is, the images themselves are

not contained in the HTML; instead the URLs for the images are contained in the

downloaded HTML file. As discussed in the textbook, your browser will have to

retrieve these logos from the indicated web sites. Our publisher’s logo is

retrieved from the web site. The image of our book’s cover is

stored at the server.

• Stop Ethereal packet capture, and enter “http” in the display-filter-specification

window, so that only captured HTTP messages will be displayed.

• (Note:

If you are unable to run Ethereal on a live network connection, you can

use the http-ethereal-trace-4 packet trace to answer the questions below; see

footnote 1. This trace file was gathered while performing the steps above on one

of the author’s computers.)

实验结果:

6 16. How many HTTP GET request messages were sent by your browser? To which

Internet addresses were these GET requests sent?

结果:

浏览器一共发出了4个HTTP GET请求,目的IP如图所示

17. Can you tell whether your browser downloaded the two images serially, or

whether they were downloaded from the two web sites in parallel? Explain.

浏览器在下载这两个图片时,是串行下载还是并行下载?请解释

结果:

是并行下载。因为两个图行片是连续请求,并没有等第行个图片请求得到回复后

才继续第二次请求。

Authentication

实验步骤:

• Make sure your browser’s cache is cleared, as discussed above, and close down

your browser. Then, start up your browser

• Start up the Ethereal packet sniffer

• Enter the following URL into your browser

7 /ethereal-labs/protected_pages/

Type the requested user name and password into the pop up box..

• Stop Ethereal packet capture, and enter “http” in the display-filter-specification

window, so that only captured HTTP messages will be displayed later in the

packet-listing window.

• (Note:

If you are unable to run Ethereal on a live network connection, you can

use the http-ethereal-trace-5 packet trace to answer the questions below; see

footnote 1. This trace file was gathered while performing the steps above on one

of the author’s computers.)

实验结果:

18. What is the server’s response (status code and phrase) in response to the initial

HTTP GET message from your browser?

对于浏览器发出的最初的HTTP GET请求,服务器的响应是什么?

结果:401 Unauthorized(未经授权)

19. When your browser’s sends the HTTP GET message for the second time, what

new field is included in the HTTP GET message?

当浏览器发出第二个HTTP GET请求时,在HTTP GET报文中包含了哪些新的字段?

结果:出现新字段:Authorization: Basic MTEyMzoyMzEzrn

Credentials: 1123:2313(用户名及密码)

第一次请求:

第二次请求:

8

二、TCP

实验步骤:

1. Capturing a bulk TCP transfer from your computer to a remote

Server

2. A first look at the captured trace

3. TCP Basics

实验结果:

1. What is the IP address and TCP port number used by your client computer

(source) to transfer the file to ? What is the IP address and port

9 number used by to receive the file.

答:client computer: IP address: 10.63.236.170 TCP port number: 60813

: IP address: 128.119.245.12 TCP port number: 80

2. What is the sequence number of the TCP SYN segment that is used to initiate the

TCP connection between the client computer and ? What is it

in the segment that identifies the segment as a SYN segment?

答:

第一次握手:

Sequence number: 0 (relative sequence number), SYN被置位,SYN=1

第二次握手:Sequence number: 0,Acknowledgment number: 1,SYN=1

第三次握手:

Sequence number: 1,Acknowledgment number: 1,SYN=0

10

3. What is the sequence number of the SYNACK segment sent by

to the client computer in reply to the SYN? What is the value of the

ACKnowledgement field in the SYNACK segment? How did

determine that value? What is it in the segment that identifies the segment as a

SYNACK segment?

答:

由上一个题目可知,三次握手的过程中,第二次握手[SYNACK] Sequence number: 0,Acknowledgment number: 1,SYN=1;第三次握手[ACK] Sequence number: 1,Acknowledgment

number: 1,SYN=0,其中Acknowledgment number = 上一个Sequence numbe+1。实验结果和理论一致。

4. 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 Ethereal window, looking for a

segment with a “POST” within its DATA field.

答:TCP segment data (481 bytes)

11 5. 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 the

TCP 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 its

acknowledgement was received, what is the RTT value for each of the six

segments? What is the EstimatedRTT value (see page 237 in text) after the

receipt of each ACK? Assume that the value of the EstimatedRTT is equal to

the measured RTT for the first segment, and then is computed using the

EstimatedRTT equation on page 237 for all subsequent segments.

Note:

Ethereal has a nice feature that allows you to plot the RTT for each

of the TCP segments sent. Select a TCP segment in the “listing of

captured packets” window that is being sent from the client to the

server. Then select:

Statistics->TCP Stream Graph-

>Round Trip Time Graph.

答:可以知道:EstimatedRTT = 0.251545000 seconds

HTTPPOST

12 Segment1:

Segment2

Segment3

Segment4

Segment5

13

6. What is the length of each of the first six TCP segments?

答:前6个段的长度分别为:642、1460、1460、1460、1460、1460bytes。

7. 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?接收缓冲空间不足是否阻碍了发送者?

答:Window size value: 239, 会阻碍。

8. Are there any retransmitted segments in the trace file? What did you check for (in

the trace) in order to answer this question?

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

14 9. How much data does the receiver typically acknowledge in an ACK? Can you

identify cases where the receiver is ACKing every other received segment (see

Table 3.2 on page 245 in the text).

答: 接收方需要1460 bytes,

10. What is the throughput (bytes transferred per unit time) for the TCP connection?

Explain how you calculated this value.

答:

TC吞吐量 = (0.75 x W)/ RTT = 0.75*239 /0.251545000 =

712.5969655

15 4. TCP congestion control in action

11. 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

server. Can you identify where TCP’s slowstart phase begins

and ends, and where congestion avoidance takes over? Note that in this “realworld”

trace, not everything is quite as neat and clean as in Figure 3.51 (also note

that the y-axis labels for the

Time-Sequence-Graph(Stevens) plotting tool and

Figure 3.51 are different).

答:慢启动从HTTP POST 报文段发出时开始,但是慢启动结束时间不知道,从下面的图可以看出避免拥塞阶段没有发生,所以没有发生拥塞。

12. Comment on ways in which the measured data differs from the idealized behavior

of TCP that we’ve studied in the text.

答:实际的TCP和书本的理想化TCP一些小的差别,超时和丢包事件会频繁发生。

16