TFTP(Trivial File Transfer Protocol)

Divyesh Parmar
5 min readMar 19, 2023

--

What is TFTP?

Trivial File Transfer Protocol is a simple lockstep File Transfer Protocol which allows a client to get a file from or put a file onto a remote host. Also in simply words we can say that TFTP or Trivial File Transfer Protocol, is a simple protocol used for transferring files between networked devices. It is commonly used for transferring firmware updates or configuration files to network devices such as routers, switches, and servers. In this blog post, we’ll explore how TFTP works and its advantages and disadvantages.

How does TFTP work?

TFTP is a client-server protocol , which means that there is a TFTP client that initiates the file transfer and a TFTP server that receives the transfer request and sends the requested file. The TFTP client and server communicate using UDP (User Datagram Protocol), which is a connectionless protocol that does not guarantee reliable data transfer.

The TFTP client initiates the file transfer by sending a read or write request to the TFTP server. The read request is used when the client wants to download a file from the server, while the write request is used when the client wants to upload a file to the server. The TFTP server responds to the request by sending the requested file to the client or waiting for the client to send the file, depending on the request type.

Overview of operation and messaging of TFTP

One of the key features of TFTP is its simplicity. TFTP only supports a limited set of commands and does not include features such as authentication or encryption. This simplicity makes TFTP easy to implement and use, but also makes it less secure and less reliable than more complex file transfer protocols.

Features of TFTP

The main features of TFTP are as follows−

TFTP is based on the client-server principle and uses well-known UDP port number 69 for the TFTP server.

TFTP is an unsecured protocol and does not support authentication.

TFTP incorporates idle − RQ (stop and wait) error recovery mechanism.

  • Every TFTP data unit bears a sequence number.
  • Each data unit is separately acknowledged. After taking the acknowledgement, the next data unit is transmitted.
  • Error recovery is by retransmission after timeout. TFTP uses adaptive timeout with an exponential back-off algorithm.

Configuration

Step 1: Login as superuser to get easy and installing required tftpd-hpa package

Step 2: Checking the IP address as TFTP require LAN IP for configuring

Step 3: Setting up Server using TFTPD64 by Ph. Jounin

Step 4: Starting with establishment of Client and configuring it for transferring with respected file to send

Here LAN IP react as TFTP Server, i.e 172.16.102.181 is the server IP for TFTP

Step 5: Checking the service is active or not, if not then again install TFTP.

Here the TFTP require an option to create a file in server. As of below there is no create option provided, so we will explicitly provide the create option.

Step 6: To configure TFTP for accessing create option, head over to the location in the below image

Step 7: Editing the TFTP_OPTIONS for accessing create option.

Step 8: After updating the TFTP_OPTION save the file and restart the service again.

Step 9: Here you can find that now create option is now accessible for the server

Step 10: Uploading file to the TFTP Server

Local File :- File from the Client to be uploaded on the TFTP Server.

Remote File :- File to be saved as new filename in the Server.

TFTPD
Successfully uploaded
File uploaded on Server

Step 11: Retrieving file from the Server

Local File :- path\file_name as you want to save on your local storage.

Remote File :- File to be retrieved from server for the given request as per user.

Files to be restored by Client from the Server
Successfully Retrieved from the Server
Verifying the fetched files

Advantages of TFTP

TFTP has several advantages that make it a popular choice for file transfer in certain network environments. One advantage is its simplicity, which makes it easy to implement and use. TFTP also uses UDP, which is a lightweight protocol that does not require a lot of network overhead. This makes TFTP ideal for transferring small files or for use in networks with limited bandwidth.

Another advantage of TFTP is its compatibility with a wide range of network devices and operating systems. TFTP clients and servers are available for many different platforms, including Windows, Linux, and macOS. This makes it easy to transfer files between devices that may be running different operating systems.

Disadvantages of TFTP

While TFTP has several advantages, it also has some significant disadvantages. One disadvantage is its lack of security features. TFTP does not include authentication or encryption, which means that files transferred using TFTP can be intercepted and read by unauthorized users. This makes TFTP unsuitable for transferring sensitive or confidential files.

Another disadvantage of TFTP is its lack of reliability. Because TFTP uses UDP, which does not guarantee reliable data transfer, there is a risk of data loss or corruption during file transfer. This makes TFTP unsuitable for transferring large or important files.

Conclusion

TFTP is a simple protocol used for transferring files between networked devices. Its simplicity and compatibility make it a popular choice for file transfer in certain network environments. However, its lack of security features and reliability make it unsuitable for transferring sensitive or important files. If security and reliability are a concern, more complex file transfer protocols such as SFTP or SCP should be used instead.

--

--