跳到主要内容

5. 网关状态变量与状态转换

如上所述, FTP-FTAM 网关提供两组服务: FTP 发起和 FTAM 发起. 每组服务都有各自互斥的一组状态变量和状态转换, 它们以确定性的方式定义网关的动作. 要求网关支持这些状态变量和状态转换.

为简化本节的讨论, FTP-Initiated 缩写为 "FTP-I", FTAM-Initiated 缩写为 "FTAM-I".

关于错误条件, 如果在网关处于 FTP-I:Initial-State 或 FTAMI:Initial-State 以外的任何状态时连接断开, 则网关将向仍保持连接的主机发出致命错误消息, 然后断开该连接. 如果仍保持连接的是 FTP Client, 则网关将发送 ABOR, QUIT 和 426 回复码 (Connection closed, transfer aborted). 如果仍保持连接的是 FTAM Initiator, 则网关将发送 F-P-ABORT, 其 值的标识符为 1011 (Lower layer failure), 并附带任何已知的 .

本节不讨论其他错误条件.

5.1. FTP 发起的网关服务​

FTP 发起的网关服务的状态变量集合如下:

  State Variable                State Definition
----------------------------------------------------------------

FTP-I:Initial-State FTP 发起的网关服务的初始状态.

                                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 网关已收到来自 FTP Client 的 PASS 命令. 网关正在把所提供的 FTAM Responder 地址解析为表示地址. 所提供的地址可以是可分辨名称, 用户友好名称或域名. 解析通常使用 X.500 目录服务完成.

FTP-I:Wait-for-Connection 网关已发起与 FTAM Responder 的连接, 正在等待登录是否成功的通知.

FTP-I:Wait-for-ClientCmd FTP Client 与 FTAM Responder 之间存在连接. 网关正在等待来自 FTP 的下一个命令或响应.

                                Client.  Commands and responses are
mapped as they are received.

FTP-I:Wait-for-RespondrCmd FTP Client 与 FTAM Responder 之间存在连接. 网关正在等待来自 FTAM Responder 的下一个命令或响应. 命令和响应在收到时即被映射.

第 5.1 节的其余部分给出每一种可能的状态转换. 对每种状态转换, 都列出了引起该转换的动作.

5.1.1. FTP-I:Initial-State --> FTP-I:Initial-State​

        1. 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​

        1. 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​

        1. Gateway receives PASS command from FTP Client.

5.1.4. FTP-I:Wait-for-PAddress --> FTP-I:Wait-for-Connection​

        1. Gateway resolves received Distinguished Name, User Friendly
Name, or Domain Name of FTAM Responder to OSI Presentation
address.
2. 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​

        1. Gateway receives <State Result> of "Success" .
2. Gateway sends 230 reply code (User Logged In) to FTP
Client.

5.1.6. FTP-I:Wait-for-ClientCmd --> FTP-I:Wait-for-RespondrCmd​

        1. 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​

        1. 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​

        1. Gateway receives QUIT command from FTP Client; maps QUIT as
per Section 8.1.

5.2. FTAM 发起的网关服务​

FTAM 发起的网关服务的状态变量集合如下:

  State Variable                State Definition
----------------------------------------------------------------

FTAM-I:Initial-State FTAM 发起的网关服务的初始状态.

                                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 网关已发起与 FTP Server 的连接, 正在等待登录是否成功的通知.

FTAM-I:Wait-for-InitiatrCmd FTAM Initiator 与 FTP Server 之间存在连接. 网关正在等待来自 FTAM Initiator 的下一个命令或响应. 命令和响应在收到时即被映射.

FTP-I:Wait-for-ServerCmd FTAM Initiator 与 FTP Server 之间存在连接. 网关正在等待来自 FTP Server 的下一个命令或响应. 命令和响应在收到时即被映射.

第 5.2 节的其余部分给出每一种可能的状态转换. 对每种状态转换, 都列出了引起该转换的动作.

5.2.1. FTAM-I:Initial-State --> FTAM-I:Wait-for-IPAddress​

        1. Gateway receives F-INITIALIZE from FTAM Initiator.  Domain
Name of 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 password is in <Filestore Password>
parameter.

5.2.2. FTAM-I:Wait-for-IPAddress --> FTAM-I:Wait-for-Connection​

        1. Gateway resolves received Domain Name, Distinguished Name,
or User Friendly Name of FTP Server to IP address.
2. Gateway sends USER to FTP Server.
3. Gateway sends PASS to FTP Server.

5.2.3. FTAM-I:Wait-for-Connection --> FTAM-I:Wait-for-NextMapping​

        1. Gateway receives 230 reply code (User Logged In) from FTP
Server.
2. Gateway sends <State Result> of "Success" to FTAM
Initiator.

5.2.4. FTAM-I:Wait-for-InitiatrCmd --> FTAM-I:Wait-for-ServerCmd​

        1. Gateway receives command or response from FTAM Initiator
and maps it to FTP protocol, as defined in section 8.2.

5.2.5. FTAM-I:Wait-for-ServerCmd --> FTAM-I:Wait-for-InitiatrCmd​

        1. Gateway receives command or response from FTP Server and
maps it to FTAM protocol, as defined in section 8.2.

5.2.6. FTAM-I:Wait-for-InitiatrCmd --> FTAM-I:Wait-for-INITIALIZE​

        1. Gateway receives F-CLOSE primitive from FTAM Initiator;
maps F-CLOSE as per Section 8.2.