home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc1571 < prev    next >
Text File  |  1994-01-13  |  8KB  |  228 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          D. Borman
  8. Request for Comments: 1571                           Cray Research, Inc.
  9. Updates: 1408                                               January 1994
  10. Category: Informational
  11.  
  12.  
  13.            Telnet Environment Option Interoperability Issues
  14.  
  15. Status of this Memo
  16.  
  17.    This memo provides information for the Internet community.  This memo
  18.    does not specify an Internet standard of any kind.  Distribution of
  19.    this memo is unlimited.
  20.  
  21. 1.  Overview
  22.  
  23.    RFC 1408 [1], the specification for the Telnet Environment Option,
  24.    specifies definitions for VAR and VALUE that are reversed from the
  25.    BSD implementation of the Telnet Environment option.  Since the BSD
  26.    implementation was the reference implementation that the RFC was
  27.    supposed to document, and is the base for many existing
  28.    implementations, there exists an interoperability problem between
  29.    implementations with conflicting definitions for VAR and VALUE.
  30.  
  31.    This document describes a method for allowing implementors to ensure
  32.    that their implementation of the Environment option will be
  33.    interoperable with as many other implementations as possible, by
  34.    providing a set of heuristics that can be used to help identify which
  35.    definitions for VAR and VALUE are being used by the other side of the
  36.    connection.
  37.  
  38. 2.  Client Telnet: Parsing a SEND
  39.  
  40.    The SEND suboption should only contain VAR and USERVAR commands.  It
  41.    should never contain a VALUE.  If while parsing a SEND suboption, a
  42.    VALUE is encountered, the client should assume that the server has
  43.    reversed values for VAR and VALUE, and from that point on the client
  44.    should reverse those values, both in parsing the rest of the SEND
  45.    suboption, and when generating an IS or INFO suboption.  If both
  46.    VALUE and VAR commands are encountered, the SEND command is not well
  47.    formed, and it is implementation dependent as to what will happen.
  48.  
  49.    If there are not VAR or VALUE commands in the SEND suboption, then
  50.    the client cannot know what values the server is expecting for VAR
  51.    and VALUE.  In this case, it should just assume that the server has
  52.    the correct definitions, and use the correct values for VAR and
  53.    VALUE.
  54.  
  55.  
  56.  
  57.  
  58. Telnet Working Group                                            [Page 1]
  59.  
  60. RFC 1571          Environment Option Interoperability       January 1994
  61.  
  62.  
  63. 3.  Server Telnet: Parsing an IS or INFO
  64.  
  65.    The IS or INFO in a suboption can only be legally followed by either
  66.    a VAR or a USERVAR.  If an IS or INFO is immediately followed by a
  67.    VAR, then it can be assumed that the client has the correct
  68.    definitions for VAR and VALUE.  If the IS or INFO is immediately
  69.    followed by a VALUE, then it can be assumed that the client has
  70.    reversed definitions for VAR and VALUE, and from that point on the
  71.    server should assume that the VALUE and VAR definitions are reversed.
  72.  
  73.    If the IS or INFO is immediately followed by a USERVAR, further
  74.    hueristics must be applied to determine what are the client
  75.    definitions for VAR and VALUE. This is because it is legal for a
  76.    USERVAR to be followed by either a VAR or a VALUE.  A VALUE after a
  77.    USERVAR gives the value for the USERVER.  A VAR after a USERVAR
  78.    implies that the USERVAR is undefined.
  79.  
  80.    The next thing to do is to scan the entire suboption, looking for two
  81.    consecutive instances of VAR or VALUE, or for a VAR or VALUE that is
  82.    empty.  It is not legal for a suboption to contain two VALUEs without
  83.    an intervening VAR or USERVAR, and it is also not legal for a
  84.    suboption to contain an empty VAR.  Thus, if two consecutive VARs or
  85.    an empty VALUE can be found, it can be assumed that the client that
  86.    generated the suboption uses the correct definitions for VAR and
  87.    VALUE.  If two consecutive VALUEs or an empty VAR can be found, then
  88.    it can be assumed that the client that generated the suboption has
  89.    reversed definitions for VAR and VALUE, and from that point on the
  90.    server should assume that the VAR and VALUE definitions are reversed.
  91.  
  92.    If things are still in doubt, the next test that can be applied is to
  93.    count up how many VARs, USERVARs and VALUEs were received.
  94.    (Consecutive USERVARs without an intervening VALUE or VAR should only
  95.    be counted as one.) Because a VALUE can only follow a VAR or a
  96.    USERVAR, there can never be more VALUEs than the sum of VARs and
  97.    USERVARs, and if all VARs and USERVARs have values, then there will
  98.    be exactly as many VALUEs as there are VARs and USERVARs.  If the
  99.    number of VARs and USERVARs is the same as the total number of
  100.    VALUEs, then the client has correct definitions for VAR and VALUE.
  101.    If the number of VALUEs and USERVARs is the same as the total number
  102.    of VARs, then the client has reversed definitions for VAR and VALUE.
  103.  
  104.    If the number of VALUEs is more than the sum of VARs and USERVARs, it
  105.    can be assumed that the client has reversed definitions of VAR and
  106.    VALUE, and if there are more VARs than USERVARs and VALUEs, then it
  107.    can be assumed that the client has the correct definitions for VAR
  108.    and VALUE.  However, in order to get to this step, it has already
  109.    been determined that there are no consecutive VARs and VALUEs.  A
  110.    little math will show that this means that the number of VALUEs will
  111.  
  112.  
  113.  
  114. Telnet Working Group                                            [Page 2]
  115.  
  116. RFC 1571          Environment Option Interoperability       January 1994
  117.  
  118.  
  119.    never exceed the sum of VARs and USERVARs, and the number of VARs
  120.    will never exceed the sum of VALUEs and USERVARs.  Hence, this check
  121.    is redundant and can be skipped.
  122.  
  123.    If things are still in doubt, the values of the VAR commands can be
  124.    checked to see if they do indeed specify well known variables.  If
  125.    any of them do, then the client is probably using the correct
  126.    definitions for VAR and VALUE.  Otherwise, if any of the VALUEs
  127.    contain well know variable names, then the client probably has
  128.    reversed definitions for VAR and VALUE.
  129.  
  130.    If all the above heuristics fail, then the server has done all it can
  131.    to determine what type of client it is, and it should just be assumed
  132.    that the client is using the correct definitions for VAR and VALUe.
  133.  
  134. 4.  Client Summary
  135.  
  136.        The SEND suboption contains only VAR and USERVAR commands.
  137.            The server is ok.
  138.        The SEND suboption contains VALUE commands.
  139.            The server is reversed.
  140.        No VAR or VALUE commands are found.
  141.            Assume the server is ok.
  142.  
  143. 5.  Server Summary
  144.  
  145.        IS/INFO is followed by VAR.
  146.            The client is ok.
  147.        IS/INFO is followed by VALUE.
  148.            The client is reversed.
  149.        There are two consecutive VARs.
  150.            The client is ok.
  151.        There are consecutive VALUEs.
  152.            The client is reversed.
  153.        There is an empty VALUE.
  154.            The client is ok.
  155.        There is an empty VAR.
  156.            The client is reversed.
  157.        The number of USERVARs and VARs is equal to the number of VALUEs.
  158.            Assume the client is ok.
  159.        The number of USERVARs and VALUEs is equal to the number of VARs.
  160.            Assume the client is reversed.
  161.        There are VARs with names that are well known.
  162.            Assume the client is ok.
  163.        There are VALUEs with names that are well known.
  164.            Assume the client is reversed.
  165.        Anything else.
  166.            Assume the client is ok.
  167.  
  168.  
  169.  
  170. Telnet Working Group                                            [Page 3]
  171.  
  172. RFC 1571          Environment Option Interoperability       January 1994
  173.  
  174.  
  175. References
  176.  
  177.    [1] Borman, D., Editor, "Telnet Environment Option", RFC 1408, Cray
  178.        Research, Inc., January 1993.
  179.  
  180. Security Considerations
  181.  
  182.    Security issues are not discussed in this memeo.
  183.  
  184. Author's Address
  185.  
  186.    David A. Borman
  187.    Cray Research, Inc.
  188.    655F Lone Oak Drive
  189.    Eagan, MN 55123
  190.  
  191.    Phone: (612) 452-6650
  192.    EMail: dab@CRAY.COM
  193.  
  194.    Telnet Working Group Mailing List: telnet-ietf@CRAY.COM
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Telnet Working Group                                            [Page 4]
  227.  
  228.