Open menu

Learn

Is SFTP Based on TCP or UDP?

The Secure File Transfer Protocol (SFTP), as its name suggests, is a standard network protocol used for the transfer of computer files between a client and server on a computer network. When discussing SFTP, a common question that arises is whether it operates on TCP or UDP. To address this query directly, SFTP uses the Transmission Control Protocol (TCP) for data transfer, not the User Datagram Protocol (UDP).

Why SFTP Uses TCP

SFTP was designed to deliver secure and reliable file transfer, which is why it uses TCP as its transport layer protocol. TCP's reliability and connection-oriented nature make it a perfect match for SFTP. In a file transfer scenario, the consistency and order of data packets are of utmost importance. A missing packet or packets received in the wrong sequence could corrupt a file, rendering it useless. TCP, with its error-checking and resending capabilities, ensures that the data transferred is the same as the data received, critical for file transfers. Moreover, because SFTP provides file access and file management functions in addition to file transfers, it requires a reliable connection between the client and server. Here again, TCP's connection-oriented design comes to the fore. Before data transmission begins, TCP establishes a connection between the sender and receiver and maintains it until the transfer is complete.