3
0

ftp_ipv6_rfc2428.txt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. Network Working Group M. Allman
  2. Request for Comments: 2428 NASA Lewis/Sterling Software
  3. Category: Standards Track S. Ostermann
  4. Ohio University
  5. C. Metz
  6. The Inner Net
  7. September 1998
  8. FTP Extensions for IPv6 and NATs
  9. Status of this Memo
  10. This document specifies an Internet standards track protocol for the
  11. Internet community, and requests discussion and suggestions for
  12. improvements. Please refer to the current edition of the "Internet
  13. Official Protocol Standards" (STD 1) for the standardization state
  14. and status of this protocol. Distribution of this memo is unlimited.
  15. Copyright Notice
  16. Copyright (C) The Internet Society (1998). All Rights Reserved.
  17. Abstract
  18. The specification for the File Transfer Protocol assumes that the
  19. underlying network protocol uses a 32-bit network address
  20. (specifically IP version 4). With the deployment of version 6 of the
  21. Internet Protocol, network addresses will no longer be 32-bits. This
  22. paper specifies extensions to FTP that will allow the protocol to
  23. work over IPv4 and IPv6. In addition, the framework defined can
  24. support additional network protocols in the future.
  25. 1. Introduction
  26. The keywords, such as MUST and SHOULD, found in this document are
  27. used as defined in RFC 2119 [Bra97].
  28. The File Transfer Protocol [PR85] only provides the ability to
  29. communicate information about IPv4 data connections. FTP assumes
  30. network addresses will be 32 bits in length. However, with the
  31. deployment of version 6 of the Internet Protocol [DH96] addresses
  32. will no longer be 32 bits long. RFC 1639 [Pis94] specifies
  33. extensions to FTP to enable its use over various network protocols.
  34. Unfortunately, the mechanism can fail in a multi-protocol
  35. environment. During the transition between IPv4 and IPv6, FTP needs
  36. the ability to negotiate the network protocol that will be used for
  37. data transfer.
  38. Allman, et. al. Standards Track [Page 1]
  39. RFC 2428 FTP Extensions for IPv6 and NATs September 1998
  40. This document provides a specification for a way that FTP can
  41. communicate data connection endpoint information for network
  42. protocols other than IPv4. In this specification, the FTP commands
  43. PORT and PASV are replaced with EPRT and EPSV, respectively. This
  44. document is organized as follows. Section 2 outlines the EPRT
  45. command and Section 3 outlines the EPSV command. Section 4 defines
  46. the utilization of these two new FTP commands. Section 5 briefly
  47. presents security considerations. Finally, Section 6 provides
  48. conclusions.
  49. 2. The EPRT Command
  50. The EPRT command allows for the specification of an extended address
  51. for the data connection. The extended address MUST consist of the
  52. network protocol as well as the network and transport addresses. The
  53. format of EPRT is:
  54. EPRT<space><d><net-prt><d><net-addr><d><tcp-port><d>
  55. The EPRT command keyword MUST be followed by a single space (ASCII
  56. 32). Following the space, a delimiter character (<d>) MUST be
  57. specified. The delimiter character MUST be one of the ASCII
  58. characters in range 33-126 inclusive. The character "|" (ASCII 124)
  59. is recommended unless it coincides with a character needed to encode
  60. the network address.
  61. The <net-prt> argument MUST be an address family number defined by
  62. IANA in the latest Assigned Numbers RFC (RFC 1700 [RP94] as of the
  63. writing of this document). This number indicates the protocol to be
  64. used (and, implicitly, the address length). This document will use
  65. two of address family numbers from [RP94] as examples, according to
  66. the following table:
  67. AF Number Protocol
  68. --------- --------
  69. 1 Internet Protocol, Version 4 [Pos81a]
  70. 2 Internet Protocol, Version 6 [DH96]
  71. The <net-addr> is a protocol specific string representation of the
  72. network address. For the two address families specified above (AF
  73. Number 1 and 2), addresses MUST be in the following format:
  74. AF Number Address Format Example
  75. --------- -------------- -------
  76. 1 dotted decimal 132.235.1.2
  77. 2 IPv6 string 1080::8:800:200C:417A
  78. representations
  79. defined in [HD96]
  80. Allman, et. al. Standards Track [Page 2]
  81. RFC 2428 FTP Extensions for IPv6 and NATs September 1998
  82. The <tcp-port> argument must be the string representation of the
  83. number of the TCP port on which the host is listening for the data
  84. connection.
  85. The following are sample EPRT commands:
  86. EPRT |1|132.235.1.2|6275|
  87. EPRT |2|1080::8:800:200C:417A|5282|
  88. The first command specifies that the server should use IPv4 to open a
  89. data connection to the host "132.235.1.2" on TCP port 6275. The
  90. second command specifies that the server should use the IPv6 network
  91. protocol and the network address "1080::8:800:200C:417A" to open a
  92. TCP data connection on port 5282.
  93. Upon receipt of a valid EPRT command, the server MUST return a code
  94. of 200 (Command OK). The standard negative error code 500 and 501
  95. [PR85] are sufficient to handle most errors (e.g., syntax errors)
  96. involving the EPRT command. However, an additional error code is
  97. needed. The response code 522 indicates that the server does not
  98. support the requested network protocol. The interpretation of this
  99. new error code is:
  100. 5yz Negative Completion
  101. x2z Connections
  102. xy2 Extended Port Failure - unknown network protocol
  103. The text portion of the response MUST indicate which network
  104. protocols the server does support. If the network protocol is
  105. unsupported, the format of the response string MUST be:
  106. <text stating that the network protocol is unsupported> \
  107. (prot1,prot2,...,protn)
  108. Both the numeric code specified above and the protocol information
  109. between the characters '(' and ')' are intended for the software
  110. automata receiving the response; the textual message between the
  111. numeric code and the '(' is intended for the human user and can be
  112. any arbitrary text, but MUST NOT include the characters '(' and ')'.
  113. In the above case, the text SHOULD indicate that the network protocol
  114. in the EPRT command is not supported by the server. The list of
  115. protocols inside the parenthesis MUST be a comma separated list of
  116. address family numbers. Two example response strings follow:
  117. Network protocol not supported, use (1)
  118. Network protocol not supported, use (1,2)
  119. Allman, et. al. Standards Track [Page 3]
  120. RFC 2428 FTP Extensions for IPv6 and NATs September 1998
  121. 3. The EPSV Command
  122. The EPSV command requests that a server listen on a data port and
  123. wait for a connection. The EPSV command takes an optional argument.
  124. The response to this command includes only the TCP port number of the
  125. listening connection. The format of the response, however, is
  126. similar to the argument of the EPRT command. This allows the same
  127. parsing routines to be used for both commands. In addition, the
  128. format leaves a place holder for the network protocol and/or network
  129. address, which may be needed in the EPSV response in the future. The
  130. response code for entering passive mode using an extended address
  131. MUST be 229. The interpretation of this code, according to [PR85]
  132. is:
  133. 2yz Positive Completion
  134. x2z Connections
  135. xy9 Extended Passive Mode Entered
  136. The text returned in response to the EPSV command MUST be:
  137. <text indicating server is entering extended passive mode> \
  138. (<d><d><d><tcp-port><d>)
  139. The portion of the string enclosed in parentheses MUST be the exact
  140. string needed by the EPRT command to open the data connection, as
  141. specified above.
  142. The first two fields contained in the parenthesis MUST be blank. The
  143. third field MUST be the string representation of the TCP port number
  144. on which the server is listening for a data connection. The network
  145. protocol used by the data connection will be the same network
  146. protocol used by the control connection. In addition, the network
  147. address used to establish the data connection will be the same
  148. network address used for the control connection. An example response
  149. string follows:
  150. Entering Extended Passive Mode (|||6446|)
  151. The standard negative error codes 500 and 501 are sufficient to
  152. handle all errors involving the EPSV command (e.g., syntax errors).
  153. When the EPSV command is issued with no argument, the server will
  154. choose the network protocol for the data connection based on the
  155. protocol used for the control connection. However, in the case of
  156. proxy FTP, this protocol might not be appropriate for communication
  157. between the two servers. Therefore, the client needs to be able to
  158. request a specific protocol. If the server returns a protocol that
  159. is not supported by the host that will be connecting to the port, the
  160. Allman, et. al. Standards Track [Page 4]
  161. RFC 2428 FTP Extensions for IPv6 and NATs September 1998
  162. client MUST issue an ABOR (abort) command to allow the server to
  163. close down the listening connection. The client can then send an
  164. EPSV command requesting the use of a specific network protocol, as
  165. follows:
  166. EPSV<space><net-prt>
  167. If the requested protocol is supported by the server, it SHOULD use
  168. the protocol. If not, the server MUST return the 522 error messages
  169. as outlined in section 2.
  170. Finally, the EPSV command can be used with the argument "ALL" to
  171. inform Network Address Translators that the EPRT command (as well as
  172. other data commands) will no longer be used. An example of this
  173. command follows:
  174. EPSV<space>ALL
  175. Upon receipt of an EPSV ALL command, the server MUST reject all data
  176. connection setup commands other than EPSV (i.e., EPRT, PORT, PASV, et
  177. al.). This use of the EPSV command is further explained in section
  178. 4.
  179. 4. Command Usage
  180. For all FTP transfers where the control and data connection(s) are
  181. being established between the same two machines, the EPSV command
  182. MUST be used. Using the EPSV command benefits performance of
  183. transfers that traverse firewalls or Network Address Translators
  184. (NATs). RFC 1579 [Bel94] recommends using the passive command when
  185. behind firewalls since firewalls do not generally allow incoming
  186. connections (which are required when using the PORT (EPRT) command).
  187. In addition, using EPSV as defined in this document does not require
  188. NATs to change the network address in the traffic as it is forwarded.
  189. The NAT would have to change the address if the EPRT command was
  190. used. Finally, if the client issues an "EPSV ALL" command, NATs may
  191. be able to put the connection on a "fast path" through the
  192. translator, as the EPRT command will never be used and therefore,
  193. translation of the data portion of the segments will never be needed.
  194. When a client only expects to do two-way FTP transfers, it SHOULD
  195. issue this command as soon as possible. If a client later finds that
  196. it must do a three-way FTP transfer after issuing an EPSV ALL
  197. command, a new FTP session MUST be started.
  198. Allman, et. al. Standards Track [Page 5]
  199. RFC 2428 FTP Extensions for IPv6 and NATs September 1998
  200. 5. Security Issues
  201. The authors do not believe that these changes to FTP introduce new
  202. security problems. A companion Work in Progress [AO98] is a more
  203. general discussion of FTP security issues and techniques to reduce
  204. these security problems.
  205. 6. Conclusions
  206. The extensions specified in this paper will enable FTP to operate
  207. over a variety of network protocols.
  208. References
  209. [AO98] Allman, M., and S. Ostermann, "FTP Security
  210. Considerations", Work in Progress.
  211. [Bel94] Bellovin, S., "Firewall-Friendly FTP", RFC 1579, February
  212. 1994.
  213. [Bra97] Bradner, S., "Key words for use in RFCs to Indicate
  214. Requirement Levels", BCP 14, RFC 2119, March 1997.
  215. [DH96] Deering, S., and R. Hinden, "Internet Protocol, Version 6
  216. (IPv6) Specification", RFC 1883, December 1995.
  217. [HD96] Hinden, R., and S. Deering, "IP Version 6 Addressing
  218. Architecture", RFC 2373, July 1998.
  219. [Pis94] Piscitello, D., "FTP Operation Over Big Address Records
  220. (FOOBAR)", RFC 1639, June 1994.
  221. [Pos81a] Postel, J., "Internet Protocol", STD 5, RFC 791, September
  222. 1981.
  223. [Pos81b] Postel, J., "Transmission Control Protocol", STD 7, RFC 793,
  224. September 1981.
  225. [PR85] Postel, J., and J. Reynolds, "File Transfer Protocol (FTP)",
  226. STD 9, RFC 959, October 1985.
  227. [RP94] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC
  228. 1700, October 1994. See also:
  229. http://www.iana.org/numbers.html
  230. Allman, et. al. Standards Track [Page 6]
  231. RFC 2428 FTP Extensions for IPv6 and NATs September 1998
  232. Authors' Addresses
  233. Mark Allman
  234. NASA Lewis Research Center/Sterling Software
  235. 21000 Brookpark Rd. MS 54-2
  236. Cleveland, OH 44135
  237. Phone: (216) 433-6586
  238. EMail: mallman@lerc.nasa.gov
  239. http://gigahertz.lerc.nasa.gov/~mallman/
  240. Shawn Ostermann
  241. School of Electrical Engineering and Computer Science
  242. Ohio University
  243. 416 Morton Hall
  244. Athens, OH 45701
  245. Phone: (740) 593-1234
  246. EMail: ostermann@cs.ohiou.edu
  247. Craig Metz
  248. The Inner Net
  249. Box 10314-1954
  250. Blacksburg, VA 24062-0314
  251. Phone: (DSN) 754-8590
  252. EMail: cmetz@inner.net
  253. Allman, et. al. Standards Track [Page 7]
  254. RFC 2428 FTP Extensions for IPv6 and NATs September 1998
  255. Full Copyright Statement
  256. Copyright (C) The Internet Society (1998). All Rights Reserved.
  257. This document and translations of it may be copied and furnished to
  258. others, and derivative works that comment on or otherwise explain it
  259. or assist in its implementation may be prepared, copied, published
  260. and distributed, in whole or in part, without restriction of any
  261. kind, provided that the above copyright notice and this paragraph are
  262. included on all such copies and derivative works. However, this
  263. document itself may not be modified in any way, such as by removing
  264. the copyright notice or references to the Internet Society or other
  265. Internet organizations, except as needed for the purpose of
  266. developing Internet standards in which case the procedures for
  267. copyrights defined in the Internet Standards process must be
  268. followed, or as required to translate it into languages other than
  269. English.
  270. The limited permissions granted above are perpetual and will not be
  271. revoked by the Internet Society or its successors or assigns.
  272. This document and the information contained herein is provided on an
  273. "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  274. TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  275. BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  276. HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  277. MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  278. Allman, et. al. Standards Track [Page 8]