| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Telnet Options and Option Negotiation (Page 4 of 4) Option Subnegotiation All of the DO/DONT/WILL/WONT stuff above only serves to enable or disable an option. Some options are only either off or on, in which case the negotiation above is sufficient. An example would be the binary transmission option, TRANSMIT-BINARY. Others require that after they are enabled, the client and server exchange parameters to control how the option works. For example, the TERMINAL-TYPE option requires some way for the client to send the server the name of the terminal. Telnet allows the client and server to send an arbitrary amount of data related to the option using a process called option subnegotiation. A device begins this process by sending a special sequence of Telnet protocol commands and data. First the command SB is sent, followed by the option number and parameters as defined by the particular option; the end of the subnegotiation data is marked by the protocol command SE. Of course, both SB and SE must be preceded by the Interpret As Command (IAC) command byte. So, lets take the terminal type option again as an example. Suppose the server supports this option and would like the client to use it. It will send: IAC DO TERMINAL-TYPE
Assuming the client agrees, it will respond with: IAC WILL TERMINAL-TYPE Now the terminal type option is in effect, but the server still doesnt know what terminal the client is using. It can prompt the client to provide that information by sending this: IAC SB TERMINAL-TYPE SEND IAC SE The client, receiving this subnegotiation command, will respond with: IAC SB TERMINAL-TYPE IS <some_terminal_type> IAC SE
Home - Table Of Contents - Contact Us The TCP/IP Guide (http://www.TCPIPGuide.com) Version 3.0 - Version Date: September 20, 2005 © Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved. Not responsible for any loss resulting from the use of this site. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||