SlideShare a Scribd company logo
1 of 35
Download to read offline
Tutorial - IEEE 802.11 Protocol and
Frames
Dheryta Jaisinghani
1
Primer to General WLANs and
Enterprise WLANs
2
Wireless Networks - Adhoc vs Infrastructure Mode
● Adhoc -
○ Wireless communication happens without an
Access Point (AP)
○ Nodes talk to each other directly
● Infrastructure -
○ Wireless communication happens via an AP
○ Nodes talk to each other via AP
3
IEEE 802.11 Structure
Figure 4.11 from IEEE Std Draft 2012 4
● STA (Station)
○ Logical entity,
singly addressable
by MAC+PHY
● BSS (Basic Service Set)
○ Set of stations
synchronized to
communicate
● DS (Distribution
System)
○ System that
connects all BSS’s
● SS (Station Services)
○ Set of services
that enable
transport of
MSDUs within a
BSS
Enterprise WLAN Design - A Cisco Deployment
https://www.cisco.com/c/en/us/td/docs/wireless/wcs/4-0/configuration/guide/wcscfg40/wcsovrv.html
WiFi Protocol
- IEEE
802.11
WiFi Clients
5
What does controller do?
● Manages lot of APs
● Load balancing
● Configurations
● Band Selection
● Channel Selection
● Band Steering
● Mobility Management
IEEE 802.11 Standards
● Standard: a,b,g,n,ac,ad,ah,ax etc
● Frequency Bands: 2.4 GHz vs 5 GHz
● Data rates: 1 Mbps to 7 Gbps
● Modulations: DSSS, FHSS, OFDM, MIMO-OFDM, MU-MIMO
Summary available here: https://en.wikipedia.org/wiki/IEEE_802.11
6
MAC Sublayer Management
Entity
7
Functions of MLME
● MLME - MAC subLayer Management
Entity
● Decide when transmit
○ Distributed Coordination Function
○ CSMA/CA
● Scan - Discover nearby Access Points
● Associate and Authenticate
● Connection Management - Rate
Control, Retry Management,
Acknowledgement Handling
● Beacon Handling
● Power Management
Application
Presentation
Session
Transport
Network
MLME|MAC
Physical
WiFi -
IEEE 802.11
Station
Management
88
WLANs - Collision Avoidance NOT Detection
● Collision detection is hard in WLANs
● Most WLAN radios - Transmitters and Receivers - are half-duplex.
● Senders and Receivers may not be in range of each other
9
IEEE 802.11 MAC Protocol Architecture
10
Figure 9.1 from IEEE Std Draft 2012
Distributed Co-ordination Function
● Fundamental Access method
● Based on Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)
○ Sense the carrier, transmit if free
○ Carrier Sensing can be Physical or Virtual with RTS and CTS
○ Delivery success measured with Acknowledgements
● IFS (Inter-Frame Space) - Time interval between frames
○ SIFS - Short IFS
○ PIFS - PCF IFS
○ DIFS - DCF IFS
○ AIFS - Arbitration IFS (QoS)
● IFS
○ Reduces collision probability
○ Implements priority
■ Lower IFS, Higher Priority
11
Figure 9.3 from IEEE Std Draft 2012
Frame transmission
12
Ref: 802.11 Arbitration CWNP white paper
Carrier Sensing - Physical vs Virtual
● Physical - Sense energy with PHY
● Virtual - RTS
(Request-To-Send)/CTS(Clear-To-Send)/NAV(Network-Allocation-Vector)
13
Figure 9.4 from IEEE Std Draft 2012
Why virtual CS?
● It solves hidden node problem
14
N1 N2R
Collisions
N1 N2R
1.RTS
2.CTS Keeps Quite
for NAV
Hidden Nodes
Point Co-ordination Function
● Uses a Point Co-ordinator (PC) for deciding who will transmit when
● PC runs at the Access Point
● PC uses polling mechanism to decide the turn
● Eliminates all contention, PCF has only contention-free period
● Has higher delays than DCF with higher reliability
● Carrier Sensing is Virtual
15
Hybrid Co-ordination Function
● Implemented for QoS WLANs
● Combines , DCF and PCF along with additional QoS guidelines for alternating
Collision and Collision-Free Periods (CP and CFPs)
● CP - Enhanced Distributed Channel Access (EDCA)
● CFP - Hybrid Coordination Function Controlled Channel Access (HCCA)
● Stations should obtains transmission opportunity (TxOP) before they can
transmit for both EDCA and HCCA
● Traffic priorities - background, best-effort, video, and voice
● All parameters are announced in beacons and probe response frames
● Refer to Chapter 9. MAC sublayer functional description from IEEE 802.11 for
details
16
Enabling QoS with Frame Priorities and More
17
Data from upper layers
Priority
Access Categories
Backoff as per CW and IFS
Transmission Scheduler
● IFS and Contention
Window Sizes
● Block Acknowledgements
● TxOPs
● Direct Link Protocol
(DLP)
● No ACK for time critical
applications
● Piggyback data
Ref: Deyun Gao, Jianfei Cai and
King Ngi Ngan, "Admission control in
IEEE 802.11e wireless LANs," in
IEEE Network, vol. 19, no. 4, pp.
6-13, July-Aug. 2005.
doi: 10.1109/MNET.2005.1470677
Calculating IFS and CW
● SlotTime = aCCATime + aRxTxTurnaroundTime + aAirPropagationTime +
aMACProcessingDelay
○ SlotTime for 802.11a/n/ac (5 GHz) = 9μS
○ SlotTime for 802.11g/n (2.4 GHz – HT or ERP) = 9μS with short
preamble
○ SlotTime for 802.11g/n (2.4 GHz – HT or ERP) = 20μS with long
preamble
○ SlotTime for 802.11b/g/n (2.4 GHz – DSS ) = 20μS
● SIFSTime = aRxRFDelay + aRxPLCPDelay + aMACProcessingDelay +
aRxTxTurnaroundTime
○ SIFS for 802.11b/g/n (2.4 GHz) = 10μS
○ SIFS for 802.11a/n/ac (5 GHz) = 16μS
● RIFS = 2μS, DIFS = SIFS + 2x SlotTime, PIFS = SIFS + SlotTime 18
Contd...
● EIFS (in EDCA) = SIFS + AIFS[AC] + ACK_Tx_Time
○ EIFS (in DCF) = SIFS + DIFS + ACK_Tx_Time
○ EIFS 802.11b/g/n devices using DSS = 364μS
○ EIFS 802.11g/n devices using OFDM = 160μS
○ EIFS 802.11a/n devices (5GHz) = 160μS
● AIFS[AC] = AIFSN[AC] × SlotTime + SIFSTime
○ Voice and Video = 2 slot times
○ Best Effort = 3 slot times
○ Background = 7 slot times
● Contention Window=
● BE/BK = aCWMin to aCWMax, VI=(aCWMin+1)/2 - 1 to aCWMin,
VO=(aCWMin+1)/4 - 1 to (aCWMin+1)/2 - 1
● Backoff Time = Random() × aSlotTime
○ [Random=Pseudorandom number [0,CW], aCWMin<=CW<=aCWMax]
19
Fragmentation and Defragmentation
● MAC sublayer data units (MSDUs) are partitioned into smaller units for higher
reliability
● Original Data Unit - MSDU is divided into smaller MPDUs (MAC Protocol Data
Units) each MPDU has its own MAC header and CRC
● Each MPDU should be separately acknowledged
● Burst transmissions allowed in an obtained TxOP
20
Figure 9.2 from IEEE Std Draft 2012
IEEE 802.11 - Introduction to WiFi Frames
Frame Types
Data FramesManagement Frames Control Frames
RTS/CTS/ACK/PollingScanning/Association/Authentication
21
QoS/Non-QoS
Physical Layer Headers
- RadioTap/Prism Headers - Depending upon the chipset and driver
- MAC Timestamp
- Channel Frequency
- Signal Strength
- MCS Rate
- Antenna Information
- Channel Information
PHY Header MAC Header Frame Body FCS
22
Frame Structure
23
Figure 8.1 from IEEE Std Draft 2012
Figure 8.2 from IEEE Std Draft 2012
Frame Control Field
● Protocol Version - Version of 802.11 standard followed
● Type - Data, Management or Control Frame
● Subtype - Each type has multiple subtype for frames. For example Type
Management frames - Subtypes - Association Req/Res, Reassociation Req/Res
[Type Subtype Mapping - Table 8.1 in the standard]
● To DS and From DS - Direction from Distribution System
○ 0,0 => A data frame from one station to other station in the same BSS
○ 1,0 => A data frame for DS or Port Access Entity at the AP
○ 0,1 => A data frame from DS or in Mesh network
○ 1,1 => A data frame using 4-address MAC header. Used in Mesh network
● More Fragments - Used in case of fragmented frames, set to 1 when more
fragments present
● Retry - Set to 1 is sent again 24
Frame Control Field [Contd…]
● Power Management - 1 indicates that STA is in Power-Save Mode, 0 indicates
active mode [Meaning changes for adhoc and mesh networks]
● More Data - Indicates that data is buffered for a STA in power-save mode, 1-
Data buffered
● Protected Frame - 1 if cryptographic encapsulation used
● Order - 1 - if strictly ordered service is used
25
Other Fields
● Duration -
○ Control Frame - Association ID
○ Network Allocation Vector
● Addresses
○ DA - Destination Address (Final Recipient)
○ SA - Source Address (Initiator)
○ TA - Transmitter Address
○ RA - Receiver Address
● Sequence Control - Used for fragmentation
● QoS Control Field - Identifies traffic category, TxOP, ACK Policy, Queue Size
etc [See Table 8.4 in IEEE std Draft for Details]
26
Capturing Network Traffic
● Tools
a. Wireshark/tshark/TCPDump etc
b. System Logs
● Collection Points
a. Client Side Capture
i. Data Path - Wireshark captures all application layer traffic
ii. Control Path - Debug Device Driver Logs, system logs, kernel logs
b. AP Side Capture
i. Example - Enabled with OpenWRT
c. In the Air - Sniffing the IEEE 802.11 frames in the air
27
In the Air Sniffing Process
- Monitor Mode
- Multiple Channel Sniffing - Round Robin
- sudo iw dev wlan0 interface add mon0 type monitor
- Single Channel Sniffing - Specify the channel
- sudo iw dev mon0 set freq 2437
- Checking if monitor mode is supported
- Hardware Support
- Driver Support
- sudo iw list - search for “monitor”
- For Details Refer -
https://www.slideshare.net/DherytaJaisinghani/tutorial-wifi-driver-code-opening
-nuts-and-bolts-of-linux-wifi-subsystem
- 28
Wireshark Filters
1. Management Frames - wlan.fc.type == 0
a. Probe Requests - wlan.fc.type_subtype == 0x04
b. Probe Responses - wlan.fc.type_subtype == 0x05
c. Beacons - wlan.fc.type_subtype == 0x08
2. Control Frames - wlan.fc.type == 1
a. RTS - wlan.fc.type_subtype == 0x1b
b. CTS - wlan.fc.type_subtype == 0x1c
c. ACK - wlan.fc.type_subtype == 0x1d
3. Data Frames - wlan.fc.type == 2
a. QoS Data - wlan.fc.type_subtype == 0x28
b. Non-QoS Data - wlan.fc.type_subtype == 0x20
29
Client-side State Machine and
MAC Implementation
30
Client Side WiFi State Machine
● Class 1 Frames
○ Control Frames -
RTS/CTS/ACK/CF-End/CF-End+ACK
○ Management Frames - Probe
Requests/Probe
Responses/Beacons/Authentication/D
eauthentication
○ Data Frames - Only allowed in
IBSS/Peer Mode
● Class 2 Frames
○ Management Frames - Association
Request/Association
Response/Reassociation
Request/Response/Disassociation
● Class 3 Frames
○ Data Frames
○ Management Frames
○ Control Frames
Details from IEEE Std Draft 2012
31
Linux WiFi Subsystem
32
Data Path vs Control Path
Data Application
System Call
Sockets
Network Protocols
Net_dev core
Driver
Network Application
nl80211
cfg80211
mac80211
Data Path Control Path
Application
Programming
Driver
Programming
33
Backports Code Structure
net/wireless/handlers/wireless/nl80211.c (struct
genl_opsnl80211_ops)
nl80211
cfg80211
mac80211
ath9k
net/wireless (Configurations) - Struct cfg80211_ops
/net/mac80211 (Rate Control, MLME-Authenticate,
Reassociate, Deauthenticate, Associate,
Disassociate, Beacon , Probe, PM, Scan, Retries,
ACK Handling, etc) - struct ieee80211_ops
drivers/net/wireless/ath/ath9k (Transmit and
Receive)
34
Contact Me
● Webpage: www.dheryta.co.in
● Email: dherytaj@iiitd.ac.in
35

