IEEE 802.11 Basics

Wireless LAN I
IEEE 802.11 Basics
©2020 Mahbub Hassan

1. IEEE 802.11 vs. WiFi
2. IEEE Standards Numbering System
3. Key features of 802.11
4. 802.11 Bands and Channels
5. Hidden Node Problem and 4-Way Handshake RTS/CTS) 6. 802.11 MAC (inter-frame space, PCF, DCF)
7. 802.11 Architecture and Addressing
8. 802.11 Frame Format
9. 802.11 Power Management
©2020 Mahbub Hassan

IEEE 802.11 vs. WiFi
q IEEE 802.11 is a standard
q WiFi = “Wireless Fidelity” is a trademark
q Fidelity = Compatibility between wireless equipment from different manufacturers
q WiFi Alliance is a non-profit organization that does the compatibility testing (WiFi.org)
q 802.11 has many options and it is possible for two equipment based on 802.11 to be incompatible.
q All equipment with “WiFi” logo have selected options such that they will interoperate.
©2020 Mahbub Hassan

IEEE Standards Numbering System
q IEEE 802.* and IEEE 802.1* standards (e.g.,
IEEE 802.1Q-2011) apply to all IEEE 802 technologies:
Ø IEEE 802.3 Ethernet Ø IEEE 802.11 WiFi
Ø IEEE 802.16 WiMAX
802 Overview and Architecture
802.2 Logical Link Control
802.1 Bridging
802.1 Management
802.10 Security
802.3 Ethernet
802.11 WiFi
802.17 Resilient Packet
Ring (RPR)
©2020 Mahbub Hassan

Lettered vs. Numerical Versions
q IEEE 802.11 uses letters to name the versions
Ø E.g., 802.11a/b (1999), 802.11g (2003), 802.11n (2009), 802.11ac
(2013), and so on
q WiFi Alliance proposes numbers to simplify
Ø E.g., WiFi 4 (802.11n), WiFi 5 (802.11ac), WiFi 6 (802.11ax) …
©2020 Mahbub Hassan

