Search

TELNET Negotiation

The TELNET protocol has following commands for negotiation between TELNET client and TELNET server.

TELNET Command Code in decimals Code in hexadecimals Description
WILL 251 FB The sender suggests it would like to use an available option.
WON’T 252 FC The sender informs the recipient it will not use that option.
DO 253 FD The sender instructs the recipient to use an available option.
DON’T 254 FE The sender instructs the recipient not to use that option.

 

Following table lists some possible combinations of TELNET negotiations with above commands.

Sender Receiver Meaning
WILL DO Sender wants to enable an option with TELNET WILL command, and the receiver agrees to that by sending back a TELNET DO command.
WILL DON’T Sender wants to enable an option with TELNET WILL command, and the receiver does not agrees to that by sending back a TELNET DON’T command.
DO WILL Sender wants the receiver to enable an option with TELNET DO command, and the receiver agrees to that by sending back a TELNET WILL command.
DO WON’T Sender wants the receiver to enable an option with TELNET DO command, and the receiver does not agrees to that by sending back a TELNET WON’T command.
WON’T DON’T The sender wants not to use and option with TELNET WON’T command, and the receiver confirms to that by sending back a DON’T command.
DON’T WON’T The sender wants the receiver not to use and option with TELNET DON’T command, and the receiver confirms to that by sending back a WON’T command.

 

Examples of TELNET negotiation

To understand what is TELNET negotiation, lets us consider an example of negotiation between a TELNET server and a TELNET client, based on above table. Click the following links to learn what is IAC (Interpret as Command) and TELNET Commands and Options.

Case 1 - Server wants to enable Echo option

iac-will-echo-1.gif

The reply can be either with a DO or DON’T.

iac-do-echo-1.gif

iac-dont-echo-1.gif

Case 2 - Server wants the client to enable Echo option

iac-do-echo-2.gif

The reply can be either with a WILL or WON’T.

iac-will-echo-2.gif

iac-wont-echo-2.gif

Wireshark packet capture screenshots of TELNET negotiation

Following Wireshark packet capture screenshots show examples of negotiations.

IAC WILL ECHO capture

iac-will-echo-capture.jpg

IAC DO ECHO capture

iac-do-echo-capture.jpg

Related Tutorials
What is TELNET
TELNET modes of operation
TELNET NVT (Network Virtual Terminal)
What is IAC (Interpret as Command) in TELNET
TELNET Commands and Options
How to install TELNET server in Windows Server using Server Manager
How to install TELNET server in Windows Server using PowerShell
How to start TELNET service in Windows Server
How to connect to Cisco Router using TELNET
How to install TELNET Client in Windows 10
How to use telnet command on Windows and telnet command options
How to test ports using TELNET
Why TELNET is not secure