aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-06-11 03:42:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:18:11 -0400
commitacc1e7a3007ec1940374206a84465c1e0cfcda09 (patch)
treeaf6f8a36da6979d0e4504615aa57a6b4bd87c561 /Documentation
parent14a08a7fcf72a8d69cdee225cc76c50b229faa20 (diff)
mac80211_hwsim: 802.11 radio simulator for mac80211
mac80211_hwsim is a Linux kernel module that can be used to simulate arbitrary number of IEEE 802.11 radios for mac80211 on a single device. It can be used to test most of the mac80211 functionality and user space tools (e.g., hostapd and wpa_supplicant) in a way that matches very closely with the normal case of using real WLAN hardware. From the mac80211 view point, mac80211_hwsim is yet another hardware driver, i.e., no changes to mac80211 are needed to use this testing tool. Signed-off-by: Jouni Malinen <j@w1.fi> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/networking/mac80211_hwsim/README68
-rw-r--r--Documentation/networking/mac80211_hwsim/hostapd.conf11
-rw-r--r--Documentation/networking/mac80211_hwsim/wpa_supplicant.conf10
3 files changed, 89 insertions, 0 deletions
diff --git a/Documentation/networking/mac80211_hwsim/README b/Documentation/networking/mac80211_hwsim/README
new file mode 100644
index 000000000000..2f6e90fcb5a7
--- /dev/null
+++ b/Documentation/networking/mac80211_hwsim/README
@@ -0,0 +1,68 @@
1mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
2Copyright (c) 2008, Jouni Malinen <j@w1.fi>
3
4This program is free software; you can redistribute it and/or modify
5it under the terms of the GNU General Public License version 2 as
6published by the Free Software Foundation.
7
8
9Introduction
10
11mac80211_hwsim is a Linux kernel module that can be used to simulate
12arbitrary number of IEEE 802.11 radios for mac80211 on a single
13device. It can be used to test most of the mac80211 functionality and
14user space tools (e.g., hostapd and wpa_supplicant) in a way that
15matches very closely with the normal case of using real WLAN
16hardware. From the mac80211 view point, mac80211_hwsim is yet another
17hardware driver, i.e., no changes to mac80211 are needed to use this
18testing tool.
19
20The main goal for mac80211_hwsim is to make it easier for developers
21to test their code and work with new features to mac80211, hostapd,
22and wpa_supplicant. The simulated radios do not have the limitations
23of real hardware, so it is easy to generate an arbitrary test setup
24and always reproduce the same setup for future tests. In addition,
25since all radio operation is simulated, any channel can be used in
26tests regardless of regulatory rules.
27
28mac80211_hwsim kernel module has a parameter 'radios' that can be used
29to select how many radios are simulates (default 2). This allows
30configuration of both very simply setups (e.g., just a single access
31point and a station) or large scale tests (multiple access points with
32hundreds of stations).
33
34mac80211_hwsim works by tracking the current channel of each virtual
35radio and copying all transmitted frames to all other radios that are
36currently enabled and on the same channel as the transmitting
37radio. Software encryption in mac80211 is used so that the frames are
38actually encrypted over the virtual air interface to allow more
39complete testing of encryption.
40
41A global monitoring netdev, hwsim#, is created independent of
42mac80211. This interface can be used to monitor all transmitted frames
43regardless of channel.
44
45
46Simple example
47
48This example shows how to use mac80211_hwsim to simulate two radios:
49one to act as an access point and the other as a station that
50associates with the AP. hostapd and wpa_supplicant are used to take
51care of WPA2-PSK authentication. In addition, hostapd is also
52processing access point side of association.
53
54Please note that the current Linux kernel does not enable AP mode, so a
55simple patch is needed to enable AP mode selection:
56http://johannes.sipsolutions.net/patches/kernel/all/LATEST/006-allow-ap-vlan-modes.patch
57
58
59# Build mac80211_hwsim as part of kernel configuration
60
61# Load the module
62modprobe mac80211_hwsim
63
64# Run hostapd (AP) for wlan0
65hostapd hostapd.conf
66
67# Run wpa_supplicant (station) for wlan1
68wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf
diff --git a/Documentation/networking/mac80211_hwsim/hostapd.conf b/Documentation/networking/mac80211_hwsim/hostapd.conf
new file mode 100644
index 000000000000..08cde7e35f2e
--- /dev/null
+++ b/Documentation/networking/mac80211_hwsim/hostapd.conf
@@ -0,0 +1,11 @@
1interface=wlan0
2driver=nl80211
3
4hw_mode=g
5channel=1
6ssid=mac80211 test
7
8wpa=2
9wpa_key_mgmt=WPA-PSK
10wpa_pairwise=CCMP
11wpa_passphrase=12345678
diff --git a/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf b/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf
new file mode 100644
index 000000000000..299128cff035
--- /dev/null
+++ b/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf
@@ -0,0 +1,10 @@
1ctrl_interface=/var/run/wpa_supplicant
2
3network={
4 ssid="mac80211 test"
5 psk="12345678"
6 key_mgmt=WPA-PSK
7 proto=WPA2
8 pairwise=CCMP
9 group=CCMP
10}