RFC 1415
FTP-FTAM Gateway Specification
FTP-FTAM Gateway Specification โจ
okay bestie, this is RFC 1415 ๐ฆ It's from January 1993 and the authors are J. Mindel and R. Slaski from Open Networks, Inc. ๐ It's an IAB standards track protocol spec for the Internet community, and the whole point is that it wants discussion and suggestions for improvements. It's giving "please review and send feedback" ๐ซถ
The document is in its own network working group, and it doesn't say it obsoletes or updates any other RFC, so there's nothing to replace or patch here. โจ
For the current standardization state and status of this protocol, you have to check the current edition of the "IAB Official Protocol Standards". ๐ And distribution of this memo is unlimited, so share away ๐
Status of the Memo
This RFC specifies an IAB standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "IAB Official Protocol Standards" for the standardization state and status of this protocol. Distribution of this memo is unlimited. ๐
Abstract
This memo describes a dual protocol stack application layer gateway that performs protocol translation, in an interactive environment, between the FTP and FTAM file transfer protocols. ๐
Two key assumptions are made: 1) POSIX file naming conventions and hierarchical organization, rather than proprietary conventions are in use; and 2) X.500 Directory Services are available. ๐ง So the gateway is built around POSIX-style naming and assumes X.500 Directory Services exist, and that's the deal ๐ค
Acknowledgments
The authors of this RFC would like to express their appreciation to the individuals and organizations that participated in the implementation of the FTP-FTAM Application Layer Gateway and its fielding on the MILNET. ๐ธ Implementation credits go to Mr. John Scott, formerly of the MITRE Corporation, while fielding credits are extended to James Graham and R. Greg Lavender of Open Networks, Inc. (formerly NetWorks One) and Robert Cooney of the Naval Computer and Telecommunications Station (NCTS) Washington. Dr. Marshall Rose is to be commended for recognizing the importance of the FTP-FTAM gateway and promulgating it as a part of the ISO Development Environment (ISODE). ๐
The following individuals have provided valuable editorial comments: Larry Friedman, Donna Vincent and Michael Resnick of Digital Equipment Corporation; Robert Cooney of NCTS; and S.E. Hardcastle-Kille of University College London. ๐ซถ Funding of the FTP-FTAM Gateway Request for Comments effort was provided by Open Networks Inc. and the Defense Information Systems Agency (DISA), formerly the Defense Communications Agency. DISA sponsors include Len Tabacchi, George Bradshaw, Tom Clarke, and Betsy Turner. ๐
Table of Contents
1. Introduction..................................................2
1.1. Relationship to Other Work ................................3
1.2. Overview of Gateway Operation .............................4
2. Gateway Architecture..........................................6
3. Network Naming and Addressing.................................8
4. Use of the Gateway Services...................................9
4.1. FTP-Initiated Gateway Service .............................9
4.2. FTAM-Initiated Gateway Service ...........................11
4.3. Summary of Usage .........................................12
5. Gateway State Variables and Transitions......................13
5.1. FTP-Initiated Gateway Service ............................14
5.2. FTAM-Initiated Gateway Service ...........................16
6. Document Type Support........................................18
6.1. Notes on NBS-9 ...........................................18
7. Functional Comparison of FTP and FTAM........................19
7.1. Loss of Functionality ....................................20
8. Mapping of Protocol Functions and Representations.............20
8.1. FTP-Initiated Gateway Service .............................22
8.2. FTAM-Initiated Gateway Service ............................38
9. Mapping between FTP Reply Codes and FTAM Parameters...........47
9.1. FTP Reply Codes to FTAM Parameters ........................48
9.2. FTAM Parameters to FTP Reply Codes ........................50
9.3. Future Mapping Problem ....................................54
9.4. Error Handling ............................................54
10. Implementation and Configuration Guidelines..................54
10.1. Robustness ...............................................54
10.2. Well-Known TCP/IP Port ...................................55
10.3. Gateway Listener Processes ...............................55
10.4. Implementation Testing ...................................55
10.5. POSIX File Naming and Organization .......................55
11. Security Considerations......................................55
12. References...................................................56
13. Authors' Addresses...........................................58
Yes, that's the whole map of the spec, page numbers and all ๐บ๏ธ Use it to find your way around, and we'll hit every section in order as we go ๐
1. Introduction ๐
okay so the TCP/IP and OSI protocol suites are going to coexist on the Internet for several years ๐ And the more OSI hosts that get fielded on the Internet, the more urgent it gets to have gateways between the two suites. It's giving "we need a bridge, and we need it now" ๐
This specification describes an application layer gateway that gives you interoperability between the TCP/IP File Transfer Protocol (FTP) and the OSI File Transfer, Access, and Management (FTAM) protocol. โจ The gateway is built on a bi-directional set of mappings between FTP and FTAM. The protocols have really different command structures, so the mappings aren't one-to-one, which is a whole mood ๐ญ This paper assumes you already know about the File Transfer Protocol (FTP) [RFC959] and the File Transfer, Access, and Management Protocol (FTAM) [ISO8571-1,2,3,4,5].
Two important goals of the mappings are to:
- Provide FTP users with as much emulated FTP capability on an FTAM Responder as possible, and
- Provide FTAM users with as much emulated FTAM capability on an FTP Server as possible.
Main character energy for both sides ๐ Though the application layer gateway is expected to be implemented on full protocol suites of both TCP/IP and OSI, at least one implementation of such a gateway (included in the ISO Development Environment) can be configured to run FTAM over either OSI or TCP/IP lower-layer services. ๐ง
1.1. Relationship to Other Work
Ideas in this specification come from lessons learned while fielding the gateway on the MILNET, operational at NCTS Washington D.C. since 1989. ๐ They also build on the efforts of M. A. Wallace et al. of the National Institute of Standards and Technology (NIST) [NIST86]. In 1986, NIST published a design document for an FTP-FTAM gateway. ๐ Since then, at least one implementation (for a subset of the FTP and FTAM protocols) has been developed [MITRE87] and is included with the ISODE. That implementation is based on the NIST protocol translator gateway design [NIST86]. Gateway lineage is giving legacy ๐
This document's contribution to the advancement of the FTP-FTAM gateway concept is to:
- Enhance the user interaction capability provided by the ISODE implementation of the FTP-FTAM application layer gateway.
- Clarify and enhance the mappings (FTP to FTAM, FTAM to FTP) documented by NIST.
- Provide guidelines for fielding the FTP-FTAM application layer gateway on the Internet so that it is useful as an Internet resource.
- Produce a formal specification for the FTP-FTAM gateway suitable for implementors to use in building additional FTP-FTAM gateways.
- Provide a formal specification for organizations wishing to procure FTP-FTAM gateways.
So this doc is the upgrade pack: better user interaction, cleaner mappings, fielding guidance, and formal specs for both builders and buyers ๐
1.2. Overview of Gateway Operation
The gateway gives you a virtual end-to-end application file transfer service. โจ As data is sent via FTP, the gateway immediately maps the requested function to FTAM and passes it to the FTAM host. ๐ฆ Going the other way, an FTAM request gets sent to the gateway, is immediately mapped to an FTP function using a different set of mappings, and is passed along to the FTP host. It's a two-way street, bestie ๐ฆ
In FTP, the two parties in a file transfer are the Client and Server. ๐ The Client is responsible for initiating a connection to the Server. Once the connection is established, all service requests originate from the Client. The FTP-FTAM gateway does not support the FTP three node model. ๐
In FTAM, the two parties in a file transfer are the Initiator and Responder. The Initiator is responsible for initiating a connection to the Responder. Once the connection is established, either the Initiator or Responder may issue service requests to the other. So in FTAM, requests can come from either side, which is kind of iconic ๐ฅ
The FTP-FTAM gateway provides two sets of services:
- FTP-Initiated Gateway Services
Utilized when an FTP Client contacts the FTP-FTAM gateway to instigate a file transfer with an FTAM Responder. ๐ง
- FTAM-Initiated Gateway Services
Utilized when an FTAM Initiator contacts the FTP-FTAM gateway to instigate a file transfer with an FTP Server. ๐ธ
The gateway services' names were picked to show the roles the FTP-FTAM gateway plays when it does file transfers. ๐ For example, when an FTP Client starts a file transfer, it contacts the FTP Server portion of the gateway. That portion maps the protocol information to the FTAM Initiator portion of the gateway, which then contacts the remote FTAM Responder. This example scenario uses the FTP-Initiated Gateway Services. Role-play energy, but make it networking ๐ญ
Figure 1 shows the view of the application process in the FTP-Initiated service. Figure 2 shows the view for the FTAM-Initiated service. Look at those diagrams, they're so clean ๐ค
TCP Host OSI Host
+--------------+ +------------------+
| FTP Client | | FTAM Responder |
+--------------+ +------------------+
| |
| |
| |
| FTP-FTAM Gateway |
| +--------------------------------+ |
+-- | FTP Server FTAM Initiator | --+
+--------------------------------+
Figure 1 - FTP-Initiated Gateway Service
TCP Host OSI Host
+--------------+ +------------------+
| FTP Server | | FTAM Initiator |
+--------------+ +------------------+
| |
| |
| |
| |
| FTP-FTAM Gateway |
| +--------------------------------+ |
+-- | FTP Client FTAM Responder | --+
+--------------------------------+
Figure 2 - FTAM-Initiated Gateway Service
That's part 1 of 11 done ๐ We've got the title block, the status, the abstract, the thank-yous, the full table of contents, and sections 1 through 1.2. Part 2 picks up with Section 2, Gateway Architecture ๐ฆ
2. Gateway Architecture โจ
okay so the gateway is basically a protocol translator (see [NIST86]) ๐ฆ. It runs both the TCP/IP and OSI protocol stacks, and there's an application-level process in the middle linking the two. The FTP-to-FTAM link is made up of two sets of protocol mappings, one for the FTP-Initiated service set and one for the FTAM-Initiated service set. Lowkey genius ๐ง
Check out Figure 3 ๐
+------------+ +-------------+
| FTP Host | | FTAM Host |
+------------+ +-------------+
| |
| |
| |
| |
| +---------------------------------+ |
| | FTP - FTAM | |
| | Gateway Application | |
| |---------------------------------| |
| | FTP | FTAM | |
| |----------------+----------------| |
| | TCP/IP | TP4/et al | |
| +---------------------------------+ |
| /|\ /|\ |
| | | |
+------------+ +-------------+
Figure 3 - Gateway Protocol Stack
The big thing about this architecture is that data gets mapped and sent immediately ๐ฅ So no transferred file ever has to live on the gateway's file system. Quick note: in this doc, "filesystem" means the file access and maintenance stuff the operating system provides. Not having the gateway touch a filesystem helps speed up the end-to-end transfer โก Another speedy perk is that the FTP and FTAM network connections can run at the same time ๐โโ๏ธ There are more wins too:
- FTP and FTAM hosts require no modification to utilize gateway services.
- Users require no knowledge of the other protocol.
- Gateway access control is not impaired (since users cannot directly access the gateway filesystem).
- No additional filesystem space is required on the gateway.
- Interactive nature of protocols is preserved.
- Users become aware of fatal errors immediately.
The downside? You've gotta put in the initial coding effort to build the gateway, and then keep re-coding it so it stays current ๐ญ Not gonna lie, that's a lot of work bestie ๐ธ
3. Network Naming and Addressing
the naming and addressing schemes are super different ๐ FTP uses Domain Names (DN) and IP Addresses, while FTAM uses Distinguished Names and Presentation Addresses. It gets really obvious when a user of one protocol needs to identify a destination host of the other protocol. Awkward!! ๐
On the TCP/IP side, an FTP Server's identity is its DN and its IP address [RFC1101] ๐ To connect to an FTP Server, the FTP Client looks up a DN either in the Domain Name System (DNS) or in a static host table, and gets back an IP address.
On the OSI side, an FTAM Responder service is identified by its Distinguished Name in the OSI Directory (X.500 or a static table) plus its Presentation address. The Distinguished Name is an authoritative description of the service โจ A Presentation address is made up of a Presentation selector, a session selector, a transport selector, and a network address. To connect to an FTAM Responder, the FTAM Initiator goes to the OSI Directory, hands over the Distinguished Name of the FTAM Responder it wants, and asks for the Presentation address attribute tied to that name ๐ง
There's also an alternative to using Distinguished Names directly: "User Friendly Naming", as defined in [Kille92] ๐ Gateway support for "User Friendly Naming" is recommended, but not required.
4. Use of the Gateway Services
4.1. FTP-Initiated Gateway Service
the FTP Client uses the FTP-Initiated gateway service to tap into the resources of an FTAM Responder ๐
To start a file transfer from an FTP Client, the Client connects to the FTP-Initiated gateway service over TCP/IP. The gateway then sets up a connection to the FTAM Responder over OSI. Once that's up, the user can start doing file transfer operations ๐
The FTP Client is responsible for giving the gateway an authoritative Distinguished Name, or a User Friendly Name, for the OSI filestore it wants. The gateway's job is to resolve that Distinguished Name, or User Friendly Name, into its matching Presentation address ๐
Here's the logon sequence an FTP Client follows when starting a file transfer with an FTAM Responder:
% ftp gateway
ftp> site Distinguished-Name-of-FTAM Responder
ftp> user username
ftp> pass password
So ftp gateway starts the connection between the FTP Client and the gateway. Once connected to the gateway, the FTP Client should identify the FTAM Responder service by its Distinguished Name or User Friendly Name, which gets resolved by an algorithm running on the Directory Services provider ๐ธ That info gets sent with either site Distinguished-Name-of-FTAM Responder or site UFN-of-FTAM Responder.
When the gateway gets a Distinguished Name or User Friendly Name, it has to resolve it to the Presentation Address tied to that name ๐ซถ It does this by asking the OSI Directory (X.500 or a local static table) with the Distinguished Name or User Friendly Name. Once it has the Presentation address, the gateway can try to connect to the final destination file transfer service at that address โญ
The userid goes in with user username, and the password goes in with pass password. If the FTAM Responder needs a password, a password prompt should show up after you send the user username command ๐ It is anticipated that stronger authentication mechanisms will be required for DoD gateways in the future. ๐
Let's walk through a real example ๐ Say an FTAM Responder has this Distinguished Name:
CountryName = "US"
Organization = "Open Networks"
OrganizationalUnit = "Network Services"
CommonName = "netwrx1"
CommonName = "FTAM service"
and the FTP-FTAM gateway lives at washdc1-osigw.navy.mil.
The FTP user action looks like this:
% ftp washdc1-osigw.navy.mil
ftp> site "c=US@o=Open Networks@ou=Network Services@cn=netwrx1
@cn=FTAM service"
ftp> user mindel
ftp> pass ***********
So ftp washdc1-osigw.navy.mil opens the connection between the FTP Client and the FTP-FTAM gateway at the Washington Navy Yard, Washington D.C. โจ Once connected, the OSI filestore at Open Networks gets identified by its Distinguished Name, "@c=US@o=Open Networks@ou=Network Services@cn=netwrx1@cn=FTAM service". Or you can use a User Friendly Name instead, like this:
"netwrx1, Open Networks, us"
which lets you do this:
% ftp washdc1-osigw.navy.mil
ftp> site "netwrx1, Open Networks, us"
ftp> user mindel
ftp> pass ***********
ngl, the point here is that using an intermediate gateway is not transparent ๐ฉ It's a bit awkward, so the gateway can be made more transparent by registering the FTAM host in the DNS using the gateway's address [RFC1279] ๐ฆ
Here's how that plays out. Imagine the "netwrx1, Open Networks, us" FTAM host is registered in the TCP/IP DNS with the DN "ftam-service.netwrx1.com" and the IP address of the "washdc1-osigw.navy.mil" gateway. Then this is all the user has to do:
% ftp ftam-service.netwrx1.com
ftp> user mindel
ftp> pass ***********
Since "ftam-service.netwrx1.com" really points to the gateway's address, that first command connects the FTP Client to the gateway. The gateway then uses that name (via [RFC1279]) to figure out where the actual FTAM host lives ๐งโโ๏ธ Gateway support for RFC1279 is recommended, but not required. ๐
4.2. FTAM-Initiated Gateway Service
okay so this one flips the script ๐ The FTAM Initiator uses the FTAM-Initiated gateway service to tap into the resources of an FTP Server ๐ฆ
To start a file transfer, the FTAM Initiator connects to the FTAM-Initiated gateway service over OSI ๐ธ The gateway then sets up a TCP/IP connection to the FTP Server, and from there the user can start file transfer operations โจ
The FTAM Initiator is responsible for giving the gateway an authoritative DN for the TCP/IP filestore they want ๐ It's the gateway's job to resolve that DN to its matching IP address ๐ง
Here's the logon sequence an FTAM Initiator follows when starting a file transfer with an FTP Server:
% ftam gateway
ftam> user username@DNS-string
ftam> pass password
The ftam gateway command sets up the connection between the FTAM Initiator and the gateway ๐ Once that's connected, the userid and TCP/IP filestore both get identified in the username@DNS-string argument to the user command. If the FTP Server asks for a password, a password prompt should appear after you issue the user command ๐
The gateway should include the BIND Resolver functionality, so that when it gets a Domain Name, the Gateway FTP Client can resolve it through the distributed Domain Name System ๐
Let's use a specific example. Say an FTP Server has the Domain Name "ftp-service.netwrx1.com", and an FTP-FTAM gateway is available at:
CountryName = "US"
Organization = "GOV"
OrganizationalUnit = "DOD"
OrganizationalUnit = "DISA"
Locality = "Washington Navy Yard"
CommonName = "wnyosi7"
The FTAM user action looks like this ๐
% ftam @c=US@o=GOV@ou=DOD@ou=DISA@l=Washington Navy Yard
@cn=wnyosi7
ftam> user mindel@ftp-service.netwrx1.com
ftam> pass ***********
You can also use a User Friendly Name in place of the Distinguished Name ๐ซถ
As we covered in the previous section, "Use of the FTP-Initiated Gateway Service", using an intermediate gateway is not transparent ๐ The gateway can be made more transparent by registering the FTP host in the X.500 OSI Directory. By querying the X.500 OSI Directory, the gateway can work out where the actual host lives ๐ต๏ธโโ๏ธ
For example, say the FTP Server from the previous example ("ftp-service.netwrx1.com") is registered in the X.500 Directory with this Distinguished Name:
CountryName = "US"
Organization = "Open Networks"
OrganizationalUnit = "Network Services"
CommonName = "netwrx1"
CommonName = "FTP service"
and the Presentation Address of the FTP-FTAM gateway. This approach, described in [RFC1279], would let the user do this:
% ftam @c=US@o=Open Networks@ou=Network Services
@cn=netwrx1@cn=FTP Service"
ftam> user mindel
ftam> pass ***********
4.3. Summary of Usage
okay so the big takeaway from the FTP-Initiated and FTAM-Initiated sections is that the gateway user never gets access to the gateway filesystem ๐ โโ๏ธ They just use the gateway logon procedure to specify the final destination userid and password ๐
We went over two ways to interact with the gateway. In the first one, the user must:
- Be aware that a gateway is required to reach the destination FTP or FTAM host.
- Determine which gateway is most appropriate for their respective source-destination pair.
- Explicitly connect to the gateway host prior to connecting to the destination host.
Honestly, swapping files between FTP and FTAM hosts takes more effort than swapping files between two hosts that use the same file transfer protocol ๐ญ
The second, more transparent method doesn't necessarily require the user to figure out which gateway fits their source-destination pair ๐ In fact, filestore service providers get registered using the address of a predetermined gateway. With this approach, the user:
- Must be aware that a gateway is required to reach the destination FTP or FTAM host.
- Need not determine which gateway is most appropriate to access their ultimate destination host.
- Need not explicitly connect to the gateway prior to connecting to the destination FTP or FTAM host.
5. Gateway State Variables and Transitions โจ
okay so as we've described, the FTP-FTAM gateway offers two sets of services: FTP-Initiated and FTAM-Initiated ๐ฆ Each service has its own mutually exclusive set of state variables and transitions, and those deterministically define what the gateway does ๐ฅ Gateway support for these state variables and transitions is required.
To keep things short from here on, FTP-Initiated gets abbreviated as "FTP-I", and FTAM-Initiated gets abbreviated as "FTAM-I" ๐
Quick heads-up on errors ๐จ If a connection drops while the gateway is in any state other than FTP-I:Initial-State or FTAM-I:Initial-State, the gateway issues a fatal error message to the host on the remaining connection, and then drops that connection too. If the remaining host is an FTP Client, the gateway sends ABOR, QUIT, and the 426 reply code (Connection closed, transfer aborted). If it's an FTAM Initiator, the gateway sends an F-P-ABORT with a <Diagnostic> value of identifier 1011 (Lower layer failure), plus any known <Further Details> ๐ญ
Other error conditions aren't addressed in this discussion ๐
5.1. FTP-Initiated Gateway Service
The FTP-Initiated Gateway service has these state variables ๐
State Variable State Definition
----------------------------------------------------------------
FTP-I:Initial-State Initial state of FTP-Initiated Gateway
service.
Gateway is waiting for an FTP Client to
issue a USER command in order to
proceed with connection establishment
with remote FTAM Responder. If SITE or
ACCT commands are sent while waiting
for USER command, save arguments for
subsequent use.
FTP-I:Wait-for-PASS Gateway has already received USER
command from FTP Client, as well as
userid and destination host DN.
Gateway is waiting for the FTAM
Responder logon password.
FTP-I:Wait-for-PAddress Gateway has already received PASS
command from FTP Client. Gateway is
resolving the provided FTAM Responder's
address to a Presentation Address. The
provided address may be a Distinguished
Name, User Friendly Name, or Domain
Name. Resolution will typically be
done using X.500 directory services.
FTP-I:Wait-for-Connection Gateway has initiated a connection to
the FTAM Responder and is waiting for
notification as to whether or not the
logon is successful.
FTP-I:Wait-for-ClientCmd Connection exists between FTP Client
and FTAM Responder. Gateway is waiting
for next command or response from FTP
Client. Commands and responses are
mapped as they are received.
FTP-I:Wait-for-RespondrCmd Connection exists between FTP Client
and FTAM Responder. Gateway is waiting
for next command or response from FTAM
Responder. Commands and responses are
mapped as they are received.
Each possible state transition is covered in the rest of Section 5.1 ๐ฆ For every transition, we list the actions that cause it ๐
5.1.1. FTP-I:Initial-State --> FTP-I:Initial-State
- Gateway receives SITE or ACCT command from FTP Client. SITE argument includes Distinguish Name of FTAM Responder.
5.1.2. FTP-I:Initial-State --> FTP-I:Wait-for-PASS
- Gateway receives USER command from FTP Client. Arguments include Distinguished Name of FTAM Responder and userid on FTAM responder.
5.1.3. FTP-I:Wait-for-PASS --> FTP-I:Wait-for-PAddress
- Gateway receives PASS command from FTP Client.
5.1.4. FTP-I:Wait-for-PAddress --> FTP-I:Wait-for-Connection
- Gateway resolves received Distinguished Name, User Friendly Name, or Domain Name of FTAM Responder to OSI Presentation address.
- Gateway sends F-INITIALIZE to FTAM Responder with Presentation Address in
<Called Presentation Address>, userid in<Initiator Identity>, and password in<Filestore Password>.
5.1.5. FTP-I:Wait-for-Connection --> FTP-I:Wait-for-NextMapping
- Gateway receives
<State Result>of "Success". - Gateway sends 230 reply code (User Logged In) to FTP Client.
5.1.6. FTP-I:Wait-for-ClientCmd --> FTP-I:Wait-for-RespondrCmd
- Gateway receives command or response from FTP Client and maps it to FTAM protocol, as defined in section 8.1.
5.1.7. FTP-I:Wait-for-RespondrCmd --> FTP-I:Wait-for-ClientCmd
- Gateway receives command or response from FTAM Responder and maps it to FTP protocol, as defined in section 8.1.
5.1.8. FTP-I:Wait-for-ClientCmd --> FTP-I:Wait-for-USER
- Gateway receives QUIT command from FTP Client; maps QUIT as per Section 8.1.
5.2. FTAM-Initiated Gateway Service
okay so here are the state variables for the FTAM-Initiated Gateway service ๐ โจ
State Variable State Definition
----------------------------------------------------------------
FTAM-I:Initial-State Initial state of FTAM-Initiated Gateway
Service.
Gateway is waiting for an FTAM
Initiator to issue an F-INITIALIZE
command in order to proceed with
connection establishment with remote
FTP Server.
FTAM-I:Wait-for-IPAddress Gateway has already received F-
INITIALIZE from FTAM Initiator.
Gateway is resolving the provided FTP
Server's address to an IP address. The
provided address may be a Domain Name,
Distinguished Name, or User Friendly
Name.
FTAM-I:Wait-for-Connection Gateway has initiated a connection to
the FTP Server and is waiting for
notification as to whether or not the
logon is successful.
FTAM-I:Wait-for-InitiatrCmd Connection exists between FTAM
Initiator and FTP Server. Gateway is
waiting for next command or response
from FTAM Initiator. Commands and
responses are mapped as they are
received.
FTP-I:Wait-for-ServerCmd Connection exists between FTAM
Initiator and FTP Server. Gateway is
waiting for next command or response
from FTP Server. Commands and
responses are mapped as they are
received.
every possible state transition is covered in the rest of Section 5.2 ๐ฆ for each one, I'll spell out what actually makes it happen.
5.2.1. FTAM-I:Initial-State --> FTAM-I:Wait-for-IPAddress
- Gateway receives
F-INITIALIZEfrom FTAM Initiator ๐ the Domain Name of the FTP Server is either in<Responding Presentation Address>or in the"@host"portion of the<Initiator Identity>parameter. the userid is in<Initiator Identity>, and the password is in the<Filestore Password>parameter.
5.2.2. FTAM-I:Wait-for-IPAddress --> FTAM-I:Wait-for-Connection
- Gateway resolves the received Domain Name, Distinguished Name, or User Friendly Name of the FTP Server to an IP address ๐ธ
- Gateway sends
USERto FTP Server. - Gateway sends
PASSto FTP Server.
5.2.3. FTAM-I:Wait-for-Connection --> FTAM-I:Wait-for-NextMapping
- Gateway receives the
230reply code (User Logged In) from FTP Server ๐ฅณ - Gateway sends a
<State Result>of"Success"to FTAM Initiator.
5.2.4 FTAM-I:Wait-for-InitiatrCmd --> FTAM-I:Wait-for-ServerCmd
- Gateway receives a command or response from FTAM Initiator and maps it to the FTP protocol, as defined in section 8.2 ๐ฅ
5.2.5. FTAM-I:Wait-for-ServerCmd --> FTAM-I:Wait-for-InitiatrCmd
- Gateway receives a command or response from FTP Server and maps it to the FTAM protocol, as defined in section 8.2 ๐
5.2.6. FTAM-I:Wait-for-InitiatrCmd --> FTAM-I:Wait-for-INITIALIZE
- Gateway receives an F-CLOSE primitive from FTAM Initiator, and maps
F-CLOSEas per Section 8.2 ๐ซถ
6. Document Type Support โจ
okay the FTP-FTAM gateway only supports a subset of the document types from the Stable Implementation Agreements for Open Systems Interconnection Protocols: Part 9 - FTAM Phase 2, which was produced by the March 1992 Open Systems Environment Implementors' Workshop [NIST92]. this subset was picked because it matches the document types FTP already supports ๐ the set includes:
FTAM-1 "ISO FTAM Unstructured text file
FTAM-3 "ISO FTAM Unstructured binary file
NBS-9 "NBS-9 FTAM File directory file"
FTAM document types map to FTP document types like this ๐
FTAM <-> FTP
----------------------------------
FTAM-1 <-> ASCII
FTAM-3 <-> 8 bit binary
NBS-9 <-> Directory
gateway support for FTAM-1 and FTAM-2 is required, whereas support for NBS-9 is recommended ๐
6.1. Notes on NBS-9
ngl this part is kind of a lore dump ๐ NBS-9 is optional in GOSIP versions 1 and 2 [NIST91]. it's getting superseded by its replacement once ISO/IEC ISP 10607-2 and ISO/IEC ISP 10607-2/Amendment 1 are published [NIST92].
for conformance to NBS-9, an FTAM Responder is only required to return the <Filename> file attribute, subject to local security and access control. all the other requested attributes need not be returned ๐ง
systems supporting the NBS-9 document type shall make available an NBS-9 document called 'DIRLIS'. this document can be used to get a listing of files and their associated attributes from a remote Filestore ๐
7. Functional Comparison of FTP and FTAM ๐
a full comparison of the services offered by FTP and FTAM is beyond the scope of this spec, so don't come for me ๐ญ this section just covers a few key points. go read [NIST 86a] and [ROSE90] if you want the full tea โ
FTAM is not a superset of FTP. each protocol has functions that only it performs ๐ the set of FTAM functions is, however, bigger than the set of FTP functions.
FTP combines file management and file transfer into one protocol engine, whereas FTAM separates management and transfer as they relate to files ๐ฆ
the file transfer services of both FTP and FTAM expect a reliable underlying end-to-end service. at a minimum, this service includes the capability to transfer entire files between remote hosts and to display remote filenames ๐
on top of that basic file transfer service, FTAM supports the capability to access a few records from a file server, create a network file system (similar to Sun's Network File System), handle printing and spooling, and access remote database records. FTP does not support these extra capabilities ๐
FTP uses TELNET services to set up a connection between the FTP Client and FTP Server. a three-digit reply code followed by explanatory text shows the status of the preceding request and gives diagnostic info explaining each transaction ๐
FTAM relies on the Association Control Service Element (ACSE) to start and stop the network for network file interaction. generally, the ASCE establishes the application association and related application context needed to support the FTAM protocol ๐ง
the FTAM protocol is modularized so the allowable number of actions in any particular state stays relatively small. there are way more possible sequences of FTP operations than possible sequences of FTAM operations [NIST86] ๐ธ
because FTAM is more robust than FTP, FTAM allows greater flexibility for conveying information about files. FTAM only deals with aspects of application processes, and leaves data representation and data management facilities to other OSI service elements ๐
the FTP scheme is a Client/Server model, but FTAM is based on the Initiator/Responder model ๐ซถ the key difference is that once the FTAM Initiator has established a connection with a remote host, either the Initiator or the Responder can request services of the other. in the FTP realm, the Client both initiates a connection and requests all services ๐ฅ
the FTP Client knows the real properties of the remote host filesystem. FTAM, on the other hand, uses a conceptual model of a filesystem called a virtual filestore model ๐ the virtual filestore is a collection of files, and each file has a name that uniquely identifies it. each file has a set of attributes, such as ownership information and contents, which is the data associated with the file. one file attribute is the <Contents Type> of the file, typically with a value of "FTAM-1", "FTAM-3", or "NBS-9" โจ the FTAM Initiator only knows the properties of the corresponding Responder and virtual filestore, not the real properties of the filesystem on the remote host ๐
7.1. Loss of Functionality
translating two dissimilar protocols is kind of like translating two languages, so some loss of functionality is inevitable ๐ญ for the FTP-FTAM gateway, some of the most blatant losses are:
- Diagnostics passed between protocols may not be precisely translated.
- The FTAM partial file (record) transfer may not be supported.
- Some FTAM attributes are not supported by FTP.
the main goal of the gateway protocol mappings is to minimize this loss of functionality ๐ซถ as this gateway spec and later implementations evolve, ways to partly overcome the loss of functionality may become more obvious. for example, the gateway may be able to emulate file record transfers between FTAM Initiators and FTP Servers ๐ฆ
8. Mapping of Protocol Functions and Representations โจ
okay so this section is where the actual translation happens, bestie ๐ง The mappings are based on the FTAM protocol implementation in Stable Implementation Agreements for Open Systems Interconnection Protocols: Part 9 - FTAM Phase 2, produced by the March 1992 Open Systems Environment Implementors' Workshop [NIST92], plus [ISO8571-1], [ISO8571-2], [ISO8571-3], [ISO8571-4], and [ISO8571-5]. The FTP side is defined in Request for Comments [RFC959]. The mappings are strongly influenced by the work of M. A. Wallace et. al. at NIST [NIST86] and John Scott at MITRE [MITRE87] ๐ซถ
A key goal here is to minimize the loss of functionality between the two protocols ๐ How the gateway actually implements the mappings is up to the gateway implementor, and the focus is on non-error-encumbered processing. Diagnostic and error messages get their own treatment in section 9 ๐ฅ
At a minimum, the FTAM implementation in the FTP-FTAM gateway support for Implementation Profiles T1 (Simple File Transfer) and M1 (Management), as defined in [NIST92], is required. Those profiles line up with the A/111 and A/13 Profiles of Standards Promotion and Application Group in Europe, respectively [NIST92] ๐ธ
At a minimum, the gateway support for the following is also required:
- ASCII and 8 bit binary file types. It should also support FTP File Stream Mode.
- The following FTAM document types: FTAM-1 (unstructured text file), FTAM-3 (unstructured binary file), and NBS-9 (set of directory entries).
POSIX file naming and organization conventions are assumed in these mappings. So files are organized in a hierarchy where every non-terminal node is a directory and every terminal node is some other type of file ๐ฆ
Here's the terminology we're using:
- argument: FTP Service Command argument, as used in [RFC959].
- parameter: FTAM Service Primitive parameters and attributes, as enumerated in Tables 6, 50, and 51 of [ISO8571-3].
And the notation:
- Arguments and parameters are enclosed in angle brackets, e.g.,
<Action Result>. - Values of arguments and parameters are enclosed in quotation marks, e.g.,
"Success". - FTP Service Commands and FTAM Primitives are in uppercase, e.g.,
F-INITIALIZE.
8.1. FTP-Initiated Gateway Service
the protocol mapping between FTP and FTAM may be one-to-zero (i.e., not mappable), one-to-one, or one-to-many. so not everything lines up neatly, but that's the vibe ๐
The general steps the FTP-FTAM gateway takes to provide the FTP-Initiated service are:
- Accept an FTP Client request at the FTP Server side of the gateway service.
- Map the request to the (set of) corresponding FTAM Initiator function(s).
- Acting as an FTAM Initiator, send the FTAM Initiator function(s) to the FTAM Responder.
- Accept information returned to the FTAM Initiator side of the gateway. This information originated at the FTAM Responder.
- Map this returned information to the protocol form understood by the FTP Server side of the gateway.
- Send this returned information from the FTP Server side of the gateway to the FTP Client.
For each FTP protocol function, here are the FTAM protocol functions needed to map it ๐
FTP FTAM
------------------------------------------------------------------
ABOR F-BEGIN-GROUP, F-CANCEL, F-CLOSE, F-DESELECT, F-END-GROUP
ACCT F-INITIALIZE,
ALLO none
APPE F-BEGIN-GROUP, F-CLOSE, F-CREATE, F-DATA, F-DATA-END, F-
DESELECT, F-END-GROUP, F-OPEN, F-READ-ATTRIBUTES, F-SELECT,
F-TRANSFER-END, F-WRITE
CDUP F-BEGIN-GROUP, F-DESELECT, F-END-GROUP, F-SELECT
CWD F-BEGIN-GROUP, F-END-GROUP, F-DESELECT, F-SELECT
DELE F-BEGIN-GROUP, F-DELETE, F-END-GROUP, F-SELECT
HELP none
LIST F-BEGIN-GROUP, F-CLOSE, F-DATA, F-DATA-END, F-DESELECT, F-
END-GROUP, F-OPEN, F-READ, F-READ-ATTRIBUTES, F-SELECT, F-
TRANSFER-END
MKD none
MODE none
NLST F-BEGIN-GROUP, F-CLOSE, F-DATA, F-DATA-END, F-DESELECT, F-
END-GROUP, F-OPEN, F-READ, F-SELECT, F-TRANSFER-END
NOOP none
PASS F-INITIALIZE
PASV none
PORT none
PWD F-BEGIN-GROUP, F-DESELECT, F-END-GROUP, F-READ-ATTRIBUTES,
F-SELECT
QUIT F-P-ABORT or F-U-ABORT, F-TERMINATE
REIN F-BEGIN-GROUP, F-CANCEL, F-CLOSE, F-DESELECT, F-END-GROUP
REST F-CHECK, F-RESTART
RETR F-BEGIN-GROUP, F-CLOSE, F-DATA, F-DATA-END, F-DESELECT, F-
END-GROUP, F-OPEN, F-READ, F-SELECT, F-TRANSFER-END
RMD none
RNFR F-BEGIN-GROUP, F-DESELECT, F-END-GROUP, F-SELECT
RNTO F-BEGIN-GROUP, F-CHANGE-ATTRIBUTES, F-DESELECT, F-END-
GROUP, F-SELECT
SITE F-INITIALIZE
SMNT none
STAT none
STOR F-BEGIN-GROUP,F-CLOSE, F-CREATE, F-DATA, F-DATA-END, F-
DESELECT, F-END-GROUP, F-OPEN, F-READ-ATTRIBUTES, F-SELECT,
F-TRANSFER-END, F-WRITE
STOU F-BEGIN-GROUP, F-CLOSE, F-CREATE, F-DATA, F-DATA-END, F-
DESELECT, F-END-GROUP, F-OPEN, F-READ-ATTRIBUTES, F-SELECT,
F-TRANSFER-END, F-WRITE
STRU none
TYPE none
USER F-INITIALIZE
The rest of this section gets into the detailed mapping procedures for each FTP protocol function. Gateway support for these mappings is required ๐
8.1.1. ABOR
- Send F-CANCEL to FTAM Responder.
- Send the following grouped request to the FTAM Responder:
F-BEGIN-GROUP,F-CLOSE,F-DESELECT,F-END-GROUP. - Translate FTAM Responder
<Action Result>and<Diagnostic>parameters to equivalent FTP reply code(s), and send reply codes to FTP Client. - Translate FTP Client reply codes to equivalent FTAM
<Action Result>and<Diagnostic>parameters, and send parameters to FTAM Responder.
8.1.2. ACCT
- Set the
<Account>parameter value for issuing F-INITIALIZE to FTAM Responder. - If the
<Called Presentation Address>,<Initiator Identity>, and<Filestore Password>parameters are available, attempt connection with FTAM Responder. Otherwise, wait for additional ACCT commands. - Translate FTAM Responder
<Action Result>and<Diagnostic>parameters to equivalent FTP reply code(s), and send reply codes to FTP Client. - Translate FTP Client reply codes to equivalent FTAM
<Action Result>and<Diagnostic>parameters, and send parameters to FTAM Responder.
Note: the ACCT command will be effective with the next PASS command.
8.1.3. ALLO
- Return a 200 reply code to FTP Client.
8.1.4. APPE
- Save the current pathname by appending the saved CWD string with the
<pathname>argument. If there is no saved CWD string, proceed to step 12. - Send the following grouped request to FTAM Responder:
F-BEGIN-GROUP,F-SELECT,F-READ-ATTRIBUTES, then save the<Contents Type>parameter value, and finallyF-DESELECT,F-END-GROUP. - If the
<Contents Type>parameter value returned with the F-READ-ATTRIBUTES has a value of"NBS-9", proceed to step 12. - Send the following grouped request to the FTAM Responder:
F-BEGIN-GROUP,F-CREATE(with the<Override>parameter in the F-CREATE set to"Select Old File"),F-OPEN,F-END-GROUP. - If the file existed, set the
<Contents Type>parameter in the F-CREATE to match the one returned by the F-READ-ATTRIBUTES. - If the file did not exist and no previous FTP TYPE
"Image"command was issued, set the<Contents Type>parameter to"FTAM-1". Otherwise, set the<Contents Type>parameter to"FTAM-3". - Send F-WRITE, with the
<Bulk Data Transfer Specification, FADU Operation>parameter set to"File Extend", to FTAM Responder. - Loop reading data from the FTP data connection, sending the data in F-DATA PDUs until end-of-file on the FTP connection.
- Send F-DATA-END to FTAM Responder.
- Send F-TRANSFER-END to FTAM Responder.
- Send the following grouped request to the FTAM Responder:
F-BEGIN-GROUP,F-CLOSE,F-DESELECT,F-END-GROUP. - Translate FTAM Responder
<Action Result>and<Diagnostic>parameters to equivalent FTP reply code(s), and send reply code(s) to FTP Client. - Translate FTP Client reply codes to equivalent FTAM
<Action Result>and<Diagnostic>parameters, and send parameters to FTAM Responder.
Note: a. The <pathname> argument is assumed to be a filename, relative to the currently saved CWD. b. The CWD of the FTAM system must be defined prior to issuance of APPE.
8.1.5. CDUP
- Determine the parent directory from the saved CWD string. If there is no saved CWD string, proceed to step 4.
- Set the
<Contents Type>parameter to"NBS-9". - Send the following grouped request to FTAM Responder:
F-BEGIN-GROUP,F-SELECT,F-DESELECT,F-END-GROUP. - Translate FTAM Responder
<Action Result>and<Diagnostic>parameters to equivalent FTP reply code(s), and send reply code(s) to FTP Client. - Translate FTP Client reply codes to equivalent FTAM
<Action Result>and<Diagnostic>parameters, and send parameters to FTAM Responder.
Note: a. A POSIX file organization is assumed, i.e., files in the systems are organized in a hierarchical structure in which all of the non-terminal nodes are directories and all of the terminal nodes are any other type of file. b. If the parent directory does not exist, the current working directory remains unchanged. c. The CWD of the FTAM system must be defined prior to issuance of CDUP.
8.1.6. CWD
- Save the
<pathname>argument as the CWD string. - Set the
<Contents Type>parameter to"NBS-9". - Send the following grouped request to FTAM Responder:
F-BEGIN-GROUP,F-SELECT,F-DESELECT,F-END-GROUP. - Translate FTAM Responder
<Action Result>and<Diagnostic>parameters to equivalent FTP reply code(s), and send reply code(s) to FTP Client. - Translate FTP Client reply codes to equivalent FTAM
<Action Result>and<Diagnostic>parameters, and send parameters to FTAM Responder.
Note: a. The <pathname> argument is assumed to be an absolute directory specification. b. If the specified directory does not exist, the current working directory remains unchanged. c. The saved CWD string is used in other FTP-to-FTAM mappings, such as APPE.
8.1.7. DELE ๐๏ธโจ
- Okay so first, save the current pathname by appending the saved CWD string with the <pathname> argument ๐. If there's no saved CWD string, skip ahead to step 3.
- Send this grouped request to the FTAM Responder ๐:
F-BEGIN-GROUP
F-SELECT
F-DELETE
F-END-GROUP
- Take the FTAM Responder's <Action Result> and <Diagnostic> parameters, translate them into the matching FTP reply code(s), and send those to the FTP Client ๐.
- Take the FTP Client reply codes, translate them into the equivalent FTAM parameters, and send those to the FTAM Responder ๐.
Note: a. The <pathname> argument is treated as a filename, relative to the currently saved CWD ๐ง. b. The CWD of the FTAM system has to be defined before you issue DELE โ ๏ธ, bestie, don't skip this.
8.1.8. HELP ๐๐
- If no <string> argument is provided, send helpful information about the implementation of the gateway to the FTP Client ๐. If an argument is provided, send more specific information instead.
- Return the FTP reply code
214to the FTP Client ๐.
8.1.9. LIST ๐๐ธ
- If a <pathname> argument is provided, jump straight to step 3 ๐โโ๏ธ.
- Save the current pathname by appending the saved CWD string with the <pathname> argument. If there's no saved CWD string, skip to step 11 ๐ซ .
- Send this grouped request to the FTAM Responder ๐จ:
F-BEGIN-GROUP
F-SELECT
F-READ-ATTRIBUTES
F-DESELECT
F-END-GROUP
Save the <Filename>, <Contents Type>, <Data/Time of Last Modification>, and <Filesize> parameters ๐พ.
- If the <Contents Type> parameter of the F-READ-ATTRIBUTES is not
"NBS-9", then return the <Filename>, <Contents Type>, <Date/Time of Last Modification>, and <Filesize> parameter values, obtained with the previous F-READ-ATTRIBUTES, to the FTP data connection ๐ฆ, and proceed to step 8. - Send this grouped request to the FTAM Responder:
F-BEGIN-GROUP
F-SELECT
F-OPEN
F-END-GROUP
- Send F-READ to the FTAM Responder ๐.
- Loop reading F-DATA until F-DATA-END ๐. As data comes in, write the <Filename>, <Permitted Actions>, <Contents Type>, and <Date/Time of Last Modification> parameter values from the PDU to the FTP data connection ๐.
- Send F-TRANSFER-END to the FTAM Responder ๐.
- Send this grouped request to the FTAM Responder:
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
- Translate the FTAM Responder's <Action Result> and <Diagnostic> parameters into the equivalent FTP reply code(s), and send those to the FTP Client ๐ .
- Translate the FTP Client reply codes into the equivalent FTAM <Action Result> and <Diagnostic> parameters, and send those to the FTAM Responder ๐ซถ.
Note: a. Assume the <pathname> argument is relative to the saved CWD, whether it's a filename or a directory specification ๐๏ธ. b. The CWD of the FTAM system must be defined before you issue LIST ๐ง. c. Transfers over the data connection should be in ASCII ๐ค. e. If a list of files with full directory/file specifications comes back from the FTAM Responder, the gateway should parse the list to strip off the directory portion โ๏ธ. Slay the parsing.
8.1.10. MKD ๐ โโ๏ธ
- Return a
502reply code (Command not implemented) to the FTP Client ๐ซ.
Note: a. As indicated in the NIST Stable Implementation Agreements for FTAM [NIST92], creation or deletion of NBS-9 files is outside the scope of the agreements ๐.
8.1.11. MODE ๐
- If <argument> is
"Stream", return a200reply code to the FTP Client ๐. Otherwise, return a504reply code (Command not implemented for that parameter) ๐.
8.1.12. NLST ๐โจ
- If a <pathname> argument is provided, use the <pathname> argument as the <Filename> parameter value in the F-SELECT issued in step 3 ๐ฏ.
- If no argument is provided, use the saved CWD value as the <Filename> parameter value in the F-SELECT issued in step 3. If there's no saved CWD string and no argument, skip to step 9 ๐ซฅ.
- Set the <Contents Type> parameter to
"NBS-9"๐ท๏ธ. - Send this grouped request to the FTAM Responder:
F-BEGIN-GROUP
F-SELECT
F-OPEN
F-END-GROUP
- Send F-READ to the FTAM Responder ๐.
- Loop reading F-DATA until F-DATA-END ๐. As data is received, write the filenames and other useful information from the PDU to the FTP data connection ๐.
- Send F-TRANSFER-END to the FTAM Responder ๐.
- Send this grouped request to the FTAM Responder:
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
- Translate the FTAM Responder's <Action Result> and <Diagnostic> parameters into the equivalent FTP reply code(s), and send those to the FTP Client ๐.
- Translate the FTP Client reply codes into the equivalent FTAM <Action Result> and <Diagnostic> parameters, and send those to the FTAM Responder ๐.
Note: a. As per RFC 959 (FTP), the NLST <pathname> argument is a directory ๐. b. Assume the argument is relative to the saved CWD, whether it's a filename or a directory specification ๐งญ. c. The CWD of the FTAM system must be defined before you issue NLST ๐ง. d. Transfers over the data connection should be in ASCII ๐ค. e. The gateway should parse full directory/file specifications received from the FTAM Responder to strip off the directory portion. This is required to support the "FTP multiple get" function that pipes NLST output to the STOR command ๐ซถ. This one is literally non-negotiable.
8.1.13. NOOP ๐ด
- Return a
200reply code to the FTP Client โจ.
8.1.14. PASS ๐
- Set the <Filestore Password> parameter for F-INITIALIZE ๐๏ธ.
- If <Called Presentation Address>, <User Identity>, and <Filestore Password> are all available, issue F-INITIALIZE to the FTAM Responder ๐.
- Translate the FTAM Responder's <Action Result> and <Diagnostic> parameters into the equivalent FTP reply code(s), and send those to the FTP Client ๐.
- Translate the FTP Client reply codes into the equivalent FTAM <Action Result> and <Diagnostic> parameters, and send those to the FTAM Responder ๐.
8.1.15. PASV ๐ฆ
- Wait for the data transfer on the default data port, or on the data port specified by the PORT command ๐.
- Return a
200reply code to the FTP Client ๐ .
8.1.16. PORT ๐
- Return a
200reply code to the FTP Client ๐ธ.
8.1.17. PWD ๐๐
- If there's a saved CWD string, return it to the FTP Client and proceed to step 4 ๐.
- Set the <Contents Type> attribute to
"NBS-9"๐ท๏ธ. - Send this grouped request to the FTAM Responder:
F-BEGIN-GROUP
F-SELECT
F-READ-ATTRIBUTES
F-DESELECT
F-END-GROUP
- Return the current directory name to the FTP Client ๐บ๏ธ.
- Translate the FTAM Responder's <Action Result> and <Diagnostic> parameters into the equivalent FTP reply code(s), and send those to the FTP Client ๐.
- Translate the FTP Client reply codes into the equivalent FTAM <Action Result> and <Diagnostic> parameters, and send those to the FTAM Responder ๐ซถ.
8.1.18. QUIT ๐๐ฅ
- If the user is not logged in, proceed to step 5 ๐.
- If a file transfer is in progress, send F-P-ABORT or F-U-ABORT to the FTAM Responder ๐.
- If a file transfer is not in progress, send F-TERMINATE to the FTAM Responder ๐.
- Return charge information to the FTP Client ๐ธ.
- Translate the FTAM Responder's <Action Result> and <Diagnostic> parameters into the equivalent FTP reply code(s), and send those to the FTP Client ๐.
- Translate the FTP Client reply codes into the equivalent FTAM <Action Result> and <Diagnostic> parameters, and send those to the FTAM Responder ๐.
8.1.19. REIN ๐โจ
- Flush all I/O and account information ๐งน.
- Allow all transfers in progress to be completed ๐โโ๏ธ.
- Set all parameters to their default values ๐.
- Send F-CANCEL to the FTAM Responder ๐ซ.
- Send this grouped request to the FTAM Responder:
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
- Leave the control connection open ๐.
- Translate the FTAM Responder's <Action Result> and <Diagnostic> parameters into the equivalent FTP reply code(s), and send those to the FTP Client ๐.
- Translate the FTP Client reply codes into the equivalent FTAM <Action Result> and <Diagnostic> parameters, and send those to the FTAM Responder ๐.
Note: a. This is typically followed by a USER command ๐ค.
8.1.20. REST ๐๐ง
- Send F-CHECK to the FTAM Responder โ .
- Send F-RESTART to the FTAM Responder โถ๏ธ.
- Translate the FTAM Responder's <Action Result> and <Diagnostic> parameters into the equivalent FTP reply code(s), and send those to the FTP Client ๐.
- Translate the FTP Client reply codes into the equivalent FTAM <Action Result> and <Diagnostic> parameters, and send those to the FTAM Responder ๐ซถ.
Notes: a. This will only have an effect on the FTAM Responder if the restart functional unit is negotiated on F-INITIALIZE ๐ค. b. Refer to ISO 8571-3 for additional subtleties of FTAM checkpoint and restart ๐.
8.1.21. RETR ๐ฅ๐ซ
- Save the current pathname by appending the saved CWD string with the <pathname> argument. If there's no saved CWD string, skip to step 9 ๐๏ธ.
- Set the <Contents Type> parameter to the appropriate type of file ๐ท๏ธ.
- Send this grouped request to the FTAM Responder:
F-BEGIN-GROUP
F-SELECT
F-OPEN
F-END-GROUP
- If the file does not exist, skip to step 9 ๐ฅบ.
- Send F-READ to the FTAM Responder ๐.
- Loop reading F-DATA until F-DATA-END ๐. As data is received, write it to the FTP data connection ๐.
- Send F-TRANSFER-END to the FTAM Responder ๐.
- Send this grouped request to the FTAM Responder:
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
- Translate the FTAM Responder's <Action Result> and <Diagnostic> parameters into the equivalent FTP reply code(s), and send those to the FTP Client ๐.
- Translate the FTP Client reply codes into the equivalent FTAM <Action Result> and <Diagnostic> parameters, and send those to the FTAM Responder ๐.
Note: a. The <pathname> argument is assumed to be a filename, relative to the currently saved CWD ๐งญ. b. The CWD of the FTAM system must be defined before you issue RETR ๐ง.
8.1.22. RMD ๐ โโ๏ธ๐
- Return a
502reply code (Command not implemented) to the FTP Client ๐ซ.
Note: a. As indicated in the NIST Stable Implementation Agreements for FTAM [NIST92], creation or deletion of NBS-9 files is outside the scope of the agreements ๐ซ .
8.1.23. RNFR ๐ฆ
okay so RNFR is the "rename from" half of the duo ๐ here's how it goes:
- Save the current pathname by tacking the
<pathname>argument onto the saved CWD string. If there's no saved CWD string, skip ahead to step 3 โจ - Send this grouped request to the FTAM Responder ๐ซถ
F-BEGIN-GROUP
F-SELECT
Get <Filename> parameter value from RNFR <pathname>
argument.
F-DESELECT
F-END-GROUP
- Translate the FTAM Responder's
<Action Result>and<Diagnostic>parameters into the matching FTP reply code(s), then send those reply code(s) to the FTP Client ๐ - Translate the FTP Client's reply codes into the matching FTAM
<Action Result>and<Diagnostic>parameters, then send those parameters to the FTAM Responder ๐ฅ
Note:
- a. The
<pathname>argument is assumed to be a filename, relative to the currently saved CWD. - b. Together with RNTO, this command causes a file to be renamed ๐ฆ
- c. The CWD of the FTAM system must be defined prior to issuance of RNFR ๐ธ
8.1.24. RNTO ๐
RNFR's partner in crime, RNTO, is the "rename to" step ๐ here's the flow:
- Save the current pathname by tacking the
<pathname>argument onto the saved CWD string. If there's no saved CWD string, skip ahead to step 3 โจ - Send this grouped request to the FTAM Responder ๐ซถ
F-BEGIN-GROUP
F-SELECT
F-CHANGE-ATTRIBUTES
Get <Filename> parameter from arguments provided by
RNTO and previous RNFR.
F-DESELECT
F-END-GROUP
- Translate the FTAM Responder's
<Action Result>and<Diagnostic>parameters into the matching FTP reply code(s), then send those reply code(s) to the FTP Client ๐ - Translate the FTP Client's reply codes into the matching FTAM
<Action Result>and<Diagnostic>parameters, then send those parameters to the FTAM Responder ๐ฅ
Note:
- a. The
<pathname>argument is assumed to be a filename, relative to the currently saved CWD. - b. Together with RNFR, this command causes a file to be renamed ๐ฆ
- c. The CWD of the FTAM system must be defined prior to issuance of RNTO ๐ธ
8.1.25. SITE ๐ง
the SITE command is giving destination energy ๐ง here's the plan:
- Save the specified destination address information ๐
- Set the
<Called Presentation Address>parameter value equal to the<string>argument. This parameter will be used when the F-INITIALIZE is sent to the FTAM Responder ๐ - Translate the FTAM Responder's
<Action Result>and<Diagnostic>parameters into the matching FTP reply code(s), then send those reply code(s) to the FTP Client ๐ - Translate the FTP Client's reply codes into the matching FTAM
<Action Result>and<Diagnostic>parameters, then send those parameters to the FTAM Responder ๐ฅ
Note:
- a. The
<string>argument to the SITE command may include a Distinguished Name or a User Friendly Name ๐
8.1.26. SMNT ๐
SMNT is giving "no thanks" energy ๐ here's the whole thing:
- Return a 502 reply code to FTP Client ๐ซ
Note:
- a. The argument is ignored ๐
8.1.27. STAT ๐ท
STAT is the gateway checking its own vibes ๐ท here's how:
- Provide the gateway session status to the FTP Client โจ
- Return a 211 reply code to FTP Client ๐
Note:
- a. The argument is ignored ๐
8.1.28. STOR ๐
STOR is the big one, bestie, it literally uploads a file ๐ hold on to your hat:
- Save the current pathname by tacking the
<pathname>argument onto the saved CWD string. If there's no saved CWD string, skip ahead to step 11 โจ - Send this grouped request to the FTAM Responder ๐ซถ
F-BEGIN-GROUP
F-SELECT
F-READ-ATTRIBUTES
Save <Contents Type> parameter value
F-DESELECT
F-END-GROUP
- If the
<Contents Type>parameter returned with the F-READ-ATTRIBUTES indicates a directory, skip ahead to step 11 ๐ - Send this grouped request to the FTAM Responder ๐ซถ
F-BEGIN-GROUP
F-CREATE
Set the <Override> parameter in the F-CREATE to
"Delete and create with new attributes.".
F-OPEN
F-END-GROUP
- If the file existed, set the
<Contents Type>parameter in the F-CREATE to match the F-READ-ATTRIBUTES. If the file did not exist, set the<Contents Type>parameter to"FTAM-1". If TYPE"Image"was previously requested, set the<Contents Type>parameter to"FTAM-3"๐ - Send F-WRITE, with the
<Bulk Data Transfer Specification, FADU Operation>parameter set to"File Extend", to the FTAM Responder โ๏ธ - Loop reading data from the FTP data connection, sending the data in F-DATA PDUs until end-of-file on the FTP connection ๐
- Send F-DATA-END to the FTAM Responder ๐
- Send F-TRANSFER-END to the FTAM Responder ๐
- Send this grouped request to the FTAM Responder ๐ซถ
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
- Take the FTAM Responder's
<Action Result>and<Diagnostic>parameters, translate them into the matching FTP reply code(s), and send those reply code(s) to the FTP Client ๐ - Take the FTP Client's reply codes, translate them into the matching FTAM
<Action Result>and<Diagnostic>parameters, and send those parameters to the FTAM Responder ๐ฅ
Note:
- a. The
<pathname>argument is assumed to be a filename, relative to the currently saved CWD. - b. The CWD of the FTAM system must be defined prior to issuance of STOR ๐ธ
8.1.29. STOU ๐
STOU is STOR's cousin with a twist: the file name has to be unique ๐ here's the breakdown:
- Save the current pathname by tacking the
<pathname>argument onto the saved CWD string. If there's no saved CWD string, skip ahead to step 11 โจ - Send this grouped request to the FTAM Responder ๐ซถ
F-BEGIN-GROUP
F-SELECT
F-READ-ATTRIBUTES
Save <Contents Type> parameter value
F-DESELECT
F-END-GROUP
- If the file already exists, skip ahead to step 12 ๐ โโ๏ธ
- If the
<Contents Type>parameter returned with the F-READ-ATTRIBUTES indicates a directory, skip ahead to step 11 ๐ - Send this grouped request to the FTAM Responder ๐ซถ
F-BEGIN-GROUP
F-CREATE
Set the <Override> parameter in the F-CREATE to
"Delete and create with new attributes.".
F-OPEN
F-END-GROUP
- If the file existed, set the
<Contents Type>parameter in the F-CREATE to match the F-READ-ATTRIBUTES. If the file did not exist, set the<Contents Type>parameter to"FTAM-1". If TYPE"Image"was previously requested, set the<Contents Type>parameter to"FTAM-3"๐ - Send F-WRITE, with the
<Bulk Data Transfer Specification, FADU Operation>parameter set to"File Extend", to the FTAM Responder โ๏ธ - Loop reading data from the FTP data connection, sending the data in F-DATA PDUs until end-of-file on the FTP connection ๐
- Send F-DATA-END to the FTAM Responder ๐
- Send F-TRANSFER-END to the FTAM Responder ๐
- Send this grouped request to the FTAM Responder ๐ซถ
F-BEGIN-GROUP
F-CLOSE
F-DESELECT
F-END-GROUP
- Take the FTAM Responder's
<Action Result>and<Diagnostic>parameters, translate them into the matching FTP reply code(s), and send those reply code(s) to the FTP Client ๐ - Take the FTP Client's reply codes, translate them into the matching FTAM
<Action Result>and<Diagnostic>parameters, and send those parameters to the FTAM Responder ๐ฅ
Note:
- a. The
<pathname>argument is assumed to be a filename, relative to the currently saved CWD. - b. This is the same as STOR, except the name of the created file must be unique in that directory ๐ฆ
- c. The CWD of the FTAM system must be defined prior to issuance of STOU ๐ธ
8.1.30. STRU ๐งฉ
STRU is the structure check, and it's very particular ๐งฉ here's the deal:
- If the
<structure code>argument is not"File", return 504 reply code to FTP Client ๐ โโ๏ธ; otherwise, return 200 reply code to FTP Client โ
8.1.31. SYST ๐ซฅ
SYST is the "not telling you" command ๐ซฅ here's the whole thing:
- Return 502 reply code to FTP client ๐
8.1.32. TYPE ๐จ
TYPE is where the file vibe gets picked ๐จ here's the flow:
- If no
<type code>argument is provided, set the<Contents Type>parameter equal to"FTAM-1"๐ - If an argument is provided and it's equal to
"ASCII", set the<Contents Type>parameter to"FTAM-1"๐ - If an argument is provided and it's equal to
"Image", set the<Contents Type>parameter to"FTAM-3"๐ผ๏ธ - Translate the FTAM Responder's
<Action Result>and<Diagnostic>parameters into the matching FTP reply code(s), then send those reply code(s) to the FTP Client ๐ - Take the FTP Client's reply codes, translate them into the matching FTAM
<Action Result>and<Diagnostic>parameters, and send those parameters to the FTAM Responder ๐ฅ
Note:
- a. Default to ASCII if no
<type code>argument is provided ๐ท
8.1.33. USER ๐
USER is the main character intro, and it's giving "who's the destination?" energy ๐ here's how it figures that out:
- Set the
<Initiator Identity>parameter for issuing F-INITIALIZE to the FTAM Responder ๐ชช - If the destination address was specified in the Domain Name used to attach to the gateway, use it to set the value of the
<Called Presentation Address>parameter of the to-be-issued F-INITIALIZE command ๐บ๏ธ - If the destination address is not known, check if it was specified in a previously issued SITE command. If available, set the
<Called Presentation Address>parameter for issuing F-INITIALIZE to the FTAM Responder ๐งญ - If the destination address is still not available, check if it is encoded in the user identity (e.g., user@host). If encoded, set the
<Called Presentation Address>parameter for issuing F-INITIALIZE to the FTAM Responder using the "host" portion ๐ - If no destination address is available, skip ahead to step 7 ๐คทโโ๏ธ
- Prompt the user for a password ๐
- Translate the FTAM Responder's
<Action Result>and<Diagnostic>parameters into the matching FTP reply code(s), then send those reply code(s) to the FTP Client ๐ - Take the FTP Client's reply codes, translate them into the matching FTAM
<Action Result>and<Diagnostic>parameters, and send those parameters to the FTAM Responder ๐ฅ
Note:
- a. A USER command should be acceptable in any state ๐
- b. There are multiple mechanisms for specifying the destination address: 1) the Domain Name used in connecting to the gateway (see section 4, Use of Gateway Services); 2) the SITE command argument; and 3) the user@host format ๐
8.2. FTAM-Initiated Gateway Service โจ
okay bestie so the mapping between FTP and FTAM can be one-to-zero (aka literally not mappable ๐), one-to-one, or one-to-many ๐ซถ
the general steps the FTP-FTAM gateway takes to pull off the FTAM-Initiated service go like this:
- Accept an FTAM Initiator request at the FTAM Responder side of the gateway.
- Map the request to the (set of) corresponding FTP Client function(s).
- Acting as an FTP Client, send the FTP Client function(s) to the FTP Server.
- Accept information returned to the FTP Client side of the gateway. This information originated at the FTP Server.
- Map this returned information to a form understood by the FTAM Responder side of the gateway.
- Send this returned information from the FTAM Responder side of the gateway to the FTAM Initiator.
for each FTAM protocol function, here's the list of FTP protocol functions you need to map it ๐
FTAM FTP
-----------------------------------------------------------------
F-BEGIN-GROUP none
F-CANCEL ABOR
F-CHANGE-ATTRIBUTE RNFR, RNTO
F-CHECK none
F-CLOSE none
F-CREATE STOR
F-DATA ALLO, STOR or RETR or APPE
F-DATA-END none
F-DELETE DELE
F-DESELECT none
F-END-GROUP STAT
F-ERASE DELE
F-INITIALIZE ACCT, PASS, USER
F-LOCATE none
F-OPEN MODE, STRU, TYPE
F-READ MODE, NLST, RETR, TYPE
F-READ-ATTRIBUTE LIST
F-RECOVER REST
F-RESTART ABOR, REST
F-SELECT LIST
F-TERMINATE QUIT
F-TRANSFER none
F-P-ABORT QUIT
F-U-ABORT QUIT
F-WRITE APPE or STOR, NOOP
the rest of this section is the detailed mapping procedures for each FTAM protocol function ๐ง where it helps, each FTAM service primitive is followed by the parameters that matter for the mapping. gateway support for these mappings is required ๐
8.2.1. F-BEGIN-GROUP REQ
- Send F-BEGIN-GROUP RESP PDU to FTAM Initiator signifying that processes are available to handle concatenated requests.
8.2.2. F-CANCEL REQ
- Close FTP data connection.
- Send ABOR to FTP Server.
- Translate FTP Server reply code to equivalent FTAM Responder action and diagnostic parameters and send parameters to FTAM Initiator via F-CANCEL RESP PDU.
- Translate FTAM Initiator action and diagnostic parameters to equivalent FTP reply codes and send reply codes to FTP Server.
Note:
- a. F-U-ABORT REQ is a viable alternative to F-CANCEL REQ.
- b. Note that since ABOR is not implemented by all FTP Servers, the remote file may be corrupted, though accessible.
8.2.3. F-CHANGE-ATTRIBUTE REQ
- Get original filename from
<Filename>parameter and send it with an RNFR to the FTP Server. - Get new filename from
<Filename>parameter and send it with an RNTO to the FTP Server. - Translate FTP Server reply code to equivalent FTAM Responder action and diagnostic parameters and send parameters to FTAM Initiator via F-CHANGE-ATTRIBUTE RESP PDU.
- Translate FTAM Initiator action and diagnostic parameters to equivalent FTP reply codes and send reply codes to FTP Server.
Note:
- a. Allow for processing an arbitrary number attributes at one time.
- b. Allow for responses of "Attribute currently unavailable for change" and "Attribute not currently supported".
- c. At a minimum, support the
<Filename>,<Permitted Actions>, and<Contents Type>parameters.
8.2.4. F-CHECK REQ
- Send an F-CHECK RESP PDU to the FTAM Initiator.
8.2.5. F-CLOSE REQ
- Send F-CLOSE RESP PDU , with
<Action Result>parameter value of "Success", to FTAM Initiator.
Note:
- a. If an error had occurred during transfer, it would have been noted before the F-CLOSE REQ.
8.2.6. F-CREATE REQ
- Send STOR and zero data bytes to FTP Server.
- Translate FTP Server reply code to equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters and send parameters to FTAM Initiator. - Translate FTAM Initiator
<Action Result>and<Diagnostic>parameters to equivalent FTP reply codes and send reply codes to FTP Server.
8.2.7. F-DATA PDU
- If necessary, send ALLO command to FTP Server.
- Depending on whether reading or writing, send STOR, RETR, or APPE command to FTP Server.
- Translate FTP Server reply code to equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters and send parameters to FTAM Initiator. - Translate FTAM Initiator
<Action Result>and<Diagnostic>parameters to equivalent FTP reply codes and send reply codes to FTP Server.
Note:
- a. The use of an FTP command may be unnecessary. Sending the data on the data connection may be adequate.
8.2.8. F-DATA-END REQ
- Close the data connection.
- Save mandatory Diagnostic parameter for later use.
- Translate FTP Server reply code to equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters and send parameters to FTAM Initiator. - Translate FTAM Initiator
<Action Result>and<Diagnostic>parameters to equivalent FTP reply codes and send reply codes to FTP Server.
8.2.9. F-DELETE REQ
- Send DELE to FTP server.
- Translate FTP Server reply code to equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters and send parameters to FTAM Initiator via F-DELETE RESP PDU. - Translate FTAM Initiator
<Action Result>and<Diagnostic>parameters to equivalent FTP reply codes and send reply codes to FTP Server.
8.2.10. F-DESELECT REQ
- Return F-DESELECT RESP PDU, with
<Action Result>parameter value of "Success", to FTAM Initiator.
8.2.11. F-END-GROUP REQ
- Send STAT command sequence to FTP Server.
- Translate FTP Server reply code to equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters and send parameters to FTAM Initiator via F-END GROUP RESP. - Translate FTAM Initiator
<Action Result>and<Diagnostic>parameters to equivalent FTP reply codes and send reply codes to FTP Server.
8.2.12. F-ERASE REQ
- Send DELE to FTP Server.
- Translate FTP Server reply code to equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters and send parameters to FTAM Initiator via F-ERASE RESP PDU. - Translate FTAM Initiator
<Action Result>and<Diagnostic>parameters to equivalent FTP reply codes and send reply codes to FTP Server.
8.2.13. F-INITIALIZE REQ
- Establish initial area for activity attributes.
- Save
<Responding Presentation Address>,<Initiator Identity>, and<Filestore Password>parameter values received from FTAM Initiator. - If the destination address was specified in the Distinguished Name (or User Friendly Name) used to attach to the gateway, save it as the ultimate destination address.
- If the ultimate destination address is not yet known, look at the "@host" portion of the
<Initiator Identity>parameter for the ultimate destination parameter. - If the ultimate destination address is still not known, check if it is available in the
<Responding Presentation Address>parameter. - Get userid from
<Initiator Identity>and send it with USER command to FTP Server. - Get password from
<Filestore Password>and send it with PASS command to FTP Server. - If necessary, send ACCT command to FTP Server.
- Negotiate acceptance of mandatory functional units, service classes, service types, presentation contexts, and attribute groups.
- Accept context management functional unit passed by Presentation service provider.
- Translate FTP Server reply code to equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters and send parameters to FTAM Initiator via F-INIT RESP PDU. - Translate FTAM Initiator
<Action Result>and<Diagnostic>parameters to equivalent FTP reply codes and send reply codes to FTP Server.
Note:
- a. Multiple mechanisms are available for specifying the destination address: 1) Distinguished Name, or User Friendly Name, used in connecting to the gateway (see section 4, Use of Gateway Services); 2)
user@hostformat; and 3) Inclusion as<Responding Presentation Address>parameter value.
8.2.14. F-LOCATE REQ
Note:
- a. Not supported since FTAM-1 and FTAM-3 don't support this primitive.
8.2.15. F-OPEN REQ
- Get
<Contents Type>and<Processing Mode>parameter values from FTAM Initiator. - Send TYPE command to FTP Server.
- Send MODE command to FTP Server.
- Send STRU command to FTP Server.
- Translate FTP Server reply code to equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters and send parameters to FTAM Initiator via F-OPEN RESP PDU. - Translate FTAM Initiator
<Action Result>and<Diagnostic>parameters to equivalent FTP reply codes and send reply codes to FTP Server.
Note:
- a. Establishes definite value for presentation context name parameter for this data transfer.
- b. Assumes that the
<Requested Access>parameter is permitted.
8.2.16. F-READ REQ
- If requested file type and file mode are different than current settings, send TYPE and MODE to FTP Server.
- If
<Contents Type>is FTAM-1 or FTAM-3, then send RETR to FTP Server. - If
<Contents Type>is "NBS-9", then send NLST to FTP Server. - If reply code from FTP Server is 1xx, open FTP data connection and loop until End-of-File is read on FTP data connection. Inside loop, read block from FTP data connection, format FTAM DATA PDU, and send FTAM PDU to FTAM Initiator. At End-of-File on FTP data connection, send F-DATA-END and return.
- If reply code from FTP Server is not 1xx, send F-CANCEL REQ to FTAM Initiator.
- Translate FTP Server reply code to equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters and send parameters to FTAM Initiator via F-READ RESP PDU. - Translate FTAM Initiator
<Action Result>and<Diagnostic>parameters to equivalent FTP reply codes and send reply codes to FTP Server.
Note:
- a. To send NLST response, TYPE must be ASCII.
8.2.17. F-READ-ATTRIBUTE REQ โจ
- Send
LISTto the FTP Server ๐ - Take the returned info and turn it into the
<Filename>,<Contents Type>, and<Permitted Actions>parameter values, then send them back to the FTAM Initiator ๐ - Translate the FTP Server reply code into the equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters, then send them to the FTAM Initiator in anF-READ-ATTRIBUTE RESPPDU ๐ซถ - Translate the FTAM Initiator's
<Action Result>and<Diagnostic>parameters into equivalent FTP reply codes, then send those codes to the FTP Server ๐
8.2.18. F-RECOVER REQ ๐ฉน
- Send
RESTto the FTP Server ๐ - Translate the FTP Server reply code into the equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters, then send them to the FTAM Initiator ๐ - Translate the FTAM Initiator's
<Action Result>and<Diagnostic>parameters into equivalent FTP reply codes, then send those codes to the FTP Server โจ
Note:
- a. Regime recovery only works if the
<Recovery Functional Unit>parameter was negotiated earlier by an F-INITIALIZE. ๐
8.2.19. F-RESTART REQ ๐
- To interrupt any bulk data transfer that's in progress, send
ABORto the FTP Server ๐ - To negotiate the point where the transfer picks back up, grab the
<Checkpoint Identifier>parameter from the FTAM Initiator and send it withRESTto the FTP Server ๐ - Translate the FTP Server reply code into the equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters, then send them to the FTAM Initiator in anF-RESTART RESPPDU ๐ - Translate the FTAM Initiator's
<Action Result>and<Diagnostic>parameters into equivalent FTP reply codes, then send those codes to the FTP Server ๐ซถ
8.2.20. F-SELECT REQ ๐ฏ
- Take the
<Filename>parameter and send it with theLISTcommand to the FTP Server to check whether the file exists ๐ - If the file exists, compare its POSIX file access rights with the
<Requested Access>parameter the FTAM Initiator sent. If the access rights match, return an<Action Result>parameter value of "Success". Otherwise, return an<Action Result>parameter value of "Failure" ๐ โโ๏ธ - Translate the FTP Server reply code into the equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters, then send them to the FTAM Initiator in anF-SELECT RESPPDU ๐ - Translate the FTAM Initiator's
<Action Result>and<Diagnostic>parameters into equivalent FTP reply codes, then send those codes to the FTP Server โจ
Note:
- a. The file is a binary/text file if one record comes back, or a directory file if multiple records come back ๐
8.2.21. F-TERMINATE REQ ๐
- Send
QUITto the FTP Server ๐ช - Translate the FTP Server reply code into the equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters, then send them to the FTAM Initiator in anF-TERMINATE RESPPDU ๐ธ - Translate the FTAM Initiator's
<Action Result>and<Diagnostic>parameters into equivalent FTP reply codes, then send those codes to the FTP Server ๐
8.2.22. F-TRANSFER-END ๐
- Take the
<Action Result>parameter value from the last F-DATA-END and return it to the FTAM Initiator as the<Action Result>parameter of this F-TRANSFER-END ๐ฆ
8.2.23. F-P-ABORT REQ ๐
- Send
QUITto the FTP Server ๐ช - Return an
<Action Result>parameter value of "Permanent Error" to the FTAM Initiator ๐ญ - Translate the FTP Server reply code into the equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters, then send them to the FTAM Initiator ๐ซถ - Translate the FTAM Initiator's
<Action Result>and<Diagnostic>parameters into equivalent FTP reply codes, then send those codes to the FTP Server ๐
8.2.24. F-U-ABORT REQ ๐
- Send
QUITto the FTP Server ๐ช - Return an
<Action Result>parameter value of "Permanent Error" to the FTAM Initiator ๐ญ - Translate the FTP Server reply code into the equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters, then send them to the FTAM Initiator ๐ซถ - Translate the FTAM Initiator's
<Action Result>and<Diagnostic>parameters into equivalent FTP reply codes, then send those codes to the FTP Server ๐
8.3. F-WRITE REQ โ๏ธ
- Save the bulk transfer specification parameter from the PDU ๐พ
- Send
NOOPto the FTP Server to get status info ๐ - If the
<Bulk Data Transfer Specification, FADU Operation>parameter has a value of "File Extend", send anAPPEto the FTP Server. Otherwise, send aSTORto the FTP Server ๐ - If the reply code from the FTP Server is 200, accept the FTP data connection. Otherwise, send an
F-CANCEL REQto the FTAM Initiator ๐ - Translate the FTP Server reply code into the equivalent FTAM Responder
<Action Result>and<Diagnostic>parameters, then send them to the FTAM Initiator ๐ - Translate the FTAM Initiator's
<Action Result>and<Diagnostic>parameters into equivalent FTP reply codes, then send those codes to the FTP Server ๐
9. Mapping between FTP Reply Codes and FTAM Parameters ๐ฆ
The focus of the protocol function and representation mappings from the earlier sections is on non-error-encumbered processing, meaning the happy path. โจ Appropriate responses are designated in many cases, but it's intended that a more thorough use of responses will be built into gateway implementations. ๐ฅ
The point of this section is to give you a set of mappings between FTAM responses (<Action Result> and <Diagnostic>) and FTP responses (reply codes). ๐
The <Action Result> parameter of the FTAM File Service primitives sums up what's in the <Diagnostic> parameter. Its value is never less than the most severe diagnostic value. The valid values are "Success", "Transient Error", and "Permanent Error". The FTP response text should be supplied in the <Further Details> field of the <Diagnostics> sequence in the FTAM response and abort messages ๐
An FTAM <Action Result> of "Success" may come with a <Diagnostic> whose value is "Informative Error Type". These "Success" diagnostic messages are tied to error type 0 in the table below (and in [ISO8571-3]). Error type 1 means a transient error, and type 2 means a permanent error ๐ง
An FTP reply is a three-digit number followed by some text. Each digit of the code has its own special meaning. The first digit gives you roughly the same info as the FTAM <Action Result> parameter, i.e., positive, transient negative, or permanent negative ๐ธ
The FTP specification document [RFC959] explicitly says the list of reply codes should not be expanded beyond what's presented in [RFC959]. The mappings in this document stick to that rule ๐
9.1. FTP Reply Codes to FTAM Parameters ๐
This section gives you the set of mappings between FTP reply codes and their equivalent FTAM action and diagnostic parameters. Gateway support for these mappings is recommended, but not required. The abbreviations for FTAM action parameter values are:
trans = transient error
perman = permanent error
FTP Reply |FTAM Diagnostic
|
|
Code Text |Result Type Id
---------------------------------------------+------------------
110 Restart marker reply |success 0 0
120 Service ready in nnn minutes |success 0 0
125 Data connection open, transfer |
starting |success 0 0
150 File status okay; about to open |
data connection |success 0 0
200 Command okay |success 0 0
202 Command not implemented; |
superfluous |success 0 0
211 System status, or system help |
reply |success 0 0
212 Directory status |success 0 0
213 File status |success 0 0
214 Help message |success 0 0
215 NAME system type |success 0 0
220 Service ready for new user |success 0 0
221 Service closing control connection |success 0 0
225 Data connection; no transfer in |
progress |success 0 0
226 Closing data connection |success 0 0
227 Entering passive mode (h1,h2,..) |success 0 0
230 User logged in, proceed |success 0 0
250 Requested file action okay, |
completed |success 0 0
257 "PATHNAME" created |success 0 0
331 User name okay, need password |success 0 0
332 Need account for logon |success 0 0
350 Requested file action pending |
further information |success 0 0
421 Service not available, closing |
control connection |trans 1 1
425 Can't open data connection |trans 1 3
426 Connection closed, transfer |
aborted |trans 1 1014
450 Requested file action not taken, |
file unavailable (e.g., file busy) |trans 1 5041
451 Requested file action aborted, |
local error in processing |trans 1 5028
452 Requested action not taken, |
insufficient storage space |trans 1 9
500 Syntax error, command unrecognized |perman 2 5015
501 Syntax error in parameters or |
arguments |perman 2 4004
502 Command not implemented |perman 2 5016
503 Bad sequence of commands |perman 2 1015
504 Command not implemented for that |
parameter |perman 2 4003
530 Not logged in |perman 2 2020
532 Need account for storing files |perman 2 2008
550 Requested action not taken; file |
unavailable (e.g., file not found, |
no access) |perman 2 3013
551 Requested action aborted, page |
type |perman 2 5002
552 Requested file action aborted, |
exceeded storage allocation |perman 2 9
553 Requested file action not taken, |
file name not allowed |perman 2 3024
9.2. FTAM Parameters to FTP Reply Codes ๐
okay so this part is literally the whole cheat sheet ๐๐ It's the big FTAM-to-FTP translation table, and it's giving organised chaos โจ
Gateway support for these mappings is recommended, but not required ๐ Remember the diagnostic type column from earlier: type 0 is the informative one, which can show up alongside a "Success" action result ๐ธ Type 1 is the transient error type ๐ and type 2 is the permanent one ๐ So when you're scanning the table, the type decides which FTP reply code you land on, and the same reason can map to different codes depending on the type ๐
FTAM Diagnostic |FTP Reply Code
|
Type Id Reason |
--------------------------------------------------+--------
|
1,2 0 No reason | 421
0 1 Responder error | 211
1,2 1 Responder error | 421
1,2 2 System shutdown | 421
0 3 FTAM mgmt problem, unspecific | 211
1,2 3 FTAM mgmt problem, unspecific | 425
0 4 FTAM mgmt, bad account | 221
2 4 FTAM mgmt, bad account | 532
0 5 FTAM mgmt, security not passed | 211
2 5 FTAM mgmt, security not passed | 530
0 6 Delay may be encountered | 211
0 7 Initiator error, unspecific | 211
1,2 7 Initiator error, unspecific | 421
0 8 Subsequent error | 211
1,2 8 Subsequent error | 421
0 9 Temporal insufficiency of resources| 211
1,2 9 Temporal insufficiency of resources| 452
1,2 10 Access req. violates VFS security | 550
1,2 11 Access req. violates local security| 550
2 1000 Conflicting parameter values | 504
2 1001 Unsupported parameter values | 504
2 1002 Mandatory parameter not set | 504
2 1003 Unsupported parameter | 504
2 1004 Duplicated parameter | 504
2 1005 Illegal parameter type | 504
2 1006 Unsupported parameter types | 504
2 1007 FTAM protocol err., unspecific | 426
2 1008 FTAM protocol err., procedure err | 426
2 1009 FTAM protocol err., funct. unit err| 426
2 1010 FTAM protocol err., corruption err.| 426
2 1011 Lower layer failure | 426
1,2 1012 Lower layer addressing error | 426
1,2 1013 Timeout | 426
1,2 1014 System shutdown | 426
2 1015 Illegal grouping sequence | 503
2 1016 Grouping threshold violation | 503
2 1017 Inconsistent PDU request | 503
2 2000 Association with user not allowed | 532
2 2002 Unsupported service class | 504
0 2003 Unsupported functional unit | 211
2 2003 Unsupported functional unit | 502
0 2004 Attribute group error, unspecific | 211
1,2 2004 Attribute group error, unspecific | 504
2 2005 Attribute group not supported | 504
0 2006 Attribute group not allowed | 211
2 2006 Attribute group not allowed | 504
0 2007 Bad account | 211
2 2007 Bad account | 532
0 2008 Association management, unspecific | 211
1,2 2008 Association management, unspecific | 532
2 2009 Association management, bad address| 532
1,2 2010 Association management, bad account| 532
0 2011 Checkpoint window error, too large | 211
2 2011 Checkpoint window error, too large | 426
0 2012 Checkpoint window error, too small | 211
2 2012 Checkpoint window error, too small | 426
0 2013 Checkpoint window error, unsupp. | 211
2 2013 Checkpoint window error, unsupp. | 504
0 2014 Communications QoS not supported | 211
1,2 2014 Communications QoS not supported | 504
2 2015 Initiator identity unacceptable | 532
0 2016 Context management refused | 211
0 2017 Rollback not available | 211
0 2018 Contents type list cut by |
responder | 211
0 2019 Contents type list by |
Presentation Service | 211
2 2020 Invalid filestore password | 530
2 2021 Incompatible service classes | 530
1,2 3000 Filename not found | 550
1,2 3001 Selection attributes not matched | 550
2 3002 Initial attributes not possible | 550
2 3003 Bad attribute name | 550
1,2 3004 Non-existent file | 550
1,2 3005 File already exists | 553
1,2 3006 File cannot be created | 553
1,2 3007 File cannot be deleted | 553
0 3008 Concurrency control not available | 211
2 3008 Concurrency control not available | 503
0 3009 Concurrency control not supported | 211
2 3009 Concurrency control not supported | 502
0 3010 Concurrency control not possible | 211
2 3010 Concurrency control not possible | 503
0 3011 More restrictive lock | 211
1 3011 More restrictive lock | 450
1,2 3012 File busy | 450
1,2 3013 File not available | 450
0 3014 Access control not available | 211
1,2 3014 Access control not available | 503
0 3015 Access control not supported | 211
1,2 3015 Access control not supported | 502
0 3016 Access control inconsistent | 211
1,2 3016 Access control inconsistent | 503
0 3017 Filename truncated | 211
0 3018 Initial attributes altered | 211
1,2 3019 Bad account | 532
0 3020 Override selected existing file | 211
0 3021 Override deleted and recreated | 211
0 3022 Create override deleted and |
recreate file with new attributes | 211
1,2 3023 Create override, not possible | 553
1,2 3024 Ambiguous file specification | 553
2 3025 Invalid create password | 550
2 3026 Invalid delete password on override| 550
2 3027 Bad attribute value | 550
2 3028 Requested access violation | 550
2 3029 Functional unit not available for | 550
requested access |
0 3030 File created but not selected | 211
1 3030 Invalid create password | 550
0 4000 Attribute non-existent | 211
1,2 4000 Attribute non-existent | 501
1,2 4001 Attribute cannot be read | 504
1,2 4002 Attribute cannot be changed | 504
1,2 4003 Attribute not supported | 504
2 4004 Bad attribute name | 501
2 4005 Bad attribute value | 501
0 4006 Attribute partially supported | 211
0 4007 Additional set attribute value |
not distinct | 211
1,2 5000 Bad FADU, unspecific | 550
2 5001 Bad FADU, size error | 501
2 5002 Bad FADU, type error | 551
2 5003 Bad FADU, poorly specified | 501
2 5004 Bad FADU, bad location | 550
0 5005 FADU does not exist | 550
1 5005 FADU does not exist | 550
0 5006 FADU not available, unspecific | 550
1,2 5006 FADU not available, unspecific | 550
1,2 5007 FADU not available for reading | 550
1,2 5008 FADU not available for writing | 550
1,2 5009 FADU not available for location | 550
1,2 5010 FADU not available for erasure | 550
1,2 5011 FADU cannot be inserted | 550
1,2 5012 FADU cannot be replaced | 550
0 5013 FADU cannot be located | 550
1,2 5013 FADU cannot be located | 550
2 5014 Bad data element type | 550
1,2 5015 Operation not available | 500
1,2 5016 Operation not supported | 502
0 5017 Operation inconsistent | 211
2 5017 Operation inconsistent | 503
0 5018 Concurrency control not available | 211
1,2 5018 Concurrency control not available | 503
0 5019 Concurrency control not supported | 211
2 5019 Concurrency control not supported | 502
0 5020 Concurrency control inconsistent | 211
2 5020 Concurrency control inconsistent | 503
0 5021 Processing mode not available | 211
1,2 5021 Processing mode not available | 503
0 5022 Processing mode not supported | 211
2 5022 Processing mode not supported | 504
0 5023 Processing mode inconsistent | 211
2 5023 Processing mode inconsistent | 503
0 5024 Access context not available | 211
2 5024 Access context not available | 503
0 5025 Access context not supported | 211
2 5025 Access context not supported | 504
1,2 5026 Bad write, unspecific | 550
1,2 5027 Bad read, unspecific | 550
0 5028 Local failure, unspecific | 211
1,2 5028 Local failure, unspecific | 451
0 5029 Local failure, filespace exhausted | 211
1,2 5029 Local failure, filespace exhausted | 552
0 5030 Local failure, data corrupted | 211
1,2 5030 Local failure, data corrupted | 451
0 5031 Local failure, data corrupted | 211
1,2 5031 Local failure, data corrupted | 451
2 5032 Future file size exceeded | 451
0 5034 Future file size increased | 211
0 5035 Functional unit invalid in |
processing mode | 211
2 5035 Functional unit invalid in |
processing mode | 503
0 5036 Contents type inconsistent | 211
2 5036 Contents type inconsistent | 503
0 5037 Contents type simplified | 211
0 5038 Duplicate FADU name | 211
1,2 5039 Damage to select/open regime | 553
1,2 5040 FADU locking not available on file | 450
1,2 5041 FADU locked by another user | 450
Okay so the table above is the last bit of the FTP-to-FTAM reply code mapping, and it's giving "every row has to be exact" ๐ญ๐ The columns are the FTAM parameter, the FTAM diagnostic code, the description, and then the FTP reply code, bestie. Don't fudge a single number here ๐
9.3. Future Mapping Problem ๐ฎ
Okay so this is the "what if" section, and I'm lowkey obsessed with it. Right now the FTAM <Responding Presentation Address> parameter is used for passing the final destination address in the FTAM-Initiated gateway service [NIST86]. But literally someday it might get used for something else ๐. If that happens, the destination address would have to move somewhere else, like the "@host" part of the <Initiator Identity>. For now, the FTP-FTAM gateway spec is chill and lets you store the ultimate destination address using either way ๐ โจ.
9.4. Error Handling ๐จ
Okay so this is the "when things go wrong" part, and it's giving responsible adult energy ๐ซถ. For FTAM-Initiated service errors, the bare minimum is mapping FTP failures to FTAM "Unrecoverable error" and sticking the FTP diagnostic string into the FTAM <Further Details> field. For FTP-Initiated service errors, the bare minimum is returning reply code 221, "Service closing control connection, Logged out if appropriate". That minimum is totally acceptable, ngl. But the recommended move for Gateway developers is to implement the mappings in Section 9.1, FTP Reply Codes to FTAM Parameters, and Section 9.2, FTAM Parameters to FTP Reply Codes ๐๐.
10. Implementation and Configuration Guidelines ๐ง
Okay so the intent here is to nail down the required characteristics and functions of an FTP-FTAM gateway. HOWEVER, the specific way you actually build one is totally up to the implementor ๐ ๏ธ. We do take the liberty of suggesting some ideas about configuring and implementing these gateways, though ๐.
10.1. Robustness ๐ช
The gateway should be robust enough to handle situations where only a subset of the FTP and/or FTAM protocols is implemented on a host.
The gateway should support multiple concurrent FTP and FTAM connections.
These are requirements for gateway implementations. ๐ซถ
10.2. Well-Known TCP/IP Port ๐
It is recommended that the FTP-Initiated gateway process listen on TCP/IP port 21, the well-known port for FTP listener processes ๐ฅ. Since the gateway computer is primarily meant for gateway services, using this port means gateway users won't have to specify the port when they connect ๐. The standard FTP server listener can then be moved to another port that's known to those users (e.g., System Administrators) who need FTP-to-FTP access to the gateway computer ๐.
10.3. Gateway Listener Processes ๐ฆ
To keep the admin overhead on the gateway computer simple, it is recommended that the FTP-Initiated service and FTAM-Initiated gateway listener processes get merged into a single executable module ๐งโโ๏ธ. This single daemon will act as the one and only gateway listener process. As connections get established with hosts, other processes would be created ๐ .
10.4. Implementation Testing ๐งช
To help with developing and evaluating FTP-FTAM gateway prototypes, NIST has developed a test system to evaluate a gateway's conformance to the protocol standards [NIST88] ๐ธ.
10.5. POSIX File Naming and Organization ๐๏ธ
The OSI profiles do not define a standard way for an FTAM Responder to return file names ๐คทโโ๏ธ.
To avoid unnecessary complexity, proprietary file systems are not addressed in these mappings. Gateway support for POSIX file naming and organization conventions is required; i.e., files are assumed to be organized in a hierarchical structure in which all of the non-terminal nodes are directories and all of the terminal nodes are any other type of file ๐โจ.
11. Security Considerations ๐
Okay bestie, this section is SERIOUS, so please read it carefully ๐จ๐.
The gateway system may place the burden of authentication on the destination system. However, the gateway MUST accommodate the passing through of all authentication parameters. The authentication parameters of each protocol are applied at the destination, and no additional parameters are needed for authentication at the gateway. As such, no gateway password file is required to support gateway functions ๐.
It is anticipated that the requirement for a strong authentication mechanism will soon replace the most currently used userid and password mechanism. The U.S. National Security Agency (NSA) has already prototyped and has plans to field a Message Secure Protocol (MSP) as part of the Defense Message System (DMS) Program, which will soon become the Department of Defense (DoD) mandatory messaging system ๐บ๐ธ. MSP utilizes a public key encryption-like mechanism which will be used to authenticate users and allow signed operations. The current philosophy is to use this same mechanism for all authentication and access control situations, such as logging onto remote hosts or gateways ๐. Detailed specifications for Pre-MSP, used in the unclassified though sensitive arena, are scheduled to be published in the first quarter of 1993. The requirement for gateways to process PMSP and MSP strong authentication mechanisms will be part of all future DoD procurements ๐๐.
12. References ๐
[ISO8571-1] Information processing systems - Open Systems Interconnection - File Transfer, Access and Management, Part 1: General Introduction, International Standards Organization for Standards, First Edition, October 1988.
[ISO8571-2] Information processing systems - Open Systems Interconnection - File Transfer, Access and Management, Part 2: Virtual Filestore Definition, International Standards Organization for Standards, First Edition, October 1988.
[ISO8571-3] Information processing systems - Open Systems Interconnection - File Transfer, Access and Management, Part 3: File Service Definition, International Standards Organization for Standards, First Edition, October 1988.
[ISO8571-4] Information processing systems - Open Systems Interconnection - File Transfer, Access and Management, Part 4: File Protocol Specification, International Standards Organization for Standards, First Edition, October 1988.
[ISO8571-5] Information processing systems - Open Systems Interconnection - File Transfer, Access and Management, Part 5: Protocol Implementation Conformance Statement, International Standards Organization for Standards, First Edition.
[KILLE92] Hardcastle-Kille, S., "Using the OSI Directory to achieve User Friendly Naming", OSI-DS 24 (v1.1), October 1992.
[MITRE87] Scott, J., "An FTP/FTAM Application Bridge, An FTAM/FTAM (MTR-87W00186)", The MITRE Corporation, July 1987.
[NETWRX90a] Mindel, J., "Gateway Technical Specification" Open Networks, Inc. (formerly NetWorks One), 28 February 1990.
[NETWRX90b] Mindel, J., "FTP Gateway User's Guide", Open Networks, Inc. (formerly NetWorks One), 28 February 1990.
[NIST86] Wallace, M, et. al., "A Gateway Architecture Between FTP and FTAM (ICST/SNA86-6)", National Institute of Standards and Technology, U.S. Department of Commerce, July 1986.
[NIST88] A Test System for Implementations of FTAM/FTP Gateways: Final Report Part 1, National Institute of Standards and Technology, U.S. Chamber of Commerce, October 1988.
[NIST91] CSL Bulletin: File Transfer, Access, and Management, National Institute of Standards and Technology, U.S. Chamber of Commerce, July 1991.
[NIST92] Stable Implementation Agreements for Open Systems Interconnection Protocols: Part 9 - FTAM Phase 2, Output from the March 1992 Open Systems Environment Implementors' Workshop (OIW), March 1992.
[RFC959] Postel, J., and J. Reynolds, "File Transfer Protocol (FTP), STD 9, RFC 959, USC/Information Sciences Institute, October 1985.
[RFC1101] Mockapetris, P., "DNS Encoding of Network Names and other Types", RFC 1101, USC/Information Sciences Institute, April 1989.
[RFC1279] Hardcastle-Kille, S., "X.500 and Domain", RFC 1279, University College London, November 1991.
[ROSE90] Rose, M., "The Open Book: A Practical Perspective on OSI", Prentice-Hall Inc., 1990.
13. Authors' Addresses ๐
Joshua L. Mindel Open Networks, Inc. 11490 Commerce Park Dr., Suite 205 Reston, Virginia 22091 USA
Phone: (703) 648-0013 Email: mindel@netwrx1.nw1.com
Robert L. Slaski Open Networks, Inc. 11490 Commerce Park Dr., Suite 205 Reston, Virginia 22091 USA
Phone: (703) 648-0013 Email: slaski@netwrx1.nw1.com
๐ฆ where this page comes from
- ietf: rfc1415 1993-01
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms