Why Wireless Networks Are Scarier Than Jigsaw
We’ve seen in a previous post that IEEE ratified wireless networks as 802.11 standards. They are commonly known as WiFi by the general public (for Wireless Fidelity). But this cool name hides some interesting challenges.
Wireless signal concepts
Wireless network frequencies operate in the spectrum of microwaves. They explore the electromagnetic signals to transport data. Like other technologies where data is transported by electrical signals (in copper cables) or light (Fiber Optic cables) as carriers, data in WiFi is transported by an electromagnetism carrier signal that flies in the air.
WiFi standards use high frequencies. The IEEE 802.11b and 802.11g use a frequency of 2.4GHz. That’s more than two billion oscillations of the waveform per second. In radio communication, higher frequencies mean shorter length of the wave, thus shorter covered distance.
Wireless networks: the challenges
- Interference: wireless networks use electromagnetic waves to transport information. But the very nature of the signal makes WiFi prone to interference. In fact, the electromagnetic spectrum is vast and it encompasses signals ranging from gamma rays to satellite signals. Each country regulates the use of the electromagnetic spectrum. The diagram below is the radio frequency classification in the United States
From this diagram, you may notice that both Bluetooth, WiFi and Zigbee (IEEE 802.15.4) occupy the same spectrum. And that means when you connect to WiFi and somebody switches Bluetooth on, there may be interference.
- Obstacles: unlike wired Ethernet where signals propagate in a sort of high way, WiFi signals have a plethora of obstacles to face: watery objects (such as human bodies), solid objects, building walls, doors, … which reduce the strength of the signal
- Attenuation: a WiFi signal is strongly attenuated over distance and especially in the presence of physical obstacles.
Wireless and wavelength
It is possible to calculate the length of the wave -wavelength- for a given wireless standard. The wavelength is measured in meters, and is equal to the speed of light divided by the frequency.
wavelength = speed of light / frequency
For example, the wavelength of the IEEE 802.11b and IEEE 802.11g standards is :
299 792 458 / (2.4*10^9)
Where 299 792 458 is the speed of light, in meters per second, and 2.4 GHz is the frequency of 802.11b/g standards.
Why WiFi networks hate CSMA/CD
WiFi networks operate on Ether which is a shared media, as we saw above.
In a CSMA/CD network, when a collision occurs, the colliding signals reach both the sender and the receiver and they send a jamming signal that propagates across all the medium, to inform all contending hosts of the collision. In the air, however, it is difficult to rely on this mechanism to inform hosts of the collision event, simply because signals attenuate quickly over distance. A host “A” whose signal created a collision may not know that it is his own signal that is “guilty”, because the colliding signal he will receive will be attenuated. So it’ll barely detect it.
So CSMA/CD is not useful in the context of WiFi networks. A better MAC protocol is CSMA/CA.
How CSMA/CA works
Let’s consider three wireless network hosts A, B, C and D:
CSMA/CA data transmission
Whenever A has data to send, it senses the medium while maitaining a timer “t”. Each time toe medium is free, t is decremented. When t reaches 0 and the medium is free, A sends data then resetes the timer.
CSMA/CA ACK packets
Any host that transmitted data needs to know if the data has been received at the other end. For that purpose, a mechanism of ACK packets is implemented in the data link layer. Each time host A sends data and host B receives it, host B sends back an ACK packet.
If host A does not receive the ACK from host B, it must resend data by following the same mechanism described in data transmission.
There are some unrsesolved ussiues with CSMA/CA and we’ll discuss them briefly.
Problem#1: Hidden terminal
Host A is sending data to host B. Host C sensed that the medium was free. We say that host C is hidden from host A, and host A is hidden from host C.
Host C does not know that host B is already receiving data. It puts data on the medium and a collision occurs.
Problem#2: Exposed terminal
Let’s suppose that host C is now able to sense a broader range of the medium. Host C has some data to send to host D.
Whenever host B is receiving data, host C can sense that the medium is not free and then backs off. Although host C will not communicate with B, it waits for an additional Backoff time instead of sending data to D.
Problem#3: Deciding if it is a collision or a low SNR
When host A does not receive an ACK packet as expected from host B, but receives a low voltage signal, it can not really tell whether it’s an ACK with a low voltage (due to low SNR) or a collision signal. And that’s due the challenges we read about earlier. And that’s the third problem with CSMA/CA.
- CS144, Stanford University