Commonly used serial cables fall into one of the two following general categories:
Straight-through serial cables are used to connect unlike devices (DTE to DCE). A straight-through cable is just what it sounds like—each pin on one connector connects to the corresponding pin on the other. On a DB25-to-DB25 or DB9-to-DB9 cable, this means that each pin on one connector connects to the same pin number on the other. On a DB9-to-DB25 cable, the wires connect different pin numbers, but the same signal. For example, DTR (Pin 20 on the DB25) is connected to DTR (Pin 4 on the DB9). Almost any cable with a DB9 connector connects all nine pins. DB25 cables may have all or only some pins connected, but the existing connections are straight-through.
Cross-over serial cables are used to connect like devices (DTE to DTE, or DCE to DCE). Cross-over cables come in an amazing variety of pinouts, some reasonably standard and others specific to one particular type of connection—e.g., an HP LaserJet serial port to a DB25 PC serial port. The term null-modem cable is often misused to mean any cross-over cable, but a null-modem cable is really just one variety of cross-over cable.
PC serial ports are usually configured as DTE. Modems, mice, trackballs, digitizers, and scanners are usually DCE devices, and so connect to a PC with a straight-through cable. Serial printers and plotters are usually DTE devices, and so connect to ...