Nothing Special   »   [go: up one dir, main page]

Hasanul Kabir Roll 2303225 - Lab01 HTTP Protocol Analysis With Wireshark

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

1.

The Basic HTTP GET/response interaction

Let’s begin our exploration of HTTP by downloading a very simple HTML file - one that is very short and contains no
embedded objects. Do the following:
1. Start up your web browser.
2. Start up the Wireshark packet sniffer, as described in the Introductory lab (but don’t yet begin packet capture). Enter
“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 see the clutter of all captured packets).
3. Wait a bit more than one minute (we’ll see why shortly), and then begin Wireshark packet capture.
4. Enter the following to your browser http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file1.html Your browser
should display the very simple, one-line HTML file.
5. Stop Wireshark packet capture.

1. Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the server running?
Answer: Browser is running HTTP version is 1.1.

2. What languages (if any) does your browser indicate that it can accept to the server?
Answer: Accept-Language: en-US,en;q=0.9.

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

Answer: 192.168.1.132

4. What is the status code returned from the server to your browser?
Answer: 200 OK

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

Answer: Tue, 22 Aug 2023

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


Answer: 128\r\n

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.
Answer: No, I don’t see any in the HTTP message below.

2. The HTTP CONDITIONAL GET/response interaction

Recall from Section 2.2.6 of the text, that most web browsers perform object caching and thus perform a conditional
GET when retrieving an HTTP object. Before performing the steps below, make sure your browser’s cache is empty. (To
do this under Firefox, select Tools->Clear Recent History and check the Cache box, or for Internet Explorer, select Tools-
>Internet Options->Delete File; these actions will remove cached files from your browser’s cache.) Now do the following:
• Start up your web browser, and make sure your browser’s cache is cleared, as discussed above.
• Start up the Wireshark packet sniffer
• Enter the following URL into your browser http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file2.html 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 Wireshark packet 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.

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?
Answer: No
9. Inspect the contents of the server response. Did the server explicitly return the contents of the file? How can you
tell?
Answer: Yes

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?
Answer: Yes
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.
Answer: 304 Not Modified. No, contents return the file from cache.

3. Retrieving Long Documents

In our examples thus far, the documents retrieved have been simple and short HTML files. Let’s next see what happens
when we download a long HTML file. Do the following:
• Start up your web browser, and make sure your browser’s cache is cleared, as discussed above.
• Start up the Wireshark packet sniffer
• Enter the following URL into your browser http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file3.html Your
browser should display the rather lengthy US Bill of Rights.
• Stop Wireshark packet capture, and enter “http” in the display-filter-specification window, so that only captured HTTP
messages will be displayed.

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?
Answer: 1; 663 is the packet number in the trace contains the GET message for the Bill or Rights
13. Which packet number in the trace contains the status code and phrase associated with the response to the HTTP
GET request? Answer: Packet 668 contains the status code and phrase

14. What is the status code and phrase in the response?

Answer: 200 OK

15. How many data-containing TCP segments were needed to carry the single HTTP response and the text of the Bill of
Rights?
Answer: Four segments 668, 669, 670, 671

4. HTML Documents with Embedded Objects

Now that we’ve seen how Wireshark displays the captured packet traffic for large HTML files, we can look at what
happens when your browser downloads a file with embedded objects, i.e., a file that includes other objects (in the
example below, image files) that are stored on another server(s). Do the following:
• Start up your web browser, and make sure your browser’s cache is cleared, as discussed above.
• Start up the Wireshark packet sniffer
• Enter the following URL into your browser
http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file4.html 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
www.aw-bc.com web site. The image of the cover for our 5 th edition (one of our favorite covers) is stored at the
manic.cs.umass.edu server.
• Stop Wireshark packet capture, and enter “http” in the display-filter-specification window, so that only captured HTTP
messages will be displayed.

16. How many HTTP GET request messages did your browser send? To which Internet addresses were these GET
requests sent?
Answer: There were three HTTP GET request sent. Packet 21,26 were sent to 128.119.245.12 and packet 35 was sent to
178.79.137.164
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.

Answer: The downloads occurred in parallel. Note that the two GET messages for the images are in packets 26 and 35.
The 200 OK replies containing the images show up as packets 25 and 39.
which means the request for the second image was made before the first image was received.

5. HTTP Authentication

Finally, let’s try visiting a web site that is password-protected and examine the sequence of HTTP message exchanged for
such a site. The URL http://gaia.cs.umass.edu/wireshark-labs/protected_pages/HTTP-wireshark-file5.html is password
protected. The username is “wireshark-students” (without the quotes), and the password is “network” (again, without
the quotes). So let’s access this “secure” password-protected site. Do the following:
• Make sure your browser’s cache is cleared, as discussed above, and close down your browser. Then, start up your
browser
• Start up the Wireshark packet sniffer
• Enter the following URL into your browser http://gaia.cs.umass.edu/wireshark-labs/protected_pages/HTTP-
wiresharkfile5.html Type the requested user name and password into the pop up box.
• Stop Wireshark packet 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.

18. What is the server’s response (status code and phrase) in response to the initial HTTP GET message from your
browser?
Answer: Packet 14 in the trace contains the first GET and packet 18 contains the REPLY. The server’s in packet 18 is: 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?

Answer: The HTTP GET includes the Authorization: Basic field

You might also like