CSMA/CD is a media access control protocol and is standardized in IEEE 802.3 group of IEEE. The CSMA /CD protocol is located in the second layer (data link layer) of the OSI model.
Simultaneous data transmission by two nodes or devices degrades the performance of Ethernet, resulting in collisions. In such situations, CSMA/CD is helpful. Data transmitted over the network is referred to as a frame. Devices connected through the Ethernet technology of LAN uses CSMA/CD as a base for the transmission of data. Devices on the network are first connected to cables to access the CSMA/CD protocol. The device that has to send data first senses or detects, whether the transmitting medium is free or not, with the help of a carrier (a specified level used for the transmission of a frame). If the carrier is detected, then the transmission is delayed, until the carrier is terminated and a notification signal is sent to the device, while the non-detection of the carrier signifies that the medium for transmitting the frame is free and the process can proceed.
When the medium is free, the device transmits the frame. If two or more devices transmit the frames at the same time, collision occurs. This whole process of collision is known as listen while talking. Carrier sensing detects for these collisions. After the collision is detected, the device transmitting the frames waits for an indefinite period before retransmitting the frames. This condition is known as Backoff condition.
The period, for which the device waits, is decided by a random number that is generated by the collision counter located on each device. After Back off, the device involved in the collision broadcasts data again. This whole process is continued till a collision is not detected or sensed. If the collision is not found in the working of CSMA/CD, then transmission of the frame takes place and the process of transmission completes; otherwise, the frame is re-transmitted to the node, until the collision counter is cleared.