• Trivial file transfer protocol (TFTP) is suited for those applications that do not require complex procedures of FTP and do not have enough resources (RAM, ROM) for this purpose.
• Typical applications of TFTP include loading the image on diskless machine and upgrading the operating system in network devices such as routers.
The main features TFTP are :
1. TFTP is based on client/server principle.
2. It uses Well-known UDP port number 69 for TFTP server.
3. TFTP 1S unsecured protocol.
4. TFTP does not support authentication.
5 Every TFTP data unit has a sequence number.
6. Each data unit is individually acknowledged. After receiving the acknowledgement the next data unit is sent.
7. Error recovery is by retransmission after timeout.
We’ll be covering the following topics in this tutorial:
TFTP message formats
There are four types of TFTP messages. The first two octets indicate the type of message. Mode field defines the type of data (ASCII, binary, Mail). The filename and mode fields are delimited using an all zeroes octet.
1. Read request (Type 1). This is used by the client to get a copy of a file from the server.
2. Write request (Type 2). This command is used by the client to write a file into the server.
3. Data (Type 3) this command contains block of data (portion of the file being copied). This message contains the data block of fixed size of 512 octets. The session is terminated if a data message arrives with data octet less than 512 octets.
4. Acknowledgement (Type 4). The last data message can have data block with EOF having size less than 512 octets. This is used by the client and the server to acknowledge the received data units.
• The client sends a read or write request at the server’s UDP Port 69
• The server accepts the request by sending data message in case of read request.
• The server accepts the request by sending acknowledgement in case of write request.
• In either case, the server selects a UDP port to be used for further dialogue and sends its first response to the client through the selected UPD port.
• Each data message has fixed size of data block (512 octets) and IS individually acknowledged.
• The last data block containing EDF or a data block containing less than 512 octets terminates the session.
• Error recovery is done using retransmission after timeout.
• If TFTP message is lost and if there is no expected response, the message is repeated by the sender after time out.
• If the next data message is not received after acknowledgement, the last acknowledgement is repeated after timeout.