0% found this document useful (0 votes)
14 views11 pages

DNS Query and HTTP Protocol Analysis

The document consists of a homework assignment with multiple questions related to DNS queries, HTTP requests, and server responses. It covers topics such as transport protocols, resource records, query types, and the timing of requests and responses in web interactions. Additionally, it includes calculations for access link utilization and the handling of HTTP cookies.

Uploaded by

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

DNS Query and HTTP Protocol Analysis

The document consists of a homework assignment with multiple questions related to DNS queries, HTTP requests, and server responses. It covers topics such as transport protocols, resource records, query types, and the timing of requests and responses in web interactions. Additionally, it includes calculations for access link utilization and the handling of HTTP cookies.

Uploaded by

lmelody206
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

HOMEWORK 2

1. Imagine that you are trying to visit [Link], but you don't remember
the IP address the webserver is running on.

Assume the following records are on the TLD DNS server:


 ([Link], [Link], NS)
 ([Link], [Link], A)
Assume the following records are on the [Link] DNS server:
 ([Link], [Link], CNAME)
 ([Link], [Link], A)
 ([Link], [Link], MX)
 ([Link], [Link], A)

Figure 1
Assume your local DNS server only has the TLD DNS server cached.
a. What transport protocol(s) does DNS use: TCP, UDP, or Both?
b. What well-known port does DNS use?
c. In the above example, how many unique types of Resource Records (RR)
are there at the authoritative [Link] DNS server?
d. Can you send multiple DNS questions and get multiple RR answers in one
message? Answer with Yes or No
e. To which DNS server does a host send their requests to? Answer with the
full name
f. Which type of DNS server holds a company's DNS records? Answer with the
full name
g. In the example given in the problem, what is the name of the DNS server for
[Link]?
h. When you make the request for [Link], your local DNS
requests the IP on your behalf. When it contacts the TLD server, how many
answers (RR) are returned?
i. In the previous question, there were two responses, one was a NS record
and the other an A record. What was the content of the A record? Answer
with the format: "name, value" -
j. Assuming that the [Link] website is actually hosted on
[Link], what type of record is needed for this? –
k. Now imagine we are trying to send an email to admin@[Link], and
their mail server has the name [Link]. What type of record will
contain the name of the [Link] domain and the name of its
mailserver(s)?
l. In that MX record, what are the contents? Answer with the format: "name,
value"
m. Does your local DNS server take advantage of caching like web requests?
Answer with Yes or No
2. Assume that a user is trying to visit [Link], but his browser doesn't
know the IP address of the website. In this example, examine the difference
between an iterative and recursive DNS query.

Figure 2

a. Between steps 1 and 2, where does the Local DNS server check first? Answer
with 'User', 'DNS Local', 'DNS Root', 'DNS TLD', or 'DNS Authoritative'.
b. Between steps 2 and 3, assuming the root DNS server doesn't have the IP we
want, where does the response link? Answer with 'DNS Local', 'DNS Root', 'DNS
TLD', or 'DNS Authoritative'.
c. Between steps 4 and 5, assuming the TLD DNS server doesn't have the IP we
want, where does the response link? Answer with 'DNS Local', 'DNS Root', 'DNS
TLD', or 'DNS Authoritative'.
d. Between steps 6 and 7, the authoritative DNS server responds with the IP we
want. What type of DNS record is returned?
e. Which type of query is considered best practice: iterative or recursive?
3. Suppose within your Web browser you click on a link to obtain a Web page. The IP
address for the associated URL is not cached in your local host, so a DNS lookup
is necessary to obtain the IP address. Suppose that three DNS servers are visited
before your host receives the IP address from DNS. The first DNS server visited is
the local DNS cache, with an RTT delay of RTT 0 = 3 msecs. The second and third
DNS servers contacted have RTTs of 17 and 27 msecs, respectively. Initially, let's
suppose that the Web page associated with the link contains exactly one object,
consisting of a small amount of HTML text. Suppose the RTT between the local
host and the Web server containing the object is RTT HTTP = 41 msecs.

Figure 3

a. Assuming zero transmission time for the HTML object, how much time (in msec)
elapses from when the client clicks on the link until the client receives the
object?
b. Now suppose the HTML object references 2 very small objects on the same
server. Neglecting transmission times, how much time (in msec) elapses from
when the client clicks on the link until the base object and all 2 additional
objects are received from web server at the client, assuming non-persistent
HTTP and no parallel TCP connections?
c. Suppose the HTML object references 2 very small objects on the same server,
but assume that the client is configured to support a maximum of 5 parallel TCP
connections, with persistent HTTP.
d. What's the fastest method we've explored: Nonpersistent-serial, Nonpersistent-
parallel, or Persistent-parallel?
4. Consider the figure below, where a client is sending an HTTP GET message to a
web server, [Link]

Figure 4

