Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 02/07/12.

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

HTTP Exercise 01. Three Internet Protocols IP TCP HTTP Routes messages thru “Inter-network “ 2-way Connection between programs on 2 computers So they.
Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/10/10.
FTP (File Transfer Protocol) & Telnet
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
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
Week 11: Application Layer1 Web and HTTP First some jargon r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,…
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.
Web Programming Week 1 Old Dominion University Department of Computer Science CS 418/518 Fall 2010 Martin Klein 8/31/10.
1 HTTP EECS 325/425, Fall 2005 September Chapter 2: Application layer r 2.1 Principles of network applications m app architectures m app requirements.
Web Server Design Week 8 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/3/10.
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.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
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 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.
LURP Details. LURP Lab Details  1.Given a GET … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
Web Server Design Week 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/17/10.
Week 11: Application Layer 1 Web and HTTP r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,… r Web page consists.
WEB1P webarch1 Web architecture Dr Jim Briggs. WEB1P webarch2 What is the web? Distributed system Client-server system Characteristics of clients and.
Web Server Design Week 10 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/17/10.
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
CS 5565 Network Architecture and Protocols
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 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
Web Server Design Week 16 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 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 02/07/12

History… In the prehistoric days, we used “inetd” to start net services – image from:

Latency in HTTP/1.0 image size = 2.5k image size = 45k Figs 6-1 & 6-2 from Padmanabhan & Mogul, “Improving HTTP Latency”,Proceedings of 2nd WWW Conference,

HTTP/1.0 Keep-Alive In the very early days, web pages had few images, so 1 TCP connection per URL was not so bad HTTP/1.0 –Keep-Alive extension added (but unevenly supported) to say “don’t hang up” –see Roy Fielding's early note: http/hypermail/1995q4/0063. htmlhttp://ftp.ics.uci.edu/pub/ietf/ http/hypermail/1995q4/0063. html image from:

HTTP/1.1 Keep-Alive is Default HTTP/1.1 –Persistent connections (as they are now called) are the norm see section , RFC 2068; section , RFC 2616 –you now have to specify a non-persistent connection with Connection: close –adsf

Old Headers Die Hard… (FF 9.0.1)

Long-Lived Connections If the client does not send a “Connection: close” header, the server can assume the client wishes to maintain the TCP connection If the server sends a “Connection: close” header, the session is over

Long-Lived Connections AIHT:~/Desktop/cs595-s06 mln$ telnet 80 | tee 6-1.out Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/teaching/cs595-s06/a1-test/ HTTP/1.1 Host: HTTP/ OK Date: Sun, 12 Feb :58:49 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Content-Type: text/html HEAD /~mln/teaching/cs595-s06/a1-test/1/ HTTP/1.1 Host: HTTP/ OK Date: Sun, 12 Feb :58:55 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Content-Type: text/html HEAD /~mln/teaching/cs595-s06/a1-test/2/ 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. response request response request response request

Pipelining Requests Section “A client that supports persistent connections MAY "pipeline" its requests (i.e., send multiple requests without waiting for each response). A server MUST send its responses to those requests in the same order that the requests were received.”

Pipelined Requests AIHT:~/Desktop/cs595-s06 mln$ telnet 80 | tee 6-2.out Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/teaching/cs595-s06/a1-test/ HTTP/1.1 Host: HEAD /~mln/teaching/cs595-s06/a1-test/1/ HTTP/1.1 Host: HEAD /~mln/teaching/cs595-s06/a1-test/2/ HTTP/1.1 Host: HTTP/ OK Date: Sun, 12 Feb :08:44 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Content-Type: text/html HTTP/ OK Date: Sun, 12 Feb :08:44 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Content-Type: text/html HTTP/ OK Date: Sun, 12 Feb :08:44 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. 3 requests 3 responses

Error Responses in Pipeline AIHT:~/Desktop/cs595-s06 mln$ telnet 80 | tee 6-3.out Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/teaching/cs595-s06/a1-test/ HTTP/1.1 Host: HEAD /~mln/teaching/cs595-s06/a1-test/XASDFASDASDF/ HTTP/1.1 Host: HEAD /~mln/teaching/cs595-s06/a1-test/2/ HTTP/1.1 Host: HTTP/ OK Date: Sun, 12 Feb :19:37 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Content-Type: text/html HTTP/ Not Found Date: Sun, 12 Feb :19:37 GMT Server: Apache/ (Unix) ApacheJServ/1.1.2 PHP/4.3.4 Content-Type: text/html; charset=iso HTTP/ OK Date: Sun, 12 Feb :19:38 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. this error does not terminate the session

