TFTP (Trivial File Transfer Protocol)
- Lightweight file transfer protocol designed for simplicity over features
- Uses UDP port 69 (connectionless, no reliability guarantees)
- No authentication - relies on network-level security
- No directory listing - must know exact filename
- Maximum file size limited to 32MB due to 16-bit block numbering
- Primarily used for network device operations (router/switch firmware, config backups)
FTP (File Transfer Protocol)
- Full-featured file transfer protocol with comprehensive functionality
- Uses TCP ports 20 (data) and 21 (control) for reliable delivery
- Requires authentication with username/password
- Supports directory browsing, file management, and multiple transfer modes
- No practical file size limitations
- Two connection modes: Active (server initiates data connection) and Passive (client initiates both connections)
Protocol Comparison
| Feature | TFTP | FTP |
|---|---|---|
| Transport Protocol | UDP (port 69) | TCP (ports 20/21) |
| Authentication | None | Username/Password |
| Security | Minimal | Basic (cleartext by default) |
| File Size Limit | 32MB | No practical limit |
| Directory Operations | No | Yes |
| Reliability | None (UDP) | Built-in (TCP) |
| Complexity | Minimal | Full-featured |
| Typical Use | Device management | General file transfer |
Common Use Cases
TFTP Applications:
- Router/switch firmware upgrades (
copy tftp: flash:) - Configuration file backups (
copy running-config tftp:) - PXE boot environments for network installations
- Cisco IP phone firmware delivery
- Small file transfers in controlled environments
FTP Applications:
- Large file transfers between systems
- Website content management
- Database backups and synchronization
- Software distribution
- General-purpose file sharing (though largely replaced by SFTP/FTPS)
Vocabulary
Active FTP: Server initiates data connection back to client (can cause firewall issues)
Passive FTP: Client initiates both control and data connections (firewall-friendly)
Block Size: TFTP transfers files in 512-byte blocks by default (can negotiate larger)
Acknowledgment: TFTP requires ACK for each block before sending next (stop-and-wait)
Binary vs ASCII: Transfer modes - binary for executables/images, ASCII for text files
Notes
- TFTP is inherently insecure - use only on trusted networks or with VPN protection
- TFTP’s simplicity makes it ideal for embedded systems with limited memory/processing
- For production environments, consider SFTP (SSH File Transfer Protocol) or FTPS (FTP over SSL/TLS) instead of standard FTP
- TFTP timeout and retry mechanisms vary by implementation - typically 5-second timeouts with 5 retries
- When using
copycommands on Cisco devices, TFTP is often the default protocol unless otherwise specified - FTP active mode often blocked by firewalls since server connects back to client - use passive mode for NAT/firewall traversal
- Both protocols transfer credentials and data in cleartext - monitor network access carefully