RFC 158
Telnet Protocol: A Proposed Document
RFC 158: TELNET Protocol π
okay bestie, RFC 158 is giving vintage π¦ It was written by T. O'Sullivan from Raytheon, posted to the Network Working Group, and dated 19 May 1971 (NIC 6768). It's a Request for Comments, so the TELNET committee is literally asking everyone to weigh in. The header doesn't list anything it obsoletes or updates.
This is part 1 of 2 π§
Here's the vibe: the TELNET committee is circulating this proposal to get feedback, evaluation, and change requests. If comments don't reach the writer within two weeks of the date of this RFC, they won't make it into the official TELNET PROTOCOL document. Not a vibe π
The proposal is the committee's joint work, and it's meant to be a TELNET protocol that's good enough for a first implementation π
Before you dive in, the RFC points you to these earlier releases for background π
- Conventions for Using an IBM 2741 Terminal or a User Console for Access to Network Server HOSTS Joel Winett, RFC 110 (NIC #5809)
- Response to RFD 110 Wayne Hathaway, RFC 135 (NIC #6712)
- Level III Server Protocol for the Lincoln Laboratory 360/67 HOST Joel Winett, RFC 109 (NIC #5808)
- First Cut at a Proposed TELNET Protocol J. Melvin, D. Watson, RFC 97 (NIC #5740)
- ASCII Format for Network Interchange V. Cerf, RFC 20 (NIC #4722)
- Discussion of TELNET PROTOCOL Tom O' Sullivan, RFC 139 (NIC 6717) (Although relevant to the obsoleted RFC 137 (NIC 6714) many of the examples still hold. A replacement discussion document RFC 159 (NIC 6769) will be forthcoming in the near future).
TELNET PROTOCOL
A Proposed Document
T. O'Sullivan for the TELNET Committee
Will Crowther BBN
Bob Long SDC
John Melvin SRI-ARC
Bob Metcalfe Harvard
Ed Meyer MAC
Tom O'Sullivan (Chairman) Raytheon
Joel Winett MIT-LL
Telnet Protocol π
TELNET is a third-level protocol, and its whole job is making a terminal (or process) at a using site look to the system, or a process, at a serving site like it's logically equivalent to a terminal "directly" connected to the serving site β¨ The protocol also tries to keep each HOST from having to remember too much about the characteristics of other HOSTS, which is honestly so considerate π«Ά
Definitions πΈ
Protocol Levels (see Figure 1) π§
- Level 1: HOST-IMP protocol specified by BBN in NIC 5735, Specifications for the Interconnection of a HOST and an IMP (BBN Report 1822)
- Level 2: HOST-HOST protocol performed by NCPs as described in Document Number 1 (NIC 5413) and subsequent amendments, see RFC 107 (NIC #5806)
- One way to think about the NCP is that it takes information from the net and routes it to receiving processes through mechanisms inside each HOST. Going the other way, processes use the NCP, through internal system calls, to have information routed to other processes on the net (via the other processes' NCPs). β¨
- Level 3 (see Figure 2): Level 3 is, by definition, the place to which and from which the NCP communicates internally in its own host.
- This level may be equivalent to the user process level in some systems, but this may not be the case in all systems. At using sites, the TELNET process operates at this level. At serving sites, the TELNET server operates at this level. π
Initial Connection Protocol (ICP) π¦
An agreed-upon sequence of level 3 exchanges between two processes. It's generally used to sync up the connection dialogue between the processes, e.g., RFC 80 (NIC #5608) #1, as revised by subsequent information.
Serving Site π
The HOST that the TELNET process directs the user's keyboard input into, and that sends the TELNET process control information and data affecting the user's terminal. A TELNET server is executing at the serving site.
Using Site π»
The HOST in which the TELNET process is executing.
Sending Site π€
The HOST transmitting data. It could be either the using site or the serving site.
Receiving Site π₯
The converse of sending site.
User π§βπ»
The person or process "driving" the TELNET process.
Overview of Services β¨
In providing services, the TELNET protocol uses established network conventions, specifically the Network Control Program and the Initial Connection Protocol mentioned in the definitions above. It uses a byte size of 8 bits on the permanent connection.
The TELNET protocol provides a Network Virtual Terminal (NVT) π₯οΈ Users send and receive data through it over connections between the using site and the serving site.
The NVT code is full 7 bit ASCII. The seven-bit code gets transmitted in eight-bit bytes, with the high order bit set to zero. Iconic π
It's the using site's job to give its users a way to produce all 128 ASCII codes, plus a selected set of special TELNET control signals (see Figure 3) π
The ASCII character ESC is used by the user as an escape signal, meaning the next character(s) has special meaning. The meaning given to the escape code is defined by the serving site, so it may not be consistant across the network. Not me going "huh" π
It's the serving site's job to spell out for users how the NVT code will be used to represent the codes normally generated by a local terminal. Where it's reasonable, that representation is expected to map one-for-one onto the ASCII graphics and controls provided through local terminals. The serving site also specifies how the escape conventions get interpreted by the system. π§
The end of a line is represented in the NVT as carriage return (X'0D') followed by line feed (X'0A') π
The protocol assumes that, at first, the serving site won't provide any echo to the using site π
Every TELNET control signal that needs its code sent over the connection is represented in the NVT by an eight-bit code, with the high order bit set to one. Here are the special codes established so far. (U) means that in most implementations, the user is expected to be able to signal the TELNET process from their terminal to start the code. π₯
X'A0'- Source: Both Sites (U)
- Meaning: A DATA TYPE[1] signal indicating that code will be transmitted by NVT, i.e., using the seven-bit ASCII conventions.
X'80'- Source: Using Site (U)
- Meaning: Order using site NCP to send an INS and insert X'80' in data stream.
X'81'- Source: Using Site (U)
- Meaning: Break or Attention, and reverse break.
X'82'- Source: Both Sites
- Meaning: No op
X'83'- Source: Both Sites
- Meaning: Don't Echo
X'84'- Source: Both Sites
- Meaning: You Echo
X'85'- Source: Serving Site
- Meaning: Hide your input [2]
Some special TELNET control signals are required to let the user on some systems send control information to the using site TELNET process[3]. These don't need a matching control code for transmission. The local TELNET control signals are: 1. Transmit all data to this point. 2. Suppress transmission of end of line, send all other data.
Data is forwarded to the NCP for transmission as convenient, but at least at the end of line, end of line suppression, and transmit signals. If the normal line length of the sending site is greater than the allocation given by the receiving site, the sending site's NCP, TELNET process, or TELNET server must be prepared to send line segments in convenient lengths until the full line has been sent. π
Minimum Implementation π
A minimum implementation of TELNET for both the using site and the serving site looks like this:
Using Site π»
- 1.) Provide User (human or process) with ability to cause all 128 ASCII codes to be transmitted in the required 8 bit field to the serving site.
- 2.) Ignore (and strip) all TELNET control characters received from the serving site.
- 3.) Provide echo or local print capability to local user terminals.
- 4.) Provide for CR-LF end of line convention.
- 5.) Implement local TELNET controls (See discussion above of local TELNET control signals) for transmit or suppress end of line.
Serving Site π
- 1.) Provide (and announce) one for one mapping between ASCII and Serving Site character and control set (or if Serving Site set greater than 128, a sub set.)
- 2.) Ignore (and strip) all TELNET control characters received from the Using Site.
- 3.) Assume Using Site will provide local terminal echo or print capability.
- 4.) Provide for CR-LF end of line convention.
Okay bestie, the tables are where the magic happens π Here's the first chart, the one with the bit labels down the side. Every single cell matters, so I kept it exact:
+---------------------------+----+----+----+----+----+----+----+----+
|\ b8 -> | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| \ b7 -> | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| \ b6 -> | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
|B \ b5 -> | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| I +---+---+---+---+------+----+----+----+----+----+----+----+----+
+ T | b | b | b | b |\COL->| | | | | | | | |
\ S| 4 | 3 | 2 | 1 | \ | | | | | | | | |
\ | | | | | |\ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
\ | | | | | | | | | v \ | | | | | | | | |
\ | v | v | v | v |ROW \ | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 0 | 0 | 0 | 0 |NUL |DLE | SP | 0 | @ | P | \ | p |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 0 | 0 | 1 | 1 |SOH |DC1 | ! | 1 | A | Q | a | q |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 0 | 1 | 0 | 2 |STX |DC2 | " | 2 | B | R | b | r |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 0 | 1 | 1 | 3 |ETX |DC3 | # | 3 | C | S | c | s |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 1 | 0 | 0 | 4 |EOT |DC4 | $ | 4 | D | T | d | t |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 1 | 0 | 1 | 5 |ENO |NAC | % | 5 | E | U | e | u |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 1 | 1 | 0 | 6 |ACK |SYN | & | 6 | F | V | f | v |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 1 | 1 | 1 | 7 |BEL |ETB | ' | 7 | G | W | g | w |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 0 | 0 | 0 | 8 | BS |CAN | ( | 8 | H | X | h | x |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 0 | 0 | 1 | 9 | HT | EM | ) | 9 | I | Y | i | y |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 0 | 1 | 0 | 10 | LF |SUB | * | : | J | Z | j | z |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 0 | 1 | 1 | 11 | VT |ESC | + | ; | K | [ | k | { |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 1 | 0 | 0 | 12 | FF | FS | , | < | L | \ | l | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 1 | 0 | 1 | 13 | CR | GS | - | = | M | ] | m | } |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 1 | 1 | 0 | 14 | S0 | RS | . | > | N | ^ | n | ~ |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 1 | 1 | 1 | 15 | S1 | US | / | ? | O | _ | o |DEL |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
Code Structure 8 7 6 5 4 3 2 1
--- --- --- --- --- --- --- --- --- ---
Now the second chart, the high-bit half of the code page. Same vibe, different bits, so pay attention to the top rows π₯
+---------------------------+----+----+----+----+----+----+----+----+
|\ b8 -> | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| \ b7 -> | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| \ b6 -> | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
|B \ b5 -> | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| I +---+---+---+---+------+----+----+----+----+----+----+----+----+
+ T | b | b | b | b |\COL->| | | | | | | | |
\ S| 4 | 3 | 2 | 1 | \ | | | | | | | | |
\ | | | | | |\ | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
\ | | | | | | | | | v \ | | | | | | | | |
\ | v | v | v | v |ROW \ | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 0 | 0 | 0 | 0 |'80'| |'A0'| | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 0 | 0 | 1 | 1 |'81'| | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 0 | 1 | 0 | 2 |'82'| | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 0 | 1 | 1 | 3 |'83'| | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 1 | 0 | 0 | 4 |'84'| | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 1 | 0 | 1 | 5 |'85'| | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 1 | 1 | 0 | 6 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 0 | 1 | 1 | 1 | 7 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 0 | 0 | 0 | 8 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 0 | 0 | 1 | 9 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 0 | 1 | 0 | 10 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 0 | 1 | 1 | 11 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 1 | 0 | 0 | 12 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 1 | 0 | 1 | 13 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 1 | 1 | 0 | 14 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
| 1 | 1 | 1 | 1 | 15 | | | | | | | | |
+---+---+---+---+------+----+----+----+----+----+----+----+----+
Figure 3. Official Network Virtual Terminal Code
Quick note from me: the 'XX' cells are the hex codes for TELNET Control Signals, so they're the special ones to watch π
Endnotes π
[1] Okay so, a one-byte DATA TYPE signal is sent as the very first byte of data over a connection π«Ά If the first byte has the high order bit set to zero, a default kicks in, and the seven-bit ASCII NVT convention is assumed. Most implementations and applications can expect the DATA TYPES to be symmetrical at any point in time, meaning both sides are using the same DATA TYPE (think both ends of a serving site). Other data types with codes assigned right now are:
X'A1' Transparency
X'A2' EBCDIC
X'A3' Special String to TELNET (I'll use your code)
X'A4' End Special String to TELNET (I'll use my code)
[2] Translation: suppress printing of password π
[3] In some cases, for prolonged periods of special treatment, local implementation may dictate permitting the user to set a "mode" to prevail until explicitly discarded. Main character energy, honestly π
[This RFC was put into machine readable form for entry into the online RFC archives by Lorrie Shiota 2/02]
π¦ where this page comes from
- ietf: rfc158 1971-05
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms