?? 00000015.htm
字號:
considered senders and receivers. One sends data and receives <br /> acknowledgments, the other sends acknowledgments and receives data. <br /> Most errors cause termination of the connection. An error is <br /> signalled by sending an error packet. This packet is not <br /> acknowledged, and not retransmitted (i.e., a TFTP server or user may <br /> terminate after sending an error message), so the other end of the <br /> connection may not get it. Therefore timeouts are used to detect <br /> such a termination when the error packet has been lost. Errors are <br />Sollins [Page 2] <br /> <br />RFC 1350 TFTP Revision 2 July 1992 <br /> caused by three types of events: not being able to satisfy the <br /> request (e.g., file not found, access violation, or no such user), <br /> receiving a packet which cannot be explained by a delay or <br /> duplication in the network (e.g., an incorrectly formed packet), and <br /> losing access to a necessary resource (e.g., disk full or access <br /> denied during a transfer). <br /> TFTP recognizes only one error condition that does not cause <br /> termination, the source port of a received packet being incorrect. <br /> In this case, an error packet is sent to the originating host. <br /> This protocol is very restrictive, in order to simplify <br /> implementation. For example, the fixed length blocks make allocation <br /> straight forward, and the lock step acknowledgement provides flow <br /> control and eliminates the need to reorder incoming data packets. <br />3. Relation to other Protocols <br /> As mentioned TFTP is designed to be implemented on top of the <br /> Datagram protocol (UDP). Since Datagram is implemented on the <br /> Internet protocol, packets will have an Internet header, a Datagram <br /> header, and a TFTP header. Additionally, the packets may have a <br /> header (LNI, ARPA header, etc.) to allow them through the local <br /> transport medium. As shown in Figure 3-1, the order of the contents <br /> of a packet will be: local medium header, if used, Internet header, <br /> Datagram header, TFTP header, followed by the remainder of the TFTP <br /> packet. (This may or may not be data depending on the type of packet <br /> as specified in the TFTP header.) TFTP does not specify any of the <br /> values in the Internet header. On the other hand, the source and <br /> destination port fields of the Datagram header (its format is given <br /> in the appendix) are used by TFTP and the length field reflects the <br /> size of the TFTP packet. The transfer identifiers (TID's) used by <br /> TFTP are passed to the Datagram layer to be used as ports; therefore <br /> they must be between 0 and 65,535. The initialization of TID's is <br /> discussed in the section on initial connection protocol. <br /> The TFTP header consists of a 2 byte opcode field which indicates <br /> the packet's type (e.g., DATA, ERROR, etc.) These opcodes and the <br /> formats of the various types of packets are discussed further in the <br /> section on TFTP packets. <br />Sollins [Page 3] <br /> <br />RFC 1350 TFTP Revision 2 July 1992 <br /> --------------------------------------------------- <br /> | Local Medium | Internet | Datagram | TFTP | <br /> --------------------------------------------------- <br /> Figure 3-1: Order of Headers <br />4. Initial Connection Protocol <br /> A transfer is established by sending a request (WRQ to write onto a <br /> foreign file system, or RRQ to read from it), and receiving a <br /> positive reply, an acknowledgment packet for write, or the first data <br /> packet for read. In general an acknowledgment packet will contain <br /> the block number of the data packet being acknowledged. Each data <br /> packet has associated with it a block number; block numbers are <br /> consecutive and begin with one. Since the positive response to a <br /> write request is an acknowledgment packet, in this special case the <br /> block number will be zero. (Normally, since an acknowledgment packet <br /> is acknowledging a data packet, the acknowledgment packet will <br /> contain the block number of the data packet being acknowledged.) If <br /> the reply is an error packet, then the request has been denied. <br /> In order to create a connection, each end of the connection chooses a <br /> TID for itself, to be used for the duration of that connection. The <br /> TID's chosen for a connection should be randomly chosen, so that the <br /> probability that the same number is chosen twice in immediate <br /> succession is very low. Every packet has associated with it the two <br /> TID's of the ends of the connection, the source TID and the <br /> destination TID. These TID's are handed to the supporting UDP (or <br /> other datagram protocol) as the source and destination ports. A <br /> requesting host chooses its source TID as described above, and sends <br /> its initial request to the known TID 69 decimal (105 octal) on the <br /> serving host. The response to the request, under normal operation, <br /> uses a TID chosen by the server as its source TID and the TID chosen <br /> for the previous message by the requestor as its destination TID. <br /> The two chosen TID's are then used for the remainder of the transfer. <br /> As an example, the following shows the steps used to establish a <br /> connection to write a file. Note that WRQ, ACK, and DATA are the <br /> names of the write request, acknowledgment, and data types of packets <br /> respectively. The appendix contains a similar example for reading a <br /> file. <br />Sollins [Page 4] <br /> <br />RFC 1350 TFTP Revision 2 July 1992 <br /> 1. Host A sends a "WRQ" to host B with source= A's TID, <br />
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -