25.02.2013 Views

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14.1.4 The passive data transfer<br />

Contrary to the use of an active data connection, the passive data transfer<br />

reverses the direction of establishment of the data connection. Instead of issuing<br />

a PORT comm<strong>and</strong>, the client issues a PASV comm<strong>and</strong>, which uses no<br />

parameters. Upon accepting this comm<strong>and</strong>, the FTP server sends back a reply<br />

containing an <strong>IP</strong> address <strong>and</strong> port number. The client initiates a connection back<br />

to the server on the indicated <strong>IP</strong> address <strong>and</strong> port. An example of this sequence<br />

is illustrated in Figure 14-4.<br />

FTP client<br />

<strong>IP</strong> address<br />

10.1.2.3<br />

>LS<br />

>227 Entering<br />

Passive Mode<br />

(10,4,5,6,8,9)<br />

>125 List<br />

started OK<br />

>file1<br />

>file2<br />

>file3<br />

>250 List<br />

completed<br />

successfully<br />

Figure 14-4 The passive data connection<br />

PASV<br />

(Control Connection)<br />

227 Entering Passive Mode (10,4,5,6,8,9)<br />

(Control Connection)<br />

<br />

(Data Connection)<br />

NLST<br />

(Control Connection)<br />

125 List started OK<br />

(Control Connection)<br />

<br />

(Data Connection)<br />

250 List completed successfully<br />

(Control Connection)<br />

FTP server<br />

<strong>IP</strong> address<br />

10.4.5.6<br />

One of the reasons to use a passive data transfer is to bypass firewall<br />

configurations that block active data connections. For this reason, passive mode<br />

is often referred to as “firewall friendly mode.” An example of such a scenario is a<br />

firewall that has been configured to block any inbound attempts to open a<br />

connection. In this example, an FTP server responding to a client’s PORT<br />

Chapter 14. File-related protocols 521

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!