CSMA is a basic method that controls the com­mu­ni­ca­tion of multiple par­tic­i­pants on a shared and de­cen­tral­ized trans­mis­sion medium. However, this is now available in three different variants, which depend on the trans­mis­sion medium. While CSMA/CA is mainly used in wireless networks, CSMA/CD was developed for Ethernet, and CSMA/CR is used in con­troller area networks (CAN), which are mainly used in cars and machines.

To un­der­stand exactly what is behind Carrier Sense Multiple Access with Collision Avoidance, it makes sense to look at the com­po­nents in­di­vid­u­al­ly:

  • Carrier sense (CA): The initial idea is that par­tic­i­pants may only send data over the network if the trans­mis­sion medium is free. The carrier status detection checks the channel any time, and data is not sent until it’s available.
     
  • Multiple access (MA): Several stations share a trans­mis­sion medium. It is crucial for func­tion­ing com­mu­ni­ca­tion that all of them adhere to a binding protocol.
     
  • Collision avoidance (CA): A complex schedule tries to ensure that two or more par­tic­i­pants do not start a trans­mis­sion at the same time to avoid col­li­sions. If over­lap­ping does occur, this will be detected and the trans­mis­sion will be tried again.

What is CSMA/CA and what is its purpose?

In a local area network (LAN), all network par­tic­i­pants share a trans­mis­sion medium – a cable, the so-called bus. Wireless networks naturally don’t use cables, but even with WLAN, all devices involved send and receive using only one trans­mis­sion medium, namely a certain radio range. In this respect, WiFi (IEEE 802.11) is com­pa­ra­ble to the early half-duplex Ethernet networks. So, there must also be a protocol for a wireless network that regulates the use of the medium.

The most important rule, which you’ll know from com­mu­ni­ca­tion sit­u­a­tions when there are several par­tic­i­pants (e.g. a con­ver­sa­tion with the family at the dinner table), is: only one person may send their in­for­ma­tion at once. If everyone speaks at the same time, it’s confusing and no-one can un­der­stand anything. The posts can also overlap in networks, in this case in the form of data packets. This is called a collision, when the data packets meet and alienate their contents.

CSMA/CA tries to reduce the frequency of these col­li­sions and provide a plan at the same time on how to proceed if a collision does occur. The protocol is also important because the trans­mis­sions in the wireless networks cannot run in the same order (due to the tech­nol­o­gy used) as they would have done with a cable. In a de­cen­tral­ized network, it is necessary for all par­tic­i­pants to follow a set of rules and organize the com­mu­ni­ca­tion among them­selves.

The hidden station problem

The technical dif­fer­ences between wired and wireless networks also lead to the so-called hidden station problem. Stations in a wireless network have a limited range, so that it could be that par­tic­i­pants in a network don’t even recognize each other.

It is con­ceiv­able, but not im­prob­a­ble, for two stations not to recognize one another, but to want to si­mul­ta­ne­ous­ly reach a station that is located between them. Trans­mis­sions can overlap at the receiving node, meaning data gets lost. Both trans­mit­ters do not detect the collision and don’t start a new delivery attempt. CSMA/CA alone cannot solve this problem, which is why an optional extension was created: RTS/CTS (“Request to Send” and “Clear to Send”).

CSMA/CA vs. CSMA/CD

CSMA/CA adapts the collision handling method (CSMA/CD) used in half-duplex Ethernet networks to face the chal­lenges that wireless networks pose. CSMA/CD tries less to avoid col­li­sions. Instead, the protocol un­der­stands col­li­sions as a matter of fact and es­tab­lish­es a mechanism for network par­tic­i­pants in­struct­ing them how to proceed in the event of a collision so that another one doesn’t happen straight­away on the next attempt. Backoff – a random amount of time that stations must wait after a failed trans­mis­sion so that both par­tic­i­pants don’t start sending in­for­ma­tion at the same time – ac­com­plish­es this.

Wireless networks cannot be monitored as securely as wired networks. Col­li­sions may be caused by a second trans­mit­ter out of the range of the first, and neither can recognize the other’s attempts to send in­for­ma­tion. It’s necessary, then, to reduce the prob­a­bil­i­ty of col­li­sions. CSMA/CA brings the backoff forward in the process and uses it before the first delivery process, making it less likely for par­tic­i­pants to si­mul­ta­ne­ous­ly start a trans­mis­sion and cause a collision.

How CSMA/CA works

The basic idea behind CSMA/CA is the “Listen Before Talk” (LBT) principle. This means that the line has to be checked to see if it’s free (“idle”) before the station can start a trans­mis­sion. But this is just the first step. Further functions within the procedure ensure that col­li­sions can be avoided to a large extent.

