Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Know how HTTP accesses data on the WWW Objectives.

Similar presentations


Presentation on theme: "TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Know how HTTP accesses data on the WWW Objectives."— Presentation transcript:

1 TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Know how HTTP accesses data on the WWW Objectives

2 TCP/IP Protocol Suite 2 22.3 HTTP The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web. HTTP functions like a combination of FTP and SMTP. The topics discussed in this section include: HTTP Transaction Persistent versus Nonpersistent Connection Proxy Server

3 TCP/IP Protocol Suite 3 Figure 22.12 HTTP transaction HTTP uses the services of TCP on the well-known port number 80.

4 TCP/IP Protocol Suite 4 Figure 22.13 Request and response messages A request message consists of a request line, a header, and sometimes a body. A response message consists of a status line, a header, and sometimes a body.

5 TCP/IP Protocol Suite 5 Figure 22.14 Request and status lines Request type: a particular method (methods are shown on the next slide) HTTP version: 1.1 Status code: similar to those in SMTP (see slides 7 and 8) Status phrase: the text version of the status code (also shown in slides 7 and 8)

6 TCP/IP Protocol Suite 6 Table 22.1 Methods

7 TCP/IP Protocol Suite 7 Table 22.2 Status codes

8 TCP/IP Protocol Suite 8 Table 22.2 Status codes (continued)

9 TCP/IP Protocol Suite 9 Figure 22.15 Header format The header exchanges additional info between the client and the server. The header can consist of one or more header lines. Each header line looks like this: There are four categories of header lines: general header, request header, response header, and entity header.

10 TCP/IP Protocol Suite 10 Table 22.3 General headers Gives general information about the message and can be present in both a request and a response.

11 TCP/IP Protocol Suite 11 Table 22.4 Request headers Only present in a request message; specifies the client’s configuration and preferred document format.

12 TCP/IP Protocol Suite 12 Table 22.5 Response headers

13 TCP/IP Protocol Suite 13 Table 22.6 Entity headers Gives info about the body of the document; mostly present in response messages, but also present in some request messages such as POST or PUT methods that contain a body.

14 TCP/IP Protocol Suite 14 This example retrieves a document. We use the GET method to retrieve an image with the path /usr/bin/image1. The request line shows the method (GET), the URL, and the HTTP version (1.1). The header has two lines that show that the client can accept images in the GIF or JPEG format. The request does not have a body. The response message contains the status line and four lines of header. The header lines define the date, server, MIME version, and length of the document. The body of the document follows the header (see Figure 22.16). Example 1 See Next Slide

15 TCP/IP Protocol Suite 15 Figure 22.16 Example 1

16 TCP/IP Protocol Suite 16 In this example, the client wants to send data to the server. We use the POST method. The request line shows the method (POST), URL, and HTTP version (1.1). There are four lines of headers. The request body contains the input information. The response message contains the status line and four lines of headers. The created document, which is a CGI document, is included as the body (see Figure 22.17). Example 2 See Next Slide

17 TCP/IP Protocol Suite 17 Figure 22.17 Example 2

18 TCP/IP Protocol Suite 18 Example 3 Here is the first request in a notification server session: POST http://gateway.messenger.hotmail.com/gateway/gateway.dll?Action=open&Server= NS&IP=messenger.hotmail.com HTTP/1.1 Accept: */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: MSMSGS Host: gateway.messenger.hotmail.com Proxy-Connection: Keep-Alive Connection: Keep-Alive Pragma: no-cache Content-Type: application/x-msn-messenger Content-Length: 18 VER 5 MSNP8 CVR0

19 TCP/IP Protocol Suite 19 Example 3 Here is the response: HTTP/1.0 200 OK Server: Microsoft-IIS/5.0 Date: Tue, 18 Mar 2003 07:39:53 GMT X-MSN-Messenger: SessionID=954547325.13160; GW-IP=207.46.110.18 Content-Length: 18 Content-Type: application/x-msn-messenger Age: 0 Via: HTTP/1.1 ntl_site (Traffic-Server/5.2.0-R [c sSf ]) X-Cache: MISS from nautilus.localdomain X-Cache-Lookup: MISS from nautilus.localdomain:80 Proxy-Connection: keep-alive VER 5 MSNP8 CVR0

20 TCP/IP Protocol Suite 20 HTTP version 1.1 specifies a persistent connection by default. In other words, the server leaves the connection open for more requests after sending a response. HTTP v1 opened a separate TCP connection for each part (image) of the web page. Very wasteful.


Download ppt "TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Know how HTTP accesses data on the WWW Objectives."

Similar presentations


Ads by Google