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 Communications Model and the Network Virtual Terminal (NVT)
Previous Page
Pages in Current Topic/Section
1
2
3
Next Page
Telnet Interrupt Handling Using Out-Of-Band Signaling: The Telnet Synch Function
Next Topic/Section

Telnet Protocol Commands
(Page 2 of 3)

Escaping Commands and the Interpret As Command (IAC) Character

All Telnet commands are sent in the same communication stream as regular data; they are represented using special byte values in the range from 240 to 254. To differentiate between data bytes of these values and Telnet commands, every command is preceded by a special escape character, given the name Interpret As Command (IAC). IAC has a value of 255; when the recipient sees this character, it knows the next byte is a command and not data. So, since the Telnet Interrupt Process command has the value 244, to send this command the Telnet client would transmit the byte 255 and then 244. If the actual data byte value 255 needs to be sent, it is transmitted as two 255 bytes. Some Telnet commands also include additional bytes data, which are sent after the command code itself; a good example is the use of parameters in Telnet option negotiation.

You may be wondering at this point why the IAC character is needed at all. After all, Telnet uses US ASCII, which is 7-bit data in the byte range of 0 to 127, and the Telnet commands have values higher than 127. One general rationale for using the IAC escape is to be explicit that a command is being sent. A more specific reason is to accommodate the optional sending of 8-bit binary data over Telnet, which the client and server can negotiate. If this mode were enabled and commands were not preceded by the IAC character, this would require all data bytes with values from 240 to 255 to be somehow marked so they would be interpreted as data and not commands. It is more efficient to include an extra byte for commands than data, since they are sent less frequently. By escaping commands, only data byte value 255 requires two bytes to be sent.

Key Concept: The Telnet protocol defines a set of protocol commands that are used for two purposes: first, to represent standard control functions that need to be sent between a terminal and host, such as the command to interrupt a process; and second, to enable protocol communication between the Telnet client and server software. Protocol commands are sent in the normal data communication stream over the Telnet session’s TCP connection. Each is represented by a byte value from 240 to 254, and is preceded by the Interpret As Command (IAC) command, byte value 255, which tells the recipient that the next byte in the stream is a command.



Previous Topic/Section
Telnet Communications Model and the Network Virtual Terminal (NVT)
Previous Page
Pages in Current Topic/Section
1
2
3
Next Page
Telnet Interrupt Handling Using Out-Of-Band Signaling: The Telnet Synch Function
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.