home *** CD-ROM | disk | FTP | other *** search
/ Internet Core Protocols / Oreilly-InternetCoreProtocols.iso / RFCs / rfc2355.txt < prev    next >
Encoding:
Text File  |  1999-10-14  |  89.4 KB  |  2,132 lines

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