next up previous contents
Next: Documenting Telnet options Up: The Telnet Protocol Previous: The Network Virtual Terminal

The Principle of Negotiated Options

The NVT provides only a minimum set of functionality. Many hosts would like to provide additional services. For example, in some cases it would be useful to turn remote character echo off (to save transmission bandwidth). In general terms, an option is any service or function the NVT does not perform by default.

Before using an option, the parties must negotiate to ensure that both ends support the option. This is done by exchanging ``option code sequences'', a type of in-band signaling. Telnet defines a special byte, the Interpret As Command (IAC) with the value 255. When IAC is received, the following byte(s) is interpreted as a Telnet Command. Table 2.1 lists all the commands defined in RFC 854 [2]. Note that in order to send the data byte 255, Telnet must send IAC IAC.

 

  NAME CODE MEANING
SE 240 End of sub-negotiation parameters.
NOP 241 No operation.
Data mark 242 The data stream portion of a Synch. This should always be accompanied by a TCP Urgent notification.
Break 243 NVT character BRK.
IP 244 The function Interrupt Process.
AO 245 The function Abort Output.
AYT 246 The function Are You There.
EC 247 The function Erase Character.
EL 248 The function Erase Line.
GA 249 The Go Ahead signal.
SB 250 Start of sub-negotiation parameters.
WILL (option code) 251 Indicates the desire to begin performing, or confirmation that we are now performing, the indicated option.
WONT (option code) 252 Indicates the refusal to perform, or continue performing the indicated option.
DO (option code) 253 Indicates the request that the other party perform, or confirmation that we are expecting the other party to perform, the indicated option.
DONT (option code) 254 Indicates the demand that the other party stop performing, or confirmation that you are no longer expecting the other party to perform, the indicated option.
IAC 255 Data byte 255.
Table 2.1: Telnet commands

 

Option negotiation is performed with the WILL, WONT, DO and DONT commands, succeeded by a option code byte. The use of this scheme allows the telnet protocol to be easily extended with new options, without causing incompabilities between old and new Telnet implementations. The definition of the option commands means that if both parties tries to enable or disable an option at the same time, each side will see the other party's request as an acknowledge to its own request. Some options will require one or more arguments before the options can take effect. For instance a LINE_LENGTH option could have the length of the line as an argument. The Telnet protocol specification supports this with the sub-negotiation commands. These are the SB and SE commands which correspond to sub-negotiation BEGIN and sub-negotiation END. Enclosed within SB and SE are the option code byte followed by any number of argument bytes. Examples in section 2.1.4 show how these messages are sent.


next up previous contents
Next: Documenting Telnet options Up: The Telnet Protocol Previous: The Network Virtual Terminal

Asgaut Eng
Wed Apr 10 14:07:30 MET DST 1996