Dis­trib­uted co­or­di­na­tion function (DCF)

Within CSMA/CA, the dis­trib­uted co­or­di­na­tion function (DCF) controls the time a station waits before ini­ti­at­ing trans­mis­sion in a free medium. DCF also assigns certain time slots to network par­tic­i­pants for further actions, creating a binding time structure. This procedure is the focus of collision avoidance: a complex time structure that makes it possible to avoid col­li­sions. DCF takes various intervals into account when creating the time structure.

  • DCF in­ter­frame space (DIFS): In the first step, par­tic­i­pants must monitor the network for the duration of the DIFS to determine whether it’s currently free. For CSMA/CA, this means that no other station within range is sending out a trans­mis­sion at the same time. The DIFS results from the SIFS almost double the slot time, which is between 28 and 50 µs long.
     
  • Con­tention window: If par­tic­i­pants determine that the channel is free, they wait a random amount of time before they start sending. This duration cor­re­sponds to the con­tention window. This time window doubles with each collision and cor­re­sponds to the binary ex­po­nen­tial backoff (BEB) that is familiar from CSMA/CD.
     
  • Short in­ter­frame space (SIFS): After sending the data packet, the recipient node sends a no­ti­fi­ca­tion – if the RTS/CTS procedure is also utilized. However, this station also waits for a fixed time before sending. SIFS is the time it takes to process a data package. The duration depends on the IEEE-802.11 standard and is between 10 µs and 16 µs.
Fact

The slot time is the time it takes data to pass through the maximum length of the network. For wireless networks, this depends on the standard used and is between 9 µs and 20 µs.

Request to send and clear to send (RTS/CTS)

The frames “Request to Send” (RTS) and “Clear to Send” (CTS) are part of the optional extension CSMA/CA RTS/CTS. This procedure is upstream of the actual data trans­mis­sion. If a par­tic­i­pant de­ter­mines that the trans­mis­sion medium is free, the device first sends an RTS frame to the par­tic­i­pant that is to receive the data. With this, the output computer makes it clear that it wants to start a trans­mis­sion and will occupy the trans­mis­sion medium for a certain time.

The receiver, in turn, sends a CTS frame to the original sender. As with the RTS frame, all other par­tic­i­pants in the range are informed that the trans­mis­sion is currently occupied and the trans­mit­ter is enabled for trans­mis­sion. Only then does the original device start trans­mit­ting the data. Now it is not possible for the par­tic­i­pants in a wireless network to detect col­li­sions or other in­ter­fer­ence during trans­mis­sion. For this reason, the receiving station needs to send an ac­knowl­edge­ment (ACK) when the data packet has arrived correctly.

If the ACK frame doesn’t appear, the sender of the data assumes that a com­pli­ca­tion has occurred and resends the data packet. The station has a pref­er­en­tial right to use the medium and doesn’t have to wait again for the channel to be free. The three frame types each consist of several fields.

  • Frame control: the FC field contained in each 802.11 frame is 2 bytes (16 bits) and again divided into several elements:
    • Protocol version: specifies the version of the protocol used
    • Type: specifies whether it is a control frame (as with RTS/CTS and ACK), data frame, or man­age­ment frame
    • Sub-type: specifies the type of frame by defining one of the 25 sub cat­e­gories
    • To dis­tri­b­u­tion system: is set when the frame goes to a dis­tri­b­u­tion system
    • From dis­tri­b­u­tion system: is set if the frame comes from a dis­tri­b­u­tion system
    • More fragments: only has content if more frames follow (only relevant for data frames and man­age­ment frames)
    • Retry: specifies whether and how often the frame has already been sent
    • Power man­age­ment: shows the power saving mode
    • More data: specifies that more data should be sent
    • WEP: indicates whether the data is encrypted with WEP
    • Order: tells the recipient whether the data is sent in the correct order
       
  • Duration: specifies the time the trans­mit­ter needs for data trans­mis­sion (this in­for­ma­tion is crucial for the network al­lo­ca­tion vector and has a size of 2 bytes)
  • Receiver address: contains the MAC address of the receiver (6 bytes)
  • Trans­mit­ter address: contains the MAC address of the sender (6 bytes); only required for RTS, not for CTS, and ACK
  • Frame check sequence: the 4-byte block check sequence is a checksum that enables the receiving station to determine whether the data frame has arrived as planned. The sender cal­cu­lates the checksum from the data of the frame. The same process also takes place on the receiver’s side when the frame has arrived. If the receiver’s result matches what the sender attached to the frame as FCS, the trans­mis­sion was suc­cess­ful.

