RFC 103
Implementation of Interrupt Keys
NWG RFC 103: Implementation of Interrupt Keys π
Okay bestie, let's do the paperwork first πβ¨ This one is NWG RFC 103 (also filed as NIC 5764), and it's called Implementation of Interrupt Keys.
- Author: R B Kalin, MIT Lincoln Laboratory π§
- Date: 24 Feb 1971 π
- Category or status: not stated in the original π€·
- Obsoletes: not stated π€·
- Updates: not stated π€·
Quick tea: the current protocol specs have a seriously broken logic bug in how the program interrupt function gets implemented π This paper digs into the problem and offers a fix that's simple to implement π
THE PROBLEM π₯
On most time-sharing systems, the program interrupt key (aka the break key, or the help request button π) does two jobs. First, it temporarily suspends the user process that's running. Second, it switches the keyboard input stream over to a dormant supervisory process. Any input you typed before the interrupt that hasn't been accepted yet stays buffered for the suspended user process. Anything you type after that goes to the supervisory routine.
The current NCP protocol only does half of this π It provides for suspending a remote process using INS and INR control messages, but it has no way of telling the remote host when the data stream should be switched. INR and INS messages travel over the control link, and they move at the same time as the user's keyboard input on its own link. So the receiving host can't rely on relative arrival times to figure out the timing. Without that info, the remote NCP has no way of knowing which input characters are for the user process and which are for the supervisory routine π
A solution some systems use is to map the interrupt signal to a code from the character set, usually an ASCII control-C. Unfortunately, that isn't general enough for the ARPA network π€ Some systems, e.g. MULTICS, use every available ASCII code for other things, so none are free for this. Even if one could be assigned, the interrupt character still has to be recognized by the remote host. The buffers on that user link may be full, so the sending host may not be able to send the message carrying the interrupt code. And if the remote user process loops without accepting data, its input buffers may never free up, so the message may never get through.
A partial answer is to put a teletype scanner process at the serving end that's always hungry for input π Since every input message gets consumed right away, buffers stay free and interrupt codes can get through. The catch is that characters sometimes have to be thrown away, and by the time they've been scanned there may be no buffer space left for them. That's not a big deal during console interactions, since users can only type when the program asks for input. But it stops the scanner from being driven from a text file π
A SOLUTION β¨
This is a fix for the problem above, for ASCII data streams π
- Character messages SHOULD use eight bit fields for each character code.
- For all of the defined ASCII character codes, the left most bit in the eight bit field SHALL be zero.
- An interrupt sync character (arbitrarily given the code
octal 200) SHOULD be placed in the data stream at the correct point in the typing sequence. - All codes from
octal 201tooctal 377are officially to be ignored by a receiving host. Their use is reserved for additional control information, should it become necessary. Trying to use them as extra character codes will get pushback from PDP-10 systems, which pack characters internally into seven bit fields. Note that this objection can not be made against the interrupt sync character, because the system filters it out and it never shows up in a user's input buffer π ββοΈ - Because there might not be enough allocation to send the user message containing the interrupt sync character, the
INR/INSmechanism as currently defined MUST be kept. AnINScontrol message SHOULD be sent at the moment an interrupt sync character is entered into a text stream. When the foreign host receives it, the attached process SHOULD be suspended immediately, and the associated input stream SHOULD be scanned. If possible, all input up to the interrupt sync character SHOULD be buffered for the suspended process. Once the sync character is found, the stream SHOULD be switched to the newly activated supervisory process. If it isn't possible to buffer all of the user process's input, it can be thrown away, and the supervisory process can return an error message to the user. Either way, it MUST be guaranteed that outstanding input gets consumed and message buffers get freed, so pending character messages can be sent π§Ή - If an interrupt sync character arrives before the matching
INS, the user process SHOULD be suspended, and the NCP SHOULD wait for theINSbefore going any further π - The NCP's function in the discussion above can, of course, be handed off to a separate module, e.g. a TELNET process. If that's done, the NCP can be transparent to message content π¦
COMMENTARY πΈ
This proposed change to the second level protocol is not meant as a general solution. It's a specific patch to the current NCP design, meant to fix a critical error. Its more obvious deficiencies are...
- It only works with seven bit code character streams. No extensions are allowed for EBCDIC, ASCII-8, or other large character sets. There's also no provision for interrupting a process that has no character stream, though the author knows of no case where that concept means more than closing the connection.
- It requires the system to scan all data coming over an interruptable connection. Presumably that means that when the connection is created, the receiving host MUST be told the scan is to be done. Various techniques, both implicit and explicit, could be used π§
- The technique is not immune to lost character boundaries within a message, and it can't handle INS control messages that lack matching sync characters, or vice versa π¬
- It may not be possible to get either the
INSor the text message containing the interrupt sync character to a remote host. Possible reasons include user console failure, local host failure, network failure, a blocked control link, insufficient allocation, etc. In those cases, the remote process may loop indefinitely π
The only comprehensive solutions known to the interrupt synchronization problem (the ones that avoid the difficulties above) need more than minor changes to the current NCP protocol. Unless simpler answers turn up, their implementation MUST be postponed until the next major design revision ποΈπ
[ This RFC was put into machine readable form for entry ] [ into the online RFC archives by Gert Doering 4/97 ]
π¦ where this page comes from
- ietf: rfc103 1971-02
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms