[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

System Management Guide: Communications and Networks


Modems provide serial communications across ordinary telephone lines. This section discusses modem standards, general modem setup, and specific configuration tips for popular modems.

Modem Overview

A modem is a device that allows you to connect one computer to another across ordinary telephone lines. The current telephone system is incapable of carrying the voltage changes required for a direct digital connection. A modem overcomes this limitation by modulating digital information into audio tones for transmission across the phone line, and by demodulating those tones back into digital information on reception. Modems are commonly used with Basic Network Utilities (BNU) or other implementations of the UNIX-to-UNIX Copy Program (UUCP). A high-speed (14,400 bps or greater) modem can be used with Serial Line Interface Protocol (SLIP) to provide Transmission Control Protocol/Internet Protocol (TCP/IP) connectivity as well.

Often, the term baud is used to refer to modem speed instead of bps. Baud is actually a measurement of the modulation rate. In older modems, only 1 bit was encoded in each signal change, so modem baud rate was equal to modem speed. Modems that operate at higher speeds, however, still generally operate at 2,400 (or even 1,200) baud, and encode two or more bits per signal change. A modem's bps rate is calculated by multiplying the number of data bits per signal with the baud (for example, 2,400 baud x 6 bits per signal change = 14,400 bits per second). Most modern modems can communicate at a variety of speeds (for example, 28,800, 14,400, 9,600, 7,800, 4,800, and 2,400 bps).

Telecommunications Standards

The older speeds of 300, 1,200, and 2,400 bps were well defined. However, as modem manufacturers began to devise methods for gaining higher speeds, each modem manufacturer started to use a proprietary method incompatible with modems from other manufacturers. Today, the ITU-TSS (formerly the United Nations Consultative Committee for International Telephony and Telegraphy, abbreviated CCITT) defines standards for most high-speed communications.

Even high-speed modems are much slower than other methods of computer communication. A high-speed modem can operate at 28,800 bps, but an Ethernet connection operates at 10,000,000 bps. To boost data throughput, high-speed modems typically offer one or more data compression algorithms. These algorithms can boost the throughput of a high-speed modem to speeds of 57,600 bps (if the data rate is 14,400 bps) or 115,200 bps (if the data rate is 28,800 bps). Note that these compression algorithms are sensitive to the data being transmitted. If the data has already been compressed (for example, with the compress command), the data compression methods of high-speed modems offer little or no benefit, and might even reduce data throughput. When using a modem with data compression technology, the speed of the data terminal equipment/data circuit-terminating equipment (DTE/DCE) connection between the computer and the modem is equal or greater than the nominal data rate of the connection between modems. For example, with a V.32bis modem with V.42bis data compression, the data rate of the modem (the speed at which the modem communicates across telephone lines) is 14,400 bps. When the V.42bis compression is active, actual data throughput can reach 57,600 bps. To accommodate the greater throughput offered by data compression, the speed of the DTE/DCE between the computer and the modem should be set to 57,600 bps.

Attention: Modems implementing data compression and modern modulation schemes may yield a higher data throughput than some systems and asynchronous adapters can accommodate.

The ITU-TSS defines standards for high-speed communications, including data compression algorithms. ITU-TSS standards are usually named V.nn, where nn is a number. Another, slightly less common standard is the Microcom Networking Protocol (MNP). Available in versions (called classes) 1-9, MNP is a high-performance, high-speed protocol that was available relatively early, and became something of a de facto standard before the advent of the CCITT standards.

ITU-TSS Communications Standards

Following is a list of some common communications standards defined by the ITU-TSS. Note that this only a partial list. For a complete list, refer to the Internet website for the International Telecommunication Union.

V.29 ITU-TSS standard for half-duplex 9600 bps communications.
V.32 ITU-TSS standard for full-duplex 9600 bps communications.
V.32bis ITU-TSS standard for 14,400 communications. V.32bis is a revision to the V.32 standard.
V.34 ITU-TSS standard for 33,600 bps communications. Note that this standard achieves 33,600 bps data rates using multiple bit encoding, instead of the data compression scheme used by MNP Class 9. This standard was previously referred to as V.fast.

V.42 ITU-TSS error correcting procedures for DCEs using asynchronous to synchronous conversion.
V.42bis Revised ITU-TSS data compression standard.

MNP Communications Standards

MNP Class 1 An asynchronous, half-duplex, byte-oriented method of transferring data realizing about 70% efficiency. Uncommon in modern modems.
MNP Class 2 A full-duplex counterpart to MNP Class 1. Uncommon in modern modems.
MNP Class 3 A synchronous, bit-oriented full-duplex method of transferring data realizing about 108% efficiency. (Efficiency greater than 100% is realized because the start/stop bits required for an asynchronous connection are eliminated. The DTE/DCE between the modem and the system are still asynchronous).
MNP Class 4 An enhancement to MNP Class 3 including a mechanism for varying the packet size (adaptive packet assembly) and a means of eliminating redundant administrative overhead (data phase optimization). An MNP Class 4 modem offers approximately 120% efficiency.
MNP Class 5 Class 5 includes data compression along with Class 4 features. An MNP Class 5 modem offers 200% efficiency.
MNP Class 6 MNP Class 6 allows incorporation of multiple, incompatible modulation techniques into one modem (universal link negotiation). This allows MNP Class 6 modems to begin communication at a slower speed and negotiate a transition to a higher speed. Class 6 also includes a statistical duplexing scheme that dynamically allocates utilization of half-duplex modulation to simulate full-duplex service. All features of MNP Class 5 are supported.
MNP Class 7 Incorporates enhanced data compression. Combined with Class 4, efficiencies of 300% can be realized.
MNP Class 8 N/A
MNP Class 9 Combines enhanced data compression with V.32 technology to allow data rates up to 28,800 bps.

Generic Modem Setup

To set up a modem:

  1. Attach the modem with the appropriate cables.
  2. Add a tty for the modem.
  3. Configure the modem.

Attaching the Modem with Appropriate Cables

The first step in setting up a modem is to attach the modem with the appropriate cables. Part numbers and their descriptions are listed below.

Async Cable, EIA-232; used to attach all asynchronous devices; sometimes used with other cable assemblies.

10 to 25-pin D-shell connector used to attach asynchronous cable 6323741 to native serial ports S1 and S2 as shown in the following figure.

Figure 5-1. 10 to 25-Pin Connector. This illustration shows a 10 to 25-pin connector.

Figure comma19 not displayed.

Cable P used to connect to 16-port concentrator. Part number includes four RJ45-to-DB25 converter cables.

Following are some examples of cable connections:

  1. To attach a modem to native serial port S1, use the following cables:

    Figure 5-2. Modem to Native Serial Port Cable Assembly. This illustration shows a 59F3740 cable on the serial port end and a 6323741 on the modem end.

    Artwork for comma40
  2. To attach a modem to an 8-port async adapter (EIA-232) interface cable assembly, use the following cables:

    Figure 5-3. 8-Port Interface to Modem Cable Assembly. This illustration shows an 8-port interface connected to a modem with a 6323741 cable.

    Artwork for comma10
  3. To attach a modem to a 16-port concentrator on a 64-port adapter, use the following cables:

    Figure 5-4. 16-Port Interface to Modem Cable Assembly. This illustration shows a 59F3432 cable on the serial port end and a 6323741 on the modem end.

    Artwork for comma16

Adding a TTY for the Modem

First, ensure that the system is turned on and that the modem is turned off. Use the Web-based System Manager, wsm, or the SMIT fast path smit mktty.

Configuring the Modem

Use only one of the two methods presented in this section for configuring the modem .

Sending AT Commands with the cu Command

If you have the Basic Network Utilities (BNU) installed, use the cu command to configure a modem as follows:

  1. Add the following line to your /usr/lib/uucp/Devices file. Do not add the line if it is already in the file. This should work with most Hayes-compatible modems. (Replace # with the number for your port.)

    Direct tty# - Any direct
  2. Enter the following commands (read the notes about each command before performing the command itself):

    pdisable tty#

    cu -ml tty#

    Restore the factory default configuration.

    In command state, echo characters from the keyboard to the screen. (Make sure carrier is not ON on the port or modem.)

    Note: You need issue only one of the following commands.

    Monitor the data terminal ready (DTR) signal. When an on-to-off transition of the DTR signal occurs, the modem hangs up and enters the command state.

    Monitor the DTR signal. When an on-to-off transition of the DTR signal occurs, the modem hangs up and resets.

    Write the storable parameters of the current configuration to modem memory.

    Track the status of the carrier detect signal. (The modem might disconnect.)

    Note: Issue the following command only if the previous command used the modem to disconnect.

    cu -l tty#

    Put the modem in autoanswer mode.

    Set the carrier-detect response time. Default is 6. Possible values are 1 to 255.

    Write the storable parameters of the current configuration to modem memory.

    Terminate the cu session.
  3. Enter one of the following commands:

    penable  tty#
    pshare   tty#
    pdelay   tty#
    pdisable tty#

The modem now has the basic configuration needed for most system communications. If you have problems, invoke cu with the cu -dl command to start a diagnostic trace on the connection.

Sending AT Commands Using a C Program

If the previous method failed, or if you do not have BNU installed, try running the following C program. Create a file called motalk.c containing the following code. Save the file. Compile and run it according to the instructions in the program comments.

/*  MoTalk - A "C" program for modem setup.                */
/*           This program is meant as an aid only and is   */
/*           not supported by IBM.                       */
/*                  compile:  cc -o motalk motalk.c       */
/*                  Usage:  motalk /dev/tty? [speed]      */
#include <errno.h>
#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
#include <termio.h>
FILE *fdr, *fdw;
int fd;
struct termio term_save, stdin_save;
void Exit(int sig)
   if (fdr) fclose(fdr);
   if (fdw) fclose(fdw);
   ioctl(fd, TCSETA, &term_save);
   ioctl(fileno(stdin), TCSETA, &stdin_save);
main(int argc, char *argv[])
   char *b, buffer[80];
   int baud=0, num;
   struct termio term, tstdin;
   if (argc < 2 || !strcmp(argv[1], "-?"))
      fprintf(stderr, "Usage: motalk /dev/tty? [speed]\n");
   if ((fd = open(argv[1], O_RDWR | O_NDELAY)) < 0)
   if (argc > 2)
         case   300: baud = B300;
         case  1200: baud = B1200;
         case  2400: baud = B2400;
         case  4800: baud = B4800;
         case  9600: baud = B9600;
         case 19200: baud = B19200;
         case 38400: baud = B38400;
         default:    baud = 0;
                     fprintf(stderr, "%s: %s is an unsupported baud\n", argv[0],argv[2]);
   /* Save stdin and tty state and trap some signals */
   ioctl(fd, TCGETA, &term_save);
   ioctl(fileno(stdin), TCGETA, &stdin_save);
   signal(SIGHUP, Exit);
   signal(SIGINT, Exit);
   signal(SIGQUIT, Exit);
   signal(SIGTERM, Exit);
   /*  Set stdin to raw mode, no echo */
   ioctl(fileno(stdin), TCGETA, &tstdin);
   tstdin.c_iflag = 0;
   tstdin.c_lflag &= ~(ICANON | ECHO);
   tstdin.c_cc[VMIN] = 0;
   tstdin.c_cc[VTIME] = 0;
   ioctl(fileno(stdin), TCSETA, &tstdin);
   /*  Set tty state */
   ioctl(fd, TCGETA, &term);
   term.c_cflag |= CLOCAL|HUPCL;
   if (baud > 0)
      term.c_cflag &= ~CBAUD;
      term.c_cflag |= baud;
   term.c_lflag &= ~(ICANON | ECHO); /* to force raw mode */
   term.c_iflag &= ~ICRNL; /* to avoid non-needed blank lines */
   term.c_cc[VMIN] = 0;
   term.c_cc[VTIME] = 10;
   ioctl(fd, TCSETA, &term);
   fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NDELAY);
   /*  Open tty for read and write */
   if ((fdr = fopen(argv[1], "r")) == NULL )
   if ((fdw = fopen(argv[1], "w")) == NULL )
   /*  Talk to the modem */
   puts("Ready... ^C to exit");
   while (1)
      if ((num = read(fileno(stdin), buffer, 80)) > 0)
         write(fileno(fdw), buffer, num);
      if ((num = read(fileno(fdr), buffer, 80)) > 0)
         write(fileno(stdout), buffer, num);
      Exit (0);

Hayes and Hayes-Compatible Modems

  1. Change the tty settings, if necessary, using the Web-based System Manager, wsm, or the SMIT fast path, smit chtty. For example, you might want to change the Enable LOGIN field to Share or Enable.
  2. Add the following line to /usr/lib/uucp/Systems file:

    hayes Nvr HAYESPROG 2400
  3. Add this to /usr/lib/uucp/Devices file:

    # For programming the  hayes modem only:
    HAYESPROG tty0 - 2400 HayesProgrm2400
    #regular ACU entry:
    ACU tty0 - Any hayes
  4. Add this to /usr/lib/uucp/Dialers file:

    # This Entry is used to PROGRAM the modem ONLY:
    # the next 3 lines should be made into one:
    HayesProgrm2400     =,-,     "" \d\dAT\r\c OK AT&F\r\c OK ATM1\r\c OK
    AT&D3\r\c OK AT&K3&C1\r\c OK ATL0E0Q2\r\c OK ATS0=1\r\c OK AT&W\r\c
    hayes     =,-,     "" \dAT\r\c OK ATDT\T\d\r\c CONNECT
  5. To program the modem, enter the command cu -d hayes. This command uses the cu command to program the modem. Because no connection is made to another system, the command will fail. The modem is programmed if sendthem AT&W and then OK got it appear in the output.

    If you are not doing binary file transfers or using BNU, leave out the &K3 command, and set XON as the flow control to be used. However, it is more efficient to use hardware flow control (as opposed to XON-XOFF handshaking). To do that, use the settings and the Dialers entries from the next step.

  6. After the modem is programmed, you can configure the system device driver to use hardware flow control. Using Web-based System Manager, wsm or SMIT (smit chtty fast path), change the flow control to RTS. Check your modem manuals to find out whether your modem supports hardware flow control.

Troubleshooting Modem Problems

This section attempts to identify common problems when using a modem with your computer.

Symptom Cause Solution
The modem (or other device attached to the serial port) causes the system to gradually slow down and eventually hang. Turning off the device usually lets the system function normally again. An intelligent modem has CD always ON. The system senses this and sends a login herald, which the modem tries to interpret as a command. The modem fails to recognize the login herald as a valid command, and echoes back to the tty port on the system. This cycle repeats continuously. Set the tty port to delay on the system so no login herald will be sent. With this setting, only a valid carriage return character from the host logging in will cause a login herald to be sent. You can also change the modem's AT set profile to set CD to ON only when a valid carrier is sensed on the telephone line.

Software Services Modem Questionnaire

Before calling for assistance with modem problems, please collect the following information:

AT Command Summary

The following is a summary of the Hayes Smartmodem command set. These commands comprise the AT command set used by many popular modems. This information comes from the Hayes Smartmodem 2400 Quick Reference Card, published by Hayes Microcomputer Products, Inc. Consult the modem documentation for a list of relevant AT commands.

AT Command prefix - precedes command line.
<CR> Carriage return (newline) character - terminated the command line.
A Go off-hook, remain in command mode.
A/ Repeat previous command line. This command is not preceded with AT or followed by <CR>/.
B0 Select CCITT V.22 standard for 1200 bps communications.
B1 Select Bell 212A standard for 1200 bps communications.
D Enter originate mode, dial the number that follows, and attempt to go online. D is usually followed by T for tone, P for pulse may also be used.
DS=n Dial the number stored in location n.
E0 Disable character echo in the command state.
E1 Enable character echo in the command state.
H0 Go on-hook (hang up the phone).
H1 Operate switch-hook and auxiliary relay.
I0 Return product identification code.
I1 Perform checksum on firmware ROM; return checksum.
I2 Perform checksum on firmware ROM; returns OK or ERROR as the result.
L0 Speaker off.
L1 Low speaker volume.
L2 Medium speaker volume.
L3 High speaker volume.
M0 Speaker off.
M1 Speaker on until carrier detected.
M2 Speaker always on.
M3 Speaker on until carrier detected, except during dialing.
O0 Enter online state.
O1 Enter online state and initiate equalizer retrain.
Q0 Modem returns result codes.
Q1 Modem does not return result codes.
Sr Set pointer to register r.
Sr=n Set register r to value n.
V0 Display result codes in numeric form.
V1 Display result codes in verbose form (as words).
X0 Enable features represented by result codes 0-4.
X1 Enable features represented by result codes 0-5, 10.
X2 Enable features represented by result codes 0-6, 10.
X3 Enable features represented by result codes 0-5, 7, 10.
X4 Enable features represented by result codes 0-7, 10.
Y0 Disable long space disconnect.
Y1 Enable long space disconnect.
Z Reset modem
&C0 Assume data carrier always present.
&C1 Track presence of data carrier.
&D0 Ignore DTR signal.
&D1 Assume command state when an on-to-off transition of DTR occurs.
&D2 Hang up and assume command state when an on-to-off transition of DTR occurs.
&D3 Reset when an on-to-off transition of DTR occurs.
&F Recall the factory settings as the active configuration.
&G0 No guard tone.
&G1 500 Hz guard tone.
&G2 1800 Hz guard tone.
&J0 RJ-11/RJ41/RJ45S telco jack.
&J1 RJ-11/RJ-13 telco jack.
&P0 Pulse dial with make/break ratio 39/61.
&P1 Pulse dial with make/break ratio 33/67.
&Q0 Operate in asynchronous mode.
&Qn Operate in synchronous mode n.
&R0 Track CTS according to RTS.
&R1 Ignore RTS; always assume presence of CTS.
&S0 Assume presence of DSR signal.
&S1 Track presence of DSR signal.
&T0 Terminate test in progress.
&T1 Initiate local analog loopback.
&T3 Initiate digital loopback.
&T4 Grant request from remote modem for remote data link (RDL).
&T5 Deny request from remote modem for RDL.
&T6 Initiate remote digital loopback.
&T7 Initiate remote digital loopback with self-test.
&T8 Initiate local analog loopback with self-test.
&V View active configuration, user profiles, and stored numbers.
&Wn Save storable parameters of active configuration as user profile n.
&X0 Modem provides transmit clock signal.
&X1 Data terminal provides transmit clock signal.
&X2 Receive carrier provides transmit clock signal.
&Yn Recall user profile n.
&Zn=x Store phone number x in location n.

S-Register Summary

Register Range Description
S0 0-255 Select number of rings before answer.
S1 0-255 Ring count (incremented with each ring).
S2 0-127 Define escape sequence character (ASCII).
S3 0-127 Define carriage return character (ASCII).
S4 0-127 Define line feed character (ASCII).
S5 0-32, 127 Define backspace character (ASCII).
S6 2-255 Select wait-time in seconds before blind dialing.
S7 1-55 Select wait-time in seconds for carrier/dial tone.
S8 0-255 Select duration in seconds of comma.
S9 1-255 Carrier detect response time in .1 second increments (10 = 1 second).
S10 1-255 Delay between carrier loss and hangup in .1 second increments.
S11 50-255 Duration/spacing of tones in milliseconds.
S12 50-255 Escape sequence guard time in .02 second intervals.
S13 -- Reserved.
S14 -- Reserved.
S15 -- Reserved.
S16 -- Reserved - functions for this register are controlled by the &T commands).
S17 -- Reserved.
S18 0-255 Test timer duration in seconds.
S19 -- Reserved.
S20 -- Reserved.
S21 -- Reserved.
S22 -- Reserved.
S23 -- Reserved.
S24 -- Reserved.
S25 0-255 Select DTR change detect time in .01 second intervals.
S26 0-255 RTS to CTS delay in .01 second intervals.
S27 -- Reserved.

Result Codes Summary

Number Word Description
0 OK Command executed.
1 CONNECT Connection established at 0-300 bps.
2 RING Ring signal detected.
3 NO CARRIER Carrier signal lost or not detected.
4 ERROR Invalid command, checksum, error in command line, or command line too long.
5 CONNECT 1200 Connection established at 1200 bps.
6 NO DIALTONE No dial tone detected.
7 BUSY Busy signal detected.
8 NO ANSWER No response when dialing a system.
9 CONNECT 2400 Connection established at 2400 bps.

Dial modifiers

The following lists and describes dial modifiers:

0-9 # * A-D Digits and characters for dialing.
P Pulse dial.
T Tone dial.
, Delay processing of next character.
! Hookflash.
@ Wait for silence.
W Wait for dial tone.
; Return to command state after dialing.
R Reverse mode.
S=n Dial number stored at location n.

[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]