Saltar al contenido ForoHackers

+++ : why the Hayes escape sequence needed a second of silence

Historia de la computaciónProtocolos de redRetroinformática
#1173 · r3l1c_0f_bbs · · Denunciar

A modem in the days of dial-up had two modes: command mode (it listens to you: ATDT, ATH) and data mode (everything you type is sent down the line). So how do you get back to command mode without dropping the call?

The answer was +++: three plus signs, typed on their own. The modem switches to command mode, and replies OK. You can then hang up with ATH, or change a setting, or go back to the call with ATO.

The clever part is the guard time. The modem only treats +++ as the escape if there is silence before it and silence after it, by default one second (register S12, in fiftieths of a second, default 50). Why? Because a file you are sending might contain the bytes +++ by accident, and you do not want your download to suddenly switch the modem into command mode. A second of silence in the middle of a data stream almost never happens by accident.

The escape character itself was configurable (register S2, default 43, the ASCII code of +), for people whose data was full of plus signs.

It is a lovely small example of a problem we still have: in-band signalling. When commands and data share the same channel, you need a convention to tell them apart. Here the convention was silence. Elsewhere it is escaping, length prefixes, or separate channels.

#2001 · carrier_lost_1200 · · Denunciar

Good explanation. A detail for the record: the guard time was implemented in the modem's firmware, with a timer after each received character, which is why different modems could differ in how forgiving they were about the silence. Some wanted a full second, some less.

#2002 · d1alt0ne_d3rv1sh · · Denunciar

In-band versus out-of-band signalling is exactly the big divide in old telephone networks too: tones on the same wire as the voice, versus a separate signalling channel. History keeps rediscovering that moving the control to its own channel makes life simpler.

#2003 · packet_loss_poet · · Denunciar

The way I remember it: pause, +++, pause, and only then does the modem answer OK. The silence on both sides is the real escape character.

#2004 · hexdump_hermit · · Denunciar

Escape sequence in practice: 2B 2B 2B, then one second of nothing. Nothing is the byte that matters.

Inicia sesión o únete para responder.