View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide


Telnet Protocol
Telnet Protocol
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 Virtual Terminal.

      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 important.

      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

IAC,SB,[option code],0,[value],IAC,SE

      For example if ther client wishes to identify ther termianl type to ther server the following exchange might take place.

    Client 255(IAC),251(WILL),24
    Server 255(IAC),253(DO),24
    Server 255(IAC),250(SB),24,1,255(IAC),240(SE)
    Client 255(IAC),250(SB),24,0,'V','T','1','0','0',255(IAC),240(SE)

      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

* echo

* linemode

* remote flow control

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 stream.

* Interrupt Process

* Abort Output

* Are You There

* Erase character

* Erase line

* Data Mask

Links to this Page