README 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
  2. Copyright (c) 2008, Jouni Malinen <j@w1.fi>
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License version 2 as
  5. published by the Free Software Foundation.
  6. Introduction
  7. mac80211_hwsim is a Linux kernel module that can be used to simulate
  8. arbitrary number of IEEE 802.11 radios for mac80211 on a single
  9. device. It can be used to test most of the mac80211 functionality and
  10. user space tools (e.g., hostapd and wpa_supplicant) in a way that
  11. matches very closely with the normal case of using real WLAN
  12. hardware. From the mac80211 view point, mac80211_hwsim is yet another
  13. hardware driver, i.e., no changes to mac80211 are needed to use this
  14. testing tool.
  15. The main goal for mac80211_hwsim is to make it easier for developers
  16. to test their code and work with new features to mac80211, hostapd,
  17. and wpa_supplicant. The simulated radios do not have the limitations
  18. of real hardware, so it is easy to generate an arbitrary test setup
  19. and always reproduce the same setup for future tests. In addition,
  20. since all radio operation is simulated, any channel can be used in
  21. tests regardless of regulatory rules.
  22. mac80211_hwsim kernel module has a parameter 'radios' that can be used
  23. to select how many radios are simulates (default 2). This allows
  24. configuration of both very simply setups (e.g., just a single access
  25. point and a station) or large scale tests (multiple access points with
  26. hundreds of stations).
  27. mac80211_hwsim works by tracking the current channel of each virtual
  28. radio and copying all transmitted frames to all other radios that are
  29. currently enabled and on the same channel as the transmitting
  30. radio. Software encryption in mac80211 is used so that the frames are
  31. actually encrypted over the virtual air interface to allow more
  32. complete testing of encryption.
  33. A global monitoring netdev, hwsim#, is created independent of
  34. mac80211. This interface can be used to monitor all transmitted frames
  35. regardless of channel.
  36. Simple example
  37. This example shows how to use mac80211_hwsim to simulate two radios:
  38. one to act as an access point and the other as a station that
  39. associates with the AP. hostapd and wpa_supplicant are used to take
  40. care of WPA2-PSK authentication. In addition, hostapd is also
  41. processing access point side of association.
  42. # Load the module (needs to be built into your kernel)
  43. modprobe mac80211_hwsim
  44. # Run hostapd (AP) for wlan0
  45. hostapd hostapd.conf
  46. # Run wpa_supplicant (station) for wlan1
  47. wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf