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 Protocol Commands
Previous Page
Pages in Current Topic/Section
1
2
Next Page
Telnet Options and Option Negotiation
Next Topic/Section

Telnet Interrupt Handling Using Out-Of-Band Signaling: The Telnet Synch Function
(Page 1 of 2)

All the bytes of data sent from a Telnet client to a server are received in the order that they were sent, and vice-versa. This is, of course, the way we expect an application to operate; in fact, ensuring that data is not received out-of-order is one of the jobs that we assume of the reliable transport protocol TCP, over which Telnet runs. However, this can cause a problem for Telnet because of the way the protocol sends both data and commands over the same connection.

The Problem: Sending an Interrupt Command

The most important case where the issue of all data being received in order arises is when a user needs to interrupt a process. Suppose as an example that you are using Telnet to run an interactive program that takes user input, processes it, and then produces output. You are merrily typing away when you notice that you haven’t seen any output from the program for a while. It has apparently hung up due to a programming error or other glitch.

If you were using the program on a directly-connected terminal, you would simply use the key or keystroke command appropriate to that terminal to interrupt or kill the process and restart it. Instead, you are using Telnet, so you enter the appropriate keystroke, which gets converted to the special Telnet Interrupt Process command code (byte value 244, preceded by the Telnet Interpret As Command code, 255).

Since Telnet uses only a single stream for commands and data, that code is placed into the TCP data stream to be sent over to the Telnet server. Since you were entering data for a while, that Telnet Interrupt Process code will be sitting behind a bunch of regular data bytes. Now, the remote process has stopped reading this data, which means the TCP receive buffer on the server will start to fill up. The Interrupt Process command will thus remain stuck in the buffer, waiting to be read. In fact, if the number of data bytes in front of the command is high enough, the TCP buffer on the server may fill entirely, causing the server to close the client’s TCP send window. This means the Interrupt Process command will wait in the client’s outgoing TCP queue and never even be sent to the remote host at all!

Obviously, what we need here is some way to be able to flag the Interrupt Process command, so that it can be sent to the remote host regardless of the number of data bytes outstanding in front of it. If you’ve already perused the large section of this Guide devoted to TCP, you may now be thinking that you have already read about a feature of that protocol that seems ideally suited for this exact problem… and you’d be correct! The TCP “urgent” function allows an important piece of data to be marked so that it is given priority over regular data, a process sometimes called out-of-band signaling (because the signal is “outside” the normal data stream). Telnet makes use of this feature of TCP to define what it calls the synch function.


Previous Topic/Section
Telnet Protocol Commands
Previous Page
Pages in Current Topic/Section
1
2
Next Page
Telnet Options and Option Negotiation
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.