0% found this document useful (0 votes)
3 views

Application Protocol HTTP

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Application Protocol HTTP

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

HTTP Protocol

What Is protocol?

• To communicate between two people we need at least


one common communication language.
• In every language, it do have several rules, some
characters, words, grammar etc.

• Same, when two computing devices are


communicating, this is called communication protocols.
• Protocols defines rules to transfer, packet / frame size,
frame format, fixed over head and some way of error
correction / detection mechanism.
Why It Is?

• Protocol for transfer of various data


• Plaintext
• Hypertext
• Images
• Video
• Sound
Uniform Resources

• URL
• Uniform Resource Locator
• Refers to an existing protocol
• http:, wais:, ftp:, mailto:, gopher:, news:
• Points to a document on a specific server
• URN
• Uniform Resource Name
• Globally unique, persistent identifier
• Independent of location
• URI
• Uniform Resource Identifier
• Collection of URL’s and URN’s
Uniform Resources
Uniform Resources

• All URI can be either


• URL
• URN
• Combination of both

• URN or URL can be URI but not all.


URL
• <scheme> : //<host> :<port> /<path> ;<parameters>
?<query> #<fragment>
• scheme
• The protocol you are using
• host
• Host name or IP number
• port
• TCP port number that protocol server is using
• path
• Path and filename reference of object on server
• parameters
• Any specific parameters that object needs
• query
• Query string for a CGI program
• fragment
• Reference to a subset of an object
URL and HTTP

• All parts of URL, except parameters, used with http


• Scheme and host can be omitted when referenced
object is on same machine as referring document
• For example if we are referring any file in the computer
location, we do need to provide its address not URL.
• Port can be omitted so long as referenced host is
running on port listed in your /etc/services file
• Usually port 80
• Full path used when referring to another server
• Relative path on same server
• Reference with relative path is a partial URL
Web Documents

• html
• ASCII text
• Preformatted
• postscript
• Images
• GIF
• JPEG
• Video
• MPEG
• VRML
• Java
Communication

• Server tells client what type of information is coming


before information arrives
• File extensions
• .html .htm
• .txt
• .ps
• .au
• .gif .tiff .jpeg
• .mpeg
• .vrml .wrl
• .java
HyperText Transfer Protocol (HTTP)

• The Hyper Text Transfer Protocol (HTTP) is a client-


server network protocol.
• HTTP is the protocol that supports communication
between web browsers and web servers.
• It is based on Request – Response Paradigm.
• The standard port for HTTP connections is port 80.
HTTP Version Number

• Most clients/servers today speak version 1.1, but 1.0 is


also in use.
• RFC 1945 (HTTP 1.0)
• RFC 2616 (HTTP 1.1)
• Starting with HTTP 1.0 the version number is part of
every request.
• Client tells the server what version it can talk (what options
are supported, etc).
• HTTP 0.9 did not include a version number in a request
line.
• If a server gets a request line with no HTTP version number, it
assumes 0.9
• HTTP 0.9 was used for many years.
Evolution of HTTP

• HTTP/1.0 - 1995
• Meta-information between client and server
• Media types
• MIME type/subtype
• Status codes
• This information influenced the development of web search engines
• Caching
• Authorization
• Problems
• Scalability
• High number of clients visit server for short time
• Flash crowd
• Bandwidth
Evolution of HTTP

• HTTP/1.1
• Byte ranges
• Request of a document subset
• Adobe's Portable Document Format
• Streaming multimedia
• Eliminates unnecessary client/server communication
• An interrupted transfer which is restarted can be more efficient
• Content negotiation with quality factors
• Quality factors
• Real numbers between 0 and 1
• Default is 1
• Accept-Language: fr, en-gb; q=0.8, en; q=0.7
HTTP is an application layer protocol
HTTP is an application layer protocol

• The Web client and the Web server are application


programs
• Application layer programs do useful work like
retrieving Web pages, sending and receiving email or
transferring files
• Lower layers take care of the communication details
• The client and server send messages and data without
knowing anything about the communication network
HTTP Methods

• GET - method means retrieve whatever information. Is


identified by the Request-URI
• POST - used to send data to the server for updates.
• PUT - method requests that the enclosed entity be stored
under the supplied Request-URI.
• DELETE - requests that the origin server delete the resource
identified by the Request-URI.
• HEAD - identical to GET except that the server MUST NOT
return a message-body in the response.
• TRACE - allows the client to see what is being received at the
other end of the request chain and use that data for testing
or diagnostic
• CONNECT - use with a proxy that can dynamically switch to
being a tunnel
How http works?

• HTTP is implemented in two


programs: a client program
and a server program,
executing on different end
systems, talk to each other by
exchanging HTTP messages.
• Initiates a TCP connection with
the server.
• Processes access TCP through
their socket interfaces.
How http works?

• Suppose client wants to visit www.yahoo.com


How http works? (cont.)
How http works? (cont.)
HTTP Request Message

• HTTP request message is called


the request line.
• The subsequent lines are called
the header lines.
• HTTP has a simple structure:
• client sends a request
• server returns a reply.
• HTTP can support multiple
request-reply exchanges over a
single TCP connection.
• The “well known” TCP port for
HTTP servers is port 80.
• Other ports can be used as well...
The Header Lines

• Request Headers provide information to the server about


the client
• what kind of client
• what kind of content will be accepted
• who is making the request
• Each header line contains
• an attribute name followed by a “:” followed by a space and
the attribute value.
• There can be 0 headers (HTTP 1.0)
• HTTP 1.1 requires a Host: header
HTTP Response messages

• It has three sections: an initial


status line, header lines, and
then the entity body.
• The entity body contains the
requested object itself.
• The status line has three fields:
the protocol version field, a
status code, and a corresponding
status message.
Advantages and Disadvantages of HTTP protocol

Advantages:
• Identification
• Specialization
• Addressing
• Flexibility
• Ease of programming

Disadvantages:
• Information sent via HTTP is not encrypted and can pose a
threat to your privacy.
• Packet headers are larger than other protocols as they are
needed for security and quality assurance of the information
being transferred.
Limitations of HTTP

• Designed for document transfer


• Request-response interaction
• Bi-directional but still half-duplex
• Traffic flows in only one direction at a time
• Stateless
• Header overhead
• Information is
sent with each HTTP
request and response
HTTPS

• The Secure Sockets Layer (SSL) was designed to encrypt


any TCP/IP based network traffic and provide the
following capabilities
• Prevents eavesdropping
• Prevents tampering or replaying of messages
• Uses certificates to authenticate servers and optionally clients
• The HTTPS protocol is the same text based protocol as
HTTP but is run over an encrypted SSL session.
Limitation:
• Is slower than other native protocols but is more secure,
reliable and can transfer larger chunks of data.
The Future

• HTTP-Next Generation
• Many channels
• One TCP connection carries multiple channels for parallel
communication
• Different protocols on each channel
• Traditional way
• Multiple TCP connections between same client and server
• Pages contain images, video, audio, and html
• Extensibility
• PEP
• Protocol Extension Protocol
The Future

• Performance
• Parsing MIME headers wastes resources
• Sticky headers
• Persistent state between multiple http requests
• Not all headers have to be included in every http message
• Distributed authoring
• Event notification

You might also like