Physical layer: Wireless and MAC protocols
Last layer. Everything above this point has been about the meaning of bits; today is about the bits themselves — voltages on copper, pulses of light in glass, and above all radio waves, where nothing is reliable and everyone shares the medium. The wireless material is where the abstractions we've been using finally leak: a wireless "link" isn't a wire, two nodes may not be able to hear each other, and the same physics that corrupts your signal can be turned around to detect someone's heartbeat through a wall. That last point is not a digression; it's Lab 4.
Files:
- phase.html (plot phase/amplitude in complex plane)
- constellation.html (see how noise affects a receiver)
- multipath.html (see reflectors can cause a signal to add up constructively or destructively)
- rescuer.html (reflections can cause misleading signal strength readings)
Additional information:
Agenda
These notes cover the wired physical layer, then wireless networks and radio fundamentals, modulation schemes, and 802.11 Wi-Fi — including CSMA/CA, which is the collision avoidance counterpart to Ethernet's collision detection. Bluetooth, software-defined radio, and IoT round it out.
- The wired physical layer
- Wireless networks: elements and context
- Radio basics
- Noise, attenuation, and multipath
- Antennas: MIMO and beamforming
- Radio spectrum
- Physical-layer coding
- Modulation schemes
- OFDM
- Wi-Fi: association, frames, and CSMA/CA
- Channel State Information as a side channel
- Bluetooth
- Software-defined radio and IoT
- Exercises
- Terms
Notes
The wired physical layer
Start with the easy case. Application data travels down the stack to the physical layer, where a digital-to-analog converter (DAC) creates an electrical pulse at each clock cycle — high for a 1 bit, low for a 0 — and sends it down the copper. At the far end an analog-to-digital converter (ADC) reads high as 1 and low as 0 and hands the bits up to the link layer. Cat 8 copper supports speeds up to 40 Gbps.
That scheme is called NRZ (non-return to zero): the voltage is held for the whole symbol time. It works, but notice what it depends on: the sender and receiver must get their clocks synchronized and keep them that way. If the receiver's clock drifts, it samples at the wrong instants and reads the wrong bits.
Keeping clocks in sync
One mechanism you've already met: Ethernet's preamble. Seven bytes of
10101010 announce "I'm about to send," and one byte of 10101011
— the Start of Frame Delimiter — marks where the frame begins. The alternating
pattern gives the receiver a steady stream of transitions to lock onto.
But the preamble only helps at the start. During a long run of identical bits there are no transitions at all, so clocks can drift apart mid-frame.
Manchester encoding fixes this by guaranteeing a transition every clock cycle: a 0 bit is a transition from low to high, and a 1 bit is a transition from high to low. The bit value is carried by the direction of the transition rather than by a level. Two benefits follow. Transitions keep the clocks synchronized no matter what the data looks like, and the absence of a transition during a clock cycle is itself an error indication. Manchester works better than NRZ in noisy circuits. The cost, which the slides leave implicit, is bandwidth: you're spending two signal transitions per bit.
Fiber and DWDM
Fiber works the same way with light: the DAC drives a laser or LED (on for 1, off for 0) and the receiver's photodiode feeds an ADC. Single mode fiber reaches about 40 km, multimode under 100 m, and petabit-scale speeds are theoretically possible. Could Manchester encoding be used on fiber? Yes — the encoding scheme is independent of the medium, which is the layering principle again.
Dense Wave Division Multiplexing (DWDM) gets more out of one strand: give each data stream a different color of light, transmit all colors at once, and separate them at the receiver. Multiple data streams simultaneously over a single fiber.
Two questions worth connecting. Could you encode multiple frequencies on a copper cable? Yes. And does anything else do this? Wi-Fi does exactly the same thing with radio frequencies — which is OFDM, later in these notes. One idea, three media.
Wireless networks: elements and context
Wireless is now the normal case, not the exception. There have been more mobile-broadband devices than fixed-broadband devices since around 2019 (a 5-to-1 ratio), 80% of broadband homes use Wi-Fi, and about 60% of traffic from major websites is destined for mobile devices. Add IoT and the device counts grow steeply — projections run to 50+ billion connected devices, most of them things rather than computers.
A wireless network has two parts. The core network of servers and routers reaching the Internet is normally wired. The wireless access network connects devices to that larger network, is controlled by one organization, and is called a Radio Access Network (RAN) in cellular or a Wireless LAN (WLAN) in Wi-Fi.
Its elements:
- Wireless hosts — laptops, smartphones, IoT devices — running applications. They may be stationary or mobile: wireless does not always mean mobility.
- Base station — typically connected to the wired network, relaying packets between the wired network and the wireless hosts in its area. 4G/5G cell towers and Wi-Fi access points are base stations. Note there is no real counterpart to a base station in a wired network; it's a role the wireless case creates.
- Wireless link — connecting devices to a base station, or sometimes serving as a backbone link. A multiple access protocol coordinates access (random access, FDMA, TDMA, CDMA, polling), with various rates, distances, and frequency bands.
- Wireless device radios — and there are more of these than you'd guess. An iPhone 16 has roughly eleven radios and many antennas: five cellular radios plus Wi-Fi, Bluetooth, UWB, satellite, NFC, and GPS.
Not every wireless network attaches to a larger one. Ad hoc networks — Bluetooth being the obvious example — have no infrastructure at all. Lab 4 will create ad hoc communication between devices.
Rate vs. range
Surveying the technologies — Bluetooth at 2 Mbps over 10–30 m, 802.11b at 11 Mbps indoors, 802.11g at 54 Mbps, 802.11n at 600 Mbps, 802.11ac at 3.5 Gbps, 802.11ax at 14 Gbps, 5G at 10 Gbps, 4G LTE mid-range outdoors, LEO satellites over hundreds of kilometers — one pattern dominates:
Go fast over short distances, or go slow over long distances. The reason is physics, and the next two sections explain it.
Radio basics
The mechanism, in three steps: a current at the transmitter creates an electromagnetic field in space, which induces a current at the receiver. Nothing travels but the field.
An electromagnetic wave has a handful of properties, and each of them can be used to carry information.
Frequency is how many times per second the signal repeats, measured in Hertz. A 12 Hz signal repeats 12 times in a second; a 3 Hz signal repeats 3 times. More repeats means higher frequency.
Wavelength (λ) is how far the signal travels in one cycle, and it's tied to frequency by the speed of light: frequency = c / λ. So Wi-Fi's wavelengths are about 12 cm at 2.4 GHz and about 6 cm at 5 GHz. Worth computing once yourself — it makes concrete why antenna sizes and obstacle sizes matter at these frequencies.
Amplitude measures signal strength, from average power to peak (not peak to trough). Power is the energy an antenna transmits or receives per unit time, and it can be expressed two ways: linearly in watts or milliwatts, or logarithmically in decibels (dBm):
PdBm = 10 · log10(PmW / 1 mW)
So a typical maximum mobile transmit power of 250 mW is 10 · log10(250) ≈ 24 dBm. Two useful rules of thumb: an increase of 3 dBm is roughly a doubling of power, and dBm values are relative to 1 mW, so received signals — which are far weaker than a milliwatt — come out negative. RSSI (Received Signal Strength Indicator) reports in dBm and normally runs from about −90 to −20 dBm. Don't be alarmed by negative RSSI; that's the expected case.
You'll measure RSSI in Lab 4. Some Wi-Fi cards report it per frame (USB dongles generally do), and a few also provide Channel State Information, which gives phase and amplitude per subcarrier — much richer data, and the subject of its own section below.
Power spectral density describes how much power the signal has as a function of frequency, centered on the carrier frequency. Power density is energy per unit area (watts/m2).
Phase represents the fraction of the period covered up to time t, measured in degrees (0 to 360) or radians (0 to 2π). What matters for communication is that we can measure the difference in phase between two signals — two signals might be 90 degrees out of phase, for instance.
All three of amplitude, frequency, and phase can encode data, which is the modulation section below. Note the prerequisite, though: no data can be received if the carrier is not modulated. An unmodulated carrier is a perfectly steady wave that says nothing.
Noise, attenuation, and multipath
Now the reasons wireless is hard.
Noise and SNR
The received signal is the superposition of the signal plus noise, and noise comes from two sources. Interference from other transmitters in the same band: the unlicensed 2.4 GHz ISM (Industrial, Scientific, Medical) band hosts hundreds of consumer device types — Wi-Fi, Bluetooth, Zigbee for communication, plus microwave ovens, garage-door openers, baby monitors, cordless phones, wireless mics, drones, and amateur radio. And thermal and electronic noise in the receiver itself, from natural thermal variation and imperfect electronics.
Signal to Noise Ratio (SNR) is the fundamental measure of channel quality:
SNR (dB) = 10 · log10(received signal power / noise power)
An SNR of 0 means signal and noise are equal in power. High SNR makes it easy to extract the signal; low SNR makes it hard. Typical lower limits for current radios: about −10 to −6 dB for cellular, and about 20 dB for Wi-Fi. Cellular radios work at negative SNR — below the noise floor — which is a genuinely impressive piece of engineering.
Path loss
A radio signal weakens as it propagates. Path loss (also called fading) is the reduction in power density of an electromagnetic wave as it travels from transmitter to receiver, and in free space it follows the inverse square law: signal strength attenuates with the square of distance. Double the distance, get a quarter of the signal strength.
The intuition: as the wave travels it spreads out over a larger area, so the same total power is spread thinner. This single fact explains the rate-versus-range tradeoff from earlier, and it will explain the hidden terminal problem later.
Multipath
Multipath propagation: the signal reflects off the ground, buildings, and objects, so multiple copies arrive at the receiver at slightly different times. There's usually a line of sight (LoS) component unless something blocks it, plus all the reflected paths, and all of them are superimposed at the receiver.
One consequence is a limit on speed. Coherence time (Tc) is how long a bit must be present in the channel to be received, and it bounds the maximum transmission rate, since coherence times cannot overlap — if you send bits faster than that, the delayed copies of one bit smear into the next. Coherence time is inversely proportional to frequency and to receiver velocity, so higher frequencies and faster-moving receivers both make the channel harder.
The other consequence is interference with yourself. If the multipath copies arrive in phase with the LoS signal, the waves add: constructive interference, giving greater signal strength than LoS alone. If they arrive out of phase, they cancel: destructive interference, giving less.
Why doesn't destructive interference cancel the signal completely? Because the LoS path is the shortest possible route between two points, so the reflected copies have traveled farther and attenuated more by the inverse square law. They arrive weaker than the LoS signal and can't fully cancel it. Nice case of two physical facts interacting to produce a useful result.
Antennas: MIMO and beamforming
Antennas both transmit and receive. A single antenna is old school; multiple antennas — MIMO, multiple input multiple output — are now standard.
Multiple antennas can be used three quite different ways.
Spatial diversity sends redundant streams of the same information in parallel along different spatial paths. Because multipath means the signals arriving at the receiver are not identical — some arrive at higher quality — combining them yields antenna gain, increasing SNR. This improves reliability (it's unlikely all paths degrade at once) and range (more antennas gather more signal). A two-antenna transmitter and two-antenna receiver can have a surprising number of distinct signal paths between them.
Formally, the receiver models it as yj = Σi Hi,j(xi), where Hi,j is the transformation the channel applies to the signal from transmit antenna i to receive antenna j, estimated by the receiver (often using the preamble). Note this: the receiver has to estimate what the environment did to the signal. That estimate is the CSI we'll come back to.
Spatial multiplexing is different. Instead of sending one stream redundantly, send two different streams x1 and x2 in parallel along different spatial paths. Each receive antenna gets a mixture — y1 = H1,1(x1) + H2,1(x2) — and the receiver solves for the individual streams. Diversity buys reliability; multiplexing buys throughput.
Beamforming uses a phased array: physically arrange an array of transmitting antennas and vary the phase fed to each one, and you can electronically steer the main lobe of the beam in any direction, with no moving parts. (Fighter jet radars do something similar to track multiple targets at once.)
Combine beamforming with spatial multiplexing and you get multi-user MIMO: multiple transmit antennas sending to different users at the same time, exploiting the fact that the users are geographically separated so beams can be aimed at each.
Radio spectrum
Radio spectrum is a national asset, owned by the nation, and each national government determines how it's used locally. There are three usage regimes:
- Licensed — dedicated to one owner, typically a cellular carrier, often allocated by spectrum auction.
- Unlicensed — free for anyone to use subject to rules such as transmit power limits. The ISM bands, including 2.4 GHz and 5 GHz Wi-Fi, and 3.5 GHz "private 5G" (CBRS).
- Shared — dynamically shared among users, with an "incumbent" possibly getting preferential access while others back off.
That distinction explains a lot about the interference picture: the reason your microwave interferes with your Wi-Fi is that nobody owns 2.4 GHz.
Wi-Fi bands. 2.4 GHz is divided into 11–14 channels depending on country (11 usable in the US; 13 and 14 may interfere with weather radar), used by 802.11 b/g/n/ax. The 5 GHz range offers more than 150 selectable channels (802.11 a/h/n/ac/ax). The 6 GHz range is the most recent addition, with more than 250 configurable channels (802.11 ax/be).
5G bands come in three groups, and they illustrate the rate/range tradeoff precisely. Low band below 1 GHz covers tens of miles at 50–250 Mbps. Mid band at 1–6 GHz balances the two: roughly 5 miles at 100–900 Mbps. High band at 25–66 GHz (mmWave) reaches less than a mile at up to 3 Gbps, and requires line of sight, since it penetrates trees and buildings poorly. Higher frequency, more bandwidth, more speed, less reach.
Physical-layer coding
Getting bits onto a carrier involves four stages: coding (adding error detection and correction bits), digital modulation (choosing a scheme that maximizes reliably transmitted bits/sec given the observed channel impairments), pulse shaping (matching transmission bandwidth to channel bandwidth), and RF modulation (transmitting as an electromagnetic wave on the assigned carrier frequency).
The error-coding framework is the same as at the link layer: add EDC bits so the receiver can detect and possibly correct errors. But note that EDC is used at many layers — physical, link, network, transport, and application — so a frame may carry several independent layers of redundancy.
Why add EDC at the physical layer when higher layers already do it? Two reasons: you can detect and recover locally rather than waiting for an end-to-end mechanism to notice, and physical-layer techniques can be adapted to the local radio's error characteristics.
Shuffling against burst errors
Here's a clever trick worth understanding. Radio errors come in bursts — a moment of interference wipes out several consecutive bits. Suppose the physical layer duplicates each bit for redundancy, transmitting d1 d1' d2 d2' d3 d3' d4 d4' and so on. A burst of noise long enough to destroy three consecutive bits could take out both d4 and d4', and the receiver can't recover d4.
Now shuffle the order so that a bit and its duplicate are far apart: d1 d5' d2 d6' d3 d7' d4 d8' d5 d1' d6 d2' d7 d3' d8 d4'. The same three-bit burst now destroys bits belonging to different original bits, each of which still has its copy intact elsewhere in the stream. Same redundancy, same overhead, dramatically better resistance to bursts — purely by reordering.
Modulation schemes
Digital modulation encodes bits into an analog RF carrier by changing one of its characteristics: amplitude, frequency, or phase.
- ASK (Amplitude Shift Keying): high amplitude = 1, low amplitude = 0. The simplest version transmits nothing for low amplitude, called On/Off Keying.
- FSK (Frequency Shift Keying): high frequency = 1, low frequency = 0.
- BPSK (Binary Phase Shift Keying): the phase encodes the bit, with the 0 and 1 signals 180° out of phase at the same carrier frequency.
Why stop at two phases? QPSK (Quadrature Phase Shift Keying) groups two bits into one symbol and encodes the four possible symbols (00, 01, 10, 11) using four phases. Same frequency as BPSK, twice the data rate. That's the central move in modulation: put more bits in each symbol rather than sending symbols faster.
Constellation diagrams
A constellation diagram characterizes a modulation scheme graphically, showing each symbol's amplitude and phase in the complex plane: phase is the angle counterclockwise from east, and amplitude is the distance from the origin. QPSK's diagram is four points at 45°, 135°, 225°, and 315°, all at identical amplitude — four phases, one amplitude.
QAM (Quadrature Amplitude Modulation) generalizes this by using both dimensions. m-QAM uses m different amplitude/phase combinations to encode log2(m) bits: 4-QAM gives 2 bits/symbol, 16-QAM gives 4, 64-QAM gives 6, and Wi-Fi goes up to 1024-QAM at 10 bits/symbol.
The constellation diagram also explains exactly how bit errors happen. The transmitter sends a waveform for, say, the 16-QAM symbol 1111. The receiver measures the amplitude and phase it actually received and classifies the symbol as whichever constellation point is closest. Noise displaces the received point from the transmitted one; if it's displaced far enough to land nearer a neighboring point — 1011, say — the symbol is misclassified and you get bit errors.
Which reveals the fundamental tension. Denser constellations carry more bits per symbol, but the points are packed closer together, so less noise is needed to push a received point across the boundary. Higher rate, less robustness.
Adaptive modulation
Since SNR changes constantly — interference varies, transmit power varies, devices move — the right modulation scheme changes too. As SNR increases, symbol error rate decreases; the two trade off along a curve.
Adaptive modulation changes the scheme (and power) on the fly to get the highest data rate possible at an acceptable bit error rate and energy cost. For example, 16-QAM might yield 11.5 Mbps and 64-QAM 26.9 Mbps — so when conditions allow, switch up; when they degrade, drop back. Note the structural similarity to TCP congestion control: probe for more capacity when the signals are good, back off when they aren't.
OFDM
Orthogonal Frequency Division Multiplexing is the radio version of DWDM. Split the channel into many subcarriers, each at a different frequency, and send a data symbol on each one simultaneously.
The "orthogonal" part is the trick: the spacing between subcarriers is chosen so that each subcarrier's peak falls at the nulls of its neighbors. That way they don't interfere despite being packed tightly together.
Each subcarrier's symbol is modulated with BPSK, QPSK, 16-QAM, or higher — so 1, 2, 4, 6, or up to 10 bits per symbol. Wi-Fi uses 64 subcarriers per 20 MHz channel, each carrying up to 10 bits/symbol with 1024-QAM, and 802.11ax can bond up to 8 channels together. Multiply those numbers out and the theoretical rate is enormous; actual throughput is much lower, because real channels don't support the densest modulation on every subcarrier all the time.
The preamble and CSI
Here's the problem OFDM has to solve first. The phase and amplitude the receiver measures will differ from what the sender transmitted, because of attenuation and multipath. So how does the receiver know what was sent?
Add a preamble transmitted at a pre-agreed phase and amplitude. The receiver knows what the sender used, measures what actually arrived, and computes the correction factor needed to reconcile them. That correction factor is the Channel State Information (CSI) — a measurement of what the channel, and therefore the environment, did to the signal. In the 802.11 preamble, the STF says "get ready, here comes a frame" and the LTF is used to measure CSI.
Wi-Fi: association, frames, and CSMA/CA
Joining the network
An arriving device must first establish an initial connection with a node at the wireless edge — a Wi-Fi AP or a 4G/5G base station. That connection is then used for authentication, DHCP, and gaining full network access. It's a bootstrapping step: the initial connection is just with the edge node, nothing further.
Two approaches, and both are used in practice:
- Beaconing — the network advertises itself. The mobile listens for beacon frames announcing the existence of wireless nodes.
- Probing — the mobile actively transmits probe request messages and waits for replies.
In 802.11 with beaconing: the AP broadcasts a beacon frame; the client sends an association request; the AP sends an association response. With probing: the host broadcasts a probe request, APs send probe responses, the host sends an association request to its chosen AP, and that AP responds.
Note what has not happened yet: no exchange of identity or credentials. Association only asks "can we talk?" Next the station proves it knows the AP's password through a four-way handshake, and only then does the AP accept it and issue an address via DHCP.
The 802.11 frame
Wi-Fi and Ethernet occupy the same slot in the stack — 802.11 and 802.3 are alternative MAC layers under the same network layer — but the Wi-Fi frame is more complicated. Its fields, with sizes in bytes:
frame control (2) | duration (2) | address 1 (6) | address 2 (6) |
address 3 (6) | seq control (2) | address 4 (6) | payload (0-2312) | CRC (4)
Four address fields, where Ethernet has two:
- Address 1 — MAC address of the host or AP receiving this frame (destination).
- Address 2 — MAC address of the host or AP transmitting this frame (source).
- Address 3 — MAC address of the router interface the AP is attached to. This is the field that lets the AP bridge between the wireless and wired worlds: when the AP converts an 802.11 frame to an 802.3 frame, address 3 becomes the Ethernet destination.
- Address 4 — used only in ad hoc mode.
The other fields: duration holds the reserved transmission time for RTS/CTS, seq control is a frame sequence number for reliable data transfer, and frame control subdivides into protocol version, type (0 = management, 1 = control, 2 = data), subtype, to-AP and from-AP bits, more-fragments, retry, power management, more-data, WEP, and reserved bits.
One security note the slides raise: you can see source and destination MAC addresses from a transmitter even if you're not associated with the AP. The addresses aren't encrypted, so anyone in radio range can watch who is talking to whom.
Beyond data frames carrying IP datagrams, 802.11 uses control and management frames for reliable data transfer, energy management, channel measurement, and discovery/attachment — a much richer control plane than Ethernet needs.
The hidden terminal problem
Now the reason Wi-Fi can't simply reuse Ethernet's CSMA/CD. Recall path loss: signal strength falls with the square of distance, so a node's transmission is audible only within some radius.
Consider three nodes in a line: A, B, C. A and B can hear each other. B and C can hear each other. But A and C cannot hear each other — they're beyond each other's detection threshold, or an obstacle sits between them. They are hidden terminals.
The consequence: if A and C both transmit, each believing the channel idle, their signals collide at B, which likely recovers neither. A and C effectively jam each other and neither one can tell. Carrier sensing fails, because what you sense at your own location isn't what the receiver experiences at its location. This has no analogue in wired Ethernet, where everyone on a segment hears everything.
A second, related problem: fading. B may sense an idle channel simply because A's transmission faded below its detection threshold, and transmit into an ongoing frame.
And a third: collision detection is hard wirelessly. A transmitting radio's own signal swamps its receiver, so it can't listen while sending. Hence the shift from CD to CA.
CSMA/CA
The 802.11 MAC protocol is CSMA/CA — carrier sense multiple access with collision avoidance. The sender:
- If the channel is sensed idle for DIFS (a defined interframe space), transmit the entire frame — with no collision detection.
- If the channel is sensed busy, start a random backoff timer, which counts down only while the channel is idle, and transmit when it expires.
- If no ACK arrives, increase the random backoff interval and repeat step 2.
And the receiver: if a frame is received correctly, return an ACK after SIFS (a shorter interframe space). The ACK is needed precisely because of the hidden terminal problem — the sender cannot detect collisions itself, so an explicit acknowledgment is the only way to learn whether the frame arrived. Note the contrast with Ethernet, which has no link-layer ACKs at all.
On a collision, both senders see no ACK, wait DIFS, then wait a randomized backoff drawn from a range up to roughly 200 ms depending on the PHY, with the interval doubling after each collision. Same binary exponential backoff idea as Ethernet, applied to a problem the sender can only infer.
RTS/CTS
For an explicit fix to hidden terminals, 802.11 offers channel reservation using small reservation packets:
- The sender transmits a short request-to-send (RTS) packet using CSMA, containing the duration of the data transmission to follow. RTS packets can still collide with each other, but they're short, so little time is wasted.
- The receiver (typically the AP) broadcasts a clear-to-send (CTS) in response, also containing the duration.
- The CTS is heard by all nodes in range of the AP — including the hidden terminals that couldn't hear the original sender. All of them defer their transmissions for the stated duration.
- The sender transmits the data frame, and receives an ACK.
That's the elegant part: even though A and C can't hear each other, both can hear the AP, so the AP's CTS is what coordinates them. The cost is two extra round trips of overhead per frame, which is why RTS/CTS is typically used only for larger frames.
A day in the life, Wi-Fi edition
Putting it together for one HTTP request from a laptop:
- The HTTP request goes into a TCP segment, into an IP datagram, into an 802.11 frame, which enters the MAC scheduling queue awaiting transmission.
- The device sends an RTS control frame using CSMA/CA; the AP responds with CTS.
- The device sends the DATA frame to the AP, which buffers it.
- The AP responds with an ACK; the device removes the frame from its queue; the AP forwards the frame to the router.
Channel State Information as a side channel
Recall why CSI exists: the receiver needs to know what the environment did to the signal so it can undo it. But turn that around. If CSI describes the environment's effect on the signal, then CSI is a measurement of the environment. Anything that changes the environment changes the CSI.
Published work has used CSI from ordinary Wi-Fi transmissions for device-free fall detection, identifying keystrokes on a keyboard, gesture and smoking detection, and person identification. And since data transmissions are all around us all the time, this is a side channel available essentially everywhere — a signal intended for information exchange being used to infer something else entirely.
It goes further. The Vital-Radio work transmits an RF signal and measures phase changes in the reflections: breathing changes the path length slightly, which induces a measurable phase change, so the system can determine respiration rate and heart rate through the air. Newer research does this from background Wi-Fi transmissions rather than a purpose-built signal. Worth thinking about what that means in a business setting, or a home.
A related idea: backscatter, where a device reflects and modulates ambient transmissions instead of generating its own, allowing communication with no battery at all. Plausible prediction: many IoT devices go battery-less.
Lab 4: RSSI as a shared secret
Lab 4 uses this constructively. RSSI is a coarse representation of CSI. The idea:
- Two devices rapidly exchange frames, each independently measuring RSSI and converting high RSSI to a 1 bit and low RSSI to a 0 bit.
- By reciprocity, the signal fades the same way in both directions, so both devices should compute the same key.
- Moving a hand near the two stations creates hard-to-predict periods of constructive and destructive interference, as the LoS path and the multipath signal reflected from the hand arrive superimposed — producing periods of high and low RSSI.
- That shared key then bootstraps long-term secure communication.
The physics doing the work is exactly the multipath interference from earlier in these notes. An eavesdropper at a different location experiences different multipath and so cannot reproduce the sequence.
Bluetooth
Bluetooth is the example of a wireless ad hoc network: devices have no infrastructure to connect to, so they must find each other and organize a network from scratch. It handles channel allocation, address assignment, service discovery, application-to-application communication, and security — and it needs an entirely different architecture and protocol stack from the Internet's.
A Bluetooth network is a piconet: coverage generally under 10 m diameter, no more than 8 devices. The device that forms the network takes the central role; up to 7 others take peripheral roles. Communication happens only between central and peripheral — no direct peripheral-to-peripheral communication. Each device has a unique 48-bit address, and it operates in the unlicensed 2.4 GHz ISM band.
Channel details: Classic Bluetooth uses 1 MHz per channel across 79 channels, with a maximum network rate around 2.1 Mbit/s; BLE uses 2 MHz per channel across 40 channels (3 advertising, 37 data). The channel is time-division multiplexed with a 625 microsecond slot, and access is by polling — the central device grants channel access to peripherals.
Frequency hopping
Senders hop among the 79 frequencies, transmitting on a different one after each slot, following a hopping pattern known to all devices in the piconet. Different piconets use different patterns, so several can coexist in the same space.
Why hop? To minimize the effects of interference. The ISM band is full of potential interferers, and if one of them is sitting on channel x, then x comes up only occasionally in your hopping sequence. A frame lost to interference on x is retransmitted on a different frequency in the next slot. Rather than trying to find a clean channel, assume every channel is occasionally bad and spread your exposure across all of them.
Stack
The Bluetooth stack is completely different from the Internet stack, and the differences reflect its special purpose. There is no network or transport layer — no routing in Classic Bluetooth, though BLE adds managed flooding — and the layers are not as conceptually clean as the Internet's. Deeply embedded in the architecture is a split between a host (in the OS: applications, end-to-end services, and the L2CAP layer) and a controller (in firmware: link and physical layers, with separate controllers for Classic and BLE), joined by a Host-Controller Interface.
L2CAP (Logical Link Control and Adaptation) creates and manages end-to-end channels between two devices, for application data or higher-level services, providing reliability, flow control, and segmentation. Channel types are connection-oriented asynchronous (ACL), connectionless asynchronous (ACL), and synchronous (eSCO) for things like periodic audio.
Software-defined radio and IoT
Traditionally a radio required specialized hardware with functions implemented in hardware, which meant you couldn't easily change anything after assembly. Software-defined radio (SDR) replaces that with commodity hardware controlled by software, so you can build your own custom waveforms. The price range is instructive: an RTL-SDR (receive only) is around $20, a HackRF One (transmit and receive) around $300, and an Ettus X410 with MU-MIMO around $30,000.
GNU Radio is free and open source software for composing a software radio by connecting blocks of code — many pre-made, and you can write your own — and it drives many kinds of SDR hardware.
The reason this matters: radio used to be the domain of specialists with expensive equipment. For a couple hundred dollars and open source software, it now isn't. That's an opportunity for experimentation and, equally, for attack.
IoT requirements
IoT use cases are enormous in number — monitoring pressure, vibration, tilt, temperature, humidity, switches, battery charge, leaks, cracks, strain, fill levels; asset geolocation and tracking; warehouse security; monitoring transport conditions for food safety.
The technical tradeoffs are three-dimensional. Distance ranges from meters to kilometers. Data rates run from hundreds of bps when active (metering) to about 1 Mbps (video surveillance). And energy is always a consideration, with some devices expected to run ten years without external power, or to harvest energy locally.
Different technologies sit at different corners: short range with high data rate (Wi-Fi, BLE, Zigbee), wide area with low power (LoRaWAN, LTE-M), and wide area coverage with high data rate via traditional cellular (4G/5G). You can't have all three at once, which is why IoT is a collection of technologies rather than one.
Exercises
To do before/around the next class:
- Compute the wavelength of a 2.4 GHz and a 6 GHz Wi-Fi signal from c and the frequency. Then explain, using path loss and wavelength, why the 6 GHz band offers more channels but less range.
- Convert to dBm: 1 mW, 100 mW, and 250 mW. Then confirm that adding 3 dBm roughly doubles the power. Why is a received RSSI of −70 dBm a perfectly healthy value?
- Draw the constellation diagrams for BPSK, QPSK, and 16-QAM. For each, state the bits per symbol, and explain which is most vulnerable to noise and why.
- Take the shuffling example from the coding section. Write out an 8-bit sequence with duplicates, shuffle it, and find a 3-bit burst that is unrecoverable in the unshuffled version but recoverable in the shuffled one.
- Explain why 802.11 needs link-layer ACKs when Ethernet does not. Your answer should mention hidden terminals.
- In the RTS/CTS exchange, work out why the CTS solves the hidden terminal problem but the RTS alone would not.
- If you have a Wi-Fi dongle that reports RSSI, capture a few hundred frames while moving your hand between the two devices. Do you see the alternating high and low periods Lab 4 depends on?
Terms
Not a comprehensive reference — the textbook has much more — but these are the terms from Day 11 that will keep coming back.
- NRZ (non-return to zero)
- Line coding that holds a voltage level for the whole symbol time: high = 1, low = 0. Simple, but offers no transitions to keep clocks synchronized during runs of identical bits.
- Manchester encoding
- Line coding with a guaranteed transition every clock cycle — low-to-high for 0, high-to-low for 1. Keeps clocks in sync and makes a missing transition an error indication.
- DAC / ADC
- Digital-to-analog and analog-to-digital converters, turning bits into electrical or light pulses and back.
- DWDM (Dense Wave Division Multiplexing)
- Sending several data streams simultaneously over one fiber by giving each a different color of light and separating them at the receiver.
- RAN / WLAN
- Radio Access Network (cellular) or Wireless LAN (Wi-Fi): the wireless access network connecting devices to a normally wired core network.
- base station
- A relay between the wired network and wireless hosts in its area — a cell tower or a Wi-Fi AP. Has no counterpart in wired networks.
- ad hoc network
- A wireless network with no infrastructure, where devices organize themselves. Bluetooth is the standard example.
- frequency / wavelength / amplitude / phase
- Repetitions per second (Hz); distance traveled in one cycle (frequency = c/λ); signal strength from average to peak; and the fraction of the period elapsed, in degrees or radians. All four can encode data.
- dBm
- Power in decibels relative to 1 mW: PdBm = 10 log10(PmW). 250 mW ≈ 24 dBm; +3 dBm roughly doubles power; received signals are negative.
- RSSI (Received Signal Strength Indicator)
- A per-frame measure of received signal strength in dBm, typically −90 to −20. A coarse representation of CSI.
- SNR (Signal to Noise Ratio)
- 10 log10(signal power / noise power), the fundamental measure of channel quality. Lower limits are roughly −10 to −6 dB for cellular and 20 dB for Wi-Fi.
- ISM band
- Unlicensed Industrial, Scientific, and Medical spectrum, including 2.4 GHz — shared by Wi-Fi, Bluetooth, Zigbee, microwave ovens, baby monitors, and much else.
- path loss / inverse square law
- Attenuation of an electromagnetic wave as it propagates. In free space, signal strength falls with the square of distance: double the distance, quarter the strength.
- multipath propagation
- Reflections cause multiple copies of a signal to arrive at slightly different times, superimposed with the line-of-sight component.
- coherence time
- How long a bit must remain in the channel to be received, bounding the maximum transmission rate since coherence times cannot overlap. Inversely proportional to frequency and receiver velocity.
- constructive / destructive interference
- Multipath copies arriving in phase add, giving more strength than LoS alone; arriving out of phase they cancel. Cancellation is never complete, because reflected paths travel farther and attenuate more.
- MIMO
- Multiple input multiple output antennas. Spatial diversity sends redundant streams over different paths for reliability and range; spatial multiplexing sends different streams in parallel for throughput.
- beamforming / phased array
- Varying the phase fed to each antenna in an array to steer the beam's main lobe electronically. Combined with multiplexing it yields multi-user MIMO, serving geographically separated users simultaneously.
- licensed / unlicensed / shared spectrum
- Dedicated to one owner (often auctioned), free for anyone conforming to power rules (ISM, Wi-Fi, CBRS), or dynamically shared with incumbents getting preference.
- mmWave
- 5G high-band spectrum at 25–66 GHz: up to ~3 Gbps but under a mile, requiring line of sight since it penetrates trees and buildings poorly.
- EDC shuffling
- Reordering data and its redundant copies so that a burst of noise damages bits belonging to different originals, each of which still has an intact copy elsewhere.
- ASK / FSK / BPSK
- Modulation by amplitude, frequency, or phase respectively, one bit per symbol. BPSK's two signals are 180° apart at the same carrier frequency.
- symbol
- A group of bits encoded as one waveform. QPSK carries 2 bits/symbol using four phases, doubling BPSK's rate at the same frequency.
- constellation diagram
- Symbols plotted in the complex plane by phase (angle) and amplitude (distance from origin). Receivers classify a received signal as the nearest point, so noise that displaces it past a boundary causes bit errors.
- QAM (Quadrature Amplitude Modulation)
- m-QAM uses m amplitude/phase combinations for log2(m) bits per symbol: 4-QAM = 2 bits, 16-QAM = 4, 64-QAM = 6, up to 1024-QAM = 10 in Wi-Fi. Denser constellations mean higher rates and less noise tolerance.
- adaptive modulation
- Changing modulation scheme and power on the fly as SNR varies, to get the highest rate at an acceptable bit error rate.
- OFDM
- Orthogonal Frequency Division Multiplexing: many subcarriers spaced so each one's peak falls at its neighbors' nulls, each carrying a modulated symbol. Wi-Fi uses 64 subcarriers per 20 MHz channel and can bond up to 8 channels.
- CSI (Channel State Information)
- The correction factor a receiver computes by comparing a preamble's known transmitted phase and amplitude to what actually arrived. Being a measurement of the environment, it doubles as a side channel for sensing.
- association
- The initial connection between an arriving device and a wireless edge node, established by beaconing or probing, before authentication or DHCP. Asks only "can we talk?"
- 802.11 frame addressing
- Four address fields: 1 = receiving host or AP, 2 = transmitting host or AP, 3 = the router interface the AP attaches to (used when bridging to Ethernet), 4 = ad hoc mode only.
- hidden terminal
- Two nodes that can each hear a third but not each other, so they transmit simultaneously and jam the middle node without ever detecting a problem. A consequence of path loss or obstacles, with no wired analogue.
- CSMA/CA
- 802.11's MAC protocol: sense idle for DIFS then transmit the whole frame with no collision detection; if busy, back off randomly, counting down only while idle; if no ACK arrives, double the backoff and retry.
- DIFS / SIFS
- Interframe spaces — the longer interval a sender must observe an idle channel before transmitting, and the shorter one a receiver waits before returning an ACK.
- RTS/CTS
- Channel reservation: a short request-to-send names the coming transmission's duration, and the receiver's clear-to-send broadcast makes every node in its range defer — including hidden terminals that couldn't hear the sender.
- piconet
- A Bluetooth network: under 10 m, at most 8 devices, one central and up to 7 peripherals, with no peripheral-to-peripheral communication. Channel access by polling.
- frequency hopping
- Changing transmit frequency each slot along a pattern known to the piconet, so that an interferer camped on one channel affects only occasional slots.
- L2CAP
- Bluetooth's Logical Link Control and Adaptation layer, managing end-to-end channels with reliability, flow control, and segmentation. Bluetooth has no network or transport layer.
- SDR (software-defined radio)
- Commodity radio hardware controlled by software, allowing custom waveforms. RTL-SDR (~$20, receive only) through Ettus X410 (~$30,000). Driven by tools like GNU Radio.
- backscatter
- Communicating by reflecting and modulating ambient RF transmissions rather than generating a signal, enabling battery-free devices.