--- TFTP file transfer protocol

Brief introduction

  TFTP protocol called the Trivial File Transfer Protocol, is a UDP-based application layer protocol used to transfer files between different devices. It has a simple protocol, easy-to-implement features, commonly used in embedded device development.

 

Transfer mode

  Storing data have different formats, the same piece of data on a disk, analyzed by the different storage protocols, the content obtained is completely different, such as: a disk byte 0x65, parsing the ASCII alphabet is A, according to the data itself the resolution refers to the number of content 0x65, two analytical fashion show is completely different. Thus in the process of file transfer also need to specify the data is represented, i.e., the transmission mode. TFTP protocol transmission mode are as follows:

Mode Name Mode Meaning Explanation
netascii Text transmission mode, according to an 8-bit bytes parsed Text mode
octet Binary mode, data need not be parsed Binary mode
mail Obsolete, do not use Obsolete

Protocol format

  TFTP distinguish five types were defined packet format, a packet format of the first two bytes of data to distinguish Opcode field, namely:

  • File reading request packet: Read request, abbreviated as RRQ, Opcode field value corresponding to 1
  • File write request packet: Write requst, abbreviated as WRQ, Opcode field value corresponding to 2
  • File packet: Data, abbreviated as DATA, the corresponding field is Opcode 3
  • Response packet: Acknowledgement, abbreviated is ACK, Opcode field value corresponding to 4
  • Erroneous packet: Error, abbreviated as ERROR, Opcode field value corresponding to 5

 

File reading request packet

 

2 bytes String 1 byte String 1 byte
Opcode Filename  0          Mode   0         

 

Opcode Operation Code 1

Filename file name

Mode Transfer Mode

 

Guess you like

Origin www.cnblogs.com/chusiyong/p/11389442.html