background image
234 Chapter 5: Network Protocols
connection, as well as the type of data (binary or ASCII). The control connection stays up until
the user breaks it. While the control connection is up, a separate data connection is established
for each file transfer.
An additional step helps prevent hackers from breaking in and transferring files, as shown in
Figure 5-16. Rather than just creating a new connection, the client tells the server with an
application layer message what port number will be used for the new connection. The server
will not transfer the file (zzz, in this case) over any other data connection except the one to the
correct socket--the one with the client's IP address, TCP, and the port number declared to the
server (1031, in this case).
TFTP
Trivial File Transfer Protocol (TFTP) is a UDP-based application with very basic features. One
of the reasons that such an application is needed (when the more robust FTP is available) is that
TFTP takes little memory to load and takes little time to program. With the advent of extremely
low-cost memory and processing, such advantages seem trivial. Practically speaking, if you
intend to transfer files frequently from your PC, FTP is probably what you will use. However,
to transfer files into and out of IOS-based routers and switches, Cisco supports TFTP, not FTP.
TFTP uses UDP, so there is no connection establishment and no error recovery by the transport
layer. However, TFTP uses application layer recovery by embedding a small header between
the UDP header and the data. This header includes codes--for instance, read, write, and
acknowledgment--along with a numbering scheme that numbers 512-byte blocks of data.
These block numbers are used to acknowledge receipt and resend the data. TFTP sends one
block and waits on an acknowledgment before sending another block--essentially, the
equivalent of a window size of 1.
Table 5-7 summarizes some features of TFTP and FTP.
Table 5-7
Comparison of FTP and TFTP
FTP
TFTP
Uses TCP
Uses UDP
Uses robust control commands
Uses simple control commands
Sends data over a separate TCP connection from
control commands
Uses no connections, due to UDP
Requires more memory and programming effort
Requires less memory and programming effort
Is not supported as an application in IOS
Is supported as an application in IOS
ch05.fm Page 234 Monday, March 20, 2000 5:06 PM