⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.htm

📁 this gives details of the network programming
💻 HTM
字号:
<HTML><HEAD><TITLE>NetProg Homework 5</TITLE><LINK rel=stylesheet type="text/css" HREF=../../style/proj.css></HEAD><BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0 TOPMARGIN=0  LEFTMARGIN=0><TABLE bgColor=#8899aa border=0 cellPadding=4 cellSpacing=0 width="100%">  <TR>    <TD class=title>&nbsp NetProg 2002 HW5</TD> </TR><TR BGCOLOR=BLACK><TD CLASS=menu> &nbsp &nbsp<A CLASS=menu HREF=#desc>Project Description</A> &nbsp &nbsp |&nbsp &nbsp<A CLASS=menu HREF=#server>Server Variants</A> &nbsp &nbsp |&nbsp &nbsp<A CLASS=menu HREF=#report>Report</A> &nbsp &nbsp |&nbsp &nbsp<A CLASS=menu HREF=#deliv>Deliverables</A> &nbsp &nbsp |&nbsp &nbsp<A CLASS=menu HREF=#grading>Grading</A>  &nbsp &nbsp |&nbsp &nbsp<A CLASS=menu HREF=#submitting>Submission</A> </TD></TR></TABLE><DIV CLASS=page><H2 style="font-size: 16pt; color:black; text-align:center;">Homework 5: Concurrent HTTP Server and performance report<BR>Due Date for Local and live remote students: Fri, April 5th (by11:59PM)<BR>Due Date for Tape and Videostream Delay students: Fri, April 12th</H2><H4 ALIGN=CENTER>Late Penalty: 10 points per day (out of 100)</H4><H4 ALIGN=CENTER>Submit to <I>netprog-submit@cs.rpi.edu</I> with the subject line "5"<BR>Complete Submission instructions are <A HREF=#submitting>here</A></H4><A NAME=desc><HR></A><P>Your assignment is to write an HTTP server that returns a documentwhose size is determined by the request URI. Your server will supporta variety of techniques for providing concurrency, and you will dosome performance measurements to determine which method works best forvarious size requests.</P> <P>The contents of the document can be any HTML document you want, thesize of the document is determined by the requested URI. Your servershould strip the leading slash '<CODE>/</CODE>' from the URI andinterpret the resulting string as a integer (in decimal) thatindicates the size of the document to be sent to the client.</P><P>If the request line looks like this:</P> <CENTER><CODE>GET /1234HTTP/1.0</CODE></CENTER> <P>Your server should send back a documentthat contains exactly 1,234 bytes of text. You should send back avalid HTML document, but the content of the document can be anything.The minimum size requested will be 100 bytes, this minimum means thatyou can always create a valid document (with <CODE>HTML</CODE>,<CODE>HEAD</CODE> and <CODE>BODY</CODE> tags). For example, thefollowing document is 100 bytes long:</P><TABLE BORDER=0 BGCOLOR=CYAN><TR><TD><PRE>&lt;HTML>&lt;HEAD>&lt;TITLE>100 bytes of fun&lt;/TITLE>&lt;/HEAD>&lt;BODY> a a a a a a a a a a a a &lt;/BODY>&lt;/HTML></PRE></TD></TR></TABLE><P>This document is 250 bytes long:</P><TABLE BORDER=0 BGCOLOR=CYAN><TR><TD><PRE>&lt;HTML>&lt;HEAD>&lt;TITLE>250 bytes of fun&lt;/TITLE>&lt;/HEAD>&lt;BODY> a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a &lt;/BODY>&lt;/HTML></PRE></TD></TR></TABLE>  <P>Note that your server must send back an HTTP response line, acontent-type header and a content-length header. None of these counttowards the size of the document.</P><P>Your server should send back an HTTP response line that indicatesan error if the requested URI is not a number or is less than 100.</P><A NAME=server><H3> Server Variants</H3></A><P>The focus of this project is on the development of a concurrentserver. Your server must be capable of providing concurrency in 4different ways, a command line option is used to select the mechanismused. The table below lists the command line options and the resultingmethod of concurrency:</P><TABLE WIDTH=80%><TR><TH>Command line<BR>option</TH><TH>Method of concurrency</TH></TR><TR><TD class=big>-f</TD><TH class=reg>Forking server, one child per client.</TH></TR><TR><TD class=big>-pf</TD><TH class=reg>Preforked server, the number of child processes isspecified on the command line as an additional argument.</TH></TR><TR><TD class=big>-t</TD><TH class=reg>Threaded server, one thread per client.</TH></TR><TR><TD class=big>-pt</TD><TH class=reg>Prethreaded server, the number of threads isspecified on the command line as an additional argument.</TH></TR></TABLE><P>The first command line argument to your server will be the portnumber on which your server should look for clients.</P><P>For example, if your program is named <CODE>hw5</CODE>:<P>This would create a forking server - one child per client:<CODE class=big>./hw5 1234 -f</CODE></P><P>This would create a pre-forked server with 10 child processes:<CODE class=big>./hw5 1234 -pf 10</CODE></P><P>This would create a threaded server - one thread per client:<CODEclass=big>./hw5 1234 -t</CODE><P>This would create a pre-threaded server with 5 threads:<CODE class=big>./hw5 1234 -pt 5</CODE></P><DIV CLASS=in><P><B>NOTE:</B> On solaris.remote.cs.rpi.edu you are restricted to atotal of 64 processes, this includes your login shell and any otherprocesses you may be running. You need to include code that canhandle the possibility that <CODE>fork</CODE> will return an error(don't simply keep trying to fork, make your server quit if it wantsto fork and is not able to!).</P></DIV><A NAME=report><H3>Performance Report</H3></A><P>Once your server is working, you must test your server and makesome measurements of the performance for various request sizes anddegrees of concurrency. You do not need to provide timing orstatistics gathering code in your server, instead you will use aclient that can make lots of requests and report on the results.The <em>ApacheBench</em> program is availablefor making measurements - this program can generate multiple HTTPrequests to your server with any desired level of concurrency.The program executable is installed on the CS Sunsas <CODE>~hollingd/public.html/netprog/ApacheBench/ab</CODE>, there is a copyof the formatted man page in the same directory.  Below is sample usageof the <CODE>ab</CODE> program to give you an idea of what itdoes. The test run below sends 100 requests to www.cs.rpi.edu for theURI ~hollingd/foo.html, sending 10 requests at a time (10 clients at atime).</P><TABLE BORDER=0 BGCOLOR=CYAN><TR><TD><PRE>&gt; ab -n 100 -c 10 www.cs.rpi.edu/~hollingd/foo.htmlThis is ApacheBench, Version 1.1Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd,http://www.zeustech.net/Copyright (c) 1998 The Apache Group, http://www.apache.org/Server Software:        Apache/1.3.4                                       Server Hostname:        www.cs.rpi.eduServer Port:            80Document Path:          /~hollingd/foo.htmlDocument Length:        19 bytesConcurency Level:       10Time taken for tests:   1.823 secondsComplete requests:      100Failed requests:        0Total transfered:       26400 bytesHTML transfered:        1900 bytesRequests per seconds:   54.85Transfer rate:          14.48 kb/sConnnection Times (ms)           min   avg   maxConnect:     0     0     5Total:     133   178   265</PRE></TD></TR><TABLE><BR><P>Your report should focus on a comparison of the 4 concurrency modessupported by your server. The general idea is to determine which modeworks best and by how much. The requests per second numbers reportedby <CODE>ab</CODE> are probably the most useful for this comparison,the transfer rate and total time may also be useful.You should try various request sizes and levels of concurrency in yourtests (what works best for small requests? is it different than whatworks best for large requests? , etc.) DO NOT SIMPLY SEND US THEOUTPUT GENERATED BY <CODE>ab</CODE>! You are to <em>write areport</em> that summarizes your findings and includes enoughinformation so that we could reproduce your tests. <EM>Convince us thatyou have thought about which model of concurrency is best for variouspatterns (size/concurrency) of requests.</EM></P><P>There is no specific <em>correct</em> result/conclusion we arelooking for. Instead we are looking for an indication that you havethought about what to measure and how to measure it. Your report should be no more than 2 pages and should include some conclusionsabout what kind of concurrency you think works best for variouspatterns of requests. Some reasonable parameters to test include(these are not required, just an example to give you and idea of whatkinds of things you can test):</P><UL><LI>small requests vs. large requests.<LI>level of client concurrency is greater than server concurrency vs.fewer clients than server processes/threads.</UL><A NAME=deliv><H3>Deliverables</H3> </A><P>You should submit all the files necessary to build and run your server.Your submission must also include a file named READMEthat includes the following: </P><UL><LI><P>Your Name</P></LI><LI><P>Instructions on how to build your server.</P></LI><LI><P>A list of files and a 1-line description of the contents of each file. </P></LI><LI><P>References to any borrowed code (the source code must also include this information).<P></LI><LI><P>A description of any known problems. If you think you know how to solve the problem(s) and simply didn't have time to do so - let us know how!</P></LI><LI><P>Anything else you think might be useful to us, such as what youlearned, what you had trouble with, if the project was too hard or tooeasy, etc.</P></LI></UL><P>Your submission must also include your report - this can be aplain text file, MS Word, PDF or HTML. Other formats may be fine aswell, but please ask first to make sure. If you would prefer tosubmit your report as hardcopy that is also fine, but it must begiven to Dave or a TA before the project deadline. Please don't submita report any longer than 2 pages, your report is meant to be adescription of your tests, a summary of the results of the testsand a conclusion.</P><A NAME=grading><H3>Grading</H3></A><P>Your server must support all four concurrency models, and we mustnot be able to crash it or get it to hang by sending invalid requests.You must take care of zombies and avoid memory leaks. Your server mustsend back documents of the requested size. Your server must alwayssend back a valid HTTP response line.</P><P>Points will be awarded as follows (partial credit is available foreach item): </P><TABLE BORDER=0><TR> <TH WIDTH=60% ALIGN=LEFT>Server works properly with valid     requests (supports all 4 concurrency models).     </TH> <TD>40%</TD></TR><TR> <TH ALIGN=LEFT>Server can handle any kind of nonsense.</TH> <TD>10%</TD></TR><TR> <TH ALIGN=LEFT>Writeup (your report).</TH> <TD>25%</TD></TR><TR> <TH ALIGN=LEFT>Code Style/readability</TH> <TD>25%</TD>  <TR> </TABLE>  <P>Note that the report is worth 25% of the grade, so you need to worry about this! Pretend that you have been assigned to determinethe architecture for a web server your company is writing. Your reportmust convince others that you understand the issues, have made a complete set of measurements, and have data to back upyour conclusion(s). </P><A NAME=submitting><H3>Submitting your files</H3></A><P>Submission of your homework is via email, the general idea is tosend an email message with all your files as attachments. There is an automated email submission system that will respond to yoursubmission right away, so you will have a record that we got yourfiles. </P><P>All projects must be submitted via email to <AHREF=mailto:netprog-submit@cs.rpi.edu><I>netprog-submit@cs.rpi.edu</I></A>. Thesubject line of the submission message should contain a single numberindicating the project number (5 for HW5). You mustinclude your files as attachments, feel free to send a zip-file or atar file.<P><B>Don't send compiled code!</B></P><P>You can expect a return email indicating receipt of your projectsubmission immediately. This receipt will include a list of all thefiles that were successfully extracted by the submission script -please look over the receipt carefully to make sure your submissionworked.</P><P><B>Multiple Submissions: </B> You can resubmit up to 10 times foreach project, we will always grade the last submission received unlessyou tell us otherwise.</P></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -