Web Server Design Week 7 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/24/10.

Slides:



Advertisements
Similar presentations
HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
Advertisements

Web basics HTTP – – URI/L/Ns – HTML –
16-Jun-15 HTTP Hypertext Transfer Protocol. 2 HTTP messages HTTP is the language that web clients and web servers use to talk to each other HTTP is largely.
HTTP Headers. Read these slides yourselves This set of slides explains the header fields which are pre-defined in HTTP/1.1 Read these slides yourselves.
How the web works: HTTP and CGI explained
The abs_path in a URI If the abs_path is not present in the URL, it must be given as "/" in a Request-URI for a resource. Thus, if a user points a browser.
HTTP Exercise 01. Three Internet Protocols IP TCP HTTP Routes messages thru “Inter-network “ 2-way Connection between programs on 2 computers So they.
Hypertext Transfer Protocol Information Systems 337 Prof. Harry Plantinga.
The abs_path in a URI If the abs_path is not present in the URL, it must be given as "/" in a Request-URI for a resource. Thus, if a user points a browser.
Hypertext Transport Protocol CS Dick Steflik.
Rensselaer Polytechnic Institute CSC-432 – Operating Systems David Goldschmidt, Ph.D.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/10/10.
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CSC 2720 Building Web Applications Getting and Setting HTTP Headers (With PHP Examples)
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
Web Server Design Week 14 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 4/14/10.
The HyperText Transfer Protocol. History HTTP has been in use since 1990 (HTTP/0.9) HTTP/1.0 was defined in RFC 1945 (May 1996) and included metainformation.
Web Programming Week 1 Old Dominion University Department of Computer Science CS 418/518 Fall 2010 Martin Klein 8/31/10.
Web Server Design Week 8 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/3/10.
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
Web Server Design Week 4 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/03/10.
Web Server Design Assignment #1: Basic Operations Due: 02/03/2010 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin.
Web Server Design Week 11 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/24/10.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
Web Server Design Assignment #2: Conditionals & Persistence Due: 02/24/2010 Old Dominion University Department of Computer Science CS 495/595 Spring 2010.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
Web Server Design Week 2 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 1/20/10.
Web Server Design Week 13 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 4/7/10.
HTTP Here, we examine the hypertext transfer protocol (http) – originally introduced around 1990 but not standardized until 1997 (version 1.0) – protocol.
Web Server Design Week 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/17/10.
Web Server Design Assignment #3: Transfer Encoding & Content Negotiation Due: 03/24/2010 Old Dominion University Department of Computer Science CS 495/595.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 02/07/12.
Web Programming Week 1 Old Dominion University Department of Computer Science CS 418/518 Fall 2007 Michael L. Nelson 8/27/07.
Web Server Design Week 1 Old Dominion University Department of Computer Science CS 495/595 Spring 2006 Michael L. Nelson 1/09/06.
Web Server Design Week 13 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 04/03/12.
Web Server Design Week 3 Old Dominion University Department of Computer Science CS 495/595 Spring 2006 Michael L. Nelson 1/23/06.
Web Server Design Week 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2006 Michael L. Nelson 2/13/06.
What’s Really Happening
HTTP – An overview.
Web Server Design Week 10 Old Dominion University
Web Server Design Week 4 Old Dominion University
Web Server Design Assignment #2: Conditionals & Persistence
Web Server Design Week 8 Old Dominion University
Web Server Design Week 7 Old Dominion University
HTTP Protocol.
Web Server Design Week 4 Old Dominion University
Web Server Design Week 15 Old Dominion University
Web Server Design Week 5 Old Dominion University
Web Server Design Week 8 Old Dominion University
Web Server Design Week 8 Old Dominion University
Web Server Design Week 6 Old Dominion University
Web Server Design Week 10 Old Dominion University
Web Server Design Week 8 Old Dominion University
Web Server Design Week 3 Old Dominion University
Web Server Design Week 5 Old Dominion University
Web Server Design Week 3 Old Dominion University
Web Server Design Week 4 Old Dominion University
HTTP Hypertext Transfer Protocol
Web Server Design Week 12 Old Dominion University
Web Server Design Week 12 Old Dominion University
Web Server Design Week 14 Old Dominion University
Web Server Design Week 6 Old Dominion University
Web Server Design Week 3 Old Dominion University
Web Server Design Week 3 Old Dominion University
Old Dominion University Department of Computer Science
Web Server Design Week 7 Old Dominion University
Web Programming Week 1 Old Dominion University
Web Server Design Week 7 Old Dominion University
Presentation transcript:

Web Server Design Week 7 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/24/10

Encodings gzip –extension:.gz –(sometimes seen as x-gzip) compress –extension:.Z –(sometimes seen as x-compress) deflate –extension:.zip identity –no encoding at all chunked –breaks the body into a series of server-chosen “chunks” –optimization for dynamically produced content

