All projects are to be coded in ANSI C. If you are unsure of the differences between ANSI and K&R C, there are a number of books available at the bookstore on ANSI C.
The only exception to this rule is Programming Assignment 1 (Web Proxy). This assignment (and only this one!) can be completed using C++. However, remember that you will be required to work in C for the rest of the quarter.
We expect good coding style throughout. At a minimum, good coding requires useful comments and meaningful variable names. We also expect you to design your program carefully, to achieve good functional decomposition, to use appropriate algorithms and library routines. Thirty percent of your total assignment grade is devoted to these style/design issues.
All of the assignments are designed to be implemented on the x86 Linux machines provided by Stanford- specifically, the myth cluster located in Gates B08. You can log into these machines remotely using SSH. If you develop your assignments on another machine, make sure that your code compiles and runs correctly on these machines.
At times there will be ambiguities in the assignment specifications, or multiple ways an assignment can be implemented. As CS244a is an engineering class, we expect you to make reasonable design decisions in these cases. Base your decisions on what you know of the assignment as a whole. The TA's may give you advice on the tradeoffs of these decisions, but will not make them for you.
make is a utility used to conditionally recompile your program based on the timestamps of the source code, object files, and executable. We expect that everyone in the class will have seen a makefile before as they are a permanent fixture of every flavor of Unix and most other platforms. If you don't know how to use make or write a makefile, learn. We require a makefile to be submitted with each assignment.
gdb is the GNU debugger. gdb is an interactive, source-level debugger. It allows you to trace through your code as it executes and examine program state. If your program seg faults, it will show you where. Learning to use gdb effectively will save you many hours of debugging hell.
To compile with gdb, simply add the '-g' flag to the gcc command. You can then start gdb with your program with the command
gdb prognameType 'help' from the gdb prompt for more information.
Valgrind is a programming tool for finding memory leaks and memory errors. Use Valgrind
to ensure that your program is not leaking memory, and that there aren't potential segfaults lurking
in your code. The basic procedure for running valgrind is to run the command
valgrind progname progarg1 progarg2..., where progname is the name of the program and
progarg1, etc. are arguments to the program. Run
valgrind --help for additional options-
most of the things that you will be interested in will be in the Memcheck module.
The second deliverable is a project writeup. This file should be a file called README (all caps) and should be a text file. This file should contain the following:
Once you have created the tarball, go to the submission page and click the 'Browse' button to locate the tarball you are submitting. Select the appropriate file and click 'Okay'. The click the Submit button, and your tarball will be timestamped and uploaded to the teaching staff.
TCP/IP Volume 1: The Protocols, also by Stevens, is an excellent reference to the specification and common implementations of TCP/IP and some of the related protocols. Although this book is not a required course text, it is an excellent reference. Some of the assignments refer to chapters in this book for additional reading.
The RFC's (Request for Comments) are a set of documents which are the absolute reference for Internet standards. The RFC's are numbered sequentially. There is an RFC web page; you can also get the RFC's via anonymous FTP. Look at INDEX.rfc for a list of RFC titles.
Each student will be assigned a TA after signing up through the class web page. If you have a question that cannot be answered by any of the class materials or the above references, you should contact your TA. The TA's will hold office hours in the Sweet Hall; if you are having problems, you may want to schedule one of your programming sessions during these hours.