-
计算机网络实验报告一
班级:智能
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). Ente
r “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 s
ee
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
< br>(请求成功)
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
captur
e, 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 Te
mporarily
。代表的意思是新
的
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?
p>
结果:
2
个
GET
请求
13. How many data-containing TCP
segments were needed to carry the single HTTP
response?
需要多少数据包含
TCP<
/p>
片段来承载单个
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
TCPinduce
d
“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.
浏览器在下载这两个图片时,是串行下载还是并行下载?请解释
结果:
是并
?
下载。因为两个图
?
片是连续请求<
/p>
,
并没有等第
?
个图片请求得到回复后
才继续第二次请求。
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 p
acket
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 t
he 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