the world wide - polito

34
THE WORLD WIDE WEB

Upload: others

Post on 15-Oct-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: THE WORLD WIDE - PoliTO

THE WORLD WIDE WEB

Page 2: THE WORLD WIDE - PoliTO

Outline

à  A recipe for success à  The hyper-text transfer

protocol à  Advanced features à  Performance improvement

Page 3: THE WORLD WIDE - PoliTO

A RECIPE FOR SUCCESS

Page 4: THE WORLD WIDE - PoliTO

A Web of Documents Web pages contain references to others

Page 5: THE WORLD WIDE - PoliTO

A World Wide Web (WWW) “Anywhere” in the Internet

Page 6: THE WORLD WIDE - PoliTO

The Ingredients

à  Servers à  Clients (browsers) à  Document format (HTML) à  Identifiers (URIs) à  Protocol (HTTP)

Page 7: THE WORLD WIDE - PoliTO

Web Pages

à Different objects combined in a framework à Multimedia

Page 8: THE WORLD WIDE - PoliTO

à Hyper-Text Markup Language à Some objects are “sensitive”

Page 9: THE WORLD WIDE - PoliTO

Universal Resource Identifier (URI)

à Identifies each object (resource)

à Where to find it à URL: Universal Resource Locator

à How to get it à Protocol

Page 10: THE WORLD WIDE - PoliTO

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  

Page 11: THE WORLD WIDE - PoliTO

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  

Page 12: THE WORLD WIDE - PoliTO

<h2><a  name="books"></a>Books</h2>  <p>M.  Baldi,  P.  Nicole],  "<a  href="../Inte    </body>  </html>  

HTML

Page 13: THE WORLD WIDE - PoliTO
Page 14: THE WORLD WIDE - PoliTO

Web Browsers

à “Visualize” pages à Download a new one upon a

click à Support several protocols

à HTTP, FTP, SIP à Object types

à Images, video, sound

Page 15: THE WORLD WIDE - PoliTO

Success Factors

à  Intuitive à  “Colorful” à  Multimedia

Page 16: THE WORLD WIDE - PoliTO

HYPER-TEXT TRANSFER PROTOCOL (HTTP)

Page 17: THE WORLD WIDE - PoliTO

Features

à Text based à Client-server à Based on TCP à Opened by client à Usually port 8O (server)

Page 18: THE WORLD WIDE - PoliTO

Request (C)-Response (S) Protocol

TCP  Open  

HTTP  Request  

HTTP  Response  

Stateless  

Page 19: THE WORLD WIDE - PoliTO

Message Format

Body  

[CR  LF]  

Header  Field  [<name>:<value>]  

Header  Field  [<name>:<value>]  

Request/Status  Line  

Header  lines  

Page 20: THE WORLD WIDE - PoliTO

Request Line <method> <URL> <ver>

à Methods à GET, POST, PUT, HEAD

à Version à HTTP/1.O à HTTP/1.1

Page 21: THE WORLD WIDE - PoliTO

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  

Page 22: THE WORLD WIDE - PoliTO

Status Line <ver> <status code>

à 2OO OK à 3O1 Moved Permanently à 4OO Bad Request à 4O4 Not Found à 5OO Internal Server Error

Page 23: THE WORLD WIDE - PoliTO

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>  

Page 24: THE WORLD WIDE - PoliTO

Status Code Categories

à  2xx Success à  3xx Redirection à  4xx Client problem à  5xx Server problem

Page 25: THE WORLD WIDE - PoliTO

ADVANCED FEATURES

Page 26: THE WORLD WIDE - PoliTO

Authentication

Page 27: THE WORLD WIDE - PoliTO

GET  …  

GET  …  AuthorizaMon:  <cred>  

200  OK  

401  Unauthorized  WWW-­‐AuthenMcate:  <chlg>  

GET  …  AuthorizaMon:  <cred>  

Authentication

Page 28: THE WORLD WIDE - PoliTO

Cookie

à Mechanism for the server to identify a returning client

à Enables stateful interaction à E.g. shopping chart à User preferences

Page 29: THE WORLD WIDE - PoliTO

GET  abc  

GET  defg  Cookie:  xyz  

200  OK  

200  OK  Set-­‐cookie:  xyz  

GET  defg  

200  OK  Set-­‐cookie:  wqt  

Page 30: THE WORLD WIDE - PoliTO

PERFORMANCE IMPROVEMENT

Page 31: THE WORLD WIDE - PoliTO

Caching

à Clients store pages and objects

à What if they change? à HEAD method à If-modified-since: <date> header à 304 Not Modified"

Page 32: THE WORLD WIDE - PoliTO

Proxy Server

Corporate  network  

� �

www.netscire.it  

� index.htm  

index.htm  

GET  www.netscire.it  

Page 33: THE WORLD WIDE - PoliTO

Proxy

à  Reduce traffic à  URL filtering à  Centralized monitoring à  Client protection

Page 34: THE WORLD WIDE - PoliTO

Content  cache/replica  server  

Content Delivery Network (CDN)

GET  www.netscire.it  

index.htm  

index.htm  

GET  www.netscire.it