Telnet Echo Option
also
- std-28
Extracted elements (17)
A sample UHOST implementation tracks three per-terminal state bits — Physical (P), Desired (D), and Actual (A) — to manage echo mode. The A-bit is set to the MIN of the received request, P-bit, and D-bit, allowing user-level preferences to override server-requested echo modes without violating protocol semantics.
The Echo option exists because the NVT nominally operates with local echoing (keyboard output directly to printer), but highly interactive remote applications need to control echoing. The option allows both ends to agree that characters typed on an NVT keyboard will be echoed by the remote party.
If both hosts enter echo mode simultaneously — each echoing characters sent by the other — any character transmitted will be echoed back and forth indefinitely. Implementations must ensure that if one side is echoing, the other side does not also enable echoing.
The Echo option alone is normally insufficient to achieve character-at-a-time remote echoing as commonly understood; the SUPPRESS-GO-AHEAD option must also be negotiated in conjunction with the ECHO option to achieve that behavior.
Implementations of the Echo option MUST follow the loop-preventing rules given in the General Considerations section of the TELNET Protocol Specification.
The Echo option provides control over whether one end echoes for the other, but does NOT provide control over whether a host echoes for itself; that decision is left solely to the discretion of each system.
To minimize confusion (e.g., momentary double echoing), mode switches between echo and non-echo SHOULD be precisely coordinated with the reception and transmission of echo requests. For example, after receiving DO ECHO, all subsequent data characters should be echoed and WILL ECHO must immediately precede the first echoed character.
When the echoing option is in effect, the echoing party MUST transmit (echo) data characters it receives back to the sender. The echoed characters need not be identical to what was received (e.g., ESC may be echoed differently).
When the echoing option is NOT in effect, the receiver of data characters should not echo them back to the sender; the receiver is still free to respond to those characters.
The default state is WON'T ECHO / DON'T ECHO, meaning no echoing is performed over the TELNET connection unless explicitly negotiated.
The TELNET connection is full-duplex; each direction may independently operate in echo mode. Five distinct echoing configurations exist: neither end echoes, one end echoes for itself, one end echoes for the other, both ends echo for themselves, or one end echoes for both.
The Telnet Echo option is assigned option code 1. This code is used in IAC WILL/WON'T/DO/DON'T ECHO command sequences.
The echo negotiation follows the standard TELNET option negotiation state machine: a party sends WILL ECHO or DO ECHO to request echo mode; if accepted the connection enters echo mode; either party may revert by sending DON'T ECHO or WON'T ECHO which the other must confirm. Each direction of the connection is negotiated independently.
IAC DO ECHO (3-byte sequence) requests that the receiver begin echoing, or confirms that the receiver is expected to echo, data characters it receives back to the sender.
IAC DON'T ECHO (3-byte sequence) demands the receiver stop or not start echoing data characters it receives over the TELNET connection.
IAC WILL ECHO (3-byte sequence) requests or confirms that the sender will begin echoing received data characters back to their sender.
IAC WON'T ECHO (3-byte sequence) demands that the sender stop or refuses to start echoing received data characters back to the sender.