TFTP: simple File Transfer Protocol

Source: Internet
Author: User

TFTP: simple File Transfer Protocol (TFTP) (TrivialFileTransferProtocol) is the simple file transfer protocol, initially intended to guide diskless systems (typically workstation or X terminal ). Unlike the file transfer protocol (FTP) that uses TCP, TFTP uses UDP to keep the Protocol simple and short. TFTP code (and the UDP, IP, and device drivers required) can be suitable for read-only memory. (BootstrapProtocol) also encounters TFTP. As shown in the figure, when a sun host is guided over the network, a TFTP request is sent when the sun host obtains its IP address through RARP. RFC1350 [Sollins1992] is the formal specification of TFTP version 2nd. [Steven s1990] provides all the source code for implementing the TFTP client and server, and introduces some programming techniques using TFTP. When the Protocol starts to work, the TFTP client exchanges information with the server, and the client sends a read or write request to the server. When a diskless system performs system boot, the first request is a Read Request (RRQ ). Five TFTP message formats are displayed (the same format is used for messages with the operation code 1 and 2 ). The first two bytes of the TFTP message indicate the operation code. For read requests and write requests (WRQ), the file name field indicates the file on the server to be read or written by the customer. This file field ends with 0 bytes (see figure ). The Mode Field is an ASCII string netascii or octet (any combination of uppercase and lowercase) and ends with 0 bytes. Netascii indicates that data is composed of ASCII characters in a line, and uses two bytes-enter followed by a line break (CR/LF) as the row Terminator. The two line terminator characters are converted between this format and the line delimiters used by the local host. Octet regards data as a byte stream of 8 bits without any explanation. Each Data Group contains a block number field, which will be used in the validation group later. Taking reading a file as an example, the TFTP client needs to send a read request to describe the file name and file mode to be read ). If the file can be read by the client, the TFTP server returns a data group with block number 1. The TFTP client sends another ACK with block number 1. The TFTP server then sends data with block number 2. The TFTP client sends back the ACK with block number 2. Repeat this process until the file is transferred. Except that the last data group can contain less than 512 bytes of data, each other data group contains 512 bytes of data. When a TFTP client receives a Data Group of less than 512 bytes, it knows that it receives the last data group. When writing a request, the TFTP client sends WRQ to specify the file name and mode. If the file can be written by the client, the TFTP server returns an ACK packet with the block number 0. The customer sends the first 512 bytes of the file with the block number 1. The server returns the ACK with the block number 1. This type of data transmission is called the Stop wait protocol. It is only used in some simple protocols such as TFTP. In section 20.3, we can see that TCP provides different types of validation to provide higher system throughput. The advantage of TFTP is that it is easy to implement, rather than high system throughput. The last TFTP packet type is error message, and its operation code is 5. It is used when the server cannot process read or write requests. Reading and writing errors during file transmission can also lead to transmission of such packets and then stop transmission. The error code is followed by an ASCII error message field, which may contain additional operating system instructions. Since TFTP uses unreliable UDP, TFTP must process packet loss and duplicate groups. Packet loss can be solved through the sender's timeout and retransmission mechanism (note that there is a potential problem called "sorcerer 'sapprenticesyndrome"). If both parties timeout and retransmission, this problem may occur. [Steven s1990] describes how this problem occurs ). Like many UDP applications, the TFTP message is not tested. It assumes that any data error will be detected by UDP.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.