INTERNET-DRAFT
draft-clark-telnet-control-00.txt
Expire in six months


Network Working Group                                         Glen Clark
Internet-Draft                                                ESDL, Inc.
                                                              March 1996

                         Telnet Comport Control Option

Preamble:
  This document is an Internet-Draft.  Internet-Drafts are working
  documents of the Internet Engineering Task Force (IETF), its
  areas, and its working groups.  Note that other groups may also
  distribute working documents as Internet-Drafts.

  Internet-Drafts are draft documents valid for a maximum of six
  months and may be updated, replaced, or obsoleted by other
  documents at any time.  It is inappropriate to use Internet-
  Drafts as reference material or to cite them other than as
  "work in progress."

  To learn the current status of any Internet-Draft, please check
  the "1id-abstracts.txt" listing containing in the Internet-
  Drafts Shadow Directories on ftp.is.co.za (Africa),
  nic.nordu.net (Europe), munnari.oz.au (Pacific Rim),
  ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast).

Status Section:
  This document specifies an Internet standards track protocol for the
  Internet community, and requests discussion and suggestions for
  improvements. Please refer to the current edition of the
  "Internet Official Protocol Standards" (STD 1) for the
  standardization state and status of this protocol. Distribution of
  this memo is unlimited.

Introduction Section:
  This memo proposes a protocol to allow greater use of modems
  attached to a network. Increased needs for "off network"
  communications has increased the need for modems.  Increasing the
  functionality of Telnet increases the functionality of network
  attached modems.  For example, the ability to send a FAX via a
  network attached modem.  This memo addresses configuration of the
  comport to which the modem is attached. It does not address the
  internal configuration of the modem itself.









Clark                                                           Page [1]

INTERNET-DRAFT          Telnet Comport Control Option        March 1996

Table of Contents
    1. Negotiation of the Comport
       Control Option Protocol          ..................   2
    2. Comport Configuration Commands   ..................   3
         Version
         Baud Rate
         Data Bit Size
         Parity
         Stop Bit size
    3. Special Comport Control Commands ..................   6
         XON/XOFF Flow Control
         HARDWARE Flow Control
         BREAK Signal
         DTR Signal
         RTS Signal
  4. Notification of Comport and      ..................     7
     Modem Line Changes
  5. Flow Control                     ..................     7

  Command Names and Codes:
       COMPORT-OPTION        40
       QUERY-VERSION          0
       SET-BAUDRATE           1
       SET-DATASIZE           2
       SET-PARITY             3
       SET-STOPSIZE           4
       SET-CONTROL            5
       NOTIFY-LINESTATE       6
       NOTIFY-MODEMSTATE      7

1. Negotiation of the Comport Control Option Protocol
    The negotiation of the comport control option protocol uses the
    standard Telnet negotiation protocol mechanism.

     IAC WILL COMPORT-OPTION
       The sender of this command is willing to send comport
       control option commands.
     IAC WONT COMPORT-OPTION
       The sender refuses to send comport control option commands.
     IAC DO COMPORT-OPTION
       The sender of this command is willing to accept comport
       control option commands.
     IAC DONT COMPORT-OPTION
       The sender of this command refuses to accept comport control
       options commands.

    Typically a client will use WILL and WONT, while a host will use
    DO and DONT.




Clark                                                           Page [2]

INTERNET-DRAFT          Telnet Comport Control Option        March 1996

