Open In App

What is TFTP (Trivial File Transfer Protocol)?

Last Updated : 19 Aug, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The network is made up of various devices. These devices are either connected by ethernet or by any wireless means. The communication for transferring files takes place between these connected devices. Therefore network protocols are required. Network protocols are defined as rules that describe the format of data, sending and receiving of data between the devices connected in a network. The below article covers in detail the Trivial File Transfer Protocol(TFTP).

TFTP (Trivial File Transfer Protocol)

TFTP stands for Trivial File Transfer Protocol. TFTP is defined as a protocol that is used to transfer a file from a client to a server and from a server to a client. TFTP is majorly used when no complex interactions are required by the client and server. The service of TFTP is provided by UDP (User Datagram Protocol) and works on port number 69. TFTP does not provide security features therefore it is not used in communications that take place over the Internet. Therefore it is used only for the systems that are set up on the local internet. TFTP requires less amount of memory.

IMG-20230812-WA0005

TFTP Protocol

TFTP Message Formats

There are four types of TFTP Message formats. They are as follows

1. Read Request:

Read Request is also known as Type 1. A read request is used by the client to get a copy of a file from the server. Below is the format of the Read Request

Read Request (1)

(2 Octets)

File Name

(variable)

0

(1 Octet)

Mode

(Variable)

0

(1 Octet)

2. Write Request:

Write Request is also known as Type 2. Write Request is being used by the client for writing a file into the server. Below is the format of the Write Request.

Write Request(2)

(2 Octets)

File Name

(variable)

0

(1 Octet)

Mode

(Variable)

0

(1 Octet)

3. Data

Data is also known as Type 3. Data consists of a portion of a file that is being copied. The data block is of fixed size that is 512 octets. Below is the format of the Data.

Data (3)

(2 Octets)

Sequence Number

(2 Octets)

Data

(Upto 512 octets)

4. Acknowledgement

Acknowledgment is also known as Type 4. The data present at the last in the message consists of the End of File(EOF) where the size is less than 512 octets. This acknowledgment is used by both client and server for acknowledging the received data.

Ack(4)

(2 Octets)

Sequence Number

(2 Octets)

Working of TFTP

  • TFTP makes use of port number 69 as it uses User Datagram Protocol (UDP).
  • When the connection is established successfully between client and server, the client makes a Read Request (RRQ) or
  • Write Request( WRQ). If a client wants to only read the file it requests RRQ and if the client wants to write some data into a server then it requests for WRQ.
  • Once the connection is established and a request is made communication of files takes place in the form of small packets. These packets are 512 bytes each.
  • The server then communicates the packet back to the client and waits until it receives an acknowledgment from the client that the packet has been received.
  • When the acknowledgment is received from the client side, the server again sends the next packet which is 512 bytes each.
  • The same steps as mentioned above continue until the last packet is sent by the server to the client.

Advantages of TFTP

  • TFTP Protocol makes use of User Datagram Protocol (UDP).
  • TFTP requires less amount of memory.
  • TFTP is simple to implement.
  • TFTP is supported by many network devices such as routers, firewalls, and switches.
  • TFTP has low overhead as compared to other protocols and therefore can be used for low-bandwidth networks.
  • TFTP can transfer small files such as boot files, and firmware images more fastly.

Disadvantages of TFTP

  • TFTP does not provide any security features
  • TFTP does not provide any approach for error checking.
  • TFTP can be used for limited functionalities only.
  • TFTP servers do not allow the renaming and deletion of files.

Applications of TFTP

  • TFTP is used to transfer files within clients and sever connected in a network.
  • TFTP is used to transfer the configuration files within the network.
  • TFTP is used to update the firmware on the devices connected to the network
  • TFTP is used in applications where no authentication is required.

Difference between TFTP and SFTP: TFTP vs SFTP

Difference between FTP and TFTP: FTP vs TFTP

Frequently Asked Questions on TFTP

Q1. In the working of TFTP what if the file is not received by the client during communication?

Answer:

When the server sends the packet to the client it puts on the timer. If any acknowledgement is not received from the client side the server again sends this packet. Upon receiving the acknowledgment from the client, served and then sends the next packet.

Q2. Why TFTP is considered an unsecured protocol?

Answer:

TFTP does not provide any security features such as authentication, it does not have any error recovery methods and the data that is transferred is not encrypted. Therefore TFTP is considered an unsecured protocol.

Q3. What is the difference between FTP and TFTP?

Answer:

Both FTP and TFTP are used for transferring files from one system to another but the difference between both is that FTP provides more security and allows complex functions, commands, and operations on data whereas TFTP does not provides security features and complex commands.

Q4. What is meant by a TFTP server?

Answer:

TFTP server provides communication with the TFTP client for sending and receiving the files in the form of packets.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads