Explaining Random Access Protocols

In this blog post, I explain what a multi-access network is, examining the random access protocols used by devices to access a shared communication channel.

What is a Multi-Access Computer Network

A Multi-Access Network allows for multiple nodes to transmit data (send data) over a shared communication medium, such as a cable or radio waves.

Image of Nodes sharing a link Image of Nodes sharing a common link

These types of networks are generally more cost-effective compared to other types of networks such as those that rely on a central node to forward traffic (like a switch) or networks that offer direct links between each of the hosts, So an approach that relies on neither a central node nor direct links can save an organisation quite a lot of money!

There are three major categories of Multi-Access Network Protocols:

  • Random Access Protocols
  • Controlled Access Protocols
  • Channelised Access Protocols

Each of these protocols have different methods of controlling access between nodes and all of these protocols have certain advantages and disadvantages.

However, for this blog post I will only be considering the Random Access Protocols, as they serve as great examples.

Random Access Protocols

Random Access Protocols are designed with a simple goal in mind; no node has control over another node, this means that there is no central authority that governs the transmissions, instead the nodes compete with each other to access the medium, therefore the transmission is random (truly earns its name don’t you think).

The 4 major media access control algorithms classified as random access protocols are:

  1. Pure ALOHA (1970s)
  2. Slotted Aloha (1970s)
  3. CSMA/CD (Carrier Sense Multi-Access / Collision Detect) (1980s)
  4. CSMA/CA (Carrier Sense Multi-Access / Collision Avoidance) (1990s)

Pure ALOHA

One of the earliest methods for media access control, Pure ALOHA was developed by the University of Hawaii for the ALOHAnet (A wireless LAN) to prevent collisions from happening between nodes transmitting at the same time. Pure ALOHA utilises a simple approach to reduce the number of collisions; It requires all nodes to wait a random amount of time, if one of their previous frames (a data unit sent at the link layer) has collided with another frame.

However, this only reduces the rate of collisions and that too insignificantly, making the Pure ALOHA approach impractical for larger networks.

Slotted ALOHA

To address Pure ALOHA’s Shortcomings, Slotted ALOHA was developed as an Improvement, It divides time into slots with each slot being long enough to transmit exactly one frame, therefore if a node fails to transmit frames during the first slot it must wait until the next slot to begin transmitting again.

This approach makes slotted ALOHA twice as effective at preventing collisions compared to Pure ALOHA, However, It still is not as efficient as the protocols we will discuss next!

CSMA/CD & CSMA/CA

CSMA/CD & CSMA/CA are two of the most well known multi-access network protocols, known for their historical impact and most importantly their application in network engineering courses.

We start by explaining the CSMA technology both share; CSMA stands for Carrier Sense Multi-Access which means that nodes can distinguish when a link is idle or busy, If a link is idle, CSMA transmits instantly, if a link is busy then CSMA waits before transmitting, this can still lead to collisions as two or more nodes may find the link to be idle at the same time and frames may collide, this is where CD & CA come in!

Collision Detect with Ethernet

Carrier Sense Multi-Access / Collision Detect was primarily used by Shared Ethernet links (802.3) to transmit frames over a shared link (historically Coax), An important feature of the Ethernet implementation of CSMA is that it is a 1-Persistent protocol, which means that nodes continuously check if the link is idle or busy.

The CSMA technology as defined above is deployed alongside Collision Detect (CD), which allows nodes to detect when collisions occur, addressing this limitation of CSMA!.

Once the frames collide the two nodes involved perform post-collision actions, in Ethernet’s case the nodes send a jamming sequence and stop transmission of all further frames. the adaptor nodes then wait a random amount of time before attempting to transmit again, if it fails again it waits exponentially longer (an exponential backoff), nodes try a specific number of times before giving up and reporting an error to the host node.

A lovely interactive animation that depicts CSMA/CD can be found at Computer Networking: A Top Down Approach’s website; https://gaia.cs.umass.edu/kurose_ross/animations.php

Here is an additional Flowchart;

Ethernet Flowchart A Flowchart depicting the flow of the Ethernet protocol

CSMA/CD has since been phased out in favour of Switched Ethernet, that relies on a central node which a node has a direct connection to using an Ethernet cable, despite this; CSMA/CD serves as a valuable concept to explain multi-access networks to aspiring network engineers.

Collision Avoidance with Wi-Fi

Now we talk about CSMA/CA, the sister technology to CSMA/CD; CSMA/CA stands for Carrier Sense Multi-Access with Collision Avoidance and It is used to reduce the rate of collisions on Wireless networks, more specifically Wi-Fi (802.11) (and unlike its sibling technology, it is still used today)

Before we begin exploring CSMA/CA we must address the two unique problems that are encountered by wireless transfer;

  1. The Exposed Node Problem: Where a Node can hear the transmission of another node (even though the transmissions do not interfere), this can prevent a node from transmitting as it may incorrectly assume the transmissions from both nodes would collide.
  2. The Hidden Node Problem: When two nodes that are hidden from each other communicate with another node between them, they may cause collisions as neither of them are able to detect each other’s transmissions, therefore neither of them will be able to detect the collision either, leading to a large number of collisions.

Exposed & Hidden Node Problems A Graphic depicting both the problems

To address the exposed node problem, CSMA/CA checks if a node can hear communications from another node, if it cannot then the node can freely transmit, if it can, it waits for the transmission to end. (how does this solve the problem)

To circumvent the hidden node problem, Wi-Fi expects an explicit Acknowledgement (An ACK) from the receiver, A receiver only sends an ACK if the frame arrives and passes the CRC (A Cyclic redundancy check; the details warrant another blog post :), for now It is just an error check), if the ACK is not transmitted the sender re-transmits the frame, this doesn’t entirely avoid collisions but ensures the data does end up arriving.

Another approach that addresses both the Hidden Node and Exposed Node problem is RTS-CTS frames,

While, the RTS-CTS frames are optional to implement for the 802.11 / Wi-Fi standard, they effectively solve both the problems, The Flow can be described as;

  1. The sender transmits a small packet called the RTS (Ready-To-Send) to the receiver,
  2. if the RTS arrives and the receiver is willing to receive further frames from the sender, then the receiver sends a CTS (Clear-To-Send) frame,

This can effectively counter the hidden node problem as a hidden node that might not hear the RTS may hear the CTS, effectively telling it to stop transmitting for a set amount of time. It can also effectively counter the exposed node problem, as a node that hears the RTS but not the CTS can successfully determine that the communication will not collide and that exposed node can transmit frames to other nodes.

A diagram depicting the RTS-CTS flow:

RTS-CTS A diagram depicting the RTS-CTS flow

Conclusion

In this Post, We explored the legacy Pure ALOHA, Slotted ALOHA & CSMA/CD technologies, diving into how they function in acceptable detail, We also explored current technologies such as CSMA/CA and how it attempts to solve the exposed node & hidden node problems allowing wireless transmissions to avoid collision.

I hope you enjoyed reading this blog post as much as I enjoyed writing it (A lot!), hope you have a great day ahead!

Built with Hugo
Theme Stack designed by Jimmy
Not-By-AI Not-By-AI