The Telnet protocol is often thought of as simply providing a
facility for remote logins to computer via the Internet. This was its
original purpose although is can be used for many other purposes.
The Network Virtual Terminal
Communication is established using the TCP/IP protocols and
communication is based on a set of facilities know as a Network Virtual
Terminal (NVT). At the user or client end the telnet client program is
responsible for mapping incoming NVT codes to the actual codes needed to
operate the user's display device and is also responsible for mapping user
generated keyboard sequences into NVT sequences.
The NVT uses 7 bit codes for characters, the display device,
referred to as a printer in the RFC, is only required to display the
"standard" printing ACSII characters represented by 7 bit codes and to
recognise and process certain control codes. The 7 bit characters and
transmitted as 8 bit bytes with most significant bit set to zero. An
end-of-line is transmitted as the character sequence CR (carriage return>
followed by LF (line feed). If it is desired to transmit and actual
carriage return this transmitted as a carriage return followed by a NULL
(all bits zero) character.
The following control codes are required to be understood by the Network
The following further control codes are optional but should have the
indicated defined effect on the display.
The telnet protocol also specifies various commands that control
the method and various details of the interaction betwwen the client and
server. These commands are incorporated with ing the data stream. The
commands are distinguished by the use of various characters with the most
significant bit set. Commands are always introduced by a character with
the deciaml code 255 known as an Interpret as command(IAC)
character. The complete set of special character is
There are a variety of options that can be negotiated betwwen a
telnet client and server using command at any stage during the connection.
They are described in detail in seperate RFCs. The following are the most
Options are agreed by a process of negotiation which results in
the client and server having a common view of various extra capabilities
that affect the interchange and the operation of application.
Either end of a telnet dialogue can enable or disable an option either
locally or remotely. The initiator sends a 3 byte command of ther form
IAC,[type of operation],[option]
The response is of the same form.
Operation is one of
For example if ther sender wants the other end to suppress go-ahead it
would send the byte sequence
The final byte of ther three byte sequence identifies the required action.
For Some of ther negotiable options values need to be communicated
once support of ther option has been agreed. This is done using
sub-option negotiation. Values are communicated via an exchange of
value query commands and responses in the following form.
IAC,SB,[option code number],1,IAC,SE
For example if ther client wishes to identify ther termianl type
to ther server the following exchange might take place.
The first exchange establishes that termianl type (option number
24) will be handled, the server then enquires of thec lient what value it
wishes to associate with the terminal type. The sequence SB,24,1 implies
sub-option negotiation for option type 24, value required(1). The IAC,SE
sequence indicated the end of this request. The response
IAC,SB,24,0,'V',... implies sub-option negotiation for option type 24,
value supplied(0), the IAC,SE sequence indicates the end of the response
(and the supplied value).
Telnet Negotiable Options
* Suppress Go Ahead
The original telnet implementtation defaulted to "half duplex" operation.
This means that data traffic could only go in one direction at a time and
specific action is required to indicate the end of traffic in one
direction and that traffic may now start in the other direction.
The specific action is the inclusion of a GA character in ther data
The echo option is enabled, usually by the server, to indicate that the
server will echo every character it receives. A combination of "suppress
go ahead" and "echo" is called character at a time mode meaning that each
character is separately transmitted and echoed.
This option replaces and supersedes the line mode kludge.
* remote flow control
This option controls where the special flow control effects of
Ctrl-S/Ctrl-Q are implemented.
Telnet control functions
The telnet protocol includes a number of control functions. These are
initiated in response to conditions detected by the client (usually
certain special keys or key combinations) or server. The detected
condition causes a special character to be incorporated in the data
* Interrupt Process
This is used by the client to cause the suspension or termination of the
server process. Typically the user types Ctrl-C on the keyboard. An
IP(244) character is included in the data stream.
* Abort Output
This is used to suppress the transmission of remote process output. An
AO(238) character is included in the data stream.
* Are You There
This is used to trigger a visible response from the other end to
confirm the operation of the link and the remote process. An AYT(246)
character is incorporated in the data stream.
* Erase character
Sent to the display to tell it to delete the immediately preceding
character from the display. An EC(247) character is incorporated in the
* Erase line
Causes the deletion of the current line of input. An EL(248)
character is incorporated in the data stream.
* Data Mask
Some control functions such as AO and IP require immediate action and
this may cause difficulties if data is held in buffers awaiting input
requests from a (possibly misbehaving) remote process. To overcome this
problem a DM(242) character is sent in a TCP Urgent segment, this tells
the receiver to examine the data stream for "interesting" characters such
as IP, AO and AYT. This is know as the telnet synch mechanism.
Links to this Page
- protocols last edited on 24 June 2003 at 7:11 pm by t3.hfbk-hamburg.de
- enter. last edited on 21 February 2002 at 1:43 am by max2-171.dialin.uni-hamburg.de.