FTP and TFTP
Two file-transfer protocols, two very different designs. FTP is the full-featured original: authenticated, directory-aware, and unusual in that it uses two TCP connections. TFTP strips all of that away to move a file with no login and no listing — which is exactly why it is the tool network engineers use to back up and restore router configurations.
FTP: the file-transfer workhorse
FTP (File Transfer Protocol) is a client–server protocol for moving files between a client and a server. It is one of the oldest Internet protocols and is standardised in RFC 959. The server offers a directory tree; the client logs in and can list, upload, download, rename, and delete files.
The single most examined fact about FTP is that it is not one connection but two. A firewall that only permits the control connection will let the session start but no file will ever transfer.
The two connections
FTP separates talking from moving data.
| Connection | Purpose | Port (well-known) | Lifetime |
|---|---|---|---|
| Control connection | Carries commands and replies (login, change directory, request a transfer). | TCP 21 | Stays open for the whole session. |
| Data connection | Carries the actual file, or a directory listing. | TCP 20 in active mode | Opened and closed for each transfer. |
Because the control and data channels are independent, FTP can transfer a file while still receiving commands, and it can open a fresh data connection for each operation without tearing down the session.
Active vs passive mode
The two connections create a direction problem: who opens the data connection? FTP has two answers, and the difference matters whenever NAT or a firewall is in the path.
A typical FTP session
An FTP session is a conversation of commands over the control connection. Server replies are three-digit codes (220 = service ready, 331 = password required, 230 = logged in, 150 = opening data connection, 226 = transfer complete). Select a command to see what it does.
| Command | Meaning |
|---|---|
| USER / PASS | Supply the username and password. |
| PASV | Enter passive mode (client will open the data connection). |
| LIST | List the directory contents (transferred over the data connection). |
| RETR | Retrieve (download) a file from the server. |
| STOR | Store (upload) a file to the server. |
| QUIT | End the session and close the control connection. |
FTPS vs SFTP
Plain FTP sends the username, password, and file contents in cleartext, so it must be protected. Two different solutions are commonly confused. Pick one to see the detail.
- FTPS (FTP Secure) — FTP with TLS added. It comes in two styles. Explicit FTPS starts on the normal control port 21 and upgrades with
AUTH TLS. Implicit FTPS uses dedicated TLS ports — TCP 990 for control and TCP 989 for data. - SFTP (SSH File Transfer Protocol) — a different protocol that runs inside SSH, normally on TCP 22. It provides encrypted authentication and transfer, but it is not FTP at all and shares no commands with it.
TFTP: the trivial one
TFTP (Trivial File Transfer Protocol) is defined in RFC 1350. It is a deliberately minimal file-transfer protocol designed to be simple enough to fit in a small amount of memory — for example in a device booting from the network.
- No authentication — no username or password.
- No directory listing — you must know the exact file name.
- No encryption — everything travels in cleartext.
- A tiny command set and a 512-byte block size, using UDP for transport.
TFTP’s real home is network and device management. Cisco IOS uses it to back up and restore configurations and to load operating-system images, and many devices use it for network/PXE boot and firmware updates. Because it has no authentication, TFTP must be confined to a trusted management network.
! Back up the running configuration to a TFTP server R1# copy running-config tftp: Address or name of remote host []? 192.168.1.100 Destination filename [R1-confg]? R1-backup.cfg ! ...bytes copied, transfer complete ! Restore it later R1# copy tftp: running-config
Review
Check what you have learned with these review questions.
Sources & references
- Postel, J. & Reynolds, J. RFC 959: File Transfer Protocol (FTP) (1985). rfc-editor.org/rfc/rfc959.
- Sollins, K. RFC 1350: The TFTP Protocol (Revision 2) (1992). rfc-editor.org/rfc/rfc1350.
- Ford-Hutchinson, P. RFC 4217: Securing FTP with TLS (2005). rfc-editor.org/rfc/rfc4217.
- IANA. Service Name and Transport Protocol Port Number Registry (FTP 20/21, TFTP 69, FTPS 989/990). iana.org.
- Cisco. CCNA (200-301) Exam Topics, IP Services and device management. cisco.com.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.