# Lab 2 : HTTP
## Steps
* Step 1 : 打開瀏覽器(建議用無痕模式)
* Step 2 : 打開 Wireshark (建議以系統管理員執行),開始抓 Packet
* Step 3 : Filter 輸入 http
* Step 4 : 複製下方網址,貼上網址列 Enter</br>
http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file1.html
* Step 5 : 停止抓 Packet
## Questions
#### 2-1 Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the server running?

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

#### 2-3 What is the IP address of your computer? What is the IP address of gaia.cs.umass.edu server?

#### 2-4 What is the status code returned from the server to your browser?

#### 2-5 When was the HTML file that you are retrieving last modified at the server?

#### 2-6 How many bytes of content are being returned to your browser?

#### 2-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.
* Keep-Alive
## Steps
* Step 1 : 打開瀏覽器(建議用無痕模式)
* Step 2 : 打開 Wireshark (建議以系統管理員執行),開始抓 Packet
* Step 3 : 複製下方網址,貼上網址列 Enter</br>
http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file2.html
* Step 4 : 重新整理網頁
* Step 5 : 停止抓 Packet ,並在 Filter 輸入 http
## Questions
#### 2-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?
* No there is no IF-MODIFIED-SINCE line in the GET message.
#### 2-9 Inspect the contents of the server response. Did the server explicitly return the contents of the file? How can you tell?
* The server did explicitly return the contents of the file. Wireshark includes a section titled “Line-Based Text Data” which shows what the server sent back to my browser which is specifically what the website showed when I brought it up on my browser.
#### 2-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?
* Yes in the second HTTP message an IF-MODIFIED-SINCE line is included. The information that follows is the date and time that I last accessed the webpage

#### 2-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.
* The HTTP status code is “304: Not Modified”
* The server did not return the contents of the file because the browser simply retrieved the contents from its cache. Had the file been modified since it was last accessed, it would have returned the contents of the file, instead it simply told my browser to retrieve the old file from its cached memory.
## Steps
* Step 1 : 打開瀏覽器(建議用無痕模式)
* Step 2 : 打開 Wireshark (建議以系統管理員執行),開始抓 Packet
* Step 3 : 複製下方網址,貼上網址列 Enter</br>
http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file3.html
* Step 4 : 停止抓 Packet ,並在 Filter 輸入 http
## Questions

#### 2-12 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
* 1923
#### 2-13 Which packet number in the trace contains the status code and phrase associated with the response to the HTTP GET request?
* 1931
#### 2-14 What is the status code and phrase in the response?
* 200
#### 2-15 How many data-containing TCP segments were needed to carry the single HTTP response and the text of the Bill of Rights?
* 3

## Steps
* Step 1 : 打開瀏覽器(建議用無痕模式)
* Step 2 : 打開 Wireshark (建議以系統管理員執行),開始抓 Packet
* Step 3 : 複製下方網址,貼上網址列 Enter</br>
http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file4.html
* Step 4 : 停止抓 Packet ,並在 Filter 輸入 http
## Questions
#### 2-16 How many HTTP GET request messages did your browser send? To which Internet addresses were these GET requests sent?
* Three
#### 2-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.
* By checking the TCP ports we can see if our files were downloaded serially or in parallel. In this case the 2 images were transmitted over 2 TCP connections therefore they were downloaded serially.


## Steps
* Step 1 : 打開瀏覽器(建議用無痕模式)
* Step 2 : 打開 Wireshark (建議以系統管理員執行),開始抓 Packet
* Step 3 : 複製下方網址,貼上網址列 Enter</br>
http://gaia.cs.umass.edu/wireshark-labs/protected_pages/HTTP-wireshark-file5.html
* Step 4 : 輸入帳號 (wireshark-students) 密碼 (network)
* Step 5 : 停止抓 Packet ,並在 Filter 輸入 http
#### 2-18 What is the server’s response (status code and phrase) in response to the initial HTTP GET message from your browser?
* Status code: 401 , Phrase: Authorization Required
#### 2-19 When your browser’s sends the HTTP GET message for the second time, what new field is included in the HTTP GET message?
