?? 00000015.htm
字號(hào):
---------------------------------- <br /> | Opcode | Block # | Data | <br /> ---------------------------------- <br /> Figure 5-2: DATA packet <br /> Data is actually transferred in DATA packets depicted in Figure 5-2. <br /> DATA packets (opcode = 3) have a block number and data field. The <br /> block numbers on data packets begin with one and increase by one for <br /> each new block of data. This restriction allows the program to use a <br /> single number to discriminate between new packets and duplicates. <br /> The data field is from zero to 512 bytes long. If it is 512 bytes <br /> long, the block is not the last block of data; if it is from zero to <br /> 511 bytes long, it signals the end of the transfer. (See the section <br /> on Normal Termination for details.) <br /> All packets other than duplicate ACK's and those used for <br /> termination are acknowledged unless a timeout occurs [4]. Sending a <br /> DATA packet is an acknowledgment for the first ACK packet of the <br /> previous DATA packet. The WRQ and DATA packets are acknowledged by <br /> ACK or ERROR packets, while RRQ <br /> 2 bytes 2 bytes <br /> --------------------- <br /> | Opcode | Block # | <br /> --------------------- <br /> Figure 5-3: ACK packet <br /> and ACK packets are acknowledged by DATA or ERROR packets. Figure <br /> 5-3 depicts an ACK packet; the opcode is 4. The block number in <br /> an ACK echoes the block number of the DATA packet being <br /> acknowledged. A WRQ is acknowledged with an ACK packet having a <br /> block number of zero. <br />Sollins [Page 7] <br /> <br />RFC 1350 TFTP Revision 2 July 1992 <br /> 2 bytes 2 bytes string 1 byte <br /> ----------------------------------------- <br /> | Opcode | ErrorCode | ErrMsg | 0 | <br /> ----------------------------------------- <br /> Figure 5-4: ERROR packet <br /> An ERROR packet (opcode 5) takes the form depicted in Figure 5-4. An <br /> ERROR packet can be the acknowledgment of any other type of packet. <br /> The error code is an integer indicating the nature of the error. A <br /> table of values and meanings is given in the appendix. (Note that <br /> several error codes have been added to this version of this <br /> document.) The error message is intended for human consumption, and <br /> should be in netascii. Like all other strings, it is terminated with <br /> a zero byte. <br />6. Normal Termination <br /> The end of a transfer is marked by a DATA packet that contains <br /> between 0 and 511 bytes of data (i.e., Datagram length < 516). This <br /> packet is acknowledged by an ACK packet like all other DATA packets. <br /> The host acknowledging the final DATA packet may terminate its side <br /> of the connection on sending the final ACK. On the other hand, <br /> dallying is encouraged. This means that the host sending the final <br /> ACK will wait for a while before terminating in order to retransmit <br /> the final ACK if it has been lost. The acknowledger will know that <br /> the ACK has been lost if it receives the final DATA packet again. <br /> The host sending the last DATA must retransmit it until the packet is <br /> acknowledged or the sending host times out. If the response is an <br /> ACK, the transmission was completed successfully. If the sender of <br /> the data times out and is not prepared to retransmit any more, the <br /> transfer may still have been completed successfully, after which the <br /> acknowledger or network may have experienced a problem. It is also <br /> possible in this case that the transfer was unsuccessful. In any <br /> case, the connection has been closed. <br />7. Premature Termination <br /> If a request can not be granted, or some error occurs during the <br /> transfer, then an ERROR packet (opcode 5) is sent. This is only a <br /> courtesy since it will not be retransmitted or acknowledged, so it <br /> may never be received. Timeouts must also be used to detect errors. <br />Sollins [Page 8] <br /> <br />RFC 1350 TFTP Revision 2 July 1992 <br />I. Appendix <br />Order of Headers <br /> 2 bytes <br /> ---------------------------------------------------------- <br /> | Local Medium | Internet | Datagram | TFTP Opcode | <br /> ---------------------------------------------------------- <br />TFTP Formats <br /> Type Op # Format without header <br /> 2 bytes string 1 byte string 1 byte <br /> ----------------------------------------------- <br /> RRQ/ | 01/02 | Filename | 0 | Mode | 0 | <br /> WRQ ----------------------------------------------- <br /> 2 bytes 2 bytes n bytes <br /> --------------------------------- <br /> DATA | 03 | Block # | Data | <br /> --------------------------------- <br /> 2 bytes 2 bytes <br /> ------------------- <br /> ACK | 04 | Block # | <br />
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -