Re: Disabling periodic scans

2022-07-04 Thread Thomas Haller via networkmanager-list
On Fri, 2022-07-01 at 02:12 +0300, Slava Monich wrote:
> 
> What I had in mind was a scenario when the device running network 
> manager has more than one Wi-Fi interface, and those are not
> connected 
> (but have to be ready to be connected at any time). Passive scans 
> produce lots of D-Bus traffic, which creates serious load (I mean it,
> really serious load) on the device. And yet, periodic scans on all
> those 
> interfaces produce more or less the same list of networks, needlessly
> wasting precious system resources.

Hi,


you mean, active scans, right? NM doesn't do passive scans (though it
should).


It's not clear that both devices will see the same scan result. E.g.
one radio might be worse, or maybe one of them is 2.4GHz only... it
seems non-trivial to select a device to use for scanning.

Also, if there is a good algorithm for solving this problem reliably,
then maybe this should be done by NetworkManager, because another
serivce find it hard to understand all the subtleties for selecting a
device for scanning.

Also, I guess after one device finds an SSID, it would connect and
you'd re-enable scanning on the other device? Imainge you have a
profile for $SSID that is tied to "connection.interface-name=wlan0".
When then scanning is only enabled on wlan1, then even if wlan1 finds
$SSID, then you would need logic that recognizes that now scanning on
wlan0 needs to be turned on. But of course, there is no guarantee that
wlan0 will find $SSID, so you need logic to disable it again. Seems all
non-trivial.



Maybe, if the scanning is too resource intensive, then maybe we should
-- after X minutes of scanning without success -- ratelimit the
scanning and only scan 1 every 5 minutes.

Or maybe, we could switch to passive scans for 4  out of 5 minutes...



Btw, you can also just set the device as unmanaged. After all, if you
are not going to scan, nothing interesting will happen on that device.
For unmanaged devices we don't scan. There is a D-Bus API (and it does
not survive reboot).



Thomas

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Disabling periodic scans

2022-07-04 Thread Beniamino Galvani via networkmanager-list
On Fri, Jul 01, 2022 at 02:12:45AM +0300, Slava Monich wrote:
> Actually, this wasn't about connected interfaces. When the interface is
> connected, AP roaming has to be supported, locking connection to BSSID of
> the AP is not an option, there's no way to avoid active scans.
> That's fine.
> 
> What I had in mind was a scenario when the device running network manager
> has more than one Wi-Fi interface, and those are not connected (but have to
> be ready to be connected at any time). Passive scans produce lots of D-Bus
> traffic, which creates serious load (I mean it, really serious load) on the
> device. And yet, periodic scans on all those interfaces produce more or less
> the same list of networks, needlessly wasting precious system resources.
> 
> It seems to make every bit of sense to disable scans on all but one
> disconnected Wi-Fi interface, and let the UI use the list of available APs
> produced by that one single interface. And since no connection is involved
> at this stage, it can't be a connection property, right? It's got to be an
> org.freedesktop.NetworkManager.Device.Wireless property.

Correct.

> And yes, it means that this property is not going to be persistent but it
> doesn't need to be, since it has to be updated every time when the system
> state changes (e.g. an interface appears or disappears, gets connected or
> disconnected). Which is fine since this scenario implies a separate service
> choosing which interface will do the scanning, that logic is product
> specific and out of scope.
> 
> Am I missing something?

I don't know others' opinion, but this seems a legitimate use case to
me, and I'm in favor of adding such D-bus property to the
Device.Wireless interface.

Beniamino


signature.asc
Description: PGP signature
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Disabling periodic scans

2022-06-30 Thread Slava Monich

On 20/06/2022 18.08, Beniamino Galvani wrote:

On Sun, Jun 19, 2022 at 09:01:12PM +0300, Slava Monich wrote:

Hi!

Are there any objections to adding e.g. BackgroundScanEnabled readwrite
property to org.freedesktop.NetworkManager.Device.Wireless D-Bus interface?
The idea is to allow to disable periodic background scans for those WiFi
interfaces which don't need it. There are use cases for that in the embedded
world.


Hi,

if the Wi-Fi connection profile is locked to a specific BSSID, that
disables periodic scanning while connected. Is this a suitable
solution for your use case?  Or, what is the use case?

If we want to make this behavior configurable, perhaps it should be in
the connection profile and not on the device D-Bus object, so that the
property can be changed persistently and it depends on the network.

See also:

https://blogs.gnome.org/dcbw/2016/05/16/networkmanager-and-wifi-scans/

Beniamino


Thanks for the reply!

Actually, this wasn't about connected interfaces. When the interface is 
connected, AP roaming has to be supported, locking connection to BSSID 
of the AP is not an option, there's no way to avoid active scans.

That's fine.

What I had in mind was a scenario when the device running network 
manager has more than one Wi-Fi interface, and those are not connected 
(but have to be ready to be connected at any time). Passive scans 
produce lots of D-Bus traffic, which creates serious load (I mean it, 
really serious load) on the device. And yet, periodic scans on all those 
interfaces produce more or less the same list of networks, needlessly 
wasting precious system resources.


It seems to make every bit of sense to disable scans on all but one 
disconnected Wi-Fi interface, and let the UI use the list of available 
APs produced by that one single interface. And since no connection is 
involved at this stage, it can't be a connection property, right? It's 
got to be an org.freedesktop.NetworkManager.Device.Wireless property.


And yes, it means that this property is not going to be persistent but 
it doesn't need to be, since it has to be updated every time when the 
system state changes (e.g. an interface appears or disappears, gets 
connected or disconnected). Which is fine since this scenario implies a 
separate service choosing which interface will do the scanning, that 
logic is product specific and out of scope.


Am I missing something?

Cheers,
-Slava
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Disabling periodic scans

2022-06-20 Thread Beniamino Galvani via networkmanager-list
On Sun, Jun 19, 2022 at 09:01:12PM +0300, Slava Monich wrote:
> Hi!
> 
> Are there any objections to adding e.g. BackgroundScanEnabled readwrite
> property to org.freedesktop.NetworkManager.Device.Wireless D-Bus interface?
> The idea is to allow to disable periodic background scans for those WiFi
> interfaces which don't need it. There are use cases for that in the embedded
> world.

Hi,

if the Wi-Fi connection profile is locked to a specific BSSID, that
disables periodic scanning while connected. Is this a suitable
solution for your use case?  Or, what is the use case?

If we want to make this behavior configurable, perhaps it should be in
the connection profile and not on the device D-Bus object, so that the
property can be changed persistently and it depends on the network.

See also:

https://blogs.gnome.org/dcbw/2016/05/16/networkmanager-and-wifi-scans/

Beniamino


signature.asc
Description: PGP signature
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list