home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / e / id-tko-02.txt < prev    next >
Text File  |  2020-01-01  |  18KB  |  476 lines

  1. Internet Engineering Task Force                        Jeffrey E. Altman
  2. INTERNET-DRAFT                                             Frank da Cruz
  3. <draft-altman-telnet-kermit-server-02.txt>           Columbia University
  4.                                                          25 January 2000
  5.                                                    Expires: 25 July 2000
  6.  
  7.  
  8.                           TELNET KERMIT OPTION
  9.  
  10.                                 DRAFT 02
  11.  
  12. STATUS OF THIS MEMO
  13.  
  14.    This document is an Internet-Draft and is in full conformance with
  15.    all provisions of Section 10 of RFC2026.  Internet-Drafts are working
  16.    documents of the Internet Engineering Task Force (IETF), its areas,
  17.    and its working groups.  Note that other groups may also distribute
  18.    working documents as Internet-Drafts.
  19.  
  20.    Internet-Drafts are draft documents valid for a maximum of six months
  21.    and may be updated, replaced, or obsoleted by other documents at any
  22.    time.  It is inappropriate to use Internet-Drafts as reference mate-
  23.    rial or to cite them other than as "work in progress."
  24.  
  25.    The list of current Internet-Drafts can be accessed at
  26.    http://www.ietf.org/ietf/1id-abstracts.txt
  27.  
  28.    The list of Internet-Draft Shadow Directories can be accessed at
  29.    http://www.ietf.org/shadow.html.
  30.  
  31.    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  32.    "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  33.    document are to be interpreted as described in RFC 2119.
  34.  
  35.  
  36. ABSTRACT
  37.  
  38. This Internet-Draft describes an extension to the Telnet protocol to allow
  39. the negotiation, coordination, and use of the Kermit file transfer and
  40. management protocol over an existing Telnet protocol connection.
  41.  
  42.  
  43. CONTENTS
  44.  
  45.   1. MOTIVATION
  46.   2. DEFINITIONS
  47.   3. COMMANDS AND CODES
  48.   4. COMMAND MEANINGS
  49.   5. KERMIT PROTOCOL IMPLICATIONS
  50.   6. EXAMPLES
  51.   6.1. EXAMPLE 1
  52.   6.2. EXAMPLE 2
  53.   6.3. EXAMPLE 3
  54.   6.4. EXAMPLE 4
  55.   6.5. EXAMPLE 5
  56.   7. SECURITY CONSIDERATIONS
  57.   8. REFERENCES
  58.   9. AUTHORS' ADDRESS
  59.  
  60.  
  61. 1. MOTIVATION
  62.  
  63. The Kermit protocol [KER] performs error-corrected file transfer and
  64. management over many types of connections, including terminal
  65. connections, among diverse hardware and software platforms.  It is
  66. supported by a large number of Telnet clients and is also widely
  67. available on the Internet hosts to which Telnet connections are made.
  68.  
  69. Traditionally, the Kermit protocol connection is started manually by a
  70. user, or perhaps by an automated script.  It is the user's
  71. responsibility to start the Kermit server on one end of the connection
  72. and the Kermit client on the other, or to start a Kermit "send"
  73. operation on one end and a Kermit "receive" on the other.
  74.  
  75. This procedure grew out of necessity on ordinary direct-dial
  76. connections, and serves its purpose within the limitations of that
  77. context.  But it introduces timing and dexterity problems, and lacks an
  78. effective way for each Kermit program to determine the "mode" of the
  79. other, or even its very presence, and therefore to know with certainty
  80. which operations and procedures are legal on the connection at any given
  81. time.
  82.  
  83. When Kermit services are offered on the Internet, however, a strong
  84. coupling can be established between the two end applications by having
  85. the Telnet protocol [TEL] serve as a supervisor for Kermit sessions,
  86. ensuring that a valid and known relationship is always obtained.  Kermit
  87. sessions are, in effect, embedded within Telnet sessions, with Telnet
  88. providing the mechanism for starting and stopping them and defining
  89. which end is the Kermit client and which is the Kermit server, possibly
  90. changing the relationship in response to user actions.
  91.  
  92.  
  93. 2. DEFINITIONS
  94.  
  95. Kermit server
  96.   A software program that is ready to accept and act upon commands in
  97.   the form of well-defined Kermit packets [KER].
  98.  
  99. Kermit client
  100.   A software program that receives requests through its user interface
  101.   from a human agent (or a script or other source) and translates them to
  102.   command packets, which it sends to a Kermit server, thus initiating a
  103.   Kermit protocol transaction such as the transfer of one or more files.
  104.  
  105. Availability of Kermit server
  106.   For the purposes of this document, a Kermit server is said to be
  107.   available if, through the negotiations described herein, its Telnet
  108.   partner knows that it is a Kermit server.
  109.  
  110.  
  111. 3. COMMANDS AND CODES
  112.  
  113. Support for a Kermit server is negotiated separately in each direction,
  114. allowing Kermit service to be embedded in the Telnet client, the Telnet
  115. server, or in both.  The proposed Telnet extensions are, therefore,
  116. symmetrical.
  117.  
  118. When the connection is first opened, Kermit service is unavailable in
  119. both directions.
  120.  
  121. The availability of Kermit service is negotiated using the following
  122. Telnet option:
  123.  
  124.   KERMIT           47 (assigned by IANA)
  125.  
  126. The state of the connection is controlled by the following Telnet
  127. subnegotiation function codes:
  128.  
  129.   START-SERVER      0
  130.   STOP-SERVER       1
  131.   REQ-START-SERVER  2
  132.   REQ-STOP-SERVER   3
  133.   SOP               4
  134.   RESP-START-SERVER 8
  135.   RESP-STOP-SERVER  9
  136.  
  137.  
  138. 4. COMMAND MEANINGS
  139.  
  140. The KERMIT OPTION is negotiated using the standard Telnet mechanisms:
  141.  
  142. IAC WILL KERMIT
  143.   The sender of this command incorporates a Kermit server and is willing
  144.   to negotiate its use.
  145.  
  146. IAC WONT KERMIT
  147.   The sender of this command does not incorporate a Kermit server or
  148.   refuses to negotiate its use.
  149.  
  150. IAC DO KERMIT
  151.   The sender of this command requests that the receiver negotiate use of
  152.   a Kermit server.
  153.  
  154. IAC DONT KERMIT
  155.   The sender of this command refuses to negotiate the use of a Kermit
  156.   server.
  157.  
  158. Once WILL KERMIT is negotiated in a particular direction, subnegotiations
  159. are used to indicate or request a change in state of the connection, or to
  160. convey other information.  Subnegotiations may be sent at any time.
  161.  
  162. IAC SB KERMIT START-SERVER
  163.   This command is sent by the WILL side to indicate that the Kermit
  164.   server is now active; that is, that client-initiated Kermit packets
  165.   will be accepted.
  166.  
  167. IAC SB KERMIT STOP-SERVER
  168.   This command is sent by the WILL side to indicate that the Kermit
  169.   server is no longer active, and therefore that it is not ready to
  170.   accept Kermit packets.
  171.  
  172. IAC SB KERMIT REQ-START-SERVER
  173.   This command is sent by the DO side to request that the Kermit server
  174.   be started.  It must be responded to with either RESP-START-SERVER
  175.   or RESP-STOP-SERVER depending upon whether or not the request was
  176.   accepted.
  177.  
  178. IAC SB KERMIT REQ-STOP-SERVER
  179.   This command is sent by the DO side to request that the Kermit server
  180.   be stopped.  It must be responded to with either RESP-START-SERVER
  181.   or RESP-STOP-SERVER depending upon whether or not the request was
  182.   accepted.
  183.  
  184. IAC SB KERMIT RESP-START-SERVER
  185.   This command is sent by the WILL side in response to REQ-START-SERVER
  186.   or REQ-STOP-SERVER to indicate that the Kermit server is active
  187.   after the request was accepted or denied.
  188.  
  189. IAC SB KERMIT RESP-STOP-SERVER
  190.   This command is sent by the WILL side in response to REQ-START-SERVER
  191.   or REQ-STOP-SERVER to indicate that the Kermit server is not active
  192.   after the request was accepted or denied.
  193.  
  194. IAC SB KERMIT SOP <octet>
  195.   Kermit Start Of Packet.  The sender of this command specifies the
  196.   octet it will use to mark the beginning of the Kermit packets it
  197.   sends.  This command must be sent by each connection partner upon the
  198.   first WILL/DO pair to allow unambigious identification of Kermit
  199.   packets in the data stream.  This subnegotiation must be sent whenever
  200.   the Start of Packet character changes.  The values are restricted to
  201.   ASCII C0 control characters other than Carriage Return and NUL.  The
  202.   normal value is 1 (ASCII SOH).  The two Kermit partners normally use
  203.   the same SOP, but may use distinct ones if desired.
  204.  
  205. IAC SB KERMIT SOP is necessary to allow each Telnet partner to recognize
  206. subsequent incoming Kermit packets.  Data following the SOP is processed
  207. by the Kermit packet analyzer.  All other Kermit protocol parameters are
  208. automatically negotiated within the Kermit protocol upon the initial
  209. exchange of Kermit packets [KER].
  210.  
  211. START-SERVER and STOP-SERVER commands must be sent by the WILL side
  212. whenever the state of the Kermit server changes.  When WILL is
  213. successfully negotiated the state of the WILL side is assumed to be
  214. STOP-SERVER.  If the server is active, the WILL side must send a 
  215. START-SERVER to indicate the change in state.
  216.  
  217. The receiver of a REQ-START-SERVER or REQ-STOP-SERVER is not required to
  218. agree to the request to change state.  The receiver must respond with
  219. either RESP-START-SERVER or RESP-STOP-SERVER to indicate the state of the 
  220. Kermit Server subsequent to the request.  RESP-xxx-SERVER is sent instead
  221. of xxx-SERVER to enable the sender of REQ-xxx-SERVER to distinguish 
  222. between the WILL side's spontaneous change in state and the response
  223. to the DO side's request.
  224.  
  225. If the Kermit server receives a Kermit packet commanding it to cease
  226. Kermit service (such as a FINISH, REMOTE EXIT or BYE packet [KER]), it
  227. must send IAC SB KERMIT STOP-SERVER if the command is accepted.
  228.  
  229. These rules ensure that the Telnet client's user interface always knows
  230. whether (and on which end) a Kermit server is available, and can
  231. therefore present the user only with valid choices, and that changes in
  232. state of one Telnet partner automatically switch the other to a
  233. complementary and valid state.
  234.  
  235. While it is possible for a traditional telnet service (port 23) to 
  236. implement this option while at the same time supporting the existing
  237. remote shell access functionality, it is not expected that this option
  238. will be used in that manner.  Instead, this option is primarily meant
  239. for use with dedicated Kermit services (port 1649) such as the 
  240. Internet Kermit Service [IKS].  
  241.  
  242.  
  243. 5. KERMIT PROTOCOL IMPLICATIONS
  244.  
  245. The Kermit protocol is described elsewhere [KER].  It is an extensible
  246. and self-configuring protocol, like Telnet, and thus any two proper
  247. Kermit implementations should interoperate automatically.
  248.  
  249. In Kermit, as in Telnet, one particular octet is distinguished.  In
  250. Telnet's case, it is IAC (decimal 255); in Kermit's it is the character
  251. specified by the IAC SB KERMIT SOP negotiation, normally SOH (decimal 1,
  252. Ctrl-A).  All Kermit packets must begin with the SOP and should not
  253. contain the SOP character in an unquoted form.
  254.  
  255. Telnet protocol takes precedence over Kermit protocol; whenever an IAC
  256. is detected, it is processed as the beginning of a Telnet command unless
  257. quoted by another IAC.  Telnet commands can contain any characters at
  258. all, including the SOP octet, transparently to the Kermit protocol, and
  259. in fact Telnet commands are not seen by the Kermit protocol at all.
  260.  
  261. Kermit protocol must follow Telnet NVT rules in each direction when
  262. Telnet binary mode is not negotiated for that direction.
  263.  
  264. If 8-bit transparency is desired, Telnet binary mode may be negotiated
  265. upon entry to Kermit protocol in the appropriate direction, and the
  266. previous mode (NVT or binary) restored upon exit from Kermit protocol.
  267. Telnet binary mode can result in more efficient transfers, but is not
  268. required for data transfer, since Kermit protocol does not require a
  269. transparent path.
  270.  
  271.  
  272. 6. EXAMPLES
  273.  
  274. 6.1. EXAMPLE 1
  275.  
  276. The Telnet server contains a Kermit server.  The Telnet client includes
  277. Kermit protocol but does not implement the Telnet KERMIT Option.
  278.  
  279.   Telnet Server                   Telnet Client
  280.   -----------------------------   -----------------------------
  281.   <starts negotiations>
  282.   WILL KERMIT
  283.   DO KERMIT
  284.                                   <responds to negotiations>
  285.                                   DONT KERMIT
  286.                                   WONT KERMIT
  287.  
  288. From this point, no subnegotiations take place, and the Kermit
  289. client/server relationship is under manual control of the user of the
  290. Telnet client.  This will be the case (for example) with existing
  291. Kermit-capable Telnet clients.
  292.  
  293. 6.2. EXAMPLE 2
  294.  
  295. The Telnet server contains a Kermit server and starts a Kermit server
  296. immediately after a connection is made.  The Telnet client does not
  297. offer a Kermit server.
  298.  
  299.   Telnet Server                   Telnet Client
  300.   -----------------------------   -----------------------------
  301.   <starts negotiations>
  302.   WILL KERMIT
  303.   DO KERMIT
  304.                                   <responds to negotiations>
  305.                                   DO KERMIT
  306.                                   SB KERMIT SOP <0x01>
  307.                                   WONT KERMIT
  308.   SB KERMIT SOP <0x01>
  309.  
  310.   <starts Kermit Server>
  311.   SB KERMIT START-SERVER
  312.  
  313. At this point the Telnet client knows that a Kermit server is on the
  314. other end of the connection, and so may customize its command set or
  315. menus to allow only those commands that are valid as a client of a
  316. Kermit server.
  317.  
  318. 6.3. EXAMPLE 3
  319.  
  320. Telnet server and Telnet client both contain a Kermit server.  Telnet
  321. client Kermit server is active whenever its terminal emulator is active,
  322. and not active at other times.  The Telnet server is used for shell
  323. access and does not start a Kermit Server unless requested.
  324.  
  325.   Telnet Server                 Telnet Client
  326.   ---------------------------   -----------------------------
  327.   <starts negotiations>
  328.   WILL KERMIT
  329.   DO KERMIT
  330.                                 <responds to negotiations>
  331.                                 DO KERMIT
  332.                                 SB KERMIT SOP <0x01>
  333.                                 WILL KERMIT
  334.   SB KERMIT SOP <0x01>
  335.                                 <telnet client enters terminal emulator>
  336.                                 SB KERMIT START-SERVER
  337.  
  338.                                 <client leaves terminal emulator>
  339.                                 SB KERMIT STOP-SERVER
  340.  
  341.                                 <client requests Kermit service>
  342.                                 SB KERMIT REQ-START-SERVER
  343.   <starts Kermit server>
  344.   SB KERMIT RESP-START-SERVER
  345.                                 <client sends Kermit FINISH packet>
  346.   <stops Kermit server>
  347.   SB KERMIT STOP-SERVER
  348.                                 <client returns to terminal emulator>
  349.                                 SB KERMIT START-SERVER
  350.  
  351.  
  352. 6.4. EXAMPLE 4
  353.  
  354. Telnet server and Telnet client both contain a Kermit server.  Telnet
  355. client's Kermit server is active whenever the terminal emulator is
  356. active.  Telnet server is used solely for Kermit protocol and
  357. automatically starts a Kermit Server upon accepting the connection.
  358.  
  359.   Telnet Server                 Telnet Client
  360.   ---------------------------   -----------------------------
  361.   <starts negotiations>
  362.   WILL KERMIT
  363.   DO KERMIT
  364.                                 <responds to negotiations>
  365.                                 DO KERMIT
  366.                                 SB KERMIT SOP <0x01>
  367.                                 WILL KERMIT
  368.  
  369.   SB KERMIT SOP <0x01>
  370.                                 <client enters terminal emulator>
  371.                                 SB KERMIT START-SERVER
  372.  
  373.   <in response to DO>
  374.   SB KERMIT SOP <0x01>
  375.   SB KERMIT START-SERVER
  376.                                 <client restricts command set to
  377.                                  Kermit protocol commands>
  378.                                 SB KERMIT STOP-SERVER
  379.  
  380.                                 <client performs Kermit protocol
  381.                                  operations>
  382.  
  383.                                 <client want to enter terminal mode>
  384.                                 SB KERMIT REQ-STOP-SERVER
  385.  
  386.   <Kermit Server refuses>
  387.   SB KERMIT RESP-START-SERVER
  388.  
  389.  
  390. 6.5. EXAMPLE 5
  391.  
  392. This is an example of something that should not be allowed to happen.
  393. Some Telnet clients that implement file transfer capabilities are
  394. designed to accept incoming connections.  In this situation the Telnet
  395. Client acts as a pseudo Telnet Server but without the ability to provide
  396. shell access or many of the other functions associated with Telnet.  If
  397. both Telnet clients support this option and contain a Kermit server that
  398. is active during terminal emulation there is the potential for a
  399. deadlock situation if scripting is also supported.  This is because
  400. Telnet clients that support a script language do not process input while
  401. waiting for the next command to be issued.
  402.  
  403.   Telnet Client One             Telnet Client Two
  404.   ---------------------------   -----------------------------
  405.   <starts negotiations>
  406.   WILL KERMIT
  407.   DO KERMIT
  408.                                 <responds to WILL>
  409.                                 DO KERMIT
  410.                                 SB KERMIT SOP <0x01>
  411.  
  412.   <in response to DO>
  413.   SB KERMIT SOP <0x01>
  414.   SB KERMIT START-SERVER
  415.                                 <responds to DO>
  416.                                 WILL KERMIT
  417.                                 SB KERMIT START-SERVER
  418.  
  419.   <client one restricts command
  420.    set to Kermit protocol and
  421.    disables Kermit Server>
  422.   SB KERMIT STOP-SERVER
  423.                                 <client two restricts command
  424.                                  set to Kermit protocol and
  425.                                  disables Kermit Server>
  426.                                 SB KERMIT STOP-SERVER
  427.  
  428. At this point both clients have restricted their command set to Kermit
  429. Protocol commands.  However, in both cases neither side is processing
  430. input.  Therefore the following restriction MUST be enforced: A Telnet
  431. partner may not restrict the command set if it accepted the incoming
  432. connection.
  433.  
  434.  
  435. 7. SECURITY
  436.  
  437. Implementors of this Telnet Option must enforce appropriate user 
  438. authentication and file system access restrictions in conjunction with
  439. their implementation of the Kermit file transfer protocol.  These issues
  440. are beyond the scope of this Internet-Draft.
  441.  
  442.  
  443. 8. REFERENCES
  444.  
  445. [BCP] Bradner, Scott, RFC 2119, "Best Current Practice", March 1997.
  446.  
  447. [KER] da Cruz, Frank, "Kermit, A File Transfer Protocol", Digital Press/
  448.       Butterworth Heinemann, Newton, MA, ISBN 0-932376-88-6 (1987).
  449.  
  450. [IKS] da Cruz, Frank, and Jeffrey E. Altman, "Internet Kermit Service",
  451.       Internet Draft <draft-columbia-kermit-service-02.txt>,
  452.       August 1998.
  453.  
  454. [TEL] Postel, J., and J. Reynolds, "Telnet Protocol Specification",
  455.       RFC854, May 1983, et seq.; "Telnet Option Specification",
  456.       RFC855, May 1983, et seq.
  457.  
  458.  
  459. 9. AUTHORS' ADDRESS
  460.  
  461. Jeffrey E. Altman
  462. jaltman@columbia.edu
  463.  
  464. Frank da Cruz
  465. fdc@columbia.edu
  466.  
  467. The Kermit Project
  468. Columbia University
  469. 612 West 115th Street
  470. New York NY 10025-7799
  471. USA
  472. http://www.columbia.edu/kermit/
  473. http://www.kermit-project.org/
  474.  
  475. (End)
  476.