Modem Technical Information [INLINE] Figure 1 - Modem System The purpose of a modem is to allow two computers to communicate with each other over a standard public switch telephone system. It accomplishes this goal by converting a digital signal, as is common in a computer system, to an analog signal that can be transmitted on the telephone system. Figure 1 shows the basic elements of this communications model. Signals A signal, in the case of modems, is a variation in electrical voltage over a period of time. In general, there are two types of signals: analog and digital. [INLINE] Figure 2 - Analog Signal [INLINE] Figer 3 - Digital Signal An analog signal (Figure 2) is a continuously varying voltage where the level of the signal at any given time can be anywhere in a range. A digital signal (Figure 3) is a discretely varying voltage where there are only two fundamental signal levels. Transition between these two states is theoretically instantaneous. Data can be encoded on the variations in signal voltage so that information can be transmitted from one place to another. A common example of an analog signal is audio, such as voice. An electrical signal representing voice data is very complex combining many frequencies and amplitudes. A computer system generally deals with digital signals. It is easy to encode binary data on a digital signal. Typically the higher voltage represents the binary value 1 and the lower voltage represents binary 0. This is illustrated in Figure 2. Modulation As mentioned earlier, the purpose of a modem is essentially to transmit digital data from one computer to another over a line that is designed for analog signals, the telephone line. The digital signal must be encoded onto an analog signal and then decoded off at the other end. This process is called modulation. The reverse process at the other end of the transmission system is called demodulation. This is in fact where the modem gets its name: (mod)ulation/(dem)odulation. Modulation is done by starting with a constant frequency, constant amplitude analog signal as is shown in Figure 4. This signal is called the carrier signal. We then modify some aspect of this carrier corresponding to changes in the digital signal that we are trying to send. The modem at the other end will be able to detect those changes and reconstruct the original digital signal. [INLINE] Figure 4 - Constant Frequency and Amplitude Signal In general, there a two types of modulation, or two ways that the base signal can be modified with respect to the digital input signal. One method of modulation is to vary the amplitude of the signal while keeping the frequency constant. This is shown in Figure 5. Figure 5a shows the digital signal that we wish to send to another computer. 5b shows the carrier signal that will be modulated. Finally, 5c shows an amplitude modulated signal. In this case we choose to represent the binary 1 by increasing the amplitude of the carrier signal. A binary value 0 is sent by lowering the amplitude of the carrier. [INLINE] Figure 5a - Digital Signal [INLINE] Figer 5b - Analog Carrier      [INLINE] Figer 5c - Amplitude Modulation The second basic type of modulation is to vary the frequency of the carrier signal with respect to the digital input. This is illustrated in Figure 6. Again we show the digital input in Figure 6a, and the carrier signal in Figure 6b. Figure 6c is the frequency modulated analog signal that gets transmitted over the telephone line. In this example we increase the frequency of the carrier to represent a binary 1 value and we decrease the frequency to represent a binary 0. [INLINE] Figure 6a - Digital Signal [INLINE] Figer 6b - Analog Carrier      [INLINE] Figer 6c - Frequency Modulation The issue of modulation in modern modems is actually much more complex than is shown here. In reality, a combination of amplitude and phase (similar to frequency) modulation is used. Part of the common modem standards, such as V.34 and V.90 involve the algorithm used to modulate a carrier signal to transmit digital data from one computer to another. Modem Components Now that we have an idea of what a modem does, it is time to look at how it does it. For all current modems, there are three major elements. These include the Controller, the Digital Signal Processor (DSP), and a Digital to Analog Converter (DAC) and Analog to Digital Converter (ADC). These components are shown in Figure 7. It is easiest to describe each part from right to left. [INLINE] Figure 7 - Modem Components DAC/ADC Digital to analog conversion and analog to digital conversion is different than modulation. Modulation, in the case of modems, is the process of generating an analog signal that encodes digital data. That analog signal can be represented as a continuously varying voltage, or it can be represented by a series of numerical values. Figure 8 shows an analog signal. We can sample the varying voltage at specific intervals and measure the voltage at each interval. We can then represent the signal by these values. [INLINE] Figure 8 - Sampled Analog Signal If we look at the voltage values at each sampling interval, we get the following string of numerical values: 5 7 10 10 8 6 7 9 8 6 ... This is a digital representation of the analog signal and is the result of an analog to digital conversion. We could also take a string a numbers such as the above and construct an analog signal by varying a voltage source according to the sampled values at the specified sampling rate. This is the result of a digital to analog conversion. An interesting side note: This is exactly how sounds are recorded onto a CD, or a wav file. The analog signal corresponding to the audio is sampled at some frequency and converted to numerical data which is stored on the CD or wav file. The original audio signal can then be retrieved using a digital to analog conversion. DSP The Digital Signal Processor is an electronic device that is capable of generating and manipulating digital representations of analog signals. It does this by being able to do fairly complex mathematical operations on numbers very fast. Controller A DSP must be told what kinds of mathematical operations to perform in order to generate or manipulate a digital signal. This is the job of the Controller. A Controller is a form of a microprocessor. It has a program that is stored in some kind of ROM. It may also have some RAM memory for temporary storage of values. The controller must know about the various protocols that the modem supports. This can include modulation protocols like V.34, V.90, K65flex, X2, etc. Other protocols might be V.42bis or MNP5 data compression, or LAPM and MNP4 error control. Putting it all Together The Controller, DSP, and DAC/ADC all work together to make a modem. Lets look at the process. Sending Data The controller receives a string of binary 1's and 0's from the computer. This is the data that is to be sent. This data may be a character that was typed, it might be part of a TCP/IP packet, or maybe part of a PPP datagram. The controller runs the data through its various algorithms for data compression and error correction. It then sends some control signals to the DSP according to the modulation method that is being used. The DSP does a lot of data manipulation and comes up with a digitized representation of the analog signal that must be sent over the phone line. The digital to analog converter (DAC) converts this digital representation to an actual electrical analog signal that gets sent out on to the telephone line. Receiving Data An electrical analog signal comes in from the telephone line. The analog to digital converter (ADC) converts this in to a digital representation. The controller gives the DSP appropriate commands so that it does some manipulation to the digital signal and comes up with the original binary data that came from the other machine. The controller runs the data through the compression and error correction algorithms and eventually gives the data to the computer in the form of 1's and 0's. Different Types of Modems While all modern modems have the three elements described above, there are different implementations. The first modem type to consider is what is often called the standard modem, or the hardware modem. This is illustrated in Figure 9. [INLINE] Figure 9 - Standard Modem In the standard modem configuration, the three major components of the modem are all implemented in hardware. The hardware usually takes the form of one or more integrated circuits that is called a chipset. UART Interface In between the modem hardware and the operating system (software) of the computer is an interface device. In a PC this device is known as a Universal Asynchronous Receiver Transmitter (UART). A similar device may also be used called an Asynchronous Communication Interface Adapter (ACIA). This piece of hardware is what makes up a serial port on a computer. Its basic function is to convert data on the computer motherboard, which is usually in a parallel format in to a serial stream of binary data. COM Port A Communications (COM) Port is an operating system abstraction. That is, the operating system defines a software resource that an application program can write and read data to and from. In the case of a standard modem, the COM port is directly associated with a UART chip. Most PCs have between two and four COM ports defined in the operating system. These COM ports are differentiated by two properties. The Interrupt Request (IRQ) line and the I/O Address. These are hardware concepts that relate directly to a UART. The IRQ and I/O Address are two things that operating system must know about so that it can correctly communicate with the UART. Internal and External Modems A standard modem either be an external unit or an internal unit. In the case of an external unit, the link between the UART Interface and the main components of the modem takes the form of a serial cable physically connecting the modem to a serial port on the computer. In PCs, this serial connection is defined by the RS-232 standard. This standard defines types of connectors that are used, the voltage and current levels used, and other physical properties. In the case of the external modem, the UART that is used is part of the computer. Often it is built onto the motherboard. Most modern computers come with two UARTs built on that can be used as serial ports for modems, serial printers, mice, etc. In Figure 9 above, the connection labeled RS is where the RS-232 serial connection would be on an external modem. On an internal version of the standard modem, All the parts of the modem, along with a UART are packaged together on a single circuit board. The board is then plugged in an expansion slot on the motherboard. Note that in the case of the internal modem, the UARTs that are built on to the motherboard are not used. Rather the modem has its own interface. The Controller-less Modem To understand the controller-less modem, we must consider what exactly the controller of a modem is. As mentioned before, it is usually some form of a micro-controller. A micro-controller is basically a small computer wrapped up in a single chip. We must also understand that modern computers have a lot of excess power relative to the applications that most consumers use. So, since the controller is basically a tiny computer, and since we have extra computing power available to us, why not let the main computer do the work of the controller? This gives us something that is correctly called a controller-less modem and is illustrated in Figure 10. [INLINE] Figure 10 - Controller-less Modem In the controller-less modem, the controller part of the modem has moved from being a hardware device to being part of the operating system. It is loaded into the operating system in the form of a driver. The interface between the operating system and the remaining parts of the modem is no longer based on a standard UART. It is generally a proprietary interface device whose specifications are defined by the modem manufacture and work exclusively with the driver software for that modem. In virtually all cases, the controller-less modem will be an internal modem. This is, in part, because the RS-232 serial standard is not able to transfer data as fast as required by the controller-less model. An important thing to note is that the operating system still defines a COM port. Remember that a COM port is really just an abstraction that presents a constant interface to the program. Therefore, the program knows absolutely no difference between a standard hardware modem and a controller-less one. Instead of there being a UART chip behind the COM port definition, there is now a piece of software that implements the functionality of the controller. Host Signal Processing Modem A third type of modem takes the basic idea of the controller-less modem and extends it. Again, to understand this modem, we must understand what a Digital Signal Processor (DSP) is. Basically, it is a device that is able to do fairly complex mathematical operations on binary data. This is something that the main computer can do itself. This will take a fair amount of processing power, but with modern computers, we often have that power to spare. Figure 11 shows what the Host Signal Processing (HSP) modem looks like. [INLINE] Figure 11 - Host Signal Processing Modem With the HSP modem, the DSP part of the modem now becomes part of the operating system along with the controller. The only hardware that is left is the digital to analog conversion circuitry and an interface. Similar to the controller-less modem, the interface on an HSP modem is proprietary and what is left of the hardware is built on a card that is inside of the computer. Again, note that the operating system still defines a COM port. Therefore, the communications program still knows no difference between the HSP modem as any other type of modem. The COM port is just a software interface to a set of drivers that implement both the controller and DSP parts of the modem. Examples: It is useful here to list some examples of each of the three types of modems. Standard Modems (internal and external) * U.S. Robotics Courier and Sportster * Zoom Dual-Mode Controller-less Modems * U.S. Robotics Sportster WinModem * Lucent LT Win Modem * Rockwell HCF HSP Modems * PcTel WinModems, Software, and Windows Modems The word WinModem is an often misused term. Technically speaking, the term WinModem refers to a specific trademark owned by U.S. Robotics/3COM. It is also used by Lucent to describe their LT WinModem. Any other controller-less and HSP modem should not be called a WinModem, however, they often are. Another common name for these types of modems is a software modem. This describes the fact that part, or most, or the modem functionality is implemented in software drivers. Sometimes controller-less and HSP modems are also called "Windows Modems." This name describes an important fact about these kinds of modems. That fact is that in general, they only work with the Microsoft Windows operating system. The reason for this is not because there are no other operating system capable enough to deal with a software modem, but rather because the manufactures of these modems typically do not write driver software for any other operating system. Analog vs Digital Service In the last couple years, the world of modem technology has changed a lot. This is particularly true when it comes to how an Internet Service Provider provisions dial-up access. Analog Modem Service Traditionally, an Internet Service Provider (ISP) would purchase the same kind of analog telephone service that a customer does. This results in an arrangement illustrated in Figure 12. [INLINE] Figure 12 - Analog Dial-Up Service The telephone system is made up central offices that service a region. Some small towns will have a single central office serving the town and the surrounding countryside. A larger city will have several central offices. The central offices are capable of providing analog lines to each customers premises. The central offices are then connected to each other with high capacity digital trunks. These trunks transmit signals in a digital format. Each signal is given a channel that can transmit 56 to 64 kbps depending on how it is provisioned. In Figure 12 we see the three basic parts of the home computer's modem. Because the ISP has analog service as well, the diagram of the ISPs modem is exactly the same. In fact, the modems may be identical. We can follow through this diagram and see what happens to the signal as it gets from the home computer to the ISP's computer system. First, the home computer produces a stream of digital 1's and 0's that represent some data. The modem's controller takes that data and modulates it by making the DSP generate a digital signal. That digital signal is then converted to an analog signal in the modem's digital to analog converter. The analog signal travels to the central office where it undergoes an analog to digital conversion. The digital signal now travels over one channel in the inter-office trunk to the other central office. At this point the digital signal is converted back to analog and sent on to the ISP. The ISP's modem converts the signal back to digital using the analog to digital converter, the controller and DSP of the ISP's modem then demodulates the digital signal and retrieves the original stream of 1's and 0's that is the data. The process is exactly the same when data is transfered from the ISP to the home computer. An important point to remember here is that there are two digital to analog conversion being done and two analog to digital conversions being done. Digital Modem Service Recently (the last several years) telephone service has grown to the point were now an ISP can get a small digital trunk direct from the telephone company. This connection comes in the form of an ISDN PRI or a channelized T1. This changes the overall picture as shown in Figure 13. [INLINE] Figure 13 - Digital Dial-Up Service There are a couple major differences when an ISP provides digital service compared to when they provide analog service. First, you will notice that the ISP's modems no longer have the part of the standard modem that does conversion between analog and digital signals. This is because the only signals going in and out are digital. The second thing to notice is that we have reduced the overall number of analog to digital and digital to analog conversion by half. DAC vs ADC An issue that is not readily obvious but very important is a difference between digital to analog conversions compared to analog to digital conversion. It turns out that it is relatively easy to convert a digital signal to analog with almost no inaccuracies. The same is not true for converting an analog signal to a digital signal. The reason for this is that analog signals are much more susceptible to noise and transmission line imbalances. Therefore, while it is easy to transmit an analog signal, the difficult part is accurately receiving a digital signal. And, if it is difficult to receive an analog signal, it becomes difficult to make sure that a conversion to digital is successful. 56K Modems The preceding paragraph is of importance when considering a 56K modem. 56K modems are a relatively new thing. They are made possible by the fact that in modern arrangements with Internet Service Providers, the only analog link in the transmission system is from the customer's home computer to the first central office. The rest of the time the signal is traveling in a channel that support 56 to 64K. An important element here is the conversion between analog and digital signals at the central office. The conversion process is quite a bit different that the conversion process in a modem. The central office uses a device called a MU CODEC. This device is able to detect 256 different analog signal levels. It represents each of the 256 levels by an 8 bit binary value. It then transmits those 8 bit numbers at a rate of 8000 Hz over a digital channel, which equals 64 kbps. As discussed in the previous section, the process of converting from analog to digital is a much more difficult process than converting from digital to analog. This is especially true at the MU CODEC. Therefore, data can be transmitted faster in the direction where the conversion is from digital to analog. This is where a basic property of 56K modems comes from where "download" speed can be up to 56 kbps while "upload" speeds are limited to 33.6 kbps. Modem Limitations and Issues Now that we have covered the basics of how modems work, one should be somewhat impressed that they work at all. The following is a list of factors that must be considered in successful modem communications. * Modem Code: Whether the modem is a hardware or software modem, there is modem controller and DSP code. This code determines the implementation of standard protocols (V.34, V.90, etc.). This modem code exists both on the home computer modem and on the ISP modem system. To have a successful connection, these two systems must have a compatible notion of how these standard protocols work. Right now, 56K modem code is still rather unstable. This can be seen by the fact that modem manufactures for both home computer modems and ISP servers update their code frequently. It becomes very important to have the most recent controller code on your modem. Otherwise, your modem and the providers modem will not understand each other very well. * Analog Lines: In today's digital environment, the only time that modem signals are in an analog form is between the home computer and the central office. Analog signals, however, are susceptible to a very wide range of problems. There can be noise as a result of bad connections or crosstalk with other electro-magnetic signals. There can be an imbalance in the transmission system such that some frequencies get distorted or attenuated causing the signal can look very different coming out compared to the way it looked going in. These problems can be worse in older parts of town were the telephone wiring is bad. They can also be worse in newer parts of town were the phone company has done some trickery to multiplex multiple phone lines into one. * Digital Lines: In general, signals don't have as hard of time in a digital transmission system. However, the telephone company must do an amazing amount of switching to multiplex signals from many places going to many places. Sometimes these switching systems may mess up. Sometimes an inter-office trunk may be bad and go unnoticed for a while. * Computer Issues: The state that a persons computer is in can also play a role in how well modem communications work. This is especially true if a software modem is used. Software modems require a more powerful computer to run the controller and possibly DSP drivers in addition to the actual programs that are being used. This also requires a certain amount of multiprocessing. Most software modem drivers are written for Microsoft Windows or Macintosh environments. Neither of these operating systems are particularly well known for their multiprocessing abilities. And the more software and drivers that are installed on a system the greater the potential is for problems. A well maintained system will probably work better. The average consumer's computer, however, is anything but well maintained.