Title: HTTP
1HTTP
2What is HTTP?
- According to RFC 1945, HTTP is an
application-level protocol with the lightness and
speed necessary for distributed, collaborative,
hypermedia information systems. It is a generic,
stateless, object-oriented protocol which can be
used for many tasks, such as name servers and
distributed object management systems, through
extension of its request methods.
3HUH?
- Yeah, that was my first response.
4However, to truly understand HTTP, three other
subjects must first be addressed.
5URL
- Uniform Resource Locator
- A compact representation of the location and
access method for a resource available via the
Internet - A networked extension of a file name Stallings
p. 715 - And..
6URL Cont.
- Since, different resources are accessible in
different ways, the URL also indicates which
access method must be used to retrieve the
object. Stallings p. 715 - General form
-
7URL Schemes
- ftp
- http
- mailto
- news
- telnet
8Format of the HTTP URL
- Http/// with default port set
at 80 - Example http//128.5.17.3280/some path or,
thanks to DNS, we merely see http//www.schoolsuck
s.com - Path is any extension after the main page/files
/pages whatever.
9URI
- According to Stallings, URI is a generic WWW
identifier which provides for a list of naming or
addressing schemes. - Or, what we would call a DNS. ?
10HTML
- Hypertext Markup Language
- Standard language used to make documents on the
web - Uses tags to allow connection to other
documents - Not bound to any operating systems features
- Not as concerned with appearance as structure
11So what does all of that have to do with HTTP?
12HTTP
HTTP can be used in any client-server
application involving hypertext and is a protocol
for transmitting information with the efficiency
necessary for making hypertext jumps. The data
transferred can be plain text, graphics, sound,
etc Stallings pp. 719-720
13HTTP is a stateless protocol
- each transaction is treated independently
- Therefore, a new TCP connection between client
and server is created for each transaction and
then terminated when the transaction completes. - Stallings p. 721
14So how does it work?
- TCP Connection is opened and an HTTP request is
sent by the user agent to the original server. - When the HTTP request is received, the TCP
Connection is closed by the original server. - Once the page is found, the TCP connection is
reopened and a response is sent from the original
server to the user agent.
15When a request is made as described by w3.org.
- . The client (typically a Web Browser) makes an
HTTP connection to the host. - . The server accepts the connection.
- . The client sends a request for a document --
one line of text, such as GET path_from_URL - . The server closes the connection and fetches
the requested document. - . The server reopens the connection and sends the
requested document. - . The client accepts the document.
- . When the send is complete, the server closes
the connection. - . The client terminates the HTTP connection.
16A more complex request/response path involves
intermediaries.
- Not an end-to-end TCP connection
- It consists of one or more intermediate systems
connected by TCP connections - Three forms identified
- Proxy
- Gateway
- Tunnel
17Forms of Intermediate systems
- A Proxy acts on behalf of other clients and
presents requests from other clients to a server.
Like a firewall. - A Gateway is a server that appears to the client
as if it were an origin server. - A Tunnel performs no operations on HTTP requests
and responses, rather it acts simply as a relay
point. Stallings pp. 722-723
18More on Intermediaries.
19A Cache.
- A cache is a facility that may store previous
requests and responses for handling new
requests. Stallings p. 723 - Not all requests and responses can be cached.
20Simple-Request and Simple-Response messages
21Entity Header and Body
- According to Newtons Telecom Dictionary, an
entity is an active element within an OSI layer
or sublayer. p. 303 - Entity Header provides information about the
Entity Body - Entity Body consists of an arbitrary sequence of
octets. When an entity body is present in a
message, the interpretation of the octets in the
body is determined by the entity header fields.
Stallings p. 734
22Status Codes
- RFC 2068 gives five different status codes
- 1xx Informational - Request Received, continuing
process - 2xx Success - The action was successfully
received, understood, and accepted - 3xx Redirection - Further action must be taken
in order to complete the request - 4xx Client Error - The request contains bad
syntax or cannot be fulfilled - 5xx Server Error - The server failed to fulfill
an apparently valid request
23Status Codes cont.
- 301 - Moved Permanently
- 400 - Bad Request
- 401 - Unauthorized
- 403 - Forbidden
- 404 - Not Found
- 405 - Method Not Allowed
- 406 - Not Acceptable
- 415 - Unsupported Media Type
24The End...
- For further reading the Datacom book provides
more detail. Pages 715, 719-736 - Other sources.
- RFCs 1945, 2068, 2616
- www.w3.org/Protocols/HTTP/HTTP2.html
- www.jmarshall.com/easy/http/