IEEE 802.11 Features
q Data rate (a.k.a. speed)
Ø Original IEEE 802.11-1997 was at 1 and 2 Mbps.
Ø Newer versions at 11 Mbps, 54 Mbps, 108 Mbps, 1.2 Gbps, …
q Spectrum licensing
Ø All versions use license-exempt spectrum
Ø Spread spectrum (in old versions) Ø OFDM (in new versions)
q Supports multiple priorities (time-critical and data traffic) q Power management allows a node to `doze off’
Ø Longer battery life ©2020 Mahbub Hassan

IEEE 802.11 Physical Layers
q Issued in several stages
q First version in 1997: Legacy IEEE 802.11 (no longer used)
Ø 3 physical layer specifications (2 in 2.4-GHz, 1 in infrared)
Ø All operating at 1 and 2 Mbps
q Amendments in 1999:
Ø IEEE 802.11a-1999: 5-GHz band, 54 Mbps/20 MHz, OFDM
Ø IEEE 802.11b-1999: 2.4 GHz band, 11 Mbps/22 MHz (spread spectrum)
q Amendment in 2003:
Ø IEEE 802.11g-2003 : 2.4 GHz band, 54 Mbps/20 MHz, OFDM
©2020 Mahbub Hassan

q Industrial, Scientific, and Medical bands. License exempt
6.765 MHz 13.553 MHz 26.957 MHz 40.660 MHz
902.000 MHz
24.000 GHz
61.000 GHz 122.000 GHz 244 GHz
To Bandwidth
Availability
Worldwide Worldwide Worldwide
America, Greenland
Worldwide Worldwide Worldwide
6.795 MHz 13.567 MHz 27.283 MHz 40.700 MHz
928.000 MHz
24.250 GHz
61.500 GHz 123.000 GHz 246 GHz
14 kHz 326 kHz 40 kHz
100 MHz 150 MHz 250 MHz 500 MHz 1 GHz 2 GHz
433.050 MHz
434.790 MHz
Europe, Africa, Middle east, Former Soviet Union
Ref: http://en.wikipedia.org/wiki/ISM_band ©2020 Mahbub Hassan

WLAN/WiFi Standard
Frequency Band
802.11b/g/n
802.11a/n/ac/ax
6 GHz (not confirmed yet)
802.11p (car-to-car)
5.9 GHz (licensed band)
802.11ah (IoT)
802.11af (Rural)
700 MHz (unused TV channels)
802.11ad/ay (Multi Gbps wireless applications: e.g., cable replacement, VR, …)
©2020 Mahbub Hassan

q The entire band is divided into several individual channels
q An AP operates over a single channel at any given time
q Different nearby APs can operate over different channels of the same band
Ø Avoid congestion and interference
q Each channel is usually 20 or 22 MHz wide
q With newer WiFi versions, it is possible to combine two or more channels to get a wider channel
Ø More bandwidth for higher data rates
©2020 Mahbub Hassan

2.4 GHz WiFi Channel Frequencies
q A total of 14 channels (not all channels available in all countries) q Centre frequencies are 5 MHz apart (except channel 14)
q Each channel is 22 MHz wide
From http://www.radio-electronics.com/info/wireless/wi-fi/80211-channels-number-frequencies-bandwidth.php
©2020 Mahbub Hassan

2.4 GHz Channel Overlaps
q Most channels in 2.4 GHz band overlap
q Maximum of three non-overlapping channels are possible
q 1-6-11 are most widely used non-overlapping channels (6 is usually default)
Ø E.g., if three are three nearby APs in an enterprise, they are usually set to 1-6-11
From http://boundless.aerohive.com/experts/WLAN-Channels-Explained.html
©2020 Mahbub Hassan

Channels in 5 GHz Band
q 20 MHz channels (c.f. 22 MHz in 2.4 GHz band)
q Non-overlapping (c.f., mostly overlapping in 2.4 GHz) q Two types of channels
Ø Always available
Ø Channels used by radar (requires DFS)
q Dynamic Frequency Selection (DFS): WiFi AP monitors radar channels and vacate them (switch to another channel) if radar is detected
Ø May cause connection drop for clients ©2020 Mahbub Hassan

5GHz Channel Structure
Source: https://www.ekahau.com/blog/channel-planning-best-practices-for-better-wi-fi/ (accessed 15 June 2020): this structure is probably for the US; radar channels may vary with countries
©2020 Mahbub Hassan

Hidden Node Problem
q A can hear B, B can hear C, but C cannot hear A (C and A are hidden from each other)
q C may start transmitting while A is also transmittingàcollision at B! A and C (wireless transmitters) can’t detect collision (why?).
q CSMA/CD is not possible (CD = collision detection; CD used in Ethernet) àin WLAN, only the receiver can help avoid collisions
q 4-way handshake needed to implement CA (collision avoidance) in WLAN ©2020 Mahbub Hassan

Mobile Node
Access Point
Ready to send (RTS)
©2020 Mahbub Hassan
Way Handshake
Clear to send (CTS)

IEEE 802.11 MAC
q Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)
q Listen before you talk. If the medium is busy, the transmitter backs off for a random period.
q Avoids collision by sending a short message:
Ready to send (RTS)
RTS contains dest. address and duration of message. Tells everyone to backoff for the duration.
q Destination sends: Clear to send (CTS)
Other stations set their network allocation vector (NAV) and wait for that duration
q Cannot detect collision, hence each packet is acked. q MAC-level retransmission if not acked.
©2020 Mahbub Hassan

IEEE 802.11 Priorities with Inter
Busy SIFS Carrier
frame space
Random Backoff
Backoff Slots
q 802.11 has different priorities for control, data, and time-critical packets
q Achieve priorities by using different amounts of interframe space (IFS)
q Highest priority frames, e.g., Acks, use short IFS (SIFS)
q Medium priority time-critical frames use “Point Coordination Function IFS” (PIFS)
q Asynchronous data frames use “Distributed coordination function IFS” (DIFS)
©2020 Mahbub Hassan

Time Critical Services
Super Frame
Contention-Free Period
PCF Access Beacon
Contention Period
DCF Access
q Timer critical services use Point Coordination Function
q The point coordinator allows only one station to access
q Coordinator sends a beacon frame to all stations.
Then uses a polling frame to allow a particular station to have contention-free access
q Contention Free Period (CFP) varies with the load. ©2020 Mahbub Hassan

IEEE 802.11 DCF Backoff
q MAC works with a single FIFO Queue
Ø Focuses on transmitting the packet at the head of the queue
q Three variables:
Ø Contention Window (CW)
Ø Backoff count (BO)
Ø Network Allocation Vector (NAV)
q If a frame (RTS, CTS, Data, Ack) is heard, NAV is set to the duration in that frame. Stations sense the media after NAV expires.
q If the medium is idle for DIFS, and backoff (BO) is not already active, the station draws a random BO in [0, CW] and sets the backoff timer.
Ø CW is in units of slot time (slot time varies with 802.11 standards)
q If the medium becomes busy during backoff, the timer is paused and a new
NAV is set. After NAV, back off continues.
©2020 Mahbub Hassan

IEEE 802.11 DCF Backoff (Cont)
q BO = random(0,CW)
q Initially and after each successful transmission:
CW = CWmin q After each unsuccessful attempt
CW = min{2CW + 1, CWmax}
©2020 Mahbub Hassan
Code Help
q Assume that we have CWmin=3 and CWmax=127 configured for a given WLAN. What would be the values of CW if there were 8 successive unsuccessful attempts after initalizing the network?
After initialization, CW = CWmin = 3
After 1st unsuccessful attempt, CW = min(7,127) = 7 After 2nd unsuccessful attempt, CW = min(15,127) = 15 Then on, 31, 63, 127, 127, 127, …
©2020 Mahbub Hassan

Parameter Values:
interframe space and contention window
Slot-time (μs)
11n (2.4 GHz)
11n (5 GHz)
q PIFS = SIFS + 1 slot time
q DIFS=SIFS + 2slottimes=PIFS+1slottime
Slot time: basic unit of backoff algorithm
©2020 Mahbub Hassan

q What is the duration of PIFS and DIFS for IEEE 802.11b?
Slot time = 20 μs SIFS = 10 μs
PIFS = SIFS + slot time = 10+20 = 30 μs DIFS = SIFS + 2 x slot time = 10 + 40 = 50 μs
©2020 Mahbub Hassan

Virtual Carrier Sense
q Every frame has a “Duration ID” which indicates how long the medium will be busy.
Ø RTShasdurationofRTS+SIF+CTS+SIF+Frame+SIF+Ack Ø CTShasdurationofCTS+SIF+Frame+SIF+Ack
Ø Frame has a duration of Frame + SIF + ACK
Ø ACK has a duration of ACK
Ø A station has to estimate the durations of RTS/CTS/ACK
q All stations keep a “Network Allocation Vector (NAV)” timer
in which they record the duration of each frame they hear.
q Stations do not need to sense the channel until NAV becomes zero (conserve power)
©2020 Mahbub Hassan
浙大学霸代写 加微信 cstutorcs
q Consider an 802.11b WLAN. A station estimates the transmission times of RTS, CTS, and ACK as 10 μs, 10 μs, and 25 μs, respectively. What would be the value of the Duration field in the RTS header if the station wants to send a 250 μs long data frame ?
802.11b has a SIFS duration of 10 μs.
Duration field in RTS = RTS_time + CTS_time + ACK_time + data_time + 3xSIFS
= 10+10+25+250+3×10 = 325 μs
©2020 Mahbub Hassan

802.11 with RTS/CTS
When a node is sensing the channel, it must be free for DIFS period. SIFS is used as the wait time between the RTS, CTS, DATA and ACK
frames. SIFS < DIFS means that another node cannot incorrectly determine that the channel is idle during the 4-way handshake between two other nodes. ©2020 Mahbub Hassan DCF Example q Example: Slot Time = 1, CWmin = 5, DIFS=3, PIFS=2, SIFS=1 q T=1 Station 2 wants to transmit but the media is busy q T=2 Stations 3 and 4 want to transmit but the media is busy q T=3 Station 1 finishes transmission. q T=4 Station 1 receives ack for its transmission (SIFS=1) Stations 2, 3, 4 set their NAV to 1. q T=5 Medium becomes free q T=8 DIFS expires. Stations 2, 3, 4 draw backoff count between 0 and 5. The counts are 3, 1, 2 AP S2 S3 S4 Ack CTS DIFS 8 10 12 14 16 18 20 22 24 26 28 30 32 34 ©2020 Mahbub Hassan DCF Example (Cont) q T=9 Station 3 starts transmitting. Announces a duration of 8 (RTS + SIFS + CTS + SIFS + DATA + SIFS + ACK). Station 2 and 4 pause backoff counter at 2 and 1 resp. and wait till T=17 q T=15 Station 3 finishes data transmission q T=16 Station 3 receives Ack. q T=17 Medium becomes free q T=20 DIFS expires. Station 2 and 4 notice that there was no transmission for DIFS. Stations 2 and 4 start their backoff counter from 2 and 1, respectively. q T=21 Station 4 starts transmitting RTS Ack CTS DIFS AP S2 S3 S4 8 10 12 14 16 18 20 22 24 26 28 30 32 34 ©2020 Mahbub Hassan IEEE 802.11 Architecture Distribution System (DS) Access Point Access Point Ad-hoc Station Ad-hoc Station Basic Service Set (BSS) ©2020 Mahbub Hassan Ad-hoc network IEEE 802.11 Architecture (Cont) q Basic Service Set (BSS) = Set of stations associated with one AP q Distribution System (DS) - wired backbone q Independent Basic Service Set (IBSS): Set of computers in ad-hoc mode. May not be connected to wired backbone. q Ad-hoc networks coexist and interoperate with infrastructure- based networks q BSSID: 48-bit MAC address of the AP q IBSSID: randomly generated address q 2 bits are fixed, 46 bits are generated randomly q All-1s BSSID/IBSSID is used for broadcast ©2020 Mahbub Hassan Code Help, Add WeChat: cstutorcs Frame Format 16b 16b 48b 48b 48b 16b 48b 32b 2b 2b 4b 1b 1b 1b 1b 1b 1b 1b 1b q Type: Control, management, or data q Sub-Type: Association, disassociation, re-association, probe, authentication, de-authentication, CTS, RTS, Ack, Power-Save Poll (PS- POLL) ... q Retry/retransmission q Power mgt: Going to Power Save mode q More Data: More buffered data at AP for a station in power save mode q WEP: Wireless Equivalent Privacy (Security) info in this frame q Order: Strict ordering ©2020 Mahbub Hassan Frame Control Duration/ ID Seq Control Prot. Ver. More Frag. MAC Frame Fields q Duration/Connection ID: Ø If used as duration field, indicates time (in μs) channel will be allocated for successful transmission of MAC frame. Includes time until the end of Ack Ø In some control frames, contains association or connection identifier q Sequence Control: Ø 4-bit fragment number subfield q For fragmentation and reassembly Ø 12-bit sequence number Ø Number frames between given transmitter and receiver ©2020 Mahbub Hassan 802.11 Frame Address Fields q Source/Destination: ultimate network devices that prepare and decode the frame for network layer q Transmitter(Tx)/Receiver(Rx): Could be the source/destination, or intermediate radio devices, e.g., access point (AP) q 4 address fields; defined by 2 DS bits data frames Destination From AP (from infra.) ToAP (to infra.) AP-to-AP (W’less Brdg) ©2020 Mahbub Hassan 802.11 Addressing: Wireless Client to Server Addresses in frames transmitted by the client radio ADR1: AP MAC address (BSSID) ADR2: Client MAC address (source address) ADR3: Server MAC address (destination address) ADR4: Not applicable ©2020 Mahbub Hassan 802.11 Addressing: Server to Wireless Client Addresses in frames transmitted by the AP radio ADR1: Client MAC address (destination address) ADR2: AP MAC address (BSSID) ADR3: Server MAC address (source address) ADR4: Not applicable ©2020 Mahbub Hassan q Consider the example WLAN in the figure where two BSSs are connected via a distribution system. What is the content of the Address 3 field when Station A wants to send a packet to Station B via AP 1? q In this case (To DS=1, From DS=0), Address 3 field should contain the address of the destination station. Therefore, it should be the address of B. Example 802.11 addressing ©2020 Mahbub Hassan Power Saving q Extending the battery life of portable devices is one of the main challenges of wireless networks. q Mechanisms must be devised to let the device sleep as much as possible and wake up only when it needs to transmit or receive. q If there are no packets to be received, a receiver could go to sleep and save battery power. q To facilitate this kind of power saving, IEEE 802.11 has a power management function. ©2020 Mahbub Hassan 802.11 Power Management q Station tells the base station its mode: Power saving (PS) or active Ø Mode changed by Power Mgmt bit in the frame control header. q All packets destined to stations in PS mode are buffered (at AP) q AP broadcasts list of stations with buffered packets in its beacon frames: Traffic Indication Map (TIM) q When a station wakes up, it waits for the beacon; sends a PS-Poll message to AP if its bit is turned on in TIM; AP then sends one frame with buffered data and sets the More Data bit in the header if more data in the buffer (station does not go back to sleep after receiving one frame if More is set). ©2020 Mahbub Hassan Traffic Indication Map (TIM) q A bit map inside a beacon q 2008 bits; each bit represents an Association ID (one associated client) q If packets are buffered in the AP for a given Association ID, its corresponding bit is set to ‘1’, ‘0’ otherwise ©2020 Mahbub Hassan 1. 802.11 PHYs: Spread spectrum in earlier versions, but OFDM in new versions 2. 2.4 GHz channels (22 MHz) are mostly overlapped, but 5 GHz channels (20 MHz) are non-overlapped, but some are shared with the radar service 3. High speed applications can be supported by combining multiple adjacent channels into single channel with higher bandwidth 4. 802.11 uses SIFS, PIFS, DIFS for priority 5. WLAN frames have four address fields 6. 802.11 supports power saving mode ©2020 Mahbub Hassan q APSD q BO q BSA q BSS q BSSID q CA q CDMA q CFP q CSMA q CTS ©2020 Mahbub Hassan Acknowledgement Access Point Automatic Power Save Delivery Backoff Basic Service Area Basic Service Set Basic Service Set Identifier Collision Avoidance Collision Detection Code Division Multiple Access Contention Free Period Cyclic Redundancy Check Carrier Sense Multiple Access Clear to Send Congestion Window Maximum Congestion Window q CWmin q DA q ESA q ESS q FH q FIFO q GHz q IBSS q ID q IEEE q IFS q ISM q LAN ©2020 Mahbub Hassan Acronyms (Cont) Minimum Congestion Window Destination Address Distributed Coordination Function DCF Inter-frame Spacing Direct Sequence Extended Service Area Extended Service Set Frequency Hopping First In First Out Giga Hertz Independent Basic Service Set Identifier Institution of Electrical and Electronics Engineers Inter-frame spacing Instrumentation, Scientific and Medical Local Area Network q MAC q MHz q MIMO q NAV q OFDM q PCF q PHY q PIFS q PS q QoS q RA q RTS q SA q SIFS Acronyms (Cont) Media Access Control Mega Hertz Multiple Input Multiple Output Network Allocation Vector Orthogonal Frequency Division Multiplexing Point Coordination Function Physical Layer PCF inter-frame spacing Power saving Quality of Service Receiver Address Ready to Send Source Address Short Inter-frame Spacing ©2020 Mahbub Hassan Acronyms (Cont) Subscriber Station Transmitter's Address Traffic Indication Map Wireless Fidelity Wireless Local Area Network ©2020 Mahbub Hassan