This is an edited and condensed excerpt from The Modem Reference, written by Michael A. Banks and recommended by the Associated Press, The Smithsonian Magazine, Jerry Pournelle in Byte, et al. The right to reproduce this article is granted on the condition that all text, including this notice and the notice at the end of the article, remain unchanged, and that no text is added to the body of the article. Thanks! --MB Copyright (c), 1988, 1989, 1990 Michael A. Banks All Rights Reserved (From Chapter 3) DATA TRANSMISSION MODES Now that you have a good understanding of the basics of data transmission (you did read the companion file to this one), we'll examine the major modes such transmission can take. The binary signals that must be transmitted for each data character can be sent simultaneously (parallel transmission) or one at a time (sequentially, in serial transmission). Parallel Transmission Parallel data transmission involves sending all of the bits that make up a character at the same time, using a separate wire for each bit. In parallel transmission, each bit in a character is sent as shown in Figure 3.13 in THE MODEM REFERENCE. This involves eight data bits, and thus eight wires. A ninth wire is used to send a special signal called a "strobe" or clock. This signal is sent after all 8 data bits are sent, to inform the receiving device that all bits have been sent. Data transmitted in this manner is not modified before or after transmission. Parallel transmission is commonly used to send data from a computer to a printer or another device located relatively nearby. Longer runs for parallel transmission are not very cost- effective, because of the number of wires involved as well as the more complex transmission equipment required. Serial Transmission When data is transmitted in serial format, each character's bits are sent individually, over a single wire. Some modification is required to prepare data for serial transmission, because the data a computer sends to its serial port is in parallel format. The serial port must convert this parallel data to serial format (using what are called shift registers). Among other things, this involves "lining up" the data bits in series, beginning with the lowest-value bit. At the receiving end, the serial port has to sort out the bits and return them to parallel format. Figure 3.14 illustrates how serial data transmission works. When compared with parallel transmission, serial data transmission would appear to be at a disadvantage. It requires special circuitry and other accommodations, and is somewhat slower than parallel transmission. Too, serial data must be synchronized, which sometimes means adding bits to each character. However, using one wire to send data is far less costly than using eight. Furthermore, the standard voice telephone system (noted earlier as the medium used for most telecomputing) can't accommodate parallel data transmission because it provides only two wires. So, serial transmission is the norm for telecomputing when two-wire (or four-wire), voice-grade telephone lines are involved. Synchronization. The sending and receiving systems must be synchronized during serial transmission, so that individual bits and full characters can be recognized and sorted out by the receiving system in the same pattern as they were sent. Without synchronization, the receiving system would perceive data as a seemingly-endless series of unrelated binary digits, with no indication of where one character ended and the next began. There are several modes of synchronization available. You'll probably encounter only two of them--synchronous and asynchronous. In data communication via microcomputer, these are virtually the only synchronizing modes in use. Synchronous transmission. Synchronous data transmission involves a continuous and consistent (in time) transfer of data. The duration of and time between each bit or character sent is preset by the sending and receiving systems. This provides a way for the receiving system to know when to look for each character as well as how long it will take to transmit a character. Modems that can be synchronized in this manner are called synchronous modems. Depending on the protocol used, time synchronization is usually effected by a special information signal that precedes a data transfer or by information contained in a group of bytes (called a block). This signal enables the systems to synchronize their internal clocks, and may come from the computer or the modem. For reasons discussed in the next section, synchronous transmission can be up to 20% faster than asynchronous transmission. But it requires more expensive equipment. (The expense is largely due to the additional circuits and programming required to synchronize timing.) Asynchronous transmission. Asynchronous transmission is a data transfer mode that notifies a receiving system when each character begins and ends by "framing" bytes with additional bits. These extra bits include a start bit and a stop bit, which are discussed in detail in the next section (DATA TRANSMISSION PARAMETERS). Modems that operate in asynchronous mode are called asynchronous modems, or asynchronous communications adaptors. As noted a few lines back, asynchronus transmission is a bit slower than synchronous transmission. (One reason for this is the presence of start- and stop-bits.) The advantages of asynchronous transmission far outweigh the loss in speed, however. Because no timing circuits are required, asynchronous modems are less expensive than their synchronous counterparts. Too, they are generally more "tolerant" of line noise, delays in sending, and so forth. So, you'll find the majority of modems used with microcomputers to be asynchronous; because of this the majority of dial-up systems (BBSs and online services) also operate in asynchronous mode. # There are modems that operate in both synchronous and asynchronous mode. However, unless you are communicating with mainframe computers, Local Area Networks (LANs), or other systems that use synchronous data transfer, your telecomputing needs will probably dictate an asynchronous modem. Digital Data Transmission When a data communications system is not restricted by the frequency bandwidths and other limitations of a voice-grade telephone system, digital transmission can be used. In digital data transmission, data does not have to be translated to analog format. Instead, it is sent as binary signals, just as it would be during a direct data transfer between two computers using a null-modem cable. This kind of transmission accommodates extremely high baud and bps rates, but there are tradeoffs. Digital transmission requires special interfaces or modems, and is generally used only with digital dial-up networks. Such networks use special conditioned lines and switching equipment to maintain the integrity of the digital signals they carry, and are extremely expensive to build and maintain. DATA TRANSMISSION PARAMETERS In a very general sense, this book is not unlike a data communications link. I am communicating certain information and ideas to you; this book is the vehicle for that communication, just as the a data link is the vehicle computer-to-computer communication. You can understand the information and ideas herein because I write in a language you understand, and conform to certain rules of grammar and syntax. (Whether that information is useful to you or not is irrelevant to the topic; as I said early in the chapter, we are more concerned here with the form of information than with its content.) In short, we agree as to the parameters of our communication; thus we communicate. Computers must likewise agree on communications parameters. There are several important data communications parameters that define the operation and characteristics of a data communications system. They include the following: * the number of bits transmitted for each character * how (or if) data is checked for errors * when each character transmission begins and ends * whether your system or the remote system displays what you type on your screen * the speed at which transmission takes place The parameters are data bits, parity, start- and stop-bits, duplex, and speed. As you probably know, computers are quite literal devices, and, unlike humans, do not tolerate deviations from rules. So, each of the parameter settings must be set to the same value on both systems. Parameter settings are altered via commands to your modem or communications software, and it is normally up to you to match a host system's communications parameters. Now, let's take a look at each of the parameters. Data Bits The phrase "data bits" refers to the number of bits (binary digits) sent for each data character transmitted, not counting parity, start, or stop bits--which are explained in a few paragraphs. This parameter is sometimes called "data word length" or "character length." Depending upon what's being transmitted, either seven or eight bits are used. The number of data bits used is set by a software command; the computer's serial port does the actual configuring of data before it is transmitted. Each of the first 128 characters in the ASCII character set can be represented by seven-digits binary numbers (that is, the binary counterparts of the numbers 0 through 127 are each composed of seven or fewer digits). The majority of data communication uses only the first 128 ASCII characters, because all systems have these characters in common. So, much data transmission takes place using the 7-bit ASCII characters 0 through 127. Seven bits are used whether or not the character actually uses seven places/digits (i.e., leads off with a "1" in the seventh place, as is the case with 1100010--a decimal 98, which is the ASCII number for a lower case "b"). When necessary, 0's are added to fill out the binary number to a full seven digits-- as with 111111 (a decimal 63, the question mark character on the ASCII table.) This binary number is sent with a leading zero, thus: 0111111. If special characters from an extended ASCII character set are used (ASCII numbers 128 through 255), eight data bits must be used. This is because each of the binary numbers 128 through 255 are composed of eight binary digits, each leading off with a 1. 8-bit transmission must be used with special binary file transfer protocol transfers, too, as you'll learn when we discuss these protocols. Parity Parity is an extremely simple (and not quite perfect) way for a receiving computer to determine whether a data character has been properly received. (This error checking, by the way, is quite apart from special error-checking file transfer protocols, which we'll get to later in the book.) There are two types of parity checking: Even/Odd and Mark/Space. Almost all communications software packages allow you to change the parity setting (the choices available depend upon the type of parity checking in use). More systems use Even/Odd parity than Mark/Space parity. Even/Odd parity. Even/Odd parity works by checking whether the sum of the 1s in a string of bits is even or odd. The settings available with most communications programs are "Even," "Odd," or "None." (When "none" is selected, parity checking is effectively "turned off.") When Even/Odd parity checking is used, the sending computer adds up the 1's in each binary number it sends, and determines whether their sum is odd or even. It then adds an extra bit, known as the parity bit, to the character at its serial port. (As with other data bits, the parity bit can be either 0 or 1.) The purpose of the parity bit is to make the sum of the 1s in the character even or odd, as called for by the current parity setting. For example, if the letter "A" (1000001) is sent under even parity, a 0 is added as the parity bit--making it 10000010. This is because the sum of the 1s in the binary number is already even. If the same data character is sent under odd parity, a 1 is added as the parity bit, so that the sum of the 1s in the character would be odd. (Thus, the character would be transmitted as 10000011.) The receiving computer checks the sum of the 1s--counting the parity bit as well as the bits making up the character. If the total doesn't agree with the parity setting (even or odd), it signals the transmitting computer to resend the character (provided its software supports this). The extra parity bit is "stripped" and ignored when it is sent to the software from the serial port for "end use." Most systems that use 7-bit communication use even parity, while systems that use 8-bit communication use no parity. (Parity-bit checking is theoretically possible with 8-bit communication, but not practical.) Although it is generally effective, parity checking has its shortcomings. It can detect a "dropped" or garbled bit only if the bit is a 1. And if more than one 1 is dropped, the parity check may sometimes pass the defective character anyway, because the sum of the 1s still agrees with the parity setting (as when two 1s are dropped when the parity is set to "even"). A parity bit is transmitted at the end of a seven-bit character as shown in Figure 3.15. (NOTE: As I noted during the discussion of binary signals earlier in this chapter, a character's data bits are transmitted in reverse order. This is so both the sending and receiving serial ports can calculate the number of 1s in each character as the character is sent.) Mark/Space parity. Mark/Space is even simpler than Even/Odd parity checking. When Mark/Space parity is used, the sending system puts either 1 or 0 in the parity bit's "slot." The receiving system looks for the parity bit to be a 1 or a 0, as appropriate with active setting. When set to "Mark," the parity bit must be 1; when set to "Space," the parity bit must be 0. As with Even/Odd parity, parity is checked, and parity bits added and stripped, at the systems' serial ports. Start- and Stop-Bits When data are transmitted in asynchronous mode (as will be the case in any telecomputing applications you are likely to encounter), there may be varying time lapses between the transmission of characters. Thus, the receiving modem cannot rely on a set time frame between the end of one character and the beginning of another to know when to look for the new character. This problem is solved by the use of special bits--called start bits and stop bits--added to the beginning and end of a data character. Start bits. A start bit marks the beginning of a new string of bits (i.e., a new character). A start bit is always a 0. This is because the normal "state" of a modem when it is not sending data is the equivalent of a digital 1, or negative voltage. When a 0, or positive voltage comes through after a period of no transmission, the receiving system knows that a new character transmission has started. Stop bits. To let the receiving modem know when the transmission of a string of bits is complete, the sending computer adds a stop bit to the end of a character (following the parity bit, if any). The stop bit provides a timing "bench mark" whereby the receiving modem knows when a complete character has been sent. This bench mark involves the baud rate, which is tied to the time it takes for the sending system to send each bit (i.e., make a change in state from high to low, or 0 to 1). The timing of a stop bit is entirely dependent upon the baud rate. Most systems use either one or two stop bits; one stop bit is by far the most common. Figure 3.16 shows the placement of the start and stop bits in a transmitted data character. Duplex Duplex is one of those unfortunate terms that has two meanings. It has one meaning as a parameter setting, and another as a transmission mode. Worse, there are several other terms used in place of duplex when it is used as a parameter. (Don't worry--I'll untangle this mess for you. Of course, if you've been computing for a while, this sort of dichotomy is not new to you, I'm sure.) As a parameter or a mode, duplex has two settings: full- duplex and half-duplex. Duplex parameter. As a parameter setting, duplex is used to determine whether the computer you've dialed up echoes the characters you type at your computer's keyboard back to your computer for display. When you set your software to full-duplex, it expects the remote system to echo characters back to you. When you set your software to half-duplex, it echoes the characters you type. Naturally, the remote system's duplex setting should agree with your system's. Looking at it another way, a system set to full-duplex is responsible for echoing characters back to its counterpart, but not to its own screen. A system set to half-duplex echoes no characters back to the remote system, but echoes characters to its own screen. Obviously, when the remote system is set to full-duplex, your system should be set to full-duplex. Otherwise, both your computer and the remote system will be echoing characters to you, and you'll see double characters, lliikkee tthhiiss.. Conversely, if the remote system is set to half-duplex, and your system is set to full-duplex, no characters are echoed to your screen and you will not see what you type. So, duplex modes must match. In this context, duplex is more properly referred to as echo, or echoplex, with local echo/remote echo or echo/noecho as the available settings. (A very few software packages call duplex mode, with the half and full as the available settings.) Most BBSs and dial-up systems operate in full-duplex, which means that you should set your system to full duplex (or to remote echo or noecho) as well. Many systems that operate in half-duplex (such as GEnie) can be changed to communicate with your computer in full-duplex by a simple online command. Duplex mode. As a transmission mode, duplex determines whether or not data is transmitted in two directions at once. In full duplex mode, data flows in both directions at once (two different carrier signals are used). In half duplex mode, data flows in only one direction at a time. When half duplex mode is in effect, each system must signal the other when it has finished transmitting data and is ready for a reply. All of this back-and-forth happens at the speed of light, so of course you'll notice no perceptible delay at turnaround. Duplex mode is dependent upon modem capability. Some modems operate at either half or full duplex, while others operate at only half duplex or only full duplex. The majority of modem data communication--especially communication involving BBSs and online services--takes place in half duplex transmission mode (data is transmitted in one direction at a time), due to the limitations imposed by telephone line bandwidth. Leased line modems, on the other hand, typically communicate at full duplex (data transmitted in both directions at once). # (A reminder: When you set duplex with the majority of software packages, you aren't changing the transmission mode, but the echo mode. For the dialup applications discussed in this book, you will be dealing exclusively with the echo mode.) Speed There is a lot of confusion about modem transmission speed. I strongly suspect this is a result of the fact that it's easier to say "baud" than "bits per second," though misinformation has a hand in it, too. If you've ever found yourself confused by the relationship of bits and bauds, or if you think that a modem's baud rate is the same as bits or characters per second, please read this section carefully; I guarantee to clear up the confusion and disabuse you of any false concepts ... Bits per second (bps). Bits per second is a measure of the number of bits transmitted each second in a communications channel. This is sometimes referred to as "bit rate." While a modem's bit rate is tied to its baud rate, the two are not the same, as explained below. Baud rate. Baud rate is a measure of the number of times per second a signal in a communications channel varies, or makes a transition between states (states being frequencies, voltage levels, or phase angles). One baud is one such change; thus, a 300 baud modem's signal changes state 300 times each second. Determining bits per second. Depending on the number of states used in a communications system, one change of state can transmit one bit--or more or less than one bit. The number of bits a modem transmits per second is directly related to the number of bauds that occur each second, but the numbers are not necessarily the same. To illustrate this, first consider a modem with a baud rate of 300, using a transmission technique in which one change in state (baud) transmits one bit. The bps rate is also 300: 300 bauds per second X 1 bit per baud = 300 bps This describes exactly the process used by FSK--the modulation technique used with 300 baud modems that conform to the Bell 103 standard. Only one change in state--from ON to OFF- -is required to send a bit when FSK is used. Similarly, if a modem operating at 1200 baud were to use one change in state to send each bit, that modem's bps rate would be 1200. (There are no 1200 baud modems, by the way; remember that. This is only a demonstrative and hypothetical example.) Now, consider a 1200 baud modem using a modulation technique that requires two changes in state to send one bit, which can also be viewed as 1/2 bit per baud. This modem's bps rate is only 600: 1200 bauds per second X 1/2 baud per bit = 600 bps To look at it another way, bits per second can also be obtained by dividing the modem's baud rate by the number of changes in state, or bauds, required to send one bit: 1200 baud --------------- = 600 bps 2 bauds per bit Lest I mislead you into thinking that "any 1200 baud modem" should be able to operate at 2400 bps with a two-bits-per-baud modulation technique, remember that I said there are no 1200 baud modems. Medium- and high-speed modems use baud rates that are lower than their bps rates. Along with this, however, they use multiple-state modulation to send more than one bit per baud. For example, 1200 bps modems that conform to the Bell 212A standard (which includes most 1200 bps modems used in the U.S.) use a phase modulation technique that transmits four bits per baud. Such modems are capable of 1200 bps operation, but not 2400 bps because they are not 1200 baud modems; they use a baud rate of 300. So: 300 baud X 4 bits per baud = 1200 bps or 300 baud ------------------ = 1200 bps 1/4 baud per bit Similarly, 2400 bps modems that conform to the CCITT V.22 recommendation (virtually all of them) actually use a baud rate of 600 when they operate at 2400 bps. However, they also use a modulation technique that transmits four bits per baud: 600 baud X 4 bits per baud = 2400 bps or 600 baud ------------------ = 2400 bps 1/4 baud per bit Thus, a 1200 bps modem is not a 1200 baud modem, nor is a 2400 bps modem a 2400 baud modem. To continue this demonstration, 9600 bps modems operate at 2400 baud, but use a modulation technique that yields four bits per baud: 2400 baud X 4 bits per baud = 9600 bps or 2400 baud ------------------ = 9600 bps 1/4 baud per bit # If nothing else, I hope the examples here have shown you just why baud rate is not always equivalent to bps rate. (And if anyone who tries to sell a modem to you tells you otherwise, you'll do well to take your business elsewhere.) When you're considering a particular modem for purchase, look for its bps rate, rather than its baud rate. Characters per second (cps). Characters per second is the number of characters (letters, numbers, spaces, and symbols) transmitted over a communications channel in one second. Cps is the bottom line in rating data transmission speed, and a more convenient way of thinking about data transfer than bauds or bits. Determining the number of characters transmitted per second is easy: simply divide the bps rate by the number of bits per character. You must of course take into account the fact that more than just the bits that make up the binary digit representing a character are transmitted when a character is sent from one system to another. As illustrated a few pages back in Figure 3.16, up to 10 bits may be transmitted for each character, whether 7 or 8 data bits are used. In asynchronous data communication, the number of bits per character is usually 10 (either 7 data bits, plus a parity bit, plus a start bit and a stop bit, or 8 data bits plus a start bit and a stop bit). Thus: 300 bps ----------------------- = 30 characters per second 10 bits per character 1200 bps ----------------------- = 120 characters per second 10 bits per character 2400 bps ----------------------- = 240 characters per second 10 bits per character Common speeds. The most commonly-used communications rates for dial-up systems (and hence the most commonly available modem speeds) are 300, 1200, and 2400 bps. A few older systems-- especially Telex systems--communicate at 110 bps, but these are gradually going the way of the dinosaur. 4800 and 9600 bps modems are generally available, but few online services or BBSs accommodate them. This will change in the near future, however, with the cost of high-speed modem technology decreasing as the demand for it increases. Modems with even higher bps rates are manufactured (19,200 and up) but it is doubtful that you will be accessing dial-up systems capable of more than 9600 bps (if that). The upper limit on asynchronous data transmission via voice-grade telephone lines appears to be 9600 bps. The use of higher transmission rates requires special dedicated lines that are "conditioned" (i.e., shielded from outside interference) as well as expensive modulation and transmission equipment. # Those are the basics of what goes on behind the scenes in data communications. If you've read all of this chapter (and I hope you have), my congratulations; you're now more knowledgeable in the ins and outs of data communications than the average modem user (and most computer salespeople, for that matter). The knowledge you've gained here will enable you to make optimum use of your modem and communications software. Combined with the information in the next chapter, it will also help you make an informed decision when you buy a modem. # If you found this excerpt useful, you may want to pick up a copy of the book from which it was excerpted: THE MODEM REFERENCE by Michael A. Banks Published by Brady Books/Simon & Schuster ISBN # 0-13-586646-4 $19.95 In addition to explaining the technical aspects of modem operation, communications software, data links, and other elements of computer communications, the book provides detailed, illustrated "tours" of major online services such as UNISON, CompuServe, DELPHI, BIX, Dow Jones News/Retrieval, MCI Mail, and others. It contains information on using packet switching networks and BBSs, as well as dial-up numbers for various networks and BBSs, and the illustrations alluded to in this excerpt. You'll also find hands-on guides to buying, setting up, using, and troubleshooting computer communications hardware and software. (And the book "supports" all major microcomputer brands.) For more information, contact: Michael A. Banks P.O. Box 312 Milford, OH 45150