contact@embeddedgeeks.com
Embedded World

CSMA/CD

CSMA/CD (Carrier Sense Multiple Access with Collision Detection) helps hosts to decide when to send packets on a shared network segment and how to detect collisions if they occur. For example, in a hub network, two devices can send packets at the same time. This can cause a collision. CSMA/CD enables devices to “sense” the wire to ensure that no other device is currently transmitting packets. But, if two devices “sense” that the wire is clear and send packets at the same time, a collision can occur. If the collision occur, packets have to be resend after a random period of time.

Consider the following example:

csma cd

In the topology above we have a hub network. Host A is trying to communicate with host B. Host A “senses” the wire and decides to send packets. But, at the same time, host C sends its packets to host D and the collision occurs. The sending devices (host A and host C) detect the collision and resend the packet after a random period of time.NOTE
Since switches are now commonly used in networks instead of hubs, CSMA/CD is not really used anymore. Each port on a switch usually operates in a full-duplex mode and there are no packet collisions in a full-duplex mode.