Step 1: User enables Wi-Fi
When a user enables Wi-Fi on a device, the Wi-Fi interface starts. Shill information about the current status of the Wi-Fi interface is updated. In addition, wpa_supplicant, which is responsible for connecting the device to the Wi-Fi network, starts.
- The Wi-Fi interface on the device, wlan0, starts.
- wpa_supplicant reports its own media access control (MAC) address after the interface is enabled. In this case, it's 9c:d2:1e:60:3b:71.
- wpa_supplicant sets its roaming threshold, which is 18 dB. This threshold is a function of signal strength and not the signal-to-noise ratio (SNR).
localhost shill: [0815/104602:VERBOSE2:device.cc(1178)] Device wlan0 starting
localhost shill: [0815/104602:INFO:manager.cc(1021)] Device wlan0 updated: enabled
localhost shill: [0815/104602:VERBOSE2:wifi.cc(295)] WiFi wlan0 starting.
localhost shill: [0815/104602:VERBOSE2:device.cc(1130)] OnEnabledStateChanged (target: 1, success: 1) on wlan0
localhost shill: [0815/104602:INFO:wifi.cc(1916)] wlan0: enabled supplicant: present proxy: null
localhost shill: [0815/104602:VERBOSE2:wifi.cc(1869)] WiFi debug scope changed; enable is now 1
localhost shill: [0815/104602:VERBOSE2:wifi.cc(1884)] WiFi debug level is currently msgdump; assuming that it is being controlled elsewhere.
localhost wpa_supplicant[1111]: RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
localhost wpa_supplicant[1111]: nl80211: Interface up
localhost wpa_supplicant[1111]: wlan0: Event INTERFACE_ENABLED (29) received
localhost wpa_supplicant[1111]: wlan0: Interface was enabled
localhost wpa_supplicant[1111]: wlan0: Own MAC address: 9c:d2:1e:60:3b:71
localhost wpa_supplicant[1111]: wlan0: State: INTERFACE_DISABLED -> DISCONNECTED
localhost wpa_supplicant[1111]: wpa_driver_nl80211_set_operstate: operstate 0->0 (DORMANT)
localhost wpa_supplicant[1111]: netlink: Operstate: linkmode=-1, operstate=5
localhost wpa_supplicant[1111]: wlan0: Setting scan request: 0 sec 0 usec
localhost wpa_supplicant[1111]: RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
localhost wpa_supplicant[1111]: wlan0: Event INTERFACE_STATUS (5) received
localhost wpa_supplicant[1111]: wlan0: No enabled networks - do not scan
localhost wpa_supplicant[1111]: wlan0: State: DISCONNECTED -> INACTIVE
localhost wpa_supplicant[1111]: wlan0: Setting roam threshold: 18 dB
Step 2: Scan for Wi-Fi networks
Shill requests that wpa_supplicant performs a scan for new Wi-Fi networks. Shill monitors the scan results.
- Zero (0) hidden services are found. Therefore, no hidden networks were defined by manual or policy configuration. A hidden network is one that does not broadcast its existence via beacon frames. Beacon frames contain information about the network and are transmitted periodically to announce the presence of a wireless local area network (LAN).
localhost wpa_supplicant[1111]: wlan0: Setting scan interval: 1 sec
localhost shill: [0815/104602:INFO:wifi.cc(407)] Scan [full] on wlan0 (progressive scan DISABLED) from ConnectToSupplicant
localhost shill: [0815/104602:VERBOSE2:wifi.cc(1290)] WiFi wlan0 scan requested.
localhost shill: [0815/104602:VERBOSE2:wifi_provider.cc(447)] Found 0 hidden services
localhost wpa_supplicant[1111]: Scan requested (ret=0) - scan timeout 30 seconds
localhost wpa_supplicant[1111]: nl80211: Event message available
localhost wpa_supplicant[1111]: nl80211: Scan trigger
Step 3: wpa_supplicant detects beacon frames
During the scan for new Wi-Fi networks, wpa_supplicant detects the beacon frames broadcasted from nearby access points (APs). It registers each AP as a separate Basic Service Set Identifier (BSSID).
Logs
- Each instance of beacon hint indicates an AP that’s broadcasting its network information.
- wpa_supplicant registered each of the 5 networks of interest as separate BSSIDs.
- wpa_supplicant creates a BSSID based on 2 parameters, service set identifier (SSID) and MAC address.
- Over time, wpa_supplicant flushes out and clears BSSIDs that are no longer valid.
localhost wpa_supplicant[1111]: nl80211: Event message available
localhost wpa_supplicant[1111]: nl80211: Regulatory beacon hint
localhost wpa_supplicant[1111]: wlan0: Event CHANNEL_LIST_CHANGED (31) received
localhost wpa_supplicant[1111]: nl80211: Event message available
localhost wpa_supplicant[1111]: nl80211: Regulatory beacon hint
localhost wpa_supplicant[1111]: wlan0: Event CHANNEL_LIST_CHANGED (31) received
localhost wpa_supplicant[1111]: nl80211: Event message available
localhost wpa_supplicant[1111]: nl80211: Regulatory beacon hint
localhost wpa_supplicant[1111]: wlan0: Event CHANNEL_LIST_CHANGED (31) received
localhost wpa_supplicant[1111]: wlan0: BSS: Add new id 1445 BSSID 74:44:01:71:cf:91 SSID 'Network4'
localhost wpa_supplicant[1111]: dbus: Register BSS object '/fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1445'
localhost wpa_supplicant[1111]: wlan0: BSS: Add new id 1446 BSSID 00:24:6c:db:e4:d0 SSID 'Network5'
localhost wpa_supplicant[1111]: dbus: Register BSS object '/fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1446'
localhost wpa_supplicant[1111]: wlan0: BSS: Add new id 1449 BSSID 00:24:6c:e2:c0:30 SSID 'Network5'
localhost wpa_supplicant[1111]: dbus: Register BSS object '/fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1449'
localhost wpa_supplicant[1111]: wlan0: BSS: Add new id 1458 BSSID b0:c7:45:6b:b1:97 SSID 'Network1'
localhost wpa_supplicant[1111]: dbus: Register BSS object '/fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1458'
localhost wpa_supplicant[1111]: wlan0: BSS: Add new id 1471 BSSID 00:24:6c:60:f2:c1 SSID 'Network3'
localhost wpa_supplicant[1111]: dbus: Register BSS object '/fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1471'
localhost wpa_supplicant[1111]: wlan0: BSS: Add new id 1516 BSSID 00:24:6c:db:e4:d1 SSID 'Network2'
localhost wpa_supplicant[1111]: dbus: Register BSS object '/fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1516'
Step 4: Shill registers endpoints
Shill records information about the BSSIDs, including signal strength, security type, and frequency. For each Wi-Fi network, each AP (or BSSID) is an endpoint. Shill assigns the endpoints to a specific service. If a service doesn’t exist, shill constructs one so that it can register the endpoint. Shill manages WiFi connections using services that are defined as a SSID plus Security type pair.
Logs
- Shill constructed service 44 for Network4.
- Shill references endpoints by their MAC address.
- Signal strength is measured in dB.
- Network1 and Network2 are service0 and service1, respectively. They have a higher connection priority because they’re managed by a policy.
- Due to a policy, devices automatically connect to Network1 when it's available. Therefore, it has the highest priority and lowest service number.
localhost shill: [0815/104606:VERBOSE1:wifi.cc(1113)] Found endpoint. RPC path: /fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1445, [SSID=Network4], bssid: 74:44:01:71:cf:91, signal: -46, security: 802_1x, frequency: 5180
localhost shill: [0815/104606:INFO:service.cc(242)] wifi service 44 constructed.
localhost shill: [0815/104606:VERBOSE2:eap_credentials.cc(216)] Not connectable: Identity is empty.
localhost shill: [0815/104606:INFO:wifi_service.cc(155)] Constructed WiFi service 44 name: [SSID=Network4]
localhost shill: [0815/104606:VERBOSE2:manager.cc(965)] Registering service 44
localhost shill: [0815/104606:VERBOSE2:service.cc(1044)] SetProfile from to
localhost shill: [0815/104606:VERBOSE1:wifi_provider.cc(260)] Assigned endpoint 74:44:01:71:cf:91 to service 44.
localhost shill: [0815/104606:VERBOSE1:wifi.cc(1113)] Found endpoint. RPC path: /fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1446, [SSID=Network5], bssid: 00:24:6c:db:e4:d0, signal: -64, security: 802_1x, frequency: 5180
localhost shill: [0815/104606:INFO:service.cc(242)] wifi service 45 constructed.
localhost shill: [0815/104606:VERBOSE2:eap_credentials.cc(216)] Not connectable: Identity is empty.
localhost shill: [0815/104606:INFO:wifi_service.cc(155)] Constructed WiFi service 45 name: [SSID=Network5]
localhost shill: [0815/104606:VERBOSE2:manager.cc(965)] Registering service 45
localhost shill: [0815/104606:VERBOSE1:wifi_provider.cc(260)] Assigned endpoint 00:24:6c:db:e4:d0 to service 45.
localhost shill: [0815/104606:VERBOSE1:wifi.cc(1113)] Found endpoint. RPC path: /fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1449, [SSID=Network5], bssid: 00:24:6c:e2:c0:30, signal: -62, security: 802_1x, frequency: 5805
localhost shill: [0815/104606:VERBOSE1:wifi_provider.cc(260)] Assigned endpoint 00:24:6c:e2:c0:30 to service 45.
localhost shill: [0815/104606:VERBOSE1:wifi.cc(1113)] Found endpoint. RPC path: /fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1458, [SSID=Network1], bssid: b0:c7:45:6b:b1:97, signal: -59, security: rsn, frequency: 2422
localhost shill: [0815/104606:VERBOSE1:wifi_provider.cc(260)] Assigned endpoint b0:c7:45:6b:b1:97 to service 0
localhost shill: [0815/104606:VERBOSE1:wifi.cc(1113)] Found endpoint. RPC path: /fi/w1/wpa_supplicant1/Interfaces/0/BSSs/1516, [SSID=Network2], bssid: 00:24:6c:db:e4:d1, signal: -62, security: none, frequency: 5180
localhost shill: [0815/104606:VERBOSE1:wifi_provider.cc(260)] Assigned endpoint 00:24:6c:db:e4:d1 to service 1.