Lecture 05-WLAN Basics
Lecture 05-WLAN Basics
1
Overview
2
IEEE 802.11 vs. WiFi
❑ IEEE 802.11 is a standard
❑ WiFi = “Wireless Fidelity” is a trademark
❑ Fidelity = Compatibility between wireless equipment
from different manufacturers
❑ WiFi Alliance is a non-profit organization that does
the compatibility testing (WiFi.org)
❑ 802.11 has many options and it is possible for two
equipment based on 802.11 to be incompatible.
❑ All equipment with “WiFi” logo have selected options
such that they will interoperate.
©2020 Mahbub Hassan
3
IEEE Standards Numbering System
❑ 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 802.11 802.17
Etherne WiFi Resilient
… … Packet …
t
Ring
(RPR)
4
Lettered vs. Numerical Versions
5
IEEE 802.11 Features
❑ 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, …
❑ Spectrum licensing
All versions use license-exempt spectrum
❑ PHYs:
Spread spectrum (in old versions)
OFDM (in new versions)
❑ Supports multiple priorities (time-critical and data traffic)
❑ Power management allows a node to `doze off’
Longer battery life
6
IEEE 802.11 Physical Layers
❑ Issued in several stages
❑ 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
❑ 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)
❑ Amendment in 2003:
IEEE 802.11g-2003 : 2.4 GHz band, 54 Mbps/20 MHz, OFDM
7
ISM Bands
❑ Industrial, Scientific, and Medical bands. License exempt
Ref: http://en.wikipedia.org/wiki/ISM_band
©2020 Mahbub Hassan
8
WLAN/WiFi Bands
WLAN/WiFi Standard Frequency Band
802.11a/n/ac/ax 5 GHz
9
WiFi Channels
❑ The entire band is divided into several individual channels
❑ An AP operates over a single channel at any given time
❑ Different nearby APs can operate over different channels of the
same band
Avoid congestion and interference
❑ Each channel is usually 20 or 22 MHz wide
❑ With newer WiFi versions, it is possible to combine two or
more channels to get a wider channel
More bandwidth for higher data rates
10
2.4 GHz WiFi Channel Frequencies
❑ A total of 14 channels (not all channels available in all countries)
❑ Centre frequencies are 5 MHz apart (except channel 14)
❑ Each channel is 22 MHz wide
From http://www.radio-electronics.com/info/wireless/wi-fi/80211-channels-number-frequencies-bandwidth.php
11
2.4 GHz Channel Overlaps
❑ Most channels in 2.4 GHz band overlap
❑ Maximum of three non-overlapping channels are possible
❑ 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
12
Channels in 5 GHz Band
13
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
14
Hidden Node Problem
C
Β
Α
A B C
❑ A can hear B, B can hear C, but C cannot hear A (C and A are hidden from each other)
❑ C may start transmitting while A is also transmitting 🡪 collision at B!
🡪 A and C (wireless transmitters) can't detect collision (why?).
❑ CSMA/CD is not possible (CD = collision detection; CD used in Ethernet)
🡪 in WLAN, only the receiver can help avoid collisions
❑ 4-way handshake needed to implement CA (collision avoidance) in WLAN
©2020 Mahbub Hassan
15
4-Way Handshake
Access Mobile
Point Node
d y t o sen d (RTS)
Rea
Clear to send (CT
S)
Data
Ack
16
IEEE 802.11 MAC
❑ Carrier Sense Multiple Access with
Collision Avoidance (CSMA/CA)
❑ Listen before you talk. If the medium is busy, the transmitter
backs off for a random period.
❑ 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.
❑ Destination sends: Clear to send (CTS)
Other stations set their network allocation vector (NAV) and
wait for that duration
❑ Cannot detect collision, hence each packet is acked.
❑ MAC-level retransmission if not acked.
17
IEEE 802.11 Priorities with Inter-frame space
DIFS
PIFS Random Backoff
Fram
Busy SIFS …
Backoff Slots
e
Carrier Time
Sensed
❑ 802.11 has different priorities for control, data, and time-critical packets
❑ Achieve priorities by using different amounts of interframe space (IFS)
❑ Highest priority frames, e.g., Acks, use short IFS (SIFS)
❑ Medium priority time-critical frames use “Point Coordination Function
IFS” (PIFS)
❑ Asynchronous data frames use “Distributed coordination function IFS”
(DIFS)
18
Time Critical Services
Super Frame
Contention-Free Contention
Period Period
PCF Access DCF Access
Beacon Time
❑ Timer critical services use Point Coordination Function
❑ The point coordinator allows only one station to access
❑ Coordinator sends a beacon frame to all stations.
Then uses a polling frame to allow a particular station to have
contention-free access
❑ Contention Free Period (CFP) varies with the load.
©2020 Mahbub Hassan
19
IEEE 802.11 DCF Backoff
20
IEEE 802.11 DCF Backoff (Cont)
❑ BO = random(0,CW)
❑ Initially and after each successful transmission:
CW = CWmin
❑ After each unsuccessful attempt
CW = min{2CW + 1, CWmax}
21
Example
❑ 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?
22
DCF Medium Access Flow Chart
Need to Transmit
Transmit Frame
Wait Wait
NAV=0 1 slot Yes
? No One Slot
Yes Medium
Free?
Yes Decrement
Medium
No Backoff
Free? Backoff=0
Yes
? No Counter
Generate
Random Backoff
Ref: P. Roshan and J. Leary, “802.11 Wireless LAN Fundamentals,” Cisco Press, 2003, ISBN:1587050773, Safari book
©2020 Mahbub Hassan
23
Parameter Values: interframe space and contention window
WLAN Slot-time (μs) SIFS (μs) CWmin CWmax
11a 9 16 15 1023
11b 20 10 31 1023
11g 9 or 20 10 15 or 31 1023
24
Example
❑ 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
25
Virtual Carrier Sense
❑ Every frame has a “Duration ID” which indicates how long the
medium will be busy.
RTS has duration of RTS + SIF + CTS + SIF + Frame + SIF + Ack
CTS has duration of CTS + 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
❑ All stations keep a “Network Allocation Vector (NAV)” timer
in which they record the duration of each frame they hear.
❑ Stations do not need to sense the channel until NAV becomes
zero (conserve power)
26
Example
❑ 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 ?
27
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.
28
DCF Example
❑ Example: Slot Time = 1, CWmin = 5, DIFS=3, PIFS=2, SIFS=1
❑ T=1 Station 2 wants to transmit but the media is busy
❑ T=2 Stations 3 and 4 want to transmit but the media is busy
❑ T=3 Station 1 finishes transmission.
❑ T=4 Station 1 receives ack for its transmission (SIFS=1)
Stations 2, 3, 4 set their NAV to 1.
❑ T=5 Medium becomes free
❑ T=8 DIFS expires. Stations 2, 3, 4 draw backoff count between 0 and 5.
The counts are 3, 1, 2
29
DCF Example (Cont)
❑ 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
❑ T=15 Station 3 finishes data transmission
❑ T=16 Station 3 receives Ack.
❑ T=17 Medium becomes free
❑ 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.
❑ T=21 Station 4 starts transmitting RTS
30
IEEE 802.11 Architecture
Server
Distribution System (DS)
IBSS
31
IEEE 802.11 Architecture (Cont)
❑ Basic Service Set (BSS)
= Set of stations associated with one AP
❑ Distribution System (DS) - wired backbone
❑ Independent Basic Service Set (IBSS): Set of computers in
ad-hoc mode. May not be connected to wired backbone.
❑ Ad-hoc networks coexist and interoperate with
infrastructure-based networks
❑ BSSID: 48-bit MAC address of the AP
❑ IBSSID: randomly generated address
❑ 2 bits are fixed, 46 bits are generated randomly
❑ All-1s BSSID/IBSSID is used for broadcast
32
Frame Format
Frame Duration/ Seq
Adr 1 Adr 2 Adr 3 Adr 4 Info CRC
Control ID Control
16b 16b 48b 48b 48b 16b 48b 32b
Prot. Type Sub To From More Retry Power More WEP Orde
Ver. type DS DS Frag. mgt Data r
2b 2b 4b 1b 1b 1b 1b 1b 1b 1b 1b
❑ Type: Control, management, or data
❑ Sub-Type: Association, disassociation, re-association, probe,
authentication, de-authentication, CTS, RTS, Ack, Power-Save Poll
(PS-POLL) …
❑ Retry/retransmission
❑ Power mgt: Going to Power Save mode
❑ More Data: More buffered data at AP for a station in power save mode
❑ WEP: Wireless Equivalent Privacy (Security) info in this frame
❑ Order: Strict ordering
©2020 Mahbub Hassan
33
MAC Frame Fields
❑ 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
❑ Sequence Control:
4-bit fragment number subfield
❑ For fragmentation and reassembly
34
802.11 Frame Address Fields – data frames
❑ Source/Destination: ultimate network
DS DS
devices that prepare and decode the 1-1
AP AP
frame for network layer 0-1
1-0
❑ Transmitter(Tx)/Receiver(Rx): Could
be the source/destination, or Source Destination
intermediate radio devices, e.g., 0-0
access point (AP)
❑ 4 address fields; defined by 2 DS bits
35
Example 802.11 Addressing: Wireless Client to Server
36
Example 802.11 Addressing: Server to Wireless Client
37
❑ Consider the example Example 802.11 addressing
WLAN in the figure
where two BSSs are
connected via a
distribution system. DS
What is the content of
the Address 3 field when AP 1 AP 2
Station A wants to send a
packet to Station B via B
AP 1? A
BSS 1 BSS 2
❑ 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.
38
Power Saving
❑ Extending the battery life of portable devices is one of the main challenges
of wireless networks.
❑ Mechanisms must be devised to let the device sleep as much as possible and
wake up only when it needs to transmit or receive.
❑ If there are no packets to be received, a receiver could go to sleep and save
battery power.
❑ To facilitate this kind of power saving, IEEE 802.11 has a power
management function.
39
802.11 Power Management
40
Traffic Indication Map (TIM)
❑ A bit map inside a beacon
❑ 2008 bits; each bit represents an Association ID (one
associated client)
❑ If packets are buffered in the AP for a given
Association ID, its corresponding bit is set to ‘1’, ‘0’
otherwise
41
Summary
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
42
Homework 2 part 2
❑ Two 802.11 stations get frames to transmit at time t=0.
The 3rd station (AP) has just finished transmitting
data for a long packet at t=0 to Station 1. The
transmission parameters are: Slot time=1, SIFS=1,
DIFS=3, CWmin=5, CWmax=7. Assume that the
pseudo-random number generated are 1, 3. The data
size for both stations is 3 slots. Draw a transmission
diagram. At what time the two packets will get
acknowledged assuming no new arrivals.
43
Acronyms
❑ Ack Acknowledgement
❑ AP Access Point
❑ APSD Automatic Power Save Delivery
❑ BO Backoff
❑ BSA Basic Service Area
❑ BSS Basic Service Set
❑ BSSID Basic Service Set Identifier
❑ CA Collision Avoidance
❑ CD Collision Detection
❑ CDMA Code Division Multiple Access
❑ CFP Contention Free Period
❑ CRC Cyclic Redundancy Check
❑ CSMA Carrier Sense Multiple Access
❑ CTS Clear to Send
❑ CW Congestion Window
❑ CWmax Maximum Congestion Window
©2020 Mahbub Hassan
44
Acronyms (Cont)
❑ CWmin Minimum Congestion Window
❑ DA Destination Address
❑ DCF Distributed Coordination Function
❑ DIFS DCF Inter-frame Spacing
❑ DS Direct Sequence
❑ ESA Extended Service Area
❑ ESS Extended Service Set
❑ FH Frequency Hopping
❑ FIFO First In First Out
❑ GHz Giga Hertz
❑ IBSS Independent Basic Service Set
❑ ID Identifier
❑ IEEE Institution of Electrical and Electronics Engineers
❑ IFS Inter-frame spacing
❑ ISM Instrumentation, Scientific and Medical
❑ LAN Local Area Network
©2020 Mahbub Hassan
45
Acronyms (Cont)
❑ MAC Media Access Control
❑ MHz Mega Hertz
❑ MIMO Multiple Input Multiple Output
❑ NAV Network Allocation Vector
❑ OFDM Orthogonal Frequency Division Multiplexing
❑ PCF Point Coordination Function
❑ PHY Physical Layer
❑ PIFS PCF inter-frame spacing
❑ PS Power saving
❑ QoS Quality of Service
❑ RA Receiver Address
❑ RTS Ready to Send
❑ SA Source Address
❑ SIFS Short Inter-frame Spacing
46
Acronyms (Cont)
❑ SS Subscriber Station
❑ TA Transmitter's Address
❑ TIM Traffic Indication Map
❑ WiFi Wireless Fidelity
❑ WLAN Wireless Local Area Network
47