Trivial File Transfer Protocol
Very basic transfer protocol over UDP
From Wikipedia, the free encyclopedia
The Trivial File Transfer Protocol (TFTP) is a simple lockstep communication protocol for transmitting or receiving files in a client-server application. A primary use of TFTP is in the early stages of nodes booting on a local area network when the operating system or firmware images are stored on a file server. [1]
| Communication protocol | |
| Abbreviation | TFTP |
|---|---|
| Purpose | File transfer |
| Developer(s) | Karen R. Sollins |
| Introduction | June 1981 |
| Port(s) | 69/UDP |
| RFC(s) | 1350 |
TFTP was first standardized in 1981[2] and updated in RFC 1350.
Overview
Due to its simple design, TFTP can be easily implemented by code with a small memory footprint. It is, therefore, the protocol of choice for the initial stages of any network booting strategy like BOOTP, PXE, BSDP, etc., when targeting from highly resourced computers to very low resourced Single-board computers (SBC) and System on a Chip (SoC). It is also used to transfer firmware images and configuration files to network appliances like routers, firewalls, IP phones, etc. Today, TFTP is virtually unused for Internet transfers.[1]
TFTP's design was influenced from the earlier protocol EFTP, which was part of the PARC Universal Packet protocol suite. TFTP was first defined in 1980 by IEN 133.[3] In June 1981 The TFTP Protocol (Revision 2) was published as RFC 783 and later updated in July 1992 by RFC 1350 which fixed among other things the Sorcerer's Apprentice syndrome.[4] In March 1995 the TFTP Option Extension RFC 1782 updated later in May 1998 by RFC 2347, defined the option negotiation mechanism which establishes the framework for file transfer options to be negotiated prior to the transfer using a mechanism that is consistent with TFTP's original specification.[5]
TFTP is a simple protocol for transferring files, implemented on top of the UDP/IP protocols using well-known port number 69. TFTP was designed to be small and easy to implement, and therefore it lacks most of the advanced features offered by more robust file transfer protocols. TFTP only reads and writes files from or to a remote server. It cannot list, delete, or rename files or directories and it has no provisions for user authentication. Today TFTP is generally only used on local area networks (LAN).
Operation

A TFTP transfer is initiated by the client issuing a request to read or write a particular file on the server.[6] The request can optionally include a set of negotiated transfer parameters proposed by the client as specified by RFC 2347[5] and may specify a block size as specified by RFS 2348[7]
If the server grants the request, the file is sent in fixed-length blocks (512 bytes unless otherwise specified). Each block of transferred data, which is usually carried within a single IP packet in order to avoid IP fragmentation, must be acknowledged by the client before the next block can be sent. A data packet of less than 512 bytes or the agreed blocksize option signals the termination of a transfer.[6]
If a packet gets lost in the network, the intended recipient will timeout and may retransmit their last packet (which may be data or an acknowledgment), thus causing the sender of the lost packet to retransmit that lost packet.[6]
TFTP defines three modes of transfer: "Netascii",[2] which is a modified form of the ASCII character set with modifications similar to that of the Telnet protocol, "Octet", which consists of arbitrary binary data, and "Mail", which involves Netascii characters sent to an email address rather than a file. The latter mode of transfer has since been labelled obsolete.[6]
TFTP uses the User Datagram Protocol (UDP) at the transport layer. A transfer request is always initiated targeting port 69, but the data transfer ports are chosen independently by the sender and receiver during the transfer initialization. The ports are chosen at random according to the parameters of the networking stack, typically from the range of ephemeral ports.[6]
The original protocol has a transfer file size limit of 65535 blocks, or 32 MB. With RFC 2348 allowing for block sizes of up to 65535 bytes, the maximum size increased to 4 GB.[7] Some servers and clients support block number roll-over, where the block counter resets after passing the 65535 block limit. Although non-standard, this allows for theoretically unlimited transfer file size.[8]
Due to requiring a successful round trip per block, TFTP provides low throughput especially over high latency links. In January 2015 TFTP RFC 7440 was published, which introduces a strategy where a larger amount of uninterrupted data blocks are sent before waiting for the acknowledgement, called "windowing". This substantially improves performance for use cases such as PXE booting, as an alternative to increasing the block size, which is limited by the risk of IP fragmentation.[9]
Usage
TFTP has typically been associated with network booting. One of the first applications was the Bootstrap Loading using TFTP standard RFC 906, published in 1984, which established the 1981 published Trivial File Transfer Protocol standard RFC 783 to be used as the standard file transfer protocol for bootstrap loading.[10][1]
The Preboot Execution Environment (PXE) version 2.0 was released in December 1998, and the update 2.1 was made public in September 1999 counting on TFTP as its file transfer protocol.[11] Intel has recently decided to widely support PXE within the new UEFI specification extending the TFTP support to all EFI/UEFI environments.[12][13]
Security considerations
TFTP provides no builtin security mechanisms. Care must be taken in the rights granted to a TFTP server process so as not to violate the security of the server's file system. As such, is often installed with controls such that only files that have public read access are available via TFTP.[6] Additionally, listing, deleting, renaming, and writing files via TFTP is not supported.[7] TFTP file transfers are not recommended where the inherent protocol limitations could raise insurmountable liability concerns.[9]
IETF standards documentation
| RFC Number | Title | Published | Author | Obsolete and Update Information |
|---|---|---|---|---|
| RFC 783 | The TFTP Protocol (Revision 1) | June 1981 | K. Sollins | Obsoleted by - RFC 1350 |
| RFC 906 | Bootstrap Loading using TFTP | June 1984 | Ross Finlayson | — |
| RFC 951 | Bootstrap Protocol | Sep.1985 | Bill Croft | Updated by RFC 1395, 1497, 1532, 1542, 5494 |
| RFC 1350 | The TFTP Protocol (Revision 2) | July 1992 | K. Sollins | Updated by RFC 1782, 1783, 1784, 1785, 2347, 2348, 2349 |
| RFC 1782 | TFTP Option Extension | March 1995 | G. Malkin | Obsoleted by - RFC 2347 |
| RFC 2090 | TFTP Multicast Option | February 1997 | A. Emberson | Experimental |
| RFC 2131 | Dynamic Host Configuration Protocol | March 1997 | R. Droms | Updated by RFC 3396, 4361, 5494, 6842 |
| RFC 2347 | TFTP Option Extension | May 1998 | G. Malkin | — |
| RFC 2348 | TFTP Blocksize Option | May 1998 | G. Malkin | — |
| RFC 2349 | TFTP Timeout Interval and Transfer Size Options | May 1998 | G. Malkin | — |
| RFC 5505 | Principles of Internet Host Configuration | May 2009 | B. Aboba | — |
| RFC 7440 | TFTP Windowsize Option | Jan 2015 | P. Masotta | — |