The Shared-Medium Problem
Several stations use the same shared transmission channel, so access rules are required. A station checks the channel before transmitting; after detecting a collision, it stops, waits for a selected interval, and retries. These rules belong to the MAC sublayer and describe classic half-duplex Ethernet.
Early Ethernet networks used a (typically a coaxial cable in a bus topology or a hub) to which all devices were connected. If at least two stations started transmitting at the same time, their signals overlapped on the medium and the frames were corrupted. The physical layer reported the collision to the MAC, and the damaged transmission had to be retried. This event is called a collision.
Early Ethernet used CSMA/CD, Carrier Sense Multiple Access with Collision Detection, to control access to this shared medium. The protocol combines carrier sensing, multiple access, and collision detection during transmission.
What CSMA/CD Means
The name identifies three protocol functions:
CS: Carrier Sense
Before transmitting, a device checks the channel for a carrier signal. If another station is transmitting, the device defers its transmission. It tries to send data after sensing that the channel is idle and observing the required interframe spacing.
MA: Multiple Access
Multiple stations share the same medium. Each may attempt access when the channel is idle, and the protocol defines how simultaneous transmission attempts are handled. No station receives a permanently reserved time interval. Each station makes its access decision locally, without a central arbiter.
CD: Collision Detection
Carrier Sense does not prevent every collision. Two stations can find the channel idle at the same time and start transmitting. The transmitting station monitors the medium and compares the signal it sends with the signal observed by the interface. A difference indicates a collision, which must be reported to the other stations with a Jam signal. After the Jam sequence, the station enters the backoff procedure.
The CSMA/CD Algorithm, Step by Step
CSMA/CD operation on a shared Ethernet segment consists of the following phases:
Initialization phase: getting ready to transmit
- 1: Host wants to transmit: the station prepares data for sending.
- 2: Check if carrier is detected (is someone else transmitting).
- YES: wait until the channel is idle, then return to the access check.
- NO: go to step 3 and assemble the frame.
- 3: Assemble frame: the host builds the Ethernet frame with its header fields.
- 4: Start transmission: frame bits are placed on the shared medium.
Monitoring phase: transmitting and detecting collisions
- 5: Check if a collision occurred: the host compares what it sends with what it senses on the medium.
- YES: go to step 9 and notify the network about the collision.
- NO: go to step 6 and continue transmitting.
- 6: Continue transmission: the frame is sent until completion or collision detection.
- 7: Check if transmission is complete.
- NO: return to step 6 and keep transmitting.
- YES: go to step 8.
- 8: Transmission complete: the MAC sublayer has finished sending the frame.
Collision handling phase
- 9: Broadcast a jam signal: classic CSMA/CD sends a 32-bit Jam pattern so every station detects the collision.
- 10: Increment the attempt counter: update the collision count for the current frame. The counter applies to that frame and resets when a new frame starts.
- 11: Check if too many collisions occurred.
- NO: go to step 13 to compute the wait time and retry.
- YES: go to step 12: transmission of the frame is aborted.
- 12: Too many collisions, abort transmission: the frame is dropped after exceeding the retry limit. The MAC sublayer reports the failure to a higher layer, which decides whether to retry or discard the data.
Backoff and retry phase
- 13: Calculate wait time: the station draws a delay using the binary exponential backoff algorithm. The delay is an integer number of slot times, and the random range grows after successive collisions until the procedure limit is reached. For the first retry, the range contains zero and one slot; later ranges expand and are capped by the protocol.
- 14: Wait for the specified time: after the delay expires, the host returns to carrier sensing and retries the transmission. The retry starts only after the medium is idle and the required interframe spacing has elapsed.
Minimum Frame Size and Collision Detection
In CSMA/CD, the 64-byte minimum Ethernet frame provides enough transmission time for Collision Detection across the whole segment. A station must still be transmitting when information about a collision returns from the farthest part of the medium.
Devices A and B can be at opposite ends of the longest segment.
If A finishes sending a short frame before the collision signal caused by B reaches it, A treats the transmission as complete and does not schedule a retransmission.
Propagation Delay and Slot Time
- Propagation Delay : The time required for a signal to travel from one end of the cable to the other.
- Slot Time: The worst-case detection interval includes the signal's trip to the far end and the collision signal's return. This window is defined as the and is slightly longer than to account for device delays. For 10 and 100 Mbps Ethernet, it is 512 bit times, equal to 51.2 µs at 10 Mbps.
- The Calculation: To keep a station transmitting until the collision signal arrives, the time to transmit the smallest frame must be at least the slot time. This relationship limits the maximum shared-medium diameter for a given bit rate and propagation delay.
Example: 10 Mbps Ethernet
Eight bits make one byte, so . The 64-byte minimum covers the fields from Destination MAC through FCS; the preamble, start delimiter, and interframe gap are outside that count. This frame-size rule belongs to the shared-medium timing model. In gigabit half-duplex Ethernet, preserving the collision window required mechanisms such as carrier extension and frame bursting, together with network-diameter limits. Switching and full-duplex links have limited the use of CSMA/CD in modern Ethernet.
CSMA/CD in Modern Networks
CSMA/CD was designed for the shared medium of early Ethernet. It allowed multiple stations to share one segment. Modern wired networks mainly use switched full-duplex links, so this mechanism has a limited role.
A network switch separates ports into collision domains and forwards frames to the port selected from its MAC address table. In a switched network, the collision domain normally contains one port and its attached neighbor. A point-to-point link between a switch and a host does not provide one shared medium for multiple stations.
Full-duplex communication allows simultaneous sending and receiving on a point-to-point link, so CSMA/CD collisions do not occur on that link. Collision detection and backoff are disabled, and transmission can start subject to the required interframe spacing.
Today, CSMA/CD remains a historical concept and may operate on legacy shared Ethernet links in half-duplex mode, for example with hubs. Both ends must use compatible duplex settings, since a mismatch causes errors and frame loss. WLAN uses CSMA/CA, so it is not an example of Ethernet CSMA/CD.