Web Server Design Week 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/17/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

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.
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.
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.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/10/10.
Java Technology and Applications
FTP (File Transfer Protocol) & Telnet
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.
Application Layer 2 Figures from Kurose and Ross
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 Server Design Week 1 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 1/13/10.
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.
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 7 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/24/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 10 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/17/10.
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 15 Old Dominion University Department of Computer Science CS 495/595 Spring 2009 Michael L. Nelson 4/20/09.
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.
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 11 Old Dominion University
Web Server Design Week 7 Old Dominion University
Web Server Design Assignment #5 Extra Credit
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 Assignment #2: Conditionals & Persistence
Web Server Design Week 8 Old Dominion University
Web Server Design Week 8 Old Dominion University
Web Server Design Assignment #2: Conditionals & Persistence
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 11 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 16 Old Dominion University
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 Assignment #5 Extra Credit
Web Server Design Week 3 Old Dominion University
Web Server Design Week 3 Old Dominion University
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 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/17/10

GET Client Origin Server GET /foo.pdf HTTP/1.1 HTTP/ OK

Partial GET “The partial GET method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed without transferring data already held by the client.” section 9.3, RFC-2616 Client Origin Server GET /foo.pdf HTTP/1.1 Range: HTTP/ Partial Content GET /foo.pdf HTTP/1.1 Range: HTTP/ Partial Content GET /foo.pdf HTTP/1.1 Range:

Server Signaling to the Client The server tells the client it does/does not support partial GETs on a particular URI through the “Accept-Ranges” header – “bytes” or “none” –section 14.5 A client can request partial GETs without a signal from the server, but the client must be prepared for the server to say no: –Accept-Ranges: none AIHT:~/Desktop/cs595-s06 mln$ telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/teaching/cs595-s06/a1-test/1/ HTTP/1.1 Host: HTTP/ OK Date: Sun, 12 Feb :59:01 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 1936 Content-Type: text/html X-Pad: avoid browser bug Connection closed by foreign host.

Client Requesting a Range “Range:” header –section –server MAY ignore the header 200 vs. 206 tells the story Byte range examples (section ): Examples of byte-ranges-specifier values (assuming an entity-body of length 10000): - The first 500 bytes (byte offsets 0-499, inclusive): bytes= The second 500 bytes (byte offsets , inclusive): bytes= The final 500 bytes (byte offsets , inclusive): bytes= Or bytes= The first and last bytes only (bytes 0 and 9999): bytes=0-0,-1 - Several legal but not canonical specifications of the second 500 bytes (byte offsets , inclusive): bytes= , bytes= ,

Server Response: 206 Partial Content Response Code & Headers Content-Range, Content-Length Server responds with: – HTTP/ Partial Content The “Content-Length” response header is now the number of bytes in this response, not the number of bytes in the entire entity “Content-Range” header is present –Content-Range: bytes start-end/total

Long-Lived Session AIHT:~/Desktop/cs595-s06 mln$ telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=0-9 HTTP/ Partial Content Date: Sun, 19 Feb :59:31 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 10 Content-Range: bytes 0-9/1936 Content-Type: text/html <he GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=10-19 HTTP/ Partial Content Date: Sun, 19 Feb :59:42 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 10 Content-Range: bytes 10-19/1936 Content-Type: text/html ad> <title GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=20-29 HTTP/ Partial Content Date: Sun, 19 Feb :59:52 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 10 Content-Range: bytes 20-29/1936 Content-Type: text/html > Michael Connection closed by foreign host. (line breaks added after entity data for clarity)

Same Sesssion, Pipelined AIHT:~/Desktop/cs595-s06 mln$ telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=0-9 GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=10-19 GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=20-29 Connection: close HTTP/ Partial Content Date: Mon, 20 Feb :11:58 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 10 Content-Range: bytes 0-9/1936 Content-Type: text/html <heHTTP/ Partial Content Date: Mon, 20 Feb :11:58 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 10 Content-Range: bytes 10-19/1936 Content-Type: text/html ad> <titleHTTP/ Partial Content Date: Mon, 20 Feb :11:58 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 10 Content-Range: bytes 20-29/1936 Connection: close Content-Type: text/html > Michael Connection closed by foreign host. (no line breaks added)

Requesting a Range that Exceeds the Entity Size AIHT:~/Desktop/cs595-s06 mln$ telnet 80 | tee 7-3.out Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes= Connection: close HTTP/ Partial Content Date: Mon, 20 Feb :19:05 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 1936 Content-Range: bytes /1936 Connection: close Content-Type: text/html [rest of html deleted]

Conditional Request: If-Range Combine two requests into one: –“return the entire entity if the ETag/date specified would fail the If-Match / If-Unmodified- Since condition” –section Combine with “Range:” header –server MUST ignore If- Range if the Range header missing Pass in ETag or date –If-Range: 1f4de dd0cc3 –If-Range: Sun, 29 Jan :43:15 GMT AIHT:~/Desktop/cs595-s06 mln$ telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=0-9 If-Range: Sun, 30 Jan :43:15 GMT Connection: close Connection closed by foreign host. HTTP/ OK Date: Mon, 20 Feb :25:03 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 1936 Connection: close Content-Type: text/html [rest of html deleted]

Response Code 416 Requested Range Not Satisfiable AIHT:~/Desktop/cs595-s06 mln$ telnet 80 | tee 7-6.out Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes= Connection: close HTTP/ Requested Range Not Satisfiable Date: Mon, 20 Feb :52:07 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 0 Content-Range: bytes */1936 Connection: close Content-Type: text/html section

Ignore Syntactically Invalid Range Headers (Apache 1.3.X) “The recipient of a byte-range- set that includes one or more syntactically invalid byte-range- spec values MUST ignore the header field that includes that byte-range-set.” –section AIHT:~/Desktop/cs595-s06 mln$ telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=aldksjfalsdjfl Connection: close HTTP/ OK Date: Mon, 20 Feb :57:36 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "1f4de dd0cc3" Accept-Ranges: bytes Content-Length: 1936 Connection: close Content-Type: text/html [rest of html deleted]

Ignore Syntactically Invalid Range Headers ??? (Apache 2.2.X) % telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=aldksjfalsdjfl Connection: close HTTP/ Requested Range Not Satisfiable Date: Mon, 19 Feb :07:24 GMT Server: Apache/2.2.0 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso Requested Range Not Satisfiable Requested Range Not Satisfiable None of the range-specifier values in the Range request-header field overlap the current extent of the selected resource. Apache/2.2.0 Server at Port 80 0 Connection closed by foreign host.

(Scratchpad) GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=0-9 GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=10-19 GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=20-29 Connection: close GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes= Connection: close GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=0-9 If-Range: Sun, 29 Jan :43:15 GMT Connection: close GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes= Connection: close GET /~mln/teaching/cs595-s06/a1-test/2/index.html HTTP/1.1 Host: Range: bytes=aldksjfalsdjfl Connection: close