1.)
Discuss how a web page can be transferred from a server to a client using HTTP with
NonPersistent Connections. In your answer indicate what types of HTTP messages are sent by the
client and by the server. Using an example of a HTML file with two JPEG images that reside on the
same server, explain what factors might increase the overall time to load a web page.
HTTP is the HyperText Transfer Protocol, which is an application-level protocol for systems. The
protocol is stateless and implemented through two programs, the client and the server. The client is
a program that establishes connections, which executes requests to the server. The server is a
program that accepts connections, once a request is received from the client, the server will send
back a response. A web page is stored on web servers and consists of objects which can range from
being images to audio files and the web page includes several referenced objects within the base
HTML file.
Firstly, a Persistent connection sends multiple
objects per TCP connection whereas a Non-
Persistent connection sends 1 object per TCP
connection. A web page can be transferred
from a server to a client using HTTP through a
Non-Persistent connection which begins once
the client initiates a TCP connection. The
server will then accept the connection and
respond, the client then sends a HTTP
request message, to which the server
receives and processes to which it will send a response message back. Once the client receives the
response, the server will then close the TCP connection. This process is repeated depending on how
many references are needed to transfer the web page since the Non-Persistent connection will send
1 object per TCP connection. Therefore, resulting in the round-trip time (RTT), which is the time
taken for a packet to travel from the client to the server and then back to the client. This response
time is two RTT including the transmission time at the server of the HTML file.
During this process, two types of HTTP messages are seen which are request messages and response
messages. The requests are made by the client, to the server to request a web page. The web
server’s response message is a reply to the request message, the server will transfer the requested
web page to the client. These messages have a format which follow a request line in the request
message and a status line in the response message. Within a request line, a method field is included
which includes GET, POST, HEAD seen in both method types HTTP/1.0 and HTTP/1.1 as well as PUT
and DELETE seen in HTTP/1.1. The status line contains the fields version, status code and phrase. The
header lines provide information regarding the message or the object within the message. The entity
body carries the HTTP request data and response data from the client and server.
A web page can have several factors which increase the time to load, for example web caching.
Firstly, web caches are a way that browsers on the client application download data in order to
increase the efficiency of viewing for the future. This is done by storing a local copy of a web pages
information, and therefore will be able to load some of the information without needing to
communicate or request for the objects from the server. Therefore, factors which can increase the
load time can include if a client is viewing a web page for the first time, there is no web cache, and
nothing is stored. In turn, the client must request for every object of the web page and therefore
with no web cache, the time it takes to load a webpage cannot be decreased. The round-trip time
, (RTT) is the time taken for a packet to travel from the client to the server and then back to the client.
Therefore, with web cache, it reduces the response time for client requests, reducing the RTT will
then in turn reduce the HTTP response time.
Additionally, factors such as the magnitude or
scale of the web page. For example, if a
webpage has a HTML file with two JPEG images,
then the process in a Non-Persistent connection,
for a client to request the webpage from the
server would be repeated only twice, with two
separate TCP connections for the two references. It can also be seen that depending on the size of
the JPEG images, can determine the load time as the larger the file the larger the load time.
However, if a webpage was more complex and had hundreds or thousands of objects, this would
increase the load time significantly. Therefore, the load time of a webpage may also be determined
by how many components are involved with the webpage.