SlideShare a Scribd company logo
1
Analysis of Open-Source
Drivers for 802.11 WLANs
Danh Nguyen
07/12/2013
2
Summary
• How device drivers work
• Socket buffer
• Mac80211 walk through
• Ath9k walk through
• What’s configurable
3
How Device Drivers Work
4
Linux Kernel Stack
5
struct net_device
• The central structure representing a network
device (drivers + HW) in kernel subsystem
• Network drivers allocate, initialize, and operate it
• Contains info about IF:
o Global: name, state, init function callbacks
o Hardware: memory, irq, port, dma channels
o Interface info: MAC addr, mtu, num. of TX queues (IF queues),
type, flags and features
o Device methods: kernel callbacks for features provided: `open()`,
`stop()`, `hard_start_xmit()`, `tx_timeout()`, `do_ioctl()`, etc.
o Utilities fields: tx/rx timestamps, private IF data (hw queues?),
multicast, spinlocks…
6
Socket Buffer
• Important data structure to represent packets
(complete, down to PSDU) in kernel
• 2 parts:
o Packet data: actual PSDU memory allocation
o Management (`struct sk_buff *skb`)
 Management pointers to different part of packet data
› Layer headers (TCP, IP, MAC)
› PDU for each layer
• Where drivers / network subsystem can do DPI
before handing off to applications
7
Socket Buffer (Cont.)
8
Mac80211 Walk Through
• mac80211
o “Upper” MAC functions
 Data packaging –
attach/detach 802.11 headers
 TX/RX paths – include
software en-/decryption
 QoS (admission control)
o Control paths (MLME)
 De/Authenticate
 Beacon / Probe
 Timing Sync Function
o Monitor mode support
o Rate control
Cfg80211
SoftMAC Driver
- ath5k/9k, brcmsmac,
iwlwifi
Mac80211
- “Upper” MAC / MLME
Userspace
nl80211
Cfg80211_ops
Ieee8011_ops
9
TX Path in mac80211
10
Transmission Path: Kernel -> mac80211 -> ath9k
11
SoftMAC Details
• IF Driver
o Mapping TX queues to HW
queues
o Control PHY
o Hardware signaling / sync /
interrupts
o Some with more control over
PHY than others (Atheros vs.
Broadcom)
Cfg80211
SoftMAC Driver
- ath5k/9k, brcmsmac,
iwlwifi
Mac80211
- “Upper” MAC / MLME
Userspace
nl80211
Cfg80211_ops
Ieee8011_ops
12
Ath9k Walkthrough
13
Transmission Path: ath9k -> hardware
14
What’s Configurable
• All MAC Layer functionalities, upper or lower
• Ath9k keeps track of each HW queue lower-MAC
parameters (CSMA/CA parameters): CWmin, CWmax,
back-off values, AIFS, and other TX ops
o Set them based on mac80211 TX/RX params (`tid`)
• Ath9k maps mac80211 tx queues (4, as per 802.11e) to
HW queues (10, for Atheros)
o Per-packet mappings
o TX ops propagates from mac80211 -> ath9k -> PHY Firmware
• Some PHY parameters can be changed together w/
CSMA/CA params
o Code rates, bursting, antenna power, fix antenna via API
o Additional PHY control: modify open-source PHY firmware
15
Example: Spectral Scanning
• Mobicom 2011 Demo: “Dynamic Frequency
Selection through Collaborative Reporting in
WLANs”
• In 802.11, channel selection performed by AP
o Based on RSSI
o Static -> not consistent with wireless medium
• A frequency selection algorithm
o Based on Mad-WiFi
o Switch operation channels based on channel and traffic
conditions
o Collaborative reporting: STAs feedback to APs
16
Example: Spectral Scanning
17
References
• Linux Device Drivers, 3rd Ed. (O’Reilly Book)
• http://nitlab.inf.uth.gr/NITlab/index.php/testbed/ha
rdware/sensors/2-uncategorised/367-dynamic-
frequency-selection-through-collaborative-
reporting-in-wlans (Demo)

More Related Content

What's hot

VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
Kernel TLV
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
Adrien Mahieux
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
Shay Cohen
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
Thomas Graf
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
linuxlab_conf
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
Kernel TLV
 
Time Sensitive Networking in the Linux Kernel
Time Sensitive Networking in the Linux KernelTime Sensitive Networking in the Linux Kernel
Time Sensitive Networking in the Linux Kernel
henrikau
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
RuggedBoardGroup
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecturehugo lu
 
Linux Ethernet device driver
Linux Ethernet device driverLinux Ethernet device driver
Linux Ethernet device driver
艾鍗科技
 
Linux device drivers
Linux device drivers Linux device drivers
Linux dma engine
Linux dma engineLinux dma engine
Linux dma engine
pradeep_tewani
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
dibyajyotig
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
Thomas Graf
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance
Brendan Gregg
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
Emertxe Information Technologies Pvt Ltd
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
Liran Ben Haim
 

