Regression regarding ip_type when updating from 1.10.4 to 1.12.0

Aleksander Morgado aleksander at aleksander.es
Fri Nov 15 09:33:11 UTC 2019


Hey,

> > On Thu, Nov 14, 2019 at 06:57:54PM +0100, Aleksander Morgado wrote:
> > > > Has the interpretation of the ip_type MM_BEARER_IP_FAMILY_IPV4V6
> > > > changed when performing the connect?
> > > >
> > >
> > > No it hasn't really. I really think you need to know whether the
> > > network supports ipv4v6 for a given APN before attempting to use
> > > it.
> >
> > For writing end user oriented software where the networks and
> > operators
> > that will be used are unknown when implementing it this becomes a big
> > problem.
>
> I'm not sure I see how. If you pass MM_BEARER_IP_FAMILY_ANY then you
> will get some kind of connectivity, most often V4 because that's what
> most networks provide.
>
> If you pass V4, V6, or V4V6 then MM will fail if the network cannot
> provide that connectivity. Presumably you are passing these options
> because you require the connectivity each one provides, otherwise if
> all you care about is "can I get to the Internet" you could pass ANY.
>
> > Wouldn't that mean one has to try a connect with all bearer types in
> > whatever the preferred order is?
>
> Or pass ANY and you'll get some kind of connection to the internet at
> least?
>
> Aleksander: we should probably fine-tune the logic something like this:
>
> 1) bearer default_ip_family follows what the modem is capable of via
> AT+CGDCONT=? or the equivalent; eg if the modem has V4V6 contexts then
> we default to IPV4V6.

The "default IP family" is IPv4 for all modems, there's no +CGDCONT=?
check changing that.

The +CGDCONT=? check helps build the "supported IP families" list that
we expose in the Modem interface when the device uses AT protocol. For
MBIM and QMI modems, the list of supported IP families includes all
IPv4, IPv6 and IPv4v6.

> 2) If the user passes a specific IP family for the bearer, fail if that
> family is not successfully connected (as we do now?)

More or less. If user asks for IPv4 or IPv6 and that fails, we fail
always regardless of the modem type.

In QMI modems, where we control the IPv4 and IPv6 setups separately
via different QMI clients, if the user asks for IPv4v6 and any of them
succeeds, we succeed. So if user asks for IPv4v6 and we get IPv4 only,
we would not trigger an error. Maybe we should? It's definitely easier
for us to just succeed here, because otherwise it would mean that if
IPv6 setup fails we would need to then disconnect the IPv4 setup
manually before reporting the connection error.

For other modems (AT or MBIM) there is one single command requesting
IPv4v6 and that is left to the modem to decide whether the connection
command succeeds or not. This is the key point I believe. If we
default ANY to IPv4v6 and we ask IPv4v6 by default when no explicit
ip-type provided, and the modem decides to fail the connection if we
can only setup IPv4, wouldn't that be a very bad thing?

> 3) If the user passes ANY:
>   3a) use the default_ip_family (no change)

That is what we're doing right now, but because default IP family is
IPv4, we fallback to IPv4.

>   3b) the modem accepts whatever connect result happens, eg if v4 or
> v6-only that's fine, don't fail.
>   3c) if the connection result failed because the network rejected a
> V4V6 request for example, or the default_ip_family is V4 but the APN
> only accepts V6, then should we retry with V4?

Are you suggesting we improve the ANY handling in order to attempt
different IP type connections automatically if they fail? E.g. if the
user asks for ANY, try first with IPv4v6 and if anything succeeds
we're good. If it fails, try with IPv4-only, and if it fails, try with
IPv6. That would make the ANY name much more meaningful actually.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list