Except for the field that specifies the trans­mit­ter address, all fields are contained in RTS, CTS, and ACK. However, the sender field is only of interest when first con­tact­ing the recipient, so that the recipient knows which node he is now com­mu­ni­cat­ing with.

By extending the CSMA/CA protocol with RTS/CTS, it’s possible to reduce col­li­sions on the initial RTS frame. It is still likely that two par­tic­i­pants will send a request to send to the same station at the same time. In cases like this, however, the receiver does not send a CTS frame because the RTS frames have not arrived correctly. So, RTS/CTS can solve the hidden station problem: even if the two trans­mit­ters don’t recognize each other due to the limited range, only the RTS frames are at risk and not the actual data. CSMA/CA then takes effect and the trans­mis­sion can take place in an orderly fashion.

The RTS/CTS exchange solves the hidden station principle, but the extension causes another dif­fi­cul­ty: the exposed station problem. The situation is initially the same as with the hidden station problem: one station is in the middle of two other stations so that they cannot reach each other. One of the two devices now wants to send data to the station in the middle. All ac­ces­si­ble nodes receive the CTS frame that stops them from broad­cast­ing. This avoids the hidden station problem, but creates a new one.

A third station is now prevented from trans­mit­ting, even if a com­plete­ly different, fourth station would have been the des­ti­na­tion of the trans­mis­sion. This trans­mis­sion would not cause a collision, but it still has to be prevented, which leads to the entire network slowing down.

Network al­lo­ca­tion vector (NAV)

Before a device in the network starts a trans­mis­sion, it first sends in­for­ma­tion (in the duration field of the RTS frame) to all other par­tic­i­pants. The station reveals how long the network will be occupied by the trans­mis­sion. Every other device enters this in­for­ma­tion in its very personal network al­lo­ca­tion vector (which is not really a vector from a math­e­mat­i­cal point of view). This is managed in­ter­nal­ly and specifies the time when a delivery attempt is possible again. The network al­lo­ca­tion vector (NAV) counts down con­tin­u­ous­ly and is only re­plen­ished by new in­for­ma­tion from other stations.

A NAV can increase the timer by a maximum of 33ms (32.767 µs). This is the maximum duration for which a trans­mit­ter may block the medium. The devices in the network are inactive while the network al­lo­ca­tion vector has not yet expired. This saves energy. Only when the counter is set to 0 does the sub­scriber become active again and check the network. The NAV is not only adjusted by the RTS, but is also in­flu­enced by CTS and ACK. The latter is the signal for all par­tic­i­pants to reset the NVA to 0, when the medium is free again.

The CSMA/CA procedure at a glance

If par­tic­i­pants in a wireless network follow Carrier Sense Multiple Access with Collision Avoidance, certain steps must be adhered to. First, the stations monitor the trans­mis­sion medium. When it comes to WLAN, this means that carrier sense monitors the radio channel and checks whether other network par­tic­i­pants – as long as they are visible to the re­spec­tive device – are currently trans­mit­ting.

If it turns out that the trans­mis­sion medium is currently occupied, a random backoff is initiated: the station waits a random amount of time until a new check starts. All other stations, which are not busy with sending or receiving, ex­pe­ri­ence the same. The random waiting time ensures that the par­tic­i­pants do not start to check the network at the same time and cannot start trans­mit­ting data at the same time. However, this only happens if the station is not already aware that the medium is occupied due to the network al­lo­ca­tion vector (NAV).

If the network is free, the station initiates DCF. First, the channel is checked more thor­ough­ly for the duration of DIFS. If it remains free for this time, a random backoff starts and only then does the RTS/CTS exchange begin – if this ad­di­tion­al mechanism is used. If the request to send has suc­cess­ful­ly arrived at the receiver and no collision has occurred, the sender receives per­mis­sion from the CTS frame to occupy the trans­mis­sion medium.

As this happens, all other par­tic­i­pants are informed that the network is currently in use. This causes them to raise their network al­lo­ca­tion vector again and wait to try again to see if the channel is free. Then the station starts the trans­mis­sion. When this is finished, the receiver waits for the duration of an SIFS and then responds with an ACK frame to confirm to the sender that every­thing has been fully received and to set the network al­lo­ca­tion vector to 0, showing that the network is free for a new trans­mis­sion.

The ad­van­tages and dis­ad­van­tages of CSMA/CA

CSMA/CA solves some problems that occur in wireless networks and cannot be solved by CSMA/CD. However, the process is not without its dis­ad­van­tages: on the one hand, certain problems cannot be solved com­plete­ly and, on the other hand, CSMA/CA brings new dif­fi­cul­ties along with it.

