rfc-1116

Telnet Linemode option

D.A. Borman
date1989-08 streamLegacy statusPROPOSED STANDARD pages21 canonicalhttps://www.rfc-editor.org/rfc/rfc1116 doi10.17487/RFC1116
Hosts on the Internet that support Linemode within the Telnet protocol are expected to adopt and implement this protocol. Obsoleted by RFC 1184. [STANDARDS-TRACK]

obsoleted by

Extracted elements (25)

design-rationale §4

Linemode reduces network traffic to a few packets per command line instead of per character, benefiting long-delay networks with local response time and reducing costs on per-packet-charged networks. Supercomputers that handle single-character input poorly benefit from offloading character processing to the client.

tcp

design-rationale §4

LINEMODE was created because existing ECHO/SUPPRESS-GO-AHEAD heuristics for local line editing were unreliable and semantically incorrect. Using SUPRESS-GO-AHEAD as an indicator of line-at-a-time mode misreads RFC 858; using ECHO alone provides no way to turn off echo while keeping local editing active (e.g., during password entry).

tcp

design-rationale §5.5

The client side is given control of SLC special character settings because the user's view is always through the local terminal: local special characters should apply. A full-featured client exports its settings; a thin client (e.g., terminal server) imports from the server via SLC 0 SLC_DEFAULT 0.

tcp

design-rationale §5.6

Two forwarding character mechanisms are provided (SLC_FORW1/FORW2 and FORWARDMASK) to match varying terminal driver capabilities. FORW1/FORW2 map directly to typical OS line-delimiter settings, while FORWARDMASK is a general 256-bit mask. An implementation may accept a FORWARDMASK and legally forward on a superset of the requested characters if its terminal driver cannot forward on the exact set.

tcp

interoperability-note §2.2

FLOW and ECHO are logically part of LINEMODE MODE but overlap existing Telnet options. FLOW is handled by the TOGGLE-FLOW-CONTROL option (RFC 1080), which SHOULD be co-negotiated with LINEMODE. ECHO is handled by the Telnet ECHO option (RFC 857); the client side MUST NEVER negotiate WILL ECHO.

tcp

interoperability-note §5.5

If the server does not support some editing functions, it should send 'SLC xxx SLC_DEFAULT 0' (not SLC_NOSUPPORT) in response to a SLC 0 SLC_DEFAULT 0 request, allowing the client to use its own local values rather than being forced to disable those functions.

tcp

interoperability-note §5.5

SLC_FORW2 SHOULD only be used if SLC_FORW1 is already in use. The client is required to forward buffered data on SLC_FORW1, SLC_FORW2, or FORWARDMASK characters, on normal line terminators, and on special signals; it may also freely forward on other characters it chooses.

tcp

normative-requirement §2.1 MUST NOT

IAC WILL LINEMODE should only be sent by the client side; IAC DO LINEMODE should only be sent by the server side. At no time should DO LINEMODE be negotiated in both directions.

tcp

normative-requirement §5.7 MUST NOT

SB LINEMODE DO/DONT FORWARDMASK MUST NOT be sent unless DO LINEMODE has been previously negotiated; SB LINEMODE WILL/WONT FORWARDMASK MUST NOT be sent unless WILL LINEMODE has been previously negotiated.

tcp

normative-requirement §5.3 MUST

The server side is responsible for all output processing regardless of mode. It MUST send CR LF for newline, CR NUL for carriage return only, and LF for linefeed only.

tcp

normative-requirement §5.2 MUST

When in EDIT mode, any normal line terminator MUST be transmitted with CR LF as the line terminator. When EDIT mode is off, a carriage return is sent as CR NUL, a line feed as LF, and other line-completion keys (ENTER/DOIT) as CR LF.

tcp

normative-requirement §5.5 MUST

When LINEMODE is negotiated, the client MUST either export its local special character settings to the server or send SLC 0 SLC_DEFAULT 0 to request the server's defaults. Failing to do either leaves the connection in an undefined SLC state.

tcp

normative-requirement §5.8 SHOULD

When sending IP, BRK, or ABORT with SLC_FLUSHIN set, the sequence 'IAC XXX IAC DM IAC DO TIMING-MARK' should be used: IAC DM is sent as TCP urgent data to flush the input stream, and TIMING-MARK is used to delimit output flushing until WILL/WONT TIMING-MARK is received.

