RFC 139
Discussion of Telnet Protocol
RFC 139 Β· Discussion of TELNET Protocol β¨
Bestie, here's the title block tea β This is RFC 139 from the Network Working Group, written by T. O'Sullivan of Raytheon π. It's NIC 6717, dated 7 May 1971 π . The header doesn't list a category, and it doesn't list anything it obsoletes or updates. It does say it's an extension of RFC 137 (NIC #6717), and the footnotes cover the changes to RFC 137 π¦.
The preface is giving background πΈ. This attached discussion extends RFC 137, NIC #6717, so designers and implementers can understand the proposed Protocol and judge it before more talk at the Atlantic City meetings π.
The views in here come from various TELNET committee members, but they should not be read as the agreed view of committee π. They're the author's take on some of the arguments and background behind the PROTOCOL proposed in the TELNET PROTOCOL recommendations π§.
- See Footnotes to attached discussion for changes to RFC 137.
Discussion of TELNET PROTOCOL
Okay so this is the big idea π . If everybody uses one standard, network-wide intermediate representation of terminal code between sites, then the using and serving sites don't need to keep track of each other's terminal characteristics and terminal handling conventions. Iconic, right? π But that only works if the user, the using site, and the serving site each take on certain responsibilities:
- The serving site must spell out how it maps the intermediate code into the terminal codes it expects at its own site. π
- The user must be familiar with that mapping. π§
- The using site must give the user a way to enter all of the intermediate codes (and, as a bonus, special control signals), and also explain how signals from the serving site will be presented at the user terminal. β¨
Other schemes got considered too, but they got rejected π . One idea was making the using site responsible for transmitting to and from whatever code the serving site expects. Nope. That meant the using site would have to keep tables of every serving site code and provide a mapping for each case. That info would need constant upkeep every time new hosts joined the network. Way too much π.
Since nobody knows how current or future sites will map the network-wide standard code (7 bit ASCII in an 8 bit field) onto the codes their own terminals use, the user needs to be able to send every one of the 128 ASCII codes π₯. For full user power π, they also get selected control signals, either TELNET control ones or special terminal ones like break or attention.
People were super passionate about the user/system interface at the using site π₯Ή, but just as passionate that it's a local implementation thing. It should reflect the using site's installation philosophy instead of being subject to network-wide standards. Some topics in this area:
- How to represent special graphics, not available at the using site, at the user's terminal.
- Treatment of upper/lower case problem on TTY 33 and 35.
- Representing lower-case output.
- Providing users with shift and shift lock signals.
- Incorporating editing capability in TELNET.
- Extending user options in Network mode not available to local users, e.g.,
hold outputandkill print. - Permit users to specify how keyboard input is to be translated, e.g., let a character from the terminal cause a specified string to be sent by the user's TELNET.
Early on, there was pressure to get a simple protocol statement out fast so selected systems could start using it π. There was also counter pressure for a richer set of protocol in the first release. Work started toward the richer version, but its complexities weren't needed for early use of the network. The proposed TELNET solution seems to offer a minimum implementation (more on that later) while also giving a base to build richer protocol sets for terminal applications, process-process communications, and other conventions that pass data or control information π.
ASCII being the network-wide code has been the understanding for a while now π·. Using it in TELNET ran into a problem, though: the limit is a maximum character set of 128. Some systems offer more than that in their operation, so serving sites can't map one for one.
Each serving site could probably offer a pretty useful character set, control signals included, by mapping 128 of its codes and just not giving network users access to the rest. But any character left out might later become a special control signal in a major application at that site. That could mean network users lose access to that application's features π¬. So serving sites are, therefore, encouraged to provide a full mapping between the ASCII code and the code used on the serving system.
The ASCII code for ESC (known to some as ALT MODE) was picked as an escape [1] π¦. For each serving site character not mapped one for one, the serving site can specify an escape character or string of escape characters (preferably a printable graphic) to stand in for it. That way, users can enter the full set of serving site code from any network terminal running through the Network Virtual Terminal (NVT) ASCII convention. When the serving site generates output for the user's terminal, it's expected to map out such a character and send the matching ESC character or string of ESC characters π§.
Example: A serving site, whose normal code is EBCDIC, has specified that cent ([5]) has not been mapped on a one for one basis and that to transmit the character, users must enter ESC followed by C. At a using site, the TELNET implementers have decided to try to print out all ESC characters using \ to indicate ESC. On receipt of the representation for cent, the user would see \C on his print-out. π
The end of a physical line at a terminal gets handled differently on network HOSTS π¨οΈ. Some use a return (or new line) key, where the terminal hardware both returns the carriage or printer to the start of the line and feeds the paper to the next line. In other setups, the user hits carriage return, the hardware returns the carriage, and the software sends the terminal a line feed. The network-wide representation will be carriage return followed by line feed. It stands for the physical formatting being attempted, and both the using site and the serving site are supposed to interpret it and translate it appropriately π«Ά.
Example: A Multics user is working, through the network, on some serving site HOST. During the session, the user keeps hitting New Line on his Mod 37 TTY. Each time the Multics system gets woken up by a New Line interrupt, the line of buffered characters goes to TELNET, where it's scanned for special characters. If none is found, carriage return followed by line feed is inserted where New Line was entered, and the line is handed to the NCP for transmission. When TELNET finds the carriage return line feed sequence in the data stream coming from the serving site, it swaps those two characters for New Line code and sends that to the terminal π .
The default assumption for echo is that the using site provides any echo its terminals need π. That was chosen because some installations can't turn off their echo, and some terminals print locally as a result of key strokes. Serving sites could say "let the user turn my echo off," but that seems like an unnecessary burden on the user π. Also, some serving sites may choose not to supply any echo service. In that case, the no echo assumption gives a network-wide condition, while other assumptions would give a mixed starting connection. [2]
Using "I ECHO" and "YOU ECHO" seems to cover both the needs for dynamic echo control and a minimum implementation of TELNET Protocol. [3] An agreed-upon exchange to pass echo control (i.e., two sites exchange the I ECHO/YOU ECHO codes) passes the control from one site to the other π¦.
Example: A serving site is exchanging control information with the USER in an area where the serving system asks for pass word and wants to suppress printing the pass word at the using site's user terminal. (In this case, the using site has the ability to control the print capability at the user's terminal.) The using site has been echoing to the user's terminal.
Serving Site to Using Site (--->)
I ECHO
Using Site to Serving Site (<---)
YOU ECHO
--->Pass word:
<--- (User enters password at terminal)
---> (No echo sent)
---> YOU ECHO
<--- I ECHO
After the exchange, the original normal condition is re-established β¨. If the using site didn't have dynamic echo control installed in its TELNET implementation, the serving site would've signaled I ECHO several times, gotten no response, and assumed the using site couldn't comply. It would then go ahead and ask for the pass word without the normal protection of inhibiting print π±.
TELNET control signals come in two types π. One type sends signals down the network to a receiving site. The other is meant for the user/process site only, and we'll get to that later. So far we've been talking about the first type, specifically echo control.
Using ESC shouldn't be treated as a TELNET-wide standard π . It's a convention limited to the 7 bit ASCII mode of transmission. Other conventions, to be added later, may include binary transmission, EBCDIC, etc. Presumably, each will have its own convention for an escape character to extend its code set π§.
Since other conventions than ASCII are expected to be implemented under TELNET, a code is used to indicate a DATA TYPE for each set of conventions π. The control code X'AO' was selected to represent the ASCII convention in TELNET. Since a number of applications may want to transmit transparently (i.e., 8 bit binary data), X'Al' is reserved for that purpose. The TELNET control code X'A2' is reserved for an expected set of EBCDIC conventions. The DATA TYPE is expected as the first byte of data over a TELNET connection. Minimum implementations get help from a default: if the first byte over a connection has the high order bit set as zero, the transmission has begun in ASCII mode πΈ.
Each set of conventions, i.e., each DATA TYPE, is expected to have a way for that DATA TYPE to signal that it's returning to control mode π. The return may be for the purpose of making use of an existing control code or to change data type. X'88' is used [4] π.
Example: Okay so picture this π At the using site, there's a terminal with a special device on it (plotter, laboratory instrument, control box, etc.) that's controlled by binary code in 8 bit bytes. The terminal uses a special "enter" code that routes signals to the device and cuts off printing at the terminal until a special "leave" signal comes back from the driving process. In this case the driving process lives at a remote serving site π§ For this example we assume a DLE convention is used for transparent transmission, with a single DLE signal meaning return to control. Normal transmission is in ASCII β¨
Driving Process (at Serving Site) to Using Site) ---->
X'88'X'A1'
Using Site to Serving Site <----
X'88'X'88'
----------->
ENTER code...8 bit binary bytes...
Using Site TELNET to Terminal |
|
V
Enter code...8 bit binary bytes...
Terminal
Turn printer off, feed transparently to special device, look
for LEAVE signal
------------>
8 bit binary bytes...LEAVE signal...single DLE
X'A0'
<-----------
X'88'X'88
------------>
Message
|
|
V
8 bit binary data...LEAVE signal MESSAGE
_Terminal_
During this whole exchange, the terminal feeds binary data to the special device until it senses the LEAVE signal. Then it strips off that LEAVE signal, turns the printer back on, blocks the data path to the special device, and prints MESSAGE at the terminal. Bestie, that's a whole choreography π
Some terminals have a special control signal with no matching bit pattern in ASCII. It gets sent by a special electrical signal instead π That's ATTN on a 2741 and BREAK on a teletype. The ASCII DATA TYPE in TELNET uses X'81' to represent BREAK. (There's a corresponding control signal for reverse break, going from serving sites to using sites, and it's assigned the code X'82' π¦)
Some systems treat the break as an extra code they can use in the data stream. For example, one system uses break as a special editing code meaning "delete the current line to this point" π§Ή In those cases the code can simply be inserted in the data stream, with no special additional action by the user.
Other systems use BREAK or ATTN like an interrupt, to mean stop processing the application and give me the supervisor, or cancel the present job, etc. (Other systems use normal characters for this, like "Control C".) Because the two sites operate differently, you need a route in addition to the normal TELNET data stream to signal that the special control signal is embedded in the data stream π¦
Examples-Problem π
The PDP-10 normally keeps accepting characters from a terminal when its input buffer fills up. It checks each one to see if it's a control character, acts on it if it is, and throws it away if it isn't.
Since the TELNET server at the serving site is at the mercy of the NCP with respect to controlling the bunching, and therefor, arrival at the TELNET of bursts of characters, TELNET implementations might be expected to choke off flow to the buffers until they're ready to accept characters without throwing them away.
Under this condition, the serving process might be outputting to the using terminal, the input buffers fill up, and a control C gets stuck in the data stream that's been choked off π
A similar problem could occur with Multics or some IBM system as a server. The user at a using site gets into an output loop at the serving site and wants to break the process without having to release his TELNET connection. The buffers clog the connection, transmission gets choked off, and the control C break (or other user control signal) gets stuck in the pipeline.
Example - Solution π
The user at the using site knows he's entering a special control signal (break, ATTN, control C, etc.) and follows it with an X'80'. (The local instructions at using sites for accomplishing this may differ from site to site.)
Using Site TELNET to Serving Site
Insert X'80' in Data Stream
Using Site TELNET to Using Site NCP
Send an INS
Sending Site NCP to TELNET Server
Look out, here she come
Serving Site TELNET
Does its special thing until it sees X'80' then resumes
normal handling
So, depending on the server's local implementation providing adequate service, a special handling of the data stream can be invoked whenever an INS is received, in order to get the special character through. When it sees X'80', it recognizes it as a SYNC character. Knowing the special character has been passed on, it strips the X'80' from the data stream and returns to normal mode β¨
If the X'80' arrives before the INS, a counting scheme can keep the activity appropriate to the serving site conditions.
This approach relieves the using TELNET processes from having to recognize the special serving site characters, and from having to know how the serving site wants to handle them. At the same time, the procedure only requires a minimum level of user understanding of the serving site. That seems appropriate, since the TELNET ASCII conventions are providing a Network Virtual Terminal, not a Network Virtual User π
The ability of the user to cause the using site TELNET to send any combination of ASCII characters in a string, and only that combination, is viewed as important to the user utility of the TELNET ASCII conventions. Because of this, some user sites may find it necessary to provide special local TELNET control signalling from the user to the using site.
Examples π§
A user on a line at a time system (Multics, System 360, GECOS, etc.) is working through the Network on a serving site that operates a character at a time. The application is a debugging aid that lets the user type in a memory location = to which it will respond with n, where n represents the current contents of that location. The serving site process does not expect to see the location = followed by a carriage return line feed sequence. The user at the using site should be able to type in the location, follow it with a signal to suppress the end of a line convention, then a new line or return, and expect the location number = to be transmitted immediately without an end of line sequence.
In another case, a using site has decided it's convenient to accumulate four characters at a time and transmit them to the serving site, unless an end of line is observed. If one is, the end of line sequence is sent, preceded by whatever number of characters have been accumulated (presumably three or less). In the same debugging application, the address is such that the end does not correspond with the four character buffer demarcation. The user should have the ability to enter a code for "transmit immediately" in place of the Carriage Return, in order to preserve neat formatting, and expect the address to be sent to the serving site π
TELNET controls have been discussed, and those introduced to date are probably sufficient for an early implementation of the TELNET ASCII convention. There will be a need to establish a mechanism for the controlled assignment (on request by Network Sites), and announcement of DATA TYPE and CONTROL codes.
It should be noted that some controls are network-wide TELNET controls, while others are specific to the ASCII Data Type. It should be further recognized that some local control messages do not require a corresponding network-wide code.
While it's recognized that even a minimum implementation of TELNET for a using site is expected to let the user send any selected ASCII string (and only that string) to the serving site, it is not necessary for a serving site to implement a full mapping from ASCII to local code. Nor is it necessary for either the using or serving sites to implement all control codes.
Example - Using Site πΈ
A minimum implementation of the TELNET protocol for the using site would permit ignoring (and stripping) any control signals from the serving site. They would all either require agreement or acknowledgement (e.g., DATA TYPE, ECHO CONTROL, etc.), or they can be ignored with no particularly harmful results (e.g., reverse break).
Example - Serving Site π
A minimum implementation of the TELNET protocol for the serving site could provide a one for one mapping for the most important 128 serving system controls and graphic signals, and ignore all control signals.
It would be helpful if a minimally implemented receiving site, when it recognizes an incoming control signal for which an appropriate reaction is not available, could respond with X'87' (The following not implemented at this site) and follow it with the code just received π
Whenever an ASCII TELNET connection is lost, it should be assumed that the process at the other end of the connection has been quit, aborted, failed, etc. This way, a minimum using site installation can fail to implement the break and break synchronization, and have the user rely on the using site's local procedure for leaving a running local process and returning to the supervisor to break a connection to a remote serving site.
Example π¦
User recognizes that he is caught in an output loop and wishes to stop his user process at the serving site. The serving site requires a break, but the using site's minimum implementation has not made it available. Even if it had, the INS was not implemented and could not be used to unblock the input pipe. Locally, the using site convention for leaving a process and getting to supervisory level is to hit the attention key on the 2741 terminal. The user does this and is passed to the supervisor, where he signals to release the TELNET connection. The serving site, seeing that an ASCII TELNET connection has been lost, assumes that the user has ended, either normally or abnormally. The serving site cancels the user's process. The user tries again by re-establishing the connection, logging in again, re-initiating the process, etc. π
Other conventions under TELNET may make quite different assumptions about lost connections, and some may go as far as dynamic establishing and releasing of connections.
The proposed TELNET ASCII implementation leaves much uncovered, but it seems to permit early simple implementation with varying levels of capability, along with the capacity to expand in several ways to meet other needs π
There is an important open question. Should a PROTOCOL such as TELNET provide the basis for extending a system to perform functions that go beyond the normal capacity of the local system? For example, a local system may not provide functions such as Hold Output, Kill Print, etc., but it could extend it for network purposes through TELNET. If so, to what extent should such extensions be thought of as Network-wide standards, as opposed to purely local implementations? π€
Endnotes πβ¨
[1] Okay so first up: please drop the (s) at the end of "character" in paragraph 3, page 3, RFC 137, NIC #6714. π Tiny fix, but we stan precision π«Ά
[2] Also make note that the starting assumption in the initial exchange between using site and serving site will be that the using site will (if necessary) provide echo and the serving site will not. π¦ So the default is the using site handling echo if it needs to, and the serving site just... not.
[3] Note: Please change RFC #137, NIC #6714, page 4 - Code X'85' to read Reserved. πΈ X'85' gets relabelled Reserved, no drama.
[4] Please note on page 4 of RFC 137 that the receipt of an X'88' should be responded with by the receiver sending a double signal, i.e., X'88'X'88' if the new DATA TYPE can be handled. π The reply to an X'88' is the double signal, but only if the new DATA TYPE can actually be handled. π
[5] Cent sign πΈ (the Β’, bestie)
[This RFC was put into machine readable form for entry]
[into the online RFC archives by Lorrie Shiota, 1/02]
Huge shoutout to Lorrie Shiota π for getting this into the online archives, you're literally the reason we can still read this today π
π¦ where this page comes from
- ietf: rfc139 1971-05
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms