Table of Contents
Overview
TFTP is a simple file transfer protocol. It is often used to transfer configuration files of routers and other network devices. This section explains how TFTP works and how to use a Cisco router as a TFTP server/client.
What is TFTP?
TFTP (Trivial File Transfer Protocol) is a simple file transfer protocol. When transferring files using TFTP, no user authentication is performed. It also uses UDP (well-known port 69) at the transport layer, which allows efficient file transfers without the overhead of establishing a TCP connection. Compared to FTP and HTTP, which use TCP at the transport layer, file transfers are not as reliable. TFTP is used to easily transfer files that are not very large in size, such as router configuration files.
The TFTP specification is defined in RFC 1350.
How TFTP works
When transferring files with TFTP, TFTP server application and TFTP client application are required. The flow of operation between the TFTP server application and the client application is as follows
- Send request command
- File data transfer and acknowledgement
Send request command
Sends a request command from TFTP client application to TFTP server application.In this case, the destination port number is 69. The source port number is random.
File data transfer and acknowledgement
Transfers file data in response to a request command. The TFTP server determines a random port number for file data transfer. The port number of the TFTP client side is the port number when the request command is sent. File data transfer by TFTP is 512 bytes per transfer. Files that are large in size are divided by TFTP into blocks of 512 bytes each.
When transferring files with TFTP, TFTP acknowledgment (ACK) is performed. If even one of the fragmented blocks is not received, the file cannot be re-assembled, so an acknowledgment is made at the level of TFTP.
The exchange of 512-byte blocks of segmented file data and corresponding acknowledgements is repeated as often as necessary. When the transfer of blocks of less than 512 bytes is finally completed, the TFTP file transfer is complete.
If there is a router or firewall performing packet filtering between the TFTP server and the client, the packet filter conditions should be noted. Please configure the packet filter conditions taking into account that the TFTP server uses not only UDP69 but also random ports.
Using Cisco routers as TFTP server and TFTP client
Cisco routers can be used as TFTP server and TFTP client.
TFTP Server Configuration
Cisco routers can act as TFTP servers. Then the TFTP client can download files on the router’s flash or NVRAM. To do so, enter the following command from global configuration mode.
TFTP Server Configuration
(config)#tftp-server <file-path>
<file-path> : File path to be downloaded using TFTP
TFTP Client
You can use Cisco routers as TFTP clients to transfer files to and from TFTP servers; to download a file on a TFTP server to the router’s flash memory, etc., in privileged EXEC mode, enter the following.
TFTP Client download
#copy tftp <copy-destination>
<copy-destination> : destination file
If you do not specify the IP address of the TFTP server or the name of the file to download when you enter the command, you will be prompted for the necessary information as shown below.
TFTP Client download Sample
R1#copy tftp nvram Address or name of remote host []? 192.168.12.1 Source filename []? r1-config Destination filename [nvram]? startup-config
“Address or name of remote host” is the IP address of the TFTP server. “Source filename” is the name of the file to download on the TFTP server. “Destination filename” is the name of the file to be saved locally on the router.
Also, when uploading a file on the router’s flash memory or other storage to the TFTP server, enter the following in privileged EXEC mode
TFTP Client upload
#copy <copy-source> tftp
<copy-source> : Source file
Again, if the required information is not specified when entering the command, you will be asked to enter the required information.
TFTP Client upload sample
R1#copy nvram: tftp Source filename []? startup-config Address or name of remote host []? 192.168.12.1 Destination filename [r1-confg]?
“Address or name of remote host” is the IP address of the TFTP server. “Source filename” is the name of the file to be uploaded locally on the router. “Destination filename” is the name of the file to be stored on the TFTP server.
Summary
Points
- TFTP is a simple file transfer protocol. It is often used to transfer small files such as configuration files of routers and other network devices.
- UDP is used at the transport layer and the well-known port number is 69. However, a random port is also used on the server side.
- Cisco routers can be used as TFTP servers and TFTP clients.
Related article
The following article explains how to enable the TFTP client on Windows 10.
Link
TCP/IP
- IP(Internet Protocol) : The Most Important Data Transfer Protocol
- Ping “Will the data be transfered properly?”
- Ping command on Windows OS
- Traceroute : Which router does the data go through?
- ICMP Redirect
- Where’s the Trouble? Ping and Traceroute
- ARP(Address Resolution Protocol)
- ARP Format
- Gratuitous ARP(GARP)
- nslookup command : Verifying DNS name resolution
- DHCP : Automatically Assign IP Address
- Cisco IOS DHCP Server Configuration and Verification Commands
- Cisco Router DHCP Server Configuration Example
- DHCP Relay Agent
- DHCP Relay Agent Configuration Example [Cisco]
- Summary of DHCP Server Placement
- TCP/IP Configuration Summary
- ipconfig command : To verify TCP/IP configurations on Windows OS
- Commands to Verify TCP/IP Configuration On Linux (Ubuntu)
- Web Proxy Server
- FTP : Representative File Transfer Protocol
- TFTP(Trivial File Transfer Protocol)
- TFTP Client on Windows10/11