CIS-3152 Homework #TFTP

Read RFC-1350 that describes the TFTP protocol. My DNS client/server example provides sample code showing how to construct datagrams, send them, and then receive the reply datagrams and dissect those replies. The client is probably the best starting point.

The purpose of this assignment is to implement the receive_file function for IPv6 in this skeletal TFTP client: tftpclient.c, tftpclient.h. You will also need to create a suitable Makefile.

For testing, you will need to set up a TFTP server. On your Ubuntu-based system (such as WSL), install the following packages:

  $ sudo apt install tftp-hpa tftpd-hpa

The first package installs the client, the second installs the server. You don't need the client for this assignment since you are writing your own, but you might want to use the official client to test your server configuration before trying to use your client. The HPA in the names reflects the name of the developer who created them (H. Peter Anvin).

Next, modify the TFTP server configuration file /etc/default/tftpd-hpa to contain something like:

  TFTP_USERNAME="tftp"
  TFTP_DIRECTORY="/srv/tftp"
  TFTP_ADDRESS=":69"
  TFTP_OPTIONS="--secure"

Create the directory /srv/tftp and make sure that it is owned by root and in the group nogroup. Since we are only reading files from the server, there is no need to configure the permissions to allow write access.

Put a sample text file in /srv/tftp for the server to serve. Be sure it has appropriate ownership and permissions.

Restart the TFTP service and verify that it is running using:

  $ sudo systemctl restart tftpd-hpa
  $ sudo systemctl status tftpd-hpa

Zip all the files, including your Makefile, for your client and submit the zip file to Canvas.


Last Revised: 2025-11-05
© Copyright 2025 by Peter Chapin <peter.chapin@vermontstate.edu>