File Transfer Protocol
The File Transfer Protocol ( protocol of transfer of file), or ftp , is a Communication protocol dedicated to the exchange Informatique of files on a network TCP/IP. It makes it possible, since a computer, to copy files towards another computer of the network, to manage a Web site, or to remove or modify files on this computer.
The protected alternative of ftp with the protocols SSL or TLS is called FTPS.
Ftp obeys a model Client-serveur, i.e. one of the two parts, the customer , sends requests to which reacts the other, called waiter . In practice, the waiter is a computer on which a software itself functions called Serveur ftp, which makes public a tree structure of files similar to a Filesystem Unix. to reach a waiter ftp, one uses software customers ftp (having an graphical interface or in line of order).
The protocol, which belongs to the session layer of OSI model and the application layer of the ARPA model, uses a connection TCP. It can be used in two different ways:
- active Mode : it is the customer ftp who determines the wearing of connection to use to allow the transfer of the data. Thus, so that the exchange of the data can be done, waiter ftp will initialize the connection of its wearing of data (port 20) towards the port specified by the customer. The customer will have to then configure his fire wall to authorize new entering connections so that the exchange of the data is done. Moreover it can prove to be problematic for the users trying to reach waiters ftp when they are behind a footbridge NAT. Considering the way in which NAT functions, waiter ftp initiates the connection of data while being connected to the external address of the footbridge NAT on the selected port. Certain footbridges NAT not having correspondence for the package received in the table of state the package will be ignored and will not be delivered with the customer.
- passive Mode , waiter ftp determines itself the wearing of connection to use to allow the transfer of the data (dated connection) and communicates it to the customer. In the case of the existence of a fire wall in front of waiter ftp this one will have to be configured to authorize the connection of data. The advantage of this mode, is that waiter ftp does not initialize any connection. This mode functions without problems with a footbridge NAT.
Two ports are standardized ( well known ports ) for connections ftp: port 21 for the orders and port 20 for the data.
This protocol can function with IPv4 and IPv6.
Use
To reach a waiter ftp, one uses a customer ftp, in line of order or with an graphical interface.The users of GNU-Linux or a Unix can consult a documentation (installed most of the time by defect), by typing “man ftp”
The majority of the recent navigators authorize connections ftp by using a URL of the type:
-
ftp://nom_d'utilisateur:mot_de_passe@nom_ or _adresse_du_servor: port_ftp
-
In anglophone data processing one uses login for user and passwd or password for password .
By safety, it is advised not to specify the password, the waiter will ask it. That prevents leaving it visible in the history of the navigator, but does not change anything with the fact that it is transmitted in light through the network.
The part port_ftp is optional. If it is omitted the port by defect (21) will be used.
Software of ftp
There exist many customers in line of order, such as for example ftp, Wget, Curl in remote loading or Wput to deposit files.
The majority of the Logiciel S have from now on an graphical interface making it possible to install a waiter ftp or to connect themselves to this one to copy there data (customer ftp). Certain software such as CuteFTP (Windows) is paying; others, such as FileZilla and KamzyFTP for (Windows), Cyberduck for (MacOSX) or gftp for (Linux), quite as practical and effective, are free and free. One can also quote ftp to explore (Shareware for Windows), as practical to use as the explorer of files, or FireFtp, plugin of Firefox. For more thorough uses (special orders etc) a software such as FlashFXP (paying) is of an invaluable help.
Diagram of flows
Connection Dated in active mode:
Protocol
The protocol uses two types of connections TCP:- a connection of control initialized by the customer, towards the waiter (port 21 in general), to transmit the orders of files (transfer, removal of files, renaming, list of the files…).
- a connection of given initialized by the customer or the waiter to transfer the necessary data (contents of the files, list files).
Connection of, the customer receives one or more answers of the waiter. Each answer is preceded by a decimal code making it possible to customer ftp to treat the answer which can comprise one or more lines of text.
For the preceding example, if the waiter finds the file required, it sends to the customer: 150 Files status okay; butt open to dated connection. According to what the customer and the waiter agreed, one of both listening on port TCP agreed upon, and the other is connected to it to establish the connection of data. Then the waiter sends to the customer the contents of the required file, closes the connection of data, and sends the following answer on the connection of control: 226 Closing dated connection.
Connection of data
The connection of data is established for the duration of data transmission (contained files, or lists files). In general, it is established for the transfer of information of only one order, unless another mode of transmission is selected and supported by the waiter.
The order PASV indicates to the waiter that it must await connection passively by listening to a port TCP (in general, port 20).
The port listened by the waiter is indicated in the answer:
227 Entering Passivates Mode ( h1 , H2 , h3 , h4 , p1 , p2 ).
Where h1 with h4 is 4 integers between 0 and 255 representative address IP of the waiter, and p1 and p2 represent port TCP where the waiter awaits connection, in the form of two entireties between 0 and 255 (port_TCP = p1 * 256 + p2).
In the contrary case where the customer awaits connection on a port TCP, it indicates in the same form the port listened by sending the order PORT:
PORT h1 , H2 , h3 , h4 , p1 , p2
If all occurs well, the waiter answers:
200 Command okay.
Mode of transfer
During the file transfer on the connection of data, 2 modes can be used:- Binary mode: the file is transmitted such as it is.
- ASCII mode: only intended for the textual files. The file is examined and of the transformations brought to preserve a correct format. For example, the end of line is represented by the character
on an UNIX system, and by the pair under Windows. A Windows machine receiving a textual file by ftp thus recovers with final file with in ASCII mode and in binary mode. This mode thus has its advantages, but can cause corruption of files (not text) during the transfer if one uses an old customer/in line of order, incompetent to adapt to the type of file. It is then necessary to rock of mode (by generally using order BIN) before the transfer, in order to preserve it intact.
Transfer between two waiters
The specification of protocol ftp (RFC 959) specifies that it is possible to carry out a transfer of file directly between two waiters ftp. This functionality is little known, because nonavailable in the software of customer ftp.
For that, the customer establishes a connection of control per waiter.
At the time to establish the connection of data, the customer asks a waiter to await connection (order PASV), and captures address IP and listened port TCP. These two parameters are sent to the other waiter by using the order PORT.
From there, the connection of data is established between the two waiters.
The customer is informed of the end of the transfer by receiving a positive response of each waiter.
One usually calls this protocol FXP.
Alternatives
- Trivial Spins Transfer Protocol
- Secure File Transfer Protocol
- File Transfer Protocol over SSL
Appendices
- Yafc
- Protocol network passing with difficulty the fire walls
-
RFC 959 - File Transfer Protocol (FTP)
- RFC 1579 - Firewall-Friendly ftp
- RFC 2228 - ftp Security Extensions
- RFC 3659 - Extensions to ftp
- ftp Reviewed
See also
- Internet
- CFT (nothing to see: protocol owner, CFT is a monitor of transfer very much used in company)
- For the transfer between two waiters ftp: FXP
- protocol ftp
Be-X-old: Ftp Simple: Ftp
| Random links: | Holy-Marie-of-Chignac | Commune of Örebro | 1998 in basketball | Philippe Burrin | Bram Tankink | Astoria,_Orégon |