| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
TFTP General Operation, Connection Establishment and Client/Server Communication (Page 1 of 3) Since the T in TFTP stands for trivial, and the protocol was specifically designed to be simple, you would think that describing how it works would, in fact, be simple, wouldn't you? Well, actually, it pretty much is. Sorry, I couldn't resist setting you up there. J TFTP communication is client/server based, as discussed in the overview. The process of transferring a file consists of three main phases. In highly generalized terms, these are:
The concept of a connection is somewhat different in TFTP than it is with a protocol like FTP that uses TCP. FTP must establish a connection at the TCP level before anything can be done by FTP itself. TFTP, however, uses the connectionless UDP for transport, so there is no connection in the sense that one exists in TCP. In TFTP, the connection is more in a logical sense, meaning that the client and server are participating in the protocol and exchanging TFTP messages. The TFTP server listens continuously for requests on well-known UDP port number 69, which is reserved for TFTP. The client chooses for its initial communication an ephemeral port number, as is usually the case in TCP/IP. This port number actually identifies the data transfer, and is called a transfer identifier (TID). What's different about TFTP, however, is that the server also selects a pseudo-random TID that it uses for sending responses back to the client; it doesn't send them from port number 69. The reason this is done is that by using unique client port number and source port number, multiple TFTP exchanges can be conducted simultaneously by a server. Each transfer is identified automatically by the source and destination port number, so there is no need to identify in data messages the transfer to which each block data belongs. This keeps the TFTP header size down, allowing more of each UDP message to contain actual data. For example, suppose the TFTP client selects a TID of 3,145 for its initial message. It would send a UDP transmission from its port 3,145 to the server's port 69. Say the server selects a TID of 1,114. It would send its reply from its port 1,114 to the client's port 3,145. From then on, the client would send messages back to server port 1,114 until the TFTP session was completed.
Home - Table Of Contents - Contact Us The TCP/IP Guide (http://www.TCPIPGuide.com) Version 3.0 - Version Date: September 20, 2005 © Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved. Not responsible for any loss resulting from the use of this site. |