Suppose the client-to-server HTTP GET message is the following:


GET /kurose_ross_sandbox/interactive/[Link] HTTP/1.0
Host: [Link]
If-Modified-Since: Mon, 28 Oct 2024 21:20:29 -0700

a. What is the name of the file that is being retrieved in this GET message?
b. What version of HTTP is the client running?
c. True or False: The client already has a cached copy of the file
5. Consider the figure below, where a client is sending an HTTP GET message to a
web server, [Link]

Figure 5

Suppose the client-to-server HTTP GET message is the following:


GET /kurose_ross_sandbox/interactive/[Link] HTTP/1.1
Host: [Link]
Accept: text/plain, text/html, text/xml, image/jpeg, image/png, audio/basic, audio/mp4,
video/mpeg, video/wmv,
Accept-Language: en-us, en-gb;q=0.2, en;q=0.7, fr, fr-ch, zh, de, fi
If-Modified-Since: Mon, 28 Oct 2024 23:06:45 -0700
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11
(KHTML, like Gecko) Version/5.1.3 Safari/534.53.10

a. What is the name of the file that is being retrieved in this GET message?
b. What version of HTTP is the client running?
c. True or False: The client will accept html files
d. True or False: The client will accept jpeg images
e. What is the client's preferred version of English?
f. What is the client's least preferred version of English?
g. True or False: The client will accept the German language
h. True or False: The client already has a cached copy of the file
6. Consider the figure below, where the server is sending a HTTP RESPONSE
message back to the client.

Figure 6

Suppose the server-to-client HTTP RESPONSE message is the following:


HTTP/1.0 404 Not Found
Date: Tue, 29 Oct 2024 06:25:52 +0000
Server: Apache/2.2.3 (CentOS)
Content-Length: 612
Connection: Close
Content-type: text/html

a. Is the response message using HTTP 1.0 or HTTP 1.1?


b. Was the server able to send the document successfully? Yes or No
c. Is the connection persistent or nonpersistent?
d. What is the type of file being sent by the server in response? - text/html
e. What is the name of the server and its version? Write your answer as
server/x.y.z
f. Will the ETag change if the resource content at this resource location
changes? Yes or No
7. Consider an HTTP server and client as shown in the figure below. Suppose that the
RTT delay between the client and server is 20 msecs; the time a server needs to
transmit an object into its outgoing link is 1 msecs; and any other HTTP message
not containing an object has a negligible (zero) transmission time. Suppose the
client again makes 60 requests, one after the other, waiting for a reply to a request
before sending the next request.

Figure 7

Assume the client is using HTTP 1.1 and the IF-MODIFIED-SINCE header line.
Assume 50% of the objects requested have NOT changed since the client
downloaded them (before these 60 downloads are performed)

a. How much time elapses (in milliseconds) between the client transmitting
the first request, and the completion of the last request?
Figure 8

8. Refer to Figure 8 and answer the following questions.


Figure8 shows an institutional network connected to public Internet and the
assumptions as stated below:
•Average object size: 4Mbits,
•Average request rate from browsers to origin servers: 25 request/s,
•Access link rate: 100 Mbps,
•Access LAN rate: 1Gbps.

a. Without web cache server, calculate access link utilization. [2m]


b. Assume the access link rate is increased to 200Mbps. Without web cache
server, calculate the access link utilization. [2m]
c. Assume the link capacity is unchanged (100Mbps) and a web server cache is
used which has a hit rate of 40%, find the access link utilization. [2m]
d. Compare the results in (b) and (c). What is your conclusion? [2m]
9. The diagram below shows how the HTTP cookies keep user state between client
and server. For each point highlighted by the number, identify the content of the
HTTP request or response message.

___ (1) ___ /[Link] HTTP/2.0


User-Agent: Firefox/3.6.10
At point A Host: [Link]
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
HTTP/2.0 ____ (2) ___
At point B Content-Type: text/html
Set-Cookie: ____ (3) ____
[page content]
___ (4) ___ /[Link]/[Link] HTTP/2.0
At point C
Host: ____ (5) ____
Cookie: ____ (6) ____
At point D ___(7)___ /[Link] ___(8)___
User-Agent: Firefox/3.6.10
Host: ____(9)____
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Cookie: ____(10)____
___ (1) ___ /[Link] HTTP/2.0
User-Agent: Firefox/3.6.10
At point A Host: [Link]
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
HTTP/2.0 ____ (2) ___
At point B Content-Type: text/html
Set-Cookie: ____ (3) ____
[page content]

Common questions

Powered by AI

