CSMA/CD is a modification of pure Carrier Sense Multiple Access (CSMA). The CSMA/CD - Carrier Sense Multiple Access with Collision Detection is a network access technology that enables devices of Ethernet based LANs to check the channel for carrier availability before beginning to transmit data. A device transfers information in absence of a carrier. A collision occurs when two stations try to transmit at the same time and is resolved when a device transmits data after a random time interval.
CD (collision detection) defines what happens when two devices sense a clear channel, then attempt to transmit at the same time. A collision occurs, and both devices stop transmission, wait for a random amount of time, then retransmit. This is the technique used to access the 802.3 Ethernet network channel. This method handles collisions as they occur, but if the bus is constantly busy, collisions can occur so often that performance drops drastically. It is estimated that network traffic must be less than 40 percent of the bus capacity for the network to operate efficiently. If distances are long, time lags occur that may result in inappropriate carrier sensing, and hence collisions.
Theory Behind CSMA/CD
Imagine you are with a group of friends and having a discussion. Each
of your friends could be classified as a device on the network. At
any one point in time only one person will be speaking (transmitting),
and others will be listening (receiving). When one person finishes
talking, the other people will see a blank spot in the speech and
attempt to speak, and so keeping the conversation going.
If two people attempt to talk at the same time (collision), then both will stop, and then will wait for a random period (backoff algorithm) of time before speaking again. This will ensure that both get to say what they want to say, but one at a time and with no overlapping of what they are trying to say.
Retransmission Back-Off
An overview of the transmit procedure is shown below. The transmitter
initializes the number of transmissions of the current frame (n) to
zero, and starts listening to the cable (using the carrier sense logic
(CS) - e.g., by observing the Rx signal at transceiver to see if any
bits are being sent). If the cable is not idle, it waits (defers)
until the cable is idle. It then waits for a small Inter-Frame Gap
(IFG) to allow to time for all receiving nodes to return to prepare
themselves for the next transmission.
Transmission then starts with the preamble, followed by the frame data and finally the CRC-32. After this time, the transceiver Tx logic is turned off and the transceiver returns to passively monitoring the cable for other transmissions.
During this process, a transmitter must also continuously monitor
the collision detection logic (CD) in the transceiver to detect if
a collision occurs. If it does, the transmitter aborts the transmission
(stops sending bits) within a few bit periods, and starts the collision
procedure, by sending a Jam Signal to the transceiver Tx logic. It
then calculates a retransmission time.