More Related Content

What's hot

Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Divya Tiwari
 
L2 MAC LTE PROCEDURES revC
L2 MAC LTE PROCEDURES revCL2 MAC LTE PROCEDURES revC
L2 MAC LTE PROCEDURES revCVincent Daumont
 
Ccna rse chp7 Access Control List (ACL)
Ccna rse chp7 Access Control List (ACL)Ccna rse chp7 Access Control List (ACL)
Ccna rse chp7 Access Control List (ACL)newbie2019
 
ospf routing protocol
ospf routing protocolospf routing protocol
ospf routing protocolAmeer Agel
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Chandra Meena
 
OSPF On Router OS7
OSPF On Router OS7OSPF On Router OS7
OSPF On Router OS7GLC Networks
 
CCNA BASIC SWITCHING AND SWITCH CONFIGURATION
CCNA BASIC SWITCHING AND SWITCH CONFIGURATIONCCNA BASIC SWITCHING AND SWITCH CONFIGURATION
CCNA BASIC SWITCHING AND SWITCH CONFIGURATIONAswini Badatya
 
Schedule and Contention based MAC protocols
Schedule and Contention based MAC protocolsSchedule and Contention based MAC protocols
Schedule and Contention based MAC protocolsDarwin Nesakumar
 
Data retrieval in sensor networks
Data retrieval in sensor networksData retrieval in sensor networks
Data retrieval in sensor networksAcad
 