Error Responses in Pipeline (2) % telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/teaching/cs595-s06/a1-test/ HTTP/1.1 Host: POST /~mln/teaching/cs595-s06/a1-test/ HTTP/1.1 Host: HEAD /~mln/teaching/cs595-s06/a1-test/2/ HTTP/1.1 Host: HTTP/ OK Date: Mon, 06 Feb :27:35 GMT Server: Apache/ (Unix) PHP/5.3.5 mod_ssl/ OpenSSL/0.9.8q Content-Type: text/html;charset=ISO HTTP/ Not Found Date: Mon, 06 Feb :27:35 GMT Server: Apache/ (Unix) PHP/5.3.5 mod_ssl/ OpenSSL/0.9.8q Content-Length: 348 Content-Type: text/html; charset=iso Not Found [deletia] HTTP/ OK Date: Mon, 06 Feb :27:35 GMT Server: Apache/ (Unix) PHP/5.3.5 mod_ssl/ OpenSSL/0.9.8q Last-Modified: Sun, 29 Jan :43:15 GMT ETag: "790-40b83b3fa76c0" Accept-Ranges: bytes Content-Length: 1936 Content-Type: text/html Connection closed by foreign host. this error does not terminate the session (and why is it 404?!)

Error Responses in Pipeline (3) Connected to xenon.cs.odu.edu. Escape character is '^]'. HEAD /~mln/teaching/cs595-s06/a1-test/ HTTP/1.1 Host: NOTAMEHTOD /~mln/teaching/cs595-s06/a1-test/ HTTP/1.1 Host: HEAD /~mln/teaching/cs595-s06/a1-test/2/ HTTP/1.1 Host: HTTP/ OK Date: Mon, 06 Feb :25:41 GMT Server: Apache/ (Unix) PHP/5.3.5 mod_ssl/ OpenSSL/0.9.8q Content-Type: text/html;charset=ISO HTTP/ Method Not Implemented Date: Mon, 06 Feb :25:41 GMT Server: Apache/ (Unix) PHP/5.3.5 mod_ssl/ OpenSSL/0.9.8q Allow: GET,HEAD,POST,OPTIONS Content-Length: 362 Connection: close Content-Type: text/html; charset=iso Method Not Implemented Method Not Implemented NOTAMEHTOD to /~mln/teaching/cs595-s06/a1-test/ not supported. Apache/ (Unix) PHP/5.3.5 mod_ssl/ OpenSSL/0.9.8q Server at Port 80 Connection closed by foreign host. this error does terminate the session

Timeout Not Specified in RFC-2616 KeepAliveTimeout Directive Description:Amount of time the server will wait for subsequent requests on a persistent connection Syntax:KeepAliveTimeout seconds Default:KeepAliveTimeout 15 Context:server config, virtual host Status:Core Module:core The number of seconds Apache will wait for a subsequent request before closing the connection. Once a request has been received, the timeout value specified by the Timeout directive applies. Setting KeepAliveTimeout to a high value may cause performance problems in heavily loaded servers. The higher the timeout, the more server processes will be kept occupied waiting on connections with idle clients.

Apache Gives a 400 on Timeout % telnet 80 Trying Connected to xenon.cs.odu.edu. Escape character is '^]'. GET / HTTP/1.1 Host: HTTP/ Bad Request Date: Mon, 06 Feb :56:12 GMT Server: Apache/ (Unix) PHP/5.3.5 mod_ssl/ OpenSSL/0.9.8q Content-Length: 344 Connection: close Content-Type: text/html; charset=iso Bad Request Bad Request Your browser sent a request that this server could not understand. Apache/ (Unix) PHP/5.3.5 mod_ssl/ OpenSSL/0.9.8q Server at Port 80 Connection closed by foreign host. After waiting the timeout value, Apache just gives up and sends a 400

Why Not a 408? Request Timeout The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time. I haven't seen a 408 in the wild, but I've updated A2 for us to include one

Directory Listings

Fancy Directory Listings % pwd /home/mln/public_html/teaching/cs595-s12/etag-test % cat.htaccess FileETag INode MTime Size IndexOptions FancyIndexing AddDescription "Click me ! Forget the other files!" bar3.txt