• Home
  • InfoBase
  • Dictionaries
  • Member
  • News
  • 中文网站
     Advanced Search
    Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

    TFTP: Trivial File Transfer Protocol

    Trivial File Transfer Protocol (TFTP) is a simple protocol to transfer files. It has been implemented on top of the Internet User Datagram protocol (UDP or Datagram). TFTP is designed to be small and easy to implement, therefore, lacks most of the features of a regular FTP. TFTP only reads and writes files (or mail) from/to a remote server. It cannot list directories, and currently has no provisions for user authentication.

    In TFTP, any transfer begins with a request to read or write a file, which also serves to request a connection. If the server grants the request, the connection is opened and the file is sent in fixed length blocks of 512 bytes. Each data packet contains one block of data, and must be acknowledged by an acknowledgment packet before the next packet can be sent. A data packet of less than 512 bytes signals termination of a transfer. If a packet gets lost in the network, the intended recipient will timeout and may retransmit his last packet (which may be data or an acknowledgment), thus causing the sender of the lost packet to retransmit that lost packet. The sender has to keep just one packet on hand for retransmission, since the lock step acknowledgment guarantees that all older packets have been received. Notice that both machines involved in a transfer are considered senders and receivers. One sends data and receives acknowledgments, the other sends acknowledgments and receives data.

    Three modes of transfer are currently supported by TFPT: netascii, that it is 8 bit ascii; octet (This replaces the "binary" mode of previous versions of this document.) raw 8 bit bytes; mail, netascii characters sent to a user rather than a file. Additional modes can be defined by pairs of cooperating hosts.

    The current version of TFTP is version 2 (TFTPv2).

    Protocol Structure

    The basic TFTP header structure:

    16bits String 16bits String 16bits
    Opcode Filename 0 Mode 0

    Opcode C Operation code or commands. The following are TFTP commands:

    Opcode Command Description
    1 Read Request Request to read a file.
    2 Write Request Request to write to a file.
    3 File Data Transfer of file data.
    4 Data Acknowledge Acknowledgement of file data.
    5 Error Error indication.

    Filename C The to be transferred file name.

    Mode - Datamode. The format of the file data that the protocol is to transfer. It could be NetASCII Standard ASCII, Octet Eight-bit binary data, or Mail Standard ASCII.

    Related Terms: UDP, FTP

    Sponsor Source: TFTP is defined by IETF (http://www.ietf.org) in RFC 1350.

    Reference:
    http://www.javvin.com/protocol/rfc1350.pdf: The TFTP Protocol (Revision 2).