(FTP) Service
Internet Information Server (IIS) with File Transmission Protocol (FTP) installed supports the
following connection types:
Active-mode FTP
Passive-mode FTP
The IIS-based FTP service (MSFTPSVC) supports both active and passive mode
connections, depending on the method that is specified by the client. IIS does not
support disabling either active or passive mode connections, due to the lack of such
a feature in RFC 959. Unlike HTTP and most other protocols used on the Internet, the
FTP protocol uses a minimum of two connections during a session: a half-duplex
connection for control, and a full-duplex connection for data transfer. By default, TCP
port 21 is used on the server for the control connection, but the data connection is
determined by the method that the client uses to connect to the server.
Active-mode FTP Connections
Active-mode FTP is sometimes referred to as "client-managed" because the client
sends a PORT command to the server (over the control connection) that requests the
server to establish a data connection from TCP Port 20 on the server, to the client,
using the TCP port that is specified by the PORT command.
The FTP client sends the PORT command to the FTP server in the following format:
PORT 192,168,0,3,19,243
where the first four comma-seperated values correspond to the octets of the client's
IP address, and the fifth and sixth values are the high- and low-order bits of the 16-
bit port number. To convert the high- and low-order bits into a (decimal) port
number, multiply the fifth value by 256 and add the sixth value to it. In the example
above, the TCP port (in decimal) is (256 x 19) + 243 = 5107, so the client is
instructing the server to open a data connection to 192.168.0.3:5107. By default,
the FTP client chooses an ephemeral port for the data connection port. An ephemeral
port is a port that is randomly chosen from the available ports between 1024 and
65535.
NOTE: In Windows NT 4.0 and Windows 2000, the valid default ephemeral port
range is 1024-5000. Increasing the ephemeral range in Windows NT 4.0 and
Windows 2000 requires adding a value to the system registry. For additional
information on increasing the default ephemeral range, click the article number
below to view the article in the Microsoft Knowledge Base:
196271 Unable to Connect from TCP Ports Above 5000
The following is a typical sequence for an active-mode FTP connection: