INTERNET-DRAFT Network Working Group Glen Clark Request for Comments: nnnn ESDL, Inc. Category: Standards Track May 1997 Revision: 0005 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] RFC: NNNN Telnet Comport Control Option May 1997 Table of Contents 1. Negotiation of the Comport Control Option Protocol .................. 3 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 .................. 9 Modem Line Changes 5. Flow Control .................. 10 6. Security Considerations .................. 11 Command Names and Codes: COMPORT-OPTION 40 Client to Host Host to Client SIGNATURE text text SET-BAUDRATE 1 101 SET-DATASIZE 2 102 SET-PARITY 3 103 SET-STOPSIZE 4 104 SET-CONTROL 5 105 NOTIFY-LINESTATE 6 106 NOTIFY-MODEMSTATE 7 107 FLOWCONTROL-SUSPEND 8 108 FLOWCONTROL-RESUME 9 109 SET-LINESTATE-MASK 10 110 SET-MODEMSTATE-MASK 11 111 PURGE-DATA 12 112 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, only the notify commands. However, to allow for host initiated comport configuration different command values have been established. Clark Page [2] RFC: NNNN Telnet Comport Control Option May 1997 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. 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 should be acknowledged with a confirmation of the command and the actual value set. It is at the host's discretion to acknowledge commands received. If an acknowledgment is generated, the client should expect it 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: RFC 1696 [5] refers to "baud rate" as "modulation speed". "Baud" and "baud rate" are used in this document for clarity. 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] RFC: NNNN Telnet Comport Control Option May 1997 IAC SB COMPORT-OPTION SIGNATURE IAC SE This command may be sent by either the client or the host to exchange signature information. If the command is sent without it is a request from the sender to receive the signature text of the receiver. The text may be a combination of any characters. If IAC appears in the text it must be translated to IAC-IAC to avoid conflict with the IAC which terminates the command. IAC SB COMPORT-OPTION SET-BAUD IAC SE This command is sent by the client to the host to set the baud rate of the comport. The value is four octets (4 bytes). This value is represented in network standard format. The value is the baud rate being requested. A special case is the value 0. If the baud rate is zero the client is questing the current baud rate of the comport. Discussion: Though baud rates used today form a very sparse space, and the initial version of the option used an index based baud rate table, after much discussion with a number of groups it has been determined that the actual baud rate should be used. There are two main reasons. 1) It limits the number of updates to the option as faster baud rates come into use, 2) It provides the greatest amount of flexibility in the selection of the baud rate. Clark Page [4] RFC: NNNN Telnet Comport Control Option May 1997 IAC SB COMPORT-OPTION SET-DATASIZE 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 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] RFC: NNNN Telnet Comport Control Option May 1997 IAC SB COMPORT-OPTION SET-STOPSIZE 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 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 (outbound/both) 1 Use No Flow Control (outbound/both) 2 Use XON/XOFF Flow Control (outbound/both) 3 Use HARDWARE Flow Control (outbound/both) 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 Request Comport Flow Control Setting (inbound) 14 Use No Flow Control (inbound) 15 Use XON/XOFF Flow Control (inbound) 16 Use HARDWARE Flow Control (inbound) (Table continues on next page) Clark Page [6] RFC: NNNN Telnet Comport Control Option May 1997 17 Use DCD Flow Control (outbound/both) 18 Use DTR Flow Control (inbound) 19 Use DSR Flow Control (outbound/both) 20-127 Available for Future Use Discussion: Outbound is defined as flow of data from the modem to the dialed up host. Inbound is defined as flow of data from the dialed up host to the modem. Discussion: Flow control options were divided into inbound and outbound to take full advantage of existing programming interfaces and modem sharing devices (Telnet host). Discussion: The outbound values should set flow control for both outbound and inbound. If inbound is to be, or can be, set separately it should be done after the setting of the outbound value. Discussion: If the Telnet host is not able to set inbound flow control differently from the outbound flow control, it should ignore the inbound flow control commands and set the flow control option based on the outbound flow control commands only. IAC SB COMPORT-OPTION SET-LINESTATE-MASK IAC SE This command is sent by the client to the host to set a bit mask for the sending of the NOTIFY-LINESTATE option (see section 4). When the LINESTATE changes on the host, the host will "AND" the new LINESTATE with the LINESTATE-MASK. If the result is not zero, the host will send the result of the "AND" as the value in a NOTIFY-LINESTATE comport option. If more than one bit satisfies the LINESTATE-MASK, only one NOTIFY-LINESTATE, with all the satisfying bits, will be sent to the client. The SET-LINESTATE-MASK may be any combination of bits as listed below. These are the same bit values used in the NOTIFY-LINESTATE option. The SET-LINESTATE-MASK 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 Clark Page [7] RFC: NNNN Telnet Comport Control Option May 1997 Discussion: The SET-LINESTATE-MASK value of 0 will prevent the host from sending NOTIFY-LINESTATE options to the client. Discussion: The SET-LINESTATE-MASK value of 255 will allow the host to send a NOTIFY-LINESTATE option to the client each time the LINESTATE changes on the host. Discussion: The initial LINESTATE-MASK at the host is 0. Discussion: The client does not have to send a new SET-LINESTATE-MASK after receiving a NOTIFY-LINESTATE. The LINESTATE-MASK on the host is retained until set by the client or reset at the start of a new Telnet session. IAC SB COMPORT-OPTION SET-MODEMSTATE-MASK IAC SE This command is sent by the client to the host to set a bit mask for the sending of the NOTIFY-MODEMSTATE option (see section 4). When the MODEMSTATE changes on the host, the host will "AND" the new MODEMSTATE with the MODEMSTATE-MASK. If the result is not zero, the host will send the result of the "AND" as the value in a NOTIFY-MODEMSTATE comport option. If more than one bit satisfies the MODEMSTATE-MASK, only one NOTIFY-MODEMSTATE, with all the satisfying bits, will be sent to the client. The SET-MODEMSTATE-MASK may be any combination of bits as listed below. These are the same bit values used in the NOTIFY-MODEMSTATE option. The SET-MODEMSTATE-MASK values are based on the most popular UART (comport control chip) in use. [1] Bit Position Value Meaning 7 128 Receive Line Signal Detect (also known as Carrier 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 Clark Page [8] RFC: NNNN Telnet Comport Control Option May 1997 Discussion: The SET-MODEMSTATE-MASK value of 0 will prevent the host from sending NOTIFY-MODEMSTATE options to the client. Discussion: The SET-MODEMSTATE-MASK value of 255 will allow the host to send a NOTIFY-MODEMSTATE option to the client each time the MODEMSTATE changes on the host. Discussion: The initial MODEMSTATE-MASK at the host is 255. Discussion: The client does not have to send a new SET-MODEMSTATE-MASK after receiving a NOTIFY-MODEMSTATE. The MODEMSTATE-MASK on the host is retained until set by the client or reset at the start of a new Telnet session. IAC SB COMPORT-OPTION PURGE-DATA IAC SE This command is sent by the client to the host to instruct the host to immediately clear all data from the buffer or buffers referenced by the value. The value is one octet (byte). The value is an index into the following value table: Value Purge Data Buffer 0 Available for Future Use 1 Purge host receive data buffer 2 Purge host transmit data buffer 3 Purge both the host receive data buffer and the host transmit data buffer 4-127 Available for Future Use 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 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 Clark Page [9] RFC: NNNN Telnet Comport Control Option May 1997 Discussion: The LINESTATE is the line state of the UART on the host. IAC SB COMPORT-OPTION NOTIFY-MODEMSTATE 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 (also known as Carrier 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 The client and/or host can send these commands any time and multiple times throughout the Telnet session. IAC SB COMPORT-OPTION FLOWCONTROL-SUSPEND IAC SE Sender of this command is requesting that the receiver suspend transmission of both data and commands until the FLOWCONTROL-RESUME is transmitted by the sender. IAC SB COMPORT-OPTION FLOWCONTROL-RESUME IAC SE Sender of this command is requesting that the receiver resume transmission of both data and commands. Discussion: Established Telnet sessions are initially in a resume state between the client and Telnet host and the Telnet host and the client. There is no need to send the resume command during session initialization. Discussion: Multiple concurrent suspend commands may be sent. Secondary suspend commands can be ignored. Transmission will resume with the sending of a single resume command. Clark Page [10] RFC: NNNN Telnet Comport Control Option May 1997 Discussion: The flow control option is designed to handle client to Telnet host flow control for the Telnet session. This option has been added in deference to RFC 1372: Telnet Remote Flow Control Option [2]. RFC 1372 uses simple character XON/XOFF technology to implement flow control. This can lead to two problems. First, the flow control characters may be valid data values. Second, the flow control characters may be used for end to end flow control (client application to remote dialup host). 6. Security Considerations There are two security issues to discuss; authentication and resetting resources. Authentication can follow either the Kerberos authentication protocol established in RFC 1411 [3] or the SPX authentication protocol established in RFC 1412 [4]. The Telnet host should ensure the connection to the dialed up host is disconnected and the com port geometry (baud rate, data size, stop bits, parity, and flow control) is reset to a factory or administrator defined configuration. Discussion: Resetting resources is needed to ensure that each session begins with the same configuration. This will make operation more predicable and avoid problems which might occur from starting with different configurations. Clark Page [11] RFC: NNNN Telnet Comport Control Option May 1997 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 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. [3] Internet Engineering Task Force, Telnet Working Group, D. Borman, "Telnet Authentication: Kerberos Version 4", RFC 1411, Cray Research, Inc., January 1993. [4] Internet Engineering Task Force, Telnet Working Group, K. Alagappan, "Telnet Authentication: SPX", RFC 1412, Digital Equipment Corporation, January 1993. [5] Internet Engineering Task Force, Telnet Working Group, J. Barnes, et. al., "Modem Management Information Base (MIB) using SMIv2", RFC 1696, Xylogics, Inc., August 1994. Clark Page [12]