2. Hyper Text Transfer Protocol (HTTP):
• Introduction
• Web Servers and Clients
• Resources
• URL and its Anatomy
• Message Format
• Request Message Request Line
• Request Type (Method)
• Response Message
• Status code
• Headers
• General Headers
• Persistent and Non-persistent Connections
• Web Caching
• Proxy
• Architecture
• Cache Consistency
• Pull Method
• Push Method
• Drawbacks
3. Introduction:
• HTTP (Hypertext Transfer Protocol).
• It is an application layer protocol in the TCP/IP protocol suite.
• Resources:
• Developed to transfer files and data in distributed, collaborative,
hypermedia information systems.
• WWW is based on HTTP.
• Web pages:
• WWW is a respository of resources stored in different computers
all over the world.
4. Purpose:
• HTTP is to transfer web pages from one computer (web server)
to another computer (web client).
• It is useful to transfer web pages containing links (hypertexts)
in an environment.
• There are rapid jumps among such hyperlinked web pages.
• It allows us to transfer a wide variety of data such as text,
image, audio, video, and even the result of a query.
5. Standardized:
• World Wide Web Consortium (W3C)
• Internet Engineering Task Force (IETF)
First Version:
• HTTP/1.0. was released in February,1996
Current Version:
• Specification of HTTP/1.1 [RFC 2016] was published in June
1999 and still use.
6. Web Servers and Clients:
• HTTP protocol is basically a request-response protocol
between clients and a server.
• Web servers or HTTP server?
• To this protocol, a process is run which creates and stores
resources such as HTML files, images, etc.
• This process provides the resources on request.
• It is designed to wait for incoming requests.
7.
8. A request for
a resources
Request
Comes Process
Responds with the
desired resource
Finally
Identifies the correct
resource
Who will send the requests?
Those who want to access some resources available on the web server.
9. Web Client or User agent:
• To access resources on the web server, a process is designed to
communicate with the server.
• It communicate with the web server using a set of rules and is
actually specified by the HTTP protocol.
• Web browsers are nothing but those web clients,
• They use HTTP protocol to communicate with the web server
to access resources specified by the URL at the address bar of
the web browsers.
10.
11. Port Number:
• Web server typically run on port 80 through any available port
number is used.
• TCP/IP protocol suite, a process in a machine is assigned a
locally unique positive integer.
• It can be used to identify a process within a machine uniquely.
IPAddress:
• A device connected to the Internet is assigned a unique 32-bit
address.
• It through with the port number uniquely identifies a process all
over the world.
• IP address and port pair is called socket address of the resource.
• To communicate with the web server, web clients need to specify
the socket address of the web server.
12.
13. Resources:
• The idea of resource is fundamental of WWW.
• It is used to represent basic elements in the web.
• Introduced: 1990-94
• Definition:
• It is extended further to refer to any element that can be
identified, named, addressed, and handled in any form in the
large web or smaller networked system.
• Early Web:
• A network of objects (static) files.
• Each of these objects is called a resource.
• Entity:
• A resource in the web any entity can be identified.
14. • The most common kind of resource is a file such as a text file,
an image file, an audio or video file.
• May be dynamically generated query result, the output of a
CGI program.
Identification of resource of phases:
• Naming
• Addressing
URL:
• The addressing part is protocol dependent.
• HTTP has its own scheme to address web resources.
15. URLand its Anatomy:
URL:
• A resource on the web is identified by an address.
Introduced: 1994 part of URI (Uniform Resource Identifier)
• URLs are subset of URLs
• It is used to address basically electronic resources.
• It is used to identify resources in many protocols such as ftp,
http, gopher, mailto, news, nntp, telnet, wais, file and
prospero.
URLs that are used to access web resources via HTTP.
16. Syntax:
• It is pretty simple and is similar to mailing address.
• It consists of several parts each of which contains a specific
information to identify a resource.
• It encapsulates a lot of information such as the protocol to be
used for this URL.
• Like host address (domain name or IP address), port address etc.
• Square brackets are optional
protocol://host:[port]/[path[?params][#anchor]]
17.
18.
19. Protocol:
• It is used for this URL.
• For HTTP URL, the protocol is http.
• Other protocols are ftp, http, gopher, mailto, news, nntp,
telnet, wais, file and prospero.
• The syntax of protocol is different from different protocols.
20. Host:
• Fully Qualified Domain Name (FQDN) or IP address:
• The computer where the web server runs.
• It consists of a series of domain levels separated by dots (.).
• Domain Name System (DNS):
• The Domain Name is a hierarchical name assigned to a host.
• They are case-insensitive
• Example:
• Popular Google and Yahoo web servers
• www.google.com or WWW.GOOGLE.COM
21. IPAddress:
• It also identifies a computer uniquely all over the world and
specified in the host part.
• It is a 32-bit address of the computer used by the IP of TCP/IP
protocol suite.
• It is divided into four parts each having 8 bits.
• It is written usually in decimal numbers separated by three dots
(.) is called decimal dotted notation.
• Example:
• www.google.com – 64.233.169.147
• www.yahoo.com – 69.147.76.15
22. Port:
• It indicates optional port number of process to connect to.
• A locally unique positive integer assigned to it.
• If many processes run in a computer, the port number uniquely
identifies a particular process within it.
• Web server – port 80.
• Example:
• In URL, if not port is specified, port 80 is assumed.
23. Path:
Document Root:
• The location of a file or a program specified by the web server.
• It is case-insensitive.
Example:
• Perl, CGI, JSP, PHP, etc.
• It is a directory where resources are stored.
• The path of a resource is calculated relative to this document
root.
• It varies from one web server to another.
24. Example:
• Apache Web Server, the document root is set to
/var/www/html
• Microsoft’s IIS (Internet Information Server) uses
c:Inetpubwww as default document root.
Principle:
• May be case-sensitive for servers that typically run on the
Window environment.
25. Params:
• It contains a parameter to be passed to web applications such
as PHP, JSP, etc.
• The path and parameter are separated by ? character.
• It consists of a (name = value) pair separated by an (&).
• Example:
• login=gdkf & id=543543 & page=inbox
• It specifies three parameters:
• Names - login, id and page
• Values - “gdkf”, “543543” , “inbox”
26. Anchor:
• It specifies location in the web page.
• Example:
• Location is created using <a> tag.
• <a name=“appendix”>Appendix</a>
• Referred:
• http://www.it.jusl.ac.in/httphelp.html#appendix
27. URLExamples:
Protocol Host Port Path Anchor Params
http:// www.google.com
http:// www.it.just.ac.in: 8080/ history.html
http:// www.it.just.ac.in: 8081/ history.html
http:// www.it.just.ac.in: location,html# how to
http:// www.it.just.ac.in: 8080/ Report.jsp? type=name