TCP Port Number 21 and How It Works with FTP – Knowligent
TCP Port Number 21 and How It Works with FTP

TCP Port Number 21 and How It Works with FTP

HomeHow to, TechTCP Port Number 21 and How It Works with FTP

The File Transfer Protocol provides a framework for transferring information between two computers on a network, much as Hypertext Transfer Protocol does through a Web browser. However, FTP operates on two different Transmission Control Protocol ports: 20 and 21. FTP ports 20 and 21 must both be open on the network for file transfers to be successful.

FTP (File Transfer Protocol), SFTP, TFTP explained.

After the correct FTP username and password are entered via FTP client software, the FTP server software opens port 21 by default. This is sometimes called the command or control port by default. The client then makes another connection to the server using port 20 to allow file transfers to take place.

The administrator can change the default port for sending commands and files via FTP. However, the default exists so that client/software programs, routers, and firewalls can agree on the same ports, simplifying configuration.

One reason FTP fails is if the correct ports are not open on the network. This blocking can occur on either the server or client side. Any software that blocks the ports must be manually modified to open them, including routers and firewalls that can block the ports if the operating system does not do so.