RFC 97
First Cut at a Proposed Telnet Protocol
RFC 97: A First Cut at a Proposed Telnet Protocol π§π
Quick title-block tea ββ¨
- RFC: 97 (also NIC 5740)
- Authors: John T. Melvin and Richard W. Watson, both at SRI-ARC
- Date: 15 February 1971
- Category/status: not stated in this copy
- Obsoletes/Updates: nothing listed in this copy
Okay bestie, this is the 1971 "first cut" at how a remote terminal should talk to a computer over the ARPA Network. Telnet π» It's the great-grandparent of how we all log into stuff now, so it's lowkey iconic π
1 Introduction πΈ
okay so this paper describes a first cut at a proposed Telnet protocol. Telnet is a process that runs at a user's site and lets them use a typewriter-like terminal to get interactive service from a remote server site over the ARPA Network. π₯οΈβ¨ The whole reason this paper exists is that they needed specs for a protocol that would let people get online access to the Network Information Center (NIC). They call the online system running there NLS(NIC). π
Then they got a little bit of a main character moment and went, "what if we generalize this so it works for other systems too?" π¦ The authors are very real about it though: lots of other terminal hardware and software setups might struggle to follow every requirement in here, so the final Telnet protocol will probably look a bit different from this NWG/RFC. π«Ά Honestly the big takeaway is that connecting to the network might push everyone toward a more standard way of handling terminals and their character streams, in monitors and terminal control hardware alike. π₯
In the meantime, they're hoping this paper, other papers on the same topic that might be in the works, and a survey of hardware and software needs at each site (done by an NWG subgroup) can quickly lead to an initial standard network Telnet protocol. Why the rush? Because they really want users on the network ASAP, so that real interactive use can show them where network protocols should go next. π
The rest of the paper goes like this: first some design problems, then some conventions to solve them for systems like NLS(NIC), then a few problems that still need study. The proposed conventions for NLS(NIC) access are summed up in Appendix A. π
2 Some Design Problems π
2A. Basic Assumption π
The job of the Telnet process is to make a terminal at a user site look, over the network, logically equivalent to a terminal that's "directly" connected to the server site. That basic function has a bunch of implications, so let's go:
- i) The user should be able to generate all the codes a server system terminal can generate. For the Network Information Center and some other sites, it seems like a reasonable requirement to have keying conventions so the user can generate all 128 ASCII character codes as network input. Other sites with different character codes might need the Telnet process to supply those codes to the network. π
- ii) The user should be able to escape back to their local system, or escape from the server process to the server system. πββοΈπ¨
- iii) Telnets of line-at-a-time systems should be able to work with character-at-a-time systems and line-at-a-time systems. Telnets of character-at-a-time systems should be able to work with line-at-a-time and character-at-a-time systems. It's giving compatibility, periodt π
2B Echo Control π¦
they use the term echo control instead of half duplex or full duplex, because the Telnet connection is actually full duplex with respect to network transmissions. β¨ Three terminal cases need to be considered:
- Case 1 - Character-at-a-time serving site echoed
- Case 2 - Character-at-a-time user site echoed
- Case 3 - Line-at-a-time user site echoed
Some serving sites might be able to handle all three cases, but some convention is needed to set the mode. Strictly speaking, the serving site doesn't care which characters get echoed for which keys struck π€·ββοΈ but it would be nice to minimize differences in the typescript as the user sees it. π
2C Format Control Characters π
The format control characters horizontal tab (HT), vertical tab (VT), form feed (FF), line feed (LF), and carriage return (CR) need to be handled in a consistent way for Cases 2 and 3 above. Case 1 is much simpler. π§
2D Network Message Boundaries π«§
The NCP to NCP protocol was specified with the goal of keeping network message boundaries invisible to user processes. That's a goal that would be great to keep, but it may be tricky with some line-at-a-time systems. π
2E An Implementation Convention π
Conventions for all of the above are easiest to set up if we assume the following: the character stream a Telnet process sends to the server site gets entered at the point in the server monitor where character input from "directly" connected terminals goes in. And output from the server process gets entered at the point in the monitor where normal character output goes in. The server NCP gets its input from the point where normal monitor character output is picked up. π
In other words, the server process gets its input from the server monitor character buffers and sends its output to those same buffers. It does not grab input straight from NCP buffers or push output into NCP buffers. πͺ
The Telnet process, on the other hand, gets and sends character streams directly from or to its local NCP. π‘
Other situations exist where the user processes at both ends talk directly to the NCP. So the authors recommend that both modes of connection, user process-monitor-NCP or user process-NCP, be available for communication between the NCP and a user process. These modes would be set under program control by the user process. ποΈ The initial network convention during the login procedure, and until the server process changes it, is to get characters from and send characters to the monitor. The server NCP also talks to the monitor. The scheme is shown in Figure 1. πΌοΈ
The motivation for all this flexibility gets clearer in the discussion below. π
3 Proposed Telnet Conventions π
3A The Echo Default πΈ
The server site should initially assume that echoing is performed by a user site process, until it's explicitly commanded otherwise. If the user site can send character-at-a-time, then after connection and login are established, the user can command the server site to switch to server-site echo. Then they can (invisibly to the server site) command their local Telnet to change its echo mode too. π
3B Character Set and Control Codes π¦
The server process should assume it will receive the same character set that terminals "directly" connected to it can generate. (They recommend at least 128 character ASCII.) β¨ The user's Telnet may have to recognize two-character sequences in order to generate both upper and lower-case codes, plus the control codes. π
They recommend that the user be able to set either upper or lower case as the default case for single-case terminals, and to specify a case shift character. The user should also be able to specify a character that means "the next character struck should be converted to the appropriate control character code." This last convention lets control codes generated directly at the terminal be recognized by the user's system, which enables escape to the user system. πββοΈ
Creating a convention that lets all control codes enter the network, and lets network output feed into the server monitor before it enters the server process, gives a simple mechanism for generating an escape to many existing systems. π (It's more complicated than that for some systems, and we get into it further below.) π₯²
3C Local Echoes of HT, VT, and FF π
They recommend that network standards be established for what local echoes of HT, VT, and FF mean. Or, a convention could be set up for sending the meaning of these characters to the server process. π
For example, NLS(NIC) needs to keep track of where the print head is. Without such conventions, it will convert these character codes to spaces and line feeds. π¬ That means the page can look different on output than it did on input. It would be really helpful for the user if their page on output could be formatted the way it looked on input. π
3D LF Characters π§
LF characters should be handled as if they were generated by hitting the line feed key on a terminal "directly" connected to the server system. π
3E The Carriage Return π
The carriage return (CR) character is the source of a lot of trouble, honestly. π For example, on input, different systems (and the same system at different times) can echo and transmit different codes to the terminal and the user process. Some monitor systems echo nothing, just a CR, or a CRLF. Some systems send a CR, CRLF, or end-of-line code (EOL) to the user process. And the user process may control the echo or add to it. π
With all the combinations that can exist at each end of the network connection, and in relation to each other, things get confusing unless we assume the definition in 2A and the implementation convention in 2E. Those assumptions mean that when a CR is struck, a CR gets sent over the network. β If the user monitor system or terminal control hardware converts a CR to a CRLF or EOL, then the Telnet program must convert it back to a CR. When the CR reaches the server monitor, it will handle it properly for the server process. π
When echoing is handled by the server system, the proper code or codes will be echoed. The user Telnet, on receiving a CRLF, can pad it with the proper nulls to handle carriage movement timing for a particular terminal. β±οΈ
When echoing is handled by the user system, it would be ideal if the user's Telnet or system used the same echo convention as the server system. That means either the Telnet needs a table of echo conventions for the various systems it can connect to, or it can get that information from the server system or process, or vice versa. ποΈ
For an initial Telnet protocol, this probably isn't necessary. The user system can default to echoing a CRLF on each CR received. The authors think this default should be satisfactory for all the situations they're familiar with, and for the NIC. πβ¨
Part 1 wraps up here, so there's more of this RFC coming in the next part. Stay tuned, bestie π«Άπ¦
3F. Line-at-a-time systems and EOS π
Okay bestie, so for communication from character-at-a-time and line-at-a-time systems, the Telnet process may need to recognize one character (user assignable) that we call end of stream (EOS) β¨. That character gets the function described below. The big thing to remember is that end-of-stream is a network function, and end-of-line is a user or server system function. Don't mix them up π
Let's start with line-at-a-time systems. ngl we haven't had a ton of experience with these yet, so what follows needs more study and clarification π. As we understand it, line-at-a-time systems recognize a character like CR, or a break signal, as the code to wake up the user process and send it the line of text. From NLS(NIC)'s point of view, it's important that the user can enter lines of text, each ended by a CR where appropriate, and at other times enter text that is not terminated with a CR. (A statement for NLS(NIC) is a string of text of "arbitrary" length and need not have CRs in it; on output the line is folded for the user at his (user definable) page boundary.) π
Here's an example of what's needed. Say the user's system recognizes CR as end-of-line. Then the Telnet would be awakened when a CR is received. We'd recommend that the CR code be literally entered into the Telnet output buffer. If a CR is preceded by an EOS character, then the CR should not be placed in the Telnet output buffer. Transmission through the network can happen either when an EOS is received or automatically when the Telnet output buffer fills. Transmission to character-at-a-time systems from line-at-a-time systems could require the awkward striking of three keys to get one character through the network π₯΄
Now think about sending from a character-at-a-time system to a server line-at-a-time system. A similar problem also exists between line-at-a-time systems. If the EOS is defined as something other than CR, a line can be buffered up until the EOS is received and then sent without the EOS. But then how is the serving system supposed to know that a line has been sent? π€ One way would be for the serving NCP to recognize message boundaries. That convention would violate a design goal. Another way would be for the user Telnet to ask its NCI to send an INS command. Sending INS-type control commands might introduce race conditions in the network, so this should be investigated before it's used with a Telnet process. Since some line-at-a-time systems we know have special hardware that recognizes the end-of-line signal, we need some way to stay compatible with that hardware using software control signals. We leave this problem for further NWG subgroup study π
3G. Interrupting or escaping on the remote server π
Now back to the problem of interrupting or escaping in the remote server system. In systems that don't lock out the input keyboard while output is going on, the mechanisms and conventions outlined above would seem adequate, unless a special break signal is the escape signal. That latter case needs more study. In systems that allow no input while output is occurring, you may have to live with the consequences of that terminal discipline and be prepared to wait until output stops before an escape code can be sent. If the keyboard is locked and an escape break signal can be sent to the user's system, it can prevent output from going to the terminal, but it must be prepared to keep receiving output from the server site until the user can tell his Telnet process to send an interrupt or escape signal to the server site. Again, this is a problem for further study π§
The Online System of the Network Information Center operates on a character-at-a-time monitor system, and the conventions established in this paper are adequate for access to it. These conventions are summarized in Appendix A πΈ
APPENDIX A β¨
NETWORK CONNECTION PROTOCOL TO SRI-NETWORK INFORMATION CENTER
1. Initial Connection Protocol π
Connection establishment to NIC is identical to what's presented in Section II of NWG/RFC 80 NIC (5608,). It's reproduced here:
Telnet contacts NIC
NIC <- user site
RTS <us> <l> <p>
NIC logger is socket 1
user site <- NIC
STR <l> <us> CLS <l> <us>
if accepted
CLS <l> <us>
if rejected
assuming NIC accepts
user site <- NIC
STR <ss+l> <us>
RTS <ss> <us+l> <q>
NIC receives text thru local socket ss from remote
socket us+l via link q
assuming user site accepts
NIC <- user site
STR <us> <ss+l>
RTS <us+l> <ss> <r>
NIC sends text to remote socket us thru local socket
ss+l via link r
.
.
.
user site <- NIC
ALL <q> <space>
.
.
.
NIC <- user site
ALL <r> <space>
2. Connection Breaking Protocol π
A CLS trade is made between the NCPs for each of the two connections, as per Document #1 NIC (5143,).
We may decide to put a time-out into the NIC connections, so that no interaction for some (as yet unspecified) "reasonable" length of time will result in a CLS-out of the connections being initiated by NIC.
3. Third Level Protocol π§©
The first 8 bits received by NIC through socket ss should be the message data type designating that an 8-bit ASCII stream follows, as per NWG/RFC #63, NIC (4963,).
I.e., the first 8 bits are 00000001
The first 8 bits received by Telnet through socket us will also indicate a message data type of l. Each network message should have an integral multiple of 8 bits. If a network standard is established that's different from the suggestion of NWG/RFC #63, NIC (4963,), then we would change this protocol to conform.
NIC will have NCP-generated interrupts disabled, i.e.,
- INR will be ignored
- INS will not be sent to the remote host
4. NLS(NIC) Character Conventions of Interest to Telnet π€
Echoing can either be under control of NIS(NIC) or under control of the user site. When we refer to echoing below, we mean under control of NLS(NIC). When echoing is handled by the user site, we'd expect the user to set the NLS(NIC) output conventions to match the echoing conventions at his site. NLS(NIC) assumes echoing is handled by the user site unless explicitly commanded otherwise.
Format affecting control characters:
- horizontal tab
- Spaces to the next (user definable) stop on both echoing and output.
- If during literal input, enters file as ASCII '11.
- form feed
- Carriage return and (user definable) appropriate number of line feeds on echo and output.
- If during literal input, enters file as ASCII '14.
- vertical tab
- Carriage return and (user definable) appropriate number of line feeds on echo and output.
- If during literal input, enters file as ASCII '13.
- carriage return
- Carriage return followed by line feed on echo and output.
- If during literal input, enters file as EOL (see below).
- line feed
- Line feed on echo and output.
- Enters file as ASCII '12 on literal input.
- EOL (end of line)
- Presently ASCII code '37.
- Carriage return followed by line feed on echo and output.
- If during literal input, enters file as ASCII '37.
If the user's system automatically appends a LF to a CR before sending it to Telnet, or converts CR to some EOL code not ASCII '37, we would expect Telnet to send NLS(NIC) just a CR or ASCII '37. If we receive CRLF, then on output we will send CRLFLF.
5. NLS(NIC) Interrupt Attention Convention π¨
A (user definable) ASCII code in the text input stream is used to abort the executing process and return control to the main NLS(NIC) command processor.
This code is presently DEL (ASCII '177).
- Escape to the NIC monitor: No escape is required, as all operations needed for use of the NIC can be performed within NLS(NIC).
- Character Set: We strongly recommend that the Telnet process be able to generate, by some set of keying conventions, all 128 ASCII codes. Use of NLS(NIC) will probably feel most comfortable from a device with upper and lower case graphics, although we can provide service to single case devices. We can provide a useful service if the full ASCII set cannot be sent, but we would like to minimize the special cases we have to handle. Sites which cannot provide the full ASCII set should contact us.
Figure 1 shows the pieces involved in a Telnet connection πΊοΈ
+----+ |
| | Server |
| | Program |
| | |
+----+ |
^ | |
| v |
+----+ Terminal |
| | control |
| | software | SERVER
| | and | SITE
+----+ possibly |
^ | hardware |
| v |
+----+ |
| | |
| | NCP |
| | |
+----+ |
^ | |
| v |
. .
. . Figure 1 -
. .
. . Telnet Connection
^ |
| v
+----+ |
| | |
| | NCP |
| | |
+----+ |
^ | |
| v |
+----+ |
| | |
| | Telnet |
| | |
+----+ |
^ | | USER
| v | SITE
+----+ Terminal |
| | control |
| | hardware- |
| | software |
+----+ |
^ | |
| v |
+----+ |
| | User |
\ | terminal |
\--+ |
[ This RFC was put into machine readable form for entry ]
[ into the online RFC archives by Tony Hansen 08/08 ]
π¦ where this page comes from
- ietf: rfc97 1971-02
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms