RFC 857

Telnet Echo Option

๐Ÿ“… published May 1983, from ietf

TELNET ECHO OPTION ๐ŸŽ€

okay bestie, so this is RFC 857 ๐Ÿ“œ It's from the Network Working Group and it was written by J. Postel and J. Reynolds at ISI in May 1983. It obsoletes NIC 15390, so that older doc is officially retired ๐Ÿ’€ The status line says it specifies a standard for the ARPA Internet community, and hosts on the ARPA Internet are expected to adopt and implement it ๐Ÿซถ


1. Command Name and Code โœจ

the option has one name, ECHO, and it's command code 1 ๐Ÿ”ข

ECHO       1

2. Command Meanings ๐Ÿ’…

there are four commands, and each one has its own vibe ๐Ÿฆ‹

2.1. IAC WILL ECHO

  • IAC WILL ECHO means the sender REQUESTS to start echoing the data characters it gets over the TELNET connection back to whoever sent them, or it's confirming that it will now begin ๐ŸŒธ

2.2. IAC WON'T ECHO

  • IAC WON'T ECHO means the sender DEMANDS that echoing stops, or it refuses to start ๐Ÿ™…โ€โ™€๏ธ

2.3. IAC DO ECHO

  • IAC DO ECHO means the sender REQUESTS that the receiver start echoing, or it's confirming the receiver is expected to echo the characters it gets back to the sender ๐Ÿ”ฅ

2.4. IAC DON'T ECHO

  • IAC DON'T ECHO means the sender DEMANDS the receiver stop echoing, or not start ๐Ÿ‘‘

3. Default ๐Ÿ“

the default is WON'T ECHO and DON'T ECHO, which basically means no echoing happens over the TELNET connection ๐Ÿ’œ

4. Motivation for the Option ๐Ÿงš

okay so the NVT has a printer and a keyboard, and they're nominally hooked up so that "echoes" never have to travel over the network ๐Ÿ–จ๏ธ Basically the NVT normally runs in a mode where whatever you type gets turned around locally and printed ๐Ÿ’ป

But in highly interactive situations, it's giving "the remote process should control the echo" ๐Ÿ‘€ That means the command language interpreter, or whatever process the characters are going to, should be the one deciding how they get echoed on the printer โœจ So there needs to be a TELNET option that lets both ends agree that characters typed on an NVT keyboard get echoed by the party on the other end of the connection ๐Ÿซถ

5. Description of the Option ๐Ÿ’–

when the echoing option is in effect, the party doing the echoing is expected to transmit (echo) the data characters it receives back to the sender ๐Ÿ“ฃ The option doesn't require the echoed characters to be exactly the ones received. For example, a bunch of systems echo the ASCII ESC character as something other than ESC ๐Ÿ™ˆ When echoing is not in effect, the receiver of data characters should not echo them back to the sender. That doesn't stop the receiver from responding to the characters it got, though ๐ŸŒˆ

The normal TELNET connection is two way ๐Ÿ” Data flows in each direction independently, and neither, either, or both directions may be operating in echo mode at the same time ๐Ÿฆ‹ There are five reasonable modes of operation for echoing on a connection pair, and here they are:

                <----------------

      Process 1                   Process 2
                ---------------->
                 Neither end echoes
                <----------------
                   \
      Process 1    /              Process 2
                ---------------->
             One end echoes for itself
                <----------------
                             \
      Process 1              /    Process 2
                ---------------->
          One end echoes for the other
                <----------------
                   \         /
      Process 1    /         \    Process 2
                ---------------->
          Both ends echo for themselves
                <----------------
                   \ /
      Process 1    / \            Process 2
                ---------------->
           One end echoes for both ends

this option lets you decide whether or not either end will echo for the other ๐ŸŽ€ It does not control whether an end echoes for itself. That's left totally up to the systems at each end, though they can use info about the state of "remote" echoing negotiations when they make that call ๐Ÿ’…

โš ๏ธ Watch out: if BOTH hosts enter the mode of echoing characters transmitted by the other host, then any character sent in either direction will get "echoed" back and forth indefinitely ๐Ÿ˜ญ So each implementation should take care that, if one site is echoing, echoing is not permitted to be turned on at the other site ๐Ÿšซ

as the TELNET Protocol Specification explains, both parties to a full-duplex TELNET connection start out assuming each direction is in the default mode, which is non-echo. (Non-echo means not using this option, and it's the same as DON'T ECHO and WON'T ECHO) ๐ŸŒธ

if either party wants itself to echo characters to the other party, or wants the other party to echo characters to it, that party sends the appropriate command (WILL ECHO or DO ECHO) and then waits (and hopes) for the option to be accepted ๐Ÿคž If the request is refused, the connection keeps operating in non-echo mode. If it's accepted, the connection goes into echo mode โœจ

once a connection is in echo mode, either party can demand that it go back to non-echo mode by sending the appropriate DON'T ECHO or WON'T ECHO command. The other party has to confirm that, which lets the connection operate in non-echo mode again ๐Ÿ‘‘ Just like each direction can enter remote echoing mode independently, each direction has to be removed from remote echoing mode separately ๐Ÿฆ‹

implementations of the echo option, like implementations of every other TELNET option, must follow the loop preventing rules in the General Considerations section of the TELNET Protocol Specification ๐Ÿ”’ Also, so that switches between echo and non-echo mode happen with minimal confusion (momentary double echoing, etc.), mode switches should be timed precisely with the reception and transmission of echo requests and demands โฑ๏ธ For instance, if one party answers a DO ECHO with a WILL ECHO, then all data characters received after the DO ECHO should be echoed, and the WILL ECHO should come right before the first of the echoed characters ๐Ÿ’œ

the echoing option by itself usually won't be enough to get what people normally call remote computer echoing of characters typed on a terminal keyboard ๐Ÿ™ƒ You'll normally have to invoke the SUPPRESS-GO AHEAD option along with the ECHO option to get character-at-a-time remote echoing ๐ŸŽ€

6. A Sample Implementation of the Option ๐ŸŒˆ

here's a description of a possible implementation for a simple user system called "UHOST" ๐Ÿ–ฅ๏ธ

so for each user terminal, the UHOST could keep three state bits: whether the terminal echoes for itself (UHOST ECHO always) or not (ECHO mode possible), whether the (human) user prefers ECHO mode or non-ECHO mode, and whether the connection from this terminal to the server is in ECHO or non-ECHO mode. We'll call these three bits P(hysical), D(esired), and A(ctual) ๐Ÿง 

when a terminal dials up the UHOST, the P-bit gets set appropriately, the D-bit is set equal to it, and the A-bit is set to non-ECHO ๐Ÿ“ž The P-bit and D-bit can be manually reset with direct commands if the user wants ๐Ÿซถ For example, a user in Hawaii on a "full-duplex" terminal would choose not to operate in ECHO mode, no matter what a mainland server prefers ๐ŸŒบ They'd tell the UHOST to change their D-bit from ECHO to non-ECHO ๐Ÿ๏ธ

when a connection is opened from the UHOST terminal to a server, the UHOST would send the server a DO ECHO command if the MIN of the P- and D-bits (with non-ECHO counted as less than ECHO) is different from the A-bit ๐Ÿงฎ If a WON'T ECHO or WILL ECHO arrives from the server, the UHOST sets the A-bit to the MIN of the received request, the P-bit, and the D-bit ๐Ÿ’… If that changes the state of the A-bit, the UHOST sends the appropriate acknowledgment. If it doesn't change anything, the UHOST sends the appropriate refusal, but only if not changing meant it had to deny the request (that is, the MIN of the P- and D-bits was less than the received A-request) ๐Ÿ™…โ€โ™€๏ธ

if the UHOST terminal user changes either the P-bit or the D-bit while a connection is open, the UHOST repeats the tests above and sends a DO ECHO or DON'T ECHO if it's necessary ๐Ÿ” When the connection closes, the UHOST resets the A-bit to indicate UHOST echoing ๐ŸŒธ

the UHOST implementation wouldn't send DO ECHO or DON'T ECHO commands to the server except when the connection opens or the user explicitly changes their echoing mode. Bigger hosts might switch modes pretty often though ๐Ÿข For example, while a line-at-a-time system is running, the server might try to put the user in local echo mode by sending WON'T ECHO. But while a character-at-a-time system is running, the server might try to turn on remote echoing for the user by sending WILL ECHO โŒจ๏ธ Also, while the UHOST will never send WILL ECHO and will only send WON'T ECHO to refuse a DO ECHO from the server, a server host might often send both WILL and WON'T ECHO ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from