What's hot (20)

VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Time Sensitive Networking in the Linux Kernel
Time Sensitive Networking in the Linux KernelTime Sensitive Networking in the Linux Kernel
Time Sensitive Networking in the Linux Kernel
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
 
Linux Ethernet device driver
Linux Ethernet device driverLinux Ethernet device driver
Linux Ethernet device driver
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
Linux dma engine
Linux dma engineLinux dma engine
Linux dma engine
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
 

Similar to Analysis of Open-Source Drivers for IEEE 802.11 WLANs

Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...
Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...
Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...
abdenour boussioud
 
Ccna Imp Guide
Ccna Imp GuideCcna Imp Guide
Ccna Imp Guide
abhijitgnbbl
 
Implementation of MAC-level sleep-scheduling
Implementation of MAC-level sleep-schedulingImplementation of MAC-level sleep-scheduling
Implementation of MAC-level sleep-schedulingOlivier Cervello
 
etherlink plus developers guide
etherlink plus developers guideetherlink plus developers guide
etherlink plus developers guidepanamjayait
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld
 
Unit2 arm
Unit2 armUnit2 arm
Unit2 arm
Karthik Vivek
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Tanel Poder
 
AAME ARM Techcon2013 004v02 Debug and Optimization
AAME ARM Techcon2013 004v02 Debug and OptimizationAAME ARM Techcon2013 004v02 Debug and Optimization
AAME ARM Techcon2013 004v02 Debug and Optimization
Anh Dung NGUYEN
 
Intel 8257 programmable dma controller
Intel 8257 programmable dma controllerIntel 8257 programmable dma controller
Intel 8257 programmable dma controllerafzal ahmad
 
Intel 8257 programmable dma controller
Intel 8257 programmable dma controllerIntel 8257 programmable dma controller
Intel 8257 programmable dma controllerabdulugc
 
Troubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTroubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel Poder
Tanel Poder
 
Juniper Networks Router Architecture
Juniper Networks Router ArchitectureJuniper Networks Router Architecture
Juniper Networks Router Architecture
lawuah
 
Brkdct 3101
Brkdct 3101Brkdct 3101
Brkdct 3101
Nguyen Van Linh
 
ARM stacks, subroutines, Cortex M3, LPC 214X
ARM  stacks, subroutines, Cortex M3, LPC 214XARM  stacks, subroutines, Cortex M3, LPC 214X
ARM stacks, subroutines, Cortex M3, LPC 214X
Karthik Vivek
 
Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013
Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013
Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013makezine
 
Shak larry-jeder-perf-and-tuning-summit14-part1-final
Shak larry-jeder-perf-and-tuning-summit14-part1-finalShak larry-jeder-perf-and-tuning-summit14-part1-final
Shak larry-jeder-perf-and-tuning-summit14-part1-finalTommy Lee
 
Analisis_avanzado_vmware
Analisis_avanzado_vmwareAnalisis_avanzado_vmware
Analisis_avanzado_vmware
virtualizacionTV
 
Advanced Root Cause Analysis
Advanced Root Cause AnalysisAdvanced Root Cause Analysis
Advanced Root Cause Analysis
Eric Sloof
 
When the OS gets in the way
When the OS gets in the wayWhen the OS gets in the way
When the OS gets in the way
Mark Price
 

Similar to Analysis of Open-Source Drivers for IEEE 802.11 WLANs (20)

Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...
Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...
Best practices for catalyst 4500 4000, 5500-5000, and 6500-6000 series switch...
 
Ccna Imp Guide
Ccna Imp GuideCcna Imp Guide
Ccna Imp Guide
 
Implementation of MAC-level sleep-scheduling
Implementation of MAC-level sleep-schedulingImplementation of MAC-level sleep-scheduling
Implementation of MAC-level sleep-scheduling
 
Introduction to 8085svv
Introduction to 8085svvIntroduction to 8085svv
Introduction to 8085svv
 
etherlink plus developers guide
etherlink plus developers guideetherlink plus developers guide
etherlink plus developers guide
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
 
Unit2 arm
Unit2 armUnit2 arm
Unit2 arm
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
 
AAME ARM Techcon2013 004v02 Debug and Optimization
AAME ARM Techcon2013 004v02 Debug and OptimizationAAME ARM Techcon2013 004v02 Debug and Optimization
AAME ARM Techcon2013 004v02 Debug and Optimization
 
Intel 8257 programmable dma controller
Intel 8257 programmable dma controllerIntel 8257 programmable dma controller
Intel 8257 programmable dma controller
 
Intel 8257 programmable dma controller
Intel 8257 programmable dma controllerIntel 8257 programmable dma controller
Intel 8257 programmable dma controller
 
Troubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTroubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel Poder
 
Juniper Networks Router Architecture
Juniper Networks Router ArchitectureJuniper Networks Router Architecture
Juniper Networks Router Architecture
 