Wireless LANs(IEEE802.11) Architecture
Wireless LANs(IEEE802.11) Architecture Wireless LANs(IEEE802.11) Architecture
Wireless LANs(IEEE802.11) Architecture Raj vardhan
 
Geographical routing presentation
Geographical routing presentationGeographical routing presentation
Geographical routing presentationApoorva Nagaraj
 
Openwrt wireless
Openwrt wirelessOpenwrt wireless
Openwrt wireless晓东 杜
 
Voice Services, From Circuit Switch to VoIP
Voice Services, From Circuit Switch to VoIPVoice Services, From Circuit Switch to VoIP
Voice Services, From Circuit Switch to VoIPGLC Networks
 
Nec neo microwave equipment introduction
Nec neo microwave equipment introductionNec neo microwave equipment introduction
Nec neo microwave equipment introductionAdnan Munir
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)Kruti Niranjan
 
Traffic-adaptive Medium Access Protocol
Traffic-adaptive Medium Access ProtocolTraffic-adaptive Medium Access Protocol
Traffic-adaptive Medium Access ProtocolGaurav Chauhan
 

What's hot (20)

Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks
 
L2 MAC LTE PROCEDURES revC
L2 MAC LTE PROCEDURES revCL2 MAC LTE PROCEDURES revC
L2 MAC LTE PROCEDURES revC
 
