diff mbox

(non-FT) Roaming question

Message ID 9a46753b-184b-3e06-0305-310f9980f59c@sony.com
State RFC
Headers show

Commit Message

Mikael Kanstrup May 12, 2017, 10:29 a.m. UTC
Hi,

A few questions about non-FT roaming. Basically the case moving between 
two bsses with identical configuration on same local network.

Is the association towards first AP lost as soon as roaming towards the 
other AP is initiated?

I ask to better understand the following scenario:

1. STA connects to first AP (AP1)
2. STA initiates roam to second AP (AP2)
3. AP2 fails to respond with Association Response
4. STA times out waiting for Association Response
5. STA disconnects from AP1
6. STA decides to reconnect, finds AP1 and reconnects

Why is STA disconnected from AP1 at step 5 above? Can't the old 
association with AP1 be kept to allow a non-interrupted connection 
towards the network if roam fails?

We see this happing on crowded networks where the number of 
retransmitted management frames at times are huge. Logs from a simulated 
environment available.

Supplicant debug log with the scenario:
https://drive.google.com/open?id=0Bzur-VMGp9u5RkcyeFdxOWt4R3c

The logs are from a setup like this:
- Two hostapds (latest version from git) running with D-Link DWA-160 
adapters (driver rx28xx)
- wpa_supplicant (latest version from git) running with Raspberry PI 
Wi-Fi dongle (driver brcmfmac)
- hostapd has been patched with attached patch to allow blocking assoc 
response frames.

/Mikael
diff mbox

Patch

From 2436296d96e656aafe8561134e5d14db879f7d04 Mon Sep 17 00:00:00 2001
From: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
Date: Wed, 25 Jan 2017 10:57:25 +0100
Subject: [PATCH] hostapd: Add skip_auth_reply and skip_assoc_reply test
 commands

Add skip_auth_reply and skip_assoc_reply commands for testing purpuses.
By enabling skip with the new command either authentication reply
and/or association reply frames are skipped from being sent by AP. These
commands can be used to simulate dropped reply frames.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
---
 hostapd/ctrl_iface.c |  4 ++++
 src/ap/hostapd.h     |  2 ++
 src/ap/ieee802_11.c  | 17 +++++++++++++++++
 3 files changed, 23 insertions(+)

diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 9bfead0..34a1768 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -1278,6 +1278,10 @@  static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
 		hapd->ext_mgmt_frame_handling = atoi(value);
 	} else if (os_strcasecmp(cmd, "ext_eapol_frame_io") == 0) {
 		hapd->ext_eapol_frame_io = atoi(value);
+	} else if (os_strcasecmp(cmd, "skip_auth_reply") == 0) {
+		hapd->skip_auth_reply = !!atoi(value);
+	} else if (os_strcasecmp(cmd, "skip_assoc_reply") == 0) {
+		hapd->skip_assoc_reply = !!atoi(value);
 #endif /* CONFIG_TESTING_OPTIONS */
 #ifdef CONFIG_MBO
 	} else if (os_strcasecmp(cmd, "mbo_assoc_disallow") == 0) {
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index e7c65f7..96ccbb1 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -302,6 +302,8 @@  struct hostapd_data {
 #ifdef CONFIG_TESTING_OPTIONS
 	unsigned int ext_mgmt_frame_handling:1;
 	unsigned int ext_eapol_frame_io:1;
+	unsigned int skip_auth_reply:1;
+	unsigned int skip_assoc_reply:1;
 
 	struct l2_packet_data *l2_test;
 #endif /* CONFIG_TESTING_OPTIONS */
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index d15a70c..5532d81 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -280,6 +280,14 @@  static int send_auth_reply(struct hostapd_data *hapd,
 	size_t rlen;
 	int reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE;
 
+#ifdef CONFIG_TESTING_OPTIONS
+	if (hapd->skip_auth_reply) {
+		wpa_printf(MSG_INFO, "skip_auth_reply active: STA=" MACSTR,
+			   MAC2STR(dst));
+		return WLAN_STATUS_SUCCESS;
+	}
+#endif /* CONFIG_TESTING_OPTIONS */
+
 	rlen = IEEE80211_HDRLEN + sizeof(reply->u.auth) + ies_len;
 	buf = os_zalloc(rlen);
 	if (buf == NULL)
@@ -2740,6 +2748,15 @@  static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
 	}
 #endif /* CONFIG_FILS */
 
+#ifdef CONFIG_TESTING_OPTIONS
+	if (hapd->skip_assoc_reply) {
+		wpa_printf(MSG_INFO, "skip_assoc_reply active: STA=" MACSTR,
+			   MAC2STR(sta->addr));
+		return WLAN_STATUS_SUCCESS;
+	}
+#endif /* CONFIG_TESTING_OPTIONS */
+
+
 #ifdef CONFIG_OWE
 	if ((hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_OWE) &&
 	    sta && sta->owe_ecdh &&
-- 
2.10.1.502.g6598894