About FTP

Recently I had a problem about FTP transfer, so I’m writing about FTP to deepen my understanding.


FTP is the abbreviation of “File Transfer Protocol”, and this is used when server and client transfer file. For example, if you want to publish a web site with image, you have to transfer image file by using FTP.

Difference from HTTP

As you may know, there are other protocols which can transfer file except for FTP, like HTTP.

SO what’s the difference between HTTP and FTP?


Of course, there are some differences, but the important one is that different ports are used.

HTTP use 80 port, on the other hand FTP use 20 and 21 port. FTP can use 2 port, so precise control is possible and it is suitable for big data transfer.


To transfer file, FTP combine and use two connections, called “Control connection” and “Data connection”.

Control connection is used to control the connection as the name mean. For example Username or Password and so on are transferred on the control connection.

On the other hand, data connection is used to transfer data itself.


There are two way to control the connection, as I’ll explain later, “Active mode” and “Passive mode”. Port number to be used are below each other.

<Active mode>

Control connection: 21

Data connection: 20

<Passive mode >

Control connection: 21

0Data connection: random


Copied title and URL