An iterative DNS query involves the client asking each DNS server in the hierarchy sequentially, processing the responses until it obtains the desired IP address. In this approach, the local DNS server queries each DNS level (Root, TLD, Authoritative) until it receives the address. This allows the querying client to perform a greater number of lightweight queries. In contrast, a recursive DNS query offloads the query process to one DNS server, usually one that the client trusts, which then queries other DNS servers as needed under recursion until it resolves the initial query. Recursive queries provide simplicity from the client’s perspective, as it only contacts one DNS server. Best practice often suggests using recursive queries for end-client requests due to their efficiency in reducing traffic and simplifying error handling .

The version of HTTP used in a GET request impacts the efficiency, capabilities, and state management between a client and server. HTTP/1.0, a non-persistent protocol, established new connections for each request/response pair, increasing latency. HTTP/1.1, however, introduced improvements supporting persistent connections, reducing TCP connection overhead by allowing multiple requests over a single connection, effectively managing state and session with enhancements like `If-Modified-Since` headers and chunked transfer encoding. HTTP/2 further optimizes performance thanks to multiplexing, header compression, and binary framing, which reduce overhead and allow parallel requests over the same TCP connection, advancing the efficiency of state and session management .

Non-persistent HTTP connections require a new connection for each HTTP request/response pair, resulting in three round-trip times (RTTs) per object: one for the HTTP request and two for TCP connection setup. For a web page with two additional resources, as described, the total time elapses as RTT0 + 3(RTTHTTP) + (RTTTCP for three connections) because each resource demands its own connection setup and data exchange. Conversely, with persistent connections and parallel TCP (up to 5 parallel connections available), after initial connection setup, subsequent resource requests are sent over the existing connection or multiple connections simultaneously. This efficiency reduces the total response time significantly as connection overhead is minimized, yielding a faster resource download compared to serialized non-persistent techniques .

An MX (Mail Exchange) record is a DNS type that specifies the mail server responsible for receiving email messages on behalf of a domain. During email delivery, the sending mail server queries DNS for the recipient's domain to obtain relevant MX records. The records returned contain the priority and domain names of the mail server(s) designated to handle incoming emails for that domain. The sending server then contacts the mail server identified by the MX record directly to deliver the email. Without an accurate MX record, emails cannot be correctly routed to their destination .

Max TCP parallel connections constrain the number of simultaneous data streams a client can establish with a server, affecting webpage loading efficiency especially under persistent HTTP. With persistent HTTP, multiple requests can share one TCP connection, but effectively leveraging the maximum parallel connections (e.g., five for some browsers) allows concurrent data retrieval, mitigating blocking delays. Imposing a limit ensures server stability by preventing overloads, but overly restrictive constraints can lead to inefficient resource loading, increasing total retrieval time. Properly balancing this limit enhances performance by parallelizing resource requests without excessively burdening server capacity .

High access link utilization in an institutional network arises from a combination of high request rates, substantial object size, and limited link capacity. Each request for large-size objects taxes bandwidth, potentially saturating the access link. Introducing a web cache server with a 40% hit rate reduces utilization by serving cached content locally, decreasing actual outbound traffic by nearly 40%. This offloading highlights an efficient way to handle network demand and prevent unnecessary strain on the physical links, thus optimizing link performance and reducing latency for frequent requests .

ETag, or Entity Tag, is an HTTP header used in web caching to validate cache status and ensure resource consistency. When a client cache stores a resource, it also retains the ETag associated with that resource. In subsequent requests, the client may send the ETag within the `If-None-Match` header to the server for comparison. If the server determines that the resource's ETag hasn't changed, it can return a `304 Not Modified` status, prompting the client to use the cached version, preventing unnecessary data transfer. This mechanism plays a critical role in cache validation, maintaining consistency between client and server caches, and reducing bandwidth .

A 404 Not Found HTTP status code indicates that the server couldn't find the resource requested by the client. This can occur if the URL is mistyped, the resource has been moved or deleted without redirection, or if access permissions are improperly set. The implications for the client include inability to access the intended resource, leading potentially to user dissatisfaction or obstacles in automated tasks. Properly managing such errors might involve server-side logging to diagnose the frequent causes of such errors and client-side handling to redirect or inform users appropriately .

The `If-Modified-Since` header allows clients to request resources conditionally based on the last modification date. This optimization tool reduces bandwidth usage by requesting servers to return the resource only if it has changed since the specified date. If the resource hasn't been modified, the server responds with a `304 Not Modified` status, reducing unnecessary data transfer. Its influence facilitates efficient caching, lowers load on servers, and speeds up client access to up-to-date resources, as unchanged content doesn't get re-downloaded .

Caching in a local DNS server significantly improves efficiency by storing previously queried DNS records, thereby reducing the need for repeated DNS lookups over the network for the same domain, lowering latency and reducing server loads. Web caching similarly stores copies of web data, like HTTP responses, but focuses on frequently accessed web pages to serve them faster on repeat visits. While both involve caching techniques to enhance speed and bandwidth efficiency, DNS caching specifically addresses domain translation, whereas web caching involves broader content delivery, such as HTML pages and media files .

You might also like