使用的资料

计算机网络自顶向下方法 第7版

实验手册

参考前人第六版资料

Wireshark-win64-3.4.2

操作系统:Windows 7

我的笔记

实验步骤

The Basic HTTP GET/response interaction

image-20210114131522966.png

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

HTTP/1.1

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

根据Accept-Language可以看出能接受简体中文和英文。

What is the IP address of your computer? Of the gaia.cs.umass.edu server?

我的电脑IP:192.168.0.102,是个私有地址

gaia.cs.umass.edu server:128.119.145.12

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

查看响应报文的状态码:200

image-20210114131750864.png

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

Last-Modified: Wed, 13 Jan 2021 05:13:03 GMT

In your answer to question 5 above, you might have been surprised to find that the document you just retrieved was last modified within a minute before you downloaded the document. That’s because (for this particular file), the gaia.cs.umass.edu server is setting the file’s last-modified time to be the current time, and is doing so once per minute. Thus, if you wait a minute between accesses, the file will appear to have been recently modified, and hence your browser will download a “new” copy of the document.

没有看到这段话之前,我还特意重做了一遍,顺便清理了浏览器缓存。

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

文本长度为128字节。

image-20210114132240524.png

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.

不,仅有这两条。

The HTTP CONDITIONAL GET/response interaction

image-20210116123117117.png

第一次访问

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?

检查GET报文,并没找到IF-MODIFIED-SINCE行。

image-20210116125436345.png

Inspect the contents of the server response. Did the server explicitly return the contents of the file? How can you tell?

发现了响应报文中的文件内容。

image-20210116125657398.png

第二次访问

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?

image-20210116130110495.png

If-Modified-Since: Fri, 15 Jan 2021 06:59:01 GMT

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.

状态码为304 Not Modified,也就是未发生改变,也没有进行文本重传,而是直接调用cache中已有的文本。这样可以减轻服务器和负荷,提高效率。

image-20210116130242986.png

Retrieving Long Documents

How many HTTP GET request messages did your browser send? Which packet number in the trace contains the GET message for the Bill or Rights?

仅有一个HTTP GET请求报文。它的序号是71。

image-20210117131511466.png

Which packet number in the trace contains the status code and phrase associated with the response to the HTTP GET request?

响应报文的序号是77。

What is the status code and phrase in the response?

响应报文:200 OK

How many data-containing TCP segments were needed to carry the single HTTP response and the text of the Bill of Rights?

使用了4个TCP报文段。

HTML Documents with Embedded Objects

How many HTTP GET request messages did your browser send? To which Internet addresses were these GET requests sent?

image-20210117133229346.png

http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file4.html

http://gaia.cs.umass.edu/pearson.png

http://manic.cs.umass.edu/~kurose/cover_5th_ed.jpg

总共有3个GET请求,可以通过查看Full request URL字段来确定请求的URL。

这个Internet address 说的比较模糊,如果指的是IP地址的话,就参考Destination字段。

Can you tell whether your browser downloaded the two images serially, or whether they were downloaded from the two web sites in parallel? Explain.

我并不确定这个并发是不是真的同时发,GET报文发送时间不同,我认为应该算是顺序发送。

HTTP Authentication

What is the server’s response (status code and phrase) in response to the initial HTTP GET message from your browser?

image-20210117141032227.png

这次是不太常见的401 Unauthorized

When your browser’s sends the HTTP GET message for the second time, what new field is included in the HTTP GET message?

image-20210117141312211.png

Authorization字段,可以使用base64解密,后面的文档也进一步说明:HTTP明文传输,并不安全。

it should be clear to you that simple passwords on WWW sites are not secure unless additional measures are taken.

总结

总体流程比较长,许多访问有时候需要切换代理,比较麻烦,但是仍旧很值得走一遍,也是体验一遍,加深理解。