Table of Contents 3270 Full-Screen Cross Table
TCP/IP Tutorial and Technical Overview

4.3 Trivial File Transfer Protocol (TFTP)




Figure: Trivial File Transfer Protocol (TFTP)

The TFTP protocol is a standard protocol with STD number 33. Its status is elective and it is described in RFC 1350 - The TFTP Protocol (Revision 2).

TCP/IP file transfer is a disk-to-disk data transfer, as opposed to, for example, the VM SENDFILE command, a function that is considered in the TCP/IP world as a mailing function, where you send out the data to someone's mailbox (reader in the case of VM).

TFTP is an extremely simple protocol to transfer files. It is implemented on the internet UDP layer (User Datagram Protocol) and lacks most of the features of FTP (see File Transfer Protocol (FTP)). The only thing it can do is read/write a file from/to a server.

Note: It has no provisions for user authentication: it is an unsecure protocol.

4.3.1 Usage

The command:

TFTP <hostname>
takes you to the interactive prompt where you can enter subcommands:
Connect <host>
specify destination host ID
Mode <ascii/binary>
specify the type of transfer mode
Get <remote filename> [<local filename>]
retrieve a file
Put <remote filename> [<local filename>]
store a file
Verbose
toggle verbose mode, which displays additional information during file transfer, on or off
Quit
exit TFTP
For a full list of these commands, see the user's guide of your particular TFTP implementation.

4.3.2 Protocol Description

Any transfer begins with a request to read or write a file. If the server grants the request, the connection is opened and the file is sent in blocks of 512 bytes (fixed length). Blocks of the file are numbered consecutively, starting at 1. Each data packet must be acknowledged by an acknowledgment packet before the next one can be sent. Termination of the transfer is assumed on a data packet of less than 512 bytes.

Almost all errors will cause termination of the connection (lack of reliability). If a packet gets lost in the network, a timeout will occur, after which a retransmission of the last packet (data or acknowledgment) will take place.

There was a serious bug, known as the Sorcerer's Apprentice Syndrome, in RFC 783. It may cause excessive retransmission by both sides in some network delay scenarios. It was documented in RFC 1123 and was corrected in RFC 1350. For details, please refer to the RFCs.

4.3.2.1 TFTP Packets

Only five types of packets exist:

Opcode

Operation
1
Read Request (RRQ)
2
Write Request (WRQ)
3
Data (DATA)
4
Acknowledgment (ACK)
5
Error (ERROR)
The TFTP header contains the opcode associated with the packet.


Figure: TFTP Packets

4.3.2.2 Data Modes

Three modes of transfer are currently defined in RFC 1350:

NetASCII
US-ASCII as defined in USA Standard Code for Information Interchange with modifications specified in RFC 854 - Telnet Protocol Specification and extended to use the high order bit. That is, it is an 8-bit character set, unlike US-ASCII which is 7-bit.
Octet
Raw 8-bit bytes, also called binary.
Mail
This mode was originally defined in RFC 783 and was declared obsolete by RFC 1350. It allowed for sending mail to a user rather than transferring to a file.

The mode used is indicated in the Request for Read/Write packet (RRQ/WRQ).

4.3.3 Implementations

TFTP is implemented in the IBM TCP/IP products for VM (client only), AIX/6000, AIX/ESA, OS/2 and DOS.

4.3.3.1 AIX/ESA

Both the TFTP client and server functions are available.

Note: The TFTP functions are usually disabled due to security requirements. This is especially the case in AIX/ESA. For more details, please refer to AIX/ESA Security Features User's Guide.

4.3.3.2 AIX/6000

The tftpd server (daemon) is a subserver controlled by the inetd subsystem (also known as the super daemon).

The tftp and utftp client commands are available, but they are not recommended for use in a secure environment. The securetcpip command can be used to disable tftpd, tftp and utftp.

4.3.3.3 OS/2

Because of the above-mentioned lack of authorization, there are two different ways to start the TFTP daemon (TFTPD) in an OS/2 machine (TEMP is used as an example: it could be another name):

4.3.3.4 DOS

TCP/IP for DOS provides a TFTP client. This is started from the DOS prompt using the tftp command.

Table of Contents File Transfer Protocol (FTP)