CS313 Computer Communication and Networking (Spring 2018) Assignment # 1
CS313 Computer Communication and Networking (Spring 2018) Assignment # 1
Assignment # 1
Mehran Shaikh
2014166
Sec: B
Question #1: The text below shows the reply sent from the server in response to
the HTTP GET message in the question above. Answer the following questions,
indicating where in the message below you find the answer.
a. Was the server able to successfully find the document or not? What time
was the document reply provided?
The 200 OK message indicates that the request was successful. The
document was found and the reply was sent Tue, 07 Mar 2008 at
12:39:45GMT. This information has a Date: header.
The Last-Modified: header tells us that the document was last modified
Saturday December 10, 2005 at 18:27:46 GMT
d. What are the first 5 bytes of the document being returned? Did the
server agree to a persistent connection?
The server did agree to a persistent connection, but it will timeout. This is
known by the Keep-Alive: timeout=max=100 and the Connection: header.
Question #2: Obtain an HTTP/1.1 specifications (RFC 2616). Answer the
following questions
A. Explain the mechanism used for signaling between the client and server to
indicate that a persistent connection is being closed. Can the client, the server, or
both signal the close of a connection?
For the first time with HTTP/1.1, persistent connections are the default behavior
of the http connection. The client should therefore assume that the connection
with the server will remain open unless otherwise indicated. The closing of a
connection can be initiated by either the client or the server using the connection
header field. In order for the host to close the connection, the connection header
must include the connection-token, “close” in the request. If the server wishes to
close the connection, it must include the same “close” token in the connection
header along with its response.
B. What encryption services are provided by HTTP?
There are no real encryption services provided by HTTP 1.1. Instead HTTP includes
Content Coding. Content coding allows content to be compressed or transformed
without losing the identity of the media type or loss of information. Content
coding allows the entity to be stored in coded form, transmitted and then
decoded only by the recipient. In order to do so, content coding values must be
placed in the Accept-Encoding and Content-Encoding header fields. If incorrect
values are entered, you may get a response stating, “Incorrect Media Type” after
requesting a message. In order to use true encryption services, you must use
HTTPS which includes a secure socket layer within the HTTP protocol and
therefore can encrypt sent messages.
C. Can a client open 3 or more simultaneous connections with a given server?
Yes, 3 or more simultaneous connections can be opened with a given server.
D. Either a server or a client may close a transport connection between them if
either one detects the connection has been idle for some time. Is it possible that
one side starts closing a connection while the other side is transmitting data via
the connection?
Closure by one side is possible while the other side is transmitting. This is because
HTTP is stateless and therefore neither party knows the others state. Due to the
fact that a connection can be incidentally closed at any time by either party
without the knowledge of the other, the client, server and proxies must be able to
recover from these events and does so by having client software reopen the
connection and retransmit the message, as long as the request is idempotent.
Question #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 n DNS
servers are visited before your host receives the IP address from DNS; the
successive visits occur at RTT1, RTT2…RTTn. Further, suppose that the web page
associated with the link contains exactly one object, consisting of a small
amount of HTML text. Let RTT0 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 the link until the client
receives the object?
We are told that we wish to obtain a web page, however, the webpage is not
cached and therefore must be found before the file can be requested and then
received by the contacting host. We are told that visits to nDNS servers to find the
site occur a round-trip time (RTT) or RTT1, RTT2,… RTTn. Each one of these
indicates a server that was requested and then responded with the site or not.
Therefore the total time it takes for the host to obtain the IP address can be
denoted as: RTT1+RTT2+RTT3+…RTTn. The total time it will take to obtain the IP
address is the total amount of time it took to find the address which would be the
amount of time each trip took until one of the servers in this case, N, responded
that it did in fact host that IP address. Then, because it is stated that transmission
time for the file is zero and RTT0 is the round trip time between the host and the
server, we can then find the total time for the transmission. Each transmission
takes a total of 2 round trip times for the file to be received, because, the first
message initiates the connection, then after a response from the server, the
request message must then be sent, followed by the server returning the file.
Therefore, while all the other servers require just 1 RTT between the host and
themselves, RTT0 (the host that contains our file) must be doubled, for both the
time it takes to ask if it has the file and the time it takes to request the file. The
second transmission also does not need to be sent to every server, because we
now know which server the file is located on. Therefore, the total time that it
takes for the file to be found from n servers and then received by the local host
can be shown as:
2RTT0+RTT1+RTT2+RTT3+….RTTn= Total-time.
The image below shows that the time of RTT0 must be doubled because the local
host must send and receive 2 different messages and responses for the file which
is placed on this server.
No, he must be in Alice's top 4 to provide her chunks. It's possible he may not be
there.