Next Previous Contents

9. What Speed Should I Use with My Modem?

By "speed" we really mean the "data flow rate" but almost everybody incorrectly calls it speed. For all modern modems you have no choice of the speed that the modem uses on the telephone line since it will automatically choose the highest possible speed that is possible under the circumstances. But you do have a choice as to what speed will be used between your modem and your computer. This is sometimes called "DTE speed" where "DTE" stands for Data Terminal Equipment (Your computer is a DTE.) You need to set this speed high enough so this part of the signal path will not be a bottleneck. The setting for the DTE speed is the maximum speed of this link. Most of the time it will likely operate at lower speeds.

For an external modem, DTE speed is the speed (in bits/sec) of the flow over the cable between you modem and PC. For an internal modem, it's the same idea since the modem also emulates a serial port. It may seem ridiculous having a speed limit on communication between a computer and a modem card that is directly connected inside the computer to a much higher speed bus. But it's that way since the modem card probably includes a dedicated serial port which does have speed limits (and settable speeds).

9.1 Speed and Data Compression

What speed do you choose? If it were not for "data compression" one might try to choose a DTE speed exactly the same as the modem speed. Data compression takes the bytes sent to the modem from your computer and encodes them into a fewer number of bytes. For example, if the flow (speed) from the PC to the modem was 20,000 bytes/sec (bps) and the compression ratio was 2 to 1, then only 10,000 bytes/sec would flow over the telephone line. Thus for a 2:1 compression ratio you need to set the speed double the maximum modem speed on the phone line. If the compression ratio is 3 to 1 you need to set it 3 times faster.

9.2 Where do I Set Speed ?

This DTE speed is normally set by a menu in your communications program or by an option given to the getty command if someone is dialing in. You can't set the DCE modem-to-modem speed.

9.3 Can't Set a High Enough Speed

You need to find out the highest speed supported by your hardware. As of late 1998 most hardware only supported speeds up to 115.2K bps. A few 56K internal modems support 230.4K bps. If you have a communications programs that doesn't show high enough speeds in its menu, then there are some options you can give to the setserial command so that a low speed command from the communication program will actually result in a higher speed. With these options, when you set the speed for 38400 the actual speed will be much higher. See the man page for "setserial" and search for spd_hi, spd_vhi, spd_cust, baud_base, and divisor. Note that you must set baud_base to the actual maximum speed of the hardware. This speed is usually lower than the frequency of the crystal oscillator in the hardware since the crystal frequency is often divided by 16 in the hardware to get the actual speed. (The reason the crystal frequency needs to be higher is so that this high crystal speed can be used to take at least several samples of each bit to determine if it's a 1 or a 0. To get a speed of 230400 (if this is what your serial port uses) on ttyS2 you could use:

setserial /dev/ttyS2 spd_cust baud_base 230400 divisor 1
In some cases this works when "stty 230400" doesn't. If you've used spd_cust you'll have to claim the speed is 38400 somewhere else to obtain the actual speed of 230400. This method of setting speed is sort of a hack and when applications catch up to higher speeds it might not be needed anymore.

9.4 Speed Table

It's best to have at least a 16650 UART for a 56K modem but few modems support it. Second best is a 16550 that has been tweaked to give 230,400 bps. Here are some suggested speeds to set your serial line if your modem speed is:


Next Previous Contents