Appendix 3 - Use of the Byte Macro Option
One of the major drawbacks of the DET option is that because the functions are encoded as Telnet option subnegotiations a fairly high overhead is incurred. A function like Character Insert which is encoded as a single byte in most terminals requires six bytes in the DET option. Originally the only other solution that would have accomplished the same transparency that the use of subcommands provides would have been to define additional Telnet control functions. However, since this would entail modification of the Telnet protocol itself, it was felt that this was not a wise solution. Since then the Telnet Byte Macro Option (RFC 729) has been defined. This option allows the user and server Telnets to map an arbitrary character string into a single byte which is then transferred over the net. Thus the Byte Macro Option provides the means for implementations to avoid the overhead for heavily used subcommands. The rest of this appendix suggests how the Byte Macro Option should be applied to the DET option.
In keeping with the specification of the Byte Macro Option, macro bytes will be chosen from the range 128 to 239. For the DET option, it is suggested that macro bytes be chosen by adding the subcommand code to 128. In addition, an unofficial DET subcommand might be defined indicating that each side was willing to support macro bytes for all subcommands (but not necessarily support all of the subcommands themselves) according to this algorithm. This subcommand would be:
IAC SB DET DET-MACRO <negotiation> IAC SE
subcommand code: 254
where <negotiation> may have the values of the Telnet option negotiation:
251 WILL
252 WONT
253 DO
254 DONT
This subcommand is sent by a Telnet implementation to indicate its willingness to adopt byte macros for all of the DET subcommands according to the following algorithm:
The macro byte for subcommand i will be i+128 and will represent the following string for parameterless subcommands:
IAC SB DET <subcommand code> IAC SE
and the following string for subcommands with parameters:
IAC SB DET <subcommand code>
The default setting for this subcommand is that the macros are not in effect, in other words,
IAC SB DET DET-MACRO WONT IAC SE
IAC SB DET DET-MACRO DONT IAC SE
Negotiation of this subcommand follows the same rules as negotiations of the Telnet options.