Illustrated TCP/IP Illustrated TCP/IP
by Matthew G. Naugle
Wiley Computer Publishing, John Wiley & Sons, Inc.
ISBN: 0471196568   Pub Date: 11/01/98
  

Previous Table of Contents Next


Chapter 221
TELNET Options

TELNET Options

  Each side of the connection requests or tells its partner the options it wants or can do.
  Options are formatted in:
  WILL or WON’T <option>
  DO or DON’T <option>
  Negotiates options such that symmetry can be set up between two stations.
  Options include:
  Ability to echo
  Terminal type
  Setting line mode so that groups of characters can be sent

The TELNET program is extensible through the use of options. Each side of the connection requests or tells the remote end of the connection which of these options it can support and which one the remote end should support. This provides for symmetry. The TELNET protocol was written so that it would work on a variety of operating systems. Therefore, before a connection is made to the remote device, the TELNET protocol has some work to do in order to synchronize the connection with the remote device. For example, the DOS operating system for personal computers requires that a CR-LF (carriage return-line feed) be used to terminate a line of text. Other systems such as Unix require a line of text to be terminated with an LF. Another example is the echoing of characters. Upon connection attempt, the TELNET protocol will negotiate with the remote device as to who will do the echoing of typed characters to the initiator of a connection. During the connection attempt between a source and destination station, the two stations will communicate options. These options indicate how each end of the connections will respond on the TELNET connection. These options include:

1.  The ability to change from 7-bit text to 8-bit binary
2.  Allowing one side or the other to echo characters
3.  Specifying a terminal type
4.  Requesting the status of a TELNET option from the remote connection
5.  Setting a timing mark to synchronize two ends of a connection
6.  The ability to terminate a record with an EOR code
7.  Setting line mode so that strings of characters may be sent instead of a character-at-a-time transmit
8.  Stopping the go-ahead signal after data

The options are negotiated between the two network stations in the following manner:

Request Response
WILL <option> DO or DON’T <option>

For example, WILL ECHO from station A is requesting that station A provide the echoing of characters. The response will either be DO ECHO, meaning the remote end agrees, or DON’T ECHO, meaning the remote end will not allow station A to echo.

Agreement between the two TELNET ends communicated for a DO <option> will be responded to with a WILL <option> or WON’T <option>. An example of this option negotiation: If the TELNET application is running on a DOS personal computer which is set up for local echo, upon the connection setup the TELNET option from the PC will be WILL ECHO and the response should be DO ECHO. If the PC had been set up without the local echo option and you wish the remote end to provide echo, the PC should negotiate echo with DO ECHO and the response will be WILL ECHO.

Using WILL, WON’T, DO, and DON’T provides symmetry. Either side of the connection can provide the command or the response. One side provides services in exactly the same manner as the other side.


Previous Table of Contents Next