Ccna rse chp7 Access Control List (ACL)
Ccna rse chp7 Access Control List (ACL)Ccna rse chp7 Access Control List (ACL)
Ccna rse chp7 Access Control List (ACL)
 
ospf routing protocol
ospf routing protocolospf routing protocol
ospf routing protocol
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
 
OSPF On Router OS7
OSPF On Router OS7OSPF On Router OS7
OSPF On Router OS7
 
CCNA BASIC SWITCHING AND SWITCH CONFIGURATION
CCNA BASIC SWITCHING AND SWITCH CONFIGURATIONCCNA BASIC SWITCHING AND SWITCH CONFIGURATION
CCNA BASIC SWITCHING AND SWITCH CONFIGURATION
 
Schedule and Contention based MAC protocols
Schedule and Contention based MAC protocolsSchedule and Contention based MAC protocols
Schedule and Contention based MAC protocols
 
2.7 wlan ieee 802.11
2.7 wlan   ieee 802.112.7 wlan   ieee 802.11
2.7 wlan ieee 802.11
 
Data retrieval in sensor networks
Data retrieval in sensor networksData retrieval in sensor networks
Data retrieval in sensor networks
 
Wireless LANs(IEEE802.11) Architecture
Wireless LANs(IEEE802.11) Architecture Wireless LANs(IEEE802.11) Architecture
Wireless LANs(IEEE802.11) Architecture
 
Hiperlan
HiperlanHiperlan
Hiperlan
 
Geographical routing presentation
Geographical routing presentationGeographical routing presentation
Geographical routing presentation
 
Fools your enemy with MikroTik
Fools your enemy with MikroTikFools your enemy with MikroTik
Fools your enemy with MikroTik
 
Openwrt wireless
Openwrt wirelessOpenwrt wireless
Openwrt wireless
 
Zigbee 802-15-4
Zigbee 802-15-4Zigbee 802-15-4
Zigbee 802-15-4
 
Voice Services, From Circuit Switch to VoIP
Voice Services, From Circuit Switch to VoIPVoice Services, From Circuit Switch to VoIP
Voice Services, From Circuit Switch to VoIP
 
Nec neo microwave equipment introduction
Nec neo microwave equipment introductionNec neo microwave equipment introduction
Nec neo microwave equipment introduction
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
 
Traffic-adaptive Medium Access Protocol
Traffic-adaptive Medium Access ProtocolTraffic-adaptive Medium Access Protocol
Traffic-adaptive Medium Access Protocol
 

Similar to Tutorial on IEEE 802.11 - MAC Protocols and Frames

Telecommunications: Wireless Networks
Telecommunications: Wireless NetworksTelecommunications: Wireless Networks
Telecommunications: Wireless NetworksNapier University
 
