Network Working Group D. Bernstein
Request for Comments: 1143 NYU
February 1990
The Q Method of Implementing TELNET Option Negotiation
1. Introduction
This RFC amplifies, supplements, and extends the RFC 854 [7] option negotiation rules and guidelines, which are insufficient to prevent all option negotiation loops. This RFC also presents an example of correct implementation.
Bernstein [Page 1]
RFC 1143 Q Method February 1990
NOTE: Reading This Document
2. RFC 854 Option Negotiation Requirements
As specified by RFC 854: A TELNET implementation MUST obey a refusal to enable an option; i.e., if it receives a DONT/WONT in response to a WILL/DO, it MUST NOT enable the option.
Bernstein [Page 2]
RFC 1143 Q Method February 1990
Many existing implementations respond to rejection by confirming the rejection; i.e., if they send WILL and receive DONT, they send WONT. This has been construed as acceptable behavior under a certain (strained) interpretation of RFC 854. However, to allow this possibility severely complicates later rules; there seems to be no use for the wasted bandwidth and processing. Note that an implementation compliant with this RFC will simply ignore the extra WONT if the other side sends it.
3. Rule: Remember DONT/WONT requests
A TELNET implementation MUST remember starting a DONT/WONT negotiation.
Bernstein [Page 3]
RFC 1143 Q Method February 1990
LOOP EXAMPLE 1
4. Rule: Prohibit new requests before completing old negotiation
A TELNET implementation MUST NOT initiate a new WILL/WONT/DO/DONT request about an option that is under negotiation, i.e., for which it has already made such a request and not yet received a response. DISCUSSION:
Bernstein [Page 4]
RFC 1143 Q Method February 1990
It is unclear from RFC 854 whether or not a TELNET implementation may allow new requests about an option that is currently under negotiation; it certainly seems limiting to prohibit "option typeahead". Unfortunately, consider the following:
Bernstein [Page 5]
RFC 1143 Q Method February 1990
A more restrictive solution would be to buffer all data and do absolutely nothing until the response comes back. There is no apparent reason for this, though some existing TELNET implementations do so anyway at the beginning of a connection, when most options are negotiated.
5. How to reallow the request queue
DISCUSSION:
Bernstein [Page 6]
RFC 1143 Q Method February 1990
If the user or process makes a second new request, for switching back again, while the original negotiation is still incomplete, the implementation SHOULD handle the request simply by forgetting the previous one. The third request SHOULD be treated like the first, etc. In any case, these further requests MUST NOT generate immediate requests through the network.
6. Rule: Separate WANTNO and WANTYES
Implementations SHOULD separate any states of negotiating WILL/DO from any states of negotiating WONT/DONT.
Bernstein [Page 7]
RFC 1143 Q Method February 1990 7. Example of Correct ImplementationTo ease the task of writing TELNET implementations, the author presents here a precise example of the response that a compliant TELNET implementation could give in each possible situation. All TELNET implementations compliant with this RFC SHOULD follow the procedures shown here.
Bernstein [Page 8]
RFC 1143 Q Method February 1990
Upon receipt of WONT, we choose based upon him and himq:
8. References
[1] Borman, D., private communication, April 1989.
Bernstein [Page 9]
RFC 1143 Q Method February 1990
Research, August 1989.
9. Acknowledgments
Thanks to Dave Borman, dab@opus.cray.com, for his helpful comments.