Connection mode

For sending and receiving files or for transmitting directory lists (the default-port is port 20) a separate TCP-connection will be used per process. FTP knows two different modes to connect to these kinds of connections: "active FTP" and "passive FTP".

The TwinCAT FTP Client Version 1.0.8 can use both modes. Earlier Version only support "passive FTP" connection mode.

active FTP

At active FTP ("active mode") the client open a random port and send a PORT-command to the FTP Server which contains the port and the IP-Address. This is typically a port of the client which is greater than 1023, can also be another server that has been switched to passive mode, i.e. is waiting for a connection (so-called FXP). The data transmitting at server site use the port 20. The communication with commands uses exclusive the control port. We also call this control "Out of Band". Therefore, it is possible to keep on communicate with the partner while data transmitting.

passive FTP

At passive FTP ("passive mode") the client sends a PASV-command, the server open a port and transmit this port together with the IP-Address to the client. The client use therefore a port higher than 1023 and the server use the port which he has transmit. These technique will be used, if the client isn't available for the server. This could be, if the client is located behind a router, which circumscribe the address of the client with NAT, or if a firewall refuse the access to the network of the client.