Content Encoding vs. Transfer Encoding Client Origin Server GET /bottle1 HTTP/1.1 HTTP/ OK images from: Content-Encoding Transfer-Encoding

Content-Encodings “Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type.” –section 14.11

Content-Encoding Example (Correct) AIHT:~/Desktop/cs595-s06 mln$ telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/pubs/bollenj_adaptive.ps.gz HTTP/1.1 Host: Connection: close HTTP/ OK Date: Mon, 20 Feb :30:25 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Thu, 25 Jul :58:58 GMT ETag: "1c16-139ea-3d402e52" Accept-Ranges: bytes Content-Length: Connection: close Content-Type: application/postscript Content-Encoding: x-gzip Connection closed by foreign host.

Content-Encoding Example (Incorrect) AIHT:~/Desktop mln$ telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/pubs/bollenj_adaptive.ps.gz HTTP/1.1 Host: Connection: close HTTP/ OK Date: Mon, 26 Feb :06:25 GMT Server: Apache/2.2.0 Last-Modified: Thu, 25 Jul :58:58 GMT ETag: "1c16-139ea-92cab880" Accept-Ranges: bytes Content-Length: Connection: close Content-Type: application/x-gzip Connection closed by foreign host. Wrong, Wrong, Wrong!!!!!!!

Transfer Encodings “Transfer-Encoding is a property of the message, not of the entity, and thus MAY be added or removed by any application along the request/response chain.” –section 4.3

TE Request Header & Transfer-Encoding Response Header Client specifies preferences for transfer encoding in the “TE:” header –section Server marks the encoding used with the “Transfer-Encoding” header –section Both headers use the same encoding values available with “Content-Encoding”, plus the special “chunked” encoding and the “Trailers” keyword

TE & Transfer-Encoding dhcp :~/Desktop/cs595-s06 mln$ telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET / HTTP/1.1 TE: gzip;q=1.0, Trailers Host: HTTP/ OK Date: Mon, 27 Feb :52:33 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Transfer-Encoding: chunked Content-Type: text/html 5f6 [more html deleted]

Time / Space Tradeoff Hard to find examples of compression used in transfer encoding – – –idea: for very heavy volume web servers, answering the request quickly is more important than preserving bandwidth Complexity of management seems to be the limiting factor

Chunked Encoding “The chunked encoding modifies the body of a message in order to transfer it as a series of chunks, each with its own size indicator, followed by an OPTIONAL trailer containing entity-header fields. This allows dynamically produced content to be transferred along with the information necessary for the recipient to verify that it has received the full message.” –sections 3.6.1,

Chunked Encoding Example AIHT:~/Desktop/cs595-s06 mln$ telnet 80 | tee 1-6.out Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET /~mln HTTP/1.1 Connection: close Host: Connection closed by foreign host. HTTP/ Moved Permanently Date: Mon, 09 Jan :32:24 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Location: Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso e 301 Moved Permanently Moved Permanently The document has moved here. Apache/ Server at Port 80 0

Chunked Encoding Example 2 AIHT:~/Desktop/cs595-s06 mln$ telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET / HTTP/1.1 Host: HTTP/ OK Date: Tue, 21 Feb :54:31 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Transfer-Encoding: chunked Content-Type: text/html 5f6 Department Of Computer Science <LINK title=style href="files/style.css" type=text/css rel=stylesheet> [lots of html deleted] [demo this example to see the various “chunks”] 0

Trailer Response Header The “Trailer” response header lets the client know that additional headers will appear at the end of the chunked response –section –headers can be reconstructed by downstream servers –headers that can never be trailers: Transfer-Encoding Content-Length Trailer

Trailer Example HTTP/ OK Date: Mon, 22 Mar :15:03 GMT Content-Type: text/html Content-Length: 129 Expires: Sat, 27 Mar :12:00 GMT The file you requested is 3,400 bytes long and was last modified: Sat, 20 Mar :12:00 GMT. HTTP/ OK Date: Mon, 22 Mar :15:03 GMT Content-Type: text/html Transfer-Encoding: chunked Trailer: Expires 29 The file you requested is 5 3, bytes long and was last modified: 1d Sat, 20 Mar :12:00 GMT Expires: Sat, 27 Mar :12:00 GMT Examples from: “Expires:” response header covered in section 14.21

Two More Request Headers to Process

User-Agent Request Header User-Agent: –section –“This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests.” –examples: User-Agent: CERN-LineMode/2.15 libwww/2.17b3 User-Agent: CS 495/595 Spring 2006 Automated Checker (A3)

Referer Request Header Referer: –section –“The Referer[sic] request-header field allows the client to specify, for the server's benefit, the address (URI) of the resource from which the Request-URI was obtained (the "referrer", although the header field is misspelled.) The Referer request-header allows a server to generate lists of back-links to resources for interest, logging, optimized caching, etc. It also allows obsolete or mistyped links to be traced for maintenance. The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI, such as input from the user keyboard.” –examples: Referer: Referer: /opening-page.php