以下實驗步驟均來自實驗指導手冊。
實驗指導手冊下載地址:Jim Kurose Homepage (umass.edu)
1.The Basic HTTP GET/response interaction
在瀏覽器輸入http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file1.html,並抓取對應的http包,結果如下,得到http get請求
數據包以及http responce
數據包
為方便分析數據包,可以將內容打印出來,如下
-
Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the server running?
-
What languages (if any) does your browser indicate that it can accept to the server?
-
What is the IP address of your computer? Of the gaia.cs.umass.edu server?
在get請求中,計算機的ip地址是Source,server的ip地址是Destination
-
What is the status code returned from the server to your browser?
-
When was the HTML file that you are retrieving last modified at the server?
有趣的是,無論何時抓包,上次更改時間永遠是在一分鍾之內,手冊解釋如下
-
How many bytes of content are being returned to your browser?
-
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.
packet-listing只顯示了這些header
在get請求中,下面這些沒有顯示
同樣,在responce中,也有未顯示的headers
2.The HTTP CONDITIONAL GET/response interaction
先清空瀏覽器緩存,然后訪問http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file2.html,然后不清空緩存再次訪問此url,抓包如下,並打印出來
-
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/responce中,沒有這一行,在第二次get中才會存在
-
Inspect the contents of the server response. Did the server explicitly return the contents of the file? How can you tell?
在第一次responce中存在文件的內容
但是在第二次responce中,沒有返回文件的具體內容
-
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?
-
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.
3.Retrieving Long Documents
本部分實驗,由於涉及到部分tcp報文需要觀測,故不再打印出來,直接在wireshark中進行分析,抓包前需要清空緩存
-
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?
總共發送了1個,number 8包括
-
Which packet number in the trace contains the status code and phrase associated with the response to the HTTP GET request?
-
What is the status code and phrase in the response?
-
How many data-containing TCP segments were needed to carry the single HTTP response and the text of the Bill of Rights?
4.HTML Documents with Embedded Objects
抓包前需要清空緩存
-
How many HTTP GET request messages did your browser send? To which Internet addresses were these GET requests sent?
-
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請求是在第二個get發出之后發出的,並沒有等待第二個get的responce返回
5.HTTP Authentication
抓包前需要清空緩存
-
What is the server’s response (status code and phrase) in response to the initial HTTP GET message from your browser?
-
When your browser’s sends the HTTP GET message for the second time, what new field is included in the HTTP GET message?
值得注意的是,進行http認證的時候,賬戶名和密碼只是簡單的進行了base64編碼,而沒有進行加密,這是不安全的。