Question about sending beacons
markryde at gmail.com
Mon Dec 1 09:13:18 EST 2008
Thanks for your reply.
I tried this today:
Use hostapd from git and
added printf in i802_set_beacon() in driver_nl80211.c.
Run the first example of mac80211_hwsim from under
mac80211_hwsim/tests (the hostapd git tree).
namely, I ran:
wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf
with hostapd.conf and wpa_supplicant.conf from the test.
This was first trial and it seems ok.
Then after running hostapd hostapd.conf, I started a sniffer (on the
same machine) thus:
tshark -R wlan -i mon.wlan0
then I ran wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf
This is what I saw in the console:
ioctl[SIOCSIWAUTH]: Operation not supported
WEXT auth param 4 value 0x0 - ioctl[SIOCGIWSCAN]: Resource temporarily
ioctl[SIOCGIWSCAN]: Resource temporarily unavailable
Trying to associate with 02:00:00:00:00:00 (SSID='mac80211 test' freq=2412 MHz)
Associated with 02:00:00:00:00:00
WPA: Key negotiation completed with 02:00:00:00:00:00 [PTK=CCMP GTK=CCMP]
CTRL-EVENT-CONNECTED - Connection to 02:00:00:00:00:00 completed
(auth) [id=0 id_str=]
I also see that I do get to the i802_set_beacon() method in
driver_nl80211.c (due to my addition of printf).
What is strange to me is that I do not see beacon frames in the sniffer !
What I see is:
tshark -R wlan -i mon.wlan0
Capturing on mon.wlan0
1228140028.888129 02:00:00:00:01:00 -> Broadcast IEEE 802.11 Probe
Request,SN=14,FN=0, SSID: "mac80211 test"
1228140028.921542 02:00:00:00:00:00 -> 02:00:00:00:01:00 IEEE 802.11
Probe Response,SN=0,FN=0,BI=100, SSID: "mac80211 test"
1228140028.922042 02:00:00:00:00:00 -> 02:00:00:00:01:00 IEEE 802.11
Probe Response,SN=12,FN=0,BI=100, SSID: "mac80211 test"
1228140028.909587 02:00:00:00:01:00 -> 02:00:00:00:00:00 IEEE 802.11
1228140028.909745 02:00:00:00:00:00 -> 02:00:00:00:01:00 IEEE 802.11
1228140028.909747 02:00:00:00:00:00 -> 02:00:00:00:01:00 IEEE 802.11
1228140028.910179 02:00:00:00:01:00 -> 02:00:00:00:00:00 IEEE 802.11
Association Request,SN=16,FN=0, SSID: "mac80211 test"
1228140028.910265 02:00:00:00:00:00 -> 02:00:00:00:01:00 IEEE 802.11
1228140028.910268 02:00:00:00:00:00 -> 02:00:00:00:01:00 IEEE 802.11
1228140028.910677 02:00:00:00:00:00 -> 02:00:00:00:01:00 EAPOL Key
1228140028.910680 02:00:00:00:00:00 -> 02:00:00:00:01:00 EAPOL Key
Any idea why I do not see beacon frames ?
I am using wireshark-0.99.6-3.fc8.
What should I do in order to sniff beacon frames ?
On Sun, Nov 30, 2008 at 5:55 PM, Jouni Malinen <j at w1.fi> wrote:
> On Sun, Nov 30, 2008 at 04:42:46PM +0200, Mark Ryden wrote:
>> I am new to hostapd; I am using hostapd with nl80211.
>> As far as I know, an Access Point should send something like 10
>> beacons per second.
>> My question is: which method is called to send beacons ? I want to
>> delve into the code a bit.
> hostapd generates the Beacon frame template (everything apart from TIM
> IE) (see ieee802_11_set_beacon() in hostapd/beacon.c) and configures
> that into mac80211 (in kernel). Furthermore, hostapd configures the
> interval for Beacon frame transmission. The actual Beacon frame
> construction (use the template and insert TIM IE) happens in mac80211
> (see ieee80211_beacon_get() in Linux kernel net/mac80211/tx.c) and
> actual transmission/scheduling at the drivers (search for
> ieee80211_beacon_get calls in drivers/net/wireless/...).
> Jouni Malinen PGP id EFC895FA
> HostAP mailing list
> HostAP at lists.shmoo.com
More information about the HostAP