Ad­van­tages Dis­ad­van­tages
Helps prevent data col­li­sions Longer waiting times
Thanks to feedback, no data is un­no­tice­ably lost Causes ad­di­tion­al traffic
Avoids un­nec­es­sary data traffic with the RTS/CTS extension Solves the hidden station problem only by using RTS/CTS extension
  Creates the exposed station problem through using RTS/CTS

What are co­or­di­nat­ed multiple access protocols?

Since the CSMA/CA procedure is far from perfect, efforts have been made to expand it. This is how weak points are erad­i­cat­ed. Two pro­ce­dures, both of which follow the concept of co­or­di­nat­ed multiple access protocols have been developed, but are hardly used for various reasons. Co­or­di­nat­ed multiple access protocols establish a central or­ga­ni­za­tion­al point: the access rights of the in­di­vid­ual stations on the trans­mis­sion medium should no longer be co­or­di­nat­ed ex­clu­sive­ly with one another. Instead, requests run via the access point (e.g. via the WiFi router).

Point co­or­di­na­tion function

The point co­or­di­na­tion function (PCF) is ad­di­tion­al­ly in­te­grat­ed into the CSMA/CA procedure and replaces or sup­ple­ments the dis­trib­uted co­or­di­na­tion function (DCF). The access point acts as a co­or­di­na­tor (point co­or­di­na­tor) and specif­i­cal­ly addresses the stations within the network. No-one is allowed to occupy the trans­mis­sion medium until this has been done. The co­or­di­na­tor has a polling list for the order of the in­di­vid­ual stations.

According to this list, each network par­tic­i­pant is asked either simply one after the other (or in order of priority) whether they wish to make a trans­mis­sion. Before the access point starts the request, however, it has to wait for a certain time just like with DFC. The PCF in­ter­frame space is one slot time shorter than the DIFS and has a higher priority, so PCF takes effect earlier than DCF.

The method offers an approach to solve the hidden station problem: the required range can be halved if the access point is well po­si­tioned. PCF means that par­tic­i­pants no longer have to recognize each other. The access point just needs to be placed in the middle and can reach all stations in a star shape.

However, the point co­or­di­na­tion function creates another weak point: to use the tech­nol­o­gy, all network par­tic­i­pants must be able to use PCF. However, this is by no means always the case. When devices are not par­tic­i­pat­ing in the PCF process, they and their transfer requests are simply ignored. That is why an al­ter­nat­ing system has been developed: PCF and DCF can alternate to give all devices in the network the pos­si­bil­i­ty of trans­mis­sion. The access point provides two time periods for this. Firstly, there is the con­tention free period (CFP), in which PCF ensures co­or­di­nat­ed multiple access, and the con­tention period (CP), in which DCF applies and col­li­sions as described above are avoided using CSMA/CA. This al­ter­na­tion is initiated by a beacon frame, which the co­or­di­na­tor sends to all stations.

Hybrid co­or­di­na­tion function con­trolled channel access (HCCA)

The other method with co­or­di­nat­ed multiple access protocols, HCF con­trolled channel access, is strongly oriented towards the PCF method. However, HCCA regulates the change between the con­tention period and the con­tention free period dif­fer­ent­ly. Instead of an al­ter­nat­ing system, HCCA es­tab­lished the option that allows the access point to switch from CP to CFP at any time – which is the con­trolled access phase (CAP) in HCCA. During this period, the hybrid co­or­di­na­tor (also the access point here) co­or­di­nates who may send data and when, based on priority. The co­or­di­na­tor de­ter­mines these via traffic classes (TC), which specify the stations. This way, different pri­or­i­ties can be assigned to different classes.

In addition, with HCCA, the trans­mis­sion period becomes a transmit op­por­tu­ni­ty (TXOP). This describes a time during which trans­mit­ters may not only send one frame, but as many data frames as possible within the TXOP phase. If a frame is too large for the period, it must be broken open and sent in several parts. This prevents slower stations from slowing down faster ones.

During the con­tention period, however, enhanced dis­trib­uted channel access (EDCA) applies. There is also an order of priority behind EDCA. However, this order is not organized by a central point; instead, the par­tic­i­pat­ing stations arrange them­selves just like with DCF. Nodes that have important traffic to transmit do not need to wait for a full DIFS. Instead, stations like these pause only for the length of the ar­bi­tra­tion in­ter­frame space (AIFS). There are various AIFs, which are numbered con­sec­u­tive­ly, depending on the priority. AIFS1 has the highest priority level and is \ smaller than DIFS but longer than SIFS. TXOP also applies to EDCA.

Go to Main Menu