1
CS 168, Spring 2026 @ UC Berkeley
Slides credit: Sylvia Ratnasamy, Rob Shakir, Peyrin Kao, Prabal Dutta (and others)
Wireless Links
Lecture 24 (Wireless 1)
Why is Wireless Different?
Lecture 24, CS 168, Spring 2026
Why is Wireless Different?
MACAW Optimizations
Brief History of Wireless Communication
Wireless communication predates the Internet!
We now live in a world where wireless communication is everywhere.
Wireless Signals
Wireless signals are not packets of data floating in space.
Wireless signals are waves that propagate in all directions.
A
B
Wired vs. Wireless: Key Differences
Differences mostly affect Layer 1 (Physical) and Layer 2 (Link).
Difference: Wireless is a Shared Medium
Lecture 24, CS 168, Spring 2026
Why is Wireless Different?
MACAW Optimizations
Difference: Wired vs. Wireless Links
Wired links:
Wireless links:
Encoding Data Over Wireless Links
Wired link: Encode bits as electrical signals.
Wireless link:
0 0 1 1 0 0 0 0 0 1 0 1 0 1 1 1 1 0 0 0 0
Encoding Data Over Wireless Links – Modulation
Modulation: Impose our data signal on top of a carrier signal.
Amplitude Modulation (AM):
1 = Taller wave.
0 = Shorter wave.
Frequency Modulation (FM):
1 = Oscillate fast.
0 = Oscillate slow.
Original signal
+ Carrier signal
= Modulated signal
Other modulation strategies exist.
Measuring Noise and Interference – SINR
Shared medium → other signals can corrupt our data!
SINR (Signal to Interference and Noise Ratio) lets us measure connection quality:
Measuring Noise and Interference – SINR
SINR is dimensionless (it's a ratio).
Decibels let us measure ratios on a logarithmic scale.
Ratio | Ratio in dB |
1 | 0 dB |
10 | 10 dB |
100 | 20 dB |
1000 | 30 dB |
10000 | 40 dB |
SINR formula.
SINR (measured in dB).
Measuring Noise and Interference – Noisy Channel Shannon Capacity
Shannon capacity: Theoretical limit of how much data can be sent on a noisy channel.
How much data can be sent? (bits/sec)
Bandwidth of channel (range of frequencies we can use).
Ratio of signal power to noise+interference.
Measuring Noise and Interference – Noisy Channel Shannon Capacity
Shannon capacity: Theoretical limit of how much data can be sent on a noisy channel.
Example: The plain old telephone system:
How much data can be sent? (bits/sec)
Bandwidth of channel (range of frequencies we can use).
Ratio of signal power to noise+interference.
Difference: Wireless Signals Attenuate
Lecture 24, CS 168, Spring 2026
Why is Wireless Different?
MACAW Optimizations
Difference: Attenuation
Wireless signals attenuate – they get much weaker over longer distances.
Trade-off:
Measuring Attenuation – Free-Space Model
Free-space model (aka line-of-sight model):
In this model, the inverse square law applies.
Receiver power
d = distance between transmitter and receiver
Transmitter power
Intuition: Signal propagates out like a sphere.
Signal power is spread over surface of sphere.�Surface area of sphere = 4πr2.
"is proportional to"
Distance
Signal Strength
Measuring Attenuation – Friis Equation
The Friis equation accounts for:
Receiver power
Transmitter power
Gains of antennas
Aperture of receiver antenna
Distance (inverse square law)
Measuring Attenuation – Friis Equation, Rewritten
The equation is sometimes written like this:
Or in terms of decibels (logarithmic scale):
Measuring Attenuation – Link Budget
How do we know if the link will actually work?
Link margin is difference between receiver signal and sensitivity.
Measuring Attenuation – Link Budget
Example of computing link budget:
Transmitter
Receiver
Sensitivity: –80 dBm
Transmitted Signal:�+10 dBm
Cable: –0.44 dB
Cable: –2.21 dB
Cable: –0.44 dB
Cable: –2.21 dB
Antenna: +25 dB
Antenna: +25 dB
Signal travels 10km: –120 dB
Received Signal: –65.5 dBm
Link margin = 14.5 dBm > 0.�Our connection works!
Note: dBm = Power relative to 1 milliwatt.
Difference: Changing Environments
Lecture 24, CS 168, Spring 2026
Why is Wireless Different?
MACAW Optimizations
Difference: Environments Change
Wireless environments change rapidly.
Distance
Signal Strength
Free-space model:�Signal weakens over distance.
Distance
Signal Strength
After accounting for obstacles: Signal strength fluctuates!
Path Loss is Messy
Wireless propagation is messy.
Color = strength of signal.
Characteristics of Path Loss
3 characteristics affect signal strength:
Distance
Signal Strength
Free-space loss:
– Due to inverse� square law.�– Fluctuates very slowly.
Shadowing:
– Due to obstructions.�– Fluctuates quickly.
Multipath fading:
– Due to signal colliding� with itself.�– Fluctuates very quickly.
Distance
Signal Strength
Distance
Signal Strength
Distance
Signal Strength
+
Modeling Path Loss – Two-Ray Model
Two-ray model assumes the signal waves travel along two paths:
Earth's surface
Sender tower
Receiver tower
Line-of-sight path
Ground bounce path
Modeling Path Loss – Two-Ray Model
Assuming sender and receiver are far enough:
Earth's surface
Sender tower
Receiver tower
Line-of-sight path
Ground bounce path
Time
Signal
Time
Signal
=
Signal arrives with phase offset...
...canceling each other out!
Modeling Path Loss – Two-Ray Model
If sender and receiver are far enough:
Distance
Signal Strength
Free-space model:
– Signal strength ∝ 1/d2.�– Idealized, no obstacles.
Distance
Signal Strength
Two-ray model:
– Signal strength ∝ 1/d4.�– Signal bounces off ground.� Causes destructive interference.
Modeling Path Loss – General Ray Tracing Models
General ray tracing models account for other obstacles.
Earth's surface
Sender
Receiver
Obstacle
Obstacle
Obstacle
Modeling Path Loss – General Ray Tracing Models
Free-space model: Signal strength ∝ 1/d2.
Two-ray model: Signal strength ∝ 1/d4.
General ray tracing model:
Receiver power
Transmitter power
Distance
K and γ are empirically determined by the model.
Difference: Collision Detection
Lecture 24, CS 168, Spring 2026
Why is Wireless Different?
MACAW Optimizations
Difference: Collision Detection
Wired collisions are easy to detect.
Wireless collisions are much harder to detect.
A
B
Signals collide here.
No collision here!
No collision here!
Recall: Multiple Access Protocols
Recall: Many ways for devices to share a link.
CSMA/CD
CSMA
ALOHA
Tokens
Polling
Multiplexing
Taking Turns
Random Access
Multiple Access Protocols
Frequency
Time
CSMA in Wireless Networks
If pairs are well-separated, no problem!
Notice: Signals propagate in all directions (not just toward the destination).
A
C
B
D
CSMA in Wireless Networks
If pairs are in range of each other, no problem!
A is quiet now.�My turn!
A
C
B
D
I hear A transmitting!
I'll wait for A to finish.
CSMA in Wireless Networks – Hidden Terminal Problem
Hidden terminal problem:
Problem: A and C are out-of-range. They can't detect each other sending.
A
C
B
All is quiet.�Time to send!
All is quiet.�Time to send!
???
CSMA in Wireless Networks – Exposed Terminal Problem
Exposed terminal problem:
Notice: We could have actually sent simultaneously.
A
C
B
D
All is quiet.�Time to send!
I hear B.
I'll be quiet.
This would have been okay!�But C didn't send.
MACA (Multiple Access with Collision Avoidance)
Key problem: CSMA detects collisions at the sender.
Solution: Let's have the receiver announce if it detects collisions.
MACA (Multiple Access with Collision Avoidance)
To communicate over MACA:
A
B
RTS: "I want to send 1 MB."
CTS: "If you hear this, shut up.�I need to receive 1 MB."
A sends 1 MB.
MACA (Multiple Access with Collision Avoidance) – Solving Hidden Terminal Problem
MACA solves the hidden terminal problem.
A
C
B
RTS: "I want to send 1 MB."
CTS: "If you hear this, shut up.�I need to receive 1 MB."
B told me to be quiet.�I won't send.
A sends 1 MB.
C would have sent, but MACA saved the day!
MACA (Multiple Access with Collision Avoidance) – Rules
If you hear a CTS, be quiet until the data is sent.
If you hear an RTS, be quiet for one time slot.
MACA (Multiple Access with Collision Avoidance) – Solving Exposed Terminal Problem
MACA solves the exposed terminal problem, under certain assumptions.
A
C
B
D
I hear an RTS.�I'll be quiet for 1 time slot�to avoid clobbering the CTS.
RTS: "I want to send 1 MB."
CTS: "If you hear this, shut up. I'm receiving 1 MB."
B sends 1 MB.
C quiet at this time.
I didn't hear the CTS.�I'm not in receiver range.�I can send data!
C can send here too!�(After its own RTS/CTS.)
MACA (Multiple Access with Collision Avoidance) – Solving Exposed Terminal Problem
MACA solves the exposed terminal problem, under certain assumptions.
A
C
B
D
RTS: "I want to send 1 MB."
CTS: "If you hear this, shut up. I'm receiving 1 MB."
B sends 1 MB.
C quiet at this time.
RTS: "I want to send 1 MB."
CTS from D.
Did I hear CTS from D,�or data from B?
MACA (Multiple Access with Collision Avoidance) – Collisions
If we send RTS, but don't hear CTS, that means there was a collision!
Apply exponential backoff and wait up to twice as long before sending another RTS.
Rules for adjusting CW:
Optimization: Acks for Reliability
Lecture 24, CS 168, Spring 2026
Why is Wireless Different?
MACAW Optimizations
Introducing MACAW (Multiple Access Collision Avoidance for Wireless)
MACAW (Multiple Access Collision Avoidance for Wireless) offers improvements over MACA.
MACAW Feature: Acks for Reliability
MACAW implements acks for reliability:
Recall end-to-end principle: Reliability implemented at end hosts for correctness.
A
B
RTS
CTS
Data
Ack
Optimization: Better Backoff for Fairness
Lecture 24, CS 168, Spring 2026
Why is Wireless Different?
MACAW Optimizations
MACAW Feature: Better Backoff for Fairness
MACA is unfair: Winners keep winning. Losers keep losing.
A
B
CW = 2
CW = 2
A and B try to reserve simultaneously. Suppose A wins.
CW = 2
CW = 4
B loses and doubles CW.
A wins and sets CW = 2.
A has lower CW, will try again sooner.
A wins again!
CW = 2
CW = 8
B loses and doubles CW.
A wins and sets CW = 2.
A has lower CW, will try again sooner.
A wins again!
CW = 2
CW = 16
B loses and doubles CW.
A wins and sets CW = 2.
MACAW Feature: Better Backoff for Fairness
MACAW solution: Have everybody share the same CW.
MACAW solution: Change CW update rules to be more gentle.
We're simplifying a bit. Technically, this slide is only true if all devices are in range of each other.
Optimization:�DS for Synchronization
Lecture 24, CS 168, Spring 2026
Why is Wireless Different?
MACAW Optimizations
MACAW Feature: Admit Defeat on Exposed Terminals
Recall the exposed terminal problem.
A
C
B
D
RTS: "I want to send 1 MB."
CTS: "If you hear this, shut up. I'm receiving 1 MB."
B sends 1 MB.
C quiet at this time.
RTS: "I want to send 1 MB."
CTS from D.
Did I hear CTS from D,�or data from B?
MACAW Feature: Admit Defeat on Exposed Terminals
MACAW (and MACA) admits defeat on the exposed terminal problem.
A
C
B
D
RTS: "I want to send 1 MB."
CTS: "If you hear this, shut up. I'm receiving 1 MB."
B sends 1 MB.
C quiet at this time.
RTS: "I want to send 1 MB."
CTS from D.
Did I hear CTS from D,�or data from B?
MACAW Feature: Admit Defeat on Exposed Terminals
Punchline: If you're in range of sender, you need to be quiet.
A
C
B
D
RTS: "I want to send 1 MB."
CTS: "If you hear this, shut up. I'm receiving 1 MB."
B sends 1 MB.
C quiet at this time.
C stays quiet, as intended.
(Because C can't hear the CTS it'd need to start sending.)
DS: "If you hear this, shut up. I'm sending 1 MB."
MACAW Feature: DS Packet for Fairness
The DS packet also helps with synchronization for fairness.
A
C
B
D
B busy sending.
I know exactly when my transmission ends.
When should I try an RTS again?
C attempts RTS.�Fails, because C won't hear CTS.
B attempts RTS immediately after its data. B will win!
C attempts RTS.�Fails, because B sent RTS first.
MACAW Feature: DS Packet for Fairness
B has a huge advantage, because B knows when its data transmission ends.
A
C
B
D
B busy sending.
I know exactly when my transmission ends.
When should I try an RTS again?
C attempts RTS.�Fails, because C won't hear CTS.
B attempts RTS immediately after its data. B will win!
C attempts RTS.�Fails, because B sent RTS first.
MACAW Feature: DS Packet for Fairness
The DS packet synchronizes by telling everybody when the transmission ends.
A
C
B
D
B busy sending.
I know exactly when my transmission ends.
The DS packet tells me when B's transmission ends.
C attempts RTS after B is done.�Fair shot at winning!
B attempts RTS after B is done. Fair shot at winning!
DS: I'm sending 1 MB.
Optimization:�RRTS for Synchronization
Lecture 24, CS 168, Spring 2026
Why is Wireless Different?
MACAW Optimizations
MACAW Feature: RRTS Packet for Fairness
Another case where we need synchronization for fairness:
A
C
B
D
I know when to RTS again.
I heard CTS, so I need to be quiet.
D attempts RTS.
Fails, because C cannot respond.
RTS
CTS
DS
Data
Next RTS (wins).
Next RTS (loses).
MACAW Feature: RRTS Packet for Fairness
Solution: Let C contend on behalf of D.
A
C
B
D
I know when to RTS again.
I heard CTS, so I need to be quiet.
RRTS
RTS
CTS
DS
Data
Next RTS (fair).
Next RTS (fair).
A's done!�I'll tell D.
MACAW Feature: RRTS Packet for Fairness
If C hears an RTS, but can't respond: Send an RRTS when channel frees up.
A
C
B
D
I know when to RTS again.
I heard CTS, so I need to be quiet.
RRTS
RTS
CTS
DS
Data
Next RTS (fair).
Next RTS (fair).
A's done!�I'll tell D.
Summary
Wireless is different!
Use MACA instead of CSMA for collision detection at receivers.
Optimize with MACAW for: