TFTP Project

by: burt rosenberg
at: university of miami


A Write Request packet destined for the Well Known Port

The Trivial File Transfer Protocol

TFTP was first defined in 1981 by RFC 783, although the RFC does refer to an earlier "IEN", so it is really the second definition. Currently RFC 1350 is the best reference. What is defined is a truly simple protocol for transferring files using the UDP protocol. Studying the protocol you will learn about achieving reliability by using a positive acknowledgement with retry scheme; and will see some of the pitfalls of even a simple protocol. You will also learn to construct and parse databuffers that become packets.

Instructions

Please look at the proto-man page for mytftp.

Your program should that options, and should use getopt to parse the option string. Getopt is a standard C library call that makes command line options easy, and will also insure that your command line tool follows the same conventions as every other command line tool in the unix tool set. It will implement even rules you don't know about!

Please work in groups of two. One person writes the server code and other the client code. You might consider writing mytftp-server.c and mytftp-client.c and finally linking them together with mytftp.c to get a combination of you and your partner's code

Ports 3000-3999 are open on the AWS machines. Two programs cannot bind to the same port, so the well known port for your tftp server must be adjustable, to avoid other people's ports.

Make a single threaded server at first. For extra-credit make a server capable of simultaneously handling multiple requests.

Steps

  1. First get packets to flow, like use netbounce.
  2. Write code to construct and parse packets
  3. Get the code to step through the major motions: responding with acks, moving to a new port number.
  4. Now open, read and write files.
  5. Add retries and test more error paths, simulating dropped, duplicated and out of order packets.
  6. Optional: remove the single-threaded requirement.

Submitting

Create a proj2 directory and put your files there. There should be a Makefile and a mytftp product. Show your test suite with a test target in your Makefile. Your Makefile should contain a clean target. Commit only the sources and test input files. Do not commit binaries.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Author: Burton Rosenberg
Created: January 18, 2014
Last Update: January 18, 2014