www and http services

25
WWW SERVICE AND HTTP SERVICE

description

networking:) WWW AND HTTP

Transcript of www and http services

Page 1: www and http services

WWW SERVICE AND

HTTP SERVICE

Page 2: www and http services

When a web address (or URL- Uniform Resource Locator) is typed into a web browser, the web browser establishes a connection to the web service running on the server using HTTP.

URLs and URIs (uniform resource identifiers) are the names most people associate with web addresses.

Page 3: www and http services

The URL http://www.cisco.com/index.html refers to a specific resource—a web page named index.html on a server identified as cisco.com.

Web browsers are the client applications computers use to connect to the World Wide Web and access resources stored on a web server.

As with most server processes, the web server runs as a background service and makes different types of files available.

Page 4: www and http services

To access the content, web clients make connections to the server and request the desired resources.

The server replies with the resources and, upon receipt, the browser interprets the data and presents it to the user.

Browsers can interpret and present many data types, such as plain text or HTML, the language in which web pages are constructed.

Page 5: www and http services

Other types of data, however, might require another service or program, typically referred to as a plug-in or add-on.

To help the browser determine what type of file it is receiving, the server specifies what kind of data the file contains.

Page 6: www and http services

consider the URL http://www.cisco.com/web-server.htm.

First, the browser interprets the three parts of the URL:

■ http: The protocol or scheme■ www.cisco.com: The server name■ web-server.htm: The specific filename

requested

The browser then checks with a name server to convert http://www.cisco.com into a numeric address, which it uses to connect to the server.

Page 7: www and http services

Using the HTTP requirements, the browser sends a GET request to the server and asks for the file web-server.htm.

The server in turn sends the HTML code for this web page to the browser.

Finally, the browser deciphers the HTML code and formats the page for the browser window.

Page 8: www and http services

HTTP, one of the protocols in the TCP/IP suite, was originally developed to publish and retrieve HTML pages and is now used for distributed, collaborative information systems.

HTTP is used across the world wide web for data transfer and is one of the most used application protocols.

Page 9: www and http services

HTTP specifies a request/response protocol. When a client, typically a web browser, sends a request message to a server, the HTTP protocol defines the message types the client uses to request the web page and the message types the server uses to respond.

Page 10: www and http services

GET is a client request for data.

A web browser sends the GET message to request pages from a web server.

When the server receives the GET request, it responds with a status line, such as HTTP/1.1 200 OK, and a message of its own, the body of which can be the requested file, an error message, or some other information.

Page 11: www and http services

The three common message types are:

■ GET■ POST■ PUT

Page 12: www and http services

POST and PUT are used to send messages that upload data to the web server.

For example, when the user enters data into a form embedded in a web page, POST includes the data in the message sent to the server.

PUT uploads resources or content to the web server.

Page 13: www and http services

ExamplePOST/phonebook.cgi.HTTP/1.0Date:User-Agent:Accept Language: en-usContent Length: 1498490 55266

Looks up phone book for the number Could have been also achieved by Get But in that case number would have been in the Resource URL Which would have been stored in the log

Page 14: www and http services

Although it is remarkably flexible, HTTP is not a secure protocol.

The POST messages upload information to the server in plain text that can be intercepted and read.

Similarly, the server responses, typically HTML pages, are unencrypted.

Page 15: www and http services

For secure communication across the Internet, the Secure HTTP (HTTPS) protocol is used for accessing and posting web server information. HTTPS can use authentication and encryption to secure data as it travels between the client and server.

HTTPS specifies additional rules for passing data between the application layer and the transport layer.

Page 16: www and http services

HTTP Protocol Using GET

Page 17: www and http services

Accessing Resources over the Web

<protocol>://<server>/<path>

Defines the address (Uniform Resource Locator)

Communication Protocol between the client and the server

Page 18: www and http services

Hypertext Transport Protocol (HTTP) characteristicsRequest-response mechanism:

◦Transaction is initiated by a client sending a request to server

◦Server generates a response Resource Identification

◦ Each HTTP request includes a URI (Uniform Resource Identifier)Statelessness

◦ The server does not maintain any information about the transaction

Meta data support ◦ Metadata about information can be exchanged in the

messages

Page 19: www and http services

HTTP Request Format

GET /index.html HTTP/1.0Request Line

Host: www.content-networking.comDate: BBBBBBBBBBBBUser-Agent: Mozilla/5.0 (en) (WINNT; U)Accept-Language: en-us

Header Lines

Carriage Return/Line Feed

Specifies request method

Specifies resource via URI

& meta data

Message Body Content-length: (Message Payload)

Page 20: www and http services

HTTP Response Format

HTTP/1.0 200 OK Status line

Date: BBBBBBBBBBBBServer: Apache/1.3.12 (Unix)Last-Modified: (date)Content Type: text/html

Header Lines

Carriage Return/Line Feed

Status line with result code and phrase

Specifies server &

resource meta data

Message Body Content-length: (Message Payload)

Page 21: www and http services

Result Code and Phrase1xx: Informational – Not Done Yet2xx: Success – You win3xx:Redirection-You lose but try again4xx:Client Error – You lose, your fault5xx:Server Error – You lose, my bad

200 OK 204 No Content300 Multiple Choices301 Moved Permanently 302 Moved Temporarily304 Not Modified 400 Bad Request 401 Unauthorized404 Not Found500 Internal Server Error

Page 22: www and http services

Improvements in HTTP/1.1Persistent connections

◦Keeps the connection open after the server response

◦Connection can be closed by either client or server

Request Pipelining ◦Allows a client to send several requests without

waiting for a response◦Server responds in the same order

Chunked Encoding ◦Allows sender to break a message into arbitrary

sized chunks ◦ Useful for dynamically created response messages

Page 23: www and http services

Cookies• HTTP is stateless protocol • Cookies manage state maintenance by shifting the burden to

client• Cookies are transmitted in clear text (security issue)

Client Server

Usual HTTP Request

Usual HTTP Response, including header line Set-cookie: <cookie>

1st client request

Usual HTTP Request, including header line Set-cookie: <cookie>

Usual HTTP Response

2nd client request

Client does not interpret the cookie string Server is presented with the previously returned state information

Page 24: www and http services

User Authentication

• Users browser information remembers credentials and includes them in headers for subsequent requests• Browser typically deletes stored

authentication credentials once browser is closed• HTTP allows various authentication

mechanisms

Page 25: www and http services

Group 2John Gabriel JavierJenica SalmorinEnrefie AbuelaMarilou Villanueva