back to table of contents

Chapter 4. Modem Internals

 

The Fine Art of Negotiation

Data Compression and Error Correction are wonderful right? And you get it for free, right? Well, not quite. You have to learn some more potentially confusing things about modems now that they have data compression and all these speeds supported. Since modems can now connect at a variety of different physical speeds depending on what the remote modem and local modem are capable of, and provide a variety of error detection and compression schemes, the modems now have a more complex job when first connecting. When modems connect they must first negotiate a physical link (a common baud rate), then they negotiate protocols. If we translated this negotiation into English it might look like two people in an airport in Europe trying to decide what language to speak to each other in. It might go something like this:

Modem 1 Modem 2

Dials Phone… Answers Phone…

"Hello?"

"Hi, I’m a modem." "Can you speak 33.6?"

"Yes, I can speak at 33.6" "Oh good. I’m a 33.6 too."

"Can you speak MNP-5?" "Yes I can."

"Can you speak V.42?" "Yes I can."

"Can you speak V.42bis?" "Yes I can."

"Okay, well then let’s speak V.42 bis" "Okay. Let’s do that then. That’s the best we can do."

The modems actually do all of this with a bunch of beeps, hisses, squeaks, and other generally unpleasant sounds that were not meant for the human ear. If you’ve picked up the phone and tried to eavesdrop on a modem, you probably know this. What is actually going on is many times more complicated than I have explained here, but for the sake of time, I will leave it at this.

Connect Messages Revisited

From the time the modem dials the phone to the time it prints out the CONNECT message is usually from four to fifteen seconds. If the modems can’t come to an agreement, or if the line is too noisy they will give up, and hang up on each other.

Because of all of these connection options, the CONNECT message itself has been extended in most modems to output additional information, usually including the data rate and protocols being used to make the connection:

CONNECT 2400/ARQ ARQ means error Correction

CONNECT 2400/ARQ/LAP-M LAP-M is data compression, ARQ is error correction.

CONNNECT2400/MNP Connection using MNP protocols

These connect messages vary widely from manufacturer to manufacturer, and indeed they can be set up to display more or less detail. Check the ATX command to see the levels available for command responses. The most detailed messages are enabled with the ATX4 command on most modems.

DTE Speed and DCE Speed

When you start your terminal program, or any other program on your computer that uses a modem, it has to talk to the modem at a certain speed. If your modem was a 300 baud modem, your only choice would be to set your terminal up for 300 baud. If your modem was a 1200 baud modem, you could connect to your modem at 300 baud or 1200 baud. If you were to dial out at 1200 baud and the remote modem was at 300 baud what would happen then? In the old days, if a 1200 baud modem connected remotely at 300 baud, it would send out the connect message to you at 1200 baud, then it would switch the speed that it talks to you at to 300 baud immediately, if you, or your software did not then follow the modem down to 300 baud, you would not be able to communicate. If the modem was speaking over the phone line to another modem at 300 baud, it expected you to move your terminal speed down to match it. It makes sense; if you could send data to the modem at 1200 baud, but it could only send data through the phone line at 300 baud, you’d have what we commonly call a bottleneck; the modem could receive data from you faster than it could send data out. So the modem would move the speed that it talks to your computer at. That is called "Floating DTE Speed". Since I’ve gone and used another acronym, now I have to explain it.

DTE is a short form for Data Terminal Emulator, and it refers to your computer, or your dumb terminal. The DTE is one half of an RS-232 connection. The other half is the DCE, or Data Communications Equipment, which is your modem, or theoretically any other piece of equipment not yet invented that does roughly the same thing. A smart modem (as opposed to dumb modems) has to be able to communicate out through the phone line, and communicate out through the serial port in a somewhat independent fashion. The phone line speed is the DCE speed, and the terminal speed is the DTE speed.

The two ways modems work are "Floating DTE Speed" and "Fixed or Locked DTE Speed". Floating DTE speed means that after connecting at a certain baud rate the DTE speed shifts to match the DCE speed. Locked DTE speed means that regardless of the DCE speed, the DTE speed stays where it’s put.

Now why would you want to use Floating DTE Speed? The answer is only when you don’t have a choice. Most of the time you want people to be able to dial in at any speed and connect to you and your program doesn’t have to move it’s own speed to match. It’s not always the default behavior of a modem though. It’s simpler to use. It’s not simple, it’s very complex to implement, but it’s simple for you to use. The command for your modem to enable or disable this varies from manufacturer to manufacturer, but its AT&B1 to lock the speed on an US Robotics Modem, and AT&B0 to unlock it.

What DTE Speed Should I Use?

The rate that you talk to your modem at through your serial port (your DTE Speed) can be independent of the speed that the modem connects at through the phone line. That is what we learned just previously, by locking our DTE Speed.

The answer to this question is: Whatever you need. What you probably need is a rate about double of the data rate you wish to use, and slow enough that your hardware won’t have problems with that rate. The lower limit is probably 9600 bps, and the upper limit for most systems is 57600 bps, although some systems might actually benefit very slightly from 115,200 bps DTE speeds.

If you are connecting using two 2400 baud modems with error correction and compression, a DTE speed of 9600 is fine. If you are connecting two 33.6 modems, a DTE speed of 38400 is acceptable, but will limit the performance of your data compression. A DTE speed of 57600 is better, but is sometimes not stable, depending on the speed of your computer, the serial hardware of your computer, and the software on your computer. Most PCs and modems support DTE speeds up to 115,200 bps. You don’t have a 115 kbps modem though. Some people see that their terminal is set to 38400 bps, and mistakenly assume they have a 38400 modem. There is really no such thing, at least not yet.

back to table of contents