In this example, the sender transmits each bit on the rising edge of the clock. The receiver latches the data signal on the trailing edge of the clock. In this manner, race conditions between the two are avoided. Every clock cycle, a single bit is transferred.
It is also possible to combine the clock and data signals together into one:
In this example, every zero bit is encoded as a full clock cycle, while one bits are encoded by skipping a transition in the middle of the cycle. The decoding circuitry is more complex, but fewer wires are required in this scheme.
In any event, such serial links are termed synchronous because the data signal is synchronized with a clock signal. Most serial links are synchronous; low speed modems and printers form the exception.
Typically, one side of the link provides clocking (gives clock) for data traveling in both directions. The other side of the link takes clock. If a telephone company (telco) leased line is involved, the telco will give clock, since the data must be carefully synchronized as it moves through the telco's network.
Asynchronous links lack any form of clock signal. Rather, a start bit is used to signal the beginning of a transmission. Once the receiver has seen the start bit, it begins counting bit times according to the pre-configured line speed:
Without an explicit clock signal, the receiver risks gradually losing synchronization with the sender. For this reason, almost all asynchronous links transmit only a single byte at a time. The next byte requires a new start bit to re-synchronize the sender and receiver.
Asynchronous links, since they lack clocking, require the sender and receiver to agree on the bit speed of the link. If they do not agree, for example if the sender transmits at 14.4 kbps but the receiver is configured for 9.6 kbps, gibberish will result, as almost anyone with an external modem has experienced from time to time.
No matter what kind of serial lines are in use, the bits and bytes transferred over them must be grouped together into packets. The beginning and end of each packet must be clearly delineated, usually a checksum will be included to ensure the packet is undamaged, and often a type field is required to differentiate between, say, an IP packet and one for IPX.
Most serial links use HDLC or some varient of it. Dialup modem lines first used SLIP, but PPP is now preferred. Both are HDLC-based, but PPP is more elaborate, supporting dynamic address assignment, on-the-fly data compression, and multiple network-layer protocols. In addition to data compression, header compression is also supported.