18

I am searching for this answer for quite some time now. Why there is CSMA/CD in LAN but CSMA/CA in WLAN?

The best explanation I could find is "due to extreme ratio in transmitting and receiving power, it is very impractical to transmit data on the same channel. Hence collision avoidance is used". Couldn't get the meaning. Even if you're using two separate channels for transmit and receive, CSMA is used to decide which node will use channel, so no point in dropping CD in place of CA. So this explanation somehow doesn't seem fit.

The only reason I could think of is that if number of nodes are low, hence chances of collision is low, we should use CD, if chances of collision are high, we should use CA. But there isn't a difference of number of users between LAN and WLAN.
If someone could please explain.

Mike Pennington
  • 29,876
  • 11
  • 78
  • 152
vish213
  • 283
  • 1
  • 2
  • 4
  • csma/cd cannot be used in WLAn effectively because the error rate is very high in WLAN and allowing collisions will lead ti a drastic reduction in throughput. refer ;AD Hoc Wireless Network, C.Siva Ram Murthy – user63044 Nov 02 '19 at 17:16

4 Answers4

20

Avoidance is used for the very simple fact that every radio ("client") is not necessarily in range of each other. Thus, without the AP coordinating who can talk, distant radios may step on each other because they cannot know the other is transmitting.

Ricky
  • 31,438
  • 2
  • 43
  • 84
  • 4
    THis is the correct answer. For a wireless client to be able to communicate, it only needs to see the AP, not necessarily any other clients. So, if two clients who are out of reach from each other start talking, they would be jamming each others signals at the AP. They would never know about it though, since they can't hear each other. Basically, CSMA/CD works in a broadcast domain. In wireless, the broadcast domain doesn't fully overlap with the physical devices. (Think of it as a venn diagram, any overlap will interfere with the entire other domain.) – JelmerS Aug 31 '14 at 10:12
  • 1
    @JelmerS, sorry, this is a secondary answer. While true, it is not always applicable. The real reason is that even if a wireless device is designed to RX while it is TX, it will not be able to detect a collision because it's TX would be FAR stronger than any other signal it could hear (based on the same EIRP) and "mask" it's ability RX that other signal. In practical terms, a wireless device cannot both TX and RX at the same time. – YLearn Aug 31 '14 at 14:07
  • 1
    No, that's just a different way of saying it. While a radio can (and does) receive while transmitting, it would only work for that sender. (by subtracting TX from RX. something every analog modem has done for 20+ years.) Everyone else will hear garbage, or the more powerful, more local, transmitter. – Ricky Aug 31 '14 at 23:56
  • 1
    @RickyBeam, comparing wireless to a wired technology is a fallacy. Most RF is half-duplex. It is designed as half-duplex because it is cheaper/simpler to do so and being full-duplex on the same frequency is not practical. Cell phones work by using frequency pairs, one for TX and one for RX. Most other RF is half-duplex; citizen band, shortwave, FM, AM, many police/fire radios, many military applications, etc. – YLearn Sep 01 '14 at 03:29
  • Upon re-reading, I should also note that CSMA/CA is implemented independently of any mechanism the AP uses to manage "who can talk." This is why problems such as the hidden node problem can also require the implementation of RTS/CTS in addition to CSMA/CA. – YLearn Sep 03 '14 at 03:25
  • That's the "CA" part of "CS". During the listening phase, it can see the RTS request and/or the CTS answer. Despite several webpages saying it's "rarely used", it is required in all 802.11 WiFi compliant devices; the only time it's not used is for frames smaller than the RTS/CTS handshake. – Ricky Sep 03 '14 at 07:54
  • Didn't see the above comment earlier, but the "CA" part has nothing to do with with RTS/CTS. They are two entirely separate mechanisms that do not interrelate at all. An 802.11 client is not listening for a "CTS" as part of CSMA/CA, it is listening for other 802.11 traffic of any type before transmitting. RTS/CTS is rarely used in 802.11 because it has a *very significant* performance impact as all RTS/CTS frames must utilize one of the basic data rates (typically much lower than data frames). CTS-to-self is more common in 802.11 deployments, but still suffers a performance hit. – YLearn Sep 23 '15 at 02:49
20

In a wired CSMA/CD Ethernet environment, it is possible to detect a collision because there are separate TX and RX pairs (using the example of 10BaseT). If a half-duplex 10BaseT NIC sends a frame on the TX pair, but sees that frame is corrupted on the RX pair, the NIC detected a collision.