Рекомендации по настройке контроллеров БЛВС Cisco
Рекомендации по настройке контроллеров БЛВС CiscoРекомендации по настройке контроллеров БЛВС Cisco
Рекомендации по настройке контроллеров БЛВС CiscoCisco Russia
 
IT8602 Mobile Communication - Unit III
IT8602 Mobile Communication  - Unit IIIIT8602 Mobile Communication  - Unit III
IT8602 Mobile Communication - Unit IIIpkaviya
 
Cisco WLAN - Chapter. 02 : Part 1 – 802.11 MAC and Cisco Client Adapters
Cisco WLAN -  Chapter. 02 :  Part 1 – 802.11 MAC and Cisco Client AdaptersCisco WLAN -  Chapter. 02 :  Part 1 – 802.11 MAC and Cisco Client Adapters
Cisco WLAN - Chapter. 02 : Part 1 – 802.11 MAC and Cisco Client AdaptersYaser Rahmati
 
Samsung_EnodeLSMR__Integration_Module__V1.pdf (1).pdf
Samsung_EnodeLSMR__Integration_Module__V1.pdf (1).pdfSamsung_EnodeLSMR__Integration_Module__V1.pdf (1).pdf
Samsung_EnodeLSMR__Integration_Module__V1.pdf (1).pdfRaviSharma1113
 
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aqPLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aqPROIDEA
 
3. Wireless Local Area Networks WLAN.ppt
3. Wireless Local Area Networks WLAN.ppt3. Wireless Local Area Networks WLAN.ppt
3. Wireless Local Area Networks WLAN.pptKp Sharma
 
3. Introduction Wireless Local Area Networks.ppt
3. Introduction Wireless Local Area Networks.ppt3. Introduction Wireless Local Area Networks.ppt
3. Introduction Wireless Local Area Networks.pptKp Sharma
 
cFrame framework slides
cFrame framework slidescFrame framework slides
cFrame framework slideskestasj
 
Training Day Slides
Training Day SlidesTraining Day Slides
Training Day Slidesadam_merritt
 
VMware NSX 101: What, Why & How
VMware NSX 101: What, Why & HowVMware NSX 101: What, Why & How
VMware NSX 101: What, Why & HowAniekan Akpaffiong
 
packet traveling (pre cloud)
packet traveling (pre cloud)packet traveling (pre cloud)
packet traveling (pre cloud)iman darabi
 

Similar to Tutorial on IEEE 802.11 - MAC Protocols and Frames (20)

80211
8021180211
80211
 
Telecommunications: Wireless Networks
Telecommunications: Wireless NetworksTelecommunications: Wireless Networks
Telecommunications: Wireless Networks
 
Рекомендации по настройке контроллеров БЛВС Cisco
Рекомендации по настройке контроллеров БЛВС CiscoРекомендации по настройке контроллеров БЛВС Cisco
Рекомендации по настройке контроллеров БЛВС Cisco
 
IT8602 Mobile Communication - Unit III
IT8602 Mobile Communication  - Unit IIIIT8602 Mobile Communication  - Unit III
IT8602 Mobile Communication - Unit III
 
WLAN
WLANWLAN
WLAN
 
Glomosim scenarios
Glomosim scenariosGlomosim scenarios
Glomosim scenarios
 
Ieee 802.11overview
Ieee 802.11overviewIeee 802.11overview
Ieee 802.11overview
 
Networking revolution
Networking revolutionNetworking revolution
Networking revolution
 
Wireless lecture1
Wireless lecture1Wireless lecture1
Wireless lecture1
 
Networking basics
Networking basicsNetworking basics
Networking basics
 
Cisco WLAN - Chapter. 02 : Part 1 – 802.11 MAC and Cisco Client Adapters
Cisco WLAN -  Chapter. 02 :  Part 1 – 802.11 MAC and Cisco Client AdaptersCisco WLAN -  Chapter. 02 :  Part 1 – 802.11 MAC and Cisco Client Adapters
Cisco WLAN - Chapter. 02 : Part 1 – 802.11 MAC and Cisco Client Adapters
 
Samsung_EnodeLSMR__Integration_Module__V1.pdf (1).pdf
Samsung_EnodeLSMR__Integration_Module__V1.pdf (1).pdfSamsung_EnodeLSMR__Integration_Module__V1.pdf (1).pdf
Samsung_EnodeLSMR__Integration_Module__V1.pdf (1).pdf
 
Wan networks
Wan networksWan networks
Wan networks
 
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aqPLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
PLNOG 8: Peter Ashwood-Smith - Shortest Path Bridging IEEE 802.1aq
 
