HW02
HW02
Assignment 2
Aylar Khorsadnia
98100418
Problem 1. List the four broad classes of services that a transport protocol can provide. For each of the
service classes, indicate if either UDP or TCP (or both) provides such a service.
Problem 2. Describe how Web caching can reduce the delay in receiving a requested object. Will Web
caching reduce the delay for all objects requested by a user or for only some of the objects? Why?
Web caching can reduce the delay in receiving a requested object by storing a copy of the
requested object (such as a web page, image, or file) on a server closer to the user. When the
user requests the same object again, the server can deliver it from the cache instead of fetching
it from the original source. This reduces the round-trip time and network congestion, resulting
in faster access to the requested object.
Web caching will reduce the delay for only some of the objects requested by a user. This is
because not all objects are cacheable. Objects that are static and do not change frequently, such
as images, CSS files, and JavaScript files, are good candidates for caching. However, dynamic
content, personalized data, and objects explicitly marked as non-cacheable will not benefit from
web caching. Additionally, the cache may have a limited capacity, so it will prioritize caching the
most frequently accessed and popular objects. Therefore, while web caching can significantly
reduce delay for cacheable objects, it may not apply to all objects requested by a user.
Problem 3. Consider the following string of ASCII characters that were captured by Wireshark when
the browser sent an HTTP GET message (i.e., this is the actual content of an HTTP GET message).
The characters <cr><lf> are carriage return and line-feed characters (that is, the italized character
string <cr> in the text below represents the single carriage-return character that was contained at
that point in the HTTP header). Answer the following questions, indicating where in the HTTP
GET message below you find the answer.
(a) The URL of the document requested by the browser is, http://giai.cs.umass.edu/cs453/index.html.
This is shown in the GET line, the first line of communication between the two communi-
cating hosts.
1
(b) The browser is running HTTP/1.1 shown directly following the GET message and before
the first line return.
(c) The browser requests a persistent connection with the host. This can be understood because
a message is sent stating “Keep-Alive”. This means that the connection should not terminate
following the sending of the file requested. Had the server asked for the connection to close,
then the connection would have been listed as non-persistent.
(d) This question is unanswerable. The IP address is not contained in an HTTP message. In
order to have such information, we would need access to the information present in IP
datagrams.
(e) The type of browser that initiated the message is Mozilla/5.0. The browser type is needed
in an HTTP request message because the server may have to send a different types of the
same object to different browsers
Problem 4. 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 n DNS servers are visited before your host receives the IP address
from DNS; the successive visits incur an RTT of𝑅𝑇𝑇1 , ..., 𝑅𝑇𝑇𝑛 . Further suppose that the Web page
associated with the link contains exactly one object, consisting of a small amount of HTML text. Let
𝑅𝑇𝑇0 denote the RTT between the local host and the server containing the object. Assuming zero
transmission time of the object, how much time elapses from when the client clicks on the link until
the client receives the object?
In the case where the IP addresses of the links are already determined, the RTT0 is incorporated
to fix the connection, and another RTT is incorporated to receive and request the client’s object.
Therefore, the required elapsed time is, 2𝑅𝑇𝑇0 + 𝑅𝑇𝑇1 + ... + 𝑅𝑇𝑇𝑛
Problem 5. Referring to the previous problem, suppose the HTML file references eight very small
objects on the same server. Neglecting transmission times, how much time elapses with
(a) Non-persistent HTTP with no parallel TCP connections?
(b) Non-persistent HTTP with the browser configured for 5 parallel connections?
(c) Persistent HTTP?
(a) For obtaining the HTML files referencing the 3 objects on the same server, there would be
2𝑅𝑇𝑇0 round-trip time for each of the 8 objects. Therefore, the required elapsed time for this
scenario would be, 𝑅𝑇𝑇1 +𝑅𝑇𝑇2 +...+𝑅𝑇𝑇𝑛+2𝑅𝑇𝑇𝑜 +8∗(2𝑅𝑇𝑇𝑜 ) = 18𝑅𝑇𝑇1 +𝑅𝑇𝑇2 +...+𝑅𝑇𝑇𝑛
(b) For obtaining the HTML files and for the browser configuring the 3 parallel TCP connec-
tions, the 2𝑅𝑇𝑇0 time would be used. And another 2𝑅𝑇𝑇0 time would be used for another
two parallel TCP connections. Therefore, the required elapsed time for this case would be,
𝑅𝑇𝑇1 + 𝑅𝑇𝑇2 + ... + 𝑅𝑇𝑇𝑛 + 2𝑅𝑇𝑇𝑜 + 2 × (2𝑅𝑇𝑇𝑜 ) = 6𝑅𝑇𝑇0 + 𝑅𝑇𝑇1 + ... + 𝑅𝑇𝑇𝑛
(c) For persistent HTTP connection with pipelining, there would be a 3𝑅𝑇𝑇0 round-trip time
for the default mode of HTTP. Therefore, the required elapsed time would be, 3𝑅𝑇𝑇0 +
𝑅𝑇𝑇1 + ... + 𝑅𝑇𝑇𝑛
Problem 6. Consider a short, 10-meter link, over which a sender can transmit at a rate of 150 bits/sec in
both directions. Suppose that packets containing data are 100,000 bits long, and packets containing
Page 2
only control (e.g., ACK or handshaking) are 200 bits long. Assume that N parallel connections
each get 1/N of the link bandwidth. Now consider the HTTP protocol, and suppose that each
downloaded object is 100 Kbits long, and that the initial downloaded object contains 10 referenced
objects from the same sender. Would parallel downloads via parallel instances of non-persistent
HTTP make sense in this case? Now consider persistent HTTP. Do you expect significant gains over
the non-persistent case? Justify and explain your answer.
Note that each downloaded object can be completely put into one data packet. Let 𝑇𝑝 denote the
one-way propagation delay between the client and the server. First, consider parallel downloads
via non-persistent connections. Parallel download would allow 10 connections share the 150
bits/sec bandwidth, thus each gets just 15 bits/sec. Thus, the total time needed to receive all
objects is given by:
Then consider a persistent HTTP connection. The total time needed is given by:
Assume the speed of light is 300*106 m/sec, then 𝑇𝑝 = 10/(300 × 106) = 0.03 microsec. 𝑇𝑝 is
negligible compared with transmission delay. Thus, we see that the persistent HTTP does not
have a significant gain (less than 1 percent) over the non-persistent case with parallel download.
Problem 7. We have seen that Internet TCP sockets treat the data being sent as a byte stream but UDP
sockets recognize message boundaries. What are one advantage and one disadvantage of byteori-
ented API versus having the API explicitly recognize and preserve application-defined message
boundaries?
One advantage of byte-oriented APIs is that all byte of the data sent by the API is retrieved but
for APIs with application-defined message boundaries, some bytes of data could be lost in the
streaming process. One disadvantage of byte-oriented APIs is the time it takes to resend a byte
increases its propagation delay, while the is an advantage of the APIs with application-defined
message boundaries as it does not have to resend any lost bytes of data, making it faster.
Explanation: Note that byte-oriented APIs uses the TCP socket which resends lost bytes of data
and application-defined message boundaries APIs uses the UDP protocol to send data but does
not resend if lost.
Page 3