2. Comport Configuration Commands
    Once DO and WILL have been negotiated, the client may send any of
    the following commands. The client can send these commands at any
    time and multiple times throughout the Telnet session. Each
    command transmitted from the client to the host is acknowledged
    with a confirmation of the command and the actual value set. The
    client should expect a response within a reasonable time (such as
    twice the delay acknowledgment timer). The client may wish to
    resend any command which is not acknowledged, however the client
    may also ignore the failure to receive an acknowledgment.

    Though the commands may be sent from the client to the host in any
    sequence, there are sequences which may result in invalid
    configurations for the comport (for example: EVEN parity is only
    valid if the data size is set to less than 8 bits). Thus it is
    recommended that commands be issued in the following sequence:
      1. SET-BAUDRATE
      2. SET-DATASIZE
      3. SET-PARITY
      4. SET-STOPSIZE

    Discussion: As initially proposed, comport configuration commands
                are only sent from the client to the host. There is no
                current vision that the host would initiate the use a
                comport configuration command. Host initiated comport
                configuration commands could easily be included in the
                protocol. It would require that a response command
                have a different value than an initiate command.
                For example:
                  Command        Initiate Value     Response Value
                  SET-BAUDRATE       1                  101
                  SET-DATASIZE       2                  102
                  SET-PARITY         3                  103
                  SET-STOPSIZE       4                  104
                  SET-CONTROL        5                  105

    Discussion: The prompt response mechanism suggested here allows
                the protocol to be used to query the values at the host
                as well as set the values. The use of this mechanism
                provides more functionality than a simple ACK/NAK
                protocol.











Clark                                                           Page [3]

INTERNET-DRAFT          Telnet Comport Control Option        March 1996

  IAC SB COMPORT-OPTION QUERY-VERSION <value> IAC SE
    This command is sent by the client to the host to query the
    version of the COMPORT-OPTION protocol supported by the host.
    The value is one octect (byte).  When sent by the client the
    value indicates the version supported by the client.  When
    returned by the host, the value indicates the version supported
    by the host.  This exchange allows both parties to
    know the capabilities supported by the other and make
    appropriate modifications in the commands and responses.
    The value is an index into the following value table:
        Value      Version
          0           Draft Version
          1           Initial Approved Version
        2-127         Available for Future Use

  IAC SB COMPORT-OPTION SET-BAUD <value> IAC SE
    This command is sent by the client to the host to set the baud
    rate of the comport. The command can also be sent to query the
    current baud rate as well as receive the maximum baud rate
    supported by the comport. The value is one octet (byte). The
    value is an index into the following value table:
        Value      Baud Rate (bits per second)
          0           Request Current Baud Rate
          1           110
          2           150
          3           300
          4           600
          5          1200
          6          2400
          7          4800
          8          9600
          9         14400
         10         19200
         11         28800
         12         38400
         13         57600
         14        115200
       15-126      Available for Future Use
        127        Query Maximum Baud Supported

    Discussion: Baud rates use today form a very sparse value space.
                Representing these by their actual value requires four
                octets. In additional to the extra data transmitted
                this representation requires the negotiation of the
                byte order for the longer data representation. The
                value table mechanism provides ample room for future
                expansion as well as avoids the need for byte order
                negotiation.




Clark                                                           Page [4]

INTERNET-DRAFT          Telnet Comport Control Option        March 1996

  IAC SB COMPORT-OPTION SET-DATASIZE <value> IAC SE
    This command is sent by the client to the host to set the data bit
    size. The command can also be sent to query the current data bit
    size. The value is one octet (byte). The value is an index into
    the following value table:
        Value      Data Bit Size
          0           Request Current Data Bit Size
          1           Available for Future Use
          2           Available for Future Use
          3           Available for Future Use
          4           Available for Future Use
          5           5
          6           6
          7           7
          8           8
         9-127        Available for Future Use

    Discussion: There are only eight possible values for the data bit
                size, only four have ever been used historically and
                only two are commonly used today. The use of the
                command-value format is recommended to preserve
                consistency with other commands. It also reduces the
                number of commands defined in the protocol, and allows
                for future expansion.

  IAC SB COMPORT-OPTION SET-PARITY <value> IAC SE
    This command is sent by the client to the host to set the parity.
    The command can also be sent to query the current parity. The
    value is one octet (byte). The value is an index into the
    following value table:
        Value      Parity [1]
          0           Request Current Data Size
          1           NONE
          2           ODD
          3           EVEN
          4           MARK
          5           SPACE
         6-127        Available for Future Use

    Discussion: There are only five possible values for parity
                commonly used today. The use of the command-value
                format is recommended to preserve consistency with
                other commands.









Clark                                                           Page [5]