tcp

normative-requirement §2.2 MUST

When the client receives a MODE command, it MUST agree with at least the state of the EDIT and TRAPSIG bits. If the server receives a MODE with EDIT or TRAPSIG not set, it may set them in response; if the client receives a MODE with EDIT or TRAPSIG set, it may not clear them in the response.

tcp

normative-requirement §5.8 MUST

Whenever IAC AO is received, a Synch (IAC DM as TCP urgent data) MUST be returned. During Synch processing while in TCP Urgent mode, all data MUST be discarded (but not Telnet commands) until IAC DM is found and Urgent mode exits.

tcp

protocol-element §2.4

SLC defines 18 function codes split into two groups. Telnet-mapped functions (sent as Telnet equivalents): SLC_SYNCH (1), SLC_BRK (2), SLC_IP (3), SLC_AO (4), SLC_AYT (5), SLC_EOR (6), SLC_ABORT (7), SLC_EOF (8), SLC_SUSP (9). Locally processed functions: SLC_EC (10), SLC_EL (11), SLC_EW (12), SLC_RP (13), SLC_LNEXT (14), SLC_XON (15), SLC_XOFF (16), SLC_FORW1 (17), SLC_FORW2 (18).

tcp

protocol-element §2.4

SLC defines four levels of support for a special character function. SLC_NOSUPPORT (0): function not supported. SLC_CANTCHANGE (1): supported but value is fixed. SLC_VALUE (2): supported with a settable character value. SLC_DEFAULT (3): use the system default on the other side.

tcp

protocol-element §1

The LINEMODE Telnet option is assigned code 34. It uses three suboptions: MODE (1), FORWARDMASK (2), and SLC (3). LINEMODE enables client-side line editing, reducing network traffic to one packet per command line rather than one per character.

tcp

protocol-element §2.2

The MODE suboption carries a bitmask with two defined bits: EDIT (1) enables client-side line processing and sends only completed lines; TRAPSIG (2) causes the client to translate interrupts/signals to their Telnet equivalents (IP, BRK, AYT, ABORT, EOF, SUSP). A MODE_ACK bit (4) is used to acknowledge mode changes.

tcp

protocol-element §2.5

Three new Telnet control characters are defined: IAC EOF (236) signals end-of-file to the process; IAC SUSP (237) suspends the current process so another may take control; IAC ABORT (238) aborts or terminates the connected process, distinguished from IAC IP which may also suspend.

tcp

security-consideration §2.2

RFC 1116 contains no explicit Security Considerations section. The protocol's signal-trapping mechanism (TRAPSIG) controls whether interrupt signals (IP, BRK, ABORT) are forwarded as Telnet commands or as literal characters, which affects the ability of either side to abort remote processes; misconfiguration could allow unintended process termination or prevent legitimate interrupts from being delivered.

security, tcp

state-machine §2.2

MODE negotiation resolves via the MODE_ACK bit. When a MODE with MODE_ACK is received and differs from current mode, the client ignores the new mode while the server switches to it. No response is ever generated to a MODE command bearing MODE_ACK. This ensures both sides converge to the same mode.

tcp

state-machine §5.5

SLC negotiation follows a defined resolution diagram. When an SLC command is received: (1) ignore if same as current settings; (2) if same level but different value and SLC_ACK is set, server ignores and client switches silently; (3) agree → switch and reply with SLC_ACK set; (4) disagree → reply with preferred value at a lower level without SLC_ACK.

tcp

wire-format §2.3

The FORWARDMASK suboption carries up to 32 octets encoding a bitmask of ASCII character codes 0–255. The high-order bit of mask0 represents ASCII 0; the low-order bit represents ASCII 7; successive octets cover the next 8 codes each. In non-binary mode only the first 16 octets are used. Any octet equal to IAC must be doubled.

tcp

wire-format §2.4

The SLC suboption carries a list of octet triplets: the first octet is the function code (1–18), the second contains level bits (SLC_LEVELBITS, mask 0x03) plus flag bits SLC_ACK (128), SLC_FLUSHIN (64), and SLC_FLUSHOUT (32), and the third is the ASCII character value. Any octet equal to IAC must be doubled.

tcp