However, with an 802.11 wireless device, there are no "conductors," just antennas which do not simultaneously transmit and receive. When an 802.11 device is transmitting it cannot in practical terms listen for another signal transmitting at the same time on the same frequency. The reason for this is that RF signal strength drops off very quickly when transmitting.

Even if we built an imaginary WiFi device that could simultaneously receive and transmit, it will only be able to hear a downstream collision if the other device is using a much higher output power (either raw power or through passive/active gain of some sort). Normally its own TX signal will be too strong and "drown" out any other received signal.

So another process was required, resulting in the need for CSMA/CA.

Mike Pennington
  • 29,876
  • 11
  • 78
  • 152
YLearn
  • 27,141
  • 5
  • 59
  • 128
  • 1
    10base-2 and 10base-5 (from the early days of ethernet) do not have TX and RX pairs. Even with 10/100base-T, the hub connecting more than two endpoints would have to add more than one TX for the RX of all the ports. The simple truth is wireless cannot reliably *detect* collisions because all radios cannot reliably hear each other. – Ricky Sep 01 '14 at 00:02
  • My original post did not mention TX and RX pairs because of bus networks, I simply left it as TX and RX conductors. Bus networks exist by basically allowing all devices to reside on a single circuit. The simple truth is that wireless cannot detect collisions because it can't do so. – YLearn Sep 01 '14 at 03:13
4

EDIT(Based on Ricky's correction):

Below is a excerpt from http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Linux.Wireless.mac.html

CSMA/CA is derived from CSMA/CD (Collision Detection), which is the base of Ethernet. The main difference is the collision avoidance: on a wire, the transceiver has the ability to listen while transmitting and so to detect collisions (with a wire all transmissions have approximately the same strength). But, even if a radio node could listen on the channel while transmitting, the strength of its own transmissions would mask all other signals on the air. So, the protocol can't directly detect collisions like with Ethernet and only tries to avoid them.

The link below is good read on CSMA/CA and also explains how CSMA/CA works:

http://www2.cs.uidaho.edu/~oman/SC&CI/CSMA-CA-collisions_Bonaventure.pdf

  • 1
    Negative. CSMA/CD does not require simultaneous tx/rx. It was designed LONG before full-duplex ethernet ever existed. – Ricky Aug 31 '14 at 09:13
  • Thank you for the catch @RickyBeam. Could you also please then explain how would station back off from transmission if it can't sense the station at the same time of transmission? – vish213 Aug 31 '14 at 12:36
  • I often agree with Ricky, but CSMA/CD being able to both monitor RX and while in the process of TX has nothing to do with full-duplex operation. It is based on having separate TX and RX conductors and a collision is detected when a device is sending a signal on TX while also receiving a signal on RX. While a radio "could" in theory TX and RX at the same time, this is not practically possible...which is why in basic terms it is not possible for a wireless device to TX and RX at the same time. – YLearn Aug 31 '14 at 14:03
  • @YLearn, that's not what he said. And you're reading everything as if twisted pair (or optical) were the only media. CSMA/CD was designed in an era of 10base-2 -- coax cabling. Collisions were detected by current monitoring in early hardware; later (more advanced) hardware subtracts TX from the line to listen for other signals, but that's still not "transmit and receive data at the same time" – Ricky Aug 31 '14 at 23:47
  • @RickyBeam a bus network is basically a network where all devices take part in a single circuit. Same principles apply. As to your comment on current, yes in early hardware if there was current, there was a signal. I never said it could actually use the signal on RX, rather that when such a signal was received while TX this allowed the detection of a collision. – YLearn Sep 01 '14 at 03:08
0

On a wired bus signal, losses are fairly small, and so it is fairly easy to detect collisions. IIRC coax ethernet does it by looking at the DC level on the line, but it would be equally possible to do it by comparing the signal on the bus to the signal you are trying to transmit.

That just doesn't work for radio. Signal loss between transmitter and receiver is massive, tens of dB at least. In the face of the strong outgoing signal, it is impractical to detect the incoming signal which is operating in the same frequency spectrum and is massively weaker. This basically rules out collision detection as an approach for wireless systems.

P.S. Twisted pair and fiber Ethernet uses separate data channels for each direction, so there are no collisions on the wire. A "collision" is detected simply by detecting activity on both channels at once.

tripleee
  • 123
  • 5
Peter Green
  • 12,935
  • 2
  • 20
  • 46