Telnet Status Option
A Telnet option that lets one side ask the other what options it currently believes are switched on.
Postel, J. and J. Reynolds, "Telnet Status Option", STD 30, RFC 859, DOI 10.17487/RFC0859, May 1983, <https://www.rfc-editor.org/info/rfc859>.
@misc{rfc859,
series = {Request for Comments},
number = 859,
howpublished = {RFC 859},
publisher = {RFC Editor},
doi = {10.17487/RFC0859},
url = {https://www.rfc-editor.org/info/rfc859},
author = {J. Postel and J. Reynolds},
title = {{Telnet Status Option}},
pagetotal = 3,
year = 1983,
month = may,
} RFC text
Contents
Network Working Group J. Postel
Request for Comments: 859 J. Reynolds
ISI
Obsoletes: RFC 651 (NIC 31154) May 1983
TELNET STATUS OPTION
This RFC specifies a standard for the ARPA Internet community. Hosts on
the ARPA Internet are expected to adopt and implement this standard.
1. Command Name and Code
STATUS 5
2. Command Meanings
This option applies separately to each direction of data flow.
IAC DON'T STATUS
Sender refuses to carry on any further discussion of the current
status of options.
IAC WON'T STATUS
Sender refuses to carry on any further discussion of the current
status of options.
IAC SB STATUS SEND IAC SE
Sender requests receiver to transmit his (the receiver's)
perception of the current status of Telnet options. The code for
SEND is 1. (See below.)
IAC SB STATUS IS ... IAC SE
Sender is stating his perception of the current status of Telnet
options. The code for IS is 0. (See below.)
3. Default
DON'T STATUS, WON'T STATUS
The current status of options will not be discussed.
4. Motivation for the Option
This option allows a user/process to verify the current status of
TELNET options (e.g., echoing) as viewed by the person/process on the
other end of the TELNET connection. Simply renegotiating options
could lead to the nonterminating request loop problem discussed in
the General Consideration section of the TELNET Specification. This
option fits into the normal structure of TELNET options by deferring
the actual transfer of status information to the SB command.
5. Description of the Option
WILL and DO are used only to obtain and grant permission for future
discussion. The actual exchange of status information occurs within
option subcommands (IAC SB STATUS...).
Once the two hosts have exchanged a WILL and a DO, the sender of the
WILL STATUS is free to transmit status information, spontaneously or
in response to a request from the sender of the DO. At worst, this
may lead to transmitting the information twice. Only the sender of
the DO may send requests (IAC SB STATUS SEND IAC SE) and only the
sender of the WILL may transmit actual status information (within an
IAC SB STATUS IS ... IAC SE command).
IS has the subcommands WILL, DO and SB. They are used EXACTLY as used
during the actual negotiation of TELNET options, except that SB is
terminated with SE, rather than IAC SE. Transmission of SE, as a
regular data byte, is accomplished by doubling the byte (SE SE).
Options that are not explicitly described are assumed to be in their
default states. A single IAC SB STATUS IS ... IAC SE describes the
condition of ALL options.
The following is an example of use of the option:
Host1: IAC DO STATUS
Host2: IAC WILL STATUS
(Host2 is now free to send status information at any time.
Solicitations from Host1 are NOT necessary. This should not
produce any dangerous race conditions. At worst, two IS's will
be sent.)
Host1 (perhaps): IAC SB STATUS SEND IAC SE
Host2 (the following stream is broken into multiple lines only for
readability. No carriage returns are implied.):
IAC SB STATUS IS
WILL ECHO
DO SUPPRESS-GO-AHEAD
WILL STATUS
DO STATUS
IAC SE
Explanation of Host2's perceptions: It is responsible for echoing
back the data characters it receives over the TELNET connection;
it will not send Go-Ahead signals; it will both issue and request
Status information.
AI ELI5
On this page
§1Command Name and Meanings
The Telnet Status option has the command name STATUS and option code 5. It applies separately to each direction of data flow.
Four commands matter. IAC DON'T STATUS and IAC WON'T STATUS both mean the sender refuses to discuss the current status of options any further. IAC SB STATUS SEND IAC SE asks the receiver to report its own view of the options (SEND is code 1). IAC SB STATUS IS ... IAC SE states the sender's view (IS is code 0). The default is DON'T STATUS and WON'T STATUS, so status is not discussed unless both sides agree.
There are a few special words: one means "tell me your settings", one means "here are my settings", and two mean "I do not want to talk about settings."
§2Why the Option Exists
The option lets a user or process verify the current state of Telnet options (echoing, for example) as seen by the party at the other end of the connection.
Renegotiating an option to find out its state could lead to the nonterminating request loop problem discussed in the General Consideration section of the Telnet specification. STATUS avoids this by fitting into the normal structure of Telnet options: it defers the actual transfer of status information to the SB subnegotiation command.
If you keep asking "are you sure?" by flipping the switch again and again, you can get stuck in a loop. Asking for a report is safer.
§3How a Status Exchange Works
WILL and DO are used only to get and grant permission for future discussion. The real status information travels inside subcommands (IAC SB STATUS ...).
Once a WILL and a DO have been exchanged, the sender of the WILL may send status information spontaneously or in response to a request. At worst the information is sent twice. Only the sender of the DO may send requests, and only the sender of the WILL may send actual status information.
Inside an IS report, the items WILL, DO and SB are used exactly as in real option negotiation, except that SB is terminated with SE rather than IAC SE. A data byte SE is sent by doubling it (SE SE). Options not listed are assumed to be in their default states, and a single report describes the condition of all options.
First both sides agree that a report is allowed. Then the one who agreed to report can send the list, and only the one who asked may ask for it.
§4The Example in the RFC
In the RFC's example, Host1 sends IAC DO STATUS and Host2 replies IAC WILL STATUS. Host2 is now free to send status at any time, and solicitations from Host1 are not necessary.
Host1 may still send IAC SB STATUS SEND IAC SE. Host2 then answers with IAC SB STATUS IS followed by WILL ECHO, DO SUPPRESS-GO-AHEAD, WILL STATUS and DO STATUS, ended by IAC SE. The RFC explains this as: Host2 echoes back the data characters it receives, will not send Go-Ahead signals, and will both issue and request status information.
One computer asks, "Can you tell me your settings?" The other says yes, and then lists them: "I repeat what you type, I do not send go-ahead signals, and I can tell you about settings."
- IAC DO STATUSAsks Host2 to take part in status reporting.
- IAC WILL STATUSHost2 may now send status at any time.
- IAC SB STATUS SEND IAC SEOptional request for a report.
- IAC SB STATUS IS ... IAC SELists WILL ECHO, DO SUPPRESS-GO-AHEAD, WILL STATUS, DO STATUS.