计算机网络实验报告一.docx
《计算机网络实验报告一.docx》由会员分享,可在线阅读,更多相关《计算机网络实验报告一.docx(22页珍藏版)》请在冰点文库上搜索。
计算机网络实验报告一
计算机网络实验报告一
班级:
智能1401
*******
学号:
************
一、HTTP
1.TheBasicHTTPGET/responseinteraction
实验步骤:
1.Startupyourwebbrowser.
2.StartuptheEtherealpacketsniffer,asdescribedintheIntroductorylab(butdon’t
yetbeginpacketcapture).Enter“http”(justtheletters,notthequotationmarks)
inthedisplay-filter-specificationwindow,sothatonlycapturedHTTPmessages
willbedisplayedlaterinthepacket-listingwindow.(We’reonlyinterestedinthe
HTTPprotocolhere,anddon’twanttoseetheclutterofallcapturedpackets).
3.Waitabitmorethanoneminute(we’llseewhyshortly),andthenbeginEthereal
packetcapture.
4.Enterthefollowingtoyourbrowser
http:
//gaia.cs.umass.edu/ethereal-labs/HTTP-ethereal-file1.html
Yourbrowsershoulddisplaytheverysimple,one-lineHTMLfile.
5.StopEtherealpacketcapture.
实验结果:
1.IsyourbrowserrunningHTTPversion1.0or1.1?
WhatversionofHTTPisthe
serverrunning?
结果:
我的浏览器HTTP的版本是1.1,服务器的HTTP版本是1.1
2.Whatlanguages(ifany)doesyourbrowserindicatethatitcanaccepttothe
server?
结果:
浏览器可以接受的语言版本:
zh-Hans-CN,zh-Hans;q=0.8,en-US;q=0.5,en;q=0.3
3.WhatistheIPaddressofyourcomputer?
Ofthegaia.cs.umass.eduserver?
结果:
电脑的IP地址为192.168.1.8服务器IP为:
128.119.245.12
4.Whatisthestatuscodereturnedfromtheservertoyourbrowser?
结果:
状态代码是200(请求成功)
5.WhenwastheHTMLfilethatyouareretrievinglastmodifiedattheserver?
结果:
Last-Modified:
Tue,18Apr201705:
59:
01GMT\r\n
6.Howmanybytesofcontentarebeingreturnedtoyourbrowser?
结果:
返回到浏览器的内容的字节126
7.Byinspectingtherawdatainthepacketcontentwindow,doyouseeanyheaders
withinthedatathatarenotdisplayedinthepacket-listingwindow?
Ifso,name
one通过检查数据包内容窗口中的原始数据,您会看到任何标题在数据包列表窗口中未显示的数据中?
如果是这样,找出一个。
结果:
没有。
2.TheHTTPCONDITIONALGET/responseinteraction
实验步骤:
•Startupyourwebbrowser,andmakesureyourbrowser’scacheiscleared,as
discussedabove.
•StartuptheEtherealpacketsniffer
•EnterthefollowingURLintoyourbrowser
http:
//gaia.cs.umass.edu/ethereal-labs/HTTP-ethereal-file2.html
Yourbrowsershoulddisplayaverysimplefive-lineHTMLfile.
•QuicklyenterthesameURLintoyourbrowseragain(orsimplyselecttherefresh
buttononyourbrowser)
•StopEtherealpacketcapture,andenter“http”inthedisplay-filter-specification
window,sothatonlycapturedHTTPmessageswillbedisplayedlaterinthe
packet-listingwindow.
•(Note:
IfyouareunabletorunEtherealonalivenetworkconnection,youcan
usethehttp-ethereal-trace-2packettracetoanswerthequestionsbelow;see
footnote1.Thistracefilewasgatheredwhileperformingthestepsaboveonone
oftheauthor’scomputers.)
实验结果:
8.InspectthecontentsofthefirstHTTPGETrequestfromyourbrowsertothe
server.Doyouseean“IF-MODIFIED-SINCE”lineintheHTTPGET?
结果:
第一次HTTPGET没有看到“IF-MODIFIED-SINCE”
9.Inspectthecontentsoftheserverresponse.Didtheserverexplicitlyreturnthe
contentsofthefile?
Howcanyoutell?
检查服务器响应的内容。
服务器是否显式返回文件的内容?
你怎么知道?
结果:
返回内容:
10.NowinspectthecontentsofthesecondHTTPGETrequestfromyourbrowserto
theserver.Doyouseean“IF-MODIFIED-SINCE:
”lineintheHTTPGET?
If
so,whatinformationfollowsthe“IF-MODIFIED-SINCE:
”header?
客户端第二次请求此URL时,根据HTTP协议的规定,浏览器会向服务器传送If-Modified-Since报头
结果:
有“IF-MODIFIED-SINCE:
”,内容是:
If-Modified-Since:
Sat,22Apr201705:
59:
01GMT\r\n
11.WhatistheHTTPstatuscodeandphrasereturnedfromtheserverinresponseto
thissecondHTTPGET?
Didtheserverexplicitlyreturnthecontentsofthefile?
Explain.
答案:
状态码和相应状态信息的值为302MovedTemporarily。
代表的意思是新的URL应该被视为临时性的替代。
3.RetrievingLongDocuments
实验步骤:
•Startupyourwebbrowser,andmakesureyourbrowser’scacheiscleared,as
discussedabove.
•StartuptheEtherealpacketsniffer
•EnterthefollowingURLintoyourbrowser
http:
//gaia.cs.umass.edu/ethereal-labs/HTTP-ethereal-file3.html
YourbrowsershoulddisplaytheratherlengthyUSBillofRights.
•StopEtherealpacketcapture,andenter“http”inthedisplay-filter-specification
window,sothatonlycapturedHTTPmessageswillbedisplayed.
•(Note:
IfyouareunabletorunEtherealonalivenetworkconnection,youcan
usethehttp-ethereal-trace-3packettracetoanswerthequestionsbelow;see
footnote1.Thistracefilewasgatheredwhileperformingthestepsaboveonone
oftheauthor’scomputers.)
实验结果:
12.HowmanyHTTPGETrequestmessagesweresentbyyourbrowser?
结果:
2个GET请求
13.Howmanydata-containingTCPsegmentswereneededtocarrythesingleHTTP
response?
需要多少数据包含TCP片段来承载单个HTTP响应?
结果:
4个
14.WhatisthestatuscodeandphraseassociatedwiththeresponsetotheHTTPGET
request?
答案:
状态码和短语是200OK:
表示请求成功,信息包含在响应的报文中。
15.ArethereanyHTTPstatuslinesinthetransmitteddataassociatedwithaTCPinduced“Continuation”?
结果:
有,对于一个大的HTML文件会被TCP分为若干个独立的包。
4.HTMLDocumentswithEmbeddedObjects
实验步骤:
•Startupyourwebbrowser,andmakesureyourbrowser’scacheiscleared,as
discussedabove.
•StartuptheEtherealpacketsniffer
•EnterthefollowingURLintoyourbrowser
http:
//gaia.cs.umass.edu/ethereal-labs/HTTP-ethereal-file4.html
YourbrowsershoulddisplayashortHTMLfilewithtwoimages.Thesetwo
imagesarereferencedinthebaseHTMLfile.Thatis,theimagesthemselvesare
notcontainedintheHTML;insteadtheURLsfortheimagesarecontainedinthe
downloadedHTMLfile.Asdiscussedinthetextbook,yourbrowserwillhaveto
retrievetheselogosfromtheindicatedwebsites.Ourpublisher’slogois
retrievedfromthewebsite.Theimageofourbook’scoveris
storedatthemanic.cs.umass.eduserver.
•StopEtherealpacketcapture,andenter“http”inthedisplay-filter-specification
window,sothatonlycapturedHTTPmessageswillbedisplayed.
•(Note:
IfyouareunabletorunEtherealonalivenetworkconnection,youcan
usethehttp-ethereal-trace-4packettracetoanswerthequestionsbelow;see
footnote1.Thistracefilewasgatheredwhileperformingthestepsaboveonone
oftheauthor’scomputers.)
实验结果:
16.HowmanyHTTPGETrequestmessagesweresentbyyourbrowser?
Towhich
InternetaddressesweretheseGETrequestssent?
结果:
浏览器一共发出了4个HTTPGET请求,目的IP如图所示
17.Canyoutellwhetheryourbrowserdownloadedthetwoimagesserially,or
whethertheyweredownloadedfromthetwowebsitesinparallel?
Explain.
浏览器在下载这两个图片时,是串行下载还是并行下载?
请解释
结果:
是并⾏下载。
因为两个图⽚片是连续请求,并没有等第⼀个图片请求得到回复后才继续第二次请求。
5.HTTPAuthentication
实验步骤:
•Makesureyourbrowser’scacheiscleared,asdiscussedabove,andclosedown
yourbrowser.Then,startupyourbrowser
•StartuptheEtherealpacketsniffer
•EnterthefollowingURLintoyourbrowser
http:
//gaia.cs.umass.edu/ethereal-labs/protected_pages/HTTP-ethereal-file5.html
Typetherequestedusernameandpasswordintothepopupbox..
•StopEtherealpacketcapture,andenter“http”inthedisplay-filter-specification
window,sothatonlycapturedHTTPmessageswillbedisplayedlaterinthe
packet-listingwindow.
•(Note:
IfyouareunabletorunEtherealonalivenetworkconnection,youcan
usethehttp-ethereal-trace-5packettracetoanswerthequestionsbelow;see
footnote1.Thistracefilewasgatheredwhileperformingthestepsaboveonone
oftheauthor’scomputers.)
实验结果:
18.Whatistheserver’sresponse(statuscodeandphrase)inresponsetotheinitial
HTTPGETmessagefromyourbrowser?
对于浏览器发出的最初的HTTP GET请求,服务器的响应是什么?
结果:
401Unauthorized(XX)
19.Whenyourbrowser’ssendstheHTTPGETmessageforthesecondtime,what
newfieldisincludedintheHTTPGETmessage?
当浏览器发出第二个HTTPGET请求时,在HTTPGET报文中包含了哪些新的字段?
结果:
出现新字段:
Authorization:
BasicMTEyMzoyMzEz\r\n
Credentials:
1123:
2313(用户名及密码)
第一次请求:
第二次请求:
二、TCP
实验步骤:
1.CapturingabulkTCPtransferfromyourcomputertoaremote
Server
2.Afirstlookatthecapturedtrace
3.TCPBasics
实验结果:
1.WhatistheIPaddressandTCPportnumberusedbyyourclientcomputer
(source)totransferthefiletogaia.cs.umass.edu?
WhatistheIPaddressandport
numberusedbygaia.cs.umass.edutoreceivethefile.
答:
client computer:
IP address:
10.63.236.170 TCP port number:
60813
Gaia.cs.umass.edu:
IP address:
128.119.245.12 TCP port number:
80
2.WhatisthesequencenumberoftheTCPSYNsegmentthatisusedtoinitiatethe
TCPconnectionbetweentheclientcomputerandgaia.cs.umass.edu?
Whatisit
inthesegmentthatidentifiesthesegmentasaSYNsegment?
答:
第一次握手:
Sequencenumber:
0(relativesequencenumber),SYN被置位,SYN=1
第二次握手:
Sequencenumber:
0,Acknowledgmentnumber:
1,SYN=1
第三次握手:
Sequencenumber:
1,Acknowledgmentnumber:
1,SYN=0
3.WhatisthesequencenumberoftheSYNACKsegmentsentbygaia.cs.umass.edu
totheclientcomputerinreplytotheSYN?
Whatisthevalueofthe
ACKnowledgementfieldintheSYNACKsegment?
Howdidgaia.cs.umass.edu
determinethatvalue?
Whatisitinthesegmentthatidentifiesthesegmentasa
SYNACKsegment?
答:
由上一个题目可知,三次握手的过程中,第二次握手[SYNACK]Sequencenumber:
0,Acknowledgmentnumber:
1,SYN=1;第三次握手[ACK]Sequencenumber:
1,Acknowledgmentnumber:
1,SYN=0,其中Acknowledgmentnumber=上一个Sequencenumbe+1。
实验结果和理论一致。
4.WhatisthesequencenumberoftheTCPsegmentcontainingtheHTTPPOST
command?
NotethatinordertofindthePOSTcommand,you’llneedtodiginto
thepacketcontentfieldatthebottomoftheEtherealwindow,lookingfora
segmentwitha“POST”withinitsDATAfield.
答:
TCPsegmentdata(481bytes)
5.ConsidertheTCPsegmentcontainingtheHTTPPOSTasthefirstsegmentinthe
TCPconnection.Whatarethesequencenumbersofthefirstsixsegmentsinthe
TCPconnection(includingthesegmentcontainingtheHTTPPOST)?
Atwhat
timewa