Medium Access Control: Stochastic Methods - CSMA/CD

In this lesson, we'll look at the variant of CSMA that also detects collisions.

Carrier Sense Multiple Access with Collision Detection

CSMA improves channel utilization compared to ALOHA. However, the performance can still be improved further, especially in wired networks.

Consider the situation of two terminals that are connected to the same cable. This cable could, for example, be a coaxial cable, or it could also be built with twisted pairs. Before extending CSMA, it’s useful to understand more intuitively, how frames are transmitted in such a network and how collisions can occur.

The slides below illustrate the physical transmission of a frame on such a cable. To transmit its frame, host A must send an electrical signal on the shared medium.

  1. The first step is thus to begin the transmission of the electrical signal. This is depicted in the first slide below.

  2. This electrical signal will travel along the cable. Although electrical signals travel fast, we know that information cannot travel faster than the speed of light (i.e. 300,000300,000 kilometers/second). On a coaxial cable, an electrical signal is slightly slower than the speed of light in a vacuum which is at about 200,000200,000 kilometers/second.

    • This implies that if the cable has a length of one kilometer, the electrical signal will need 5 microseconds to travel from one end of the cable to the other.
  3. The ends of coaxial cables are equipped with termination points that ensure that the electrical signal is not reflected back to its source. This is illustrated in the third slide below, where the electrical signal has reached the left endpoint and host B.

  4. At this point, B starts to receive the frame being transmitted by A. Notice that there is a delay between the transmission of a bit on host A and its reception by host B. If there were other hosts attached to the cable, they would receive the first bit of the frame at slightly different times. As we will see later, this timing difference is a key problem for MAC algorithms.

  5. In slide 4, the electrical signal has reached both ends of the cable and occupies it completely. Host A continues to transmit the electrical signal until the end of the frame.

  6. As shown in slide 5, when the sending host stops its transmission, the electrical signal corresponding to the end of the frame leaves the coaxial cable.

  7. The channel becomes empty again once the entire electrical signal has been removed from the cable.

Press + to interact
Frame transmission on a shared bus
Frame transmission on a shared bus
1 of 6

Now that we have looked at how a frame is actually transmitted as an electrical signal on a shared bus, it’s interesting to look in more detail at what happens when two hosts transmit a frame at almost the same time. This is illustrated in the slides below:

  • Hosts A and B start their transmission at the same time (first slide).

  • At this time, if host C senses the channel, it will consider it to be free.

  • This will not last a long time, and in the second slide the electrical signals from both host A and host B reach host C.

  • The combined electrical signal (shown graphically as the superposition of the two curves in the figure) cannot be decoded by host C.

  • Host C detects a collision, as it receives a signal that it cannot decode. Since on a wire, this could be a voltage level that corresponds to neither 0 nor 1.

  • Since host C cannot decode the frames, it cannot determine which hosts are sending the colliding frames. Note that host A (and host B) will detect the collision after host C (third slide).

  • In a wired network, a host is able to detect such a collision both while it’s listening (e.g., like host C in the figure above) and also while it is sending its own frame. When a host transmits a frame, it can compare the electrical signal that it transmits with the electrical signal that it senses on the wire.

  • In the first and second slides in the figure above, host A senses only its own signal.

  • In the third slide, it senses an electrical signal that differs from its own signal and can thus detect the collision.

  • At this point, its frame is corrupted and it can stop its transmission.

The ability to detect collisions while transmitting is the starting point for the Carrier Sense Multiple Access with Collision Detection (CSMA/CD) MAC algorithm which is used in Ethernet networks. When an Ethernet host detects a collision while it’s transmitting, it immediately stops its transmission. Compared with pure CSMA, CSMA/CD is an important improvement since when collisions occur, they only last until colliding hosts have detected it and stopped their transmission instead of continuing to transport the rest of the frame unnecessarily. In practice, when a host detects a collision, it sends a special jamming signal on the cable to ensure that all hosts have detected the collision.

Press + to interact
Frame collision on a shared bus
Frame collision on a shared bus
1 of 4

Worst Case

To better understand these collisions, it’s useful to analyse what would be the worst collision on a shared bus network. Let’s consider a wire with two hosts attached at both ends, as shown in the slides below.

  • Host A starts to transmit its frame and its electrical signal is propagated on the cable. Its propagation time depends on the physical length of the cable and the speed of the electrical signal. Let us use ττ to represent this propagation delay in seconds.

  • Slightly less than ττ seconds after the beginning of the transmission of A’s frame, B decides to start transmitting its own frame.

  • After ϵ\epsilon seconds, B senses A’s frame, detects the collision and stops transmitting.

  • The beginning of B’s frame travels on the cable until it reaches host A.

  • Host A can thus detect the collision at time ττ ϵ+- \epsilon + ττ 2×\approx 2 \times ττ.

  • An important point to note is that a collision can only occur during the first 2×2\times ττ seconds of its transmission. If a collision did not occur during this period, it cannot occur afterward since the transmission channel is busy after ττ seconds and CSMA/CD hosts sense the transmission channel before transmitting their frame.

Press + to interact
The worst collision on a shared bus
The worst collision on a shared bus
1 of 3

Feel free to ask any questions related to the lesson in the following widget. Our AI will answer them and help you better understand the topic

Powered by AI
3 Prompts Remaining
Prompt AI WidgetOur tool is designed to help you to understand concepts and ask any follow up questions. Ask a question to get started.

Quick Quiz!

1

What would happen if a collision occurs and regular CSMA was deployed?

A)

Both hosts will continue to transmit the frame even after collision

B)

Both hosts will immediately stop transmitting the frame as soon as collision is detected

C)

Both hosts will crash immediately

Question 1 of 30 attempted

Now that we have a basic idea of how CSMA/CD works, we’ll look at a few ways that it’s optimized in the next lesson.

Get hands-on with 1400+ tech skills courses.