As per Relevance of the word complete, we have this rfc below:
Network Working Group Telnet Working
Request for Comments: 1184 D. Borman,
Obsoletes: RFC 1116 Cray Research, Inc
October 1990
Telnet Linemode
Status of this
This memo describes a Draft Standard for the Internet community,
requests discussion and suggestions for improvements. This
specifies an IAB standards track protocol for the Internet community
Please refer to the current edition of the "IAB Official
Standards" for the standardization state and status of this protocol
Distribution of this memo is unlimited
Changes from RFC1116:
Two new mode bits have been added, SOFT_TAB and LIT_ECHO.
bits allow the server to give the client some advise on how
echo tabs and non-printable characters
Several new special character mappings have been added for
motion when visual editing is supported. These are: Move
one character left/right (SLC_MCL/SLC_MCR), move cursor one
left/right (SLC_MCWL/SLC_MCWR), move cursor to begining/end
line (SLC_MCBOL/SLC_MCEOL), enter insert/overstrike
(SLC_INSRT/SLC_OVER), erase one character/word to the
(SLC_ECR/SLC_EWR), and erase to the beginning/end of the
(SLC_EBOL/SLC_EEOL).
Linemode Telnet is a way of doing terminal character processing
the client side of a Telnet connection. While in Linemode
editing enabled for the local side, network traffic is reduced to
couple of packets per command line, rather than a couple of
per character typed. This is very useful for long delay networks
because the user has local response time while typing the
line, and only incurs the network delays after the command is typed
It is also useful to reduce costs on networks that charge on a
packet basis. Please send comments to the telnet-ietf@cray.
mailing list
Telnet Working Group [Page 1]
RFC 1184 Telnet Linemode Option October 1990
Table of
1. Command Names and Codes 2
2. Command Meanings 3
2.1 The LINEMODE function 3
2.2 LINEMODE suboption MODE 4
2.3 LINEMODE suboption FORWARDMASK 5
2.4 LINEMODE suboption SLC, Set Local Characters 6
2.5 New control characters 10
3. Default Specification 11
4. Motivation 11
5. Implementation Rules 13
5.1 User Interface 13
5.2 End of line terminators 14
5.3 Output processing 14
5.4 A terminal driver in Telnet? 14
5.5 Setting of Local Characters 14
5.6 FORWARDMASK and SLC_FORW1 and SLC_FORW2 15
5.7 Valid and invalid modes and values 16
5.8 Flushing input and output 16
5.9 State diagram for SLC 18
5.10 Example of a connection 19
6. Other Telnet options and RFCs 22
7. Security Considerations 23
8. Author's Address 23
1. Command Names and
LINEMODE 34
MODE 1
EDIT 1
TRAPSIG 2
MODE_ACK 4
SOFT_TAB 8
LIT_ECHO 16
FORWARDMASK 2
SLC 3
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
SLC_EC 10
SLC_EL 11
Telnet Working Group [Page 2]
RFC 1184 Telnet Linemode Option October 1990
SLC_EW 12
SLC_RP 13
SLC_LNEXT 14
SLC_XON 15
SLC_XOFF 16
SLC_FORW1 17
SLC_FORW2 18
SLC_MCL 19
SLC_MCR 20
SLC_MCWL 21
SLC_MCWR 22
SLC_MCBOL 23
SLC_MCEOL 24
SLC_INSRT 25
SLC_OVER 26
SLC_ECR 27
SLC_EWR 28
SLC_EBOL 29
SLC_EEOL 30
SLC_DEFAULT 3
SLC_VALUE 2
SLC_CANTCHANGE 1
SLC_NOSUPPORT 0
SLC_LEVELBITS 3
SLC_ACK 128
SLC_FLUSHIN 64
SLC_FLUSHOUT 32
EOF 236
SUSP 237
ABORT 238
2. Command
2.1 The LINEMODE
IAC WILL
The sender of this command REQUESTS permission to begin sub
negotiation of the editing/signaling status. This should only
sent by the client side of the connection
IAC WONT
The sender of this command DEMANDS that sub-negotiation of
editing/signaling status not be allowed
Telnet Working Group [Page 3]
RFC 1184 Telnet Linemode Option October 1990
IAC DO
The sender of this command REQUESTS that the remote side
sub-negotiation of the editing/signaling status. This should
be sent by the server side of the connection
IAC DONT
The sender of this command DEMANDS that the remote side not
sub-negotiation of the editing/signaling status
2.2 LINEMODE suboption
IAC SB LINEMODE MODE mask IAC
The sender of this command CONFIRMS, or REQUESTS permission for,
switch to the mode defined by "mask".
The "mask" is a bit mask of various modes that the connection can
in. Under normal operation, the server side of the connection
initiate mode changes, and the client will confirm the mode changes
The currently defined modes are
EDIT When set, the client side of the connection
process all input lines, performing any editing functions
and only send completed lines to the remote side.
unset, client side should not process any input from
user, and the server side should take care of
character processing that needs to be done
TRAPSIG When set, the client side should translate
interrupts/signals to their Telnet equivalent. (
would be IP, BRK, AYT, ABORT, EOF, and SUSP) When unset
the client should pass interrupts/signals as their
ASCII values
FLOW Logically, this belongs in the "mask". However,
would overlap the Telnet TOGGLE-FLOW-CONTROL option,
the Telnet TOGGLE-FLOW-CONTROL option is used instead
When DO/WILL LINEMODE is negotiated, DO/WILL TOGGLE
FLOW-CONTROL should also be negotiated. See RFC 1080,
"Telnet Remote Flow Control", for correct usage
ECHO Logically, this belongs in the "mask". However,
would overlap the Telnet ECHO option, so the Telnet
option is used instead. The client side should
negotiate "WILL ECHO". When the server has
"WILL ECHO", the client should not echo data typed by
Telnet Working Group [Page 4]
RFC 1184 Telnet Linemode Option October 1990
user back to the user. When the server has
"WONT ECHO", the the client is responsible for
data typed by the user back to the user. See RFC 857,
"Telnet ECHO OPTION" for a complete discussion on the
of the Telnet ECHO option
SOFT_TAB When set, the client side should expand the
Tab (HT) code, USASCII 9, into the appropriate number
spaces to move the printer to the next horizontal
stop. When unset, the client side should allow
Horizontal Tab code to pass through un-modified
LIT_ECHO When set, if the client side is echoing a non-
character that the user has typed to the users screen
the character should be echoed as the literal character
If the LIT_ECHO bit is not set, then the client side
echo the character in any manner that it desires. (
systems echo unprintable characters as two
sequences, for example, they will echo "^A" for
ASCII 1 value.)
When the client side of a connection receives a MODE command, it
agree with at least the state of the EDIT and TRAPSIG bits. If
MODE command is received with a mode mask that is currently in
(ignoring the MODE_ACK bit), the MODE command is ignored. If a
command is received that is different from the current mode mask
then a reply is sent with either the new mode mask and the MODE_
bit set, or a subset of the new mode mask. The only exception
that if the server receives a MODE with either the EDIT or
bits not set, it may set the EDIT and TRAPSIG bits in the response
and if the client receives a MODE with the EDIT or TRAPSIG bits set
it may not clear them in the response
When a MODE command is received with the MODE_ACK bit set, and
mode is different that what the current mode is, the client
ignore the new mode, and the server will switch to the new mode
This ensures that both sides of the connection will resolve to
same mode. In all cases, a response is never generated to a
command that has the MODE_ACK bit set
2.3 LINEMODE suboption
IAC SB LINEMODE DO FORWARDMASK mask0 mask1 ... mask31 IAC
The sender of this command request that the other side send
buffered data when any of the ASCII characters defined by the
mask are received. Only the side of the connection that sent
LINEMODE (the server side) may negotiate this. The mask is up
Telnet Working Group [Page 5]
RFC 1184 Telnet Linemode Option October 1990
32 octets long. Each octet represents 8 ASCII character codes
The high order bit of mask0 corresponds to an ASCII code of 0.
The low order bit of mask0 corresponds to an ASCII code of 7.
high order bit of mask1 corresponds to an ASCII code of 8.
low order bit of mask1 corresponds to an ASCII code of 15, and
on. The mask list may be terminated before the end of the list,
which case all the rest of the mask octets are assumed to be
(equal to zero). When the server side is in DONT TRANSMIT-
mode, then only the first 16 octets of the mask (ASCII codes 0
through 127) are used. If any individual octet of the mask
equal to IAC, it must be sent as a double IAC
IAC SB LINEMODE DONT FORWARDMASK IAC
The sender of this command requests that the other side stop
the forward mask to determine when to send buffered data
IAC SB LINEMODE WILL FORWARDMASK IAC
This command is sent in response to a DO FORWARDMASK command.
indicates that the forward mask will be used to determine when
send buffered data
IAC SB LINEMODE WONT FORWARDMASK IAC
This command is sent in response to a DO FORWARDMASK command.
indicates that the forward mask will not be used to determine
to send buffered data
2.4 LINEMODE suboption SLC, Set Local
The SLC suboption uses a list of octet triplets. The first
specifies the function, the second octet specifies modifiers to
function, and the third octet specifies the ASCII character for
function
IAC SB LINEMODE SLC IAC
The sender of this command REQUESTS that the list of
triplets be used to set the local character to be used to send
perform the specified function
There are four levels that a function may be set to
SLC_NOSUPPORT is the lowest, SLC_CANTCHANGE is the next
level, SLC_VALUE is above that, and SLC_DEFAULT is the
level
If the SLC_LEVELBITS in the second octet are equal to SLC_DEFAULT
Telnet Working Group [Page 6]
RFC 1184 Telnet Linemode Option October 1990
then this particular function should use the system default on
other side of the connection
If the SLC_LEVELBITS in the second octet are equal to SLC_VALUE
then this function is supported, and the current value
specified by the third octet
If the SLC_LEVELBITS in the second octet are equal
SLC_CANTCHANGE, then this is a function that is supported, but
value for this function, specified in the third octet, cannot
changed
If the SLC_LEVELBITS in the second octet are equal
SLC_NOSUPPORT, then this particular function is not supported
should be disabled by the other side
If this is a response to a previous request to change a
character, and we are agreeing to the change, then the SLC_ACK
must be set in the second octet
If the SLC_FLUSHIN bit is set in the second octet, then
this function is sent, a Telnet "sync" should be sent at the
time to flush the input stream
If the SLC_FLUSHOUT bit is set in the second octet, then
this function is sent, output data should be flushed
Only the client may send an octet triplet with the first
equal to zero. In this case, the SLC_LEVELBITS may only be set
SLC_DEFAULT or SLC_VALUE, and the third octet does not matter
When the server receives 0 SLC_DEFAULT 0, it should switch to
system default special character settings, and send all
special characters to the client. When the server receives 0
SLC_VALUE 0, it should just send its current special
settings. Note that if the server does not support some of
editing functions, they should be sent as XXX SLC_DEFAULT 0,
rather than as XXX SLC_NOSUPPORT 0, so that the client may
to use its own values for those functions, rather than have
disable those functions even if it supports them
If any of the octets in the list of octet triplets is equal
IAC, it must be sent as a double IAC
When a connection is established, it is the responsibility of
client to either request the remote default values for the
characters, or to send across what all the special characters
be set to
Telnet Working Group [Page 7]
RFC 1184 Telnet Linemode Option October 1990
The function values can be put into two groups, functions that are
be translated to their Telnet equivalents before being sent
the Telnet connection, and functions that are to be recognized
processed locally
First, we have those characters that are to be mapped into
Telnet equivalents
SLC_SYNCH Synch. See RFC 854, "TELNET PROTOCOL SPECIFICATION",
for a complete description
SLC_BRK Break. See RFC 854, "TELNET PROTOCOL SPECIFICATION",
for a complete description
SLC_IP Interrupt Process. See RFC 854, "TELNET
SPECIFICATION", for a complete description
SLC_AO Abort Output. See RFC 854, "TELNET
SPECIFICATION", for a complete description
SLC_AYT Are You There. See RFC 854, "TELNET
SPECIFICATION", for a complete description
SLC_EOR End of Record. See RFC 885, "TELNET END OF
OPTION" for a complete description
SLC_ABORT Abort. See section 2.5 for a complete description
SLC_EOF End of File. See section 2.5 for a
description
SLC_SUSP Suspend. See section 2.5 for a complete description
Next, we have the locally interpreted functions
SLC_EC Erase Character. This is the character that is typed
erase one character from the input stream. See RFC 854,
"TELNET PROTOCOL SPECIFICATION", for a
description
SLC_EL Erase Line. This is the character that is typed
erase the entire contents of the current line of input
See RFC 854, "TELNET PROTOCOL SPECIFICATION", for
complete description
SLC_EW Erase Word. This is the character that is typed
erase one word from the input stream
Telnet Working Group [Page 8]
RFC 1184 Telnet Linemode Option October 1990
SLC_RP Reprint Line. This is the character that is typed
cause the current line of input to be reprinted,
the cursor at the end of the line
SLC_LNEXT Literal Next. This is the character that is typed
indicate that the next character is to be
literally, no character processing should be done
it, and if it is a special character that would
get mapped into a Telnet option, that mapping
not be done
SLC_XON Start Output. This is the character that is sent
resume output to the users terminal
SLC_XOFF Stop Output. This is the character that is sent to
output to the users terminal
SLC_FORW1 Forwarding character. This is a character that
cause all data currently being buffered, and
character, to be sent immediately
SLC_FORW2 Forwarding character. This is another character that
to be treated in the same manner as SLC_FORW1.
SLC_MCL Move cursor one character left. When visual editing
supported, this is the character that, when typed,
move the cursor one character to the left in
display
SLC_MCR Move cursor one character right. When visual editing
supported, this is the character that, when typed,
move the cursor one character to the right in
display
SLC_MCWL Move cursor one word left. When visual editing
supported, this is the character that, when typed,
move the cursor one word to the left in the display
SLC_MCWR Move cursor one word right. When visual editing
supported, this is the character that, when typed,
move the cursor one word to the right in the display
SLC_MCBOL Move cursor to the begining of the line. When
editing is supported, this is the character that,
typed, will move the cursor to the begining of the
that is being edited
SLC_MCEOL Move cursor to the end of the line. When visual
Telnet Working Group [Page 9]
RFC 1184 Telnet Linemode Option October 1990
is supported, this is the character that, when typed
will move the cursor to the end of the line that
being edited
SLC_INSRT Enter insert mode. When visual editing is supported
after this character is typed, all normal
that are subsequently typed will be inserted into
display
SLC_OVER Enter overstrike mode. When visual editing
supported, after this character is typed, all
charactersthat are subsequently typed will
any characters in the current display. If
SLC_INSRT and SLC_OVER variables are set to the
value, then that value is to act as a toggle
overstrike and insert mode
SLC_ECR Erase character to the right. When visual editing
supported, this is the character that, when typed,
erase one character to the right of the cursor
SLC_EWR Erase word to the right. When visual editing
supported, this is the character that, when typed
will erase one word to the right of the cursor
SLC_EBOL Erase to the begining of the line. When visual
is supported, this is the character that, when typed
will erase all the characters to the left of the cursor
SLC_EEOL Erase to the end of the line. When visual editing
supported, this is the character that, when typed,
erase all characters to the right of the cursor
For SLC_EEOL, SLC_EWR, and SLC_ECR, if a system has a cursor that
not diplayed between characters, but is positioned over a character
that character is assumed to be to the right of the cursor. Thus
the SLC_ECR will erase the character that is under the current
position
2.5 New control
IAC
Abort. Similar to "IAC IP", but means only to abort or
the process to which the NVT is connected. (The Telnet spec
IP may "suspend, interrupt, abort or terminate" the process.) If
system does not have two methods of interrupting a process,
ABORT and IP should have the same effect
Telnet Working Group [Page 10]
RFC 1184 Telnet Linemode Option October 1990
IAC
Suspend the execution of the current process attached to the
in such a way that another process will take over control of
NVT, and the suspended process can be resumed at a later time.
the receiving system does not support this functionality,
should be ignored
IAC
End Of File. The recipient should notify the process connected
the NVT that an end of file has been reached. This is
for systems that support the ability for the user to type in
EOF character at the keyboard
3. Default
The default specification for this option
WONT
DONT
meaning there will not be any subnegotiation of the mode of
connection
If WILL LINEMODE is negotiated, the defaults are
IAC SB LINEMODE MODE 0 IAC
IAC SB LINEMODE WONT FORWARDMASK IAC
If DO LINEMODE is negotiated, the defaults are
IAC SB LINEMODE MODE 0 IAC
IAC SB LINEMODE DONT FORWARDMASK IAC
Character values for SLC default to SLC_NOSUPPORT
4.
With increasing Telnet usage, it has become apparent that the
to do command line processing on the local machine and send
lines to the remote machine is a feature necessary in
environments. First, in the case of a connection over long
equipment, it is very frustrating to the user to have the echoing
his data take several seconds. Second, some supercomputers, due
their nature, are not good at handling and processing
character input. For these machines, it is better to have the
Telnet Working Group [Page 11]
RFC 1184 Telnet Linemode Option October 1990
end computer do the character processing, and leave
supercomputer's cycles available for doing vectorized
crunching
There have been attempts to make local line editing work within
existing Telnet specs. Indeed, the 4.3 BSD tape includes a
of Telnet that attempts to do this through recognition of the
of the ECHO and SUPRESS-GO-AHEAD options; other implementations
this recognition purely through the ECHO option
There are problems with both of these methods. Using just the
provides no mechanism to have ECHO to the user turned off, and
local character processing on, for example, when a user is typing
password
The usage of the SUPRESS-GO-AHEAD comes from reading into RFC 858,
where it states
"In many TELNET implementations it will be desirable to couple
SUPRESS-GO-AHEAD option to the echo option so that when the
option is in effect, the SUPPRESS-GO-AHEAD option is in
simultaneously: both of these options will normally have to be
effect simultaneously to effect what it commonly understood to
character at a time echoing by the remote computer."
The reverse reading of this is that without the ECHO option or
SUPPRESS-GO-AHEAD option, you are in line at a time mode,
local line editing. This has the obvious problem that that is
what the SUPPRESS-GO-AHEAD option is supposed to mean
Other shortcomings are that the Telnet specification is not
enough to handle all of the special characters that some of
current operating systems support. For example, the ECHO/
implementation supports two ways of interrupting a process,
borrowing the BRK option for the second interrupt.
implementations have taken the EOR option to send an End-Of-File
Obviously, this is using things for which they were not intended,
the correct solution would be to define new options
Another problem is that some implementations of line mode buffer
the input until the end of the line, and then send the whole
across, editing characters and all. No local editing of the line
been done
After examining several implementations, it has become clear that
correct thing to do is to implement new options to enhance
current Telnet specification so that it can support local
editing in a reasonable, reliable, and consistent manner
Telnet Working Group [Page 12]
RFC 1184 Telnet Linemode Option October 1990
There are three states that are of interest
1) Local line editing and local signal
2) Remote line editing, local signal
3) Remote line editing, remote signal
The case of local line editing and remote signal trapping is not
very interesting case, because you don't recognize the signals,
cannot send them to the remote side for it to recognize until
line has been completed. Also, special signals usually will have
effect on the line editing function, and if they are not
trapped locally the desired action will not happen
Local line editing means that all normal command line
processing, like "Erase Character" and "Erase Line", happen on
local system, and only when "CR LF" (or some other special character
is encountered is the edited data sent to the remote system
Signal trapping means, for example, that if the user types
character associated with the IP function, then the "IAC IP"
is sent to the remote side instead of the character typed.
signal trapping means, for example, that if the user types
character associated with the IP function, then the "IAC IP"
is not sent to the remote side, but rather the actual character
is sent to the remote side
5. Implementation
It is expected that any implementation that supports the
LINEMODE option will support all of this specification
5.1 User
Normally, the entire user interface is left up to the implementor
However, there is functionality that the user should be able
specify on the client side of the connection. During a
session, the client side should allow some mechanism for the user
give commands to the local Telnet process. These commands should
least allow the user to
1) Change the mode of the connection. The user should be able
attempt to turn EDIT, FLOW, TRAPSIG, and ECHO on and off.
server may refuse to change the state of the EDIT and
bits
2) Import or export SLC. The user should be able to tell
Telnet Working Group [Page 13]
RFC 1184 Telnet Linemode Option October 1990
local Telnet process whether he wants to use the local
the current or default remote definitions of the
characters
3) Manual sending of options. The user should be able to
the local Telnet process to explicitly send any of the
options (like IP, ABORT, AYT, etc).
5.2 End of line terminators
When LINEMODE is turned on, and when in EDIT mode, when any
line terminator on the client side operating system is typed,
line should be transmitted with "CR LF" as the line terminator.
EDIT mode is turned off, a carriage return should be sent as "
NUL", a line feed should be sent as LF, and any other key that
be mapped into an ASCII character, but means the line is
(like a DOIT or ENTER key), should be sent as "CR LF".
5.3 Output
Regardless of what mode has been negotiated, the server side
responsible for doing all output processing. Specificly, it
send "CR LF" when it wants the "newline" function, "CR NUL" when
wants just a carriage return, and "LF" when it wants just a linefeed
5.4 A terminal driver in Telnet
Conforming implementations need not do all the line
themselves. There is nothing wrong with letting the system
driver handle the line editing, and have it hand to the
application the completed and edited line, which is then sent to
remote system
5.5 Setting of Local
When this RFC was being developed, the original thought was that
sides of the connection would use their own defaults for the
characters, even if they were not the same on both sides of
connection. If this scheme is used, though, the view that the
has is that the local special characters are being used, and
remote character settings don't matter. It was decided that
client side of the connection should be in control of the
settings
When LINEMODE is negotiated, the client must either export the
character settings to the server, or send a request (SLC 0
SLC_DEFAULT 0) to import the servers special characters. The
action would be that a client running on a full fledged
Telnet Working Group [Page 14]
RFC 1184 Telnet Linemode Option October 1990
would export the special characters, and a client running where
are no local defaults (like on some terminal servers) would
the special characters
When an SLC command is received, the action taken should be
1) Ignore it if it is the same as the current settings
2) If the SLC_LEVELBITS are the same as the current level bits
but the value is different and the SLC_ACK bit is set,
reply is generated. On the server side, the command
ignored, and on the client side, a switch is made to
new value. This is so that if a request to change the
character is generated by both the server and the client
they will both settle on the clients requested value
3) If we agree with the new setting, we switch to it and
with the same value, but also set the SLC_ACK bit
4) If we don't agree, we send a response with what we think
value should be. The SLC_ACK bit is NOT set in this case
You may only disagree with a value by sending a
value at a lower level
If the remote system doesn't support some of the line
characters, but the front end does, then the front end may use
local definitions for those characters when in line mode. In
case, the server should send "SLC xxx SLC_DEFAULT 0" in response to
"SLC 0 SLC_DEFAULT 0" request, and just ack whatever value the
requests to set the function to
The SLC_FORW2 character should only be used if SLC_FORW1 is
in use
5.6 FORWARDMASK and SLC_FORW1 and SLC_FORW
To help ease the amount of work needed to implement the client side
two methods of setting forwarding characters are provided.
SLC_FORW1 and SLC_FORW2 allow for the setting of two
characters on which to forward buffered input data. Since
terminal drivers have the ability to set one or more line delimiters
it is fairly easy to support these without having to
through the local terminal driver, rather than putting a
driver into Telnet. If the local terminal driver has
that maps easily into the FORWARDMASK, then it can also be
supported. If the local terminal driver does not support that,
it would require more work to support FORWARDMASK
Telnet Working Group [Page 15]
RFC 1184 Telnet Linemode Option October 1990
Also note that the client side is required to forward data when
sees one of SLC_FORW1, SLC_FORW2, or FORWARDMASK characters, or
any normal line termination or special signal is encountered.
client side is also free to forward on other characters that
chooses. For example, if the server side sent a FORWARDMASK
asked for data to be forwarded on the first 20 control
(ASCII codes 1 through 024), and the client side cannot have
local terminal driver forward on just the first 20
characters, but it can have the local terminal driver forward on
control character (ASCII codes 1 through 039), then the client
could validly accept the FORWARDMASK, and forward on any
character. When in EDIT mode, care should be taken to not forward
random times, since once that data is forwarded, no more editing
the forwarded part of the line can be done. The only time (
than the normal times) that data should be forwarded when in
mode would be if a single input line is too long to handle locally
5.7 Valid and invalid modes and
At no time should "DO LINEMODE" be negotiated in both directions
the Telnet connection. The side that is the "DO LINEMODE"
considered to be the server side, and the side that is "
LINEMODE" is the client side
At no time should "SB LINEMODE DO/DONT FORWARDMASK", be sent
"DO LINEMODE" has been previously negotiated. At no time should "
LINEMODE WILL/WONT FORWARDMASK", be sent unless "WILL LINEMODE"
been previously negotiated
If an ABORT, EOF or SUSP, is received and the system does not
that functionality, it may just be ignored
5.8 Flushing input and
When an IP, BRK or ABORT is sent, it is usually desirable to be
to flush the input stream, and to flush output to the user until
IP, BRK, or ABORT is processed. The SLC_FLUSHIN and SLC_
bits are used to indicate what action should be done. These bits
advisory only, but should be honored if possible. The
method for processing the SLC_FLUSHIN is to use the Telnet "Synch
signal, and the SLC_FLUSHOUT is processed using the TIMING-
option. If both are to be sent, the IAC DM is sent before the
TIMING-MARK Thus, the sender would send "IAC XXX IAC DM IAC
TIMING-MARK", where XXX may be IP, BRK or ABORT, or any other
character. The IAC DM is sent as TCP urgent data with the DM as
last (or only) data octet; this is used to flush the input stream
The "IAC DO TIMING-MARK" is used to tell when to stop
output; once it is sent, all data is discarded until an "IAC
Telnet Working Group [Page 16]
RFC 1184 Telnet Linemode Option October 1990
TIMING-MARK" or an "IAC WONT TIMING-MARK" is received
Since the SLC_FLUSHIN and SLC_FLUSHOUT bit are only advisory,
user interface should provide a method so that the user can
the sending (or not sending) of the "Synch" and TIMING-MARK, but
default action should be to send them according to the SLC_
and SLC_FLUSHOUT bits
Whenever an IAC AO is received, a Synch must be returned. When
a Synch is being processed, (by the TCP connection going into
mode), all data must be discarded (but not Telnet commands!) until
IAC DM is found, and the connection goes out of Urgent mode. See
854, "TELNET PROTOCOL SPECIFICATION", for a complete description
the Synch signal
Telnet Working Group [Page 17]
RFC 1184 Telnet Linemode Option October 1990
5.9 State diagram for
+---------------------------------------------------------------+
| IDLE |
+----------------------+------+------+-------+-------+---------++
^ ^ ^ | | ^ | ^ | ^ | ^ |
| | | v v | | | | | v | |
| | | +------+ +---+--+ | | | | ########### | |
| | | | Get | | Send | | | | | # Get # | |
| | | | SPC0 | | SPC0 | | | | | # 0,DEF,0 # | |
| | | +---+--+ +------+ | | | | ########### | |
| | | | ^ | | | | | | |
| | | v | v | | | v | |
| | | / \ | *********** | | ########### | |
| | | / \ | * Send * | | # Switch # | |
| ********** |Yes/ Same as \ | * 0,VAL,0 * | | # to # | |
| * Change * +--< current? > | *********** | | # default # | |
| * to new * \ / | v | ########### | |
| * value * \ / | *********** | | |
| ********** \ / | * Send * v | |
| ^ |No | * 0,DEF,0 * ######### | |
| |Yes v | *********** # Send #--+ |
| / \ / \ | # SPC-A # |
| / \ / \ | ######### |
| / Is ACK \ Yes/ Same \ | ^ |
|< bit set? ><-< level as > | | |
| \ / \ current?/ | ########### |
| \ / \ / | # Get #<--+
| \ / \ / +-+---+ # 0,VAL,0 #
| |No |No | Set | ###########
| +--------------+ | ACK |
| v | bit | * - Client side
| / \ +-----+ # - Server side
| +------+ / \ ^
| | Send | No / Do we \ Yes
+---| SPC1 |<---< agree? >---+
+------+ \ /
\ /
\ /
SPC0 Initial setting for a special
SPC1 A changed special character < SPC
SPC-A All current special character
VAL SLC_VALUE
DEF SLC_DEFAULT
Levels: DEFAULT, VALUE, CANT_CHANGE,
Flags:
Telnet Working Group [Page 18]
RFC 1184 Telnet Linemode Option October 1990
Receive
------- --------
f,SLC_DEFAULT,x f,SLC_VALUE,
f,SLC_CANTCHANGE,
f,SLC_NOSUPPORT,
f,SLC_VALUE,v f,SLC_ACK|SLC_VALUE,
f,SLC_CANTCHANGE,
f,SLC_NOSUPPORT,
f,SLC_CANTCHANGE,v f,SLC_ACK|SLC_CANTCHANGE,
f,SLC_NOSUPPORT,
f,SLC_NOSUPPORT,x f,SLC_ACK|SLC_NOSUPPORT,
x,SLC_ACK|x,x no
5.10 Examples of a
In these examples, the symbolic names are used rather than the
values, to make them readable. When two or more symbolic names
joined by a |, it means that the actual value will be the
"or" of the values of the symbolic names. In the interest
clarity, for these examples the leading IAC and IAC SB sequences,
the trailing IAC SE sequences have been omitted. Also, the SLC
prefix has been left off where ever it would normally occur
CLIENT
DO TOGGLE-FLOW-
DO
WILL TOGGLE-FLOW-
WILL
[ Subnegotiation may now proceed in both directions. The
sends of the list of special characters. ]
LINEMODE SLC SYNCH DEFAULT 0
VALUE|FLUSHIN|FLUSHOUT 3
VALUE 15 AYT DEFAULT 0
VALUE|FLUSHIN|FLUSHOUT 28
VALUE 4 SUSP VALUE|FLUSHIN 26
VALUE 127 EL VALUE 21 EW
23 RP VALUE 18 LNEXT VALUE 22
XON VALUE 17 XOFF VALUE 19
[ Now that linemode is enabled, the server sets the initial mode
and acknowledges the special characters. ]
LINEMODE MODE
LINEMODE SLC SYNCH NOSUPPORT 0
IP VALUE|FLUSHIN|FLUSHOUT|ACK 3
Telnet Working Group [Page 19]
RFC 1184 Telnet Linemode Option October 1990
AO NOSUPPORT 0 AYT NOSUPPORT 0
ABORT VALUE|FLUSHIN|FLUSHOUT|
28 EOF VALUE|ACK 4 SUSP NOSUP
PORT 0 EC VALUE|ACK 127
VALUE|ACK 21 EW VALUE|ACK 23
VALUE|ACK 18 LNEXT VALUE|ACK 22
XON VALUE|ACK 17 XOFF VALUE|
19
[ The client gets the mode and ack of the special characters,
acks the mode and any special characters that the
changed. ]
LINEMODE MODE EDIT|MODE_
LINEMODE SLC SYNCH NOSUPPORT|
0 AO NOSUPPORT|ACK 0 AYT|
NOSUPPORT 0 SUSP NOSUPPORT|ACK 0
"Login:"
"my_account
[ Turn off echo to the user. ]
WILL
DO
"Password:"
"my_password
[ Turn back on echo to the user. ]
WONT
DONT
[ User does some stuff, and then runs an application that
to use single character mode, doing its own echoing
characters, but keep signal trapping on. ]
WILL
DO
LINEMODE MODE
LINEMODE MODE TRAPSIG|MODE_
[ Application finishes ]
WONT
DONT
LINEMODE MODE EDIT|
LINEMODE
EDIT|TRAPSIG|MODE_
[ Another application, that wants full control of everything. ]
WILL
DO
LINEMODE MODE 0
LINEMODE MODE 0|MODE_
[ Application finishes ]
WONT
DONT
LINEMODE MODE EDIT|
Telnet Working Group [Page 20]
RFC 1184 Telnet Linemode Option October 1990
LINEMODE
EDIT|TRAPSIG|MODE_
[ The user changes his erase character to ^H. ]
LINEMODE SLC EC VALUE 8
LINEMODE SLC EC VALUE|ACK 8
[ The user decides to revert to all the original client
special characters. ]
LINEMODE SLC SYNCH DEFAULT 0
VALUE|FLUSHIN|FLUSHOUT 3
VALUE 15 AYT DEFAULT 0
VALUE|FLUSHIN|FLUSHOUT 28
VALUE 4 SUSP VALUE|FLUSHIN 26
VALUE 127 EL VALUE 21 EW
23 RP VALUE 18 LNEXT VALUE 22
XON VALUE 17 XOFF VALUE 19
LINEMODE SLC SYNCH NOSUPPORT 0
AO NOSUPPORT 15 AYT NOSUPPORT 0
SUSP NOSUPPORT|FLUSHIN 26
VALUE|ACK 127 EW VALUE|ACK 23
VALUE|ACK 18 LNEXT VALUE|ACK 22
XON VALUE|ACK 17 XOFF VALUE|
19
LINEMODE SLC SYNCH NOSUPPORT|
0 AO NOSUPPORT|ACK 15
NOSUPPORT|ACK 0
NOSUPPORT|ACK|FLUSHIN 26
[ The user decides to import the remote sides default
characters. ]
LINEMODE SLC 0 DEFAULT 0
LINEMODE SLC
VALUE|FLUSHIN|FLUSHOUT 3
VALUE|FLUSHIN|FLUSHOUT 28
VALUE 4 EC VALUE 127 EL VALUE 21
[ Since these are the same as the current local settings,
response is generated. ]
[ This next example is what would happen if an editor was
up, that wanted to let the client side do the echoing
buffering of characters, but did not want it to do any
editing, and only forward the data when got a
character. Note that we have preceded all the the 0377
in the forward mask with an IAC. ]
LINEMODE MODE 0
LINEMODE DO FORWARDMASK IAC 0377
IAC 0377 IAC 0377 IAC 0377 0 0 0
0 0 0 0 0 0 0 0 01
LINEMODE MODE 0
LINEMODE WILL
[ Application runs to completion, and then things are to be
Telnet Working Group [Page 21]
RFC 1184 Telnet Linemode Option October 1990
back to what they were before. ]
LINEMODE MODE EDIT|
LINEMODE DONT
LINEMODE MODE EDIT|
LINEMODE WONT
6. Other Telnet options and
The following is a list of RFCs for various Telnet options
should be supported along with LINEMODE
1. Postel, J. and Reynolds, J., "TELNET PROTOCOL SPECIFICATION",
RFC 854, ISI, May 1983.
2. Postel, J. and Reynolds, J., "TELNET OPTION SPECIFICATIONS",
RFC 855, ISI, May 1983.
3. Postel, J. and Reynolds, J., "TELNET BINARY TRANSMISSION",
RFC 856, ISI, May 1983.
4. Postel, J. and Reynolds, J., "TELNET ECHO OPTION", RFC 857,
ISI, May 1983.
5. Postel, J. and Reynolds, J., "TELNET SUPRESS GO AHEAD OPTION",
RFC 858, ISI, May 1983.
6. Postel, J. and Reynolds, J., "TELNET TIMING MARK OPTION",
RFC 860, ISI, May 1983.
7. VanBokkeln, J., "Telnet Terminal-Type Option", RFC 1091,
FTP Software, Inc., February 1989.
8. Waitzman, D., "Telnet Window Size Option", RFC 1073, BBN STC
October 1988.
9. Hedrick, C., "Telnet Remote Flow Control Option", RFC 1080,
Rutgers University, November, 1988.
10. Hedrick, C., "Telnet Terminal Speed Option", RFC 1079,
University, December, 1988.
The following is a list of RFCs that need not be supported
LINEMODE, but which would enhance any TELNET implementation
11. Postel, J. and Reynolds, J., "TELNET STATUS OPTION", RFC 859,
ISI, May 1983.
12. Postel, J. and Reynolds, J., "TELNET END OF RECORD OPTION",
Telnet Working Group [Page 22]
RFC 1184 Telnet Linemode Option October 1990
RFC 885, ISI, December 1983.
13. Silverman, S., "OUTPUT MARKING TELNET OPTION", RFC 933,
MITRE-Washington, January 1985.
14. Marcy, G., "Telnet X Display Location Option", RFC 1096,
Carnegie Mellon University, March 1989.
Security
Security issues are not discussed in this memo
Author's
David A.
Cray Research Inc
655F Lone Oak
Eagan, MN 55123
Phone: (612) 452-6650
EMail: dab@CRAY.
IETF Telnet WG Mailing List: telnet-ietf@CRAY.
Telnet Working Group [Page 23]
if you see any problems within the linking, don't worry be happy,
this is version 0.1 of the Relevance System and you gotta expect some crappy subroutines sometimes,
just be content we did not write this in Java, which would have made this "bigger and better" HAHAHHA.
RFC documents can be found at I.E.T.F.
Relevance System Copyright © 2002 Spectrum WorldResearch
other technical nosh by ServerMasters Corporation
collaboration of BobX