Modems provide serial communications across ordinary telephone lines. This section discusses modem standards, general modem setup, and specific configuration tips for popular modems.
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).
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 link between the computer and the modem should be set to 57,600 bps.
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.
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.
To set up a modem:
Use the System Management Interface Tool (SMIT) to define a tty port for the device attachment. Most fields are for the general device type. The only field that can affect the modem is the Enable LOGIN field with the following values:
Fields specific to the 128-port asynchronous adapter:
Force Carrier or Ignore Carrier Detect | disable* |
Perform Cooked Processing in Adapter | disable |
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.
Following are some examples of cable connections:
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.
Use only one of the two methods presented in this section for configuring the modem. If you have Basic Networking Utilities (BNU) installed, see Sending AT Commands with the cu Command. If you do not have BNU installed, see Sending AT Commands Using a C Program. For information on installing BNU, see Basic Networking Utilities.
If you have the Basic Network Utilities (BNU) installed, use the cu command to configure a modem as follows. The commands and settings discussed in this section configure a Hayes-compatible modem with the basic parameters needed for operation on the server's serial ports.
Direct tty# - Any direct
pdisable tty#
cu -ml tty#You should see a message that says Connected.
ATThe modem should respond with OK. If it didn't, refer to Troubleshooting Modem Problems.
For additional AT commands and their descriptions, see AT Command Summary.
The modem is now configured with the basic commands needed to perform most of the operating system's serial communications needs. If you have problems, invoke the cu -dl to start a diagnostic trace on the connection.
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); close(fd); ioctl(fileno(stdin), TCSETA, &stdin_save); exit(sig); } 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"); exit(1); } if ((fd = open(argv[1], O_RDWR | O_NDELAY)) < 0) { perror(argv[1]); exit(errno); } if (argc > 2) { switch(atoi(argv[2])) { case 300: baud = B300; break; case 1200: baud = B1200; break; case 2400: baud = B2400; break; case 4800: baud = B4800; break; case 9600: baud = B9600; break; case 19200: baud = B19200; break; case 38400: baud = B38400; break; default: baud = 0; fprintf(stderr, "%s: %s is an unsupported baud\n", argv[0],argv[2]); exit(1); } } /* 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 ) { perror(argv[1]); exit(errno); } if ((fdw = fopen(argv[1], "w")) == NULL ) { perror(argv[1]); exit(errno); } /* 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 Nvr HAYESPROG 2400
# For programming the hayes modem only: HAYESPROG tty0 - 2400 HayesProgrm2400 #regular ACU entry: ACU tty0 - Any hayes
# 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 OK hayes =,-, "" \dAT\r\c OK ATDT\T\d\r\c CONNECT
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.
This section attempts to identify common problems when using a modem with your computer. Keep in mind the following points:
Not having the modem reset also protects changes when &C1 is set. Changing the Carrier Detect status may cause the carrier detect line to toggle on some modems, which causes the cu command to drop the line. You may want to set up the modem to &D3 after the final setup is made.
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. |
Before calling for assistance with modem problems, please collect the following information:
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.
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 hang-up 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. |
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. |
The following lists and describes dial modifiers: