Host data interface IP configuration via DHCP vs via control channel.
Aleksander Morgado
aleksandermj at chromium.org
Tue Oct 25 13:11:34 UTC 2022
Hey Arjen,
> I hope I am at the right place for some questions related to Modemmanager and how host interfaces actually get their IP configuration assigned. Apologies if I'm at the wrong place.
>
Yes, you are :)
> Assuming a mobile connection via any of the available control protocols (QMI/AT/etc) has been initiated.
> The mobile modem firmware has established a bearer connection and via the (3GPP PCO -Protocol Control Options amongst others) an IPv4 address has been received from the mobile network. Now for the actual data interface on the host a DHCPv4 client could be run to retrieve the IP address from the modem (this assumes the Modem runs a DHCP server). But likewise via control protocol (QMI/AT/etc) one could retrieve the IP address from the modem and configure the data interface with the retrieved result.
>
Yes. Not all modems have a DHCP server though, beware.
> This question actually does extend to IPv6, here also via the available control protocol (QMI/AT/etc) the connection is initiated. It is the modem firmware that runs a SLAAC client process to receive a /64 prefix. Then the data interface on the host is able retrieve that prefix (via a SLAAC/DHCPv6 client procedure (depending on the modem firmware capabilities) from the modem. Also here the alternative option exists to retrieve the IPv6 prefix (+ other items like Ipv6DNS, MTU size, or even PD - (e.g quectel AT+QIP6CFG="PD_addr") via the control interface from the modem and apply the result to the data interface.
>
This assumes the modem firmware is the one running SLAAC, which is
true for Qualcomm based devices. In that case we just get all the IPv6
details ready to use. But other modems like Intel-XMM based modules
don't run SLAAC themselves; instead they will report which is the IPv6
address that the host should configure in the net interface before the
host runs SLAAC itself.
> What is the modem manager approach in this ? It looks like always the data interface needs to use DHCP/SLAAC kind of client processes. As I prefer to be independent of specific modem firmware (DHCP) server processes (which are often outdated/have limited DHCP options supported) I am interested to understand the pros/cons of the above approach (and the modem manager support of this approach).
The way to go here is to use the IP method that ModemManager reports
in the Bearer object once the modem is connected:
* If the bearer reports "static" then you can read the IP settings
from the bearer object and apply them directly in the net interface.
* If the bearer reports "dhcp" then you can read some of the IP
settings from the bearer object (e.g. IPv6 address needed to run
SLAAC, or DNS servers), apply them in the net interface, and then run
DHCP (v4) or SLAAC (v6).
* If the bearer reports "ppp" then you should setup a PPP session
over the TTY reported as net port (e.g. running pppd).
You should "trust" what ModemManager reports to be on the safe side.
--
Aleksander
More information about the ModemManager-devel
mailing list