📄 p6.html
字号:
<HTML><HEAD><TITLE>NetProg Homework 6</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>  NetProg 2002 HW6</TD> </TR><TR BGCOLOR=BLACK><TD CLASS=menu>    <A CLASS=menu HREF=#desc>Project Description</A>     |   <A CLASS=menu HREF=#term>Terminology</A>     |   <A CLASS=menu HREF=#func>Functionality</A>     |   <A CLASS=menu HREF=#deliv>Deliverables</A>     |   <A CLASS=menu HREF=#grading>Grading</A>     |   <A CLASS=menu HREF=#submitting>Submission</A>     |   <A CLASS=menu HREF=#hints>Hints</A>     |   <A CLASS=menu HREF=faq.html>FAQ</A> </TD></TR></TABLE><DIV CLASS=page><H2 style="font-size: 16pt; color:black; text-align:center;">Homework 6: IPv6 Chat system<BR>Due Date for Local and live remote students: Fri, April 19th (by11:59PM)<BR>Due Date for Tape and Videostream Delay students: Fri, April 26th</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 "6"<BR>Complete Submission instructions are <A HREF=#submitting>here</A></H4><A NAME=desc><HR></A><P>This project must support IPv6! You need to develop a C or C++ chat system(both client and server) that can support up to 10 users (clients) atonce. Your system should be <em>client/server</em>, meaning that allchat messages should go through the central server. Your system should be based on a single server.</P><P>Your server should be an IPv6 server. Solaris will automaticallycreate IPv4-mapped addresses for incoming clients, so your server doesnot need to do anything special to support IPv4 clients.</P><P>Your client should be capable of using either IPv4 or IPv6,depending on the server address specified on the command line. If youuse <CODE>getaddrinfo</CODE> you don't need to do anything special tosupport both IPv4 and IPv6!</P><P>Part of your job is to define an application protocol and decide onwhat kind of transport protocol to use (TCP vs. UDP). Your applicationprotocol will need to be documented and included in yoursubmission.</P><A NAME=term><H3>Terminology used below</H3></A><P>Some terms are defined here just in case you get confused withlater descriptions of functionality (just trying to avoid problems...)</P><P><B>User</B> A human (or a <em>bot</em>) that communicates with thesystem through a client program. Each user has a nickname thatidentifies the user to other users. You decide what constitutes a nickname.</P><P><B>User Interface</B> The text interface supported by the client,this is how the user interacts with the system. It is possible thatthe user interface for this system is minimal, you might even have theuser interface be your protocol... It should be possible to store asequence of UI commands in a text file and feed them to your clientprogram through standard input, so your user interface should benothing fancy.</P><P><B>Application Protocol</B> The definition of the communicationthat takes place between the client and server. Note that this can bevery different than the communication between the user and the client(but it doesn't have to be). </P><P><B>Message</B> By <em>message</em>, I mean the text that is sentfrom one user to another (or to all users). You must support textmessages. You decide whether text messages are just a single line or multi-line.</P><A NAME=func><H3>System Functionality</H3></A><P>Your system must support the functions below. <H4>User Identity</H4><P>The system must allow users to identify themselves to the systemin some way that prevents the possibility of having two users on thesystem at the same time using the same nickname.</P><H4>Private Messages</H4><P>The system must provide a way for users to send a message to oneother user. Only the indicated destination user should receive themessage. The user should find out if the destination of the message isnot currently on the system.</P><H4>Public Messages</H4><P>The system must support some way for a user to send a message toall other users currently on the system.</P><H4>User List</H4><P>It must be possible for any user to get a list of the other userson the system. This information includes the user nicknames and the IP address associated with each user. The list shown to the user must support IPv6 addresses and IPv4 addresses (an IPv4 mapped addressshould appear as an IPv4 address). Note that the user doesn't reallycare about the IP addresses (they can use nicknames to refer to otherusers), this is just so we can see that your system can support bothIPv4 and v6 clients.</P><H4>Special Client Requirement: Help command</H4><P>Your client must support a help command so that we can figure outhow to use your program. When the client initially starts up it shouldgenerate the help information automatically.</P><A NAME=deliv><H3>Deliverables</H3> </A><P>You should submit all the files necessary to build and run yourclient(s) and server.Your submission must also include a file named READMEthat includes the following: </P><UL><LI><P>Your Name</P></LI><LI><P>A description of your application protocol. This should bedetailed enough so that a competent programmer could create a clientor server that would work with your programs.</P></LI><LI><P>Instructions on how to build and run your programs.</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><A NAME=grading><H3>Grading</H3></A><P>We won't test your system with anything other than your programs,but we will look for places in your code that could lead to problemsif communication does not take place according to your protocol.As always, your server should not create zombies or have memory leaks...</P><P>The points for your protocol design are based on your descriptionand the implementation. In general you are not expected todesign the fastest, most flexible, most efficient protocol - but don'tcreate a protocol that has silly requirements either. For example, itwould be silly to develop a protocol for this application that usesfixed-size 32K bytes messages, as individual chat messages areprobably going to be much smaller. It would also be a good idea todesign a protocol that could easily be extended if we wanted thesystem to support more functionality (more users, more message types,etc.). </P><P>Points will be awarded as follows (partial credit is available foreach item): </P><TABLE BORDER=0><TR> <TH WIDTH=60% ALIGN=LEFT>Protocol Design </TH> <TD>25%</TD></TR><TR> <TH ALIGN=LEFT>Client and Server support minimum functionsover IPv4</TH> <TD>30%</TD></TR><TR> <TH ALIGN=LEFT>IPv6 support</TH> <TD>20%</TD></TR><TR> <TH ALIGN=LEFT>Code Style/readability</TH> <TD>25%</TD> <TR> </TABLE> <P>Note that support for IPv6 is worth 20% of the grade, but should benothing close to 20% of the code! (if you do it right). </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 (6 for HW6). 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><A NAME=hints> <H3>Notes & Hint </H3></A><UL><LI><P>Check out <CODE>getaddrinfo</CODE> (in the book or in thelecture notes <em>Advanced Sockets Programming</em>)</P></LI><LI><P>Your protocol design will determine how much code you need towrite</P></LI><LI><P>If you use a simple text-based protocol over TCP you can test your server using <CODE>telnet</CODE></P></LI><LI><P>Don't go crazy with the protocol description. A concise,accurate description is best. It should a technical document, not anovel...</P><DIV CLASS=in style="font-family: times-roman; font-size: 10pt; color:gray"><P>It was a dark and stormy night when I started thinking about myapplication protocol. As the storm flashed in the sky, my mindwandered to thoughts of Brittney and our on-again/off-again romance.Memories of the good times, like the time she mentioned that ourfriend Travis <em>'T.C.'</EM> Cook was urinating outside the club(she said "TCP?", I laughed for hours). Memories of the bad times, like when she told me she wasconsidering taking an alternate route... Seems like it was only yesterday...</P><P>Anyway, my protocol is text-based. Brittney, on the other hand,is a multimedia gal - she sings, dances, the whole nineyards. Speaking of yards, I was watching the storm, and during oneflash I saw that I'd left my laptop in the middle of yard. Funnything, but the rain didn't hurt it at all. I almost wish it did get hurt, as then I'd have something to think about besides<strike>Brittney</strike> this protocol design...</P></DIV></LI><LI><P>Have ideas for a <em>fancy</em> chat system (and the time toimplement it)? Stop by and <em>chat</em> with Dave about it!</P></LI></UL><BR><BR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -