8. Protocol State Machine 8.1 ODETTE-FTP State Machine The operation of an ODETTE-FTP entity is formally defined by the State Machine presented below. There are five State and Transition tables and for each table additional information is given in the associated Predicate and Action lists. The response of an ODETTE-FTP entity to the receipt of an event is defined by a Transition table entry indexed by the Event/State intersection within the appropriate State table. Each Transition table entry defines the actions taken, events generated and new state entered. Predicates may be used within a table entry to select the correct response on the basis of local information held by the entity. A transition table contains the following fields: Index(I) State transition index. Predicate A list of predicates used to select between different possible transitions. The predicates are defined in the Predicate and Action list. Actions A list of actions taken by the entity. The actions are defined in the Predicate and Action list. Events Output events generated by the entity Next State The new state of the entity. 8.2 Error Handling The receipt of an event in a given state may be invalid for three reasons. 1. The case is impossible by construction of the state automata, denoted 'X' in the State tables. For example a timer which has not been set cannot run out. 2. The event is the result of an error in the Network Service implementation, also denoted 'X' in the state tables. The Network Service implementation is considered to be correct. 3. For all other cases the event is considered to be a User Error, denoted "U" in the state tables.
The State tables define the conditions under which a User event is valid, thus preventing the generation of a protocol error by the ODETTE-FTP entity as a result of a User Monitor error. The reaction of the entity to such errors is undefined and regarded as a local implementation issue. The State tables also allow protocol errors due to the receipt of invalid Exchange Buffers, to be detected. In such cases the reaction of the entity to the error is defined. 8.3 States The Command Mode is strictly a Half Duplex Flip-Flop Mode. A_NC_ONLY Responder, Network Connection opened The Responder has sent it's Ready Message (SSRM) and is waiting for Start Session (SSID) from the Initiator. A_WF_CONRS Responder Waiting for F_CONNECT_RS The Responder has received the Initiator's Start Session (SSID) and is waiting for a response (F_CONNECT_RS) from it's User Monitor. CDSTWFCD CD_RQ stored in WF_CD state Since the User Monitor doesn't see the WF_CD state it may send a Change Direction request (F_CD_RQ) before the ODETTE-FTP receives a Change Direction (CD) command. CLIP Close Input Pending The Listener has received an End File (EFID) command and is waiting for the Close File response (F_CLOSE_FILE_RS) from it's User Monitor. CLOP Close Out Pending The Speaker has sent an End File (EFID) command and is waiting for an End File Answer (EFPA or EFNA). ERSTWFCD End to End Response stored in WF_CD state Since the User Monitor doesn't see the WF_CD state it may send F_EERP_RQ, before the ODETTE-FTP receives a Change Direction (CD) command.
IDLE Connection IDLE IDLELI Idle Listener IDLELICD Idle Listener, F_CD_RQ Received The ODETTE-FTP entity has become the Listener after receiving a Change Direction request (F_CD_RQ) from the User Monitor. The receipt of an End Session (ESID) is valid in this state. IDLESP Idle Speaker IDLESPCD Idle Speaker, F_CD_IND Sent The ODETTE-FTP entity has sent a Change Direction indication (F_CD_IND) to the User Monitor. A Change Direction request (F_CD_RQ) is invalid in this state. I_WF_NC Initiator Waiting for Network Connection The Initiator has requested a new network connection and is waiting for a Connection confirmation (N_CON_CF) from the Network Service. I_WF_RM Initiator Waiting for Ready Message Before sending Start Session (SSID), the Initiator must wait for a Ready Message (SSRM) from the Responder. I_WF_SSID Initiator Waiting for SSID The Initiator has sent a Start Session (SSID) command and is waiting for Start Session from the Responder. OPI Open Input (Data Transfer Phase) The Listener is waiting for the Speaker to send a Data Exchange buffer. OPIP Open Input Pending The Listener has received a Start File (SFID) command and is waiting for the Start File response (F_START_FILE_RS) from it's User Monitor.
OPO Open Out (Data Transfer Phase) The Speaker has received a Start File Positive Answer (SFPA) and is waiting for a Data (F_DATA_RQ) or Close File (F_CLOSE_FILE) request from it's User Monitor. OPOP Open Out Pending The Speaker has sent a Start File (SFID) command and is waiting for a Start File Answer (SFPA or SFNA). OPOWFC Open Out Wait for Credit The Speaker is waiting for a Set Credit (CDT) command before sending further Data Exchange buffers. SFSTWFCD Start File Request stored in WF_CD state. Since the User Monitor doesn't see the WF_CD state it may send a Start File request (F_START_FILE_RQ) before the ODETTE-FTP receives a Change Direction (CD) command. WF_CD Wait for Change Direction The Listener wishes to become the Speaker and is waiting for a Change Direction (CD) command after sending an End File Positive Answer (EFPA) requesting change direction. WF_RTR Wait for Ready To Receive The Initiator has sent an End to End Response (EERP) command and must wait for Ready To Receive (RTR) from the Responder. WF_NDISC Wait for N_DISC_IND ODETTE-FTP has sent an End Session (ESID) command and is waiting for a Disconnection indication (N_DISC_IND) from the Network Service. 8.4 Input Events User Monitor Input Events (Section 3) F_DATA_RQ F_CONNECT_RQ F_START_FILE_RQ F_CLOSE_FILE_RQ F_EERP_RQ F_CONNECT_RS F_START_FILE_RS(+) F_CLOSE_FILE_RS(+) F_CD_RQ F_ABORT_RQ F_START_FILE_RS(-) F_CLOSE_FILE_RS(-) F_RELEASE_RQ
Network Input Events (Section 2.2) N_CON_IND N_CON_CF N_DATA_IND N_DISC_IND N_RST_IND Peer ODETTE-FTP Input Events (Section 4) SSID SFID SFPA SFNA EFID EFPA EFNA DATA ESID EERP RTR CD CDT SSRM Internal Input Events TIME-OUT - Internal ODETTE-FTP timer expires. Input event parameters are denoted I.Event-name.Parameter-name within the state table action and predicate lists. Their value can be examined but not changed by the ODETTE-FTP entity. 8.5 Output Events User Monitor Output Events (Section 3) F_DATA_IND F_CONNECT_IND F_START_FILE_IND F_CLOSE_FILE_IND F_EERP_IND F_CONNECT_CF F_START_FILE_CF(+) F_CLOSE_FILE_CF(+) F_CD_IND F_ABORT_IND F_START_FILE_CF(-) F_CLOSE_FILE_CF(-) F_RELEASE_IND Network Output Events (Section 2.2) N_CON_RQ N_CON_RS N_DATA_RQ N_DISC_RQ Peer ODETTE-FTP Output Events (Section 4) SSID SFID SFPA SFNA EFID EFPA EFNA DATA ESID EERP RTR CD CDT SSRM Output event parameters are denoted O.Event-name.Parameter-name within the state table action and predicate lists. Their values can be examined and changed by the ODETTE-FTP entity.
8.6 Local Variables The following variables are maintained by the ODETTE-FTP entity to assist the operation of the protocol. They are denoted V.Variable- name within the state table action and predicate lists. Their value can be examined and changed by the ODETTE-FTP entity. The initial value of each variable is undefined. Variable Type Comments --------------------------------------------------------------------- Buf-size Integer Negotiated Exchange Buffer size. Called-addr Address Used to build O.F_CONNECT_IND.Called-addr Calling-addr Address To build O.F_CONNECT_IND.Calling-addr Compression Yes/No Compression in used as agreed. Credit_L Integer Listeners credit counter. Credit_S Integer Speaker's credit counter. Id String Used to build O.SSID.Id Mode Sender-only, Receiver-only, Both. Pswd String Password, used to build O.SSID.Pswd Req-buf Primitive Input event (F_XXX_RQ) stored in WF_CD state. Restart Yes/No Restart in used as agreed. Restart-pos Integer Used only during file opening. Window Integer The Credit value negotiated for the session. --------------------------------------------------------------------- 8.7 Local Constants The following constants define the capabilities of a given ODETTE-FTP entity. They are denoted C.Constant-name within the state table action and predicate lists. Their value can be examined but not changed by the ODETTE-FTP entity. Constant Value Comments --------------------------------------------------------------------- Cap-compression Yes/No Compression supported? Cap-init Initiator Must be Initiator. Responder Must be Responder. Both Can be Initiator or Responder. Cap-mode Sender-only Must be sender. Receiver-only Must be receiver. Both Can be sender or receiver. Max-buf-size 127 < Int < 100000 Maximum buffer size supported. Max-window Int < 1000 Local maximum credit value. ---------------------------------------------------------------------
8.8 Session Connection State Table 8.8.1 State Table o----------------------------------------------o | | Other States | | |--------------------------------------o | | S | A_WF_CONRS | | | |----------------------------------o | | | T | A_NC_ONLY | | | | |------------------------------o | | | | A | I_WF_SSID | | | | | |--------------------------o | | | | | T | I_WF_RM | | | | | | |----------------------o | | | | | | E | I_WF_NC | | | | | | | |------------------o | | | | | | | | IDLE | | | | | | | |==================o---+---+---+---+---+---+---| | | F_CONNECT_RQ | A | X | X | X | X | X | X | | |--------------+---+---+---+---+---+---+---| | E | N_CON_CF | X | C | X | X | X | X | X | | |--------------+---+---+---+---+---+---+---| | V | SSRM | X | X | H | X | X | X | X | | |--------------+---+---+---+---+---+---+---| | E | SSID | X | X | X | D | E | F | F | | |--------------+---+---+---+---+---+---+---| | N | N_CON_IND | B | X | X | X | X | X | X | | |--------------+---+---+---+---+---+---+---| | T | F_CONNECT_RS | X | U | U | U | U | G | U | | |--------------+---+---+---+---+---+---+---| | | ESID(R=10) | X | X | X | F | X | X | X | o----------------------------------------------o
8.8.2 Transition Table I | Predicate Actions Output Events Next State ===o================================================================= A | P1: F_ABORT_IND IDLE | not P1: 1 N_CON_RQ I_WF_NC ---+----------------------------------------------------------------- B | P3: N_DISC_RQ IDLE | not P3: N_CON_RS | SSRM A_NC_ONLY ---+----------------------------------------------------------------- C | 2 I_WF_RM ---+----------------------------------------------------------------- D | P2: 4,2,5 F_CONNECT_CF IDLESP | not P2: 4,2 ESID(R=10) | F_ABORT_IND(R,AO=L) WF_NDISC ---+----------------------------------------------------------------- E | P4: 4 N_DISC_RQ IDLE | not P4: F_CONNECT_IND A_WF_CONRS ---+----------------------------------------------------------------- F | F_ABORT_IND | N_DISC_RQ IDLE ---+----------------------------------------------------------------- G | P2: 4,2,5 SSID IDLELI | not P2: 4,2 ESID(R=10) | F_ABORT_IND(R,AO=L) WF_NDISC ---+----------------------------------------------------------------- H | 4,2,3 SSID I_WF_SSID --------------------------------------------------------------------- 8.8.3 Predicates and Actions. Predicate P1: (No resources available) OR (C.Cap-init = Responder) OR (C.Cap-mode = Sender-only AND I.F_CONNECT_RQ.Mode = Receiver-only) OR (C.Cap-mode = Receiver-only AND I.F_CONNECT_RQ.Mode = Sender-only) Predicate P2: Negotiation of (Buf-size, Restart, Compression, Mode, Credit) is OK. Predicate P3: C.Cap-init = Initiator Predicate P4: Mode in SSID incompatible with C.Cap-mode
Action 1: Set V.Mode from (C.Cap-mode, I.F_CONNECT_RQ.Mode) Set V.Pswd, V.Id, V.Restart from I.F_CONNECT_RQ Set V.Buf-size = C.Max-buf-size Set V.Compression = C.Cap-compression Build O.N_CON_RQ Action 2: Start inactivity timer Action 3: Set parameters in O.SSID = from local variables Action 4: Stop timer Action 5: Set V.Mode, V.Restart, V.Compression, V.Buf-size, V.Window = from SSID 8.9 Error and Abort State Table 8.9.1 State Table o--------------------------------------o | | Other States | | S |------------------------------o | | T | WF_NDISC | | | A |--------------------------o | | | T | I_WF_NC | | | | E |----------------------o | | | | | IDLE | | | | |======================o---+---+---+---| | | TIME-OUT | X | X | A | B | | |------------------+---+---+---+---| | E | F_ABORT_RQ | X | A | X | C | | V |------------------+---+---+---+---| | E | N_RST_IND | X | X | A | D | | N |------------------+---+---+---+---| | T | N_DISC_IND | X | E | F | G | | |------------------+---+---+---+---| | | Invalid Buffer | X | X | H | I | o--------------------------------------o
8.9.2 Transition Table I | Predicate Actions Output Events Next State ===o================================================================= A | N_DISC_RQ IDLE ---+----------------------------------------------------------------- B | F_ABORT_IND | N_DISC_RQ IDLE ---+----------------------------------------------------------------- C | 1 N_DISC_RQ IDLE ---+----------------------------------------------------------------- D | 1 N_DISC_RQ | F_ABORT_IND IDLE ---+----------------------------------------------------------------- E | F_ABORT_IND IDLE ---+----------------------------------------------------------------- F | 1 IDLE ---+----------------------------------------------------------------- G | 1 F_ABORT_IND IDLE ---+----------------------------------------------------------------- H | WF_NDISC ---+----------------------------------------------------------------- I | 1,2 ESID(R=01) | F_ABORT_IND(R,AO=L) WF_NDISC --------------------------------------------------------------------- 8.9.3 Predicates and Actions. Action 1: Stop inactivity timer Action 2: Start inactivity timer 8.10 Speaker State Table 1 8.10.1 State Table The following abbreviations are used in the Speaker State table. F_REL_RQ(Ok) - F_RELEASE_RQ Reason = Normal F_REL_RQ(Err) - F_RELEASE_RQ Reason = Error
o------------------------------------------------------------------o | | Other State | | |----------------------------------------------------------o | | | WF_NDISC | | | |------------------------------------------------------o | | | | OPOWFC | | | | |--------------------------------------------------o | | | | | OPO | | | | | S |----------------------------------------------o | | | | | | OPOP | | | | | | T |------------------------------------------o | | | | | | | CDSTWFCD | | | | | | | A |--------------------------------------o | | | | | | | | SFSTWFCD | | | | | | | | T |----------------------------------o | | | | | | | | | ERSTWFCD | | | | | | | | | E |------------------------------o | | | | | | | | | | WF_CD | | | | | | | | | | |--------------------------o | | | | | | | | | | | WF_RTR | | | | | | | | | | | |----------------------o | | | | | | | | | | | | IDLESPCD | | | | | | | | | | | | |------------------o | | | | | | | | | | | | | IDLESP | | | | | | | | | | | | |===+==============o---+---+---+---+---+---+---+---+---+---+---+---| | | F_EERP_RQ | A | A | W | F | W | U | U | U | U | U | U | U | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | | F_START_ | B | B | W | G | W | U | U | U | U | U | X | U | | | FILE_RQ | | | | | | | | | | | | | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | | SFPA | C | C | C | C | C | C | C | K | C | C | S | C | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | E | SFNA | C | C | C | C | C | C | C | L | C | C | S | C | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | V | CD | C | C | C | H | R | I | J | C | C | C | S | C | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | E | F_DATA_RQ | U | U | U | U | U | U | U | U | M | V | S | U | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | N | CDT | C | C | C | C | C | C | C | C | P | O | S | C | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | T | F_CD_RQ | D | U | W | T | W | U | U | U | U | U | X | U | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | | F_REL_RQ(Ok) | U | E | U | U | U | U | U | U | U | U | X | U | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | | F_REL_RQ(Err)| Q | Q | Q | Q | Q | Q | Q | Q | Q | Q | S | Q | | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| | | RTR | C | C | N | C | C | C | C | C | C | C | S | C | o------------------------------------------------------------------o
8.10.2 Transition Table I | Predicate Actions Output Events Next State ===o================================================================= A | 1,2,3 EERP WF_RTR ---+----------------------------------------------------------------- B | P1: UE | not P1: 1,2,5 SFID OPOP ---+----------------------------------------------------------------- C | 1,2 ESID(R=02) | F_ABORT_IND(R,AO=L) WF_NDISC ---+----------------------------------------------------------------- D | 1,2 CD IDLELICD ---+----------------------------------------------------------------- E | 1,2 ESID(R=00) WF_NDISC ---+----------------------------------------------------------------- F | 4 ERSTWFCD ---+----------------------------------------------------------------- G | P1: UE | not P1: 6 SFSTWFCD ---+----------------------------------------------------------------- H | 1,2 IDLESP ---+----------------------------------------------------------------- I | 1,2,10 SFID OPOP ---+----------------------------------------------------------------- J | 1,2 CD IDLELICD ---+----------------------------------------------------------------- K | P2: 1,2 ESID(R=02) | F_ABORT_IND(R,AO=L) WF_NDISC | not P2: 1,2,7,12 F_START_FILE_CF(+) OPO ---+----------------------------------------------------------------- L | 1,2,8 F_START_FILE_CF(-) IDLESP ---+----------------------------------------------------------------- M | P3: 1,2,11,13 DATA OPOWFC | not P3: 1,2,11,13 DATA OPO ---+----------------------------------------------------------------- N | Note 3 IDLESP ---+----------------------------------------------------------------- O | 12 OPO | See Note 1 ---+----------------------------------------------------------------- P | Protocol 1,2 ESID(R=02) | Error F_ABORT_IND(R,AO=L) WF_NDISC ---+----------------------------------------------------------------- Q | 1,2 ESID(R) WF_NDISC ---+----------------------------------------------------------------- Continued -->
I | Predicate Actions Output Events Next State ===o================================================================= R | 1,2,9 EERP WF_RTR ---+----------------------------------------------------------------- S | WF_NDISC ---+----------------------------------------------------------------- T | CDSTWFCD ---+----------------------------------------------------------------- U | User Error UE ---+----------------------------------------------------------------- V | User Error - Note 1 UE ---+----------------------------------------------------------------- W | User Error - Note 2 UE ---+----------------------------------------------------------------- X | Error --------------------------------------------------------------------- 8.10.3 Predicates and Actions. Predicate P1: (I.F_START_FILE_RQ.Restart-pos > 0) AND ((V.Restart = No) OR (V.Mode = Receiver-only)) Note: Restart requested and not supported for this session. Predicate P2: (I.SFPA.Restart-pos > V.Restart-pos) Note: Protocol error due to the restart position in the SFPA acknowledgement being greater than the position requested in the SFID request. Predicate P3: V.Credit_S - 1 = 0 Note: Speaker's Credit is exhausted. Action 1: Stop inactivity timer Action 2: Start inactivity timer Action 3: Build an EERP from F_EERP_RQ Action 4: Store F_EERP_RQ in V.Req-buf Action 5: Build SFID from F_START_FILE_RQ V.Restart-pos = I.F_START_FILE_RQ.Restart-pos Action 6: Store F_START_FILE_RQ in V.Req-buf Action 7: Build F_START_FILE_CF(+) from I.SFPA
Action 8: Build F_START_FILE_CF(-) from I.SFNA Action 9: Build EERP from F_EERP_RQ stored in V.Req-buf Action 10: Build SFID from F_START_FILE_RQ stored in V.Req-buf Set V.Restart-pos Action 11: Build Exchange Buffer Action 12: V.Credit_S = V.Window Action 13: V.Credit_S = V.Credit_S - 1 Note 1: The OPOWFC state prevents the Speaker from sending data buffers because it is waiting for credit. The ODETTE-FTP entity may need to control the flow of Data requests (F_DATA_RQ) from it's User Monitor to protect it's own buffers. Any such mechanism and the behaviour of the entity should a User Error occur are regarded as local implementation issues. Note 2: The choice to accept this "Request/Event" while in this state is a matter of local implementation. The ODETTE state tables are based on the assumption that this event cannot occur in this state and is considered to be a user error (UE). Note 3: It is a local matter to make the User Monitor aware that since the RTR is received, the protocol machine is now ready to accept the next request. 8.11 Speaker State Table 2 8.11.1 State Table o---------------------------------o | S | CLOP | | T |-------------------------o | | A | OPOWFC | | | T |---------------------o | | | E | OPO | | | |=====================o---+---+---| | E | F_CLOSE_FILE_RQ | A | E | U | | V |-----------------+---+---+---| | E | EFPA | B | B | C | | N |-----------------+---+---+---| | T | EFNA | B | B | D | o---------------------------------o
8.11.2 Transition Table I | Predicate Actions Output Events Next State ===o================================================================= A | 1,2,5,7 EFID CLOP ---+----------------------------------------------------------------- B | 1,2 ESID(R=02) | F_ABORT_IND(R,AO=L) WF_NDISC ---+----------------------------------------------------------------- C | P1: 1,2,3 F_CLOSE_FILE_CF(+,SP=No) | CD IDLELI | not P1: 1,2,4 F_CLOSE_FILE_CF(+,SP=Yes) IDLESP ---+----------------------------------------------------------------- D | 1,2,6 F_CLOSE_FILE_CF(-) IDLESP ---+----------------------------------------------------------------- E | See Note 1 ---+----------------------------------------------------------------- U | User Error UE --------------------------------------------------------------------- 8.11.3 Predicates and Actions. Predicate P1: (I.EFPA.CD-Request = Yes) AND (V.Mode = Both) Action 1: Stop inactivity timer Action 2: Start inactivity timer Action 3: O.F_CLOSE_FILE_CF(+).Speaker = No Action 4: O.F_CLOSE_FILE_CF(+).Speaker = Yes Action 5: Build EFID from F_CLOSE_FILE_RQ Action 6: Build F_CLOSE_FILE_CF(-) from EFNA Action 7: Set V.Credit_S = 0 Note 1: In order to respect the "half duplex" property of ODETTE-FTP it is forbidden to send EFID while in the OPOWFC state. EFID can be sent only in the OPO state. The ODETTE-FTP implementation must avoid sending EFID (or receiving F_CLOSE_FILE_RQ) while in the OPOWFC state.
8.12 Listener State Table 8.12.1 State Table o-----------------------------------------o | | CLIP | | |---------------------------------o | | | OPI | | | S |-----------------------------o | | | T | OPIP | | | | A |-------------------------o | | | | T | IDLELICD | | | | | E |---------------------o | | | | | | IDLELI | | | | | |=====================o---+---+---+---+---| | | SFID | A | A | B | B | B | | |-----------------+---+---+---+---+---| | E | DATA | B | B | B | I | B | | V |-----------------+---+---+---+---+---| | E | EFID | B | B | B | J | B | | N |-----------------+---+---+---+---+---| | T | F_START_FILE_RS | U | U | H | U | U | | |-----------------+---+---+---+---+---| | | F_CLOSE_FILE_RS | U | U | U | U | K | | |-----------------+---+---+---+---+---| | | CD | C | B | B | B | B | | |-----------------+---+---+---+---+---| | | ESID R=Normal | D | F | D | D | D | | |-----------------+---+---+---+---+---| | | ESID R=Error | D | D | D | D | D | | |-----------------+---+---+---+---+---| | | EERP | E | G | B | B | B | o-----------------------------------------o
8.12.2 Transition Table I | Predicate Actions Output Events Next State ===o================================================================= A | P1: 1,2 ESID(R=02) | F_ABORT_IND(R,AO=L) WF_NDISC | not P1: 1,2,3 F_START_FILE_IND OPIP ---+----------------------------------------------------------------- B | 1,2 ESID(R=02) | F_ABORT_IND(R,AO=L) WF_NDISC ---+----------------------------------------------------------------- C | 1,2 F_CD_IND IDLESPCD ---+----------------------------------------------------------------- D | 1 F_ABORT_IND(Received | ESID Reason,AO=D) | N_DISC_RQ IDLE ---+----------------------------------------------------------------- E | 4 F_EERP_IND | 8 See Note 2 | RTR IDLELI ---+----------------------------------------------------------------- F | 1 F_RELEASE_IND | N_DISC_RQ IDLE ---+----------------------------------------------------------------- G | F_EERP_IND | 8 See Note 2 | RTR IDLELI ---+----------------------------------------------------------------- H | P4: User Error UE | P2,not P4: 1,2 SFPA OPI | not(P2,P4): 1,2 SFNA IDLELI ---+----------------------------------------------------------------- I | P5: 1,2 ESID(R=02) | F_ABORT_IND(R,A0=L) WF_NDISC | not(P5,P6): 1,2,5 F_DATA_IND OPI | not P5,P6: 1,2 F_DATA_IND | 6,7 See Note 1 | CDT OPI ---+----------------------------------------------------------------- J | 1,2 F_CLOSE_FILE_IND CLIP ---+----------------------------------------------------------------- K | P2,P3: 1,2 EFPA(CD-Req) WF_CD | P2,not P3: 1,2 EFPA(no CD) IDLELI | not P2: 1,2 EFNA IDLELI ---+----------------------------------------------------------------- U | User Error UE ---------------------------------------------------------------------
8.12.3 Predicates and Actions. Predicate P1: (I.SFID.Restart-pos > 0) AND (V.Restart = No) Note: Invalid Start File command Predicate P2: Positive Response Predicate P3: I.F_CLOSE_FILE_RS(+).Speaker = Yes Predicate P4: I.F_START_FILE_RS(+).Restart-pos > V.Restart Predicate P5: V.Credit_L - 1 < 0 Note: Protocol Error because the Speaker has exceeded it's available transmission credit. Predicate P6: V.Credit_L - 1 = 0 Note: The Speaker's credit must be reset before it can send further Data Exchange buffers. Action 1: Stop inactivity timer. Action 2: Start inactivity timer Action 3: Build F_START_FILE_IND from I.SFID V.Restart-pos = I.SFID.Restart-pos Action 4: Build F_EERP_IND from I.EERP Action 5: V.Credit_L = V.Credit_L - 1 Action 6: Wait for sufficient resources to receive up to V.Window Data Exchange Buffers. Action 7: V.Credit_L = V.Window Action 8: Wait for resources required to process a new EERP. Note 1: Flow control in case of reception. The ODETTE-FTP Listener must periodically send new credit to the Speaker. The timing of this operation will depend on: 1. The User Monitor's capacity the receive data. 2. The number of buffers available to ODETTE-FTP.
3. The Speaker's available credit, which must be equal to zero. Note 2: Generally, the ODETTE-FTP Listener will send RTR immediately after receiving EERP. If required, it can delay the RTR until the resources required to process a new EERP are available. 8.13 Example Consider an ODETTE-FTP entity that has sent a Start File (SFID) command and entered the Open Out Pending (OPOP) state. It's response on receiving a Positive Answer (SFPA) is documented in Speaker State Table 1 which shows that transition 'K' should be applied and is interpreted as follows: if (I.SFPA.Restart-pos > V.Restart-pos) then begin // invalid restart Actions: Stop inactivity timer, // reset timer Start inactivity timer; Output: ESID(R=02), // to peer ODETTE-FTP F_ABORT_IND(R,AO=L); // to user monitor New State: WF_NDISC; end else begin Actions: Stop inactivity timer, // reset timer Start inactivity timer; Build F_START_FILE_CF(+) from I.SFPA V.Credit_S = V.Window // initialise credit Output: F_START_FILE_CF(+); // to user monitor New State: OPO; end The ODETTE-FTP checks the restart position in the received Start File Positive Answer (SFPA) command. If it is invalid it aborts the session by sending an End Session (ESID) command to it's peer and an Abort indication (F_ABORT_IND) to it's User Monitor. If the restart position is valid a Start File confirmation (F_START_FILE_CF) is built and sent to the User Monitor, the credit window is initialised and the Open Out (OPO) state is entered. 9. Security Considerations ODETTE-FTP exchanges user identity and password information in clear text. It is therefore recommended that a lower layer (session, network or linkage) security protocol is used to protect the session from casual identity collection.
Appendix A. Virtual File Mapping Example This example demonstrates the mapping of a Virtual File into a sequence of ODETTE-FTP Data Exchange Buffers and shows how each Stream Transmission Buffer is built from an ODETTE-FTP Data Exchange Buffer prefixed by a Stream Transmission Header. Each line in this extract from 'The Hunting of the Snark' by Lewis Carroll [SNARK] is considered to be a separate record in a file containing variable length records. Note that it does not represent a text file and CR/LF record separators are not used. The blank line is represented by a zero length record. "It's a Snark!" was the sound that first came to their ears, And seemed almost too good to be true. Then followed a torrent of laughter and cheers: Then the ominous words "It's a Boo-" Then, silence. Some fancied they heard in the air A weary and wandering sigh Then sounded like "-jum!" but the others declare It was only a breeze that went by. Assuming that the minimum exchange buffer length of 128 octets has been negotiated the result of mapping the text into Stream Transmission Buffers may be as follows. Stream Transmission Buffer 1 Text : ....D."It' s a Snark! " was the sound that first cam Hex-H : 10084B2472 7262566762 2276727662 7676627667 2667772666 Hex-L : 00044C2947 30103E12B1 2071304850 3F5E404814 069234031D Key : ----D!.... .......... .......... .......... .......... Text : e to their ears,. .A nd seemed almost too good to b Hex-H : 6276276667 26677242A4 6627666662 6666772766 2666627626 Hex-L : 504F048592 05123C5061 E40355D540 1CDF3404FF 07FF404F02 Key : .......... ......!.!. .......... .......... .......... Text : e true..Th en followe d a torren t Hex-H : 6277762156 6626666676 6262767766 72 Hex-L : 504255E848 5E06FCCF75 40104F225E 40 Key : .......!.. .......... .......... .. Text : ....D.of l aughter an d cheers:. .Then the ominous w Hex-H : 1007496626 6766767266 6266667734 2A56662766 2666667727 Hex-L : 000847F60C 157845201E 40385523A5 04485E0485 0FD9EF5307 Key : ----D!.... .......... .........! .!........ ..........
Text : ords "It's a Boo-".. Then, sile nce. Some fancied t Hex-H : 6767224727 262466228B 5666227666 6662225666 2666666627 Hex-L : F243029473 0102FFD202 485EC039C5 E35E003FD5 061E395404 Key : .......... ........!! .......... .......... .......... Text : hey heard in the air Hex-H : 6672666762 6627662667 Hex-L : 8590851240 9E04850192 Key : .......... .......... Stream Transmission Buffer 3 Text : ....D. .A weary and wandering sigh.Then sounded li Hex-H : 1007442942 7667726662 7666676662 7666B56662 7676666266 Hex-L : 0008450A10 7512901E40 71E4529E70 39780485E0 3F5E4540C9 Key : ----D!.!.. .......... .......... ....!..... .......... Text : ke "-jum!" but the o thers decl are. .It w as only a Hex-H : 6622267622 2677276626 7667726666 67642A4727 6726667262 Hex-L : B502DA5D12 025404850F 485230453C 1255029407 130FEC9010 Key : .......... .......... .......... ...!.!.... .......... Text : breeze tha t went by. Hex-H : 6766762766 7276672672 Hex-L : 2255A50481 4075E4029E Key : .......... .......... Notes: Hex-H High order bits of octet Hex-L Low order bits of octet Key: ---- Stream Transmission Header D Data Exchange Buffer command code 'D' ! Subrecord header octet . Place holder All headers are represented with a period in the Text line. Each Data Exchange Buffer is preceded by a Stream Transmission Header. In the above mapping the first Data Exchange Buffer is 128 octets in length. The last record has been continued in the second buffer. The second Data Exchange Buffer has been truncated at 116 octets to finish at the end of a record. The following record being completely contained in the third buffer. This is an alternative to spanning the record as shown between the first and second Data Exchange Buffers.
The blank line has been encoded as a single header octet of '80' hex, indicating a zero length subrecord with the end of record flag set. The indented lines have been compressed.
Appendix B. ISO 646 Character Subset o-----------------------------------------------------------------o | | 7| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | | | B -+-----+-----+-----+-----+-----+-----+-----+-----| | | I 6| 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | | | T -+-----+-----+-----+-----+-----+-----+-----+-----| | | 5| 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | | |----+-----+-----+-----+-----+-----+-----+-----+-----| | | | | | | | | | | | | | | | | | | | | | | |------------| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | | BIT | | | | | | | | | | | 4 3 2 1 | | | | | | | | | | |============o====o=====+=====+=====+=====+=====+=====+=====+=====| | 0 0 0 0 | 0 | | | SP | 0 | | P | | | |------------|----|-----+-----+-----+-----+-----+-----+-----+-----| | 0 0 0 1 | 1 | | | | 1 | A | Q | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 0 0 1 0 | 2 | | | | 2 | B | R | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 0 0 1 1 | 3 | | | | 3 | C | S | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 0 1 0 0 | 4 | | | | 4 | D | T | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 0 1 0 1 | 5 | | | | 5 | E | U | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 0 1 1 0 | 6 | | | & | 6 | F | V | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 0 1 1 1 | 7 | | | | 7 | G | W | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 1 0 0 0 | 8 | | | ( | 8 | H | X | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 1 0 0 1 | 9 | | | ) | 9 | I | Y | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 1 0 1 0 | 10 | | | | | J | Z | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 1 0 1 1 | 11 | | | | | K | | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 1 1 0 0 | 12 | | | | | L | | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 1 1 0 1 | 13 | | | - | | M | | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 1 1 1 0 | 14 | | | . | | N | | | | |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| | 1 1 1 1 | 15 | | | / | | O | | | | o-----------------------------------------------------------------o
Acknowledgements This document draws extensively on revision 1.3 of the ODETTE File Transfer Specification [OFTP]. Numerous people have contributed to the development of this protocol and their work is hereby acknowledged. The extensions required to utilise the Transmission Control Protocol were formulated and agreed by the current members of ODETTE Working Group Four, who also provided helpful reviews and comments on this document. References [OFTP] Organisation for Data Exchange by Tele Transmission in Europe, Odette File Transfer Protocol, Revision 1.3:1993 [RFC-739] Postel, J., Transmission Control Protocol, STD 7, RFC 739, September 1981 [ISO-646] International Organisation for Standardisation, ISO Standard 646:1991, "Information technology -- ISO 7-bit coded character set for information interchange", 1991 [ISO-6523] International Organisation for Standardisation, ISO Standard 6523:1984, "Data interchange -- Structures for the identification of organisations", 1984 [ISO-8601] International Organisation for Standardisation, ISO Standard 8601:1988 "Data elements and interchange formats -- Information interchange -- Representation of dates and times", 1988 [NIFTP] High Level Protocol Group, "A Network Independent File Transfer Protocol", 1981 [SNARK] Carroll, Lewis "The Hunting of the Snark", 1876
ODETTE Address The ODETTE File Transfer Protocol is a product of Working Group Four of the Organisation for Data Exchange by Tele Transmission in Europe. The working group can be contacted via the ODETTE Secretariat: ODETTE Secretariat Forbes House Halkin Street London SW1X 7DS United Kingdom Phone: +44 (0)171 344 9227 Fax: +44 (0)171 235 7112 EMail odette@odette.org keith.oxley@odette.org stephanie.bioux@odette.org Author's Address The author can be contacted at David Nash Ford Motor Company Limited Room 1/148, Central Office Eagle Way Warley Brentwood Essex CM13 3BW United Kingdom Phone: +44 (0)1277 253043 EMail: dnash@ford.com