\ 15-441 Project 1

15-441 Project 1 : TFTP Server

Assigned : Monday, Jan 23rd, 2006

Due : Friday, Feb 10th, 2006, 11:59pm

Lead TAs : Joshua Hailpern and David Murray


Introduction - Logistics - Assignment - Time Line - Evaluation
Hand-in - Coding Style - Resources - Hints - Extra Credit


Introduction

The purpose of this project is to give you experience in developing concurrent network applications. You will use the Berkeley Sockets API to write a Trivial File Transfer Protocol (TFTP) Server.

TFTP is a deliberately simplified file transfer protocol. Specifically, it supports the bare minimum set operations needed to get and put files. Compared to FTP, it does not support listing of directories, renaming, or access control. It is most commonly used in booting diskless workstations. The protocol is simple enough for a client to be implemented in the workstation's firmware, which uses it to fetch the operating system kernel to boot.

Logistics

You are to work in groups of 1 (alone) on this project. You are free to discuss the project and references with your classmates, but your solution must be your own.

You must code your server in C (not C++). While other languages may provide features to make network programming easier, most kernel-level networking code is written in C and future assignments will require implementing such code in a simulated environment.

You may develop & test your code on any operating system you wish, however, we will grade your code on Andrew Linux machines, so please make sure your code compiles and runs as expected on them.

Your Assignment

Your server must :

The RFC leaves several details up to the implementor. You should justify the significant choices you make in your README file. You may also find yourself constrained by resource or OS limitations. For instance, you may not be able to support an infinite number of simultaneous clients, or certain file names. You should identify what these limits are and do something reasonable when they are reached. These should also be documented in the README.

As with all network services, your server should be robust against dropped packets, clients that do not correctly implement the protocol, and malicious attacks. Thus, a large part of this assignment (and programming in general) is knowing how to test and debug your work. There are many ways to do this; be creative. We would like to know how you tested your server and how you convinced yourself it actually works. To this end, you should submit your test code along with brief documentation describing what you did to test that your server works in a file called TEST. The test cases should include both generic ones that check the server functionality and those that test particular corner cases. Several paragraphs (or even a bulleted list of things done and why) should suffice for the test case documentation. If your server fails on some tests and you do not have time to fix it, this should also be documented in the README (we would rather you know and acknowledge the pitfalls of your server than miss them).

Most operating systems (including Andrew Linux and Solaris) include a TFTP client program, tftp, that you can use to test your server. By default, it assumes the server is on the standard port 69, but the default can be overridden by specifying a port number after the host name. You can get the complete manual through man tftp, but for a quick tutorial:

Running tftp presents you with a tftp> prompt.

At the tftp> prompt, connect host port tells the program to use host "host" and port "port" for all subsequent operations. Note that this step only sets a variable - it does not send any messages. Invoking tftp host port has the same effect, with no need to issue a connect.

The get and put commands start the sequence beginning with RRQ and WRQ packets respectively.

trace causes the client to print the header of every packet in receives or sends, which could come in handy for debugging.

binary tells the client to use octet mode.

If you are using a non-Andrew machine, be sure you're using the latest version of its tftp client - older versions included with some Linux distributions may be buggy. In particular, netkit-tftp-0.17 or earlier, and tftp-hpa-0.15 or earlier are known not to work. As far as we can tell, the versions on Andrew are correct.

Time Line

We strongly recommend you start early. To help "guide" you through this lab, we have provided you some key milestones!

M
T
W
R
F
S
S
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10

Evaluation

Hand-In

Your executable must be named tftpd and accept the port number as its first argument. It must run correctly when given only one argument. Any additional arguments should be documented.

Your project must include a makefile called Makefile. We will build a binary from your source code using the makefile and GNU make. The makefile for this project should be simple. If you need help creating the makefile, everything you need to know (and much much more) about GNU make can be found in the GNU make manual. We will build your program by executing rm -f tftpd, and then make tftpd. Please test this before handing in to avoid unnecessary deductions.

Your makefile should run gcc with option -Wall and should produce no errors.

You should submit the following files:


Updated handin instructions will be provided via the course bulletin board and the project page.

Coding Style

As the course progresses, we expect you to develop and refine your personal coding style. By this we mean that there are many reasonable ways to write code so it is easy for people to read (not that anything you define as "your style" will be acceptable). Below we have provided you with a list of coding standards put forth by various groups at CMU and elsewhere. We strongly suggest that you spend some time looking through several of these before you start coding.

Resources

Hints

Depending on your previous experience, this project may be substantially larger than your previous programming projects. You can expect up to 750-1000 lines of code, possibly more, possibly less. With that in mind, this section gives suggestions for how to approach the project. Naturally, other approaches are possible, and you are free to use them.

Extra Credit

Our intent in suggesting extra credit items is to give interested students the opportunity to explore additional topics that we do not have time to cover in class. The primary reward for working on the suggested items is the additional experience and knowledge that they give you, not extra credit points. Extra credit will be granted at the discretion of the teaching staff.

For each suggestion, we list a rough estimate of the number of points you can receive. If you have more specific expectations about the extra credit you will receive, you should consult your TAs beforehand to avoid any disappointment. If you work on the suggested topics below, please include in your project submission a file called EXTRA, describing what you have done.