the world wide - polito
TRANSCRIPT
THE WORLD WIDE WEB
Outline
à A recipe for success à The hyper-text transfer
protocol à Advanced features à Performance improvement
A RECIPE FOR SUCCESS
A Web of Documents Web pages contain references to others
A World Wide Web (WWW) “Anywhere” in the Internet
The Ingredients
à Servers à Clients (browsers) à Document format (HTML) à Identifiers (URIs) à Protocol (HTTP)
Web Pages
à Different objects combined in a framework à Multimedia
à Hyper-Text Markup Language à Some objects are “sensitive”
Universal Resource Identifier (URI)
à Identifies each object (resource)
à Where to find it à URL: Universal Resource Locator
à How to get it à Protocol
h"p://12.18.43.2:8080
Port
Universal Resource Identifier (URI) h"p://www.polito.it/teach/cn/main.htm#bib
Schema
protocol and U
RI format
Host (server)
Path
Object
(document)
Anchor
HTML <html> <head> <Mtle>Mario Baldi's List of PublicaMons</Mtle> </head> <body> <h1 align="center"> List of PublicaMons of Mario Baldi</h1> <p [<a href="#books">Books</a>] [<a href= <em>These publicaMons provided here for <a href="h"p://www.ieee.org/"> <img src="../images/IEEElogo.gif"> <a href="h"p://www.ieee.org/about/documentaMon/copyright/policies.htm"> Personal use of this material is permi"ed.
Tag
<h2><a name="books"></a>Books</h2> <p>M. Baldi, P. Nicole], "<a href="../Inte </body> </html>
HTML
Web Browsers
à “Visualize” pages à Download a new one upon a
click à Support several protocols
à HTTP, FTP, SIP à Object types
à Images, video, sound
Success Factors
à Intuitive à “Colorful” à Multimedia
HYPER-TEXT TRANSFER PROTOCOL (HTTP)
Features
à Text based à Client-server à Based on TCP à Opened by client à Usually port 8O (server)
Request (C)-Response (S) Protocol
TCP Open
HTTP Request
HTTP Response
Stateless
Message Format
Body
[CR LF]
Header Field [<name>:<value>]
Header Field [<name>:<value>]
Request/Status Line
Header lines
Request Line <method> <URL> <ver>
à Methods à GET, POST, PUT, HEAD
à Version à HTTP/1.O à HTTP/1.1
Sample Request Message GET /baldi/pubs/index.htm HTTP/1.1 Host: staff.polito.it User-‐Agent: Mozilla/5.0 Accept: text/html,applicaMon/xhtml Accept-‐Language: en-‐us Accept-‐Encoding: gzip, deflate ConnecMon: keep-‐alive
Status Line <ver> <status code>
à 2OO OK à 3O1 Moved Permanently à 4OO Bad Request à 4O4 Not Found à 5OO Internal Server Error
Sample Response Message HTTP/1.1 200 OK Date: Sat, 15 Jun 2013 21:17:27 GMT Server: Apache Accept-‐Ranges: bytes Content-‐Length: 93589 Keep-‐Alive: Mmeout=15, max=97 ConnecMon: Keep-‐Alive Content-‐Type: text/html <html><head>
Status Code Categories
à 2xx Success à 3xx Redirection à 4xx Client problem à 5xx Server problem
ADVANCED FEATURES
Authentication
GET …
GET … AuthorizaMon: <cred>
200 OK
401 Unauthorized WWW-‐AuthenMcate: <chlg>
GET … AuthorizaMon: <cred>
Authentication
Cookie
à Mechanism for the server to identify a returning client
à Enables stateful interaction à E.g. shopping chart à User preferences
GET abc
GET defg Cookie: xyz
200 OK
200 OK Set-‐cookie: xyz
GET defg
200 OK Set-‐cookie: wqt
PERFORMANCE IMPROVEMENT
Caching
à Clients store pages and objects
à What if they change? à HEAD method à If-modified-since: <date> header à 304 Not Modified"
Proxy Server
Corporate network
� �
www.netscire.it
�
� index.htm
index.htm
GET www.netscire.it
Proxy
à Reduce traffic à URL filtering à Centralized monitoring à Client protection
Content cache/replica server
Content Delivery Network (CDN)
GET www.netscire.it
index.htm
index.htm
GET www.netscire.it