In order to understand how data passes from a computer to a modem, you need to know what these devices are called from an interface standpoint. A computer is considered a terminal. It will originate and terminate data. The DB-9 interface on the back of your computer is, therefore, Data Terminal Equipment (DTE).
The modem connected to your PC does not generate any data of its own. It merely takes the output of the PC and modulates it into a form that can be easily transmitted over a long distance. The (usually) DB-25 (RS-232) interface on the modem is considered Data Communications Equipment (DCE). DCE is also sometimes called Data Circuit-terminating Equipment, however, most people will understand both terms.
If you look closely at the two interfaces, you will notice two differences. The first is size. Because of the constraints of PCB layout, most multifunction devices will use the smallest interface possible while a device dedicated to one job will usually have the larger DB-25 connector.
The second difference is in the pins. The computer will have pins sticking out (male) and the modem will have holes to accept these pins (female). Virtually every DTE interface will be male while DCE will be female. The explanation given me is that a (male) DTE will send data out and a (female) DCE will accept data in. You can draw your own conclusions about the sexist nature of that statement, but it does make things easier to remember.
Basic Control Leads - DTR/DSR
When a computer wants to send data across a DTE interface, it needs to know that something will be waiting on that interface to accept the data. This is accomplished via the Data Terminal Ready (DTR)/Data Set Ready (DSR) handshake. These two leads tell the DTE and the DCE that the interface is wired to another interface, and that the equipment on the end of that wire is on.
The simplest explanation is that as soon as you turn on DTE, the DTR lead "goes high", meaning that a voltage is applied to it. The voltage and polarity applied depends on the specific standard of the interface and the manufacturers implementation of that standard. The voltage will continue to remain in this state until the DTE is turned off. The voltage, when detected by the DCE, signifies that the DTE is present and operational.
DSR, like DTR, goes high as soon as the equipment is powered on. The difference is that powering on the DCE activates DSR. You may be wondering why DSR is used vice DCR. The answer is that, back in the day, DCE was often called the "Data Set". Regardless of the acronym used, voltage is applied to DSR by the DCE and is detected by the DTE. The DTE then knows that DCE is present and operational.
More Control Leads - RTS/CTS/DCD
How fast does your can your computer send data across the serial port? Most serial ports top out at 115kbps. Now, how fast can your modem talk to your ISP? My modem connects at about 45kbps. What would happen if your computer started slamming data to your modem as fast as it could? There are two systems in place to prevent such a mess.
The first system is an internal buffer in the modem. Usually this is a very small amount of RAM, which stores data coming from the PC until it can be dumped to the analog line. The second system is the Request To Send (RTS)/Clear To Send (CTS) handshake.
The DTE has data waiting for transmission. Before sending this data, it needs to verify that the data will go somewhere. The DTE will apply a voltage to the RTS lead. When the DCE detects the voltage, it checks the internal buffer. If the buffer is not full, the DCE will apply voltage to the CTS lead. As soon as the buffer is full, the CTS lead will go low.
Just having data in the buffer does no good if the two modems are not connected. That is where the Data Carrier Detect (DCD) lead comes in. The AT commands, which are intercepted by the modem, trigger the modem to dial. When the modem detects an answer, it will attempt to establish a carrier. A carrier is the un-modulated wave that will carry the data between the two modems. As soon as the carrier is up, the DCE will apply voltage to the DCD lead. The DTE detects the voltage on the DCD lead and knows that the modem will pass any data to the distant end modem.
Now that the DTE sees both the DCD and the CTS leads as being high, it knows that it can slam data over to the DCE. When the DCE buffer is full, CTS goes low. The DTE sees CTS go low and it stops sending data. However, as long as the DTE buffer has data waiting to go out, the RTS lead will stay high.
Data Transmission - TD/RD
Ok, our DTE is on and has data in the buffer. The DTE applies voltage to the DTR and the RTS leads. The DCE has detected AT commands triggering a dial and has established a connection to the ISP. The DCE applies voltage to the CTS and the DCD leads. The DTE detects CTS and DCD. So now what?
Well, that's where the Transmit Data (TD) lead comes in. The purpose of this lead is to transport 1's and 0's from the DTE buffer to the DCE buffer. It does this by applying positive voltage to represent a "1" and no voltage to represent a "0". Before you go off on me, I do know it is more complicated than that, but this explanation will suffice.
The DCE reads the voltage from the TD lead and converts that to 1's and 0's in the buffer. What happens between the buffer and the analog line is going to have to wait for another day.
The DCE, upon receiving information from the ISP, takes that information and converts it to voltages that are then applied to the Receive Data (RD) lead. The DTE detects the voltages on the RD lead and then converts that into 1's and 0's which are then passed up the OSI layer to eventually end up as whatever you requested.
The relationship between DTE and DCE can be very complex. While I have tried to simplify this to the basics, it can still seem overwhelming. The basic thing you should be able to take away is an understanding of what the blinking lights mean. DCD, for instance, means that your modem has negotiated a connection with your ISP. Once you understand what they mean, the next important thing it to understand the direction of the signal. For instance, TD is an output on your computer and an input on your modem.
Assuming this article is accepted, I plan on writing other articles explaining how the modems modulate a carrier to pass data and how asynchronous and synchronous lines differ. From there, maybe details on how to build your own cables and what a "null-modem" cable does. Post some suggestions on things you'd like explained. If it deals with communication, I've probably done it. If I have done it, then I'd be happy to write about it.
Glossary of Terms
DTE - Data Terminal Equipment
DCE - Data Communications Equipment
DTR - Data Terminal Ready
DSR - Data Set Ready
DCD - Data Carrier Detect
RTS - Request To Send
CTS - Clear To Send
DB-9/25 - "DB" refers to the D-shaped connector on most communications equipment. It takes some imagination to see the connector as being D-shaped. Your best bet is to take my word for it:) The "9" or "25" is the pin count. For example, a DB-9 has a row of 5 pins and a row of 4 pins for a total of 9 pins.