TFTP Trivial File Transfer Protocol

TFTP (Trivial File Transfer Protocol) file transfer protocol that is simple, originally intended for guiding diskless system
(typically a workstation or X terminal). And will use different TCP file transfer protocol introduced (FTP), to
keep it simple and short, TFTP uses UDP. TFTP code (and UDP, IP, and it requires a device driver)
can fit a read only memory.
This article describes the TFTP only for general introduction, because the Bootstrap Protocol (Bootstrap Protocol) also in the case of
the TFTP. When the sun master boot from the network, have encountered TFTP, RARP eligible by the host sun
after obtain its IP address, will send a TFTP request.

 

 Agreement
at the beginning of the work, TFTP client and server exchange information, the client sends a read or write requests to the server.
Under normal circumstances the system boot in a diskless system, the first request is a read request (RRQ). FIG 15--1 shows the five
Species TFTP packet format (opcode 1 and 2 packets of the same format).
TFTP packets first two bytes and operation code. For read and write requests (WRQ), the file name field explain customer
users to read or write files located on the server. This document field to 0 as the end byte is an ASCII string or netascii OCTET (may be the case in any combination), the same ending in 0 bytes. netascii
data representing rows of ASCII code is characters, two bytes - carriage return character followed by a newline character (referred to as a CR / LF)
as a line terminator. Both transformed End of line character line delimiter between this format and use of the local host.
then the octet stream 8 bit byte data as a group without any explanation.
Each data packet contains a block number field, it is to be used later in the acknowledgment packet. To read a file as in Example
promoter, TFTP client needs to send a read request to the file name and description to be read mode (mode). If the file can be
the client reads, TFTP server returns a block number 1 data packets. TFTP client in turn sends a block number
of the ACK 1. TFTP server then sends the data block number 2. TFTP client sends back ACK 2 to the block number. Repeat
this process until the file transfer is complete. Finally, a data packet may contain less than 512 bytes, in addition to each other
Data packets contain 512 bytes of data. When the TFTP client receives a 512-byte data packets insufficient, we know that it received
to the last data packet.
In the case of a write request, TFTP client sends the WRQ specify the file name and mode. If the file can be written to the client,
the TFTP server returns an ACK packet block number is zero. The customer will first file 512-byte block number is one issued. Server
service returns an ACK 1 to the block number.
This type of data transmission is called stop-wait protocol. It is only used in some protocols such as simple in TFTP. In a 2-0.3
will be seen to provide a TCP acknowledgment different forms, provides higher system throughput. TFTP advantage achieved is that the simple
single rather than high system throughput. . mold

The last TFTP error message type is a packet, which is the operation code 5. It can not process a read request for the server or a
case of a write request. Read and write errors during a file transfer in this transfer will result in packets, then stops transmission. The difference between
wrong number field is given a numeric error code, followed by an error message fields ASCII representation, may contain additional
information about the operating system.
Since TFTP using the unreliable UDP, TFTP must deal with packet loss and packet duplication. Packet loss can be made by
solving a timeout and retransmission mechanism parties to send (note that there is a called a "magic novice syndrome (Sorcere r's Apprentice
S yndrome)" potential problem, if both the timeout and retransmission, this can occur problem. Like many UDP applications, TFTP packet inspection and no,
it is assumed that any data errors will be detected and UDP inspection

Guess you like

Origin www.cnblogs.com/momenglin/p/11261436.html