计算机网络实验报告一

更新时间:2023-11-03 23:37:01 阅读量: 综合文库 文档下载

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

计算机网络实验报告一

班级:智能1401 姓名:蒙寿伟 学号:201408070120

一、HTTP

1. The Basic HTTP GET/response interaction

实验步骤:

1.Start 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

http://gaia.cs.umass.edu/ethereal-labs/HTTP-ethereal-file1.html 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 gaia.cs.umass.edu 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 GMT\\r\\n

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

http://gaia.cs.umass.edu/ethereal-labs/HTTP-ethereal-file2.html 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 GMT\\r\\n

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

http://gaia.cs.umass.edu/ethereal-labs/HTTP-ethereal-file3.html 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

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

Top