Brkdct 3101
Brkdct 3101Brkdct 3101
Brkdct 3101
 
ARM stacks, subroutines, Cortex M3, LPC 214X
ARM  stacks, subroutines, Cortex M3, LPC 214XARM  stacks, subroutines, Cortex M3, LPC 214X
ARM stacks, subroutines, Cortex M3, LPC 214X
 
Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013
Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013
Alden Hart and Rob Giesburt at Hardware Innovation Summit 2013
 
Shak larry-jeder-perf-and-tuning-summit14-part1-final
Shak larry-jeder-perf-and-tuning-summit14-part1-finalShak larry-jeder-perf-and-tuning-summit14-part1-final
Shak larry-jeder-perf-and-tuning-summit14-part1-final
 
Analisis_avanzado_vmware
Analisis_avanzado_vmwareAnalisis_avanzado_vmware
Analisis_avanzado_vmware
 
Advanced Root Cause Analysis
Advanced Root Cause AnalysisAdvanced Root Cause Analysis
Advanced Root Cause Analysis
 
When the OS gets in the way
When the OS gets in the wayWhen the OS gets in the way
When the OS gets in the way
 

Analysis of Open-Source Drivers for IEEE 802.11 WLANs

  • 1. 1 Analysis of Open-Source Drivers for 802.11 WLANs Danh Nguyen 07/12/2013
  • 2. 2 Summary • How device drivers work • Socket buffer • Mac80211 walk through • Ath9k walk through • What’s configurable
  • 5. 5 struct net_device • The central structure representing a network device (drivers + HW) in kernel subsystem • Network drivers allocate, initialize, and operate it • Contains info about IF: o Global: name, state, init function callbacks o Hardware: memory, irq, port, dma channels o Interface info: MAC addr, mtu, num. of TX queues (IF queues), type, flags and features o Device methods: kernel callbacks for features provided: `open()`, `stop()`, `hard_start_xmit()`, `tx_timeout()`, `do_ioctl()`, etc. o Utilities fields: tx/rx timestamps, private IF data (hw queues?), multicast, spinlocks…
  • 6. 6 Socket Buffer • Important data structure to represent packets (complete, down to PSDU) in kernel • 2 parts: o Packet data: actual PSDU memory allocation o Management (`struct sk_buff *skb`)  Management pointers to different part of packet data › Layer headers (TCP, IP, MAC) › PDU for each layer • Where drivers / network subsystem can do DPI before handing off to applications
  • 8. 8 Mac80211 Walk Through • mac80211 o “Upper” MAC functions  Data packaging – attach/detach 802.11 headers  TX/RX paths – include software en-/decryption  QoS (admission control) o Control paths (MLME)  De/Authenticate  Beacon / Probe  Timing Sync Function o Monitor mode support o Rate control Cfg80211 SoftMAC Driver - ath5k/9k, brcmsmac, iwlwifi Mac80211 - “Upper” MAC / MLME Userspace nl80211 Cfg80211_ops Ieee8011_ops
  • 9. 9 TX Path in mac80211
  • 10. 10 Transmission Path: Kernel -> mac80211 -> ath9k
  • 11. 11 SoftMAC Details • IF Driver o Mapping TX queues to HW queues o Control PHY o Hardware signaling / sync / interrupts o Some with more control over PHY than others (Atheros vs. Broadcom) Cfg80211 SoftMAC Driver - ath5k/9k, brcmsmac, iwlwifi Mac80211 - “Upper” MAC / MLME Userspace nl80211 Cfg80211_ops Ieee8011_ops
  • 14. 14 What’s Configurable • All MAC Layer functionalities, upper or lower • Ath9k keeps track of each HW queue lower-MAC parameters (CSMA/CA parameters): CWmin, CWmax, back-off values, AIFS, and other TX ops o Set them based on mac80211 TX/RX params (`tid`) • Ath9k maps mac80211 tx queues (4, as per 802.11e) to HW queues (10, for Atheros) o Per-packet mappings o TX ops propagates from mac80211 -> ath9k -> PHY Firmware • Some PHY parameters can be changed together w/ CSMA/CA params o Code rates, bursting, antenna power, fix antenna via API o Additional PHY control: modify open-source PHY firmware
  • 15. 15 Example: Spectral Scanning • Mobicom 2011 Demo: “Dynamic Frequency Selection through Collaborative Reporting in WLANs” • In 802.11, channel selection performed by AP o Based on RSSI o Static -> not consistent with wireless medium • A frequency selection algorithm o Based on Mad-WiFi o Switch operation channels based on channel and traffic conditions o Collaborative reporting: STAs feedback to APs
  • 17. 17 References • Linux Device Drivers, 3rd Ed. (O’Reilly Book) • http://nitlab.inf.uth.gr/NITlab/index.php/testbed/ha rdware/sensors/2-uncategorised/367-dynamic- frequency-selection-through-collaborative- reporting-in-wlans (Demo)