Telnet Status Option
Extracted elements (14)
The STATUS option was introduced because simply renegotiating options to verify their state could produce nonterminating request loops as described in the General Considerations section of the Telnet specification. This option allows verification without triggering renegotiation.
WILL and DO commands are used only to obtain and grant permission for future status discussion. Actual status information is deferred to SB subcommands, fitting STATUS into the normal Telnet option structure.
Because the WILL sender may transmit status spontaneously and also in response to a SEND request, a race condition exists where status information may be transmitted twice. Implementations must tolerate receiving multiple IS responses.
Once WILL and DO have been exchanged, the WILL sender is free to transmit status information spontaneously or in response to a SEND request. No solicitation is required before sending status.
Only the sender of DO STATUS may send solicitation requests (IAC SB STATUS SEND IAC SE). Only the sender of WILL STATUS may transmit actual status information (IAC SB STATUS IS ... IAC SE).
Options not explicitly described in an IS subnegotiation are assumed to be in their default states. A single IAC SB STATUS IS ... IAC SE describes the condition of ALL options.
The default state is DON'T STATUS / WON'T STATUS, meaning the current status of options will not be discussed unless the option is explicitly negotiated.
Within a STATUS IS subnegotiation, transmission of an SE data byte must be accomplished by doubling it (SE SE), following standard Telnet subnegotiation escaping rules.
An example exchange shows Host1 sending IAC DO STATUS, Host2 responding IAC WILL STATUS, followed by a SEND request and an IS response reporting WILL ECHO, DO SUPPRESS-GO-AHEAD, WILL STATUS, and DO STATUS as the perceived active options.
The IS subnegotiation payload uses WILL, DO, and SB subcommands in exactly the same form as used during actual Telnet option negotiation, except that nested SB is terminated with SE (not IAC SE).
The STATUS Telnet option is assigned option code 5. This option enables negotiation of status reporting capability between Telnet endpoints.
IAC DON'T STATUS and IAC WON'T STATUS are used to refuse further discussion of current option status. Both commands use the standard Telnet option negotiation encoding (3 bytes: IAC, command, option-code 5).
IAC SB STATUS IS ... IAC SE (subnegotiation with IS code=0) carries the sender's perception of all current Telnet option states. The payload uses WILL, DO, and SB subcommands mirroring actual negotiation syntax.
IAC SB STATUS SEND IAC SE (subnegotiation with SEND code=1) is sent by the DO side to request that the peer transmit its perception of the current option status.