0% found this document useful (0 votes)
62 views4 pages

COMP3331 Lab2

Uploaded by

James Mead
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views4 pages

COMP3331 Lab2

Uploaded by

James Mead
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

COMP3331 Lab2

Exercise 3: Using Wireshark to understand basic


HTTP request/response messages (marked, include
in your report)
Question 1: What is the status code and phrase returned from the server to the client browser?

The status code returned was 200 meaning success and the phrase returned was OK.
Question 2: When was the HTML file the browser retrieves last modified at the server? Does the
response also contain a DATE header? How are these two fields different?
From the image above the HTML file was last modified on Tue, 23 Sep 2003 05:29:00 GMT. The
response also contains a DATE header which differ by 00:00:50. Last modified identifies when
the file was last changed which could be handy to identify whether the object was stored in the
correct state.
Question 3: Is the connection established between the browser and the server persistent or
non-persistent? How can you infer this?
Persistent since the connection header specifies keep-alive meaning that a single TCP
connection was opened for multiple HTTP responses / requests.
Question 4: How many bytes of content are being returned to the browser?

Question 5: What is the data contained inside the HTTP response packet?
Exercise 4: Using Wireshark to understand the HTTP
CONDITIONAL GET/response interaction (marked,
include in your report)
Question 1: Inspect the contents of the first HTTP GET request from the browser to the server.
Do you see an “IF-MODIFIED-SINCE” line in the HTTP GET?

Nope.
Question 2: Does the HTTP response from the server indicate the last time that the requested
file was modified?

Yup the HTTP response from the server has a Last-Modified header which state Tue, 23 Sep
2003 05:35:00 GMT.
Question 3: Now inspect the contents of the second HTTP GET request from the browser to the
server. Do you see the “IF-MODIFIED-SINCE:” and “IF-NONE-MATCH” lines in the HTTP GET?
If so, what information is contained in these header lines?

From the above screenshot the second HTTP GET request from the browser to the server has
If-Modified-Since and If-None-Match headers. If-Modified-Since contains a date similar to that
of the last-modified header in the first HTTP GET request.
The If-None-Match header contains an Etag value.
Question 4: 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 file's contents? Explain.

The status code returned was 304 and the response phrase returned was Not Modified. The
server did not return the file’s content as the contents of the file has not been modified since the
last request.
Question 5: What is the value of the Etag field in the 2nd response message, and how is it
used? Is the Etag value the same as in the 1st response?
The value of the Etag field is “1bfef-173-8f4ae900” and is the same Etag as in the first response.
The Etag helps web servers and clients identify whether a resource’s contents have been
changed since the previous request. By doing so the client can use a cached copy of the
resource preventing the need to download it again saving time and decreases network traffic.
Exercise 5: Ping Client (marked, submit source code
as a separate file, include sample output in the
report)

You might also like