Presentation is loading. Please wait.

Presentation is loading. Please wait.

HyperText Transfer Protocol

Similar presentations


Presentation on theme: "HyperText Transfer Protocol"— Presentation transcript:

1 HyperText Transfer Protocol

2 HTTP HyperText Transfer Protocol (HTTP) is an application protocol that is used to retrieve Web pages from remote servers. It is an application-level TCP/IP based protocol with the lightness and speed necessary for hypermedia information systems (internet). HTTP is the foundation of data communication for the World Wide Web.

3 HTTP There can be many different application programs—that is, Web clients like Internet Explorer, Chrome, Firefox, and Safari—that provide users with a different look and feel, but all of them use the same HTTP protocol to communicate with Web servers over the internet.

4 Two types of protocols Two very widely-used, standardized application protocols: SMTP: Simple Mail Transfer Protocol is used to exchange electronic mail. HTTP: HyperText Transfer Protocol is used to communicate between Web browsers and Web servers.

5 HTTP The core idea of hypertext is that a software system that links topics on the screen to related information and graphics. The protocol (HTTP) and document language (HTML) were designed to meet that goal.

6 HTTP-URL Web browser has a function that allows the user to obtain an object by “opening a URL.” Uniform Resource Locator It provide information that allows objects on the Web to be located, and they look like the following:

7 HTTP-URL If you opened that particular URL, your Web browser would open a TCP (Transmission Control Protocol)connection to the Web server at a machine called and immediately retrieve and display the file called index.html. Most files on the Web contain images and text and many have other objects such as audio and video clips, pieces of code, etc. They also frequently include URLs that point to other files that may be located on other machines, which is the core of the “hypertext” part of HTTP and HTML.

8 HTTP - URL URL Uniform Resource Locator
protocol (http, ftp, news) host name (name.domain name) port (usually 80 but many on 8080) directory path to the resource resource name

9 URI,URN,URL Uniform Resource Identifier Uniform Resource Name
Information about a resource Uniform Resource Name The name of the resource with in a namespace. Uniform Resource Locator How to find the resource, a URI that says how to find the resource

10 When you ask your browser to view a page, your browser (the client) fetches the page from the server using HTTP running over TCP. Like SMTP, HTTP is a text oriented protocol. At its core, HTTP is a request/response protocol, where every message has the general form START_LINE <CRLF> MESSAGE_HEADER <CRLF> <CRLF> MESSAGE_BODY <CRLF> where as before,<CRLF>stands for carriage-return-line-feed.The first line (START LINE) indicates whether this is a request message or a response message.

11 HTTP Request Packets Sent from client to server
Consists of HTTP header header is hidden in browser environment contains: content type content length user - browser issuing request content types user can handle and a URL

12 HTTP-Request message HTTP request message specifies three things:
the operation to be performed, the Web page operation should be performed, and the version of HTTP being used.

13 HTTP-request operations

14 Request operation example
For example: START_LINE GET HTTP/1.1 (absolute URL client wants the server on host to return page named index.html )

15 Response Packets Sent by server to client browser in response to a Request Packet

16 HTTP Response Headers Sent by server to client browser Status Header
Entities Content-Encoding: Content-Length: Content-Type: Expires: Last-Modified: extension-header Body – content (usually html)

17 HTTP-response message
Response Messages Like request messages, response messages begin with a single START LINE. In this case, the line specifies -the version of HTTP being used, -a three-digit code indicating whether or not the request was successful, and -a text string giving the reason for the response.

18 HTTP-response operation
Five types of HTTP result codes

19 Response Status Codes 200 OK 201 created 202 accepted 204 no content
301movedpermanently 302movedtemporaryly 304 not modified 400 bad request 401 unauthorized 403 forbidden 404 not found 500 int. server error 501 not impl. 502 bad gateway 503 svc not avail

20 Response operation example
For example: START_LINE HTTP/ Accepted Indicates that the server was able to satisfy the request. HTTP/ Not Found Indicates that it was not able to satisfy the request because the page was not found.

21 HTTP-VERSION1.0 The original version of HTTP (1.0) established a separate TCP connection for each data item retrieved from the server. But this was a very inefficient mechanism: connection setup and teardown messages had to be exchanged between the client and server even if all the client wanted to do was verify that it had the most recent copy of a page. Thus, retrieving a page that included some text and a dozen icons or other small graphics would result in 13 separate TCP connections being established and closed.

22 TCP-Connections HTTP 1.0 behavior

23 HTTP-VERSION1.1 To overcome this situation, HTTP version 1.1 introduced persistent connections— the client and server can exchange multiple request/response messages over the same TCP connection. Persistent connections have many advantages. It eliminates the connection setup overhead, thereby reducing the load on the server, the load on the network caused by the additional TCP packets, and the delay perceived by the user. Since , a client can send multiple request messagesdown a single TCP connection, TCP’s congestion window mechanism is able to operate more efficiently.

24 HTTP 1.1 behavior with persistent connections
TCP-Connections HTTP 1.1 behavior with persistent connections


Download ppt "HyperText Transfer Protocol"

Similar presentations


Ads by Google