3. Wireless Local Area Networks WLAN.ppt
3. Wireless Local Area Networks WLAN.ppt3. Wireless Local Area Networks WLAN.ppt
3. Wireless Local Area Networks WLAN.ppt
 
3. Introduction Wireless Local Area Networks.ppt
3. Introduction Wireless Local Area Networks.ppt3. Introduction Wireless Local Area Networks.ppt
3. Introduction Wireless Local Area Networks.ppt
 
cFrame framework slides
cFrame framework slidescFrame framework slides
cFrame framework slides
 
Training Day Slides
Training Day SlidesTraining Day Slides
Training Day Slides
 
VMware NSX 101: What, Why & How
VMware NSX 101: What, Why & HowVMware NSX 101: What, Why & How
VMware NSX 101: What, Why & How
 
packet traveling (pre cloud)
packet traveling (pre cloud)packet traveling (pre cloud)
packet traveling (pre cloud)
 

Recently uploaded

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Recently uploaded (20)

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Tutorial on IEEE 802.11 - MAC Protocols and Frames

  • 1. Tutorial - IEEE 802.11 Protocol and Frames Dheryta Jaisinghani 1
  • 2. Primer to General WLANs and Enterprise WLANs 2
  • 3. Wireless Networks - Adhoc vs Infrastructure Mode ● Adhoc - ○ Wireless communication happens without an Access Point (AP) ○ Nodes talk to each other directly ● Infrastructure - ○ Wireless communication happens via an AP ○ Nodes talk to each other via AP 3
  • 4. IEEE 802.11 Structure Figure 4.11 from IEEE Std Draft 2012 4 ● STA (Station) ○ Logical entity, singly addressable by MAC+PHY ● BSS (Basic Service Set) ○ Set of stations synchronized to communicate ● DS (Distribution System) ○ System that connects all BSS’s ● SS (Station Services) ○ Set of services that enable transport of MSDUs within a BSS
  • 5. Enterprise WLAN Design - A Cisco Deployment https://www.cisco.com/c/en/us/td/docs/wireless/wcs/4-0/configuration/guide/wcscfg40/wcsovrv.html WiFi Protocol - IEEE 802.11 WiFi Clients 5 What does controller do? ● Manages lot of APs ● Load balancing ● Configurations ● Band Selection ● Channel Selection ● Band Steering ● Mobility Management
  • 6. IEEE 802.11 Standards ● Standard: a,b,g,n,ac,ad,ah,ax etc ● Frequency Bands: 2.4 GHz vs 5 GHz ● Data rates: 1 Mbps to 7 Gbps ● Modulations: DSSS, FHSS, OFDM, MIMO-OFDM, MU-MIMO Summary available here: https://en.wikipedia.org/wiki/IEEE_802.11 6
  • 8. Functions of MLME ● MLME - MAC subLayer Management Entity ● Decide when transmit ○ Distributed Coordination Function ○ CSMA/CA ● Scan - Discover nearby Access Points ● Associate and Authenticate ● Connection Management - Rate Control, Retry Management, Acknowledgement Handling ● Beacon Handling ● Power Management Application Presentation Session Transport Network MLME|MAC Physical WiFi - IEEE 802.11 Station Management 88
  • 9. WLANs - Collision Avoidance NOT Detection ● Collision detection is hard in WLANs ● Most WLAN radios - Transmitters and Receivers - are half-duplex. ● Senders and Receivers may not be in range of each other 9
  • 10. IEEE 802.11 MAC Protocol Architecture 10 Figure 9.1 from IEEE Std Draft 2012
  • 11. Distributed Co-ordination Function ● Fundamental Access method ● Based on Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) ○ Sense the carrier, transmit if free ○ Carrier Sensing can be Physical or Virtual with RTS and CTS ○ Delivery success measured with Acknowledgements ● IFS (Inter-Frame Space) - Time interval between frames ○ SIFS - Short IFS ○ PIFS - PCF IFS ○ DIFS - DCF IFS ○ AIFS - Arbitration IFS (QoS) ● IFS ○ Reduces collision probability ○ Implements priority ■ Lower IFS, Higher Priority 11 Figure 9.3 from IEEE Std Draft 2012
  • 12. Frame transmission 12 Ref: 802.11 Arbitration CWNP white paper
  • 13. Carrier Sensing - Physical vs Virtual ● Physical - Sense energy with PHY ● Virtual - RTS (Request-To-Send)/CTS(Clear-To-Send)/NAV(Network-Allocation-Vector) 13 Figure 9.4 from IEEE Std Draft 2012
  • 14. Why virtual CS? ● It solves hidden node problem 14 N1 N2R Collisions N1 N2R 1.RTS 2.CTS Keeps Quite for NAV Hidden Nodes
  • 15. Point Co-ordination Function ● Uses a Point Co-ordinator (PC) for deciding who will transmit when ● PC runs at the Access Point ● PC uses polling mechanism to decide the turn ● Eliminates all contention, PCF has only contention-free period ● Has higher delays than DCF with higher reliability ● Carrier Sensing is Virtual 15
  • 16. Hybrid Co-ordination Function ● Implemented for QoS WLANs ● Combines , DCF and PCF along with additional QoS guidelines for alternating Collision and Collision-Free Periods (CP and CFPs) ● CP - Enhanced Distributed Channel Access (EDCA) ● CFP - Hybrid Coordination Function Controlled Channel Access (HCCA) ● Stations should obtains transmission opportunity (TxOP) before they can transmit for both EDCA and HCCA ● Traffic priorities - background, best-effort, video, and voice ● All parameters are announced in beacons and probe response frames ● Refer to Chapter 9. MAC sublayer functional description from IEEE 802.11 for details 16
  • 17. Enabling QoS with Frame Priorities and More 17 Data from upper layers Priority Access Categories Backoff as per CW and IFS Transmission Scheduler ● IFS and Contention Window Sizes ● Block Acknowledgements ● TxOPs ● Direct Link Protocol (DLP) ● No ACK for time critical applications ● Piggyback data Ref: Deyun Gao, Jianfei Cai and King Ngi Ngan, "Admission control in IEEE 802.11e wireless LANs," in IEEE Network, vol. 19, no. 4, pp. 6-13, July-Aug. 2005. doi: 10.1109/MNET.2005.1470677
  • 18. Calculating IFS and CW ● SlotTime = aCCATime + aRxTxTurnaroundTime + aAirPropagationTime + aMACProcessingDelay ○ SlotTime for 802.11a/n/ac (5 GHz) = 9μS ○ SlotTime for 802.11g/n (2.4 GHz – HT or ERP) = 9μS with short preamble ○ SlotTime for 802.11g/n (2.4 GHz – HT or ERP) = 20μS with long preamble ○ SlotTime for 802.11b/g/n (2.4 GHz – DSS ) = 20μS ● SIFSTime = aRxRFDelay + aRxPLCPDelay + aMACProcessingDelay + aRxTxTurnaroundTime ○ SIFS for 802.11b/g/n (2.4 GHz) = 10μS ○ SIFS for 802.11a/n/ac (5 GHz) = 16μS ● RIFS = 2μS, DIFS = SIFS + 2x SlotTime, PIFS = SIFS + SlotTime 18
  • 19. Contd... ● EIFS (in EDCA) = SIFS + AIFS[AC] + ACK_Tx_Time ○ EIFS (in DCF) = SIFS + DIFS + ACK_Tx_Time ○ EIFS 802.11b/g/n devices using DSS = 364μS ○ EIFS 802.11g/n devices using OFDM = 160μS ○ EIFS 802.11a/n devices (5GHz) = 160μS ● AIFS[AC] = AIFSN[AC] × SlotTime + SIFSTime ○ Voice and Video = 2 slot times ○ Best Effort = 3 slot times ○ Background = 7 slot times ● Contention Window= ● BE/BK = aCWMin to aCWMax, VI=(aCWMin+1)/2 - 1 to aCWMin, VO=(aCWMin+1)/4 - 1 to (aCWMin+1)/2 - 1 ● Backoff Time = Random() × aSlotTime ○ [Random=Pseudorandom number [0,CW], aCWMin<=CW<=aCWMax] 19
  • 20. Fragmentation and Defragmentation ● MAC sublayer data units (MSDUs) are partitioned into smaller units for higher reliability ● Original Data Unit - MSDU is divided into smaller MPDUs (MAC Protocol Data Units) each MPDU has its own MAC header and CRC ● Each MPDU should be separately acknowledged ● Burst transmissions allowed in an obtained TxOP 20 Figure 9.2 from IEEE Std Draft 2012
  • 21. IEEE 802.11 - Introduction to WiFi Frames Frame Types Data FramesManagement Frames Control Frames RTS/CTS/ACK/PollingScanning/Association/Authentication 21 QoS/Non-QoS
  • 22. Physical Layer Headers - RadioTap/Prism Headers - Depending upon the chipset and driver - MAC Timestamp - Channel Frequency - Signal Strength - MCS Rate - Antenna Information - Channel Information PHY Header MAC Header Frame Body FCS 22
  • 23. Frame Structure 23 Figure 8.1 from IEEE Std Draft 2012 Figure 8.2 from IEEE Std Draft 2012
  • 24. Frame Control Field ● Protocol Version - Version of 802.11 standard followed ● Type - Data, Management or Control Frame ● Subtype - Each type has multiple subtype for frames. For example Type Management frames - Subtypes - Association Req/Res, Reassociation Req/Res [Type Subtype Mapping - Table 8.1 in the standard] ● To DS and From DS - Direction from Distribution System ○ 0,0 => A data frame from one station to other station in the same BSS ○ 1,0 => A data frame for DS or Port Access Entity at the AP ○ 0,1 => A data frame from DS or in Mesh network ○ 1,1 => A data frame using 4-address MAC header. Used in Mesh network ● More Fragments - Used in case of fragmented frames, set to 1 when more fragments present ● Retry - Set to 1 is sent again 24
  • 25. Frame Control Field [Contd…] ● Power Management - 1 indicates that STA is in Power-Save Mode, 0 indicates active mode [Meaning changes for adhoc and mesh networks] ● More Data - Indicates that data is buffered for a STA in power-save mode, 1- Data buffered ● Protected Frame - 1 if cryptographic encapsulation used ● Order - 1 - if strictly ordered service is used 25
  • 26. Other Fields ● Duration - ○ Control Frame - Association ID ○ Network Allocation Vector ● Addresses ○ DA - Destination Address (Final Recipient) ○ SA - Source Address (Initiator) ○ TA - Transmitter Address ○ RA - Receiver Address ● Sequence Control - Used for fragmentation ● QoS Control Field - Identifies traffic category, TxOP, ACK Policy, Queue Size etc [See Table 8.4 in IEEE std Draft for Details] 26
  • 27. Capturing Network Traffic ● Tools a. Wireshark/tshark/TCPDump etc b. System Logs ● Collection Points a. Client Side Capture i. Data Path - Wireshark captures all application layer traffic ii. Control Path - Debug Device Driver Logs, system logs, kernel logs b. AP Side Capture i. Example - Enabled with OpenWRT c. In the Air - Sniffing the IEEE 802.11 frames in the air 27
  • 28. In the Air Sniffing Process - Monitor Mode - Multiple Channel Sniffing - Round Robin - sudo iw dev wlan0 interface add mon0 type monitor - Single Channel Sniffing - Specify the channel - sudo iw dev mon0 set freq 2437 - Checking if monitor mode is supported - Hardware Support - Driver Support - sudo iw list - search for “monitor” - For Details Refer - https://www.slideshare.net/DherytaJaisinghani/tutorial-wifi-driver-code-opening -nuts-and-bolts-of-linux-wifi-subsystem - 28
  • 29. Wireshark Filters 1. Management Frames - wlan.fc.type == 0 a. Probe Requests - wlan.fc.type_subtype == 0x04 b. Probe Responses - wlan.fc.type_subtype == 0x05 c. Beacons - wlan.fc.type_subtype == 0x08 2. Control Frames - wlan.fc.type == 1 a. RTS - wlan.fc.type_subtype == 0x1b b. CTS - wlan.fc.type_subtype == 0x1c c. ACK - wlan.fc.type_subtype == 0x1d 3. Data Frames - wlan.fc.type == 2 a. QoS Data - wlan.fc.type_subtype == 0x28 b. Non-QoS Data - wlan.fc.type_subtype == 0x20 29
  • 30. Client-side State Machine and MAC Implementation 30
  • 31. Client Side WiFi State Machine ● Class 1 Frames ○ Control Frames - RTS/CTS/ACK/CF-End/CF-End+ACK ○ Management Frames - Probe Requests/Probe Responses/Beacons/Authentication/D eauthentication ○ Data Frames - Only allowed in IBSS/Peer Mode ● Class 2 Frames ○ Management Frames - Association Request/Association Response/Reassociation Request/Response/Disassociation ● Class 3 Frames ○ Data Frames ○ Management Frames ○ Control Frames Details from IEEE Std Draft 2012 31
  • 33. Data Path vs Control Path Data Application System Call Sockets Network Protocols Net_dev core Driver Network Application nl80211 cfg80211 mac80211 Data Path Control Path Application Programming Driver Programming 33
  • 34. Backports Code Structure net/wireless/handlers/wireless/nl80211.c (struct genl_opsnl80211_ops) nl80211 cfg80211 mac80211 ath9k net/wireless (Configurations) - Struct cfg80211_ops /net/mac80211 (Rate Control, MLME-Authenticate, Reassociate, Deauthenticate, Associate, Disassociate, Beacon , Probe, PM, Scan, Retries, ACK Handling, etc) - struct ieee80211_ops drivers/net/wireless/ath/ath9k (Transmit and Receive) 34
  • 35. Contact Me ● Webpage: www.dheryta.co.in ● Email: dherytaj@iiitd.ac.in 35