home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 1600s / rfc1647.txt < prev    next >
Text File  |  1994-07-12  |  84KB  |  1,908 lines

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