todo: nl80211 work is finished
[NetworkManager.git] / TODO
1 So you're interested in hacking on NetworkManager?  Here's some cool
2 stuff you could do...
3
4 * Internet Connectivity Detection
5
6 This feature would consist of attempting to make an HTTP request to a known
7 DNS address and compare the response to a well-known string, like Windows does.
8 This feature and the server address should be configurable via an option in the
9 /etc/NetworkManager/NetworkManager.conf config file.
10
11 Once the device has successfully gotten an IPv4 or IPv6 address, it should
12 enter the state NM_DEVICE_STATE_IP_CHECK, where this HTTP request would be
13 performed.  After the check was done, the device would set a property in
14 NMDevicePrivate to indicate whether Internet access was successful or not, and
15 advance to the NM_DEVICE_STATE_ACTIVATED state.
16
17 The NMManager object, when determining the overall NM_STATE_* state in the
18 nm_manager_update_state() function, would query this property and set
19 NM_STATE_CONNECTED_LOCAL, NM_STATE_CONNECTED_SITE, or NM_STATE_CONNECTED_GLOBAL
20 based on it and the device's state.
21
22 Ideally this feature would not require linking to an HTTP library like libcurl,
23 but would use open-coded simple HTTP or libsoup for the request.  The request
24 must be done asynchronously, of course.
25
26
27 * ADSL support
28
29 NetworkManager should natively support ADSL modems using one of the 3 main
30 connection methods, PPP over ATM (pppoa), PPP over Ethernet (pppoe), or
31 IP over ATM (ipoatm).  Initial support could be targeted at just pppoa and
32 pppoe, and there is some code in NetworkManager already for pppoe.  More info
33 about ADSL configuration on Linux in general is here:
34
35 http://atm.eagle-usb.org/wakka.php?wiki=UeagleAtmDoc
36
37 Big thanks to Pantelis Koukousoulas for getting ADSL working for PPPoA and PPPoE
38 methods in the 'adsl' branch in NetworkManager git.  We need more testing, IPv6
39 PPP support, and also support for multiple ADSL devices (by reading the "atmindex"
40 attribute from the sysfs directory for the ATM interface on 2.6.38.8 and later
41 kernels).
42
43
44 * Real Access Point mode support
45
46 Now that NetworkManager requires wpa_supplicant 0.7.x or later, we can add
47 full Access Point (AP) mode support.  NetworkManager currently implements
48 connection sharing via AdHoc mode support, which has some limitations.  Instead,
49 we should check whether the wifi device supports AP mode, and if so, use
50 that mode instead.  wpa_supplicant has support for a "lightweight AP" mode which
51 we should use.  Witold Sowa started this support a while ago and wrote the new
52 D-Bus API for wpa_supplicant that makes all this possible, but some NM pieces
53 are still missing.  If the wifi driver supports AP mode, then in
54 src/supplicant-manager/ NM should send an AP-mode config instead of sending
55 the adhoc config.
56
57 Note that some devices (airo, ipw2100, ipw2200, iwl3945, iwl4965, atmel, zd1201)
58 will never support AP mode due to firmware limitations, so we clearly must still
59 provide Ad-Hoc connection sharing support for those devices and switch between
60 Ad-Hoc and AP mode depending on device capabilities.
61
62
63 * On-Demand WiFi Scan support
64
65 Single-user and embedded devices often use a continuous wifi scan when the
66 networking configuration interface is open to quickly allow users to find their
67 wifi network.  NM periodically scans, but this could take as long as 2 mintues
68 to update the list.  Note that WiFi scans require 2 - 10 seconds to complete,
69 and during this time normal traffic (video, VOIP, streaming music, downloads,
70 etc) is not transmitted, so a WiFi scan is a disruptive operation to the user.
71
72 A D-Bus method should be added to the NMDeviceWifi device to allow user
73 applications to request a scan.  This request should be rate-limited to no
74 more than once every 10 seconds to give time for traffic to resume when the
75 scan is done, and to lessen the effect of any DDoS by malicious user
76 applications.  This request should also be restricted by one or more PolicyKit
77 permissions like org.freedesktop.NetworkManager.network-control.
78
79 To begin, a new method definition should be added to the
80 introspection/nm-device-wifi.xml for a method called "RequestScan" which takes
81 an argument called "options" of type of "a{sv}".  This argument will be used
82 later.  An annotation (like the other functions have) should be added so that
83 the method will be called "impl_device_request_scan".
84
85 Next, the corresponding method implementation should be added to
86 src/nm-device-wifi.c by adding the prototype for impl_device_request_scan
87 near the top of the file, and implementing it below.  The implementation will
88 recieve a GHashTable corresponding to the "a{sv}" argument list from the XML
89 file, but we can ignore that for now.
90
91 The incoming request should be authenticated using nm_auth_get_caller_uid()
92 and additionally starting a PolicyKit authentication check with
93 with nm_auth_chain_new().  See the function manager_device_disconnect_request()
94 in src/nm-manager.c for an example of this.
95
96 Only after the caller is authorized to scan should the request be checked
97 against the last scan timestamp, and if the last scan was 10 seconds or more
98 ago, a new scan should be requested.
99
100
101 * Reconnect to WiFi Networks Only If They Succeeded Once
102
103 Currently, NetworkManager will attempt to connect to a previously attempted
104 WiFi network even if that network was never successfully connected to.  This
105 causes confusion because sometimes users will randomly try various WiFi networks
106 hoping to find an open AP, and then wonder why NM tries to reconnect to any of
107 those APs later when none of them worked originally due to AP-side MAC filtering
108 or other failures.  What should happen is that NetworkManager should set a flag
109 on a connection when that connection is successfully connected at least once,
110 and only autoconnect the wifi network if that flag is present *and* the
111 NMSettingConnection's 'autoconnect' property is TRUE.
112
113 This is a bit tricky because we want to consider all connections that don't have
114 this flag as having succeeded so that we don't break users' existing connections,
115 while holding all newly created connections to this policy.  This flag should
116 be determined and set for all connections, even if we only use it to determine
117 WiFi behavior for now.
118
119 This flag should be a new gboolean property on the NMSettingConnection object
120 called "connect-success", with a default value of TRUE.  It should default to
121 TRUE to ensure that existing connections are assumed to have connected
122 successfully in the past.  New connections created via the AddConnection and
123 AddAndActivateConnection D-Bus method calls should have the 'connect-success'
124 property explicitly set to FALSE.  Then, in nm-device.c's device_state_changed()
125 function where the NM_DEVICE_STATE_ACTIVATED state is handled, the
126 'connect-success' property should be set to TRUE.
127
128 For WiFi then, in nm-device-wifi.c's get_best_auto_connection() method, the
129 'connect-success' property should be checked and if it is FALSE, the connection
130 is not considered for auto-activation.
131
132
133 * Implement NM_DEVICE_STATE_DISCONNECTING
134
135 To allow for "pre-down" scenarios, this state should be implemented before a
136 device is taken down while it still has connectivity.  If the device is
137 taken down because it's ethernet carrier was dropped, or because the WiFi
138 connection was terminated by the supplicant, this state is pointless and should
139 be skipped.  But if the user requested a manual "disconnect", or NM is dropping
140 connections on exit, etc, then this state should be entered.  In the future
141 this state should hook into a new dispatcher action in src/NetworkManagerUtils.c
142 to exectue dispatcher scripts during the disconnection, and to wait a limited
143 amount of time for each script to complete before allowing the device to
144 proceed to the NM_DEVICE_STATE_DISCONNECTED state, fully implementing pre-down.
145
146
147 * Ethernet Network Auto-detection
148
149 There are various methods we can use to autodetect which wired network connection
150 to use if the user connects to more than one wired network on a frequent basis.
151 First, 802.1x enterprise switches broadcast frames which can be used to indicate
152 that the switch supports 802.1x and thus allow NetworkManager to select an
153 802.1x connection instead of blindly trying DHCP.  Second, NetworkManager could
154 listen for traffic from a list of MAC addresses.  Third, NetworkManager could
155 integrate 'arping' functionality to determine if a given IP address matches a
156 given MAC address, and thus automatically select that connection.  All these
157 methods can co-exist and be used in parallel.
158
159 One small caveat is that MAC addresses are trivial to spoof, so just because
160 NetworkManager has discovered a certain MAC address does not mean the network
161 is authenticated; only 802.1x security can assure that a network is the network
162 the user expects it to be.
163
164 In any case, a new 'anchor-addresses' property of type string-array should be
165 added to the NMSettingWired setting.  Each string element of this property
166 should be of the format "<ip>/<mac>" or simply "<mac>".  The first format with
167 an IP address would indicate that "arping"-type behavior should be used to
168 actively detect the given MAC address; obviously if the given MAC address is
169 used for passive discovery as well.  The second format simply lists a MAC
170 address to passively listen for.
171
172 One drawback of listening or probing for known MAC addresses is an increase in
173 latency during connections to ethernet networks.  The probing/listening delay
174 should be a reasonable amount of time, like 4 - 5 seconds or so, and should
175 only be used when a visible connection has anchor addresses.
176
177 Next a gboolean 'anchor-probing' variable should be added to the
178 NMDeviceEthernetPrivate structure in src/nm-device-ethernet.c.  This variable
179 should be set to TRUE whenever the device's carrier turns on *and* there are
180 visible NMConnections with anchor addresses (ie, connections which are system-
181 wide or where one of the allowed users of that connection is logged in).  Then
182 probing and listening are started, which involves opening a low-level socket
183 on the interface and starting the arping run or listening for MAC addresses.
184 A timer is also started (don't forget to cache the timer's source ID in the
185 NMDeviceEthernetPrivate data, and to cancel the timer whenever the device
186 transitions to any state other than DISCONNECTED).
187
188 If a known MAC address is discovered as a result of probing or listening, the
189 probe/listen socket, timeout, and data are cleaned up, and NetworkManager
190 would begin activation of the NMConnection that specified the found MAC address
191 in the 'anchor-addresses' property.  If two or more connections specify the
192 same MAC address, the connection with the most recent timestamp should be
193 preferred.
194
195 Similarly, if the probing/listening process detects 802.1x frames the device
196 should be marked as requring 802.1x authentication until the carrier drops.
197 This would be accomplished by adding a new property to the NMDeviceEthernet
198 object and exporting that property through the
199 introspection/nm-device-ethernet.xml file.  This would allow clients like
200 applets to ensure that users are aware that the device will not allow
201 un-authenticated connections and that additional credentials are required to
202 successfully connect to this network.
203
204
205 * VPN re-connect
206
207 NM should remember whether a VPN was connected if a connection disconnects
208 (like WiFi drops out or short carrier drop) or if the laptop goes to sleep.
209 Upon reconnect, if the same Connection is again active, the previously
210 connected VPN should be activated again as well.  Basically, don't just drop
211 the VPN because WiFi choked for 10 seconds, but reconnect the VPN if it was
212 connected before the drop.
213
214
215 * VPN autoconnect
216
217 We should add a property to the NMSettingConnection object in
218 libnm-util/nm-setting-connection.c called "vpns" that is a string list,
219 containing a list of Connection UUIDs that should be activated when the base
220 connection itself is activated.  This will allow a VPN connection to be
221 started every time another connection is started, so that if you choose you're
222 always on the VPN in your favorite coffee shop.
223
224 The NM_DEVICE_STATE_SECONDARIES state was added specifically for cases like
225 this.  Thus, after the base device has IP connectivity, but before it has
226 signaled that it's fully activated, the device should enter the SECONDARIES
227 state and kick off activation of the given VPN connection.  Only after this
228 VPN connection has successfully connected should the base device to the
229 NM_DEVICE_STATE_ACTIVATED state.
230
231
232 * VPN and IPv6
233
234 The internal VPN capability should support IPv6.  Essentially, the D-Bus
235 interface between NetworkManager and the VPN service daemons should be extended
236 with an IP6Config signal that passes up the IPv6 addressing and routing details
237 if the VPN daemon is IPv6 capable.  NM should then process those details like it
238 does with IPv4.  include/NetworkManagerVPN.h should be updated with key/value
239 pairs defining the various IPv6 attributes much like the IPv4 ones are defined.
240
241
242 * VPN IP Methods
243
244 Some VPNs (openvpn with TAP for example) require that DHCP is run on a
245 pseudo-ethernet device to obtain addressing information.  This is not currently
246 possible, but NM already has all the code for DHCP.  Thus, a new "method"
247 key should be defined in include/NetworkManagerVPN.h to allow for DHCP to
248 be performed if the VPN service daemon requests it in the IP4Config or IP6Config
249 signals.  A patch here:
250
251 http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?h=vpn-ip-method
252
253 shows that.  In nm-vpn-connection.c, upon receipt of the D-Bus Ip4Config signal
254 from the VPN plugin, NetworkManager would inspect the "method" property of the
255 ip4 config dictionary.  If that property was present and set to "auto" then
256 DHCP would be started using the network interface returned in the dict.  The
257 nm_vpn_connection_ip4_config_get() function should be split up into two
258 functions, one containing the existing code for static configuration, and a
259 second for handling DHCP kickoff.  Minimal parsing of the response should be
260 handled in the newly reduced nm_vpn_connection_ip4_config_get() function.
261
262 To handle DHCP, the NMVPNConnectionPrivate structure should have two members
263 added:
264
265     NMDHCPManager *dhcp_manager;
266     NMDHCPClient  *dhcp4_client;
267
268 which would be initialized in the new DHCP handler code split off from
269 nm_vpn_connection_ip4_config_get().  These new members would be disposed of in
270 both vpn_cleanup() and dispose(), though remember to stop any ongoing DHCP
271 transaction when doing so (see dhcp4_cleanup() in nm-device.c for example code).
272 For basic code to start the DHCP transaction, see dhcp4_start() in nm-device.c
273 as well.  After calling nm_dhcp_manager_start_ip4() and connecting the signals
274 to monitor success and failure, the VPN IP4 config handler would simply return
275 without changing VPN state, unless a failure occurred.
276
277 Then, when the DHCP transaction succeeds, which we'd know by checking the
278 DHCP client state changes in the "state-changed" signal handler we attached to
279 the DHCP client object returned from nm_dhcp_manager_start_ip4(), the code
280 would retrieve the completed NMIP4Config object from the DHCP client using the
281 nm_dhcp_client_get_ip4_config() function, and then proceed to execute
282 essentially the bottom-half of the existing nm_vpn_connection_ip4_config_get()
283 function to merge that config with user overrides and apply it to the VPN
284 tunnel interface.  Other state changes from the DHCP client might trigger a
285 failure of the VPN connection, just like DHCP timeouts and lease-renewal
286 failures do for other devices (see dhcp_state_changed() in nm-device.c).
287
288
289 * VPN Service Daemon Secret Requests
290
291 In addition to NM asking the service daemons whether more secrets are required,
292 VPN service daemons (like nm-vpnc-service, nm-openvpn-service, etc) should be
293 able to ask NetworkManager to provide secrets during the connection attempt. To
294 do this, the plugin should advertise its ability to handle out-of-band secrets
295 in its .service file via the key 'async-secrets=true'.  NetworkManager would
296 check that key and if present activate the VPN as normal, but skip the explicit
297 NeedSecrets calls.
298
299 Instead, a new "SecretsRequired" signal would be added to
300 introspection/nm-vpn-plugin.xml (and corresponding helper code added to
301 libnm-glib/nm-vpn-plugin.c) that would be emitted when the plugin determined
302 that secrets were required.  This signal would have D-Bus signature of "sas"
303 for the arguments [ <s:uuid>, <as:secrets> ] with the <uuid> obviously being
304 the connection UUID, and <secrets> being an array of strings of plugin-specific
305 strings the plugin requires secrets for.  This array of strings would then be
306 passed as the "hints" parameter in nm-vpn-connection.c when secrets are
307 requested from agents in a subsequent nm_settings_connection_get_secrets() call.
308 At this time the agent code only allows one hint per request, so we may need to
309 extend that to allow more than one hint.
310
311 Thus when connecting if the plugin supported async secrets NetworkManager would
312 still request existing secrets (without interactivity) and send them to the
313 VPN service daemon in the Connect D-Bus method, then wait for the service daemon
314 to either request secrets asynchronously via the SecretsRequired signal or to
315 signal successful connection via the Ip4Config signal.
316
317 The vpnc plugin would need to be reworked to open a pipe to vpnc's stdout and
318 stdin file descriptors to capture any authentication messages, and to match
319 these messages to known secrets request strings.  When receiving one of these
320 strings the plugin would determine which secret was being requested and then
321 emit the SecretsRequired signal to NetworkManager.  This would also imply that
322 nm-vpnc-service exectutes vpnc with the "--xauth-inter" argument to enable
323 challenge-response and does not use the "--non-inter" flag which suppresses that
324 behavior.
325
326
327 * WPS
328
329 wpa_supplicant has support for WPS (Wifi Protected Setup, basically Bluetooth-
330 like PIN codes for setting up a wifi connection) and we should add support for
331 this to NetworkManager too.  APs that support WPS will say so in their beacon
332 IEs which are contained in the "WPA" and "RSN" properties of the BSS object
333 exported by the supplicant, and can be processed in src/nm-wifi-ap.c's
334 foreach_property_cb() function.  We should add some private fields to the
335 NMAccessPoint object (defined in nm-wifi-ap.c) to remember whether a specific
336 AP supports WPS and what WPS methods it supports, and expose that over D-Bus to
337 GUI clients as well.
338
339 There are two common WPS setup methods: PIN and button.  For PIN, the router
340 either displays a random PIN on an LCD or the router's web UI, or a static PIN
341 is printed on the router itself.  The user enters that PIN instead of a PSK
342 when connecting.  For the "button" method, the router has a physical button that
343 when pushed, allows any client to connect for a short period of time.
344
345 We'll then need to add some properties to the NMSettingWirelessSecurity setting
346 for the WPS PIN code so that when the user enters it through the GUI, it can
347 be passed back to NM.  And we'll need to figure out some mechanism for passing
348 back an indication that the user pushed the button on the router for the
349 pushbutton method.
350
351 When connecting to a new access point that supports WPS, the GUI client would
352 call the AddAndActivateConnection method and wait for NM to request secrets.
353 NM would determine that the AP supports WPS, and request WPS secrets from the
354 applet.  The applet would ask the user for a PIN, or to push the button on the
355 AP, instead of asking for a passphrase or PSK.  When the user has entered the
356 PIN or pushed the button, the applet returns this information to NM, which
357 proceeds with the connection.
358
359 NM sends the correct wpa_supplicant config for WPS to the supplicant, and waits
360 for the connection to occur.  WPS can only be used the *first* time, so after a
361 first successfull connection, NM must request the actual hexadecimal PSK from 
362 wpa_supplicant via D-Bus, and store that PSK in the connection, clear any WPS
363 PIN code from the connection, and save the connection to backing storage.
364
365 Any applet GUI should also allow the user to enter the PSK instead of completing
366 association using WPS, since quite a few routers out there are broken, or
367 because the user has no physical access to the router itself, but has been given
368 as passphrase/PSK instead.
369
370
371 * Proxies
372
373 HTTP and other proxies are per-connection configuration.  It's highly unlikely
374 that the same proxy you need to use at work is used at home or in a coffee shop.
375 Thus, it makes sense that which proxy settings to use should be updated when
376 network connections change.  NetworkManager is a perfect place to do this since
377 it tracks which network connections are active, and it already queries the
378 network for automatic proxy configuration via DHCP and WPAD.
379
380 We should add a new NMSetting subclass called NMSettingProxy that holds
381 necessary proxy configuration.  The properties of this setting should be a
382 superset of what is provided in the Firefox proxy configuration screen and the
383 various desktop environment proxy configuration tools like the GNOME Network
384 Proxy control panel; this should include at a minimum:
385
386   method: "auto", "manual", "none"
387   default-proxy: string
388   default-proxy-port: uint
389   default-always: boolean (use default proxy for all protocols)
390   ssl-proxy: string
391   ssl-proxy-port: uint
392   ftp-proxy: string
393   ftp-proxy-port: uint
394   socks-proxy: string
395   socks-proxy-port: uint
396   socks-version: uint, either 4 or 5
397   no-proxy-for: array of strings (things not to use the proxy for, ie ".foobar.com",
398                  "192.168.0.1/24", an IPv6 address, etc)
399   pac-url: string (URL of PAC file, overrides DHCP-provided WPAD value)
400   (FIXME: proxy authentication?  do we need separate user/pass properties for
401     each protocol type?  should NM handle proxy auth or should it be punted
402     to each application?)
403
404 After completing IP configuration but still during the NM_DEVICE_STATE_IP_CONFIG
405 activation stage, NetworkManager would merge the automatically supplied proxy
406 configuration (from DHCP's WPAD option) with user-provided overrides from the
407 NMSettingProxy and send the results to the system.  The 'default' connection's
408 proxy configuration would be preferred, so we'd have to update proxy
409 configuration from nm-policy.c the same time we update DNS information and the
410 default route.
411
412 The merged proxy configuration would then be sent to the system.  There is no
413 canonical proxy daemon in-use, so we should have plugins (if not separate
414 shared libraries, then certainly encapsulated source files that implement a
415 common glib GInterface or are subclasses of eg a parent NMProxyHandler class)
416 that handle different system proxy handlers.  Some of the proxy handlers are:
417
418   libproxy: need to figure out how it gets proxy info and have NM write merged
419              proxy config out to that location
420   pacrunner: a D-Bus enabled daemon, NM would call D-Bus methods of the
421                pacrunner service with the proxy information
422   GNOME/KDE: how do these desktop environments retrieve proxy configuration?
423
424
425 * Bridging and Bonding Support
426
427 The largest complication here is that NetworkManager normally operates on
428 physical interfaces, while bridging and bonding involve tying multiple physical
429 interfaces together into a logical interface.  This has interesting implications
430 for the D-Bus API and the NM device model.  The first complication is that
431 we may need to do 802.1x port authentication on an interface before it can
432 communicate with the other side of the link, and those credentials may be
433 different for each interface; thus we may need to do separate 802.1x
434 operations on each interface that is part of a bridge/bond before adding each
435 one to the master bridge/bond interface.
436
437 In this way bridge/bond interfaces may be treated the same way as NetworkManager
438 treats VPN interfaces already; one or more physical interface NMConnections must
439 be activated before the master bridge/bond interface's NMConnection can be
440 activated, though this all happens internally.
441
442 To enable bridging and bonding in the NMConnection itself, we should create
443 new NMSettingBridge and NMSettingBond classes that contain information specific
444 to each.  Both settings would contain a 'components' property with an
445 'array of string' type which would contain the UUIDs of the Connections of
446 physical interfaces that compose the bridge or bond.  Thus NetworkManager would
447 have the necessary information to tie lower-level interface configuration
448 (802.1x, MTU, MAC address locking, duplex mode, speed, etc) to each physical
449 interface that will be part of the bridge/bond, configure the interface with
450 it, and then configure the master bridge/bond interface at upper layers using
451 configuration specific for the bridge/bond interface (like IP details).  Thus
452 for a single active bridge, two or more NMConnections would be activated; one
453 for each physical interface component of the bridge/bond, and one for the master
454 bridge/bond interface itself.
455
456 NMSettingBridge would contain at least the following keys:
457
458   components: (array of string) UUIDs of component connections
459   stp:        (boolean) on to enable STP, off to disable
460
461 NMSettingBond would contain at least the following keys:
462
463   components: (array of string) UUIDs of component connections
464   mode:       (string) one of "balance-rr", "active-backup", "balance-xor",
465                   "broadcast", "802.3ad", "balance-tlb", or "balance-alb"
466   monitor-interval: (uint) Specifies link monitoring interval (in milliseconds);
467                        NM will always enable netlink carrier monitoring if this
468                        value is non-zero so this property only affects speed and
469                        duplex checking
470
471 In the future we may consider adding other bonding parameters like "up-delay"
472 and "down-delay".
473
474 Then we'd add a 'component' (boolean) property to NMSettingConnection to
475 indicate that the component interface connections were in fact components of
476 a bridge or bond and shouldn't be automatically started by NetworkManager or
477 displayed as separate connections in the user interface.
478
479 TO BE CONTINUED
480
481
482 * Better Tablet/Mobile Behavior
483
484 There are a few components to this:
485
486 1) kernel driver and hardware capabilities: most mobile devices use periodic
487 background scanning to quickly determine whether a known SSID is available and
488 notify the connection manager to connect to it.  This typically requires special
489 capabilities and good powersave/sleep support from the WiFi kernel driver.
490 There is a background scanning API in nl80211, but we need to determine how many
491 SSIDs each driver allows for background scanning, and based on that number, give
492 the driver the most recent N SSIDs.  We still need to periodically wake the
493 device up and do a full scan just in case the user is near a known SSID that was
494 not in the N top recently used networks.  This is also beneficial to normal
495 desktop use-cases.
496
497 wpa_supplicant doesn't currently provide an explicit interface for sending SSIDs
498 to the driver for background scanning, but could simply send a list using
499 configured networks.  However, NM currently does not send *all* configured
500 connections' SSIDs to the supplicant, so that's something we should do first
501 to optimize connection times.  To do this, NM would need to order all networks
502 using the NM timestamp and convert that into a supplicant priority number, which
503 would need to be adjusted periodically when the timestamp was updated.  This
504 would involve tracking each network (exposed by the supplicant as a D-Bus
505 object) and making sure they were added, deleted, and updated when the backing
506 NMConnection objects changed.  One complication is that the supplicant
507 requires secrets for various network types when the network is added via D-Bus,
508 and NetworkManager might not have those secrets yet.  We may need to modify
509 the supplicant allow for *all* secrets (PSKs, WEP keys, etc) to be requested
510 on-demand, not just EAP secrets like 802.1x passwords.  We then need to fix
511 up the supplicant's D-Bus interface to actually send requests for secrets out
512 over D-Bus (like wpa_supplicant_eap_param_needed() does for the socket-based
513 control interface) and to handle the resulting reply from a D-Bus client like
514 wpa_supplicant_ctrl_iface_ctrl_rsp() does.
515
516 With the secrets request stuff and priority handling in place, wpa_supplicant
517 would control network selection and roaming (based on the priorities NM gave it
518 of course) instead of NetworkManager itself, and hopefully lead to a faster WiFi
519 connection process.
520
521 2) single-device-at-a-time with overlapping connections: this is also probably
522 the best route to go for desktop use-cases as well.  Instead of bringing all
523 available connections up, only bring up the "best" connection at any given
524 time based on the current priority list (which is rougly Ethernet > WiFi >
525 3G/Bluetooth/WiMAX).  However, to ensure seamless connectivity, when one
526 connection begins to degrade, the next-best connection should be started before
527 the current one is terminated, such that there is a small amount of overlap.
528 Consequently the same behavior should be used when a better connection becomes
529 available.  This behavior should be suspended when special connections like
530 Internet Connection Sharing ones are started, where clearly the priorities
531 are different (ie, for Mobile Hotspot 3G > WiFi).
532
533
534 * IP over Infiniband (IPoIB)
535
536 These interfaces are similar to Ethernet interfaces with a few distinct
537 differences:
538
539   1) they have 64-bit MAC addresses (GUIDs in Infiniband parlance)
540   2) DHCP clients need to be modified to handle IPoIB
541   3) they have a different ARP type and different L2 options
542
543 By default the interfaces do not have IP capability, but they gain that
544 capability when certain kernel modules (ib_ipoib.ko) are loaded, which causes
545 the IP-capable interface is created.  The IP-capable interfaces apparently have
546 ARPHRD_INFINIBAND set, which is likely what NM should use to identify them.
547
548 One outstanding question is whether NM should (a) detect all Infiniband
549 interfaces and load ib_ipoib.ko only when there is a defined NMConnection for
550 an Infiniband interface, or (b) whether NM should automatically load ib_ipoib.ko
551 for every Infiniband interface, or (c) whether NM should only manage Infiniband
552 interfaces that already have associated IP-capable interfaces (ie, something
553 else is responsible for loading ib_ipoib.ko).  Depending on our implementation,
554 (a) might not be possible, because if IPoIB connections are treated similar to
555 plain Ethernet connections, we may not have any information about whether a
556 specific NMConnection is Infiniband other than the MAC address.
557
558 It turns out that on some distros other components (like system services) may
559 load ib_ipoib.ko for us.  For exmaple, the 'rdma' package on Fedora/RHEL systems
560 contains /etc/rc.d/init.d/rdma which uses values in /etc/rdma/rdma.conf to load
561 ib_ipoib.ko at system startup if the user has requested it via IPOIB_LOAD=yes.
562 For the time being, if the some other component of the system loads IP for us,
563 NetworkManager should probably still recognize the Infiniband interface, but
564 leave it in unmanaged mode if there is no available IPoIB interface associated
565 with the Infiniband one.  i.e. for now, NM should not automatically load
566 ib_ipoib.ko.
567
568 The second question is whether to fold IPoIB support into the NMDeviceEthernet
569 class as was done for s390 network interfaces, or whether to create a subclass
570 of NMDevice:
571
572 1) extend NMDeviceEthernet: this would involve loosening the assumption that
573 hardware addresses (the 'hw-address'/'perm-hw-address' properties of
574 NMDeviceEthernet and the 'mac-address'/'cloned-mac-address' properties of
575 NMSettingWired) are 48 bits wide and instead can be either 48 or 64 bits wide.
576
577 2) create a new NMDevice subclass for Infiniband devices tailored to Infiniband
578 specific behavior and attributes.  This would be a lot more code since we'd have
579 to duplicate much of what NMDeviceEthernet already does, plus add the
580 Infiniband device class to libnm-glib.  This also would be the least invasive
581 from an API standpoint since the existing API would be unchanged, except for
582 the addition of a new value in the NMDeviceType enum, which clients should
583 ignore if they don't understand it.  (Need to coordinate additions to this enum
584 between 0.8.x and 0.9.x since 0.9.x has more device types, but we want to make
585 sure new device types get the same number for both branches).
586
587 For Infiniband specific options we could either fold them into NMSettingEthernet
588 or create a new NMSettingInfiniband class.  Current Infiniband specific options
589 are partitions/P_Keys, datagram vs. connected mode, and MTU.  The default MTU
590 varies with the 'mode'; for datagram it is currently 2044, while for connected
591 mode it is currently 65520.  Given that we only have 2 IB-specific options
592 we should probably just fold them into NMSettingEthernet similar to what was
593 done for s390-specific options.
594
595 For some general (and also Red Hat/Fedora specific) information see:
596
597 http://tools.ietf.org/html/rfc4392
598 http://rhkernel.org/#RHEL6+2.6.32-71.18.2.el6/Documentation/infiniband/ipoib.txt
599