1 Introduction
1.1
Purpose
The Trivial File Transfer Protocol or TFTP is a very simple protocol used to transfer files.
It has been implemented on top of the User Datagram protocol (UDP) so it may be used to move files between machines on different networks implementing UDP. It is designed to be small and easy to implement. Therefore, it lacks most of the features of a regular FTP. The only thing it can do is read and write files (or mail) from/to a remote server. It cannot list directories, and currently has no provisions for user authentication.
The tftp application implements the following IETF standards:
- RFC 1350, The TFTP Protocol (revision 2)
- RFC 2347, TFTP Option Extension
- RFC 2348, TFTP Blocksize Option
- RFC 2349, TFTP Timeout Interval and Transfer Size Options
The only feature that not is implemented is the netascii transfer mode.
1.2
Prerequisites
It is assumed that the reader is familiar with the Erlang programming language, concepts of OTP, and has a basic understanding of the TFTP protocol.
1.3
Security Considerations
As stated in (RFC 1350) be aware that "Since TFTP includes no login or access control mechanisms, care must be taken in the rights granted to a TFTP server process so as not to violate the security of the server hosts file system. TFTP is often installed with controls such that only files that have public read access are available via TFTP and writing files via TFTP is disallowed."
This essentially means that any machine on the network that can reach the TFTP server is able to read and write, without authentication, any file on the machine that runs the TFTP server, that the user (or group) that runs the TFTP server (in this case the Erlang VM) is allowed to read or write. The machine configuration has to be prepared for that.
The default behavior mentioned above is in general very risky, and as a remedy, this TFTP application's default callback tftp_file implements an initial state option {root_dir,Dir} that restricts the callback's file accesses to Dir and subdirectories. It is recommended to use that option when starting start this TFTP server.