Enabling Connectivity Checking in NetworkManager

Marc Deslauriers marc.deslauriers at canonical.com
Tue Jul 10 21:01:28 UTC 2012


On Tue, 2012-07-10 at 15:59 -0400, Stéphane Graber wrote:
> >> I'm not sure I like the idea of having NM poke that same address every 5
> >> minutes as it sounds like a pretty easy way for anyone to accurately
> >> count the number of Ubuntu machines currently running in any given network.
> > 
> > Meh, there are countless other things that can be used for that
> > currently...apt requests, ntp, browser user-agent strings, etc.
> 
> None that gives you the guarantee of happening at a given interval.
> NTP happens on boot and whenever an interface is brought online, so you
> can't really know how many machines that's.
> 
> With the connectivity check running exactly every 5 minutes, you can
> take a one hour sample of the http traffic on a network, divide by 12
> and have a pretty accurate estimate of the number of machines on it.
> 
> Given a longer log, you could probably get an even more accurate count
> by looking at the exact time different between checks to detect new
> machines being turned on or machines disappearing.

Honestly, I don't see what the big deal with this is. Why do we care if
a network can count the number of Ubuntu users? Are we afraid that
*gasp* Canonical might be able to count the number of users?

Actually, why are we running it every 5 minutes? Wouldn't it make more
sense to run it every 5 minutes only if we don't have a connection, and
only turn it on following certain events, such as a new network
interface coming up, or when the user logs in?

> 
> >> Sadly it's not how it was implemented in Network Manager, but I think
> >> I'd have preferred to have this check be exposed over DBUS so that
> >> applications like ubiquity can use that call to query the connectivity
> >> on demand.
> > 
> > I'm confused...Network Manager already exposes connectivity information
> > over dbus, and that's what apps are supposed to use...
> 
> What I'm saying is that I'd rather a "function" be exported over DBUS
> than a "status"/"event".
> So that when something needs to know whether they have connectivity they
> trigger that test and possibly pass it some more information so that
> Network Manager can test it "properly".
> 
> Querying the page in the background and poking the application back is
> the difficult part of that process, not having a test service up and
> running. So I could see quite a few software developers wanting to use
> the capability in Network Manager but with their own test service and
> possibly with a different protocol.
> 
> >> This would also have allowed to extend the check to work with other
> >> protocols, letting the client application query for a specific host and
> >> protocol if it wants to (with the default being whatever is defined in
> >> NetworkManager.conf).
> > 
> > Well, the idea is apps ask Network Manager, so it can be configured in a
> > central location, and not have every app try and override the default...
> 
> Sure, in most cases they won't have to and so shouldn't mess with the
> default, though I still think being able to override the default is
> valuable as it'd let some developers have a way of preventing expensive
> API calls when something is wrong on their side too.
> 
> 
> For example you could have https://status.launchpad.net/nm.html be
> checked by python-launchpadlib, acting as both a connectivty check and
> as a service check.

What's the value in having network manager do this instead of the app
itself? Presumably the app knows the exact details of the service it
wants to probe, and already contains the code required to connect.

Marc.




More information about the ubuntu-devel mailing list