Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Collection of millions of files stored on thousands of servers all over the world. The components required to make a web are Structural Components
- Web Server - Web Client - Internet
Semantic Components
Well defined set of Languages Protocols Uniform Resource Locators (URLs)
Contd
Languages
HTML (Hyper Text Markup Language) XML (eXtensible Markup Language ) JAVA JAVA Script VRML (Virtual Reality Modeling Language)
Protocols
- Hyper Text Transfer Protocol (HTTP)
URLs
- Naming of Web Pages
WWW Background
1989-1990 - Tim Berners-Lee invented the World Wide Web
W3C
--
1994
protocol
host name
path name
WWW Structure
Clients use browser to send URLs via HTTP to servers requesting a Web page Web pages constructed using HTML (or other markup language) and consist of text, graphics, sounds etc. Servers respond to the clients with the requested Web page or with an error message
such syuhhow howget gtw his hsio if iart ertage ag ty ty gun ghntee ty we we ghty ghty syuh how gtw chid chdiawl qw oat oatyf hsio wet wetdeli dfla get ght a a i ert ag ty ghn ty we ghty chdi qw oatyf wet dfla ght a
syuh how gtw hsio i ert ag ty ghn ty we ghty syuh how gtw gtw chdi syuh qw oatyf how hsioght ert ag ty ty wet dfla hsio ii ert a ag ghn ty ty we we ghty ghty ghn chdi qw oatyf chdi qw syuh oatyf how gtw wet dfla dfla ght a ag ty wet hsioght i ert a
browser displays it
Contd
HTTP overview
HTTP: hypertext transfer protocol
Webs application layer
protocol client/server model client: browser that requests, receives, displays Web objects server: Web server sends objects in response to requests
PC running Explorer
HTTP is stateless
server maintains no
connection (creates socket) to server, port 80 server accepts TCP connection from client HTTP messages (applicationlayer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server) TCP connection closed
Protocols that maintain state are complex! past history (state) must be maintained if server/client crashes, their views of state may be inconsistent, must be reconciled
aside
Client Side
Steps when link is selected Eg: http://www.sitams.org/btech/ece.html
- The browser determines the URL - The browser asks DNS for IP address of www.sitams.org - DNS replies with IP address - The browser makes a TCP connection on the IP address - It then sends over a request asking for the file /btech/ece.html - The www. sitams.org server sends the file /btech/ece.html - TCP connection is released - The browser fetches and displays all the text and images in the file
Server Side
Steps the Server performs when a link is selected
- Accept the TCP connection from the client - Get the name of the file requested - Get the file from the disk - Return the file to the client - Release the TCP connection
Protocol - HTTP
Protocol for client/server communication
Very simple request/response protocol Client sends request message, server replies with response message
Contd
HTTP/0.9
- Transfer of Raw data across the Internet
HTTP/1.0
- It is a stop and wait protocol - Provides messages in Multipurpose Internet Mail Extension (MIME) types - Separate TCP connection for each file
HTTP connections
Nonpersistent HTTP At most one object is sent over a TCP connection. Persistent HTTP Multiple objects can be sent over single TCP connection between client and server.
Nonpersistent HTTP
Suppose user enters URL www.sitams.org/ece/home.index
1a. HTTP client initiates TCP
(contains text, references to 10 jpeg images)
www.sitams.org waiting for TCP connection at port 80. accepts connection, notifying client
time
RTT
request file RTT file received time
time
Persistent HTTP
Nonpersistent HTTP issues: requires 2 RTTs per object OS overhead for each TCP connection browsers often open parallel TCP connections to fetch referenced objects Persistent HTTP server leaves connection open after sending response subsequent HTTP messages between same client/server sent over open connection client sends requests as soon as it encounters a referenced object as little as one RTT for all the referenced objects
body
Web servers construct and send response messages Typical HTTP response:
- HTTP/1.0 301 Moved Permanently Location: http://www.sitams.org/ece/faculty/index.html
HTTP Headers
Both requests and responses contain a variable number of header fields
Consists of field name, colon, space, field value 17 possible header types divided into three categories
Request Response Body
server
usual http request msg
cookie file
ebay 8734 amazon 1678
Set-cookie: 1678
usual http request msg
entry
cookie: 1678
cookiespecific action
cookiespectific action
access
access
backend database
cookie: 1678
Cookies (continued)
What cookies can bring: authorization shopping carts recommendations user session state (Web e-mail) Cookies and privacy: cookies permit sites to learn a lot about you you may supply name and e-mail to sites
aside
How to keep state: protocol endpoints: maintain state at sender/receiver over multiple transactions cookies: http messages carry state
Web accesses via cache browser sends all HTTP requests to cache
client
Proxy server
object in cache: cache returns object else cache requests object from origin server, then returns object to client
client
origin server
client and server typically cache is installed by ISP (university, company, residential ISP)
Why Web caching? reduce response time for client request reduce traffic on an institutions access link. Internet dense with caches: enables poor content providers to effectively deliver content (but so does P2P file sharing)
Caching example
Assumptions
average object size = 100,000
origin servers
public Internet
bits avg. request rate from institutions browsers to origin servers = 15/sec delay from institutional router to any origin server and back to router = 2 sec
Consequences
utilization on LAN = 15%
utilization on access link = 100% total delay
institutional cache
origin servers
public Internet
consequence
utilization on LAN = 15% utilization on access link = 15% Total delay
= Internet delay + access delay + LAN delay = 2 sec + msecs + msecs often a costly upgrade
institutional cache
origin servers
public Internet
consequence
satisfied almost immediately 60% requests satisfied by origin server utilization of access link reduced to 60%, resulting in negligible delays (say 10 msec) total avg delay = Internet delay + access delay + LAN delay = .6*(2.01) secs + .4*milliseconds < 1.4 secs
institutional cache
Conditional GET
Goal: dont send object if
cache
HTTP request msg
If-modified-since: <date>
server
object not modified
cache has up-to-date cached version cache: specify date of cached copy in HTTP request
If-modified-since: <date>
server: response contains no
HTTP response
HTTP/1.0 304 Not Modified
HTTP response
HTTP/1.0 200 OK
object modified
<data>
file transfer
FTP server
remote file system
user at host
remote) server: remote host ftp: RFC 959 ftp server: port 21
at port 21, TCP is transport protocol TCP data connection FTP FTP port 20 client authorized over control client server connection client browses remote server opens another TCP directory by sending commands data connection to transfer over control connection. another file. when server receives file control connection: out of transfer command, server band opens 2nd TCP connection (for FTP server maintains state: file) to client current directory, earlier after transferring one file, authentication server closes data connection.
in HTTP) 331 Username OK, password required 125 data connection already open; transfer starting 425 Cant open data connection 452 Error writing file