home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_q_t / draft-ietf-tn3270e-ver2-enhance-00.txt < prev    next >
Text File  |  1997-05-28  |  89KB  |  2,002 lines

  1.  
  2. Telnet TN3270 Enhancements Working Group                        B. Kelly
  3. Internet Draft                                         Auburn University
  4. Expiration Date: October 1997                                   May 1997
  5. File name: draft-ietf-tn3270e-ver2-enhance-00.txt
  6.  
  7.  
  8.                           TN3270 Enhancements
  9.  
  10. Status of this Memo
  11.  
  12.    This document is an Internet-Draft.  Internet-Drafts are working
  13.    documents of the Internet Engineering Task Force (IETF), its
  14.    areas, and its working groups.  Note that other groups may also
  15.    distribute working documents as Internet-Drafts.
  16.  
  17.    Internet-Drafts are draft documents valid for a maximum of six
  18.    months and may be updated, replaced, or obsoleted by other
  19.    documents at any time.  It is inappropriate to use Internet-
  20.    Drafts as reference material or to cite them other than as
  21.    "work in progress."
  22.  
  23.    To view the entire list of current Internet-Drafts, please check
  24.    the "1id-abstracts.txt" listing contained in the Internet-Drafts
  25.    Shadow Directories on ftp.is.co.za (Africa), ftp.nordu.net
  26.    (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East
  27.    Coast), or ftp.isi.edu (US West Coast).
  28.  
  29. Abstract
  30.  
  31.    This document describes a protocol that more fully supports 3270
  32.    devices than do the existing tn3270 practices.  Specifically, it
  33.    defines a method of emulating both the terminal and printer members
  34.    of the 3270 family of devices via Telnet; it provides for the ability
  35.    of a Telnet client to request that it be assigned a specific device-
  36.    name (also referred to as "LU name" or "network name"); finally, it
  37.    adds support for a variety of functions such as the ATTN key, the
  38.    SYSREQ key, and SNA response handling.
  39.  
  40.    This protocol is negotiated under the TN3270E Telnet Option, and is
  41.    unrelated to the Telnet 3270 Regime Option as defined in RFC 1041
  42.    [1].
  43.  
  44. TABLE OF CONTENTS
  45.  
  46.    1.  Introduction ...............................................  2
  47.    2.  TN3270E OVERVIEW ...........................................  4
  48.    3.  COMMAND NAMES AND CODES ....................................  4
  49.    4.  COMMAND MEANINGS ...........................................  5
  50.  
  51.  
  52.  
  53. Kelly                                                           [Page 1]
  54.  
  55. Internet Draft            TN3270 Enhancements                   May 1997
  56.  
  57.  
  58.    5.  DEFAULT SPECIFICATION ......................................  7
  59.    6.  MOTIVATION .................................................  7
  60.    7.  TN3270E SUB-NEGOTIATION RULES ..............................  7
  61.       7.1  DEVICE-TYPE Negotiation ................................  7
  62.           7.1.1 Device Pools ......................................  8
  63.           7.1.2 CONNECT Command ................................... 10
  64.           7.1.3 ASSOCIATE Command ................................. 10
  65.           7.1.4 Accepting a Request ............................... 11
  66.           7.1.5 REJECT Command .................................... 11
  67.       7.2  FUNCTIONS Negotiation .................................. 12
  68.           7.2.1 Commands .......................................... 12
  69.           7.2.2 List of TN3270E Functions ......................... 13
  70.    8.  TN3270E DATA MESSAGES ...................................... 14
  71.       8.1  The TN3270E Message Header ............................. 15
  72.           8.1.1 DATA-TYPE Field ................................... 15
  73.           8.1.2 REQUEST-FLAG Field ................................ 16
  74.           8.1.3 RESPONSE-FLAG Field ............................... 16
  75.           8.1.4 SEQ-NUMBER Field .................................. 18
  76.    9.  BASIC TN3270E .............................................. 18
  77.       9.1  3270 Mode and NVT Mode ................................. 18
  78.    10. DETAILS OF PROCESSING TN3270E FUNCTIONS .................... 19
  79.       10.1 The SCS-CTL-CODES Function ............................. 19
  80.       10.2 The DATA-STREAM-CTL Function ........................... 20
  81.       10.3 The BIND-IMAGE Function ................................ 21
  82.       10.4 The RESPONSES Function ................................. 22
  83.          10.4.1 Response Messages ................................. 23
  84.       10.5 The SYSREQ Function .................................... 25
  85.          10.5.1 Background ........................................ 25
  86.          10.5.2 TN3270E Implementation of SYSREQ .................. 26
  87.    11. THE 3270 ATTN KEY .......................................... 27
  88.    12. 3270 STRUCTURED FIELDS ..................................... 28
  89.    13. IMPLEMENTATION GUIDELINES .................................. 28
  90.       13.1 3270 Data Stream Notes ................................. 28
  91.       13.2 Negotiation of the TN3270E Telnet Option ............... 28
  92.       13.3 A "Keep-alive" Mechanism ............................... 29
  93.       13.4 Examples ............................................... 29
  94.    14. SECURITY CONSIDERATIONS .................................... 33
  95.    15. REFERENCES ................................................. 33
  96.    16. AUTHOR'S NOTE .............................................. 34
  97.    17. AUTHOR'S ADDRESS ........................................... 34
  98.  
  99. 1.  Introduction
  100.  
  101.    Currently, support for 3270 terminal emulation over Telnet is
  102.    accomplished by the de facto standard of negotiating three separate
  103.    Telnet Options - Terminal-Type [2], Binary Transmission [3], and End
  104.    of Record [4].  Note that there is no RFC that specifies this
  105.    negotiation as a standard.  RFC 1041 attempted to standardize the
  106.    method of negotiating 3270 terminal support by defining the 3270
  107.    Regime Telnet Option.  Very few developers and vendors ever
  108.    implemented RFC 1041.
  109.  
  110.  
  111.  
  112. Kelly                                                           [Page 2]
  113.  
  114. Internet Draft            TN3270 Enhancements                   May 1997
  115.  
  116.  
  117.    This document will refer to the existing practice of negotiating
  118.    these three Telnet Options before exchanging the 3270 data stream as
  119.    "traditional tn3270".  Traditional tn3270 is documented in [10].
  120.  
  121.    NOTE: Except where otherwise stated, this document does not
  122.    distinguish between Telnet servers that represent SNA devices and
  123.    those that represent non-SNA 3270 devices.
  124.  
  125.    All references in this document to the 3270 data stream, 3270 data
  126.    stream commands, orders, structured fields and the like rely on [5].
  127.  
  128.    References to SNA Request and Response Units rely on [6].  References
  129.    to SNA versus non-SNA operation rely on [7].
  130.  
  131.    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  132.    "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
  133.    document are to be interpreted as described in RFC 2119.
  134.  
  135.    There are several shortcomings in traditional tn3270; among them are
  136.    the following:
  137.  
  138.     - It provides no capability for Telnet clients to emulate the 328x
  139.       class of printers.
  140.  
  141.     - There is no mechanism by which a Telnet client can request that
  142.       a connection be associated with a given 3270 device-name.  This
  143.       can be of importance when a terminal session is being
  144.       established, since many host applications behave differently
  145.       depending on the network name of the terminal.  In the case of
  146.       printer emulation, this capability is an absolute necessity
  147.       because a large number of host applications have some method of
  148.       pre-defining printer destinations.
  149.  
  150.     - The 3270 ATTN and SYSREQ keys are not universally supported.
  151.  
  152.     - There is no support for the SNA positive/negative response
  153.       process.  This is particularly important if printer emulation is
  154.       to function properly, but is also useful for some terminal
  155.       applications.  A positive response is used to indicate that
  156.       the previously received data has been successfully processed.
  157.       A negative response indicates some sort of error has occurred
  158.       while processing the previously received data; this could be
  159.       caused by the host application building a 3270 data stream that
  160.       contains an invalid command, or by a mechanical error at the
  161.       client side, among other things.
  162.  
  163.     - There is no mechanism by which the client can access the SNA
  164.       Bind information.  The Bind image contains a detailed
  165.       description of the session between the Telnet server and the
  166.       host application.
  167.  
  168.  
  169.  
  170.  
  171. Kelly                                                           [Page 3]
  172.  
  173. Internet Draft            TN3270 Enhancements                   May 1997
  174.  
  175.  
  176.     - There is no mechanism by which the server can determine whether
  177.       a client supports 3270 structured fields, or a client can
  178.       request that it receive them.
  179.  
  180. 2.  TN3270E Overview
  181.  
  182.    In order to address these issues, this document proposes a new Telnet
  183.    Option - TN3270E.  Telnet clients and servers would be free to
  184.    negotiate support of the TN3270E option or not. If either side does
  185.    not support TN3270E, traditional tn3270 can be used; otherwise, a
  186.    sub-negotiation will occur to determine what subset of TN3270E will
  187.    be used on the session.  It is anticipated that a client or server
  188.    capable of both types of 3270 emulation would attempt to negotiate
  189.    TN3270E first, and only negotiate traditional tn3270 if the other
  190.    side refuses TN3270E.
  191.  
  192.    Once a client and server have agreed to use TN3270E, negotiation of
  193.    the TN3270E suboptions can begin.  The two major elements of TN3270E
  194.    sub-negotiation are:
  195.  
  196.     - a device-type negotiation that is similar to, but somewhat
  197.       more complicated than, the existing Telnet Terminal-Type Option.
  198.  
  199.     - the negotiation of a set of supported 3270 functions, such as
  200.       printer data stream type (3270 data stream or SNA Character
  201.       Stream), positive/negative response exchanges, device status
  202.       information, and the passing of BIND information from server to
  203.       client.
  204.  
  205.    Successful negotiation of these two suboptions signals the beginning
  206.    of 3270 data stream transmission. In order to support several of the
  207.    new functions in TN3270E, each data message must be prefixed by a
  208.    header.  This header will contain flags and indicators that convey
  209.    such things as positive and negative responses and what type of data
  210.    follows the header (for example, 3270 data stream, SNA Character
  211.    Stream, or device status information).
  212.  
  213. 3.  Command Names and Codes
  214.  
  215.    Please note that all numeric literals in this document specify
  216.    decimal values, unless they are preceded by "0x", in which case
  217.    a hexadecimal value is represented.
  218.  
  219.        TN3270E            40
  220.          ASSOCIATE          00
  221.          CONNECT            01
  222.          DEVICE-TYPE        02
  223.          FUNCTIONS          03
  224.          IS                 04
  225.          REASON             05
  226.  
  227.  
  228.  
  229.  
  230. Kelly                                                           [Page 4]
  231.  
  232. Internet Draft            TN3270 Enhancements                   May 1997
  233.  
  234.  
  235.          REJECT             06
  236.          REQUEST            07
  237.          SEND               08
  238.  
  239.        Reason-codes
  240.          CONN-PARTNER       00
  241.          DEVICE-IN-USE      01
  242.          INV-ASSOCIATE      02
  243.          INV-NAME           03
  244.          INV-DEVICE-TYPE    04
  245.          TYPE-NAME-ERROR    05
  246.          UNKNOWN-ERROR      06
  247.          UNSUPPORTED-REQ    07
  248.  
  249.        Function Names
  250.          BIND-IMAGE         00
  251.          DATA-STREAM-CTL    01
  252.          RESPONSES          02
  253.          SCS-CTL-CODES      03
  254.          SYSREQ             04
  255.  
  256. 4.  Command Meanings
  257.  
  258.    Refer to the Telnet Protocol Specification [8] for the meaning of
  259.    IAC, DO, WILL, etc.
  260.  
  261.    IAC WILL TN3270E
  262.  
  263.       The sender of this command is willing to send TN3270E
  264.       information in subsequent sub-negotiations.
  265.  
  266.    IAC WON'T TN3270E
  267.  
  268.       The sender of this command refuses to send TN3270E information.
  269.  
  270.    IAC DO TN3270E
  271.  
  272.       The sender of this command is willing to receive TN3270E
  273.       information in subsequent sub-negotiations.
  274.  
  275.    IAC DON'T TN3270E
  276.  
  277.       The sender of this command refuses to receive TN3270E
  278.       information.
  279.  
  280.    Note that while they are not explicitly negotiated, the equivalent of
  281.    the Telnet Binary Transmission Option [3] and the Telnet End of
  282.    Record Option [4] is implied in the negotiation of the TN3270E
  283.    Option.  That is, a party to the negotiation that agrees to support
  284.    TN3270E is automatically required to support bi-directional binary
  285.    and EOR transmissions.
  286.  
  287.  
  288.  
  289. Kelly                                                           [Page 5]
  290.  
  291. Internet Draft            TN3270 Enhancements                   May 1997
  292.  
  293.  
  294.    IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  295.  
  296.       Only the server may send this command.  This command is used to
  297.       request that the client transmit a device-type and, optionally,
  298.       device-name information.
  299.  
  300.    IAC SB TN3270E DEVICE-TYPE REQUEST <device-type>
  301.        [ [CONNECT <resource-name>] | [ASSOCIATE <device-name>] ] IAC SE
  302.  
  303.       Only the client may send this command.  It is used in response
  304.       to the server's SEND DEVICE-TYPE command, as well as to suggest
  305.       another device-type after the server has sent a DEVICE-TYPE REJECT
  306.       command (see below).  This command requests emulation of a
  307.       specific 3270 device type and model.  The REQUEST command may
  308.       optionally include either the CONNECT or the ASSOCIATE command
  309.       (but not both).  If present, CONNECT must be followed by
  310.       <resource-name> and ASSOCIATE must be followed by <device-name>.
  311.       (See the section entitled "DEVICE-TYPE Negotiation" for more
  312.       detailed information.)
  313.  
  314.    IAC SB TN3270E DEVICE-TYPE IS <device-type> CONNECT
  315.           <device-name> IAC SE
  316.  
  317.       Only the server may send this command.  This command is used to
  318.       accept a client's DEVICE-TYPE REQUEST command and to return the
  319.       server-defined device-name.
  320.  
  321.    IAC SB TN3270E DEVICE-TYPE REJECT REASON <reason-code> IAC SE
  322.  
  323.       Only the server may send this command.  This command is used to
  324.       reject a client's DEVICE-TYPE REQUEST command.
  325.  
  326.    IAC SB TN3270E FUNCTIONS REQUEST <function-list> IAC SE
  327.  
  328.       Either side may send this command.  This command is used to
  329.       suggest a set of 3270 functions that will be supported on this
  330.       session.  It is also sent as an implicit rejection of a previous
  331.       FUNCTIONS REQUEST command sent by the other side (see the
  332.       section entitled "FUNCTIONS Negotiation" for more information).
  333.       Note that when used to reject a FUNCTIONS REQUEST command, the
  334.       function-list must not be identical to that received in the
  335.       previous REQUEST command.
  336.  
  337.    IAC SB TN3270E FUNCTIONS IS <function-list> IAC SE
  338.  
  339.       Either side may send this command.  This command is sent as a
  340.       response to a FUNCTIONS REQUEST command and implies acceptance
  341.       of the set of functions sent to it in the REQUEST command.  Note
  342.       that the list of functions in the FUNCTIONS IS command must
  343.       match the list that was received in the previous FUNCTIONS
  344.       REQUEST command.
  345.  
  346.  
  347.  
  348. Kelly                                                           [Page 6]
  349.  
  350. Internet Draft            TN3270 Enhancements                   May 1997
  351.  
  352.  
  353. 5.  Default Specification
  354.  
  355.    WON'T TN3270E
  356.  
  357.    DON'T TN3270E
  358.  
  359.    i.e., TN3270E will not be used.
  360.  
  361. 6.  Motivation
  362.  
  363.    See the section entitled "Introduction".
  364.  
  365. 7.  TN3270E Sub-negotiation Rules
  366.  
  367.    Once it has been agreed that TN3270E will be supported, the first
  368.    sub-negotiation must concern the DEVICE-TYPE (and possibly device-
  369.    name) information.  Only after that has been successfully negotiated
  370.    can the client and server exchange FUNCTIONS information.  Only after
  371.    both DEVICE-TYPE and FUNCTIONS have been successfully negotiated can
  372.    3270 data stream transmission occur.
  373.  
  374.    7.1 DEVICE-TYPE Negotiation
  375.  
  376.       Device-type names are NVT ASCII strings, all upper case.
  377.  
  378.       Device-type (and device-name) negotiation begins when the server
  379.       transmits the DEVICE-TYPE SEND command to the client.  The client
  380.       responds with the DEVICE-TYPE REQUEST command, which must include
  381.       a device-type and may include a resource-name or device-name
  382.       request.
  383.  
  384.       Valid device-types are:
  385.  
  386.        terminals: IBM-3278-2  IBM-3278-2-E  (24 row x 80 col display)
  387.                   IBM-3278-3  IBM-3278-3-E  (32 row x 80 col display)
  388.                   IBM-3278-4  IBM-3278-4-E  (43 row x 80 col display)
  389.                   IBM-3278-5  IBM-3278-5-E  (27 row x 132 col display)
  390.                   IBM-DYNAMIC            (no pre-defined display size)
  391.  
  392.         printers: IBM-3287-1
  393.  
  394.       Note that the use of '3278' and '3287' is NOT intended to exclude
  395.       any particular device capabilities; they are used here only
  396.       because they are commonly known designations for a terminal and a
  397.       printer member of the 3270 family of devices.  The intention is to
  398.       simplify the device-type negotiation (in comparison to traditional
  399.       tn3270) by minimizing the number of possible device-types, and by
  400.       breaking the association of a specific piece of IBM hardware with
  401.       a related set of data stream capabilities.  For example,
  402.       negotiation of device-type IBM-3278-2-E does NOT in and of itself
  403.       preclude the use of any of the functions associated with a
  404.  
  405.  
  406.  
  407. Kelly                                                           [Page 7]
  408.  
  409. Internet Draft            TN3270 Enhancements                   May 1997
  410.  
  411.  
  412.       physical 3279 model S2B.  A client's ability to support the more
  413.       advanced functions of the 3270 data stream will be indicated not
  414.       by negotiation of an IBM device type and model number, but rather
  415.       by the combination of Read Partition Query and Query Reply.
  416.  
  417.       All of the terminal device-types support a "primary" display size
  418.       of 24 rows by 80 columns.  The "-3", "-4" and "-5" types each
  419.       support an "alternate" display size as noted in the above list.
  420.       The IBM-DYNAMIC device-type implies no pre-defined alternate
  421.       display size; this value will be passed from the client to host
  422.       applications as part of the Query Reply structured field, and it
  423.       can represent any display size the client and the host application
  424.       can support.
  425.  
  426.       Terminal device-types with the "-E" suffix should only be
  427.       negotiated by clients that are willing to support some subset of
  428.       the 3270 "extended data stream".  This usually includes at a
  429.       minimum support for extended colors and highlighting, but may also
  430.       include a number of other functions, such as graphics capability,
  431.       alternate character sets, and partitions.
  432.  
  433.       Clients that negotiate a terminal device-type with the "-E" suffix
  434.       or the DYNAMIC type, as well as those that negotiate a printer
  435.       device-type, must be able to accept and respond to a Read
  436.       Partition Query command (see the section entitled "3270 Structured
  437.       Fields").  This allows the client to indicate to host applications
  438.       which subsets of the 3270 extended data stream the client is
  439.       willing to support.
  440.  
  441.       In a VTAM/SNA environment, negotiation of IBM-DYNAMIC as the
  442.       device-type should result in a Bind in which the Presentation
  443.       Services Usage screen field (the eleventh byte in the logmode's
  444.       PSERVIC field) is set to 0x03, indicating that the alternate
  445.       screen size will be determined by the Query Reply (Usable Area).
  446.  
  447.       7.1.1 Device Pools
  448.  
  449.          An explanation of the CONNECT and ASSOCIATE commands first
  450.          requires a discussion of the organization of terminal and
  451.          printer device pools that the server maintains and from which
  452.          it selects device-names to assign to session requests.
  453.          Definition of a few terms is also in order.
  454.  
  455.          The terms "device-name", "LU name" and "network name" can be
  456.          considered interchangeable in this document.  They refer to
  457.          a specific terminal or printer device.
  458.  
  459.          The term "resource-name" is less specific; it may refer to a
  460.          device-name, but it may also be the name of a pool of printer
  461.          or terminal devices.  Such a named pool could serve to group
  462.          devices with similar operational or administrative
  463.  
  464.  
  465.  
  466. Kelly                                                           [Page 8]
  467.  
  468. Internet Draft            TN3270 Enhancements                   May 1997
  469.  
  470.  
  471.          characteristics.  In fact, this document places no restrictions
  472.          on how a server makes use of resource-names, so long as the
  473.          server can take a resource-name specified by the client and use
  474.          it to come up with a device-name to assign to the session.
  475.          Note, however, that servers must avoid allowing ambiguity; for
  476.          example, they must not allow the definition of a device-name
  477.          with the same name as that of a pool of devices.
  478.  
  479.          Device-names and resource-names are specified as NVT ASCII
  480.          strings in which upper and lower case are considered
  481.          equivalent.  The length of device-names and resource-names
  482.          should not exceed 8 bytes.
  483.  
  484.          A "generic session request" is one which includes neither
  485.          the CONNECT nor the ASSOCIATE command, while a "specific
  486.          session request" is one that includes either the CONNECT or
  487.          the ASSOCIATE command.
  488.  
  489.          If a TN3270E server wishes to support traditional tn3270
  490.          clients, it must maintain a set of terminal device-names
  491.          that can be used to satisfy requests from such clients for
  492.          terminal sessions.  This same pool could be used to satisfy
  493.          generic requests for terminal sessions from TN3270E clients.
  494.  
  495.          The server may also maintain any number of other pools of
  496.          device-names.  For example, there could be a pool of terminal
  497.          device-names reserved for a specific department within the
  498.          organization, or a pool of terminal device-names that have
  499.          access to certain applications on the host.
  500.  
  501.          For any of these terminal device pools, the TN3270E server may
  502.          also have defined a "partner" or "paired" printer device for
  503.          each terminal in the pool.  There should be a unique,
  504.          one-to-one mapping between a terminal and its associated
  505.          printer.  The reasoning behind such a configuration is to allow
  506.          for those host applications that produce printed output bound
  507.          for a printer whose device-name is determined by the
  508.          device-name of the terminal that initiated the print request.
  509.          These printer devices can only be assigned to specific printer
  510.          session requests that use the ASSOCIATE command (see below).
  511.  
  512.          In addition, the TN3270E server may also maintain one or more
  513.          pools of printer device-names that are not associated with any
  514.          terminal.  These printer devices can only be assigned to
  515.          specific printer session requests that use the CONNECT command
  516.          (see below).  This allows for those host applications that
  517.          generate printed output bound for a printer whose device-name
  518.          is determined by something other than the device-name of the
  519.          terminal that initiated the print request (for example, when
  520.          the userid of the person signed on to a terminal determines the
  521.          print destination).  It is also possible that a pool of printer
  522.  
  523.  
  524.  
  525. Kelly                                                           [Page 9]
  526.  
  527. Internet Draft            TN3270 Enhancements                   May 1997
  528.  
  529.  
  530.          device-names could be maintained to satisfy generic requests
  531.          for printers (i.e., those that specify neither CONNECT nor
  532.          ASSOCIATE).
  533.  
  534.       7.1.2 CONNECT Command
  535.  
  536.          CONNECT can be used by the client in two ways: if the resource-
  537.          name it specifies is a device-name, then the client is
  538.          requesting a specific device-name.  If the specified resource-
  539.          name is not a device-name, then the client is requesting any
  540.          one of the device-names associated with the resource-name.
  541.  
  542.          In either case, the resource indicated by the specified
  543.          resource-name must not conflict with the device-type; e.g., if
  544.          the client requests DEVICE-TYPE IBM-3287-1 (a printer) and
  545.          specifies CONNECT T1000001, but T1000001 is a device-name
  546.          defined at the host as a terminal, then the server must deny
  547.          the request.  Further, if the requested resource-name is a
  548.          device-name already associated with some other Telnet session,
  549.          or if it is not defined to the server, the server must deny the
  550.          request.
  551.  
  552.       7.1.3 ASSOCIATE Command
  553.  
  554.          ASSOCIATE can be used by the client only when requesting a
  555.          DEVICE-TYPE that represents a printer, and the specified
  556.          device-name must be that of a terminal that was returned by the
  557.          server in a previous DEVICE-TYPE IS <device-type> CONNECT
  558.          <device-name> command.
  559.  
  560.          The ASSOCIATE command requests that this session be assigned
  561.          the device-name of the printer that is paired with the terminal
  562.          named in the request.  If the device-type does not represent a
  563.          printer, or if the device-name is not that of a terminal, then
  564.          the server must deny the request.  Also, if the server does not
  565.          have defined a partner printer for the specified terminal, it
  566.          must deny the request.
  567.  
  568.          The use of the ASSOCIATE command is to be as follows:  A client
  569.          first connects and requests a terminal from one of the terminal
  570.          pools; it then uses the terminal device-name returned by the
  571.          server (see "Accepting a Request", section 7.1.4 below) in a
  572.          second session request, this time asking for the printer that
  573.          is paired with the terminal session it just established.  This
  574.          allows clients to associate a printer session with a terminal
  575.          rather than having to have prior knowledge of a printer
  576.          device-name.
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584. Kelly                                                          [Page 10]
  585.  
  586. Internet Draft            TN3270 Enhancements                   May 1997
  587.  
  588.  
  589.       7.1.4 Accepting a Request
  590.  
  591.          The server must accept the client's request or deny it as a
  592.          whole - it cannot, for example, accept the DEVICE-TYPE request
  593.          but deny the CONNECT portion.
  594.  
  595.          If the server wishes to accept the request, it sends back the
  596.          DEVICE-TYPE IS command confirming the requested device-type and
  597.          the CONNECT command specifying the device-name of the terminal
  598.          or printer assigned to this session.
  599.  
  600.          Normally, the client should accept any DEVICE-TYPE IS
  601.          <device-type> CONNECT <device-name> sent by the server.
  602.          An exception to this would be if the client must (e.g., to
  603.          satisfy local-site policy) be connected to a specific LU name
  604.          and is presented with a device-name which does not match the
  605.          one requested by the client (this could happen, for example, if
  606.          the client requested what it thought was a device-name, but
  607.          what was defined at the server as the name of a pool of
  608.          devices).  In this case, the client should reject the
  609.          DEVICE-TYPE IS command by terminating TN3270E negotiations.
  610.  
  611.       7.1.5 REJECT Command
  612.  
  613.          If the server wishes to deny the request, it sends back the
  614.          DEVICE-TYPE REJECT command with one of the following reason-
  615.          codes:
  616.  
  617.          Reason code name         Explanation
  618.          ----------------         -----------------------------------
  619.          INV-DEVICE-TYPE          The server does not support the
  620.                                   requested device-type.
  621.  
  622.          INV-NAME                 The resource-name or device-name
  623.                                   specified in the CONNECT or ASSOCIATE
  624.                                   command is not known to the server.
  625.  
  626.          DEVICE-IN-USE            The requested device-name is
  627.                                   already associated with another
  628.                                   session.
  629.  
  630.          TYPE-NAME-ERROR          The requested device-name or
  631.                                   resource-name is incompatible
  632.                                   with the requested device-type
  633.                                   (such as terminal/printer mismatch).
  634.  
  635.          UNSUPPORTED-REQ          The server is unable to satisfy
  636.                                   the type of request sent by the
  637.                                   client; e.g., a specific terminal
  638.                                   or printer was requested but the
  639.                                   server does not have any such pools of
  640.  
  641.  
  642.  
  643. Kelly                                                          [Page 11]
  644.  
  645. Internet Draft            TN3270 Enhancements                   May 1997
  646.  
  647.  
  648.                                   device-names defined to it, or the
  649.                                   ASSOCIATE command was used but no
  650.                                   partner printers are defined to the
  651.                                   server.
  652.  
  653.          INV-ASSOCIATE            The client used the ASSOCIATE
  654.                                   command and either the device-type
  655.                                   is not a printer or the device-name
  656.                                   is not a terminal.
  657.  
  658.          CONN-PARTNER             The client used the CONNECT command
  659.                                   to request a specific printer but
  660.                                   the device-name requested is the
  661.                                   partner to some terminal.
  662.  
  663.          UNKNOWN-ERROR            Any other error in device type or
  664.                                   name processing has occurred.
  665.  
  666.          The process of negotiating a device-type and device-name that
  667.          are acceptable to both client and server may entail several
  668.          iterations of DEVICE-TYPE REQUEST and DEVICE-TYPE REJECT
  669.          commands.  The client must make use of the reason-code
  670.          specified by the server in any DEVICE-TYPE REJECT command(s) to
  671.          minimize the amount of negotiation necessary.  For example, if
  672.          the client initially requests that it be assigned a specific
  673.          terminal device-name via the CONNECT command, and the server
  674.          rejects the request with a reason-code of UNSUPPORTED-REQ, the
  675.          client must make no further specific terminal requests in the
  676.          negotiations.  If at any point in the process either side
  677.          wishes to "bail out," it can simply send a WON'T (or DON'T)
  678.          TN3270E command to the other side.  At this point both sides
  679.          are free to negotiate other Telnet options (including
  680.          traditional tn3270).
  681.  
  682.    7.2 FUNCTIONS Negotiation
  683.  
  684.          Once the DEVICE-TYPE negotiation has successfully completed
  685.          (i.e, when the client receives a DEVICE-TYPE IS command that is
  686.          acceptable), the client must initiate the FUNCTIONS negotiation
  687.          by sending the FUNCTIONS REQUEST command to the server.  After
  688.          this initial REQUEST command, both sides are free to transmit
  689.          FUNCTIONS REQUEST and FUNCTIONS IS commands as needed.
  690.  
  691.       7.2.1 Commands
  692.  
  693.          The FUNCTIONS REQUEST command contains a list of the TN3270E
  694.          functions that the sender would like to see supported on this
  695.          session.  All functions not in the list are to be considered
  696.          unsupported.  The list is terminated by the IAC code that
  697.          precedes the SE command.  Functions may appear in any order in
  698.          the list.
  699.  
  700.  
  701.  
  702. Kelly                                                          [Page 12]
  703.  
  704. Internet Draft            TN3270 Enhancements                   May 1997
  705.  
  706.  
  707.          Upon receipt of a FUNCTIONS REQUEST command, the recipient has
  708.          two choices:
  709.  
  710.        - it may respond in the positive (meaning it agrees to support
  711.          all functions in the list, and not to transmit any data
  712.          related to functions not in the list).  To do this, it sends
  713.          the FUNCTIONS IS command with the function-list exactly as it
  714.          was received.  At this point, FUNCTIONS negotiation has
  715.          successfully completed.
  716.  
  717.        - it may respond in the negative by sending a FUNCTIONS
  718.          REQUEST command in which the function-list differs from the
  719.          one it received (and not simply in the order of appearance
  720.          of functions in the list; at least one function must have
  721.          been added to, or removed from, the list).
  722.  
  723.          To avoid endlessly looping, both parties must not add to the
  724.          function-list it receives any function that it has previously
  725.          added and that the other side has removed.
  726.  
  727.          The process of sending FUNCTIONS REQUEST commands back and
  728.          forth continues until one side receives a function-list it is
  729.          willing to live with.  It uses the FUNCTIONS IS command to
  730.          accept the list, and, once this command is received by the
  731.          other side, all necessary negotiation has been completed.  At
  732.          this point, 3270 data stream transmission can begin.
  733.  
  734.          Note that it is possible that the function-list agreed to is
  735.          null; this is referred to as "basic TN3270E".  See the section
  736.          entitled "Basic TN3270E" for more information.
  737.  
  738.          If an impasse is reached during FUNCTIONS negotiation (for
  739.          example, if a client requested and was granted a DEVICE-TYPE
  740.          representing a printer, but refuses to accept either the
  741.          SCS-CTL-CODES or DATA-STREAM-CTL function), then the
  742.          "offended" party should terminate the negotiation by sending
  743.          an IAC DON'T (or WON'T) TN3270E.
  744.  
  745.       7.2.2 List of TN3270E Functions
  746.  
  747.          The following list briefly describes the 3270 functions that
  748.          may be negotiated in the function-list:
  749.  
  750.          Function Name       Description
  751.          -------------       -----------
  752.          SCS-CTL-CODES       (Printer sessions only).  Allows the use
  753.                              of the SNA Character Stream (SCS) and SCS
  754.                              control codes on the session.  SCS is
  755.                              used with LU type 1 SNA sessions.
  756.  
  757.  
  758.  
  759.  
  760.  
  761. Kelly                                                          [Page 13]
  762.  
  763. Internet Draft            TN3270 Enhancements                   May 1997
  764.  
  765.  
  766.          DATA-STREAM-CTL     (Printer sessions only).  Allows the use
  767.                              of the standard 3270 data stream.  This
  768.                              corresponds to LU type 3 SNA sessions.
  769.  
  770.          RESPONSES           Provides support for positive and
  771.                              negative response handling.  Allows the
  772.                              server to reflect to the client any and
  773.                              all definite, exception, and no response
  774.                              requests sent by the host application.
  775.  
  776.          BIND-IMAGE          Allows the server to send the SNA Bind
  777.                              image and Unbind notification to the
  778.                              client.
  779.  
  780.          SYSREQ              Allows the client and server to emulate
  781.                              some (or all, depending on the server) of
  782.                              the functions of the SYSREQ key in an SNA
  783.                              environment.
  784.  
  785.          See the section entitled "Details of Processing TN3270E
  786.          Functions" for a more detailed explanation of the meaning and
  787.          use of these functions.
  788.  
  789.          If in the process of functions negotiation an unrecognized
  790.          function code is recieved, the recipient should simply remove
  791.          that function code from the list and continue normal functions
  792.          negotiation.
  793.  
  794. 8.  TN3270E Data Messages
  795.  
  796.    3270 device communications are generally understood to be block
  797.    oriented in nature.  That is, each partner buffers data until an
  798.    entire "message" has been built, at which point the data is sent to
  799.    the other side.  The "outbound message" (from host to device)
  800.    consists of a 3270 command and a series of buffer orders, buffer
  801.    addresses, and data, while the "inbound message" contains only buffer
  802.    orders, addresses and data.  The end of a message is understood to be
  803.    the last byte transmitted (note that this discussion disregards SNA
  804.    chaining).  The Telnet EOR command is used to delimit these natural
  805.    blocks of 3270 data within the Telnet data stream.
  806.  
  807.    In TN3270E, each 3270 message must be prefixed with a TN3270E header,
  808.    which consists of five bytes and whose format is defined below (see
  809.    the section entitled "The TN3270E Message Header").  A "data message"
  810.    in TN3270E therefore has the following construction:
  811.  
  812.           <TN3270E Header><data><IAC EOR>
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820. Kelly                                                          [Page 14]
  821.  
  822. Internet Draft            TN3270 Enhancements                   May 1997
  823.  
  824.  
  825.    It should be noted that it is possible that, for certain message
  826.    types, there is no data portion present.  In this case, the TN3270E
  827.    data message consists of:
  828.  
  829.           <TN3270E Header><IAC EOR>
  830.  
  831.    If either side wishes to transmit the decimal value 255 and have it
  832.    interpreted as data, it must "double" this byte.  In other words, a
  833.    single occurrence of decimal 255 will be interpreted by the other
  834.    side as an IAC, while two successive bytes containing decimal 255
  835.    will be treated as one data byte with a value of decimal 255.
  836.  
  837.    It is strongly recommended that Telnet commands (other than IAC IAC)
  838.    should be sent between TN3270E data messages, with no header and no
  839.    trailing IAC EOR.  If a TN3270E data message containing either IAC IP
  840.    (to be interpreted as 3270 Attention) or IAC AO (to be interpreted as
  841.    SYSREQ) is received, the receiver should defer processing the command
  842.    until the 3270 data has been processed (see the appropriate sections
  843.    for discussion of 3270 Attention and SYSREQ).  If a TN3270E data
  844.    message containing any other IAC-command sequence (other than IAC
  845.    IAC) is received, it is implementation dependent when the IAC-command
  846.    sequence will be processed, but it must be processed.  The receiver
  847.    may process it immediately, which in effect causes it to be processed
  848.    as if it had been received before the current TN3270E data message,
  849.    or the processing may be deferred until after the current TN3270E
  850.    data message has been processed.  It is because of this ambiguity
  851.    that the presence of Telnet commands within a TN3270E data message
  852.    (i.e., between the header and the trailing IAC EOR) is not
  853.    recommended; neither clients nor servers should send such data.
  854.  
  855.    8.1 The TN3270E Message Header
  856.  
  857.       As stated earlier, each data message in TN3270E must be prefixed
  858.       by a header, which consists of five bytes and is formatted as
  859.       follows:
  860.  
  861.       -----------------------------------------------------------
  862.       | DATA-TYPE | REQUEST-FLAG | RESPONSE-FLAG |  SEQ-NUMBER  |
  863.       -----------------------------------------------------------
  864.          1 byte        1 byte         1 byte         2 bytes
  865.  
  866.       8.1.1 DATA-TYPE Field
  867.  
  868.          The DATA-TYPE field indicates how the data portion of the
  869.          message is to be interpreted by the receiver.  Possible values
  870.          for the DATA-TYPE field are:
  871.  
  872.          Data-type Name   Code                Meaning
  873.          --------------   ----   ---------------------------------
  874.          3270-DATA        0x00   The data portion of the message
  875.                                  contains only the 3270 data stream.
  876.  
  877.  
  878.  
  879. Kelly                                                          [Page 15]
  880.  
  881. Internet Draft            TN3270 Enhancements                   May 1997
  882.  
  883.  
  884.          SCS-DATA         0x01   The data portion of the message
  885.                                  contains SNA Character Stream data.
  886.  
  887.          RESPONSE         0x02   The data portion of the message
  888.                                  constitutes device-status information
  889.                                  and the RESPONSE-FLAG field indicates
  890.                                  whether this is a positive or negative
  891.                                  response (see below).
  892.  
  893.          BIND-IMAGE       0x03   The data portion of the message is
  894.                                  the SNA bind image from the session
  895.                                  established between the server and the
  896.                                  host application.
  897.  
  898.          UNBIND           0x04   The data portion of the message is
  899.                                  an Unbind reason code.
  900.  
  901.          NVT-DATA         0x05   The data portion of the message is to
  902.                                  be interpreted as NVT data.
  903.  
  904.          REQUEST          0x06   There is no data portion present in
  905.                                  the message.  Only the REQUEST-FLAG
  906.                                  field has any meaning.
  907.  
  908.          SSCP-LU-DATA     0x07   The data portion of the message is
  909.                                  data from the SSCP-LU session.
  910.  
  911.          PRINT-EOJ        0x08   There is no data portion present in
  912.                                  the message.  This value can be sent
  913.                                  only by the server, and only on a
  914.                                  printer session.
  915.  
  916.       8.1.2 REQUEST-FLAG Field
  917.  
  918.          The REQUEST-FLAG field only has meaning when the DATA-TYPE
  919.          field has a value of REQUEST; otherwise, the REQUEST-FLAG field
  920.          must be ignored by the receiver and should be set to 0x00 by
  921.          the sender.  Possible values for the REQUEST-FLAG field are:
  922.  
  923.          Request-Flag Name   Code                Meaning
  924.          -----------------   ----   ---------------------------------
  925.          ERR-COND-CLEARED    0x00   The client sends this to the server
  926.                                     when some previously encountered
  927.                                     printer error condition has been
  928.                                     cleared.  (See the section entitled
  929.                                     "The RESPONSES Function" below.)
  930.  
  931.       8.1.3 RESPONSE-FLAG Field
  932.  
  933.          The RESPONSE-FLAG field only has meaning for certain values of
  934.          the DATA-TYPE field.  For DATA-TYPE field values of 3270-DATA
  935.  
  936.  
  937.  
  938. Kelly                                                          [Page 16]
  939.  
  940. Internet Draft            TN3270 Enhancements                   May 1997
  941.  
  942.  
  943.          and SCS-DATA, the RESPONSE-FLAG is an indication of whether or
  944.          not the sender of the data expects to receive a response.  In
  945.          this case the possible values of RESPONSE-FLAG are:
  946.  
  947.          Response-Flag Name  Code                Meaning
  948.          ------------------  ----   ---------------------------------
  949.          NO-RESPONSE         0x00   The sender does not expect the
  950.                                     receiver to respond either
  951.                                     positively or negatively to this
  952.                                     message.  The receiver must
  953.                                     therefore not send any response
  954.                                     to this data-message.
  955.  
  956.          ERROR-RESPONSE      0x01   The sender only expects the
  957.                                     receiver to respond to this message
  958.                                     if some type of error occurred, in
  959.                                     which case a negative response must
  960.                                     be sent by the receiver.
  961.  
  962.          ALWAYS-RESPONSE     0x02   The sender expects the receiver to
  963.                                     respond negatively if an error
  964.                                     occurs, or positively if no errors
  965.                                     occur.  One or the other must
  966.                                     always be sent by the receiver.
  967.  
  968.          For a DATA-TYPE field value of RESPONSE, the RESPONSE-FLAG is
  969.          an actual response to a previous data message (which must by
  970.          definition have had a DATA-TYPE of either 3270-DATA or SCS-DATA
  971.          and a RESPONSE-FLAG value of either ERROR-RESPONSE or ALWAYS-
  972.          RESPONSE).  In this case the possible values of RESPONSE-FLAG
  973.          are:
  974.  
  975.          Response-Flag Name  Code                Meaning
  976.          ------------------  ----   ---------------------------------
  977.          POSITIVE-RESPONSE   0x00   The previous message was received
  978.                                     and executed successfully with
  979.                                     no errors.
  980.  
  981.          NEGATIVE-RESPONSE   0x01   The previous message was received
  982.                                     but an error(s) occurred while
  983.                                     processing it.
  984.  
  985.          Accompanying status information will be found in the data
  986.          portion of the message.
  987.  
  988.          For any other values of the DATA-TYPE field, the RESPONSE-FLAG
  989.          field must be ignored by the receiver and should be set to 0x00
  990.          by the sender.
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997. Kelly                                                          [Page 17]
  998.  
  999. Internet Draft            TN3270 Enhancements                   May 1997
  1000.  
  1001.  
  1002.       8.1.4 SEQ-NUMBER Field
  1003.  
  1004.          The SEQ-NUMBER field is only used when the RESPONSES function
  1005.          has been agreed to.  It contains a 2 byte binary number, and is
  1006.          used to correlate positive and negative responses to the data
  1007.          messages for which they were intended.  This field must be sent
  1008.          in network byte order ("big endian").  If either byte contains
  1009.          a 0xff, it should be doubled to 0xffff before sending and
  1010.          stripped back to 0xff upon receipt; this is standard IAC
  1011.          escaping.  See the section entitled "The RESPONSES Function"
  1012.          for further information on the use of the SEQ-NUMBER field.
  1013.          When the RESPONSES function is not agreed to, this field should
  1014.          always be set to 0x0000 by the sender and ignored by the
  1015.          receiver.
  1016.  
  1017. 9.  Basic TN3270E
  1018.  
  1019.    As has been stated earlier, whether or not the use of each of the
  1020.    TN3270E functions is allowed on a session is negotiated when the
  1021.    connection is established.  It is possible that none of the functions
  1022.    are agreed to (in this case, the function-list in the FUNCTIONS
  1023.    REQUEST and FUNCTIONS IS commands is null).  This mode of operation
  1024.    is referred to as "basic TN3270E".  Note that, since neither the
  1025.    SCS-CTL-CODES function nor the DATA-STREAM-CTL function is agreed to,
  1026.    basic TN3270E refers to terminal sessions only.
  1027.  
  1028.    Basic TN3270E requires the support of only the following TN3270E
  1029.    header values:
  1030.  
  1031.           Header field         Value
  1032.           ------------         -----
  1033.            DATA-TYPE          3270-DATA
  1034.            DATA-TYPE          NVT-DATA
  1035.  
  1036.    The REQUEST-FLAG, RESPONSE-FLAG and SEQ-NUMBER fields are not used in
  1037.    basic TN3270E.
  1038.  
  1039.    9.1 3270 Mode and NVT Mode
  1040.  
  1041.       At any given time, a TN3270E connection can be considered to be
  1042.       operating in either "3270 mode" or "NVT mode".  In 3270 mode, each
  1043.       party may send data messages with the DATA-TYPE flag set to 3270-
  1044.       DATA; sending a DATA-TYPE flag set to NVT-DATA constitutes a
  1045.       request to switch modes.  In NVT mode, each party may send data
  1046.       messages with the DATA-TYPE flag set to NVT-DATA; sending 3270-
  1047.       DATA is a request to switch modes.  The connection is initially in
  1048.       3270 mode when TN3270E operation is successfully negotiated.  When
  1049.       a party receives a message with a DATA-TYPE different from the
  1050.       mode it is operating in, the mode of operation for the connection
  1051.       is switched.  Switching modes results in the client performing the
  1052.       equivalent of a 3270 Erase/Reset operation, as described in [5],
  1053.  
  1054.  
  1055.  
  1056. Kelly                                                          [Page 18]
  1057.  
  1058. Internet Draft            TN3270 Enhancements                   May 1997
  1059.  
  1060.  
  1061.       using the default partition (screen) size.  The server cannot
  1062.       assume the client preserves any attributes of the previous
  1063.       environment across a mode switch.
  1064.  
  1065.       Note that even when sending NVT-DATA, each side should buffer data
  1066.       until an entire message is built (for the client, this would
  1067.       normally mean until the user presses Enter).  At that point, a
  1068.       complete TN3270E data message should be built to transmit the NVT
  1069.       data.
  1070.  
  1071.       Typically, NVT data is used by a server to interact with the user
  1072.       of a client.  It allows the server to do this using a simple NVT
  1073.       data stream, instead of requiring a 3270 data stream.  An example
  1074.       would be a server which displays a list of 3270 applications to
  1075.       which it can connect the client.  The server would use NVT data to
  1076.       display the list and read the user's choice.  Then the server
  1077.       would connect to the application, and begin the exchange of 3270
  1078.       data between the application and the client.
  1079.  
  1080. 10.  Details of Processing TN3270E Functions
  1081.  
  1082.    Agreement by both parties to a specific function in the FUNCTIONS
  1083.    REQUEST function-list implies agreement by each party to support a
  1084.    related set of values in the TN3270E header.  It also implies a
  1085.    willingness to adhere to the rules governing the processing of data
  1086.    messages with regard to the agreed upon function.  Either party that
  1087.    fails to accept header values associated either with agreed upon
  1088.    functions or with basic TN3270E, or attempts to use header values
  1089.    associated with a function that is not a part of basic TN3270E and
  1090.    was not agreed upon, will be considered non-conforming and in
  1091.    violation of the protocol.  The following sections detail for each
  1092.    TN3270E function the associated header values and processing rules.
  1093.  
  1094.    10.1 The SCS-CTL-CODES Function
  1095.  
  1096.       This function can only be supported on a 3270 printer session.
  1097.  
  1098.       Agreement to support this function requires that the party support
  1099.       the following TN3270E header values:
  1100.  
  1101.           Header field         Value
  1102.           ------------         -----
  1103.            DATA-TYPE          SCS-DATA
  1104.            DATA-TYPE          PRINT-EOJ
  1105.  
  1106.       A client representing a printer device uses this function to
  1107.       indicate its willingness to accept a data stream that includes SCS
  1108.       control codes.  For the purposes of NVT mode versus 3270 mode,
  1109.       SCS-DATA must be treated exactly like 3270-DATA (i.e., it can
  1110.       cause a switch from NVT mode to 3270 mode).
  1111.  
  1112.  
  1113.  
  1114.  
  1115. Kelly                                                          [Page 19]
  1116.  
  1117. Internet Draft            TN3270 Enhancements                   May 1997
  1118.  
  1119.  
  1120.       When a printer device-type has been negotiated, either the SCS-
  1121.       CTL-CODES function or the DATA-STREAM-CTL function, or both, must
  1122.       be negotiated.  This enables the server to know when it should and
  1123.       should not accept a session with a host application on behalf of
  1124.       the client.  If only the SCS-CTL-CODES function is agreed to, then
  1125.       the server will not establish sessions with host applications that
  1126.       would send 3270 data stream control.  If both SCS-CTL-CODES and
  1127.       DATA-STREAM-CTL are agreed to, then the server will establish
  1128.       sessions both with host applications that would send SCS control
  1129.       codes and with those that would send 3270 orders.
  1130.  
  1131.       The server should send a TN3270E message with DATA-TYPE set to
  1132.       PRINT-EOJ at the end of each print job to indicate to the client
  1133.       that it may now take whatever action is appropriate for its
  1134.       environment (e.g., close a disk or spool file, etc.).  The server
  1135.       may have multiple criteria for determining when it should send a
  1136.       PRINT-EOJ, such as receipt of SNA End Bracket from the host
  1137.       application, or expiration of a pre-defined timeout value.
  1138.  
  1139.    10.2 The DATA-STREAM-CTL Function
  1140.  
  1141.       This function can only be supported on a 3270 printer session.
  1142.  
  1143.       Agreement to support this function requires that the party support
  1144.       the following TN3270E header values:
  1145.  
  1146.           Header field         Value
  1147.           ------------         -----
  1148.            DATA-TYPE          3270-DATA
  1149.            DATA-TYPE          PRINT-EOJ
  1150.  
  1151.       A client representing a printer device uses this function to
  1152.       indicate its willingness to accept a data stream that includes
  1153.       3270 orders and attributes.
  1154.  
  1155.       When a printer device-type has been negotiated, either the SCS-
  1156.       CTL-CODES function or the DATA-STREAM-CTL function, or both, must
  1157.       be negotiated.  This enables the server to know when it should and
  1158.       should not accept a session with a host application on behalf of
  1159.       the client.  If only the DATA-STREAM-CTL function is agreed to,
  1160.       then the server will not establish sessions with host applications
  1161.       that would send SCS control codes in a data stream.  If both SCS-
  1162.       CTL-CODES and DATA-STREAM-CTL are agreed to, then the server will
  1163.       establish sessions both with host applications that would send SCS
  1164.       control codes and with those that would send 3270 orders.
  1165.  
  1166.       The server should send a TN3270E message with DATA-TYPE set to
  1167.       PRINT-EOJ at the end of each print job to indicate to the client
  1168.       that it may now take whatever action is appropriate for its
  1169.       environment (e.g., close a disk or spool file, etc.).  The server
  1170.       may have multiple criteria for determining when it should send a
  1171.  
  1172.  
  1173.  
  1174. Kelly                                                          [Page 20]
  1175.  
  1176. Internet Draft            TN3270 Enhancements                   May 1997
  1177.  
  1178.  
  1179.       PRINT-EOJ, such as receipt of SNA End Bracket from the host
  1180.       application, or expiration of a pre-defined timeout value.
  1181.  
  1182.    10.3 The BIND-IMAGE Function
  1183.  
  1184.       This function can only be supported when the TN3270E server
  1185.       represents SNA terminals and printers.
  1186.  
  1187.       Agreement to support this function requires that the party support
  1188.       the following TN3270E header values:
  1189.  
  1190.           Header field         Value
  1191.           ------------         -----
  1192.            DATA-TYPE          BIND-IMAGE
  1193.            DATA-TYPE          UNBIND
  1194.            DATA-TYPE          SSCP-LU-DATA
  1195.  
  1196.       When BIND-IMAGE is in effect, the server must inform the client
  1197.       when an SNA session has been established with a host application,
  1198.       and when such a session has been terminated.  It uses DATA-TYPE
  1199.       values of BIND-IMAGE and UNBIND to convey this information.
  1200.  
  1201.       When establishing an SNA session on behalf of a client, the server
  1202.       will receive a Bind RU from the host application.  It will also
  1203.       receive a Start Data Traffic RU.  Once both of these have been
  1204.       responded to positively by the server, it must then inform the
  1205.       client of the presence of this session by sending it a data
  1206.       message with the DATA-TYPE flag set to BIND-IMAGE.  The data
  1207.       portion of this message must contain the bind image exactly as it
  1208.       was received in the Bind RU that the server accepted on behalf of
  1209.       the client.  The format and maximum length of this bind image is
  1210.       defined in [6].
  1211.  
  1212.       When an SNA session between the server and a host application is
  1213.       terminated, the server must send a data message to the client
  1214.       with the DATA-TYPE flag set to UNBIND.  If the server was notified
  1215.       of the session termination via an SNA Unbind RU, it should include
  1216.       the Unbind reason code in the data portion of the message it sends
  1217.       to the client.  If the server itself requested the SNA session
  1218.       termination (for example, as part of SYSREQ key processing), it
  1219.       should set the data portion of the UNBIND message to 0x01,
  1220.       indicating "normal end of session".
  1221.  
  1222.       Another aspect of the BIND-IMAGE function alters the allowable
  1223.       DATA-TYPE flag values slightly from the behavior described in the
  1224.       section entitled "Basic TN3270E".  When BIND-IMAGE is in effect,
  1225.       data messages with DATA-TYPE set to 3270-DATA or SCS-DATA are not
  1226.       allowed before the first BIND-IMAGE is received by the client;
  1227.       only SSCP-LU-DATA or NVT-DATA can be used to transmit user-
  1228.       oriented data.  The same applies to data messages exchanged after
  1229.       an UNBIND is sent and before another BIND-IMAGE is received by the
  1230.  
  1231.  
  1232.  
  1233. Kelly                                                          [Page 21]
  1234.  
  1235. Internet Draft            TN3270 Enhancements                   May 1997
  1236.  
  1237.  
  1238.       client.  Once the client receives a BIND-IMAGE data message, the
  1239.       allowable DATA-TYPE values, in addition to SSCP-LU-DATA, now
  1240.       include 3270-DATA and/or SCS-DATA, depending on whether a terminal
  1241.       or printer device-type was negotiated, and whether a printer
  1242.       client agreed to DATA-STREAM-CTL or SCS-CTL-CODES, or both.  (See
  1243.       the section entitled "The SYSREQ Function" for further discussion
  1244.       of the SSCP-LU session in an SNA environment.)
  1245.  
  1246.    10.4 The RESPONSES Function
  1247.  
  1248.       This function can be supported for both terminal and printer
  1249.       sessions connected to both SNA and non-SNA servers.
  1250.  
  1251.       Agreement to support this function requires that the party support
  1252.       the following TN3270E header values:
  1253.  
  1254.           Header field         Value
  1255.           ------------         -----
  1256.            DATA-TYPE          RESPONSE
  1257.            DATA-TYPE          REQUEST
  1258.            RESPONSE-FLAG      -all values-
  1259.            REQUEST-FLAG       ERR-COND-CLEARED
  1260.            SEQ-NUMBER         binary values from 0-32767
  1261.  
  1262.       Whenever a data message is sent with a DATA-TYPE of either SCS-
  1263.       DATA or 3270-DATA, the sender must set the RESPONSE-FLAG field to
  1264.       either NO-RESPONSE, ERROR-RESPONSE, or ALWAYS-RESPONSE.  It is
  1265.       anticipated that the client side will normally set RESPONSE-FLAG
  1266.       to NO-RESPONSE.  The server, if it represents an SNA device,
  1267.       should set RESPONSE-FLAG to reflect the response value set in the
  1268.       RH of the RU that generated this data message - Definite Response
  1269.       resulting in a RESPONSE-FLAG value of ALWAYS-RESPONSE, Exception
  1270.       Response resulting in ERROR-RESPONSE being set, and No Response
  1271.       causing a setting of NO-RESPONSE.  A non-SNA server should set
  1272.       RESPONSE-FLAG to ERROR-RESPONSE.
  1273.  
  1274.       In addition, the sender must keep a count of the messages with a
  1275.       DATA-TYPE of 3270-DATA or SCS-DATA that it sends on a given
  1276.       TN3270E session.  This counter should start at zero for the first
  1277.       such message, and be incremented by one for each subsequent
  1278.       message.  Note that this counter is independent of any SNA
  1279.       sequence numbers, and should not be reset to zero as a result of
  1280.       Bind or Unbind.  If the counter reaches the maximum of 32767, it
  1281.       should be restarted at zero.  The sender must place this value in
  1282.       the SEQ-NUMBER field of the TN3270E header before it sends the
  1283.       message.  Note that the SEQ-NUMBER field must be set regardless of
  1284.       the value of the RESPONSE-FLAG field.
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292. Kelly                                                          [Page 22]
  1293.  
  1294. Internet Draft            TN3270 Enhancements                   May 1997
  1295.  
  1296.  
  1297.       10.4.1 Response Messages
  1298.  
  1299.          Whenever a data message with a DATA-TYPE of either SCS-DATA or
  1300.          3270-DATA is received, the receiver must attempt to process the
  1301.          data in the data portion of the message, then determine whether
  1302.          or not it should send a data message with a DATA-TYPE of
  1303.          RESPONSE.  If the data message it has just processed had a
  1304.          RESPONSE-FLAG value of NO-RESPONSE, or if it had a value of
  1305.          ERROR-RESPONSE and there were no errors encountered while
  1306.          processing the data, then no RESPONSE type message should be
  1307.          sent.  Otherwise, a data message should be sent in which the
  1308.          header DATA-TYPE field is set to RESPONSE, and in which the
  1309.          SEQ-NUMBER field is a copy of the SEQ-NUMBER field from the
  1310.          message to which this response corresponds.  The RESPONSE-FLAG
  1311.          field in this header must have a value of either POSITIVE-
  1312.          RESPONSE or NEGATIVE-RESPONSE.  A POSITIVE-RESPONSE should be
  1313.          sent if the previously processed message's header specified
  1314.          ALWAYS-RESPONSE and no errors were encountered in processing
  1315.          the data.  A NEGATIVE-RESPONSE should be sent when
  1316.  
  1317.           1) the previously processed message specified ERROR-RESPONSE
  1318.              or ALWAYS-RESPONSE and
  1319.  
  1320.           2) some kind of error occurred while processing the data.
  1321.  
  1322.          Normally only the client will be constructing and sending these
  1323.          RESPONSE messages.  A negative response sent by the client to
  1324.          the server is the equivalent of a Unit Check Status [7].  All
  1325.          references to device status and sense codes in this section
  1326.          rely on [7].
  1327.  
  1328.          The data portion of a RESPONSE message must consist of one byte
  1329.          of binary data.  The value of this byte gives a more detailed
  1330.          account of the results of having processed the previously
  1331.          received data message.  The possible values for this byte are:
  1332.  
  1333.            For a RESPONSE-FLAG value of POSITIVE-RESPONSE -
  1334.  
  1335.              Value            Meaning
  1336.              -----            -------
  1337.              0x00      Successful completion (when sent by the client,
  1338.                        this is equivalent to "Device End").
  1339.  
  1340.            For a RESPONSE-FLAG value of NEGATIVE-RESPONSE -
  1341.  
  1342.              Value            Meaning
  1343.              -----            -------
  1344.              0x00      An invalid 3270 command was received
  1345.                        (equivalent to "Command Reject").
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351. Kelly                                                          [Page 23]
  1352.  
  1353. Internet Draft            TN3270 Enhancements                   May 1997
  1354.  
  1355.  
  1356.              0x01      Printer is not ready (equivalent to
  1357.                        "Intervention Required").
  1358.  
  1359.              0x02      An illegal 3270 buffer address or order
  1360.                        sequence was received (equivalent to
  1361.                        "Operation Check").
  1362.  
  1363.              0x03      Printer is powered off or not connected
  1364.                        (equivalent to "Component Disconnected").
  1365.  
  1366.          When the server receives any of the above responses, it should
  1367.          pass along the appropriate information to the host application.
  1368.          The appropriate information is determined by whether the server
  1369.          represents an SNA or a non-SNA device.
  1370.  
  1371.          An SNA server should pass along a POSITIVE-RESPONSE from the
  1372.          client as an SNA positive Response Unit to the host
  1373.          application.  It should translate a NEGATIVE-RESPONSE from the
  1374.          client into an SNA negative Response Unit in which the Sense
  1375.          Data Indicator bit is on and which contains one of the
  1376.          following sense codes:
  1377.  
  1378.              RESPONSE-FLAG        Equivalent        SNA Sense Code
  1379.              -------------        ----------        --------------
  1380.                  0x00           Command Reject        0x10030000
  1381.  
  1382.                  0x01        Intervention Required    0x08020000
  1383.  
  1384.                  0x02           Operation Check       0x10050000
  1385.  
  1386.                  0x03        Component Disconnected   0x08310000
  1387.  
  1388.          A non-SNA server should pass along a POSITIVE-RESPONSE from the
  1389.          client by setting the Device End Status bit on.  It should
  1390.          reflect a NEGATIVE-RESPONSE from the client by setting the Unit
  1391.          Check Status Bit on, and setting either the Command Reject,
  1392.          Intervention Required, or Operation Check Sense bit on when
  1393.          responding to the Sense command.
  1394.  
  1395.          In the case of Intervention Required or Component Disconnected
  1396.          being passed by the server to the host application, the host
  1397.          would normally refrain from sending any further data to the
  1398.          printer.  If and when the error condition at the client has
  1399.          been resolved, the client must send to the server a data
  1400.          message whose header DATA-TYPE field is set to REQUEST, and
  1401.          whose REQUEST-FLAG is set to ERR-COND-CLEARED.  Note that this
  1402.          message has no data portion.  Upon receipt of this message, the
  1403.          server should pass along the appropriate information to the
  1404.          host application so that it may resume sending printer output.
  1405.          Again, the form of this information depends on whether the
  1406.          server represents an SNA or a non-SNA device.
  1407.  
  1408.  
  1409.  
  1410. Kelly                                                          [Page 24]
  1411.  
  1412. Internet Draft            TN3270 Enhancements                   May 1997
  1413.  
  1414.  
  1415.          An SNA server should reflect an ERR-COND-CLEARED to the host
  1416.          application by sending an SNA LUSTAT RU with one of the
  1417.          following sense codes:
  1418.  
  1419.           - if the previous error condition was an Intervention
  1420.             Required, the server should send sense code 0x00010000
  1421.  
  1422.           - if the previous error condition was Component
  1423.             Disconnected, the server should send sense code 0x082B0000
  1424.  
  1425.          A non-SNA server should set the corresponding bits in the
  1426.          Ending Status and Sense Condition bytes.
  1427.  
  1428.    10.5 The SYSREQ Function
  1429.  
  1430.       This function can only be supported when the TN3270E server
  1431.       represents SNA devices.
  1432.  
  1433.       Agreement to support this function requires that the party support
  1434.       the following TN3270E header values:
  1435.  
  1436.           Header field         Value
  1437.           ------------         -----
  1438.            DATA-TYPE          SSCP-LU-DATA
  1439.  
  1440.       The 3270 SYSREQ key can be useful in an SNA environment when the
  1441.       ATTN key is not sufficient to terminate a process.  (See the
  1442.       section entitled "The 3270 ATTN Key" for more information.)
  1443.  
  1444.       10.5.1 Background
  1445.  
  1446.          In SNA, there is a session between the host application (the
  1447.          PLU, or Primary Logical Unit) and the TN3270E server
  1448.          representing the client (the SLU, or Secondary Logical Unit).
  1449.          This is referred to as the PLU-SLU session, and it is the one
  1450.          on which normal communications flow.  There is also a session
  1451.          between the host telecommunications access method (the SSCP, or
  1452.          System Services Control Point) and the SLU, and it is referred
  1453.          to as the SSCP-LU session.  This session is used to carry
  1454.          various control information and is normally transparent to the
  1455.          user; normal 3270 data stream orders are not allowed in this
  1456.          data.  For more information, refer to [7].
  1457.  
  1458.          The terminal display and keyboard are usually "owned" by the
  1459.          PLU-SLU session, meaning any data the user types is sent to the
  1460.          host application.  The SYSREQ key is used to toggle ownership
  1461.          of the keyboard and display between the PLU-SLU session and the
  1462.          SSCP-LU session.  In other words, the user is able to press
  1463.          SYSREQ and then communicate directly with the host SSCP.  The
  1464.          user may then enter any valid Unformatted Systems Services
  1465.          commands, which are defined in the USS table associated with
  1466.  
  1467.  
  1468.  
  1469. Kelly                                                          [Page 25]
  1470.  
  1471. Internet Draft            TN3270 Enhancements                   May 1997
  1472.  
  1473.  
  1474.          the SLU.  The most common USS command users employ is "LOGOFF,"
  1475.          which requests that the SSCP immediately terminate the PLU-SLU
  1476.          session.  The usual reason for requesting such an action is
  1477.          that the host application (the PLU) has stopped responding
  1478.          altogether.
  1479.  
  1480.          Whenever the keyboard and display are owned by the SSCP-LU
  1481.          session, no data is allowed to flow in either direction on the
  1482.          PLU-SLU session.  Once "in" the SSCP-LU session, the user may
  1483.          decide to switch back to the PLU-SLU session by again pressing
  1484.          the SYSREQ key.
  1485.  
  1486.       10.5.2 TN3270E Implementation of SYSREQ
  1487.  
  1488.          The design of some TN3270E servers allows them to fully support
  1489.          the SYSREQ key because they are allowed to send USS commands on
  1490.          the SSCP-LU session.  Other TN3270E servers operate in an
  1491.          environment which does not allow them to send USS commands to
  1492.          the SSCP; this makes full support of the SYSREQ key impossible.
  1493.          For such servers, TN3270E provides for emulation of a minimal
  1494.          subset of functions, namely, for the sequence of pressing
  1495.          SYSREQ and typing LOGOFF that many users employ to immediately
  1496.          terminate the PLU-SLU session.
  1497.  
  1498.          The Telnet Abort Output (AO) command is the mechanism used to
  1499.          implement SYSREQ key support in TN3270E because, in a real SNA
  1500.          session, once the user presses the SYSREQ key, the host
  1501.          application is prevented from sending any more output to the
  1502.          terminal (unless the user presses SYSREQ a second time), but
  1503.          the user's process continues to execute.
  1504.  
  1505.          In order to implement SYSREQ key support, TN3270E clients that
  1506.          have agreed to the SYSREQ function should provide a key (or
  1507.          combination of keys) that is identified as mapping to the 3270
  1508.          SYSREQ key.  When the user presses this key(s), the client
  1509.          should transmit a Telnet AO command to the server.
  1510.  
  1511.          Upon receipt of the AO command, a TN3270E server that has
  1512.          agreed to the SYSREQ function should enter what will be loosely
  1513.          termed "suspended mode" for the connection.  If a server that
  1514.          has not agreed to the SYSREQ function receives an AO command,
  1515.          it should simply ignore it.  Any attempt by the host
  1516.          application to send data to the client while the connection is
  1517.          "suspended" should be responded to by the server with a
  1518.          negative response, sense code 0x082D, indicating an "LU Busy"
  1519.          condition.  The server should not transmit anything to the
  1520.          client on behalf of the host application.  While the connection
  1521.          is "suspended," any data messages exchanged between the client
  1522.          and server should have the DATA-TYPE flag set to SSCP-LU-DATA;
  1523.          the data stream will be as defined in [7], specifically the
  1524.          section entitled "Operation in SSCP-SLU Session."
  1525.  
  1526.  
  1527.  
  1528. Kelly                                                          [Page 26]
  1529.  
  1530. Internet Draft            TN3270 Enhancements                   May 1997
  1531.  
  1532.  
  1533.          At this point, the behavior of the server depends upon whether
  1534.          or not it is allowed to send USS commands on the SSCP-LU
  1535.          session.  Servers that have this ability should simply act as a
  1536.          vehicle for passing USS commands and responses between the
  1537.          client and the SSCP.
  1538.  
  1539.          Servers that are not allowed to send USS commands on the SSCP-
  1540.          LU session should behave as follows:
  1541.  
  1542.          - if the user transmits the string LOGOFF (upper or lower case),
  1543.            the server should send an Unbind SNA RU to the host
  1544.            application.  This will result in termination of the PLU-SLU
  1545.            session.  If the BIND-IMAGE function was agreed upon, then
  1546.            the server should also send a data message to the client with
  1547.            the DATA-TYPE flag set to UNBIND and the data portion set to
  1548.            0x01.
  1549.  
  1550.          - if the user transmits anything other than LOGOFF, the server
  1551.            should respond with the string "COMMAND UNRECOGNIZED" to the
  1552.            client.  The server should not send anything to the host
  1553.            application on behalf of the client.
  1554.  
  1555.          Regardless of which kind of server is present (i.e., whether or
  1556.          not it may send USS commands on the SSCP-LU session), while the
  1557.          connection is suspended, the user may press the "SYSREQ" key
  1558.          again.  This will result in the transmission of another AO to
  1559.          the server.  The server should then send to the host
  1560.          application an LUSTAT RU with a value of 0x082B indicating
  1561.          "presentation space integrity lost".  The server will then
  1562.          "un-suspend" the Telnet connection to the client, meaning it
  1563.          will allow the host application to once again send data to the
  1564.          client.
  1565.  
  1566. 11.  The 3270 ATTN Key
  1567.  
  1568.    The 3270 ATTN key is interpreted by many host applications in an SNA
  1569.    environment as an indication that the user wishes to interrupt the
  1570.    execution of the current process.  The Telnet Interrupt Process (IP)
  1571.    command was defined expressly for such a purpose, so it is used to
  1572.    implement support for the 3270 ATTN key.  This requires two things:
  1573.  
  1574.        - TN3270E clients should provide as part of their keyboard
  1575.          mapping a single key or a combination of keys that map to
  1576.          the 3270 ATTN key.  When the user presses this key(s), the
  1577.          client should transmit a Telnet IP command to the server.
  1578.  
  1579.        - TN3270E servers should translate the IP command received from
  1580.          a TN3270E client into the appropriate form and pass it along
  1581.          to the host application as an ATTN key.  In other words, the
  1582.          server representing an SLU in an SNA session should send
  1583.          a SIGNAL RU to the host application.
  1584.  
  1585.  
  1586.  
  1587. Kelly                                                          [Page 27]
  1588.  
  1589. Internet Draft            TN3270 Enhancements                   May 1997
  1590.  
  1591.  
  1592.    The ATTN key is not supported in a non-SNA environment; therefore, a
  1593.    TN3270E server representing non-SNA 3270 devices should ignore any
  1594.    Telnet IP commands it receives from a client.
  1595.  
  1596. 12.  3270 Structured Fields
  1597.  
  1598.    3270 structured fields provide a much wider range of features than
  1599.    "old-style" 3270 data, such as support for graphics, partitions and
  1600.    IPDS printer data streams. It would be unreasonable to expect all
  1601.    TN3270E clients to support all possible structured field functions,
  1602.    yet there must be a mechanism by which those clients that are capable
  1603.    of supporting some or all structured field functions can indicate
  1604.    their wishes.
  1605.  
  1606.    The design of 3270 structured fields provides a convenient means to
  1607.    convey the level of support (including no support) for the various
  1608.    structured field functions.  This mechanism is the Read Partition
  1609.    Query command, which is sent from the host application to the device.
  1610.    The device responds with a Query Reply structured field(s) listing
  1611.    which, if any, structured field functions it supports.
  1612.  
  1613.    The Query Reply is also used to indicate some device capabilities
  1614.    which do not require the use of structured fields, such as extended
  1615.    color support and extended highlighting capability.  Most host
  1616.    applications will use Read Partition Query to precisely determine a
  1617.    device's capabilities when there has been some indication that the
  1618.    device supports the "extended data stream".
  1619.  
  1620.    Therefore, all TN3270E clients that negotiate a terminal device-type
  1621.    that contains a "-E" suffix, the DYNAMIC terminal type, or a printer
  1622.    device-type, must be able to respond to a Read Partition Query
  1623.    command.  Note that these clients must support both the Read
  1624.    Partition Query (Type 02), and all forms of the Read Partition Query
  1625.    List (Type 03).
  1626.  
  1627. 13.  Implementation Guidelines
  1628.  
  1629.    13.1 3270 Data Stream Notes
  1630.  
  1631.       Implementors of TN3270E clients should note that the command codes
  1632.       for the various 3270 Read and Write commands have different values
  1633.       depending on how the server is connected to the host (local versus
  1634.       remote, SNA versus non-SNA).  Clients should be coded to check for
  1635.       the various possible values if they wish to be compatible with the
  1636.       widest range of servers.  See [7] for further details.
  1637.  
  1638.    13.2 Negotiation of the TN3270E Telnet Option
  1639.  
  1640.       Since TN3270E is a Telnet Option governed by [8], both client and
  1641.       server are free to attempt to initiate negotiation of TN3270E by
  1642.       sending a DO TN3270E command.  However, just as is usually the
  1643.  
  1644.  
  1645.  
  1646. Kelly                                                          [Page 28]
  1647.  
  1648. Internet Draft            TN3270 Enhancements                   May 1997
  1649.  
  1650.  
  1651.       case with the Telnet DO TERMINAL-TYPE, it is anticipated that the
  1652.       server will normally be the one sending the DO TN3270E, and the
  1653.       client will be responding with a WILL or a WON'T TN3270E.
  1654.  
  1655.    13.3 A "Keep-alive" Mechanism
  1656.  
  1657.       In many environments, it is very helpful to have in place a
  1658.       mechanism that allows timely notification of the loss of a 3270
  1659.       session.  TN3270E does not require that any form of keep-alive
  1660.       mechanism be employed by either clients or servers, but
  1661.       implementors wishing to support such a mechanism should consider
  1662.       the following guidelines.
  1663.  
  1664.       There are at least three possible means of providing a keep-alive
  1665.       mechanism in TN3270E: the TCP Keepalive, the Telnet IAC NOP
  1666.       command [8], and the Telnet DO TIMING-MARK option [9].  Each
  1667.       method has its advantages and disadvantages.  It is recommended
  1668.       that TN3270E clients and servers that support keep-alives should
  1669.       support all three methods, and that both sides should always
  1670.       respond to TIMING-MARKs.
  1671.  
  1672.       Note that both clients and servers could be configured to
  1673.       "actively" implement keep-alives.  That is, both sides could send
  1674.       a TIMING-MARK or a NOP or issue a TCP Keepalive in order to
  1675.       determine whether or not the partner is still alive.
  1676.       Alternatively, network administrators may wish to configure only
  1677.       one side to send keep-alives; in this case, the other side would
  1678.       be a "passive" participant which simply responds to the
  1679.       keep-alives it receives.
  1680.  
  1681.       Implementors who want their code to be capable of being an
  1682.       "active" keep-alive participant should make their client or server
  1683.       configurable so that administrators can set which, if any, keep-
  1684.       alive mechanism should be employed, and how often it should be
  1685.       used.
  1686.  
  1687.       Upon failure of a session on which keep-alives are used, both
  1688.       parties should make the proper notifications.  A client should
  1689.       give the user some indication of the failure, such as an error
  1690.       code in the Operator Information Area of the screen.  A server
  1691.       should notify the host application that the session has been
  1692.       terminated, for example by sending an UNBIND with type CLEANUP in
  1693.       an SNA environment.
  1694.  
  1695.    13.4 Examples
  1696.  
  1697.       The following example shows a TN3270E-capable server and a
  1698.       traditional tn3270 client establishing a connection:
  1699.  
  1700.         Server:  IAC DO TN3270E
  1701.         Client:  IAC WON'T TN3270E
  1702.  
  1703.  
  1704.  
  1705. Kelly                                                          [Page 29]
  1706.  
  1707. Internet Draft            TN3270 Enhancements                   May 1997
  1708.  
  1709.  
  1710.         Server:  IAC DO TERMINAL-TYPE
  1711.         Client:  IAC WILL TERMINAL-TYPE
  1712.         Server:  IAC SB TERMINAL-TYPE SEND IAC SE
  1713.         Client:  IAC SB TERMINAL-TYPE IS IBM-3278-2 IAC SE
  1714.         Server:  IAC DO EOR IAC WILL EOR
  1715.         Client:  IAC WILL EOR IAC DO EOR
  1716.         Server:  IAC DO BINARY IAC WILL BINARY
  1717.         Client:  IAC WILL BINARY IAC DO BINARY
  1718.            (3270 data stream is exchanged)
  1719.  
  1720.       The following example shows a TN3270E-capable server and a
  1721.       TN3270E-capable client establishing a generic pool (non-specific)
  1722.       terminal session:
  1723.  
  1724.         Server:  IAC DO TN3270E
  1725.         Client:  IAC WILL TN3270E
  1726.         Server:  IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  1727.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3278-2 IAC SE
  1728.         Server:  IAC SB TN3270E DEVICE-TYPE IS IBM-3278-2 CONNECT
  1729.                         anyterm IAC SE
  1730.         Client:  IAC SB TN3270E FUNCTIONS REQUEST RESPONSES IAC SE
  1731.         Server:  IAC SB TN3270E FUNCTIONS IS RESPONSES IAC SE
  1732.            (3270 data stream is exchanged)
  1733.  
  1734.       The following example shows a TN3270E-capable server and a
  1735.       TN3270E-capable client establishing a terminal session where the
  1736.       client requests a specific device-name:
  1737.  
  1738.         Server:  IAC DO TN3270E
  1739.         Client:  IAC WILL TN3270E
  1740.         Server:  IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  1741.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3278-5-E
  1742.                         CONNECT myterm IAC SE
  1743.         Server:  IAC SB TN3270E DEVICE-TYPE IS IBM-3278-5-E CONNECT
  1744.                         myterm IAC SE
  1745.         Client:  IAC SB TN3270E FUNCTIONS REQUEST RESPONSES
  1746.                         BIND-IMAGE IAC SE
  1747.         Server:  IAC SB TN3270E FUNCTIONS IS RESPONSES BIND-IMAGE
  1748.                         IAC SE
  1749.            (3270 data stream is exchanged)
  1750.  
  1751.       The following example shows a TN3270E-capable server and a
  1752.       TN3270E-capable client establishing a terminal session where the
  1753.       client requests a resource-name and is returned a device-name
  1754.       chosen by the server:
  1755.  
  1756.         Server:  IAC DO TN3270E
  1757.         Client:  IAC WILL TN3270E
  1758.         Server:  IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  1759.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3278-5-E
  1760.                         CONNECT pool1 IAC SE
  1761.  
  1762.  
  1763.  
  1764. Kelly                                                          [Page 30]
  1765.  
  1766. Internet Draft            TN3270 Enhancements                   May 1997
  1767.  
  1768.  
  1769.         Server:  IAC SB TN3270E DEVICE-TYPE IS IBM-3278-5-E CONNECT
  1770.                         term0013 IAC SE
  1771.         Client:  IAC SB TN3270E FUNCTIONS REQUEST BIND-IMAGE IAC SE
  1772.         Server:  IAC SB TN3270E FUNCTIONS IS BIND-IMAGE IAC SE
  1773.            (3270 data stream is exchanged)
  1774.  
  1775.       The following example shows a TN3270E-capable server and a
  1776.       TN3270E-capable client attempting to establish a terminal session;
  1777.       multiple attempts are necessary because the device-name initially
  1778.       requested by the client is already in use:
  1779.  
  1780.         Server:  IAC DO TN3270E
  1781.         Client:  IAC WILL TN3270E
  1782.         Server:  IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  1783.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3278-5
  1784.                         CONNECT myterm IAC SE
  1785.         Server:  IAC SB TN3270E DEVICE-TYPE REJECT REASON
  1786.                         DEVICE-IN-USE IAC SE
  1787.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3278-2
  1788.                         CONNECT herterm IAC SE
  1789.         Server:  IAC SB TN3270E DEVICE-TYPE IS IBM-3278-2 CONNECT
  1790.                         herterm IAC SE
  1791.         Client:  IAC SB TN3270E FUNCTIONS REQUEST RESPONSES IAC SE
  1792.         Server:  IAC SB TN3270E FUNCTIONS IS RESPONSES IAC SE
  1793.            (3270 data stream is exchanged)
  1794.  
  1795.       The following example shows a TN3270E-capable server and a
  1796.       TN3270E-capable client establishing a printer session where the
  1797.       client requests a specific device-name, and where some amount of
  1798.       3270 function negotiation is required before an agreement is
  1799.       reached:
  1800.  
  1801.         Server:  IAC DO TN3270E
  1802.         Client:  IAC WILL TN3270E
  1803.         Server:  IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  1804.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3287-1 CONNECT
  1805.                         myprt IAC SE
  1806.         Server:  IAC SB TN3270E DEVICE-TYPE IS IBM-3287-1 CONNECT
  1807.                         myprt IAC SE
  1808.         Client:  IAC SB TN3270E FUNCTIONS REQUEST DATA-STREAM-CTL IAC
  1809.         Server:  IAC SB TN3270E FUNCTIONS REQUEST DATA-STREAM-CTL
  1810.                         RESPONSES IAC SE
  1811.         Client:  IAC SB TN3270E FUNCTIONS REQUEST DATA-STREAM-CTL IAC
  1812.         Server:  IAC SB TN3270E FUNCTIONS IS DATA-STREAM-CTL IAC SE
  1813.            (3270 data stream is exchanged)
  1814.  
  1815.       The following example shows a TN3270E-capable server and a
  1816.       TN3270E-capable client establishing first a specific terminal
  1817.       session, then a printer session where the "partner" printer for
  1818.       the assigned terminal is requested:
  1819.  
  1820.  
  1821.  
  1822.  
  1823. Kelly                                                          [Page 31]
  1824.  
  1825. Internet Draft            TN3270 Enhancements                   May 1997
  1826.  
  1827.  
  1828.         Server:  IAC DO TN3270E
  1829.         Client:  IAC WILL TN3270E
  1830.         Server:  IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  1831.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3278-2 CONNECT
  1832.                         termxyz IAC SE
  1833.         Server:  IAC SB TN3270E DEVICE-TYPE IS IBM-3278-2 CONNECT
  1834.                         termxyz IAC SE
  1835.         Client:  IAC SB TN3270E FUNCTIONS REQUEST RESPONSES IAC SE
  1836.         Server:  IAC SB TN3270E FUNCTIONS IS RESPONSES IAC SE
  1837.            (3270 data stream is exchanged)
  1838.              .            .
  1839.              .            .
  1840.            (user decides to request a printer session,
  1841.             so client again connects to Telnet port on server)
  1842.         Server:  IAC DO TN3270E
  1843.         Client:  IAC WILL TN3270E
  1844.         Server:  IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  1845.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3287-1
  1846.                         ASSOCIATE termxyz IAC SE
  1847.         Server:  IAC SB TN3270E DEVICE-TYPE IS IBM-3287-1 CONNECT
  1848.                         termxyz's-prt IAC SE
  1849.         Client:  IAC SB TN3270E FUNCTIONS REQUEST SCS-CTL-CODES
  1850.                         RESPONSES IAC SE
  1851.         Server:  IAC SB TN3270E FUNCTIONS IS SCS-CTL-CODES RESPONSES
  1852.                         IAC SE
  1853.            (3270 data stream is exchanged)
  1854.  
  1855.       The following example shows a TN3270E-capable server and a
  1856.       TN3270E-capable client establishing first a terminal session where
  1857.       a resource-name was requested and a server chosen device-name was
  1858.       returned, then a printer session where the "partner" printer for
  1859.       the assigned terminal is requested:
  1860.  
  1861.         Server:  IAC DO TN3270E
  1862.         Client:  IAC WILL TN3270E
  1863.         Server:  IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  1864.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3278-5 CONNECT
  1865.                         poolxyz IAC SE
  1866.         Server:  IAC SB TN3270E DEVICE-TYPE IS IBM-3278-5 CONNECT
  1867.                         terma IAC SE
  1868.         Client:  IAC SB TN3270E FUNCTIONS REQUEST RESPONSES IAC SE
  1869.         Server:  IAC SB TN3270E FUNCTIONS IS RESPONSES IAC SE
  1870.            (3270 data stream is exchanged)
  1871.              .            .
  1872.              .            .
  1873.            (user decides to request a printer session,
  1874.             so client again connects to Telnet port on server)
  1875.         Server:  IAC DO TN3270E
  1876.         Client:  IAC WILL TN3270E
  1877.         Server:  IAC SB TN3270E SEND DEVICE-TYPE IAC SE
  1878.  
  1879.  
  1880.  
  1881.  
  1882. Kelly                                                          [Page 32]
  1883.  
  1884. Internet Draft            TN3270 Enhancements                   May 1997
  1885.  
  1886.  
  1887.         Client:  IAC SB TN3270E DEVICE-TYPE REQUEST IBM-3287-1
  1888.                         ASSOCIATE terma IAC SE
  1889.         Server:  IAC SB TN3270E DEVICE-TYPE IS IBM-3287-1 CONNECT
  1890.                         terma's-prt IAC SE
  1891.         Client:  IAC SB TN3270E FUNCTIONS REQUEST SCS-CTL-CODES
  1892.                         RESPONSES IAC SE
  1893.         Server:  IAC SB TN3270E FUNCTIONS IS SCS-CTL-CODES RESPONSES
  1894.                         IAC SE
  1895.            (3270 data stream is exchanged)
  1896.  
  1897. 14.  Security Considerations
  1898.  
  1899.    Security issues are not addressed directly in this document.
  1900.    This is recognized as an important shortcoming in TN3270E as
  1901.    defined here, and work is continuing in the IETF TN3270E Working
  1902.    Group to address this shortcoming.  Of particular importance is
  1903.    the lack of the ability to authenticate a client's "right" to
  1904.    be granted a specific device-name, especially in the case of a
  1905.    printer.
  1906.  
  1907.    In the meantime, implementation specific solutions are possible
  1908.    using, for example, Kerberos.
  1909.  
  1910. 15.  References
  1911.  
  1912.    [1] Rekhter, J., "Telnet 3270 Regime Option", RFC 1041, IBM
  1913.        Corporation, January 1988.
  1914.  
  1915.    [2] VanBokkelen, J., "Telnet Terminal-Type Option", RFC 1091, FTP
  1916.        Software, Inc., February 1989.
  1917.  
  1918.    [3] Postel, J., and J. Reynolds, "Telnet Binary Transmission", STD
  1919.        27, RFC 856, USC/Information Sciences Institute, May 1983.
  1920.  
  1921.    [4] Postel, J., "Telnet End of Record Option", RFC 885, USC/
  1922.        Information Sciences Institute, December 1983.
  1923.  
  1924.    [5] "3270 Information Display System - Data Stream Programmer's
  1925.        Reference", publication number GA24-0059, IBM Corporation.
  1926.  
  1927.    [6] "SNA Formats", publication number GA27-3136, IBM Corporation.
  1928.  
  1929.    [7] "3174 Establishment Controller Functional Description",
  1930.        publication number GA23-0218, IBM Corporation.
  1931.  
  1932.    [8] Postel, J., and J. Reynolds, "Telnet Protocol Specification", STD
  1933.        8, RFC 854, USC/Information Sciences Institute, May 1983.
  1934.  
  1935.    [9] Postel, J., and J. Reynolds, "Telnet Timing Mark Option", STD 31,
  1936.        RFC 860, USC/Information Sciences Institute, May 1983.
  1937.  
  1938.  
  1939.  
  1940.  
  1941. Kelly                                                          [Page 33]
  1942.  
  1943. Internet Draft            TN3270 Enhancements                   May 1997
  1944.  
  1945.  
  1946.   [10] J. Penner, "TN3270 Current Practices", RFC 1576, DCA Inc.,
  1947.        January, 1994.
  1948.  
  1949. 16.  Author's Note
  1950.  
  1951.    Portions of this document were drawn from the following sources:
  1952.  
  1953.     - A White Paper written by Owen Reddecliffe, WRQ Corporation,
  1954.       October 1991.
  1955.  
  1956.     - Experimental work on the part of Cleve Graves and Michelle
  1957.       Angel, OpenConnect Systems, 1992 - 1993.
  1958.  
  1959.     - Discussions at the 1993 IETF meetings.
  1960.  
  1961.     - Discussions on the "TN3270E" list, 1993-94 and 1997.
  1962.  
  1963. 17. Author's Address
  1964.  
  1965.    Bill Kelly
  1966.    Division of University Computing
  1967.    144 Parker Hall
  1968.    Auburn University, AL  36849
  1969.  
  1970.    Phone: (334) 844-4512
  1971.    EMail: kellywh@mail.auburn.edu
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000. Kelly                                                          [Page 34]
  2001.  
  2002.