Internet Engineering Task Force T. Tsou, Ed. Internet-Draft Huawei Technologies (USA) Intended status: Informational S. Perreault Expires: March 20, 2014 Viagenie J. Huang Huawei Technologies September 16, 2013 An FTP Application Layer Gateway (ALG) for IPv4-to-IPv6 Translation draft-tsou-behave-ftp46-01 Abstract An FTP ALG for NAT64 was defined in RFC 6384. Its scope was limited to an IPv6 client connecting to an IPv4 server. This memo supports the case of an IPv4 client connecting to an IPv6 server. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on March 20, 2014. Copyright Notice Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved. Tsou, et al. Expires March 20, 2014 [Page 1] Internet-Draft FTP46 September 2013 This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4. PASV to EPSV . . . . . . . . . . . . . . . . . . . . . . . . 3 5. EPSV (IPv4) to EPSV (IPv6) . . . . . . . . . . . . . . . . . 4 6. Command to disable FTP ALG . . . . . . . . . . . . . . . . . 5 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 8. Security Considerations . . . . . . . . . . . . . . . . . . . 6 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6 10. Normative References . . . . . . . . . . . . . . . . . . . . 6 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 1. Overview During the transition from IPv4 to IPv6, some operators need to deploy NAT in their network. Some subscribers have the need to run IPv4 based FTP servers at home, and some of the FTP [RFC0959] control messages carry IP address and port number in the payload, which will cause a NAT traversal problem. [RFC6384] defines FTP ALG for NAT64, but only for the case where the FTP client is on the inside of the NAT64. The case where an FTP server is on the inside of the NAT64 is not covered. When the FTP server is behind NAT, it can publish its service address via a HTTP redirect server and a DDNS system which needs to support both IP address and port rather than IP address only, or other possible methods. The FTP server can listen on any possible ports, not just port 21; FTP server can get it external IP address and port via some technology like UPnP, and then publish the acquired IP address and port as its URI, ftp://203.0.113.1:1200, port 1200 is allocated by NAT. 1.1. Requirements Language Tsou, et al. Expires March 20, 2014 [Page 2] Internet-Draft FTP46 September 2013 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. 2. Terminology 3. Scenarios There can be several scenarios if NAT is involved in the network. a) In this scenario, the FTP client is behind NAT, FTP ALG needs to handle the EPRT / PORT command in FTP active mode, translating the IP address and port. This scenario has been covered by [RFC6384], but only for NAT64. This scenario for other kinds of NAT has not been covered. +--------+ +---------+ +-------+ +---------+ +--------+ | FTP | | | | | | | | FTP | | Client +----+ IPv6 +----+ NAT64 +----+ IPv4 +----+ Server + | | | Network | | | | Network | | | | IPv6 | | | | | | | | IPv4 | +--------+ +---------+ +-------+ +---------+ +--------+ FTP Client Behind NAT b) If the FTP server is behind a NAT, FTP passive mode will be the only working mode, the EPSV / PASV command and the response will be processed by FTP ALG. This memo covers this scenario. +--------+ +---------+ +-------+ +---------+ +--------+ | FTP | | | | | | | | FTP | | Server +----+ IPv6 +----+ NAT64 +----+ IPv4 +----+ Client + | | | Network | | | | Network | | | | IPv6 | | | | | | | | IPv4 | +--------+ +---------+ +-------+ +---------+ +--------+ FTP Server Behind NAT 4. PASV to EPSV Tsou, et al. Expires March 20, 2014 [Page 3] Internet-Draft FTP46 September 2013 If FTP client issues PASV command to FTP server, FTP ALG translates PASV command into EPSV command [RFC2428], setting the "net-prt" field to 2 (IPv6). The response of EPSV command is translated into PASV response. FTP ALG allocates an IPv4 address and port for the EPSV response message, and builds a NAT mapping entry if the NAT is stateful. The source address of the EPSV response message and the "tcp-port" in the payload are used for the NAT mapping. The allocated IPv4 address and port are put into the PASV response message. For instance, in the IPv4 side of NAT64, FTP server's address is 203.0.113.1. FTP client issues a PASV command to FTP server, and it is translated into EPSV command by FTP AGL, as shown below: PASV command: PASV EPSV command: EPSV 2 When FTP server returns a success response of EPSV containing tcp- port 3000, FTP AGL allocates an IPv4 address 203.0.113.1 and tcp-port 2000 corresponding to the tcp-port 3000 in the EPSV response message, and puts the allocated IP address and port into PASV response message, as shown below: EPSV success response: 229 Entering Passive Mode (|||3000|) PASV success response: 227 Entering Passive Mode (203,0,113,1,7,208) 5. EPSV (IPv4) to EPSV (IPv6) If FTP client issues EPSV command to FTP server, FTP ALG modifies the "net-prt", change the value from 1 (IPv4) to 2 (IPv6). The response of IPv6 EPSV command is also translated. FTP ALG allocates an IPv4 address and port for the EPSV response message. Tsou, et al. Expires March 20, 2014 [Page 4] Internet-Draft FTP46 September 2013 [RFC2428] requires that "the network address used to establish the data connection will be the same network address used for the control connection", so NAT MUST to make sure that IPv4 address for control connection and IPv4 address for data connection for a FTP server must be the same, which means all the mappings for an IPv6 address MUST have the same external IPv4 address. For instance, in the IPv4 side of NAT64, FTP server's address is 203.0.113.1. The FTP client issues an IPv4 EPSV command to FTP server, and it is translated into IPv6 EPSV command by FTP AGL, as shown below: EPSV (IPv4) command: EPSV 1 EPSV (IPv6) command: EPSV 2 When FTP server returns a success response of EPSV containing port 3000, FTP AGL will allocate an IPv4 address 203.0.113.1 and port 2000 corresponding to the port 3000 in the EPSV response message, and put the allocated port into PASV response message, as shown below: EPSV (IPv6) success response: 229 Entering Passive Mode (|||3000|) EPSV (IPv4) success response: 229 Entering Passive Mode (|||2000|) 6. Command to disable FTP ALG Command ALGS defined in [RFC6384] is extended, three more possible arguments are added: ALGS STATUS46 to return the EPSV and EPRT translation status. ALGS ENABLE46 to enable translation. ALGS DISABLE46 to disable translation. 7. IANA Considerations This memo includes no request to IANA. Tsou, et al. Expires March 20, 2014 [Page 5] Internet-Draft FTP46 September 2013 8. Security Considerations RFC6384's security considerations applies to this document. 9. Acknowledgements 10. Normative References [RFC0959] Postel, J. and J. Reynolds, "File Transfer Protocol", STD 9, RFC 959, October 1985. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2428] Allman, M., Ostermann, S., and C. Metz, "FTP Extensions for IPv6 and NATs", RFC 2428, September 1998. [RFC6384] van Beijnum, I., "An FTP Application Layer Gateway (ALG) for IPv6-to-IPv4 Translation", RFC 6384, October 2011. Authors' Addresses Tina Tsou (editor) Huawei Technologies (USA) 2330 Central Expressway Santa Clara CA 95050 USA Phone: +1 408 330 4424 Email: tina.tsou.zouting@huawei.com Simon Perreault Viagenie 246 Aberdeen Quebec, QC G1R 2E1 Canada Phone: +1 418 656 9254 Email: simon.perreault@viagenie.ca URI: http://viagenie.ca Tsou, et al. Expires March 20, 2014 [Page 6] Internet-Draft FTP46 September 2013 Jing Huang Huawei Technologies Huawei Area F, Bantian, Longgang District Shenzhen 518129 China Email: James.huang@huawei.com Tsou, et al. Expires March 20, 2014 [Page 7]