idnits 2.17.1 draft-rfced-info-nash-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-25) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 75 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. == There are 9 instances of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The "Author's Address" (or "Authors' Addresses") section title is misspelled. == Line 3109 has weird spacing: '...was the sound...' == Line 3114 has weird spacing: '...o their ears,...' == Line 3126 has weird spacing: '...hen the omino...' == Line 3131 has weird spacing: '.... Some fanci...' == Line 3136 has weird spacing: '...y heard in th...' == (2 more instances...) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 1997) is 9781 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'TCP' is mentioned on line 307, but not defined == Missing Reference: 'Ba' is mentioned on line 1062, but not defined == Missing Reference: 'Ca' is mentioned on line 1081, but not defined == Missing Reference: 'Cb' is mentioned on line 1087, but not defined == Missing Reference: 'ISO 6523' is mentioned on line 2019, but not defined == Unused Reference: 'RFC-739' is defined on line 3248, but no explicit reference was found in the text == Unused Reference: 'ISO-6523' is defined on line 3255, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'OFTP' ** Obsolete normative reference: RFC 739 (Obsoleted by RFC 750) -- Possible downref: Non-RFC (?) normative reference: ref. 'ISO-646' -- Possible downref: Non-RFC (?) normative reference: ref. 'ISO-6523' -- Possible downref: Non-RFC (?) normative reference: ref. 'ISO-8601' -- Possible downref: Non-RFC (?) normative reference: ref. 'NIFTP' -- Possible downref: Non-RFC (?) normative reference: ref. 'SNARK' Summary: 9 errors (**), 0 flaws (~~), 17 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 INTERNET-DRAFT EXPIRES: JANUARY 1998 INTERNET-DRAFT 2 Network Working Group D. Nash 3 INTERNET-DRAFT ODETTE 4 July 1997 6 ODETTE File Transfer Protocol 7 9 Status of this Memo 11 Distribution of this memo is unlimited. 13 This document is an Internet-Draft. Internet-Drafts are working 14 documents of the Internet Engineering Task Force (IETF), its areas, 15 and its working groups. Note that other groups may also distribute 16 working documents as Internet-Drafts. 18 Internet-Drafts are draft documents valid for a maximum of six months 19 and may be updated, replaced, or obsoleted by other documents at any 20 time. It is inappropriate to use Internet- Drafts as reference 21 material or to cite them other than as ``work in progress.'' 23 To learn the current status of any Internet-Draft, please check the 24 ``1id-abstracts.txt'' listing contained in the Internet- Drafts Shadow 25 Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), 26 munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or 27 ftp.isi.edu (US West Coast). 29 This memo provides information for the Internet community. This memo 30 does not specify an Internet standard. Distribution of this memo is 31 unlimited. 33 Abstract 35 This memo describes a file transfer protocol to facilitate electronic 36 data interchange between trading partners. 38 The protocol, denoted the ODETTE File Transfer Protocol, supports 39 both direct communication between installations and indirect 40 communication via a third party clearing centre. It was developed by 41 the Organisation for Data Exchange by Tele Transmission in Europe to 42 facilitate communication within the European motor industry and is 43 presented here to allow for wider use within the Internet community. 45 Table of Contents 47 1. Introduction 48 1.1 - Background 49 1.2 - Relationship to the original ODETTE Standard 50 1.3 - General Principles 51 1.4 - Structure 52 1.5 - Virtual Files 53 1.6 - Service Description 55 2. Network Service (TCP Transport Service) 56 2.1 - Introduction 57 2.2 - Service Primitives 58 2.3 - Port Assignment 60 3. File Transfer Service 61 3.1 - Model 62 3.2 - Session Setup 63 3.3 - File Transfer 64 3.4 - Session Take Down 65 3.5 - Service State Automata 67 4. Protocol Specification 68 4.1 - Overview 69 4.2 - Start Session Phase 70 4.3 - Start File Phase 71 4.4 - Data Transfer Phase 72 4.5 - End File Phase 73 4.6 - End Session Phase 74 4.7 - Problem Handling 76 5. Commands and Formats 77 5.1 - Conventions 78 5.2 - Commands 79 5.3 - Command Formats 80 5.4 - Identification Code 82 6. ODETTE-FTP Data Exchange Buffer 83 6.1 - Overview 84 6.2 - Data Exchange Buffer Format 85 6.3 - Buffer Filling Rules 87 7. Stream Transmission Buffer (TCP only) 88 7.1 - Introduction 89 7.2 - Stream Transmission Header Format 91 8. Protocol State Machine 92 8.1 - ODETTE-FTP State Machine 93 8.2 - Error Handling 94 8.3 - States 95 8.4 - Input Events 96 8.5 - Output Events 97 8.6 - Local Variables 98 8.7 - Local Constants 99 8.8 - Session Connection State Table 100 8.9 - Error and Abort State Table 101 8.10 - Speaker State Table 1 102 8.11 - Speaker State Table 2 103 8.12 - Listener State Table 104 8.13 - Example 106 Appendix A Virtual File Mapping Example 107 Appendix B ISO 646 Character Subset 109 Acknowledgements 110 References 111 Security Considerations 112 ODETTE Address 113 Author's Address 115 1. Introduction 117 1.1 Background 119 The ODETTE File Transfer Protocol (ODETTE-FTP) was defined in 1986 by 120 working group four of the Organisation for Data Exchange by Tele 121 Transmission in Europe (ODETTE) to address the electronic data 122 interchange (EDI) requirements of the European automotive industry. 123 It was designed in the spirit of the Open System Interconnection 124 (OSI) model utilising the Network Service provided by the CCITT X25 125 recommendation. 127 Over the last ten years ODETTE-FTP has been widely deployed on 128 systems of all sizes from personal computers to large mainframes. As 129 a result of the wide scale deployment of internet technology and the 130 trend towards global business practices, ODETTE has decided to extend 131 the scope of it's file transfer protocol to allow the use of TCP/IP 132 and to make the protocol available to the Internet community. 134 This memo describes the ODETTE-FTP protocol using the Transmission 135 Control Protocol for it's network service. 137 1.2 Relationship to the original ODETTE Standard 139 This memo is an interpretation of version 1.3 of the ODETTE File 140 Transfer Protocol [OFTP]. In the event of any ambiguity between this 141 document and the original ODETTE-FTP, the original shall take 142 precedence. 144 For ODETTE-FTP on TCP/IP the following sections have been added with 145 respect to the original document. 147 Section 2 - Network Service 148 Section 7 - Stream Transmission Buffer 149 Appendix A - Virtual File mapping example 151 1.3 General Principles 153 The aim of the ODETTE-FTP is to facilitate the transmission of a file 154 between one or more locations in a way that is independent of the 155 data communication network, system hardware and software environment. 157 In designing and specifying the protocol, the following factors were 158 considered. 160 1. The possible differences of size and sophistication (file storage, 161 small and large systems). 163 2. The necessity to work with existing systems (reduce changes to 164 existing products and allow easy implementation). 166 3. Systems of different ages. 168 4. Systems of different manufactures. 170 5. The potential for growth in sophistication (limit impact and avoid 171 changes at other locations). 173 1.4 Structure 175 ODETTE-FTP is modelled on the OSI reference model. It is designed to 176 use the Network Service provided by level 3 of the model and provide 177 a File Service to the users. Thus the protocol spans levels 4 to 7 178 of model. 180 The description of the ODETTE-FTP contained in this memo is closely 181 related to the original 'X.25' specification of the protocol and in 182 the spirit of the OSI model describes: 184 1. A File Service provided to a user monitor. 186 2. A protocol for the exchange of information between peer 187 ODETTE-FTP entities. 189 A major consideration in adapting the protocol to use the 190 Transmission Control Protocol (TCP) was the desire to make no changes 191 to the existing protocol by adding the functionality required to 192 allow implementors to support internet communication with only minor 193 changes to existing ODETTE-FTP engines. To this end an additional 194 header has been added to the start of each exchange buffer to allow 195 the TCP byte stream to be broken up into the discrete exchange 196 buffers expected by the ODETTE-FTP protocol. 198 1.5 Virtual Files 200 Information is always exchanged between ODETTE-FTP entities in a 201 standard representation called a Virtual File. This allows data 202 transfer without regard for the nature of the communicating systems. 204 The mapping of a file between a local and virtual representation will 205 vary from system to system and is not defined here. 207 o---------o 208 Site | Local | 209 A | File A | 210 o---------o 211 | 212 o----------------------- Mapping A ------------------------o 213 | | | 214 | o---------o | 215 | | Virtual | | 216 | | File | | 217 | o---------o | 218 | o------------------------------------------------o | 219 | | | | 220 | | ODETTE-FTP | | 221 | | | | 222 | o------------------------------------------------o | 223 | o---------o o---------o | 224 | | Virtual | | Virtual | | 225 | | File | | File | | 226 | o---------o o----+----o | 227 | | | | 228 o------ Mapping B ------------------------ Mapping C ------o 229 | | 230 o---------o o----+----o 231 | Local | Site Site | Local | 232 | File B | B C | File C | 233 o---------o o---------o 235 A Virtual File is described by a set of attributes identifying and 236 defining the data to be transferred. The main attributes are: 238 1.5.1 Organisation: 240 Sequential 242 Logical records are presented one after another. The ODETTE-FTP 243 must be aware of the record boundaries. 245 1.5.2 Identification 247 Filename, Date, Time 249 A Virtual File is uniquely identified by the combination of it's 250 filename, date and time attributes. 252 1.5.3 Record Format 254 Four record formats are defined. 256 Fixed (F) 258 Each record in the file has the same length. 260 Variable (V) 262 The records in the file can have different lengths. 264 Unstructured (U) 266 The file contains a stream of data. No structure is defined. 268 Text File (T) 270 A Text File is defined as a sequence of ASCII characters, 271 containing no control characters except CR/LF which delimits 272 lines. A line will not have more than 2048 characters. 274 1.5.4 Restart 276 ODETTE-FTP can negotiate the restart of an interrupted Virtual File 277 transmission. Fixed and Variable format files are restarted on 278 record boundaries. For Unstructured and Text files the restart 279 position is expressed as a file offset in 1K (1024 octet) blocks. 280 The restart position is always calculated relative to the Virtual 281 File. 283 1.6 Service Description 285 ODETTE-FTP provides a file transfer service to a user monitor and in 286 turn uses the Internet transport layer stream service to communicate 287 between peers. 289 These services are specified in this memo using service primitives 290 grouped into four classes as follows: 292 Request (RQ) An entity asks the service to do some work. 293 Indication (IND) A service informs an entity of an event. 294 Response (RS) An entity responds to an event. 295 Confirm (CF) A service informs an entity of the response. 297 Services may be confirmed, using the request, indication, response 298 and confirm primitives, or unconfirmed using just the request and 299 indication primitives. 301 2. Network Service (TCP Transport Service) 303 2.1 Introduction 305 ODETTE-FTP peer entities communicate with each other via the OSI 306 Network Service or the Transmission Control Protocol Transport 307 Service [TCP]. This is described by service primitives representing 308 request, indication, response and confirmation actions. 310 For the internet environment, the service primitives mentioned below 311 for the Network Service have to be mapped to the respective Transport 312 Service primitives. This section describes the network service 313 primitives used by ODETTE-FTP and their relationship to the TCP 314 interface. In practice the local transport service application 315 programming interface will be used to access the TCP service. 317 2.2 Service Primitives 319 All Network primitives can be directly mapped to the respective 320 Transport primitives when using TCP. 322 2.2.1 Network Connection 324 N_CON_RQ ------> N_CON_IND 325 N_CON_CF <------ N_CON_RS 327 This describes the setup of a connection. The requesting ODETTE-FTP 328 peer uses the N_CON_RQ primitive to request an active OPEN of a 329 connection to a peer ODETTE-FTP, the Responder, which has previously 330 requested a passive OPEN. The Responder is notified of the incoming 331 connection via N_CON_IND and accepts it with N_CON_RS. The requester 332 is notified of the completion of it's OPEN request upon receipt of 333 N_CON_CF. 335 Parameters 337 Request Indication Response Confirmation 338 --------------------------------------------------------------------- 339 Dest addr ------> same same same 341 2.2.2 Network Data 343 N_DATA_RQ ------> N_DATA_IND 345 Data exchange is an unconfirmed service. The Requester passes data 346 for transmission to the network service via the N_DATA_RQ primitive. 347 The Responder is notified of the availability of data via N_DATA_IND. 349 In practice the notification and receipt of data may be combined, 350 such as by the return from a blocking read from the network socket. 352 Parameters 354 Request Indication 355 --------------------------------------------------------------------- 356 Data ------------------> same 358 2.2.3 Network Disconnection 360 N_DISC_RQ ------> N_DISC_IND 362 An ODETTE-FTP requests the termination of a connection with the 363 N_DISC_RQ service primitive. It's peer is notified of the CLOSE by a 364 N_DISC_IND event. It is recognised that each peer must issue a 365 N_DISC_RQ primitive to complete the TCP symmetric close procedure. 367 2.2.4 Network Reset 369 ------> N_RST_IND 371 An ODETTE-FTP entity is notified of a network error by a N_RST_IND 372 event. It should be noted that N_RST_IND would also be generated by 373 a peer RESETTING the connection, but this is ignored here as N_RST_RQ 374 is never sent to the Network Service by ODETTE-FTP. 376 2.3 Port Assignment 378 A ODETTE-FTP requester will select a suitable local port. 380 The responding ODETTE-FTP will listen for connections on Registered 381 Port 3305, the service name is 'odette-ftp'. 383 3. File Transfer Service 385 The File Transfer Service describes the services offered by an 386 ODETTE-FTP Entity to it's User Monitor. The implementation of the 387 service primitives is a local matter. 389 3.1 Model 391 o-------------------o o-------------------o 392 | | | | 393 | USER MONITOR | | USER MONITOR | 394 | | | | 395 o-------------------o o-------------------o 396 | A | A 397 ...............|...|... FILE TRANSFER SERVICE ...|...|............... 398 | | | | 399 F_XXX_RQ/RS | | F_XXX_IND/CF F_XXX_RQ/RS | | F_XXX_IND/CF 400 V | V | 401 o-------------------o o-------------------o 402 | |- - - - - - >| | 403 | ODETTE-FTP Entity | E-Buffer | ODETTE-FTP Entity | 404 | |< - - - - - -| | 405 o-------------------o o-------------------o 406 | A | A 407 N_XXX_RQ/RS | | N_XXX_IND/CF N_XXX_RQ/RS | | N_XXX_IND/CF 408 | | | | 409 ...............|...|...... NETWORK SERVICE ......|...|............... 410 V | V | 411 o---------------------------------------------------------o 412 | | 413 | N E T W O R K | 414 | | 415 o---------------------------------------------------------o 417 Key: E-Buffer - Exchange Buffer 418 F_ - File Transfer Service Primitive 419 N_ - Network Service Primitive 421 3.2 Session Setup 423 3.2.1 Session Connection Service 425 | | 426 F_CONNECT_RQ ---->|------------|----> F_CONNECT_IND 427 | | 428 F_CONNECT_CF <----|------------|<---- F_CONNECT_RS 429 | | 431 Parameters 433 Request Indication Response Confirm 434 --------------------------------------------------------------------- 435 called-address -> same --- ---- 436 calling-address-> same --- ---- 437 ID1 ------------> same ID2 ------------> same 438 PSW1------------> same PSW2 -----------> same 439 mode1 ----------> mode2 ----------> mode3 ----------> same 440 restart1 -------> same -----------> restart2 -------> same 441 --------------------------------------------------------------------- 443 Mode 445 Specifies the file transfer capabilities of the entity sending or 446 receiving a F_CONNECT primitive for the duration of the session. 448 Value: 449 Sender-Only The entity can only send files. 450 Receiver-Only The entity can only receive files. 451 Both The entity can both send and receive files. 453 Negotiation: 454 Sender-Only Not negotiable. 455 Receiver-Only Not negotiable. 456 Both Can be negotiated down to Sender-Only or 457 Receiver-Only by the User Monitor or the 458 ODETTE-FTP entity. 460 Request Indication Response Confirm 461 --------------------------------------------------------------------- 462 Sender-only ----> Receiver-only --> Receiver-only --> Sender-only 464 Receiver-only --> Sender-only ----> Sender-only ----> Receiver-only 466 Both -----+-----> Both ----+------> Both -----------> Both 467 | or +------> Receiver-only --> Sender-only 468 | or +------> Sender-only ----> Receiver-only 469 | 470 or +-----> Receiver-only --> Receiver-only --> Sender-only 471 or +-----> Sender-only ----> Sender-only ----> Receiver-only 472 --------------------------------------------------------------------- 473 Restart 475 Specifies the file transfer restart capabilities of the User 476 Monitor. 478 Value: 479 'Y' Restart supported. 480 'N' Restart not supported. 482 Negotiation: 483 'Y' May be negotiated down to 'N' by the User Monitor. 484 'N' Not negotiable. 486 Request Indication Response Confirm 487 --------------------------------------------------------------------- 488 restart = Y ----> restart = Y --+-> restart = Y ----> restart = Y 489 or +-> restart = N ----> restart = N 491 restart = N ----> restart = N ----> restart = N ----> restart = N 492 --------------------------------------------------------------------- 494 3.3 File Transfer 496 3.3.1 File Opening 498 | | 499 F_START_FILE_RQ ---->|------------|----> F_START_FILE_IND 500 | | 501 F_START_FILE_CF(+|-) <----|------------|<---- F_START_FILE_RS(+|-) 502 | | 504 Parameters: 506 Request Ind. RS(+) CF(+) RS(-) CF(-) 507 -------------------------------------------------------------------- 508 file-name ----> same ---- ---- ---- ---- 509 date-time ----> same ---- ---- ---- ---- 510 destination---> same ---- ---- ---- ---- 511 originator----> same ---- ---- ---- ---- 512 rec-format----> same ---- ---- ---- ---- 513 rec-size -----> same ---- ---- ---- ---- 514 file-size-----> same ---- ---- ---- ---- 515 restart-pos1--> same-> restart-pos2-> same ---- ---- 516 ---- ---- ---- ---- cause ------> same 517 ---- ---- ---- ---- retry-later-> same 518 -------------------------------------------------------------------- 519 Notes: 521 1. Retry-later has values "Y" or "N". 522 2. Cause is the reason for refusing the transfer (1,..,13,99). 523 3. Restart-pos1 not equal 0 is only valid if restart has been agreed 524 during initial negotiation. 525 4. Restart-pos2 is less than or equal to restart-pos1. 527 3.3.2 Data Regime 529 | | 530 F_DATA_RQ ---->|------------|----> F_DATA_IND 531 | | 533 Notes: 535 1. The data format within a F_DATA primitive is locally defined. 537 2. The File Transfer service may have to provide a flow control 538 mechanism to regulate the flow of F_DATA primitives. 540 3.3.3 File Closing 542 | | 543 F_CLOSE_FILE_RQ --->|------------|----> F_CLOSE_FILE_IND 544 | | 545 F_CLOSE_FILE_CF(+|-) <---|------------|<---- F_CLOSE_FILE_RS(+|-) 546 | | 548 Parameters 550 Request Ind RS(+) CF(+) RS(-) CF(-) 551 --------------------------------------------------------------------- 552 rec-count ---> same ---- ---- ---- ---- 553 unit-count --> same ---- ---- ---- ---- 554 ---- ---- Speaker=Y ---> Speaker=N ---- ---- 555 ---- ---- Speaker=N ---> Speaker=Y ---- ---- 556 ---- ---- ---- ---- cause ---> same 557 --------------------------------------------------------------------- 559 In a positive Close File response (F_CLOSE_FILE_RS(+)) the current 560 Speaker may either: 562 1. Set Speaker to "Yes" and become the Speaker. 563 2. Set Speaker to "No" and remain the Listener. 565 The File Transfer service will ensure that the setting of the speaker 566 parameter is consistent with the capabilities of the peer user. 568 The turn is never exchanged in the case of a negative response or 569 confirmation. 571 Only the Speaker is allowed to issue F_XXX_FILE_RQ primitives. 573 3.3.4 Exchanging the Turn 575 3.3.4.1 Initial Turn (First Speaker) 577 The Initiator becomes the first Speaker at the end of the Session 578 Setup (F_CONNECT_CF received by Initiator and F_CONNECT_RS sent by 579 Responder). 581 3.3.4.2 Following Turns 583 Rules: 585 1. At each unsuccessful End of File the turn is not exchanged. 587 2. At each successful End of File the turn is exchanged if requested 588 by the Listener: 590 - The current Listener receives F_CLOSE_FILE_IND 591 (Speaker = choice). 593 - If the Listener answers F_CLOSE_FILE_RS(Speaker = YES), it 594 becomes Speaker, the Speaker receives F_CLOSE_FILE_CF 595 (Speaker = NO) and becomes Listener. 597 - If the Listener answers F_CLOSE_FILE_RS(Speaker = NO), it 598 remains Listener, and the Speaker receives F_CLOSE_FILE_CF 599 (Speaker = YES) and remains Speaker. 601 3. The Speaker can issue a Change Direction request (F_CD_RQ) to 602 become the Listener. The Listener receives a Change Direction 603 indication (F_CD_IND) and becomes the Speaker. 605 4. In order to prevent loops of F_CD_RQ/IND, it is an error to send 606 F_CD_RQ immediately after having received a F_CD_IND. 608 3.3.5 End to End Response 610 This service is initiated by the current Speaker (if there is no file 611 transfer in progress) to send an End-to-End response from the final 612 destination to the originator of a file. 614 | | 615 F_EERP_RQ ---->|------------|----> F_EERP_IND 616 | | 618 Parameters 620 Request Indication 621 ------------------------------------ 622 filename -------> same 623 date -----------> same 624 time -----------> same 625 destination ----> same 626 originator -----> same 627 ------------------------------------ 629 Relationship with Turn: 631 - Only the Speaker may send an End to End Response request. 633 - Invoking the EERP service does not change the turn. 635 - If a F_CD_IND has been received just before F_EERP_RQ is issued, 636 this results in leaving the special condition created by the 637 reception of F_CD_IND; i.e. while it was possible to issue 638 F_RELEASE_RQ and not possible to issue F_CD_RQ just after the 639 reception of F_CD_IND, after having issued F_EERP_RQ the normal 640 Speaker status is entered again (F_CD_RQ valid, but F_RELEASE_RQ 641 not valid). 643 3.4 Session Take Down 645 3.4.1 Normal Close 647 | | 648 F_RELEASE_RQ ---->|------------|----> F_RELEASE_IND 649 | | 651 Parameters 653 Request Indication 654 --------------------------------------------------------------------- 655 reason = normal -------> ---- 656 --------------------------------------------------------------------- 658 The Release service can only be initiated by the Speaker. 660 The Speaker can only issue a Release request (F_RELEASE_RQ) just 661 after receiving an unsolicited Change Direction indication 662 (F_CD_IND). This ensures that the other partner doesn't want to send 663 any more files in this session. 665 Peer ODETTE-FTP entities action a normal session release by 666 specifying Reason = Normal in an End Session (ESID) command. 668 3.4.2 Abnormal close 670 | | 671 F_RELEASE_RQ ---->|------------|----> F_ABORT_IND 672 | | 674 Parameters 676 Request Indication 677 --------------------------------------------------------------------- 678 reason = error value --> same (or equivalent) 679 AO (Abort Origin) = (L)ocal or (D)istant 680 --------------------------------------------------------------------- 682 Abnormal session release can be initiated by either the Speaker or 683 the Listener and also by the user or provider. 685 Abnormal session release can occur at any time within the session. 687 Peer ODETTE-FTP entities action an abnormal session release by 688 specifying Reason = Error-value in an End Session (ESID) command. 690 The abnormal session release deals with the following types of error: 692 1. The service provider will initiate an abnormal release in the 693 following cases: 695 1. Protocol error, 696 2. Failure of the Start Session (SSID) negotiation, 697 3. Command not recognised, 698 4. Exchange buffer size error, 699 5. Resources not available, 700 6. Other unspecified abort code (with "REASON" = unspecified). 702 2. The User Monitor will initiate an abnormal release in the 703 following cases: 705 1. Local site emergency close down, 706 2. Resources not available, 707 3. Other unspecified abort code (with "REASON" = unspecified). 709 Other error types may be handled by an abort of the connection. 711 3.4.3 Abort 713 | | 714 F_ABORT_RQ ---->|------------|----> F_ABORT_IND 715 | | 716 User Initiated Abort 718 | | 719 F_ABORT_IND <----|------------|----> F_ABORT_IND 720 | | 721 Provider Initiated Abort 723 Parameters 725 Request Indication 726 --------------------------------------------------------------------- 727 -- R (Reason): specified or unspecified 728 -- AO (Abort Origin): (L)ocal or (D)istant 729 --------------------------------------------------------------------- 731 The Abort service may be invoked by either entity at any time. 733 The service provider may initiate an abort in case of error 734 detection. 736 3.4.4 Explanation of Session Take Down Services 738 User | OFTP | Network | OFTP | User 739 ---------------|------|----------------------|------|--------------- 740 | | | | 742 1. Normal Release 744 F_RELEASE_RQ | | ESID(R=normal) | | F_RELEASE_IND 745 *--------------|-> ==|======================|=> --|--------------> 746 (R=normal) | | | | 748 2. User Initiated Abnormal Release 750 F_RELEASE_RQ | | ESID(R=error) | | F_ABORT_IND 751 *--------------|-> ==|======================|=> -|--------------> 752 (R=error value)| | | | (R=error,AO=D) 753 User | OFTP | Network | OFTP | User 754 ---------------|------|----------------------|------|--------------- 755 | | | | 757 3. Provider Initiated Abnormal Release 759 F_ABORT_IND | | ESID(R=error) | | F_ABORT_IND 760 <--------------|-* *=|======================|=> --|--------------> 761 | | | | 763 4. User Initiated Connection Abort 765 F_ABORT_RQ | | N_DISC_RQ | | F_ABORT_IND 766 *--------------|-> --|--------->..----------|-> --|--------------> 767 | | N_DISC_IND | | (R=unsp.,AO=D) 769 5. Provider Initiated Connection Abort 771 F_ABORT_IND | | N_DISC_RQ | | F_ABORT_IND 772 <--------------|-* *-|--------->..----------|-> --|--------------> 773 (R=error,AO=L) | | N_DISC_IND | | (R=unsp.,AO=D) 775 Key: * Origin of command flow 776 F_ ---> File Transfer Service primitive 777 N_ ---> Network Service primitive 778 ===> ODETTE-FTP (OFTP) protocol message 780 3.5 Service State Automata 782 This state automata defines the service as viewed by the User 783 Monitor. Events causing a state transition are shown in lower case 784 and the resulting action in upper case where appropriate. 786 3.5.1 Idle State Diagram 788 o------------o 789 decision | | f_connect_ind 790 +-----------------| IDLE |-----------------+ 791 | F_CONNECT_RQ | (0) | F_CONNECT_RS | 792 | o------------o | 793 V | 794 o-----------------o | 795 | | | 796 | I_WF_FCONNECTCF | | 797 | | | 798 o--------+--------o | 799 | | 800 | F_CONNECT_CF | 801 V V 802 o-----------------o o-----------------o 803 | | | | 804 | IDLE SPEAKER | | IDLE LISTENER | 805 | (1) | | (2) | 806 | See Speaker | | See Listener | 807 | State Diagram | | State Diagram | 808 | | | | 809 o-----------------o o-----------------o 811 3.5.2 Speaker State Diagram 813 o-----------------o o-----------------o 814 | IDLE LISTENER | | IDLE | 815 | CD_RQ just sent | | see (0) | 816 | see (3), Listen | | Idle | 817 | State Diagram | | State Diagram | 818 o-----------------o o-----------------o 819 A A 820 | | 821 decision decision decision 822 F_CD_RQ +----------------+ F_RELEASE_RQ 823 | | F_EERP_RQ | | 824 o=================o | o-----------------o 825 | |<-------------+ | IDLE SPEAKER | 826 | IDLE SPEAKER | | (4) | 827 | (1) | decision | CD_IND | 828 | |<-----------------------------| just received | 829 o=================o F_EERP_RQ o-----------------o 830 A A | | 831 | | | decision and P1 decision and P1 | 832 | | +-----------------+ +---------------------+ 833 | | F_START_FILE_RQ | | F_START_FILE_RQ 834 | | V V 835 | | o---------------o 836 | | f_file_start_cf(-) | | 837 | +----------------------| OPENING | 838 | | | 839 | o---------------o 840 | | 841 f_file_close_cf(-) f_start_file_cf(+) 842 and not P2 | 843 | V 844 o---------------o o---------------o 845 | | | |------------------+ 846 | CLOSING | | DATA TRANSFER | record to send | 847 | | | |<-----------------+ 848 o---------------o o---------------o F_DATA_RQ 849 | A | 850 | | end of file | 851 | +-------------------+ 852 | F_CLOSE_FILE_RQ 853 | o-----------------o 854 | f_close_file(+) and P2 | IDLE LISTENER | 855 +--------------------------------------------->| see (2), Listen | 856 | State Diagram | 857 Predicates: o-----------------o 858 P1: Mode = Both or (Mode = Sender-Only) 859 P2: Negative confirmation or (positive confirmation, Speaker = YES) 861 3.5.3 Listener State Diagram 863 o-----------------o o-----------------o 864 | IDLE SPEAKER | | IDLE | 865 | CD_IND just | | | 866 | received see(4) | | see (0) | 867 | Speaker State | | Idle | 868 | Diagram | | State Diagram | 869 o-----------------o o-----------------o 870 A A 871 | | 872 decision f_eerp_ind decision 873 F_CD_IND +--------------+ F_RELEASE_IND 874 | | | | 875 o=================o | o-----------------o 876 | |<-----------+ f_eerp_ind | | 877 | |<-----------------------------| IDLE LISTENER | 878 | IDLE LISTENER | | (3) | 879 | | f_start_file_ind | CD_RQ | 880 | (2) | and not p2 | just sent | 881 | |---------------------+ | | 882 o=================o F_START_FILE_RS(-) | o-----------------o 883 A | A A | | | 884 | | | +-----------------------+ | | 885 | | | | | 886 | | | f_start_file_ind and not p2 | | 887 | | +--------------------------------------+ | 888 | | F_START_FILE_RS(-) | 889 | | | 890 | | f_start_file_ind f_start_file_ind | 891 | | and p2 and p2 | 892 | +-------------------------------+ +------------------+ 893 | F_START_FILE_RS(+) | | F_START_FILE_RS(+) 894 | V V 895 | o---------------o 896 | f_close_file_ind and not p1 | DATA |-------------+ 897 +------------------------------| TRANSFER | | 898 F_CLOSE_FILE_RS(-) | |<------------+ 899 o---------------o F_DATA_IND 900 o---------------o | 901 | IDLE SPEAKER | f_close_file_ind and p1 | 902 | see (1), Spkr |<--------------------------+ 903 | State Diagram | F_CLOSE_FILE_RS(+) 904 o---------------o 906 Predicates: 907 P1: (decision to send F_CLOSE_FILE_RS(+)) and 908 (decision to set Speaker = yes in F_CLOSE_FILE_RS(+)) 909 P2: (decision to send F_START_FILE_RS(+)) 911 4. Protocol Specification 913 4.1 Overview 915 The ODETTE-FTP protocol is divided into five operating phases. 917 Start Session 918 Start File 919 Data Transfer 920 End File 921 End Session 923 After the End File phase an ODETTE-FTP entity may enter a new Start 924 File phase or terminate the session via the End Session phase. 926 ODETTE-FTP peers communicate by sending and receiving messages in 927 Exchange Buffers via the Network Service. Each Exchange Buffer 928 contains one of the following commands. 930 SSRM Start Session Ready Message 931 SSID Start Session 932 SFID Start File 933 SFPA Start File Positive Answer 934 SFNA Start File Negative Answer 935 DATA Data 936 CDT Set Credit 937 EFID End File 938 EFPA End File Positive Answer 939 EFNA End File Negative Answer 940 ESID End Session 941 CD Change Direction 942 EERP End to End Response 943 RTR Ready To Receive 945 The remainder of this section describes the protocol flows. Section 946 five details the command formats. 948 4.2 Start Session Phase 950 The Start Session phase is entered immediately after the network 951 connection has been established. 953 4.2.1 Entity Definition 955 The ODETTE-FTP entity that took the initiative to establish the 956 network connection becomes the Initiator. It's peer becomes the 957 Responder. 959 4.2.2 Protocol Sequence 961 The first message must be sent by the Responder. 963 1. Initiator <-------------SSRM -- Responder Ready Message 964 -- SSID ------------> Identification 965 <------------ SSID -- Identification 967 4.3 Start File Phase 969 4.3.1 Entity Definition 971 The Initiator from the Start Session phase is designated the Speaker 972 while the Responder becomes the Listener. The roles are reversed by 973 the Speaker sending a Change Direction command to the Listener. 975 4.3.2 Protocol Sequence 977 1. Speaker -- SFID ------------> Listener Start File 978 <------------ SFPA -- Answer YES 980 2. Speaker -- SFID ------------> Listener Start File 981 <------------ SFNA -- Answer NO 982 Go To 1 984 Note: The User Monitor should take steps to prevent a loop 985 situation occurring. 987 2. Speaker -- CD --------------> Listener Change Direction 988 Listener <------------ EERP -- Speaker End to End Response 989 -- RTR -------------> Ready to Receive 990 <------------ SFID -- Start File 992 4.3.3 Restart Facilities 994 The Start File command includes a count allowing the restart of an 995 interrupted transmission to be negotiated. If restart facilities are 996 not available the restart count must be set to zero. The sender will 997 start with the lowest record count + 1. 999 4.3.4 Broadcast Facilities 1001 The destination in a Start File command can be specified as follows. 1003 1. An explicitly defined destination. 1005 2. A group destination that allows an intermediate location to 1006 broadcast the Virtual File to multiple destinations. 1008 The Listener will send a negative answer to the Speaker when the 1009 destination is not known. 1011 4.3.5 Priority 1013 The prioritisation of files for transmission is left to the local 1014 implementation. To allow some flexibility, a change direction 1015 mechanism is available in the End File phase. 1017 4.3.6 End To End Response (EERP) 1019 The End to End Response (EERP) command notifies the originator of a 1020 Virtual File that it has been successfully delivered to it's final 1021 destination. This allows the originator to perform house keeping 1022 tasks such as deleting copies of the delivered data. 1024 A Response Command must be sent from the location performing the 1025 final processing or distribution of the data to the originator. The 1026 Response is mandatory and may be sent in the same or in any 1027 subsequent session. 1029 When an intermediate location broadcasts or distributes a Virtual 1030 File it must receive a Response command from all the locations to 1031 which it forwarded the data before sending it's own Response. This 1032 ensures that the Response received by the Virtual File's originator 1033 accounts for all the destination locations. An intermediate location 1034 therefore needs to track the status of files it processes over time. 1036 Example: Point to Point 1038 Location A sends file Ba to Location B which will send an EERP to 1039 location A after it successfully receives the file. 1041 o----------o o-----------o 1042 | Loc. A |----------- S1 ---------->| Loc. B | 1043 | | | | 1044 | [Ba] |<---------- R2 -----------| [Ba] | 1045 +----------o o-----------o 1047 Key: 1048 S - File Transfer R - Response EERP [Ba] - File for B from A 1050 Example: Data distribution 1052 Location A sends a Virtual File containing data for distribution to 1053 locations B and C via clearing centres E1 and E2. Clearing centre E1 1054 must wait for a response from E2 (for file Ba) and location C before 1055 it sends it's response, R8, to location A. Clearing centre E2 can 1056 only send response R7 to E1 when location B acknowledges file Ba with 1057 response R6. 1059 o---------o o---------o o---------o o---------o 1060 | Loc. A |-- S1 ->| Loc. E1 |-- S2 ->| Loc. E2 |-- S5 ->| Loc. B | 1061 | | | | | | | | 1062 | [Ba,Ca] |<- R8 --| [Ba,Ca] |<- R7 --| [Ba] |<- R6 --| [Ba] | 1063 o---------o o---------o o---------o o---------o 1064 A | 1065 | | o---------o 1066 | +----- S3 ->| Loc. C | 1067 | | | 1068 +--------- R4 --| [Ca] | 1069 o---------o 1071 Example: Data collection 1073 Locations A and B send files Ca and Cb to clearing centre E1 which 1074 forwards both files to location C in a single Virtual File. When it 1075 receives response R4 from C, clearing centre E1 sends response R5 to 1076 location A and R6 to location B. 1078 o---------o o---------o o---------o 1079 | Loc. A |-- S1 ->| Loc. E1 |-- S3 ->| Loc. C | 1080 | | | | | | 1081 | [Ca] |<- R5 --| [Ca,Cb] |<- R4 --| [Ca,Cb] | 1082 o---------o o---------o o---------o 1083 A | 1084 o---------o | | 1085 | Loc. B |-- S2 -----+ | 1086 | | | 1087 | [Cb] |<- R6 ---------+ 1088 o---------o 1090 4.3.7 Ready To Receive Command (RTR) 1092 In order to avoid congestion between two adjacent nodes caused by a 1093 continuous flow of EERP's, a Ready To Receive (RTR) command is 1094 provided. The RTR acts as an EERP acknowledgement for flow control 1095 but has no end-to-end significance. 1097 Speaker -- EERP ------------> Listener End to End Response 1098 <------------- RTR -- Ready to Receive 1099 -- EERP ------------> End to End Response 1100 <------------- RTR -- Ready to Receive 1101 -- SFID ------------> Start File 1102 or 1103 -- CD --------------> Exchange the turn 1105 After sending an EERP, the Speaker must wait for an RTR before 1106 sending any other commands. 1108 4.4 Data Transfer Phase 1110 Virtual File data flows from the Speaker to the Listener during the 1111 Data Transfer phase which is entered after the Start File phase. 1113 4.4.1 Protocol Sequence 1115 To avoid congestion at the protocol level a flow control mechanism is 1116 provided via the Credit (CDT) command. 1118 A Credit limit is negotiated in the Start Session phase, this 1119 represents the number of Data Exchange Buffers that the Speaker may 1120 send before it is obliged to wait for a Credit command from the 1121 Listener. 1123 The available credit is initially set to the negotiated value by the 1124 Start File positive answer, which acts as an implicit Credit command. 1125 The Speaker decreases the available credit count by one for each data 1126 buffer sent to the Listener. 1128 When the available credit is exhausted, the Speaker must wait for a 1129 Credit command from the Listener otherwise a protocol error will 1130 occur and the session will be aborted. 1132 The Listener should endeavour to send the Credit command without 1133 delay to prevent the Speaker blocking. 1135 1. Speaker -- SFID ------------> Listener Start File 1136 <------------ SFPA -- Answer YES 1138 2. If the Credit Value is set to 2 1140 Speaker -- Data ------------> Listener Start File 1141 -- Data ------------> 1142 <------------- CDT -- Set Credit 1143 -- Data ------------> 1144 -- EFID ------------> End File 1146 4.5 End File Phase 1148 4.5.1 Protocol Sequence 1150 The Speaker notifies the Listener that it has finished sending a 1151 Virtual File by sending an End File (EFID) command. The Listener 1152 replies with a positive or negative End File command and has the 1153 option to request a Change Direction command from the Speaker. 1155 1. Speaker -- EFID ------------> Listener End File 1156 <------------ EFPA -- Answer YES 1158 2. Speaker -- EFID ------------> Listener End File 1159 <------------ EFPA -- Answer YES + CD 1160 -- CD --------------> Change Direction 1161 Listener <------------ EERP -- Speaker End to End Response 1162 -------------- RTR -> Ready to Receive 1163 Go to Start File Phase 1165 3. Speaker -- EFID ------------> Listener End File 1166 <------------ EFNA -- Answer NO 1168 4.6 End Session Phase 1170 4.6.1 Protocol Sequence 1172 The Speaker terminates the session by sending an End Session (ESID) 1173 command. 1175 1. Speaker -- EFID ------------> Listener End File 1176 <------------ EFPA -- Answer YES 1177 -- CD --------------> Change Direction 1178 Listener <------------ ESID -- Speaker End Session 1180 4.7 Problem Handling 1182 Error detection and handling should be done as close as possible to 1183 the problem. This aids problem determination and correction. Each 1184 layer of the reference model is responsible for it's own error 1185 handling. 1187 ODETTE-FTP can detect protocol errors through the construction of 1188 it's state machine, and uses activity timers to detect session hang 1189 conditions. These mechanisms are separate from the End to End 1190 controls. 1192 4.7.1 Protocol Errors 1194 If a protocol error occurs the session will be terminated and 1195 application activity aborted. Both locations enter the IDLE state. 1197 4.7.2 Timers 1199 To protect against application and network hang conditions ODETTE-FTP 1200 uses activity timers for all situations where a response is required. 1201 The timers and actions to be taken if they expire are described in 1202 section 8, the Protocol State Machine. 1204 4.7.3 Clearing Centres 1206 The use of clearing centres introduces the possibility of errors 1207 occurring as a result of data processing activities within the 1208 centre. Such errors are not directly related to ODETTE-FTP or the 1209 communication network and are therefore outside the scope of this 1210 specification. 1212 5. Commands and Formats 1214 ODETTE-FTP entities communicate via Exchange Buffers. The Command 1215 Exchange Buffers are described below. Virtual File data is carried 1216 in Data Exchange Buffers which are described in Section 6. 1218 5.1 Conventions 1220 5.1.1 Representation unit: 1222 The basic unit of information is an octet, containing eight bits. 1224 5.1.2 Values and Characters: 1226 The ISO 646 IRV 7-bit coded character set [ISO-646] is used to encode 1227 constants and strings within command exchange buffers. 1229 5.2 Commands 1231 A Command Exchange Buffer contains a single command starting at the 1232 beginning of the buffer. Commands and data are never mixed within an 1233 Exchange Buffer. Each command has a fixed length and can not be 1234 compressed. 1236 Components: 1238 1. Command identifier: 1240 The first octet of an Exchange Buffer is the Command Identifier 1241 and defines the format of the buffer. 1243 2. Parameter(s): 1245 Command parameters are stored in fixed fields within a Command 1246 Exchange Buffer. All values are required. 1248 5.3 Command Formats 1250 The ODETTE-FTP commands are described below using the following 1251 definitions. 1253 Position (Pos.) 1255 Field offset within the command exchange buffer, relative to a 1256 zero origin. 1258 Field 1260 The name of the field. 1262 Description 1264 A description of the field. 1266 Format 1268 F - A field containing fixed values. All allowable values for 1269 the field are enumerated in the command definition. 1271 V - A field with variable values within a defined range. For 1272 example the SFIDFSIZ field may contain any integer value 1273 between 0000000 and 9999999. 1275 X(n) - An alphanumeric field of length n octets. 1277 9(n) - A numeric field of length n octets. 1279 All attributes are in character format. 1281 A String contains alphanumeric characters from the following set: 1283 The numerals: 0 to 9 1284 The upper case letters: A to Z 1285 The following special set: / - . & ( ) space. 1287 Space is not allowed as an embedded character. 1289 Numeric fields are always right justified and left padding with 1290 zeros must be done when needed. 1292 5.3.1 SSRM - Start Session Ready Message 1294 o-------------------------------------------------------------------o 1295 | SSRM Start Session Ready Message | 1296 | | 1297 | Start Session Phase Initiator <---- Responder | 1298 |-------------------------------------------------------------------| 1299 | Pos | Field | Description | Format | 1300 |-----+-----------+---------------------------------------+---------| 1301 | 0 | SSRMCMD | SSRM Command, 'I' | F X(1) | 1302 | 1 | SSRMMSG | Ready Message, 'ODETTE FTP READY ' | F X(17) | 1303 | 18 | SSRMCR | Carriage Return | F X(1) | 1304 o-------------------------------------------------------------------o 1306 SSRMCMD Command Code Character 1308 Value: 'I' SSRM Command identifier. 1310 SSRMMSG Ready Message String(17) 1312 Value: 'ODETTE FTP READY ' 1314 SSRMCR Carriage Return Character 1316 Value: Character with hex value '0D' or '8D'. 1318 5.3.2 SSID - Start Session 1320 o-------------------------------------------------------------------o 1321 | SSID Start Session | 1322 | | 1323 | Start Session Phase Initiator <---> Responder | 1324 |-------------------------------------------------------------------| 1325 | Pos | Field | Description | Format | 1326 |-----+-----------+---------------------------------------+---------| 1327 | 0 | SSIDCMD | SSID Command 'X' | F X(1) | 1328 | 1 | SSIDLEV | Protocol Release Level | F 9(1) | 1329 | 2 | SSIDCODE | Initiator's Identification Code | V X(25) | 1330 | 27 | SSIDPSWD | Initiator's Password | V X(8) | 1331 | 35 | SSIDSDEB | Exchange Buffer Size | V 9(5) | 1332 | 40 | SSIDSR | Send / Receive Capabilities (S/R/B) | F X(1) | 1333 | 41 | SSIDCMPR | Compression Indicator (Y/N) | F X(1) | 1334 | 42 | SSIDREST | Restart Indicator (Y/N) | F X(1) | 1335 | 43 | SSIDSPEC | Special Logic Indicator (N) | F X(1) | 1336 | 44 | SSIDCRED | Credit | V 9(3) | 1337 | 47 | SSIDRSV1 | Reserved | F X(5) | 1338 | 52 | SSIDUSER | User Data | V X(8) | 1339 | 60 | SSIDCR | Carriage Return | F X(1) | 1340 o-------------------------------------------------------------------o 1341 SSIDCMD Command Code Character 1343 Value: 'X' SSID Command identifier. 1345 SSIDLEV Protocol Release Level Numeric(1) 1347 Value: '1' ODETTE-FTP protocol release level 1. 1349 Future release levels will have higher numbers. The 1350 protocol release level is negotiable, with the lowest level 1351 being selected. 1353 SSIDCODE Initiator's Identification Code String(25) 1355 Format: See Identification Code (Section 5.4) 1357 Uniquely identifies the Initiator (sender) participating 1358 in the ODETTE-FTP session. 1360 SSIDPSWD Password String(8) 1362 Key to authenticate the sender. Assigned by bilateral 1363 agreement. 1365 SSIDSDEB Exchange Buffer Size Numeric(5) 1367 Minimum: 128 1368 Maximum: 99999 1370 The length, in octets, of the largest Exchange Buffer that 1371 can be accepted by the location. The length includes the 1372 command octet but does not include the Stream Transmission 1373 Header. 1375 After negotiation the smallest size will be selected. 1377 SSIDSR Send / Receive Capabilities Character 1379 Value: 'S' Location can only send files. 1380 'R' Location can only receive files. 1381 'B' Location can both send and receive files. 1383 Sending and receiving will be serialised during the 1384 session, so parallel sessions will not take place. 1386 An error occurs if adjacent locations both specify the send 1387 or receive capability. 1389 SSIDCMPR Compression Indication Character 1391 Value: 'Y' The location can handle compressed data. 1392 'N' The location can not handle compressed data. 1394 Compression is only used if supported by both locations. 1395 The compression mechanism is described in Section 6.2 1397 SSIDREST Restart Indication Character 1399 Value: 'Y' The location can handle the restart of a partially 1400 transmitted file. 1401 'N' The location can not restart a file. 1403 SSIDSPEC Special Logic Indication Character 1405 Value: 'N' Only valid value for TCP. 1407 The Special Logic extensions are only useful in an X.25 1408 environment and are not supported for TCP/IP. 1410 SSIDCRED Credit Numeric(3) 1412 Maximum: 999 1414 The number of consecutive Data Exchange Buffers sent by the 1415 Speaker before it must wait for a Credit (CDT) command from 1416 the Listener. 1418 The credit value is only applied to Data flow in the Data 1419 Transfer phase. 1421 The Speaker's available credit is initialised to SSIDCRED 1422 when it receives a Start File Positive Answer (SFPA) 1423 command from the Listener. It is zeroed by the End File 1424 (EFID) command. 1426 After negotiation, the smallest size must be selected in 1427 the answer of the Responder, otherwise a protocol error 1428 will abort the session. 1430 Negotiation of the "credit-window-size" parameter. 1432 Window Size m -- SSID ------------> 1433 <------------ SSID -- Window Size n 1434 (n less or equal m) 1435 Note: negotiated value will be "n". 1437 SSIDRSV1 Reserved String(5) 1439 This field is reserved for future use. 1441 SSIDUSER User Data String(8) 1443 May be used by the ODETTE-FTP in any way. If unused it 1444 should be initialised to spaces. It is expected that a 1445 bilateral agreement exists as to the meaning of the data. 1447 SSIDCR Carriage Return Character 1449 Value: Character with hex value '0D' or '8D'. 1451 5.3.3 SFID - Start File 1453 o-------------------------------------------------------------------o 1454 | SFID Start File | 1455 | | 1456 | Start File Phase Speaker ----> Listener | 1457 |-------------------------------------------------------------------| 1458 | Pos | Field | Description | Format | 1459 |-----+-----------+---------------------------------------+---------| 1460 | 0 | SFIDCMD | SFID Command, 'H' | F X(1) | 1461 | 1 | SFIDDSN | Virtual File Dataset Name | V X(26) | 1462 | 27 | SFIDRSV1 | Reserved | F X(9) | 1463 | 36 | SFIDDATE | Virtual File Date stamp, (YYMMDD) | V X(6) | 1464 | 42 | SFIDTIME | Virtual File Time stamp, (HHMMSS) | V X(6) | 1465 | 48 | SFIDUSER | User Data | V X(8) | 1466 | 56 | SFIDDEST | Destination | V X(25) | 1467 | 81 | SFIDORIG | Originator | V X(25) | 1468 | 106 | SFIDFMT | File Format, (F/V/U/T) | F X(1) | 1469 | 107 | SFIDLRECL | Maximum Record Size | V 9(5) | 1470 | 112 | SFIDFSIZ | File Size, 1K blocks | V 9(7) | 1471 | 119 | SFIDREST | Restart Position | V 9(9) | 1472 o-------------------------------------------------------------------o 1474 SFIDCMD Command Code Character 1476 Value: 'H' SFID Command identifier. 1478 SFIDDSN Virtual File Dataset Name String(26) 1480 Dataset name of the Virtual File being transferred, 1481 assigned by bilateral agreement. 1483 No general structure is defined for this attribute. 1485 A Virtual File is uniquely identified by its Name, Date and 1486 Time attributes which are only significant to the 1487 originating and final destinations. They must not be 1488 changed by any intermediate location. 1490 SFIDRSV1 Reserved String(9) 1492 This field is reserved for future use. 1494 SFIDDATE Virtual File Date stamp String(6) 1496 Format: 'YYMMDD' 6 decimal digits representing the year, month 1497 and day respectively [ISO-8601]. 1499 Date stamp assigned by the Virtual File's Originator 1500 indicating when the file was made available for 1501 transmission. 1503 A Virtual File is uniquely identified by its Name, Date and 1504 Time attributes which are only significant to the 1505 originating and final destinations. They must not be 1506 changed by any intermediate location. 1508 SFIDTIME Virtual File Time stamp String(6) 1510 Format: 'HHMMSS' 6 decimal digits representing hours, minutes 1511 and seconds respectively [ISO-8601]. 1513 Time stamp assigned by the Virtual File's Originator 1514 indicating when the file was made available for 1515 transmission. 1517 A Virtual File is uniquely identified by its Name, Date and 1518 Time attributes which are only significant to the 1519 originating and final destinations. They must not be 1520 changed by any intermediate location. 1522 SFIDUSER User Data String(8) 1524 May be used by the ODETTE-FTP in any way. If unused it 1525 should be initialised to spaces. It is expected that a 1526 bilateral agreement exists as to the meaning of the data. 1528 SFIDDEST Destination String(25) 1530 Format: See Identification Code (Section 5.4) 1532 The Final Recipient of the Virtual File. 1534 This is the location that will look into the Virtual File 1535 content and perform mapping functions. It is also the 1536 location that creates the End to End Response (EERP) 1537 command for the received file. 1539 SFIDORIG Originator String(25) 1541 Format: See Identification Code (Section 5.4) 1543 Originator of the Virtual File. 1545 It is the location that created (mapped) the data for 1546 transmission. 1548 SFIDFMT File Format Character 1550 Value: 'F' Fixed format binary file. 1551 'V' Variable format binary file. 1552 'U' Unstructured binary file. 1553 'T' Text 1555 Virtual File format. Used to calculate the restart 1556 position. (Section 1.5.3) 1558 SFIDLRECL Maximum Record Size Numeric(5) 1559 Maximum: 99999 1561 Length in octets of the longest logical record which may be 1562 transferred to a location. Only user data is included. 1564 If SFIDFMT is 'T' or 'U' then this attribute must be set to 1565 '00000'. 1567 SFIDFSIZ File Size Numeric(7) 1569 Maximum: 9999999 1571 Space in 1K (1024 octet) blocks required at the Originator 1572 location to store the Virtual File. 1574 This parameter is intended to provide only a good estimate 1575 of the Virtual File size. 1577 SFIDREST Restart Position Numeric(9) 1579 Maximum: 999999999 1581 Virtual File restart position. 1583 The count represents the: 1584 - Record Number if SSIDFMT is 'F' or 'V'. 1585 - File offset in 1K (1024 octet) blocks if SSIDFMT is 1586 'U' or 'T'. 1588 The count will express the transmitted user data (i.e. 1589 before compression, header not included). 1591 After negotiation between adjacent locations, 1592 retransmission will start at the lowest value. 1594 5.3.4 SFPA - Start File Positive Answer 1596 o-------------------------------------------------------------------o 1597 | SFPA Start File Positive Answer | 1598 | | 1599 | Start File Phase Speaker <---- Listener | 1600 |-------------------------------------------------------------------| 1601 | Pos | Field | Description | Format | 1602 |-----+-----------+---------------------------------------+---------| 1603 | 0 | SFPACMD | SFPA Command, '2' | F X(1) | 1604 | 1 | SFPAACNT | Answer Count | V 9(9) | 1605 o-------------------------------------------------------------------o 1607 SFPACMD Command Code Character 1609 Value: '2' SFPA Command identifier. 1611 SFPAACNT Answer Count Numeric(9) 1613 The Listener must enter a count lower or equal to the 1614 restart count specified by the Speaker in the Start File 1615 (SFID) command. The count expresses the received user 1616 data. If restart facilities are not available, a count of 1617 zero must be specified. 1619 5.3.5 SFNA - Start File Negative Answer 1621 o-------------------------------------------------------------------o 1622 | SFNA Start File Negative Answer | 1623 | | 1624 | Start File Phase Speaker <---- Listener | 1625 |-------------------------------------------------------------------| 1626 | Pos | Field | Description | Format | 1627 |-----+-----------+---------------------------------------+---------| 1628 | 0 | SFNACMD | SFNA Command, '3' | F X(1) | 1629 | 1 | SFNAREAS | Answer Reason | F 9(2) | 1630 | 3 | SFNARRTR | Retry Indicator, (Y/N) | F X(1) | 1631 o-------------------------------------------------------------------o 1632 SFNACMD Command Code Character 1634 Value: '3' SFNA Command identifier. 1636 SFNAREAS Answer Reason Numeric(2) 1638 Value: '01' Invalid filename. 1639 '02' Invalid destination. 1640 '03' Invalid origin. 1641 '04' Storage record format not supported. 1642 '05' Maximum record length not supported. 1643 '06' File size is too big. 1644 '10' Invalid record count. 1645 '11' Invalid byte count. 1646 '12' Access method failure. 1647 '13' Duplicate file. 1648 '99' Unspecified reason. 1650 Reason why transmission can not proceed. 1652 SFNARRTR Retry Indicator Character 1654 Value: 'N' Transmission should not be retried. 1655 'Y' The transmission may be retried latter. 1657 This parameter is used to advise the Speaker if it should 1658 retry at a latter point in time due to a temporary 1659 condition at the Listener site, such as a lack of storage 1660 space. It should be used in conjunction with the Answer 1661 Reason code (SFNAREAS). 1663 An invalid file name error code may be the consequence of a 1664 problem in the mapping of the Virtual File on to a real 1665 file. Such problems cannot always be resolved immediately. 1666 It it therefore recommended that when a SFNA with Retry = Y 1667 is received the User Monitor attempts to retransmit the 1668 relevant file in a subsequent session. 1670 5.3.6 DATA - Data Exchange Buffer 1672 o-------------------------------------------------------------------o 1673 | DATA Data Exchange Buffer | 1674 | | 1675 | Data Transfer Phase Speaker ----> Listener | 1676 |-------------------------------------------------------------------| 1677 | Pos | Field | Description | Format | 1678 |-----+-----------+---------------------------------------+---------| 1679 | 0 | DATACMD | DATA Command, 'D' | F X(1) | 1680 | 1 | DATABUF | Data Exchange Buffer payload | V X(n) | 1681 o-------------------------------------------------------------------o 1683 DATACMD Command Code Character 1685 Value: 'D' DATA Command identifier. 1687 DATABUF Data Exchange Buffer payload String(n) 1689 Variable length buffer containing the data payload. The 1690 Data Exchange Buffer is described in Section 6. 1692 5.3.7 CDT - Set Credit 1694 o-------------------------------------------------------------------o 1695 | CDT Set Credit | 1696 | | 1697 | Data Transfer Phase Speaker <---- Listener | 1698 |-------------------------------------------------------------------| 1699 | Pos | Field | Description | Format | 1700 |-----+-----------+---------------------------------------+---------| 1701 | 0 | CDTCMD | CDT Command, 'C' | F X(1) | 1702 | 1 | CDTRSV1 | Reserved | F X(2) | 1703 o-------------------------------------------------------------------o 1705 CDTCMD Command Code Character 1707 Value: 'C' CDT Command identifier. 1709 CDTRSV1 Reserved String(2) 1711 This field is reserved for future use. 1713 5.3.8 EFID - End File 1715 o-------------------------------------------------------------------o 1716 | EFID End File | 1717 | | 1718 | End File Phase Speaker ----> Listener | 1719 |-------------------------------------------------------------------| 1720 | Pos | Field | Description | Format | 1721 |-----+-----------+---------------------------------------+---------| 1722 | 0 | EFIDCMD | EFID Command, 'T' | F X(1) | 1723 | 1 | EFIDRCNT | Record Count | V 9(9) | 1724 | 10 | EFIDUCNT | Unit Count | V 9(12) | 1725 o-------------------------------------------------------------------o 1727 EFIDCMD Command Code Character 1729 Value: 'T' EFID Command identifier. 1731 EFIDRCNT Record Count Numeric(9) 1733 Maximum: 999999999 1735 For SSIDFMT 'F' or 'V' the exact record count. 1736 For SSIDFMT 'U' or 'T' zeros. 1738 The count will express the real size of the file (before 1739 compression, header not included). The total count is 1740 always used, even during restart processing. 1742 EFIDUCNT Unit Count Numeric(12) 1744 Maximum: 999999999999 1746 Exact number of units (octets) transmitted. 1748 The count will express the real size of the file. The 1749 total count is always used, even during restart processing. 1751 5.3.9 EFPA - End File Positive Answer 1753 o-------------------------------------------------------------------o 1754 | EFPA End File Positive Answer | 1755 | | 1756 | End File Phase Speaker <---- Listener | 1757 |-------------------------------------------------------------------| 1758 | Pos | Field | Description | Format | 1759 |-----+-----------+---------------------------------------+---------| 1760 | 0 | EFPACMD | EFPA Command, '4' | F X(1) | 1761 | 1 | EFPACD | Change Direction Indicator, (Y/N) | F X(1) | 1762 o-------------------------------------------------------------------o 1764 EFPACMD Command Code Character 1766 Value: '4' EFPA Command identifier. 1768 EFPACD Change Direction Indicator Character 1770 Value: 'N' Change direction not requested. 1771 'Y' Change direction requested. 1773 This parameter allows the Listener to request a Change 1774 Direction (CD) command from the Speaker. 1776 5.3.10 EFNA - End File Negative Answer 1778 o-------------------------------------------------------------------o 1779 | EFNA End File Negative Answer | 1780 | | 1781 | End File Phase Speaker <---- Listener | 1782 |-------------------------------------------------------------------| 1783 | Pos | Field | Description | Format | 1784 |-----+-----------+---------------------------------------+---------| 1785 | 0 | EFNACMD | EFNA Command, '5' | F X(1) | 1786 | 1 | EFNAREAS | Answer Reason | F 9(2) | 1787 o-------------------------------------------------------------------o 1789 EFNACMD Command Code Character 1791 Value: '5' EFNA Command identifier. 1793 EFNAREAS Answer Reason Numeric(2) 1795 Value: '01' Invalid filename. 1796 '02' Invalid destination. 1797 '03' Invalid origin. 1798 '04' Storage record format not supported. 1799 '05' Maximum record length not supported. 1801 '06' File size is too big. 1802 '10' Invalid record count. 1803 '11' Invalid byte count. 1804 '12' Access method failure. 1805 '13' Duplicate file. 1806 '99' Unspecified reason. 1808 Reason why transmission can not proceed. 1810 5.3.11 ESID - End Session 1812 o-------------------------------------------------------------------o 1813 | ESID End Session | 1814 | | 1815 | End Session Phase Speaker ----> Listener | 1816 |-------------------------------------------------------------------| 1817 | Pos | Field | Description | Format | 1818 |-----+-----------+---------------------------------------+---------| 1819 | 0 | ESIDCMD | ESID Command, 'F' | F X(1) | 1820 | 1 | ESIDREAS | Reason Code | F 9(2) | 1821 | 3 | ESIDCR | Carriage Return | F X(1) | 1822 o-------------------------------------------------------------------o 1824 ESIDCMD Command Code Character 1826 Value: 'F' ESID Command identifier. 1828 ESIDREAS Reason Code Numeric(2) 1830 Value '00' Normal session termination 1832 '01' Command not recognised 1834 An Exchange Buffer contains an invalid command code 1835 (1st octet of the buffer). 1837 '02' Protocol violation 1839 An Exchange Buffer contains an invalid command for 1840 the current state of the receiver. 1842 '03' User code not known 1844 A Start Session (SSID) command contains an unknown or 1845 invalid Identification Code. 1847 '04' Invalid password 1849 A Start Session (SSID) command contained an invalid 1850 password. 1852 '05' Local site emergency close down 1854 The local site has entered an emergency close down 1855 mode. Communications are being forcibly terminated. 1857 '06' Command contained invalid data 1859 A field within a Command Exchange buffer contains 1860 invalid data. 1862 '07' Exchange Buffer size error 1864 The length of the Exchange Buffer as determined by 1865 the Stream Transmission Header is different to the 1866 length implied by the Command Code. 1868 '08' Resources not available 1870 The request for connection has been denied due to a 1871 resource shortage. The connection attempt should be 1872 retried later. 1874 '09' Time out 1876 '10' Mode or capabilities incompatible 1878 '99' Unspecified Abort code 1880 An error was detected for which no specific code is 1881 defined. 1883 ESIDCR Carriage Return Character 1885 Value: Character with hex value '0D' or '8D'. 1887 5.3.12 CD - Change Direction 1889 o-------------------------------------------------------------------o 1890 | CD Change Direction | 1891 | | 1892 | Start File Phase Speaker ----> Listener | 1893 | End File Phase Speaker ----> Listener | 1894 | End Session Phase Initiator <---> Responder | 1895 |-------------------------------------------------------------------| 1896 | Pos | Field | Description | Format | 1897 |-----+-----------+---------------------------------------+---------| 1898 | 0 | CDCMD | CD Command, 'R' | F X(1) | 1899 o-------------------------------------------------------------------o 1901 CDCMD Command Code Character 1903 Value: 'R' CD Command identifier. 1905 5.3.13 EERP - End to End Response 1907 o-------------------------------------------------------------------o 1908 | EERP End to End Response | 1909 | | 1910 | Start File Phase Speaker ----> Listener | 1911 | End File Phase Speaker ----> Listener | 1912 |-------------------------------------------------------------------| 1913 | Pos | Field | Description | Format | 1914 |-----+-----------+---------------------------------------+---------| 1915 | 0 | EERPCMD | EERP Command, 'E' | F X(1) | 1916 | 1 | EERPDSN | Virtual File Dataset Name | V X(26) | 1917 | 27 | EERPRSV1 | Reserved | F X(9) | 1918 | 36 | EERPDATE | Virtual File Date stamp, (YYMMDD) | V X(6) | 1919 | 42 | EERPTIME | Virtual File Time stamp, (HHMMSS) | V X(6) | 1920 | 48 | EERPUSER | User Data | V X(8) | 1921 | 56 | EERPDEST | Destination | V X(25) | 1922 | 81 | EERPORIG | Originator | V X(25) | 1923 o-------------------------------------------------------------------o 1925 EERPCMD Command Code Character 1927 Value: 'E' EERP Command identifier. 1929 EERPDSN Virtual File Dataset Name String(26) 1931 Dataset name of the Virtual File being transferred, 1932 assigned by bilateral agreement. 1934 No general structure is defined for this attribute. 1936 A Virtual File is uniquely identified by its Name, Date and 1937 Time attributes which are only significant to the 1938 originating and final destinations. They must not be 1939 changed by any intermediate location. 1941 EERPRSV1 Reserved String(9) 1943 This field is reserved for future use. 1945 EERPDATE Virtual File Date stamp String(6) 1947 Format: 'YYMMDD' 6 decimal digits representing the year, month 1948 and day respectively [ISO-8601]. 1950 Date stamp assigned by the Virtual File's Originator 1951 indicating when the file was made available for 1952 transmission. 1954 A Virtual File is uniquely identified by its Name, Date and 1955 Time attributes which are only significant to the 1956 originating and final destinations. They must not be 1957 changed by any intermediate location. 1959 EERPTIME Virtual File Time stamp String(6) 1961 Format: 'HHMMSS' 6 decimal digits representing hours, minutes 1962 and seconds respectively [ISO-8601]. 1964 Time stamp assigned by the Virtual File's Originator 1965 indicating when the file was made available for 1966 transmission. 1968 A Virtual File is uniquely identified by its Name, Date and 1969 Time attributes which are only significant to the 1970 originating and final destinations. They must not be 1971 changed by any intermediate location. 1973 EERPUSER User Data String(8) 1975 May be used by the ODETTE-FTP in any way. If unused it 1976 should be initialised to spaces. It is expected that a 1977 bilateral agreement exists as to the meaning of the data. 1979 EERPDEST Destination String(25) 1981 Format: See Identification Code (Section 5.4) 1983 Originator of the Virtual File. 1985 This is the location that created (mapped) the data for 1986 transmission. 1988 EERPORIG Originator String(25) 1990 Format: See Identification Code (Section 5.4) 1992 Final Recipient of the Virtual File. 1994 This is the location that will look into the Virtual File 1995 content and perform mapping functions. It is also the 1996 location that creates the EERP for the received file. 1998 5.3.14 RTR - Ready To Receive 2000 o-------------------------------------------------------------------o 2001 | RTR Ready To Receive | 2002 | | 2003 | Start File Phase Initiator <---- Responder | 2004 | End File Phase Initiator <---- Responder | 2005 |-------------------------------------------------------------------| 2006 | Pos | Field | Description | Format | 2007 |-----+-----------+---------------------------------------+---------| 2008 | 0 | RTRCMD | RTR Command, 'P' | F X(1) | 2009 o-------------------------------------------------------------------o 2011 RTRCMD Command Code Character 2013 Value: 'P' RTR Command identifier. 2015 5.4 Identification Code 2017 The Initiator (sender) and Responder (receiver) participating in an 2018 ODETTE-FTP session are uniquely identified by an Identification Code 2019 based on [ISO 6523], Structure for the Identification of 2020 Organisations (SIO). The locations are considered to be adjacent for 2021 the duration of the transmission. 2023 The SIO has the following format. 2025 o-------------------------------------------------------------------o 2026 | Pos | Field | Description | Format | 2027 |-----+-----------+---------------------------------------+---------| 2028 | 0 | SIOOID | ODETTE Identifier | F X(1) | 2029 | 1 | SIOICD | International Code Designator | V 9(4) | 2030 | 5 | SIOORG | Organisation Code | V X(14) | 2031 | 19 | SIOCSA | Computer Sub-Address | V X(6) | 2032 o-------------------------------------------------------------------o 2033 SIOOID ODETTE Identifier Character 2035 Value: 'O' Indicates ODETTE assigned Organisation Identifier. 2036 Other values may be used for non-ODETTE codes. 2038 SIOICD International Code Designator String(4) 2040 A code forming part of the Organisation Identifier. 2042 SIOORG Organisation Code String(14) 2044 A code forming part of the Organisation Identifier. This 2045 field may contain the letters A to Z, the digits 0 to 9, 2046 apace and hyphen characters. 2048 SIOCSA Computer Sub-Address String(6) 2050 A locally assigned address which uniquely identifies a 2051 system within an organisation (defined by an Organisation 2052 Identifier). 2054 6. ODETTE-FTP Data Exchange Buffer 2056 6.1 Overview 2058 Virtual Files are transmitted by mapping the Virtual File records 2059 into Data Exchange Buffers, the maximum length of which was 2060 negotiated between the ODETTE-FTP entities via the Start Session 2061 (SSID) commands exchanged during the Start Session Phase of the 2062 protocol. The format is based on the Network Independent File 2063 Transfer Protocol [NIFTP]. 2065 Virtual File records may be of arbitrary length. A simple 2066 compression scheme is defined for strings of repeated characters. 2068 An example of the use of the Data Exchange Buffer can be found in 2069 Appendix A. 2071 6.2 Data Exchange Buffer Format 2073 For transmission of Virtual File records, data is divided into 2074 Subrecords, each of which is preceded by a one octet Subrecord 2075 Header. 2077 The Data Exchange Buffer is made up of the initial Command character, 2078 'D', followed by a series of headers and subrecords. 2080 o-------------------------------------------------------- 2081 | C | H | | H | | H | | / 2082 | M | D | SUBRECORD | D | SUBRECORD | D | SUBRECORD | /_ 2083 | D | R | | R | | R | | / 2084 o------------------------------------------------------- 2086 CMD 2088 The Data Exchange Buffer Command Character, 'D'. 2090 HDR 2092 A one octet Subrecord Header defined as follows: 2094 0 1 2 3 4 5 6 7 2095 o-------------------------------o 2096 | E | C | | 2097 | o | F | C O U N T | 2098 | R | | | 2099 o-------------------------------o 2101 Bits 2103 0 End of Record Flag 2105 Set to indicate that the next subrecord is the last 2106 subrecord of the current record. 2108 Unstructured files are transmitted as a single record, in 2109 this case the flag acts as an end of file marker. 2111 1 Compression Flag 2113 Set to indicate that the next subrecord is compressed. 2115 2-7 Subrecord Count 2117 The number of octets in the Virtual File represented by the 2118 next subrecord expressed as a binary value. 2120 For uncompressed data this is simply the length of the 2121 subrecord. 2123 For compressed data this is the number of times that the 2124 single octet in the following subrecord must be inserted in 2125 the Virtual File. 2127 As six bits are available, the next subrecord may 2128 represent between 0 and 63 octets of the Virtual File. 2130 6.3 Buffer Filling Rules 2132 An Exchange Buffer may be any length up to the value negotiated in 2133 the Start Session exchange. 2135 Virtual File records may be concatenated within one Exchange Buffer 2136 or split across a number of buffers. 2138 A subrecord is never split between two Exchange Buffers. If the 2139 remaining space in the current Exchange Buffer is insufficient to 2140 contain the next 'complete' subrecord one of the following strategies 2141 should be used: 2143 1. Truncate the Exchange Buffer, and put the complete 2144 subrecord (preceded by its header octet) in a new Exchange Buffer. 2146 2. Split the subrecord into two, filling the remainder of the 2147 Exchange Buffer with the first new subrecord and starting a new 2148 Exchange Buffer with the second. 2150 A record of length zero may appear anywhere in the Exchange Buffer. 2152 A subrecord of length zero may appear anywhere in the record and/or 2153 the Exchange Buffer. 2155 7. Stream Transmission Buffer (TCP only) 2157 7.1 Introduction 2159 The ODETTE-FTP was originally designed to utilise the ISO Network 2160 Service, specifically the X.25 specification. It relies on the fact 2161 that the network service will preserve the sequence and boundaries of 2162 data units transmitted through the network and that the network 2163 service will pass the length of the data unit to the receiving 2164 ODETTE-FTP. The TCP offers a stream based connection which does not 2165 meet these requirements. 2167 In order to utilise the TCP stream without disruption to the existing 2168 ODETTE-FTP a Stream Transmission Buffer (STB) is created by adding a 2169 Stream Transmission Header (STH) to the start of all Command and Data 2170 Exchange Buffers before they are passed to the TCP transport service. 2171 This allows the receiving ODETTE-FTP to recover the original Exchange 2172 Buffers. 2174 STH - Stream Transmission Header 2175 OEB - ODETTE-FTP Exchange Buffer 2177 The Stream Transmission Buffer comprises of a STH and OEB. 2179 o-----+-----------------+-----+--------------------+-----+------ 2180 | STH | OEB | STH | OEB | STH | OEB/ 2181 o-----+-----------------+-----+--------------------+-----+---- 2183 7.2 Stream Transmission Header Format 2185 The Stream Transmission Header is shown below. The fields are 2186 transmitted from left to right. 2188 0 1 2 3 2189 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2190 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2191 |Version| Flags | Length | 2192 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2194 Version 2196 Value: 0001 (binary) 2198 Stream Transmission Header version number. 2200 Flags 2202 Value: 0000 (binary) 2204 Reserved for future use. 2206 Length 2208 Range: 5 - 100003 (decimal) 2210 The length of the Stream Transmission Buffer (STH+OEB). 2212 The smallest STB is 5 octets consisting of a 4 octet header 2213 followed by a 1 octet Exchange Buffer such as a Change Direction 2214 (CD) command. 2216 The maximum Exchange Buffer length that can be negotiated is 99999 2217 octets (Section 5.3.2) giving a STB length of 100003. 2219 The length is expressed as a binary number with the most 2220 significant bit on the left. 2222 It is expected that implementations of this protocol will follow the 2223 Internet robustness principle of being conservative in what is sent 2224 and liberal in what is accepted. 2226 8. Protocol State Machine 2228 8.1 ODETTE-FTP State Machine 2230 The operation of an ODETTE-FTP entity is formally defined by the 2231 State Machine presented below. There are five State and Transition 2232 tables and for each table additional information is given in the 2233 associated Predicate and Action lists. 2235 The response of an ODETTE-FTP entity to the receipt of an event is 2236 defined by a Transition table entry indexed by the Event/State 2237 intersection within the appropriate State table. 2239 Each Transition table entry defines the actions taken, events 2240 generated and new state entered. Predicates may be used within a 2241 table entry to select the correct response on the basis of local 2242 information held by the entity. 2244 A transition table contains the following fields: 2246 Index(I) State transition index. 2248 Predicate A list of predicates used to select between different 2249 possible transitions. The predicates are defined in the 2250 Predicate and Action list. 2252 Actions A list of actions taken by the entity. The actions are 2253 defined in the Predicate and Action list. 2255 Events Output events generated by the entity 2257 Next State The new state of the entity. 2259 8.2 Error Handling 2261 The receipt of an event in a given state may be invalid for three 2262 reasons. 2264 1. The case is impossible by construction of the state automata, 2265 denoted 'X' in the State tables. For example a timer which has 2266 not been set cannot run out. 2268 2. The event is the result of an error in the Network Service 2269 implementation, also denoted 'X' in the state tables. The 2270 Network Service implementation is considered to be correct. 2272 3. For all other cases the event is considered to be a User Error, 2273 denoted "U" in the state tables. 2275 The State tables define the conditions under which a User event is 2276 valid, thus preventing the generation of a protocol error by the 2277 ODETTE-FTP entity as a result of a User Monitor error. The reaction 2278 of the entity to such errors is undefined and regarded as a local 2279 implementation issue. 2281 The State tables also allow protocol errors due to the receipt of 2282 invalid Exchange Buffers, to be detected. In such cases the reaction 2283 of the entity to the error is defined. 2285 8.3 States 2287 The Command Mode is strictly a Half Duplex Flip-Flop Mode. 2289 A_NC_ONLY Responder, Network Connection opened 2291 The Responder has sent it's Ready Message (SSRM) and is 2292 waiting for Start Session (SSID) from the Initiator. 2294 A_WF_CONRS Responder Waiting for F_CONNECT_RS 2296 The Responder has received the Initiator's Start Session 2297 (SSID) and is waiting for a response (F_CONNECT_RS) from 2298 it's User Monitor. 2300 CDSTWFCD CD_RQ stored in WF_CD state 2302 Since the User Monitor doesn't see the WF_CD state it may 2303 send a Change Direction request (F_CD_RQ) before the 2304 ODETTE-FTP receives a Change Direction (CD) command. 2306 CLIP Close Input Pending 2308 The Listener has received an End File (EFID) command and 2309 is waiting for the Close File response (F_CLOSE_FILE_RS) 2310 from it's User Monitor. 2312 CLOP Close Out Pending 2314 The Speaker has sent an End File (EFID) command and is 2315 waiting for an End File Answer (EFPA or EFNA). 2317 ERSTWFCD End to End Response stored in WF_CD state 2319 Since the User Monitor doesn't see the WF_CD state it may 2320 send F_EERP_RQ, before the ODETTE-FTP receives a Change 2321 Direction (CD) command. 2323 IDLE Connection IDLE 2325 IDLELI Idle Listener 2327 IDLELICD Idle Listener, F_CD_RQ Received 2329 The ODETTE-FTP entity has become the Listener after 2330 receiving a Change Direction request (F_CD_RQ) from the 2331 User Monitor. The receipt of an End Session (ESID) is 2332 valid in this state. 2334 IDLESP Idle Speaker 2336 IDLESPCD Idle Speaker, F_CD_IND Sent 2338 The ODETTE-FTP entity has sent a Change Direction 2339 indication (F_CD_IND) to the User Monitor. A Change 2340 Direction request (F_CD_RQ) is invalid in this state. 2342 I_WF_NC Initiator Waiting for Network Connection 2344 The Initiator has requested a new network connection and 2345 is waiting for a Connection confirmation (N_CON_CF) from 2346 the Network Service. 2348 I_WF_RM Initiator Waiting for Ready Message 2350 Before sending Start Session (SSID), the Initiator must 2351 wait for a Ready Message (SSRM) from the Responder. 2353 I_WF_SSID Initiator Waiting for SSID 2355 The Initiator has sent a Start Session (SSID) command and 2356 is waiting for Start Session from the Responder. 2358 OPI Open Input (Data Transfer Phase) 2360 The Listener is waiting for the Speaker to send a Data 2361 Exchange buffer. 2363 OPIP Open Input Pending 2365 The Listener has received a Start File (SFID) command and 2366 is waiting for the Start File response (F_START_FILE_RS) 2367 from it's User Monitor. 2369 OPO Open Out (Data Transfer Phase) 2371 The Speaker has received a Start File Positive Answer 2372 (SFPA) and is waiting for a Data (F_DATA_RQ) or Close 2373 File (F_CLOSE_FILE) request from it's User Monitor. 2375 OPOP Open Out Pending 2377 The Speaker has sent a Start File (SFID) command and is 2378 waiting for a Start File Answer (SFPA or SFNA). 2380 OPOWFC Open Out Wait for Credit 2382 The Speaker is waiting for a Set Credit (CDT) command 2383 before sending further Data Exchange buffers. 2385 SFSTWFCD Start File Request stored in WF_CD state. 2387 Since the User Monitor doesn't see the WF_CD state it may 2388 send a Start File request (F_START_FILE_RQ) before the 2389 ODETTE-FTP receives a Change Direction (CD) command. 2391 WF_CD Wait for Change Direction 2393 The Listener wishes to become the Speaker and is waiting 2394 for a Change Direction (CD) command after sending an End 2395 File Positive Answer (EFPA) requesting change direction. 2397 WF_RTR Wait for Ready To Receive 2399 The Initiator has sent an End to End Response (EERP) 2400 command and must wait for Ready To Receive (RTR) from the 2401 Responder. 2403 WF_NDISC Wait for N_DISC_IND 2405 ODETTE-FTP has sent an End Session (ESID) command and is 2406 waiting for a Disconnection indication (N_DISC_IND) from 2407 the Network Service. 2409 8.4 Input Events 2411 User Monitor Input Events (Section 3) 2413 F_DATA_RQ F_CONNECT_RQ F_START_FILE_RQ F_CLOSE_FILE_RQ 2414 F_EERP_RQ F_CONNECT_RS F_START_FILE_RS(+) F_CLOSE_FILE_RS(+) 2415 F_CD_RQ F_ABORT_RQ F_START_FILE_RS(-) F_CLOSE_FILE_RS(-) 2416 F_RELEASE_RQ 2418 Network Input Events (Section 2.2) 2420 N_CON_IND N_CON_CF N_DATA_IND N_DISC_IND N_RST_IND 2422 Peer ODETTE-FTP Input Events (Section 4) 2424 SSID SFID SFPA SFNA EFID EFPA EFNA 2425 DATA ESID EERP RTR CD CDT SSRM 2427 Internal Input Events 2429 TIME-OUT - Internal ODETTE-FTP timer expires. 2431 Input event parameters are denoted I.Event-name.Parameter-name within 2432 the state table action and predicate lists. Their value can be 2433 examined but not changed by the ODETTE-FTP entity. 2435 8.5 Output Events 2437 User Monitor Output Events (Section 3) 2439 F_DATA_IND F_CONNECT_IND F_START_FILE_IND F_CLOSE_FILE_IND 2440 F_EERP_IND F_CONNECT_CF F_START_FILE_CF(+) F_CLOSE_FILE_CF(+) 2441 F_CD_IND F_ABORT_IND F_START_FILE_CF(-) F_CLOSE_FILE_CF(-) 2442 F_RELEASE_IND 2444 Network Output Events (Section 2.2) 2446 N_CON_RQ N_CON_RS N_DATA_RQ N_DISC_RQ 2448 Peer ODETTE-FTP Output Events (Section 4) 2450 SSID SFID SFPA SFNA EFID EFPA EFNA 2451 DATA ESID EERP RTR CD CDT SSRM 2453 Output event parameters are denoted O.Event-name.Parameter-name 2454 within the state table action and predicate lists. Their values can 2455 be examined and changed by the ODETTE-FTP entity. 2457 8.6 Local Variables 2459 The following variables are maintained by the ODETTE-FTP entity to 2460 assist the operation of the protocol. They are denoted 2461 V.Variable-name within the state table action and predicate lists. 2462 Their value can be examined and changed by the ODETTE-FTP entity. 2463 The initial value of each variable is undefined. 2465 Variable Type Comments 2466 --------------------------------------------------------------------- 2467 Buf-size Integer Negotiated Exchange Buffer size. 2468 Called-addr Address Used to build O.F_CONNECT_IND.Called-addr 2469 Calling-addr Address To build O.F_CONNECT_IND.Calling-addr 2470 Compression Yes/No Compression in used as agreed. 2471 Credit_L Integer Listeners credit counter. 2472 Credit_S Integer Speaker's credit counter. 2473 Id String Used to build O.SSID.Id 2474 Mode Sender-only, Receiver-only, Both. 2475 Pswd String Password, used to build O.SSID.Pswd 2476 Req-buf Primitive Input event (F_XXX_RQ) stored in WF_CD state. 2477 Restart Yes/No Restart in used as agreed. 2478 Restart-pos Integer Used only during file opening. 2479 Window Integer The Credit value negotiated for the session. 2480 --------------------------------------------------------------------- 2482 8.7 Local Constants 2484 The following constants define the capabilities of a given ODETTE-FTP 2485 entity. They are denoted C.Constant-name within the state table 2486 action and predicate lists. Their value can be examined but not 2487 changed by the ODETTE-FTP entity. 2489 Constant Value Comments 2490 --------------------------------------------------------------------- 2491 Cap-compression Yes/No Compression supported? 2492 Cap-init Initiator Must be Initiator. 2493 Responder Must be Responder. 2494 Both Can be Initiator or Responder. 2495 Cap-mode Sender-only Must be sender. 2496 Receiver-only Must be receiver. 2497 Both Can be sender or receiver. 2498 Max-buf-size 127 < Int < 100000 Maximum buffer size supported. 2499 Max-window Int < 1000 Local maximum credit value. 2500 --------------------------------------------------------------------- 2502 8.8 Session Connection State Table 2504 8.8.1 State Table 2506 o----------------------------------------------o 2507 | | Other States | 2508 | |--------------------------------------o | 2509 | S | A_WF_CONRS | | 2510 | |----------------------------------o | | 2511 | T | A_NC_ONLY | | | 2512 | |------------------------------o | | | 2513 | A | I_WF_SSID | | | | 2514 | |--------------------------o | | | | 2515 | T | I_WF_RM | | | | | 2516 | |----------------------o | | | | | 2517 | E | I_WF_NC | | | | | | 2518 | |------------------o | | | | | | 2519 | | IDLE | | | | | | | 2520 |==================o---+---+---+---+---+---+---| 2521 | | F_CONNECT_RQ | A | X | X | X | X | X | X | 2522 | |--------------+---+---+---+---+---+---+---| 2523 | E | N_CON_CF | X | C | X | X | X | X | X | 2524 | |--------------+---+---+---+---+---+---+---| 2525 | V | SSRM | X | X | H | X | X | X | X | 2526 | |--------------+---+---+---+---+---+---+---| 2527 | E | SSID | X | X | X | D | E | F | F | 2528 | |--------------+---+---+---+---+---+---+---| 2529 | N | N_CON_IND | B | X | X | X | X | X | X | 2530 | |--------------+---+---+---+---+---+---+---| 2531 | T | F_CONNECT_RS | X | U | U | U | U | G | U | 2532 | |--------------+---+---+---+---+---+---+---| 2533 | | ESID(R=10) | X | X | X | F | X | X | X | 2534 o----------------------------------------------o 2536 8.8.2 Transition Table 2538 I | Predicate Actions Output Events Next State 2539 ===o================================================================= 2540 A | P1: F_ABORT_IND IDLE 2541 | not P1: 1 N_CON_RQ I_WF_NC 2542 ---+----------------------------------------------------------------- 2543 B | P3: N_DISC_RQ IDLE 2544 | not P3: N_CON_RS 2545 | SSRM A_NC_ONLY 2546 ---+----------------------------------------------------------------- 2547 C | 2 I_WF_RM 2548 ---+----------------------------------------------------------------- 2549 Continued --> 2551 I | Predicate Actions Output Events Next State 2552 ===o================================================================= 2553 D | P2: 4,2,5 F_CONNECT_CF IDLESP 2554 | not P2: 4,2 ESID(R=10) 2555 | F_ABORT_IND(R,AO=L) WF_NDISC 2556 ---+----------------------------------------------------------------- 2557 E | P4: 4 N_DISC_RQ IDLE 2558 | not P4: F_CONNECT_IND A_WF_CONRS 2559 ---+----------------------------------------------------------------- 2560 F | F_ABORT_IND 2561 | N_DISC_RQ IDLE 2562 ---+----------------------------------------------------------------- 2563 G | P2: 4,2,5 SSID IDLELI 2564 | not P2: 4,2 ESID(R=10) 2565 | F_ABORT_IND(R,AO=L) WF_NDISC 2566 ---+----------------------------------------------------------------- 2567 H | 4,2,3 SSID I_WF_SSID 2568 --------------------------------------------------------------------- 2570 8.8.3 Predicates and Actions. 2572 Predicate P1: (No resources available) OR 2573 (C.Cap-init = Responder) OR 2574 (C.Cap-mode = Sender-only AND 2575 I.F_CONNECT_RQ.Mode = Receiver-only) OR 2576 (C.Cap-mode = Receiver-only AND 2577 I.F_CONNECT_RQ.Mode = Sender-only) 2579 Predicate P2: Negotiation of (Buf-size, Restart, Compression, 2580 Mode, Credit) is OK. 2582 Predicate P3: C.Cap-init = Initiator 2584 Predicate P4: Mode in SSID incompatible with C.Cap-mode 2586 Action 1: Set V.Mode from (C.Cap-mode, I.F_CONNECT_RQ.Mode) 2587 Set V.Pswd, V.Id, V.Restart from I.F_CONNECT_RQ 2588 Set V.Buf-size = C.Max-buf-size 2589 Set V.Compression = C.Cap-compression 2590 Build O.N_CON_RQ 2592 Action 2: Start inactivity timer 2594 Action 3: Set parameters in O.SSID = from local variables 2596 Action 4: Stop timer 2598 Action 5: Set V.Mode, V.Restart, V.Compression, V.Buf-size, 2599 V.Window = from SSID 2601 8.9 Error and Abort State Table 2603 8.9.1 State Table 2605 o--------------------------------------o 2606 | | Other States | 2607 | S |------------------------------o | 2608 | T | WF_NDISC | | 2609 | A |--------------------------o | | 2610 | T | I_WF_NC | | | 2611 | E |----------------------o | | | 2612 | | IDLE | | | | 2613 |======================o---+---+---+---| 2614 | | TIME-OUT | X | X | A | B | 2615 | |------------------+---+---+---+---| 2616 | E | F_ABORT_RQ | X | A | X | C | 2617 | V |------------------+---+---+---+---| 2618 | E | N_RST_IND | X | X | A | D | 2619 | N |------------------+---+---+---+---| 2620 | T | N_DISC_IND | X | E | F | G | 2621 | |------------------+---+---+---+---| 2622 | | Invalid Buffer | X | X | H | I | 2623 o--------------------------------------o 2625 8.9.2 Transition Table 2627 I | Predicate Actions Output Events Next State 2628 ===o================================================================= 2629 A | N_DISC_RQ IDLE 2630 ---+----------------------------------------------------------------- 2631 B | F_ABORT_IND 2632 | N_DISC_RQ IDLE 2633 ---+----------------------------------------------------------------- 2634 C | 1 N_DISC_RQ IDLE 2635 ---+----------------------------------------------------------------- 2636 D | 1 N_DISC_RQ 2637 | F_ABORT_IND IDLE 2638 ---+----------------------------------------------------------------- 2639 E | F_ABORT_IND IDLE 2640 ---+----------------------------------------------------------------- 2641 F | 1 IDLE 2642 ---+----------------------------------------------------------------- 2643 G | 1 F_ABORT_IND IDLE 2644 ---+----------------------------------------------------------------- 2645 H | WF_NDISC 2646 ---+----------------------------------------------------------------- 2647 I | 1,2 ESID(R=01) 2648 | F_ABORT_IND(R,AO=L) WF_NDISC 2649 --------------------------------------------------------------------- 2651 8.9.3 Predicates and Actions. 2653 Action 1: Stop inactivity timer 2655 Action 2: Start inactivity timer 2657 8.10 Speaker State Table 1 2659 8.10.1 State Table 2661 The following abbreviations are used in the Speaker State table. 2663 F_REL_RQ(Ok) - F_RELEASE_RQ Reason = Normal 2664 F_REL_RQ(Err) - F_RELEASE_RQ Reason = Error 2666 o------------------------------------------------------------------o 2667 | | Other State | 2668 | |----------------------------------------------------------o | 2669 | | WF_NDISC | | 2670 | |------------------------------------------------------o | | 2671 | | OPOWFC | | | 2672 | |--------------------------------------------------o | | | 2673 | | OPO | | | | 2674 | S |----------------------------------------------o | | | | 2675 | | OPOP | | | | | 2676 | T |------------------------------------------o | | | | | 2677 | | CDSTWFCD | | | | | | 2678 | A |--------------------------------------o | | | | | | 2679 | | SFSTWFCD | | | | | | | 2680 | T |----------------------------------o | | | | | | | 2681 | | ERSTWFCD | | | | | | | | 2682 | E |------------------------------o | | | | | | | | 2683 | | WF_CD | | | | | | | | | 2684 | |--------------------------o | | | | | | | | | 2685 | | WF_RTR | | | | | | | | | | 2686 | |----------------------o | | | | | | | | | | 2687 | | IDLESPCD | | | | | | | | | | | 2688 | |------------------o | | | | | | | | | | | 2689 | | IDLESP | | | | | | | | | | | | 2690 |===+==============o---+---+---+---+---+---+---+---+---+---+---+---| 2691 | | F_EERP_RQ | A | A | W | F | W | U | U | U | U | U | U | U | 2692 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2693 | | F_START_ | B | B | W | G | W | U | U | U | U | U | X | U | 2694 | | FILE_RQ | | | | | | | | | | | | | 2695 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2696 | | SFPA | C | C | C | C | C | C | C | K | C | C | S | C | 2697 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2698 | E | SFNA | C | C | C | C | C | C | C | L | C | C | S | C | 2699 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2700 | V | CD | C | C | C | H | R | I | J | C | C | C | S | C | 2701 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2702 | E | F_DATA_RQ | U | U | U | U | U | U | U | U | M | V | S | U | 2703 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2704 | N | CDT | C | C | C | C | C | C | C | C | P | O | S | C | 2705 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2706 | T | F_CD_RQ | D | U | W | T | W | U | U | U | U | U | X | U | 2707 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2708 | | F_REL_RQ(Ok) | U | E | U | U | U | U | U | U | U | U | X | U | 2709 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2710 | | F_REL_RQ(Err)| Q | Q | Q | Q | Q | Q | Q | Q | Q | Q | S | Q | 2711 | |--------------+---+---+---+---+---+---+---+---+---+---+---+---| 2712 | | RTR | C | C | N | C | C | C | C | C | C | C | S | C | 2713 o------------------------------------------------------------------o 2715 8.10.2 Transition Table 2717 I | Predicate Actions Output Events Next State 2718 ===o================================================================= 2719 A | 1,2,3 EERP WF_RTR 2720 ---+----------------------------------------------------------------- 2721 B | P1: UE 2722 | not P1: 1,2,5 SFID OPOP 2723 ---+----------------------------------------------------------------- 2724 C | 1,2 ESID(R=02) 2725 | F_ABORT_IND(R,AO=L) WF_NDISC 2726 ---+----------------------------------------------------------------- 2727 D | 1,2 CD IDLELICD 2728 ---+----------------------------------------------------------------- 2729 E | 1,2 ESID(R=00) WF_NDISC 2730 ---+----------------------------------------------------------------- 2731 F | 4 ERSTWFCD 2732 ---+----------------------------------------------------------------- 2733 G | P1: UE 2734 | not P1: 6 SFSTWFCD 2735 ---+----------------------------------------------------------------- 2736 H | 1,2 IDLESP 2737 ---+----------------------------------------------------------------- 2738 I | 1,2,10 SFID OPOP 2739 ---+----------------------------------------------------------------- 2740 J | 1,2 CD IDLELICD 2741 ---+----------------------------------------------------------------- 2742 K | P2: 1,2 ESID(R=02) 2743 | F_ABORT_IND(R,AO=L) WF_NDISC 2744 | not P2: 1,2,7,12 F_START_FILE_CF(+) OPO 2745 ---+----------------------------------------------------------------- 2746 L | 1,2,8 F_START_FILE_CF(-) IDLESP 2747 ---+----------------------------------------------------------------- 2748 M | P3: 1,2,11,13 DATA OPOWFC 2749 | not P3: 1,2,11,13 DATA OPO 2750 ---+----------------------------------------------------------------- 2751 N | Note 3 IDLESP 2752 ---+----------------------------------------------------------------- 2753 O | 12 OPO 2754 | See Note 1 2755 ---+----------------------------------------------------------------- 2756 P | Protocol 1,2 ESID(R=02) 2757 | Error F_ABORT_IND(R,AO=L) WF_NDISC 2758 ---+----------------------------------------------------------------- 2759 Q | 1,2 ESID(R) WF_NDISC 2760 ---+----------------------------------------------------------------- 2761 R | 1,2,9 EERP WF_RTR 2762 ---+----------------------------------------------------------------- 2763 Continued --> 2765 I | Predicate Actions Output Events Next State 2766 ===o================================================================= 2767 S | WF_NDISC 2768 ---+----------------------------------------------------------------- 2769 T | CDSTWFCD 2770 ---+----------------------------------------------------------------- 2771 U | User Error UE 2772 ---+----------------------------------------------------------------- 2773 V | User Error - Note 1 UE 2774 ---+----------------------------------------------------------------- 2775 W | User Error - Note 2 UE 2776 ---+----------------------------------------------------------------- 2777 X | Error 2778 --------------------------------------------------------------------- 2780 8.10.3 Predicates and Actions. 2782 Predicate P1: (I.F_START_FILE_RQ.Restart-pos > 0) AND 2783 ((V.Restart = No) OR (V.Mode = Receiver-only)) 2785 Note: Restart requested and not supported for this session. 2787 Predicate P2: (I.SFPA.Restart-pos > V.Restart-pos) 2789 Note: Protocol error due to the restart position in the 2790 SFPA acknowledgement being greater than the position 2791 requested in the SFID request. 2793 Predicate P3: V.Credit_S - 1 = 0 2795 Note: Speaker's Credit is exhausted. 2797 Action 1: Stop inactivity timer 2799 Action 2: Start inactivity timer 2801 Action 3: Build an EERP from F_EERP_RQ 2803 Action 4: Store F_EERP_RQ in V.Req-buf 2805 Action 5: Build SFID from F_START_FILE_RQ 2806 V.Restart-pos = I.F_START_FILE_RQ.Restart-pos 2808 Action 6: Store F_START_FILE_RQ in V.Req-buf 2810 Action 7: Build F_START_FILE_CF(+) from I.SFPA 2812 Action 8: Build F_START_FILE_CF(-) from I.SFNA 2813 Action 9: Build EERP from F_EERP_RQ stored in V.Req-buf 2815 Action 10: Build SFID from F_START_FILE_RQ stored in V.Req-buf 2816 Set V.Restart-pos 2818 Action 11: Build Exchange Buffer 2820 Action 12: V.Credit_S = V.Window 2822 Action 13: V.Credit_S = V.Credit_S - 1 2824 Note 1: The OPOWFC state prevents the Speaker from sending 2825 data buffers because it is waiting for credit. The 2826 ODETTE-FTP entity may need to control the flow of Data 2827 requests (F_DATA_RQ) from it's User Monitor to protect 2828 it's own buffers. Any such mechanism and the 2829 behaviour of the entity should a User Error occur are 2830 regarded as local implementation issues. 2832 Note 2: The choice to accept this "Request/Event" while in 2833 this state is a matter of local implementation. The 2834 ODETTE state tables are based on the assumption that 2835 this event cannot occur in this state and is 2836 considered to be a user error (UE). 2838 Note 3: It is a local matter to make the User Monitor aware 2839 that since the RTR is received, the protocol machine 2840 is now ready to accept the next request. 2842 8.11 Speaker State Table 2 2844 8.11.1 State Table 2846 o---------------------------------o 2847 | S | CLOP | 2848 | T |-------------------------o | 2849 | A | OPOWFC | | 2850 | T |---------------------o | | 2851 | E | OPO | | | 2852 |=====================o---+---+---| 2853 | E | F_CLOSE_FILE_RQ | A | E | U | 2854 | V |-----------------+---+---+---| 2855 | E | EFPA | B | B | C | 2856 | N |-----------------+---+---+---| 2857 | T | EFNA | B | B | D | 2858 o---------------------------------o 2860 8.11.2 Transition Table 2862 I | Predicate Actions Output Events Next State 2863 ===o================================================================= 2864 A | 1,2,5,7 EFID CLOP 2865 ---+----------------------------------------------------------------- 2866 B | 1,2 ESID(R=02) 2867 | F_ABORT_IND(R,AO=L) WF_NDISC 2868 ---+----------------------------------------------------------------- 2869 C | P1: 1,2,3 F_CLOSE_FILE_CF(+,SP=No) 2870 | CD IDLELI 2871 | not P1: 1,2,4 F_CLOSE_FILE_CF(+,SP=Yes) IDLESP 2872 ---+----------------------------------------------------------------- 2873 D | 1,2,6 F_CLOSE_FILE_CF(-) IDLESP 2874 ---+----------------------------------------------------------------- 2875 E | See Note 1 2876 ---+----------------------------------------------------------------- 2877 U | User Error UE 2878 --------------------------------------------------------------------- 2880 8.11.3 Predicates and Actions. 2882 Predicate P1: (I.EFPA.CD-Request = Yes) AND (V.Mode = Both) 2884 Action 1: Stop inactivity timer 2886 Action 2: Start inactivity timer 2888 Action 3: O.F_CLOSE_FILE_CF(+).Speaker = No 2890 Action 4: O.F_CLOSE_FILE_CF(+).Speaker = Yes 2892 Action 5: Build EFID from F_CLOSE_FILE_RQ 2894 Action 6: Build F_CLOSE_FILE_CF(-) from EFNA 2896 Action 7: Set V.Credit_S = 0 2898 Note 1: In order to respect the "half duplex" property of 2899 ODETTE-FTP it is forbidden to send EFID while in the 2900 OPOWFC state. EFID can be sent only in the OPO state. 2902 The ODETTE-FTP implementation must avoid sending EFID 2903 (or receiving F_CLOSE_FILE_RQ) while in the OPOWFC 2904 state. 2906 8.12 Listener State Table 2908 8.12.1 State Table 2910 o-----------------------------------------o 2911 | | CLIP | 2912 | |---------------------------------o | 2913 | | OPI | | 2914 | S |-----------------------------o | | 2915 | T | OPIP | | | 2916 | A |-------------------------o | | | 2917 | T | IDLELICD | | | | 2918 | E |---------------------o | | | | 2919 | | IDLELI | | | | | 2920 |=====================o---+---+---+---+---| 2921 | | SFID | A | A | B | B | B | 2922 | |-----------------+---+---+---+---+---| 2923 | E | DATA | B | B | B | I | B | 2924 | V |-----------------+---+---+---+---+---| 2925 | E | EFID | B | B | B | J | B | 2926 | N |-----------------+---+---+---+---+---| 2927 | T | F_START_FILE_RS | U | U | H | U | U | 2928 | |-----------------+---+---+---+---+---| 2929 | | F_CLOSE_FILE_RS | U | U | U | U | K | 2930 | |-----------------+---+---+---+---+---| 2931 | | CD | C | B | B | B | B | 2932 | |-----------------+---+---+---+---+---| 2933 | | ESID R=Normal | D | F | D | D | D | 2934 | |-----------------+---+---+---+---+---| 2935 | | ESID R=Error | D | D | D | D | D | 2936 | |-----------------+---+---+---+---+---| 2937 | | EERP | E | G | B | B | B | 2938 o-----------------------------------------o 2940 8.12.2 Transition Table 2942 I | Predicate Actions Output Events Next State 2943 ===o================================================================= 2944 A | P1: 1,2 ESID(R=02) 2945 | F_ABORT_IND(R,AO=L) WF_NDISC 2946 | not P1: 1,2,3 F_START_FILE_IND OPIP 2947 ---+----------------------------------------------------------------- 2948 B | 1,2 ESID(R=02) 2949 | F_ABORT_IND(R,AO=L) WF_NDISC 2950 ---+----------------------------------------------------------------- 2951 C | 1,2 F_CD_IND IDLESPCD 2952 ---+----------------------------------------------------------------- 2953 Continued --> 2955 I | Predicate Actions Output Events Next State 2956 ===o================================================================= 2957 D | 1 F_ABORT_IND(Received 2958 | ESID Reason,AO=D) 2959 | N_DISC_RQ IDLE 2960 ---+----------------------------------------------------------------- 2961 E | 4 F_EERP_IND 2962 | 8 See Note 2 2963 | RTR IDLELI 2964 ---+----------------------------------------------------------------- 2965 F | 1 F_RELEASE_IND 2966 | N_DISC_RQ IDLE 2967 ---+----------------------------------------------------------------- 2968 G | F_EERP_IND 2969 | 8 See Note 2 2970 | RTR IDLELI 2971 ---+----------------------------------------------------------------- 2972 H | P4: User Error UE 2973 | P2,not P4: 1,2 SFPA OPI 2974 | not(P2,P4): 1,2 SFNA IDLELI 2975 ---+----------------------------------------------------------------- 2976 I | P5: 1,2 ESID(R=02) 2977 | F_ABORT_IND(R,A0=L) WF_NDISC 2978 | not(P5,P6): 1,2,5 F_DATA_IND OPI 2979 | not P5,P6: 1,2 F_DATA_IND 2980 | 6,7 See Note 1 2981 | CDT OPI 2982 ---+----------------------------------------------------------------- 2983 J | 1,2 F_CLOSE_FILE_IND CLIP 2984 ---+----------------------------------------------------------------- 2985 K | P2,P3: 1,2 EFPA(CD-Req) WF_CD 2986 | P2,not P3: 1,2 EFPA(no CD) IDLELI 2987 | not P2: 1,2 EFNA IDLELI 2988 ---+----------------------------------------------------------------- 2989 U | User Error UE 2990 --------------------------------------------------------------------- 2992 8.12.3 Predicates and Actions. 2994 Predicate P1: (I.SFID.Restart-pos > 0) AND (V.Restart = No) 2996 Note: Invalid Start File command 2998 Predicate P2: Positive Response 3000 Predicate P3: I.F_CLOSE_FILE_RS(+).Speaker = Yes 3002 Predicate P4: I.F_START_FILE_RS(+).Restart-pos > V.Restart 3003 Predicate P5: V.Credit_L - 1 < 0 3005 Note: Protocol Error because the Speaker has exceeded it's 3006 available transmission credit. 3008 Predicate P6: V.Credit_L - 1 = 0 3010 Note: The Speaker's credit must be reset before it can send 3011 further Data Exchange buffers. 3013 Action 1: Stop inactivity timer. 3015 Action 2: Start inactivity timer 3017 Action 3: Build F_START_FILE_IND from I.SFID 3018 V.Restart-pos = I.SFID.Restart-pos 3020 Action 4: Build F_EERP_IND from I.EERP 3022 Action 5: V.Credit_L = V.Credit_L - 1 3024 Action 6: Wait for sufficient resources to receive up to 3025 V.Window Data Exchange Buffers. 3027 Action 7: V.Credit_L = V.Window 3029 Action 8: Wait for resources required to process a new EERP. 3031 Note 1: Flow control in case of reception. 3033 The ODETTE-FTP Listener must periodically send new 3034 credit to the Speaker. The timing of this operation 3035 will depend on: 3037 1. The User Monitor's capacity the receive data. 3038 2. The number of buffers available to ODETTE-FTP. 3039 3. The Speaker's available credit, which must be 3040 equal to zero. 3042 Note 2: Generally, the ODETTE-FTP Listener will send RTR 3043 immediately after receiving EERP. If required, it can 3044 delay the RTR until the resources required to process 3045 a new EERP are available. 3047 8.13 Example 3049 Consider an ODETTE-FTP entity that has sent a Start File (SFID) 3050 command and entered the Open Out Pending (OPOP) state. It's response 3051 on receiving a Positive Answer (SFPA) is documented in Speaker State 3052 Table 1 which shows that transition 'K' should be applied and is 3053 interpreted as follows: 3055 if (I.SFPA.Restart-pos > V.Restart-pos) then 3056 begin // invalid restart 3057 Actions: Stop inactivity timer, // reset timer 3058 Start inactivity timer; 3059 Output: ESID(R=02), // to peer ODETTE-FTP 3060 F_ABORT_IND(R,AO=L); // to user monitor 3061 New State: WF_NDISC; 3062 end 3063 else begin 3064 Actions: Stop inactivity timer, // reset timer 3065 Start inactivity timer; 3066 Build F_START_FILE_CF(+) from I.SFPA 3067 V.Credit_S = V.Window // initialise credit 3068 Output: F_START_FILE_CF(+); // to user monitor 3069 New State: OPO; 3070 end 3072 The ODETTE-FTP checks the restart position in the received Start File 3073 Positive Answer (SFPA) command. If it is invalid it aborts the 3074 session by sending an End Session (ESID) command to it's peer and an 3075 Abort indication (F_ABORT_IND) to it's User Monitor. If the restart 3076 position is valid a Start File confirmation (F_START_FILE_CF) is 3077 built and sent to the User Monitor, the credit window is initialised 3078 and the Open Out (OPO) state is entered. 3080 Appendix A. Virtual File Mapping Example 3082 This example demonstrates the mapping of a Virtual File into a 3083 sequence of ODETTE-FTP Data Exchange Buffers and shows how each 3084 Stream Transmission Buffer is built from an ODETTE-FTP Data Exchange 3085 Buffer prefixed by a Stream Transmission Header. 3087 Each line in this extract from 'The Hunting of the Snark' by Lewis 3088 Carroll [SNARK] is considered to be a separate record in a file 3089 containing variable length records. Note that it does not represent 3090 a text file and CR/LF record separators are not used. The blank line 3091 is represented by a zero length record. 3093 "It's a Snark!" was the sound that first came to their ears, 3094 And seemed almost too good to be true. 3095 Then followed a torrent of laughter and cheers: 3096 Then the ominous words "It's a Boo-" 3098 Then, silence. Some fancied they heard in the air 3099 A weary and wandering sigh 3100 Then sounded like "-jum!" but the others declare 3101 It was only a breeze that went by. 3103 Assuming that the minimum exchange buffer length of 128 octets has 3104 been negotiated the result of mapping the text into Stream 3105 Transmission Buffers may be as follows. 3107 Stream Transmission Buffer 1 3109 Text : ....D."It' s a Snark! " was the sound that first cam 3110 Hex-H : 10084B2472 7262566762 2276727662 7676627667 2667772666 3111 Hex-L : 00044C2947 30103E12B1 2071304850 3F5E404814 069234031D 3112 Key : ----D!.... .......... .......... .......... .......... 3114 Text : e to their ears,. .A nd seemed almost too good to b 3115 Hex-H : 6276276667 26677242A4 6627666662 6666772766 2666627626 3116 Hex-L : 504F048592 05123C5061 E40355D540 1CDF3404FF 07FF404F02 3117 Key : .......... ......!.!. .......... .......... .......... 3119 Text : e true..Th en followe d a torren t 3120 Hex-H : 6277762156 6626666676 6262767766 72 3121 Hex-L : 504255E848 5E06FCCF75 40104F225E 40 3122 Key : .......!.. .......... .......... .. 3124 Stream Transmission Buffer 2 3126 Text : ....D.of l aughter an d cheers:. .Then the ominous w 3127 Hex-H : 1007496626 6766767266 6266667734 2A56662766 2666667727 3128 Hex-L : 000847F60C 157845201E 40385523A5 04485E0485 0FD9EF5307 3129 Key : ----D!.... .......... .........! .!........ .......... 3131 Text : ords "It's a Boo-".. Then, sile nce. Some fancied t 3132 Hex-H : 6767224727 262466228B 5666227666 6662225666 2666666627 3133 Hex-L : F243029473 0102FFD202 485EC039C5 E35E003FD5 061E395404 3134 Key : .......... ........!! .......... .......... .......... 3136 Text : hey heard in the air 3137 Hex-H : 6672666762 6627662667 3138 Hex-L : 8590851240 9E04850192 3139 Key : .......... .......... 3141 Stream Transmission Buffer 3 3143 Text : ....D. .A weary and wandering sigh.Then sounded li 3144 Hex-H : 1007442942 7667726662 7666676662 7666B56662 7676666266 3145 Hex-L : 0008450A10 7512901E40 71E4529E70 39780485E0 3F5E4540C9 3146 Key : ----D!.!.. .......... .......... ....!..... .......... 3148 Text : ke "-jum!" but the o thers decl are. .It w as only a 3149 Hex-H : 6622267622 2677276626 7667726666 67642A4727 6726667262 3150 Hex-L : B502DA5D12 025404850F 485230453C 1255029407 130FEC9010 3151 Key : .......... .......... .......... ...!.!.... .......... 3153 Text : breeze tha t went by. 3154 Hex-H : 6766762766 7276672672 3155 Hex-L : 2255A50481 4075E4029E 3156 Key : .......... .......... 3158 Notes: 3159 Hex-H High order bits of octet 3160 Hex-L Low order bits of octet 3161 Key: ---- Stream Transmission Header 3162 D Data Exchange Buffer command code 'D' 3163 ! Subrecord header octet 3164 . Place holder 3165 All headers are represented with a period in the Text line. 3167 Each Data Exchange Buffer is preceded by a Stream Transmission 3168 Header. 3170 In the above mapping the first Data Exchange Buffer is 128 octets in 3171 length. The last record has been continued in the second buffer. 3173 The second Data Exchange Buffer has been truncated at 116 octets to 3174 finish at the end of a record. The following record being completely 3175 contained in the third buffer. This is an alternative to spanning 3176 the record as shown between the first and second Data Exchange 3177 Buffers. 3179 The blank line has been encoded as a single header octet of '80' hex, 3180 indicating a zero length subrecord with the end of record flag set. 3182 The indented lines have been compressed. 3184 Appendix B. ISO 646 Character Subset 3186 o-----------------------------------------------------------------o 3187 | | 7| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 3188 | | B -+-----+-----+-----+-----+-----+-----+-----+-----| 3189 | | I 6| 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 3190 | | T -+-----+-----+-----+-----+-----+-----+-----+-----| 3191 | | 5| 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 3192 | |----+-----+-----+-----+-----+-----+-----+-----+-----| 3193 | | | | | | | | | | | 3194 | | | | | | | | | | | 3195 |------------| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 3196 | BIT | | | | | | | | | | 3197 | 4 3 2 1 | | | | | | | | | | 3198 |============o====o=====+=====+=====+=====+=====+=====+=====+=====| 3199 | 0 0 0 0 | 0 | | | SP | 0 | | P | | | 3200 |------------|----|-----+-----+-----+-----+-----+-----+-----+-----| 3201 | 0 0 0 1 | 1 | | | | 1 | A | Q | | | 3202 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3203 | 0 0 1 0 | 2 | | | | 2 | B | R | | | 3204 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3205 | 0 0 1 1 | 3 | | | | 3 | C | S | | | 3206 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3207 | 0 1 0 0 | 4 | | | | 4 | D | T | | | 3208 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3209 | 0 1 0 1 | 5 | | | | 5 | E | U | | | 3210 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3211 | 0 1 1 0 | 6 | | | & | 6 | F | V | | | 3212 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3213 | 0 1 1 1 | 7 | | | | 7 | G | W | | | 3214 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3215 | 1 0 0 0 | 8 | | | ( | 8 | H | X | | | 3216 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3217 | 1 0 0 1 | 9 | | | ) | 9 | I | Y | | | 3218 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3219 | 1 0 1 0 | 10 | | | | | J | Z | | | 3220 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3221 | 1 0 1 1 | 11 | | | | | K | | | | 3222 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3223 | 1 1 0 0 | 12 | | | | | L | | | | 3224 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3225 | 1 1 0 1 | 13 | | | - | | M | | | | 3226 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3227 | 1 1 1 0 | 14 | | | . | | N | | | | 3228 |------------+----|-----+-----+-----+-----+-----+-----+-----+-----| 3229 | 1 1 1 1 | 15 | | | / | | O | | | | 3230 o-----------------------------------------------------------------o 3232 Acknowledgements 3234 This document draws extensively on revision 1.3 of the ODETTE File 3235 Transfer Specification [OFTP]. 3237 Numerous people have contributed to the development of this protocol 3238 and their work is hereby acknowledged. The extensions required to 3239 utilise the Transmission Control Protocol were formulated and agreed 3240 by the current members of ODETTE Working Group Four, who also 3241 provided helpful reviews and comments on this document. 3243 References 3245 [OFTP] Organisation for Data Exchange by Tele Transmission in 3246 Europe, Odette File Transfer Protocol, Revision 1.3:1993 3248 [RFC-739] Postel, J., Transmission Control Protocol, STD 7, RFC 739, 3249 September 1981 3251 [ISO-646] International Organisation for Standardisation, ISO 3252 Standard 646:1991, "Information technology -- ISO 7-bit coded 3253 character set for information interchange", 1991 3255 [ISO-6523] International Organisation for Standardisation, ISO 3256 Standard 6523:1984, "Data interchange -- Structures for the 3257 identification of organisations", 1984 3259 [ISO-8601] International Organisation for Standardisation, ISO 3260 Standard 8601:1988 "Data elements and interchange formats -- 3261 Information interchange -- Representation of dates and times", 1988 3263 [NIFTP] High Level Protocol Group, "A Network Independent File 3264 Transfer Protocol", 1981 3266 [SNARK] Carroll, Lewis "The Hunting of the Snark", 1876 3268 Security Considerations 3270 Security issues are not discussed in this memo. 3272 ODETTE Address 3274 The ODETTE File Transfer Protocol is a product of Working Group Four 3275 of the Organisation for Data Exchange by Tele Transmission in 3276 Europe. The working group can be contacted via the ODETTE 3277 Secretariat: 3279 ODETTE Secretariat 3280 Forbes House 3281 Halkin Street 3282 London 3283 SW1X 7DS 3284 United Kingdom 3286 Phone: +44 (0)171 344 9227 3287 Fax: +44 (0)171 235 7112 3288 EMail odette@odette.org 3289 oxleyk@dial.pipex.com 3290 stephanie.bioux@dial.pipex.com 3292 Authors Address 3294 The author can also be contacted at 3296 David Nash 3297 Ford Motor Company Limited 3298 Room 1/148, Central Office 3299 Eagle Way 3300 Warley 3301 Brentwood 3302 Essex 3303 CM13 3BW 3304 United Kingdom 3306 Phone: +44 (0)1277 253043 3307 EMail: dnash@ford.com