Mark Eschbach

Software Developer && System Analyst

HTTP

HTTP is the defacto standard of system communcation on the internet and generally used to manage interactions of web user interfaces (such as render by the browser). As a protocol, HTTP is a simple protocol. The guenius of HTTP extends from the generalized format to describe general resources.

Terms

  • User Agent - The HTTP client making the request
  • Server - An HTTP client listening for and responding to requests, either as a proxy or with an actual resource
  • Resource - A concept encapsulated by a remote name.
  • Proxy - A service which caches data and responds in place of a service with authorative data

An abstract of the protocol's general usage

HTTP is a versalite protocol really only depends on the underlying protocol to have reliable two way pipes, which may be taken in turn. By far the most popular underlying protocol is TCP/IP, however SSL/TCP/IP is gaining in popularity. For the purposes of these examples I will TCP/IP although you could substitue any underlying protocol fitting these constaints.

  • User Agent instantiates a request of TCP/IP
  • Service receives the TCP/IP request
  • User Agent sends the request line, headers and body (if applicable)
  • Service responds with a status line, followed by headers and body (usually, but may be omitted)
  • Generally the Service would close the connection at this point, however with HTTP/1.1 a keep-alive mechanism was introduced.

HTTP/1.1 Keep Alive

HTTP/1.1 introduced a new feature to the protocol, allowing a client to pipeline requests. This meant the Service was not to close the connection at the end of each response, but allow the client to make another request. Services generally honor a client's request for 'keep-alive' for up to a certain amount of time before forciably terminating a request.

The goal of the 'keep-alive' mechanism was to reduce the load of related systems such as DNS and TCP/IP due to spikes of traffic. When a user first visits a site, generally there are many resources such as landing page, images, stylesheets, and JavaScript scripts which need to be retrieved. 'keep-alive' was meant to allow the client some time to parse the returning data then request related resources.