Wifi power saving mode

(fixed dangling link - lart pipermail!)
 
(21 intermediate revisions not shown)
Line 1: Line 1:
-
{{Midgard article}}
+
The tablets support what is called Wifi Power Saving Mode (PSM). PSM allows the tablet to switch its wifi radio on and off several times a second to save battery. While this does greatly improve battery life  (6-8 hours idle on Wifi without PSM, 3-4 days with), there are still many routers on the market which do not support PSM or have a buggy implementation and this can cause problems for the tablets.
-
Nokia 770 and n800 supports Wifi Power Saving Mode (often called PSM), in order to improving battery life while keeping network connection.
+
Because using PSM introduces extra latency for incoming packets, the tablets try to optimize performance by remaining in Constant Active Mode (CAM) if there is constant traffic. On the other hand, CAM consumes a lot of power, so the timeout should be as short as possible. For more detailed description, see [http://lists.maemo.org/pipermail/maemo-users/2008-July/011430.html this posting on the subject].
-
Unfortunately, a lot of Wifi Access Point (AP) don't support completely PSM and using full PSM mode can cause network trouble.
+
== How it works ==
 +
E.G. http://features.techworld.com/mobile-wireless/4103/a-guide-to-wi-fi-power-save-technologies/ explains:
-
For Nokia 770 (running with Hacker Edition 2007), it is possible to configure a timeout for enabling PSM (with IT2006, it is not configurable).
+
'''Power Save Mode (PSM).''' This is the original power-conservation technique defined in 802.11, and was tested in this article. The methodology is for the mobile device to suspend radio activity after a variable but pre-determined (by the vendor) period of inactivity, and then wake up periodically (usually about three ''beacon frames'', which are normally 100 ms each) to see if the infrastructure has queued any traffic for it.
 +
Some AccessPoints allow to configure beacon rate and the number of beacons to pass by before the client wakes up again (a parameter that gets negotiated between AP and client)
-
To do so, in xterm, run :
+
== Issues ==
-
gconftool-2 --set --type int /system/osso/connectivity/IAP/wlan_sleep_timeout 200
+
Though PSM does greatly increase idle battery life (meaning leaving the tablet connected to a Wifi network at all times is a reality), poor support in some routers and certain network issues can crop up that cause trouble. In the case of routers with non-existent or buggy support, battery life while connected to Wifi may be greatly reduced or, at worst, connection difficulties may arise.
-
This will set sleep timeout at 200ms (by default, it is set to 1000ms for IT 2007.3 and earlier. For IT 2007.4 and later, it is set to 200ms).
+
PSM can cause some network issues even on routers with good support. Particularly with PC-to-tablet stuff like [[SSH]], connections may be dropped while idle or lag severely. There are two ways to reduce the negative impact of aggressive PSM in these situations. Either have an active network process running on the tablet (XChat in an active channel, ping to google.com, etc), or [[#Configuration|disable PSM completely]] on connections where you'll be doing a lot of work over SSH.
-
You might want to try full power saving, by setting timeout to 0.
+
The default values were tightened in Diablo release, which might be the reason that some people started seing problems then. The problems with PSM are typically random in nature, so with a bit of luck the connection works just fine sometimes, but sometimes problems are seen. The probability depends on the used timeout values.
-
To reset timeout to default behaviour, run :
+
== Configuration ==
-
gconftool-2 --unset /system/osso/connectivity/IAP/wlan_sleep_timeout
+
PSM can be configured on a per-connection basis in the Connectivity control panel (Application menu -> Settings  -> Control panel  -> Connectivity). Under the Other tab of Advanced settings when editing a saved connection. There are 3 options available: On (Maximum), On (Intermediate), and Off (note, the WLAN transmission power setting will not significantly impact battery life—though it will impact Wifi roaming distance—and is simply there for legislative reasons). Maximum and Intermediate change the timeout period (200ms and 1000ms, respectively), and Off turns off PSM entirely.
-
For Nokia n800 / n810, one additional timeout value is available :
+
== Ad-hoc prevents PSM ==
-
inactive_wlan_sleep_timeout (by default, its value is 100ms)
+
Ad-hoc mode cannot use power-saving modes other than reduce transmit power <s>- since there's no master or slave where the slave can spend a lot of time "asleep", it prevents power saving modes.</s> (This is false and needs fixed.  The stations trade off acting as "master". [http://books.google.com/books?id=9rHnRzzMHLIC&pg=PA193&lpg=PA193&dq=ibss+power+management&source=bl&ots=3wzOD62aBr&sig=lUehrHBabk4WX8NT6_XEyIjxy5Y&hl=en&ei=9zVNTOjWD4z4sAPg2PhI&sa=X&oi=book_result&ct=result&resnum=7&ved=0CC0Q6AEwBg#v=onepage&q=ibss%20power%20management&f=false 802.11 ibss psm])
-
This value is used when lcd display is turned off.
+
Smart Environments: Technology, Protocols and Applications
 +
books.google.de
 +
Diane Cook, Sajal Das - ‎2004 - 404 pages
 +
Power Management in Infrastructure-less WLANS In an IBSS, power management is a fully distributed process managed by the individual mobile stations. The station that initializes the IBSS defines the beacon interval. At the beginning of the ...
-
Be sure to test if network latency is still good when testing timeout value.
+
Anyway any master would need to send beacons every few fractions of a second, something that largely defeats the purpose of powersaving. Otherwise the time sync between the two peers gets lost rather quickly which basically means the connection gets lost or huge delay gets introduced. As far as I understand. Fact is N900 eats tons of power in ad hoc hotspot mode.
-
To test it, with a other device connected on the same subnet, run, after connecting Nokia device to Wifi network :
+
http://en.wikipedia.org/wiki/IEEE_802.11
 +
* Power Management: This bit indicates the power management state of the sender after the completion of a frame exchange. Access points are required to manage the connection and will never set the power saver bit.
 +
* More Data: The More Data bit is used to buffer frames received in a distributed system. The access point uses this bit to facilitate stations in power saver mode. It indicates that at least one frame is available and addresses all stations connected.
-
ping -i 2 192.168.x.y
+
== Routers known to be incompatible with PSM mode ==
-
where 192.168.x.y is IP address of Nokia device.
+
* La Fonera (FON2100, FON2200)
 +
* French ISP Free.fr Freebox ([https://bugs.maemo.org/show_bug.cgi?id=3481 Maemo #3481] and [http://bugs.freeplayer.org/task/2538 Free #2538])
-
There is should not be any paquet drop.
+
[[Category:Connectivity]]
-
 
+
[[Category:WiFi]]
-
You might want to test also with arping -I eth0 -b 192.168.x.y
+
[[Category:Power users]]
-
 
+
-
where eth0 is your interface in the same subnet as Wifi network.
+
-
 
+
-
If there is, you should try to increase timeout. Beware using very small timeout (10-100ms) might lead to increase power consumption, because radio chip might be always switching between shutdown and power-on state (when waiting for slow DNS reply for instance).
+
-
 
+
-
[[Category:HowTos]]
+
-
[[Category:Midgard wiki]]
+

Latest revision as of 07:02, 20 October 2013

The tablets support what is called Wifi Power Saving Mode (PSM). PSM allows the tablet to switch its wifi radio on and off several times a second to save battery. While this does greatly improve battery life (6-8 hours idle on Wifi without PSM, 3-4 days with), there are still many routers on the market which do not support PSM or have a buggy implementation and this can cause problems for the tablets.

Because using PSM introduces extra latency for incoming packets, the tablets try to optimize performance by remaining in Constant Active Mode (CAM) if there is constant traffic. On the other hand, CAM consumes a lot of power, so the timeout should be as short as possible. For more detailed description, see this posting on the subject.

Contents

[edit] How it works

E.G. http://features.techworld.com/mobile-wireless/4103/a-guide-to-wi-fi-power-save-technologies/ explains:

Power Save Mode (PSM). This is the original power-conservation technique defined in 802.11, and was tested in this article. The methodology is for the mobile device to suspend radio activity after a variable but pre-determined (by the vendor) period of inactivity, and then wake up periodically (usually about three beacon frames, which are normally 100 ms each) to see if the infrastructure has queued any traffic for it.

Some AccessPoints allow to configure beacon rate and the number of beacons to pass by before the client wakes up again (a parameter that gets negotiated between AP and client)

[edit] Issues

Though PSM does greatly increase idle battery life (meaning leaving the tablet connected to a Wifi network at all times is a reality), poor support in some routers and certain network issues can crop up that cause trouble. In the case of routers with non-existent or buggy support, battery life while connected to Wifi may be greatly reduced or, at worst, connection difficulties may arise.

PSM can cause some network issues even on routers with good support. Particularly with PC-to-tablet stuff like SSH, connections may be dropped while idle or lag severely. There are two ways to reduce the negative impact of aggressive PSM in these situations. Either have an active network process running on the tablet (XChat in an active channel, ping to google.com, etc), or disable PSM completely on connections where you'll be doing a lot of work over SSH.

The default values were tightened in Diablo release, which might be the reason that some people started seing problems then. The problems with PSM are typically random in nature, so with a bit of luck the connection works just fine sometimes, but sometimes problems are seen. The probability depends on the used timeout values.

[edit] Configuration

PSM can be configured on a per-connection basis in the Connectivity control panel (Application menu -> Settings -> Control panel -> Connectivity). Under the Other tab of Advanced settings when editing a saved connection. There are 3 options available: On (Maximum), On (Intermediate), and Off (note, the WLAN transmission power setting will not significantly impact battery life—though it will impact Wifi roaming distance—and is simply there for legislative reasons). Maximum and Intermediate change the timeout period (200ms and 1000ms, respectively), and Off turns off PSM entirely.

[edit] Ad-hoc prevents PSM

Ad-hoc mode cannot use power-saving modes other than reduce transmit power - since there's no master or slave where the slave can spend a lot of time "asleep", it prevents power saving modes. (This is false and needs fixed. The stations trade off acting as "master". 802.11 ibss psm)

Smart Environments: Technology, Protocols and Applications
books.google.de
Diane Cook, Sajal Das - ‎2004 - 404 pages 
Power Management in Infrastructure-less WLANS In an IBSS, power management is a fully distributed process managed by the individual mobile stations. The station that initializes the IBSS defines the beacon interval. At the beginning of the ...

Anyway any master would need to send beacons every few fractions of a second, something that largely defeats the purpose of powersaving. Otherwise the time sync between the two peers gets lost rather quickly which basically means the connection gets lost or huge delay gets introduced. As far as I understand. Fact is N900 eats tons of power in ad hoc hotspot mode.

http://en.wikipedia.org/wiki/IEEE_802.11

  • Power Management: This bit indicates the power management state of the sender after the completion of a frame exchange. Access points are required to manage the connection and will never set the power saver bit.
  • More Data: The More Data bit is used to buffer frames received in a distributed system. The access point uses this bit to facilitate stations in power saver mode. It indicates that at least one frame is available and addresses all stations connected.

[edit] Routers known to be incompatible with PSM mode