Fedora 8 NetworkManager IWL3945 Update

Bill Moss
March 3, 2008

Content

Current Packages
NetworkManager Overview
Recommendations, What Works
scan_ssid and ap_scan
 
 
 
 
 
 

Introduction. The purpose of this update is to report on the operation of NetworkManager and iwl3945 under Fedora 8 x86_64 (F8) on a Clemson Laptop Program Lenovo T61 which has the following features:

Current Packages. We report on an up-to-date F8 installation plus the latest NetworkManager rpms from http://koji.fedoraproject.org/koji/:

  kernel-2.6.24.3-13.fc8.x86_64
  NetworkManager-vpnc-0.7.0-0.6.3.svn3109.fc8.x86_64
  NetworkManager-0.7.0-0.6.7.svn3370.fc8.x86_64
  NetworkManager-gnome-0.7.0-0.6.7.svn3370.fc8.x86_64
  NetworkManager-glib-0.7.0-0.6.7.svn3370.fc8.x86_64
  wpa_supplicant-0.5.7-21.fc8.x86_64
  vpnc-0.5.1-2.fc8.x86_64
  http://linuxwireless.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2 (3-1-09)

The command '# dmesg | grep iwl' shows

  iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 1.2.26kds
  iwl3945: Copyright(c) 2003-2007 Intel Corporation
  iwl3945: Detected Intel PRO/Wireless 3945ABG Network Connection
  phy0: Selected rate control algorithm 'iwl-3945-rs'
  iwl3945: Tunable channels: 11 802.11bg, 13 802.11a channels

By using compat-wireless, the most up-to-date wireless drivers can be hacked and built without building a kernel.

NetworkManager Overview

(a) NetworkManager stores access point connection data (NM stored AP list) for each access point that it has successfully connected to. When NetworkManager starts, it directs the wireless driver to do a couple of scans and produces a list of scanned access points (NM scanned AP list). NetworkManager then creates a dynamic access point list (NM available AP list) consisting of access points that are in both the NM stored AP list and the NM scanned AP list. Comparisons are made by SSID and BSSID so that the NM available AP list can contain hidden access points.

(b) NetworkManager uses the wpa_supplicant to connect to the access point in the NM available AP list that was mostly recently connected to. Depending on driver capabilities, wpa_supplicant may direct the wireless driver to do a scan by SSID. In particular, this is usually required to make a connection to a hidden access point.

(c) Once a connection has been made, NetworkManager directs the wireless driver to scan every two minutes and NetworkManager uses these scan results to keep the NM available AP list up-to-date.

To be compatible with NetworkManager, a wireless driver must support the wireless extensions, must be able to scan both broadcast and hidden access points, and must be able to connect to broadcast and hidden access points using wpa_supplicant.

The iwlwifi drivers support both hardware and software scanning. Currently, hardware scanning is faster and more reliable and so is recommended for use with NetworkManager. Hardware scanning is currently the default for iwlwifi. This report discusses hardware scanning only.

  /etc/modprobe.conf
  
  alias wlan0 iwl3945
  options iwl3945 disable_hw_scan=0  <-- default, enables hardware scanning
  OR
  options iwl3945 disable_hw_scan=1  <-- enables software scanning

Recommandations, What Works. First, use the default hardware scanning. Software scanning is still plagued by random disassociations; No probe response error messages are seen in dmesg and the driver incorrectly thinks that the access point has moved out of range.

Second, avoid hidden access points if you can. Microsoft and Cisco have been saying this for years.

The following table indicates what is working. Connections are attempted with 128 bit static WEP starting from boot.

iwl3945 with hardware scanning enabled

broadcast/hidden iwlist wlan0 scan
driver not associated (1)
system-config-network wpa_supplicant
ap_scan=1, scan_ssid=1
NetworkManager
broadcast s,s,s,s,s,s,s,s,s,s (2) no (4) yes yes (5)
hidden f,f,f,f,f,f,f,f,f,f (3) no (4) yes yes (5)

(1) This experiment was done in an environment with a single access point, a Linksys WRT54GL, which can be configured as a broadcast or hidden access point. The iwl3945 driver is an a/b/g, while the WRT54GL access point is b/g. The connections made are g connections on the 2.4GHz band.

After boot, a script was run that contains the commands

  #!/bin/bash

  ifconfig wlan0 up

  iwlist wlan0 scan
  for ((  i = 0 ;  i < 10;  i++  ))
  do
    sleep 5
    iwlist wlan0 scan
  done
  
  s => the scan result contains the access point
  
  f => no scan results

The command 'iwlist wlan0 scan' produces what iwlwifi calls an indirect scan. The command 'iwlist wlan0 scan essid my_ssid' produces what iwlwifi calls a direct scan, which is also called a scan by ssid. There are two additional terms, active and passive, that are commonly used to describe scans.

During a passive scan, the driver listens for an access point beacon on each supported channel. The driver then extracts data from each received beacon frame. A passive scan can detect the presence of access points that have a hidden ssid.

During an active scan, the driver sends a probe request frame on each supported channel to solicit a probe response frame from an access point with a specified ssid. Hidden access point are not visible to an active scan.

(2) After boot with the driver not associated to the broadcast access point, each scan result contained the access point.

(3) After boot with the driver not associated to the hidden access point, each scan produced the 'No scan results' output.

When doing an indirect scan, the iwl3945 driver uses an active scan for the b/g channels in the 2.4GHz band. Hidden access points are not visible to an active scan. This is a bug. A patch for iwl3945-base.c has been submitted to intellinuxwireless, which insures that when iwl3945 does an indirect scan, each channel is scanned passively.

(4) After boot or an iwl3945 module reload, with the driver not associated to a broadcast or hidden access point, the Fedora ifup script fails to make a connection. This is a bug. A patch for ieee80211_sta.c has been submitted to mac30211 which fixes this bug.

  http://marc.info/?l=linux-wireless&m=120465031914252&w=2

(5) With the iwl3945-base.c patch in place, NetworkManager performance is the same for the broadcast and hidden cases. On boot, NetworkManager auto connects immediately to an access point in the NM available AP list.

scan_ssid and ap_scan. The iwlwifi drivers and other mac80211 drivers require the wpa_supplicant settings ap_scan=1 and scan_ssid=1 when attempting to connect to a hidden access point with wpa_supplicant or with NetworkManager. These settings can also be used for the broadcast case. Dan Williams has submitted a patch upstream which is scheduled for 2.6.25. Distros can backport to obtain better hidden ssid handling. The kernel will then be able to detect the scan capabilities of wireless drivers. NetworkManager will determine the scan capabilities from the kernel and then set ap_scan and scan_ssid accordingly. This kernel patch is in the kernel reported on here.