Please Whitelist This Site?

I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)

If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads.

If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on tcpipguide.com". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||tcpipguide.com^$document". Then just click OK.

Thanks for your understanding!

Sincerely, Charles Kozierok
Author and Publisher, The TCP/IP Guide


NOTE: Using software to mass-download the site degrades the server and is prohibited.
If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.

The Book is Here... and Now On Sale!

The whole site in one document for easy reference!
The TCP/IP Guide

Custom Search







Table Of Contents  The TCP/IP Guide
 9  TCP/IP Application Layer Protocols, Services and Applications (OSI Layers 5, 6 and 7)
      9  TCP/IP Key Applications and Application Protocols
           9  TCP/IP Interactive and Remote Application Protocols
                9  Telnet Protocol

Previous Topic/Section
Telnet Interrupt Handling Using Out-Of-Band Signaling: The Telnet Synch Function
Previous Page
Pages in Current Topic/Section
12
3
4
Next Page
Berkeley Remote ("r") Commands
Next Topic/Section

Telnet Options and Option Negotiation
(Page 3 of 4)

Enabling Options Using Negotiation

The first stage in Telnet option negotiation is for the client and server to decide whether or not they want to enable a particular option. One of the aspects of Telnet’s symmetry of operation is that either device may choose to initiate the use of an option. The initiating device may either specify that it wants to start using an option, or that it wants the other device to start using it. The responding device may either agree or disagree in either case; an option can only be enabled if both devices agree to its use.

This negotiation is performed using four Telnet protocol commands, as follows:

  • WILL: Sent by the initiator to indicate that it wants to start using a particular option. There are two possible replies by the responding device:
    • DO: Sent to indicate agreement that the initiator should use the option; it is then considered enabled.

    • DONT: Sent to specify that the initiator must not use the option.


  • DO: Sent by the initiator to request that the other device start using an option. That device may respond in two ways:
    • WILL: Sent to specify that the responding device will agree to use the option; the option is enabled.

    • WONT: Sent to tell the initiator that the responder will not use the option requested.

The symmetry of Telnet, combined with the fact that both DO and WILL can be used either to initiate a negotiation or respond to one, make Telnet’s option negotiation potentially complicated. Since either device can initiate negotiation of an option at any time, acknowledgment loops could potentially arise if both devices were to try to enable an option simultaneously, or get into a situation where each kept responding to the other’s replies.

For this reason, the Telnet standard specifies restrictions on when the WILL and DO commands are used. One is that a device may only send a negotiation command to request a change in the status of an option; it cannot send DO or WILL just to confirm or reinforce the current state of the option. Another is that a device receiving a request to start using an option it is already using should not acknowledge it using DO or WILL.

Disabling Options

Since an option may only be activated if both devices agree to use it, either may disable the use of an option at any time by sending either of these commands:

  • WONT: Sent by a device to indicate that it is going to stop using an option. The other device must respond with DONT as a confirmation.

  • DONT: Sent by a device to indicate that it wants the other device to stop using an option. The other device must respond with WONT.

Key Concept: Either device may choose to negotiate the use of a Telnet option. The initiator uses the WILL command to specify that it wants to start using a particular option; if the other device agrees, it responds with DO; otherwise, it sends DONT. Alternately, the initiator can use the DO command to indicate that it wants the other device to start using an option; that device responds with WILL if it agrees to do so, or WONT if it does not. Either device may disable the use of an option at any time by sending the other a WONT or DONT command.



Previous Topic/Section
Telnet Interrupt Handling Using Out-Of-Band Signaling: The Telnet Synch Function
Previous Page
Pages in Current Topic/Section
12
3
4
Next Page
Berkeley Remote ("r") Commands
Next Topic/Section

If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $



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.