16. HTTP and related protocols
16.3 HTTP/1.1
HTTP/1.1 is still in an evolving state. Its seeks to enhance the scope
of HTTP/1.1, remove many of the inconsistencies surrounding different
implementations, and improve the performance. It seeks to add to HTTP/1.0
features like hierarchical proxies, persistent connections, virtual hosts,
caching, as well as acting like a generic protocol for communication between
user agents and proxies/gateways to other Internet systems, including those
supported by the SMTP, NNTP, FTP, Gopher, and WAIS protocols. In this section,
we will try to elaborate on the main features of HTTP/1.1.
16.3.1 Main features
The main features of HTTP/1.1 are summarized below
- Intermediaries: HTTP/1.0 used a simple model for data transfer
between the user agent (UA) and the origin server (O) over a single
connection (v) as illustrated in Fig 2. A typical User Agent may be a
Web browser and the Origin server may be a WWW, FTP or TELNET server.
Fig 2: Interaction between user and server in HTTP/1.0
HTTP/1.1 recognizes that one or more intermediaries may exist. The most
common forms of intermediaries are proxy, gateway, and tunnel. According
to Fielding, et al, "A proxy
is a forwarding agent, receiving requests for a URI in its absolute form,
rewriting all or part of the message, and forwarding the reformatted request
toward the server identified by the URI. A gateway is a receiving agent,
acting as a layer above some other server(s) and, if necessary, translating
the requests to the underlying server's protocol. A tunnel acts as a relay
point between two connections without changing the messages; tunnels are
used when the communication needs to pass through an intermediary (such
as a firewall) even when the intermediary cannot understand the contents
of the messages." An example of multiple intermediaries is illustrated
below where A, B, and C are intermediaries between the User Agent and the
Origin server.
Fig 3: Interaction between user and server in HTTP/1.1
One of the goals of HTTP/1.1 with respect to caches and proxies is "to
support the wide diversity of configurations already deployed while introducing
protocol constructs that meet the needs of those who build web applications
that require high reliability and, failing that, at least reliable indications
of failure." (Fielding et al)
- Messages: HTTP messages consist of request from client to server
and responses from server to client. Most types of messages consist of
a start-line, one or more headers, an empty line indicating the end of
the headers, and an optional message body.
- Requests: HTTP/1.0 has just GET, HEAD and POST request. HTTP/1.1
has added four more request types. These are
- OPTIONS: A request for information about the communication options
available on the request/response chain identified by the Request-URI.
- PUT: Requests that the entity attached to the request be stored under
the supplied URI. This means that the client can write to the server.
- DELETE: Remove the resource identified by the Request-URI. This allows
the client to delete a file on a server.
- TRACE: Used to involve a remote, application-layer loop-back of the
request message.
- Responses: After receiving and interpreting a request message,
a server responds with an HTTP response message, which consists of a status-line,
headers, blank line, and the message-body. The status line consists of
the protocol version followed by a numeric status code and its associated
textual phrase.
- Persistent Connections: In the earlier versions of HTTP, s separate
TCP connection was established to fetch each URL as described in Section
16.2.3. These led to a decline in the performance of HTTP by increasing
the load on HTTP servers and causing congestion. Persistent
HTTP connections have a number of advantages.
- By opening and closing fewer TCP connections, CPU time is saved, and
memory used for TCP protocol control blocks is also saved.
- HTTP requests and responses can be pipelined on a connection.
- Network congestion is reduced by reducing the number of packets caused
by TCP opens, and by allowing TCP sufficient time to determine the congestion
state of the network.
- HTTP can evolve more gracefully; since errors can be reported without
the penalty of closing the TCP connection.
Persistent connections are the default in HTTP/1.1.
- Access Authentication
In some cases, the user may need to authenticate itself with the
server. HTTP provides a simple challenge-response authentication
mechanism by which a server may challenge a client request and
the client many need to provide authentication information.
It uses an extensible, case-insensitive
token to identify the authentication scheme, followed by a
comma-separated list of attribute-value pairs which carry the parameters
necessary for achieving authentication via that scheme.
- Content Negotiation
Content Negotiation is the
process of selecting the best representation for a given response when
there are multiple representations available.
Most HTTP responses include an entity which contains information for
interpretation by a human user. It is desirable to provide the
user with the "best available" entity corresponding to the request.
Unfortunately for servers and caches, not all users have the same
preferences for what is "best," and not all user agents are equally
capable of rendering all entity types. For that reason, HTTP has
provisions for several mechanisms for content negotiation.
There are two kinds of
content negotiations which are possible in HTTP; server-driven and
agent-driven negotiation. In the former, the selection of the best of
representation for a response is made by an algorithm located at the
server, while in the latter, the selection is made by the user agent
after receiving an initial response from the origin server.
- Caching
The goal of caching in HTTP/1.1 is to minimize the need to send requests
in some cases, and to totally eliminate the need to send full responses
in many other cases. The former reduces the number of network
round-trips required for many operations, while the latter reduces
network bandwidth requirements. Caching is implemented in HTTP/1.1
through a number of mechanisms like expiration models, document
freshness, and validators. The caching in HTTP/1.1 is quite complex.
There are many more features in HTTP/1.1 that are elaborated upon in
Fielding et al. The features
mentioned here have also been presented in greater detail.
Copyright © 1996 Mir Farooq Ali, All Rights Reserved
Mir Farooq Ali
<mfali@vt.edu>
Last modified: Sat Oct 26 13:26:04 1996