From: Aleksandar Mitev <shondll(a)yahoo.com>
Hi Daniel,
So nice to hear from you :)
Ok, let me describe our use case that led me to come up with the proposed change:
We have a setup with Ethernet, Wifi and Cellular and want to have Internet access
in any case. This would mean that if an interface fails or doesn't have Internet
reachability, a switchover should be made to the next one. Of course, Ethernet
is the most preferred, falling back to Wifi, and if Wifi is not reliable source
of Internet, then go to the last resort of Cellular.
Everything is running fine with the current version of connman, except that, if,
for example, Ethernet is the current default source of Internet, and the router
we are connected to, stops routing packets for some reason, then we lose Internet
connectivity and our connection the device is no longer active.
But connman would not react and continue using the Ethernet connecion. I have seen
this on my Android phone as well: when I am connected with Wifi and the ISP
decides to cut my router's Internet access, then the phone would not switch to
cellular
and no application would recieve notifications for indefinite time.
So my proposed change is to monitor the internet reachability at regular intervals,
using the same technique that connman uses now at the connecting phase. However,
since this checking will eat some data inevitably, we would not want to run it
on the cellular connection, at least (which is last resort anyway and no fallback
can be made). That is why the config option I added is based on network interfaces,
allowing you to choose only those devices that would make sence to continuously
check for Internet reachability.
*************
On 8/7/19 2:56 PM, Aleksandar Mitev wrote:
> I would like to propose adding an additional config option to the
main
> config file of connman that would enable continuous recheck of the
> internet connectivity for the current default connection. It would solve
> the problem of losing internet connectivity after choosing the default
> connection, due to router malfunction etc., which may result in the
> system running connman in staying offline for indefinite time. The
> option defines interfaces on which such a recheck is enabled, because
> some of them may have too expensive data plans to permit for such
> regular checks.
I am bit lost, e.g. what do you mean with the last sentence. I read
checking for online connectivity is too expensive, so let's do regular
check. Can you elaborate a bit on your use case?
I hope the above info is descriptive enough. I am avaialable for more
details if needed.
> The config option goes like this:
> # List of network interfaces that will continuously check
> # for online connectivity, separated by ",".
> # Services will check whether the interface they use is
> # into this list and if so will conduct online state check
> # regularly once Online state is reached. When in Online state
> # but due to lack of internet connectivity the service is
> # downgraded to a Ready state giving the chance of other
> # configured services to take over.
> # This feature depends on EnableOnlineCheck = true.
> # Default value is empty.
> # InterfacesPerpetualOnlineCheck = vmnet,vboxnet,virbr,ifb,ve-,vb-
Okay I might remember wrong. Currently we do only do the online check
when the link is setup, right? So adding the missing code which
constantly checks for online connectivity is just missing. With that we
would also get automatic downgrade (missing feature). IIRC this feature
is exists in Jolla version of ConnMan [1].
If possible I would like to avoid adding another config variable. Makes
it even more complex to handle it, let alone to test. It looks like I
need to understand first what you are trying to solve here.
[1]
https://git.merproject.org/mer-core/connman
I was not familiar with this fork of connman. Did not test it but looked
at the code and I did not find the continuous check after the service goes to
ONLINE state. I may be missing smth here, though.
As for the config option - sure, it could be removed (meaning that all
interfaces would be treated as enabled for checks) or reduces to a
simple global switch that would enable continuous online check after
going to the ONLINE state. However, please consider the usefulness of
our use case here.
> Attached is the proposed patch (based on tag 1.37).
The patches were attached to this mail. Did you use git send-email to
send out the patches?
No, I just used my email client. Now using the git send mail. Hope this
is the right way to send patch proposals along.
> Would be happy to read your feedback for this is my first
proposal for
> change to connman :)
Welcome! I am sorry to response to many emails rather late. Not much
space between work and a lot of other hobbies :)
Thank you!
No problem, since it is holiday season, anyway. My response comes a bit
late as well, so sorry abot that as well.
Thanks again for starting the discusstion on the proposed change.
Best,
Aleksnadar
******
Aleksandar Mitev (6):
Added a config option for perpetual online check
Added check if the device is in InterfacesPerpetualOnlineCheck
Exported device getter for the network object
Added flag in service object to determinte perpetual online check
Added logic to perform perpetual online checks
Added timeout to socket connections
gweb/gweb.c | 32 +++++++++++++++++
include/device.h | 1 +
src/connman.h | 1 +
src/device.c | 27 +++++++++++++++
src/main.c | 26 ++++++++++++++
src/main.conf | 12 +++++++
src/network.c | 5 +++
src/service.c | 90 +++++++++++++++++++++++++++++++++++++++++++++---
8 files changed, 190 insertions(+), 4 deletions(-)
--
2.17.1