INTERNET-DRAFT          Telnet Comport Control Option        March 1996

  IAC SB COMPORT-OPTION SET-STOPSIZE <value> IAC SE
    This command is sent by the client to the host to set the number
    of stop bits. The command can also be sent to query the current
    stop bit size. The value is one octet (byte). The value is an
    index into the following value table:
        Value      Stop Bit Size
          0           Request Current Data Size
          1           1
          2           2
          3         1.5
         4-127        Available for Future Use

    Discussion: Stop bit 1.5 is supported by most comport hardware
                only if data size is set to 5 bits. It is not
                commonly used.

3. Special Comport Control Commands
    The client can send this command to the host at any time and
    multiple times throughout the Telnet session. Each command
    transmitted from the client to the host is acknowledged with a
    confirmation of the command and the actual value set. The client
    should expect a response within a reasonable time (such as twice
    the delay acknowledgment timer). The client may wish to resend any
    command which is not acknowledged, however the client may also
    ignore the failure to receive an acknowledgment.

  IAC SB COMPORT-OPTION SET-CONTROL <value> IAC SE
    This command is sent by the client to the host to set special
    comport options. The command can also be sent to query the current
    option value. The value is one octet (byte). The value is an
    index into the following value table:
        Value      Control Commands
          0           Request Comport Flow Control Setting
          1           Use No Flow Control
          2           Use XON/XOFF Flow Control
          3           Use HARDWARE Flow Control
          4           Request BREAK State
          5           Set BREAK State ON
          6           Set BREAK State OFF
          7           Request DTR Signal State
          8           Set DTR Signal State ON
          9           Set DTR Signal State OFF
         10           Request RTS Signal State
         11           Set RTS Signal State ON
         12           Set RTS Signal State OFF
       13-127         Available for Future Use






Clark                                                           Page [6]

INTERNET-DRAFT          Telnet Comport Control Option        March 1996

4. Notification of Comport and Modem Line Changes
    The host can send these commands to the client any time and
    multiple times throughout the Telnet session. The host should
    send the appropriate command to the client as soon as the
    comport or modem line changes occurs. The client does not issue
    a response to these commands.

  IAC SB COMPORT-OPTION NOTIFY-LINESTATE <value> IAC SE
    The value is one octet (byte). The value is a bit level
    composition made up from the value table below. Multiple bit
    values may be set in a single transmission. The values are based
    on the most popular UART (comport control chip) in use. [1]
        Bit Position     Value     Meaning
           7              128         Time-out Error
           6               64         Transfer Shift Register Empty
           5               32         Transfer Holding Register Empty
           4               16         Break-detect Error
           3                8         Framing Error
           2                4         Parity Error
           1                2         Overrun Error
           0                1         Data Ready

  IAC SB COMPORT-OPTION NOTIFY-MODEMSTATE <value> IAC SE
    The value is one octet (byte). The value is a bit level
    composition made up from the value table below. Multiple bit
    values may be set in a single transmission. The values are based
    on the most popular UART (comport control chip) in use. [1]
        Bit Position     Value     Meaning
           7              128         Receive Line Signal Detect
           6               64         Ring Indicator
           5               32         Data-Set-Ready Signal State
           4               16         Clear-To-Send Signal State
           3                8         Delta Receive Line Signal Detect
           2                4         Trailing-edge Ring Detector
           1                2         Delta Data-Set-Ready
           0                1         Delta Clear-To-Send

5. Flow Control
    Flow control will follow the protocol established in
    RFC 1372: Telnet Remote Flow Control Option. [2]

Security Consideration Section:

   Security issues are not discussed in this memo.












Clark                                                           Page [7]

INTERNET-DRAFT          Telnet Comport Control Option        March 1996

Author Address:

  Glen Clark, Chief Architect
  Enterprise Solutions Development Laboratories, Inc.
  15127 NE 24th Street, Suite 157
  Redmond, WA  98052

  Internet:   glenc@esdl.com
  WEB:        www.esdl.com
  CompuServe: 73750,1607

Reference Section:

[1]  Joe Campbell. C Programmer's Guide to Serial Communications,
     Second Edition. Indianapolis: SAMS Publishing, 1993. 213-224.
[2]  Internet Engineering Task Force, Telnet Working Group,
     C. Hedrick and D. Borman, "Telnet Remote Flow Control Option",
     RFC 1372, Cray Research, Inc., October 1992.


































Clark                                                           Page [8]