Professional Documents
Culture Documents
Prof. Reuven Aviv Tel Hai Academic College Department of Computer Science Topics in Data Communication
The World Wide Web Architectural Overview Static Web Documents Dynamic Web Documents HTTP The HyperText Transfer Protocol Content Delivery Networks
1/31/2008
Architectural Overview
Architectural Overview
Client with Web browser program Server with Web Server and pages (html) Other servers with Web Servers and pages Links between pages
1/31/2008
Browser Operation when User clicks on a link B picks the URL from the clicked link B gets IP address of Web server from DNS B open TCP connection to the (IP, port 80) B sends a request for page (HTTP packet) W.S. sends the linked page (HTTP packet) Page is in html language B. closes TCP connection B. interpret html, displays page to user B fetches & presents images linked to the file
Plug-in
Helper Application
1/31/2008
Server Side
Accepts TCP connection Gets name of requested file (HTTP packet) Gets the file (local disk) Sends back the file (HTTP packets) Release TCP connection To improve performance Maintain cache of files Multithreading
1/31/2008
Tasks of a Working Thread Resolving name of the file Authenticating client (another lecture) Perform access control on client Check the cache Fetch file from disk Determine MIME type of file This will be sent to the client Send reply to client Construct HTTP packet(s) Write in the Web Server log
Problems Each Processing Node has its own cache P.N. specialize with certain files Both requests and replies via the Front-end
Solution?
1/31/2008
TCP Handoff
Front-end passes the TCP endpoint (IP, port) to the Processing Node Processing Node send page to Client
Normal
TCP Handoff
? ?
1/31/2008
Cookies: Structure domain: where the cookie came from Path: root of the file tree related to cookie Content: variableName=value pairs. Anything Expires if set it is kept (persistent cookie) Secure: If set cookie is sent only to secure server
Usages?
1/31/2008
Using cookies
Casino server chooses which gambling option it presents Store Server puts items in cart in the cookie Web Portal server presents stock prices and Sport results sneaky.com records visits of UserID in certain pages pages include adds/banners/small pictures User not aware its browser visited sneaky.com User profile is built, maybe with name/password
1/31/2008
(b)
Text with markups instructions (formatting, links,) Instructions in form of pair of tags <h2> </h2>
1/31/2008
HTML Table
10
1/31/2008
Browser presents a web page with a form User fill the form Browser stores User inputs in variables Browser send the information via HTTP
(b)
11
1/31/2008
Browser Response
A possible response from the browser to the server with information filled in by the user. A string of name=value
Server passes the string to back-end script for processing (e.g. Perl script) Script writes to DB, might create new page
12
1/31/2008
Hierarchical Structure We define a structure, named book_list Book_list: a list of three structures named book Book: three fields, each with name & value
13
1/31/2008
XSL
Pure html
14
1/31/2008
Server Side Dynamic pages: Embedded PHP Web server calls the PHP interpreter before downloading test.php Web Server maintains info about the browser (OS type, ..) in the variable HTTP_USER_AGENT Php re-writes the page, inserting the value of HTTP_USER_AGENT
15
1/31/2008
16
1/31/2008
17
1/31/2008
HTTP Protocol
18
1/31/2008
19
1/31/2008
Caching
20
1/31/2008
21
1/31/2008
22
1/31/2008
HTTP Messages
23
1/31/2008
Server: Apache/1.3.20 (Unix) mod_ssl/2.8.4 /Response Hdr Last-Modified: Mon, 11 Sep 2000 13:56:29 GMT//Entity Headers ETag: 2a79d-c8b-39bce48d Accept-Ranges: bytes Content-length:3211 Content-Type: text/html X-pad: avoid browser bug <html> .. // non standard field //page id, used in caching //express range in bytes
Conditional GET (1) GET /fruit/kiwi.gif HTTP/.0 User-agent: Mozilla/4.0 HTTP/1.0 200 OK Date: Wed, 1 Aug 199815:39:29 Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 June 1998 09:23:24 Content-Type: image/gif (data)
24
1/31/2008
HTTP1.1 Methods
25
1/31/2008
Request Headers
User-Agent Accept Host Authorization Cookie # Date Upgrade suggest switch to another version Info about the browser (OS) Type of pages client can handle The server DNS name client credentials (e.g. passwd) Cookie that was received before
26
1/31/2008
Response Headers
Server Info about the Server Content-Encoding; Content-Length; Content-Language; Content-Type (MIME type) Last-Modified Location commanding client to go elsewhere Accept-Ranges The server will accept byte range requests Set-Cookie # Please save attached cookie with number # Date Upgrade
Entity Body
entity body is an arbitrary sequence of octets HTTP can transfer any type of data including: text, binary data, audio, images, video data is content of resource identified by URL interpretation data determined by header fields: Content-Type - defines data interpretation Content-Encoding - applied to data Transfer-Encoding - used to form entity body
27
1/31/2008
28
1/31/2008
29
1/31/2008
Example (Contd) User types www.furryvideo.com, gets to main page of the Content Provider FurryVideo User clicks on content item Client sends Request to the cdn-server.com cdn-Server identifies (from file name) which object is required, and from IP address of user, which CDN servers is the closest to the Client cdn-server sends response to client with status code 301 and Location header, giving the files URL on a content server close to the client Client connects to the CDN content-server
30