README 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. It can be used to
  9. test most of the mac80211 functionality and user space tools (e.g.,
  10. hostapd and wpa_supplicant) in a way that matches very closely with
  11. the normal case of using real WLAN hardware. From the mac80211 view
  12. point, mac80211_hwsim is yet another hardware driver, i.e., no changes
  13. to mac80211 are needed to use this testing tool.
  14. The main goal for mac80211_hwsim is to make it easier for developers
  15. to test their code and work with new features to mac80211, hostapd,
  16. and wpa_supplicant. The simulated radios do not have the limitations
  17. of real hardware, so it is easy to generate an arbitrary test setup
  18. and always reproduce the same setup for future tests. In addition,
  19. since all radio operation is simulated, any channel can be used in
  20. tests regardless of regulatory rules.
  21. mac80211_hwsim kernel module has a parameter 'radios' that can be used
  22. to select how many radios are simulated (default 2). This allows
  23. configuration of both very simply setups (e.g., just a single access
  24. point and a station) or large scale tests (multiple access points with
  25. hundreds of stations).
  26. mac80211_hwsim works by tracking the current channel of each virtual
  27. radio and copying all transmitted frames to all other radios that are
  28. currently enabled and on the same channel as the transmitting
  29. radio. Software encryption in mac80211 is used so that the frames are
  30. actually encrypted over the virtual air interface to allow more
  31. complete testing of encryption.
  32. A global monitoring netdev, hwsim#, is created independent of
  33. mac80211. This interface can be used to monitor all transmitted frames
  34. regardless of channel.
  35. Simple example
  36. This example shows how to use mac80211_hwsim to simulate two radios:
  37. one to act as an access point and the other as a station that
  38. associates with the AP. hostapd and wpa_supplicant are used to take
  39. care of WPA2-PSK authentication. In addition, hostapd is also
  40. processing access point side of association.
  41. # Build mac80211_hwsim as part of kernel configuration
  42. # Load the module
  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
  48. More test cases are available in hostap.git:
  49. git://w1.fi/srv/git/hostap.git and mac80211_hwsim/tests subdirectory
  50. (http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=tree;f=mac80211_hwsim/tests)