Programming Project #3CS-4513, D-Term 20071 Programming Project #3 Simple Web Server CS-4513 D-Term 2007 (Slides include materials from Operating System.

Slides:



Advertisements
Similar presentations
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Advertisements

COEN 445 Communication Networks and Protocols Lab 4
Skills: none Concepts: protocol, hypertext transfer protocol, standard This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike.
Fun Fun Project One1 Building Your Very Own Web Server.
Networks & Communications CS-4513, D-Term Networks & Communication (continued) CS-4513 Distributed Computing Systems (Slides include materials from.
More on Replication and Consistency CS-4513, D-Term More on Replication and Consistency CS-4513 D-Term 2007 (Slides include materials from Operating.
1 HTTP – HyperText Transfer Protocol Part 1. 2 Common Protocols In order for two remote machines to “ understand ” each other they should –‘‘ speak the.
1 Java Networking – Part I CS , Spring 2008/9.
Election AlgorithmsCS-4513 D-term Election Algorithms CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts,
Project 2CS-4513, D-Term Programming Project #2 Distributed Game of Life Due Tuesday, April 10.
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
NamingCS-4513, D-Term Naming CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz,
Project 1CS-3013 A-term Programming Project #1 Forking Processes Due Tuesday, September 8, 11:59 PM.
Programming project #4 1 CS502 Spring 2006 Programming Project #4 Web Server CS-502 Operating Systems Spring 2006.
More on AuthenticationCS-4513 D-term More on Authentication CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Replication and Consistency CS-4513 D-term Replication and Consistency CS-4513 Distributed Computing Systems (Slides include materials from Operating.
1 Web Search Interfaces. 2 Web Search Interface Web search engines of course need a web-based interface. Search page must accept a query string and submit.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
CS 142 Lecture Notes: HTTPSlide 1 HTTP Request GET /index.html HTTP/1.1 Host: User-Agent: Mozilla/5.0 Accept: text/html, */* Accept-Language:
NamingCS-4513, D-Term Naming CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz,
CS-3103 & CS-502, Summer 2006 Programming Project #31 Programming Project #3 Web Server CS-3103 & CS-502 Operating Systems.
Project 1 Web client and server EECS 340 Jan 2009.
Project 1CS-4513, D-Term Programming Project #1 Concurrent Game of Life Due Friday, March 20.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
More on Replication and Consistency CS-4513 D-term More on Replication and Consistency CS-4513 Distributed Computing Systems (Slides include materials.
Rensselaer Polytechnic Institute CSC-432 – Operating Systems David Goldschmidt, Ph.D.
University of Calgary – CPSC 441 Parts of these slides are courtesy of Erich Nahum (IBM Research)
Distributed Computing Systems Project 2 – Distributed Shell Due: Friday, April 4 th.
Web Servers1-1 Web Servers Xingquan (Hill) Zhu
HTTP Protocol Specification
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.
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 application architecture
WebServer A Web server is a program that, using the client/server model and the World Wide Web's Hypertext Transfer Protocol (HTTP), serves the files that.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Project 1, Command Shell CS-502 (EMC) Fall Programming Project #1 Command Shell CS-502, Operating Systems EMC, Fall 2009 (Slides include materials.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
1 Introductory material. This module illustrates the interactions of the protocols of the TCP/IP protocol suite with the help of an example. The example.
CS 241 Section (04/19/12). MP8  Web Server  Due: Tuesday, May 1 st, 11:59pm  What will you be doing?  Creating a web-server in C that serves HTML.
Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.
1 Welcome to CSC 301 Web Programming Charles Frank.
Proxy Lab Recitation I Monday Nov 20, 2006.
Web Spiders Dan Reeves Bill Walsh HDIW EECS February 2000.
1 CS 4396 Computer Networks Lab TCP/IP Networking An Example.
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
A Little Bit About Cookies Fort Collins, CO Copyright © XTR Systems, LLC A Little Bit About Cookies Instructor: Joseph DiVerdi, Ph.D., M.B.A.
WEB SERVER Mark Kimmet Shana Blair. The Project Web Server Application  Receives request for web pages or images from a client browser via the internet.
HTTP How the Internet servers and clients communicate.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
HTTP Here, we examine the hypertext transfer protocol (http) – originally introduced around 1990 but not standardized until 1997 (version 1.0) – protocol.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Overview of Servlets and JSP
MapReduceCS-4513 D-term MapReduce CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz,
1 Introductory material. This module illustrates the interactions of the protocols of the TCP/IP protocol suite with the help of an example. The example.
CLIENT (Browser) socket accept C1 C2 recv C2 recv send C2 send end_thread recv C3 send bind connect Web Server Proxy recv close C3 close C2 end_thread.
Network Programming. These days almost all devices.
HTTP – An overview.
Computing with C# and the .NET Framework
TCP/IP Networking An Example
Client/Server Example
Application layer Lecture 7.
Programming Project #1 Command Shell
Networks & Communication (continued)
Programming Project #1 Fork and Command Shell
HTTP Hypertext Transfer Protocol
Project 1 Professor Breecher
Presentation transcript:

Programming Project #3CS-4513, D-Term Programming Project #3 Simple Web Server CS-4513 D-Term 2007 (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz, Galvin, & Gagne, Modern Operating Systems, 2 nd ed., by Tanenbaum, and Distributed Systems: Principles & Paradigms, 2 nd ed. By Tanenbaum and Van Steen)

Programming Project #3CS-4513, D-Term Goal —Simple Multi-threaded Web Server Capable of serving up real web pages Interpreting (a subset of) HTTP protocol Run on CCC machines Also, a web client for debugging purposes

Programming Project #3CS-4513, D-Term Operation % webserver port# [verbose | basic] Create socket, bind to your port# Listen on socket for connection requests In a loop Wait for and accept() connection Spawn a thread to handle connection Repeat …

Programming Project #3CS-4513, D-Term Operation (continued) … Spawned thread must Read client’s request from socket Find file, deliver to client via the socket –(or respond with error indication) Close connection and terminate

Programming Project #3CS-4513, D-Term Two HTTP “rules” Prefix directory name to all files:– –If user asks your server for –… it supplies /admissions.html (WPI’s web pages are on /www/docs ) If name ends in “/” or resolves to directory Append “ index.html ” to path name Note: it does not hurt to have extra “/” characters

Programming Project #3CS-4513, D-Term Mini-primer on HTTP GET request looks like:– GET /index-t.html HTTP/1.0 Connection: Keep-Alive User-Agent: Mozilla/4.7 [en] (X11; U; SunOS 5.7 sun4u) Host: ccc1.wpi.edu:4242 Accept: image/gif, image/x-xbitmap, image/jpeg, image/png, */* Accept-Encoding: gzip Accept-Language: en Accept-Charset: iso ,*,utf-8 You need only to –Interpret “ GET ” commands –HTTP/1.0 –Recognize end of header – CR/LF (i.e., \r\n )

Programming Project #3CS-4513, D-Term Responses HTTP/ OK\r\n\r\n Followed by the page itself or HTTP/ Not Found\r\n\r\n Many HTTP references on the web. –For tutorial, see

Programming Project #3CS-4513, D-Term Testing webclient host port# web-page Send a simple HTTP request to {host, port} Prints out the response verbose & basic arguments on webserver Prints out detailed or summary requests and responses to standard out

Programming Project #3CS-4513, D-Term Multi-threading You must demonstrate that your server correctly handles concurrent requests in a multi-threaded way –E.g., adapt webclient to take multiple arguments, spawn separate threads, and Show from debug logs that requests are interleaved

Programming Project #3CS-4513, D-Term Extra-credit Modify your server to support persistent connections I.e., either HTTP v1.1 or Connection: Keep-Alive At end of request, Do not close connection Do not terminate thread Terminate After timeout Connection: close

Programming Project #3CS-4513, D-Term Project Submission Due Friday, April 27, 2007 Via myWPI Zip files together to -Project3.zip Individual project However, you may discuss HTTP protocol with each other Share discussions by with class

Programming Project #3CS-4513, D-Term Grading Submission via myWPI — 5% Successful make on CCC machines — 5% No warnings Clear, cogent, write-up — 15% Successful operation of webserver on CCC — 25% Fetch WPI web pages with standard browser Successful operation of webclient — 25% Fetch WPI web pages from standard server Successfully demonstrate that server supports more than two concurrent HTTP requests at once — 25%

Programming Project #3CS-4513, D-Term Extra Credit Modify webserver to support multiple, concurrent, persistent web connections at one time — 50% Demonstrate that it does