Chapter 1 Introduction
1.1 TFTP Protocol
The TFTP (Trivial File Transfer Protocol) is a protocol used to transfer files between various machines connected
through a communications network.
TFTP is a very simple protocol, similar to a basic version of FTP (File Transfer Protocol), which is defined in RFC
1350. TFTP is implemented over a non-reliable, non-orientated to connection communications service. TFTP func-
tionality mainly consists in a client reading or writing a file (occasionally an electronic mail) from a remote server.
The main characteristics distinguishing this from FTP are as follows:
• Uses UDP (port 69) as the transport protocol (unlike FTP which uses TCP port 21).
• It cannot list the content of the remote directories, and therefore needs the client to know the complete route in the
server and the name of the files in order to transfer them.
• There are no authentication or encryption mechanisms, so it should be used over secure network paths (private
networks, local networks, etc.).
• It supports three different transfer modes, "netascii", "octet" and "mail". The first two correspond to the “ascii” and
“image” (binary) from the FTP protocol.
This protocol is often used to transfer small files between PCs in a network, such as when an X Window terminal or
any other lite client boots from a network server. A common use of this protocol is the transfer of booting programs.
1.2 Detailing a TFTP Session
As TFTP uses UDP, there is no formal definition for session, client and server. However each file transferred through
TFTP constitutes an independent exchange of packets, and there is an informal client-server relationship between
the machine initiating the communication and that responding.
1.2.1 Fundamental Characteristics
Any file transfer begins with a client requesting a file reading or writing.
If the server accepts the request, the file is sent in fixed length blocks of 512 bytes. Each data packet contains one of
these blocks and has a block number, beginning the transfer with block number 1. The data packets must be ac-
knowledged, so in the absence of machine failure, the file is correctly transferred. The acknowledgment packet indic-
ates the block number it’s acknowledging. Until acknowledgement for a block has been received, the next one is not
sent.
A data packet containing fewer than 512 bytes indicates the end of the transmission.
If a packet is lost during transmission, the receiver will timeout and must retransmit the last transmitted packet (data
or acknowledgement). This causes the sender of the lost packet to retransmit this said packet. Please note that both
the client as well as the server use timeouts.
Three types of events cause errors:
• When it is not possible to accept a transfer request (file not found, permit violation).
• When an incorrectly formatted packet is received.
• When access to a resource is lost (the disk is full) in the middle of a transfer.
Errors cause the termination of the transfer. Sending an error packet indicates an error. This packet is neither ac-
knowledged nor retransmitted, so the other end of the connection may not ever receive this.
1.2.2 Initializing a transfer
A transfer is initialized by a client sending a request (WRQ to request to write or RRQ to request to read) and a posit-
ive reply from the server received by the said client. This positive reply can be an acknowledgement packet – for
write – or the first data packet –for read--. The acknowledgement packet for write takes block number 0. If the re-
sponse to a request is an error packet, the request has been denied.
bintec elmeg
1 Introduction
TFTP Protocol 1