-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wwan: Do not change initial bearer config and properly clear unused default bearers #4401
Conversation
5c6ca9c
to
da4676a
Compare
da4676a
to
2d6c0a3
Compare
Do I get it right that you're deleting all default bearers, which are user configured? |
Yes correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run eden again
There seems to be some problem with onboarding and also pull limit was reached. I will retry and investigate tomorrow. |
Then what's the point of specifying default bearers? But if a user has a contract with a big telco, I'd assume one way they will have connectivity through some credentials that they will be supplying to a modem. Maybe I'm not following the logic, but then the scenario is following :
|
What you are referring to is the "initial EPS bearer", with parameters embedded in the SIM card / modem. We do not touch this bearer here (if it is connected, it stays connect even after this method). Default bearer is what user configured through zedcloud. We do not support multiple PDN contexts at the moment, so there will be at most one default bearer active at any time. I noticed that the ModemManager Disconnect method only deactivates the currently active bearer, without removing it. When we run Connect (with the same or changed args), ModemManager looks for the same (inactive) bearer and tries to activate it. However, I have seen this to fail in the past in multiple occasions. It was necessary to delete inactive default bearer(s) and let ModemManager to create a new one from scratch. So I'm thinking that is maybe better to not keep inactive bearers hanging around. But I could be wrong on this and there is no documentation on "how to do this the right way", it is mostly driven by experiments :/ |
We are still seeing some issues on the modem tested, so I'm bringing this back to Draft. I really don't like these cellular modems :/ |
We have some positive updates from the issue reporter. It seems that soon this PR will be moved back into the ready-for-review state. Stay tuned. |
Marking this PR again as ready for review&merge. It turned that the other issue we saw was due to an invalid device model (which broke the modem when the USB controller to which it is connected to got directly assigned to an app). |
…efault bearers This commit addresses two issues related to cellular connectivity. First, make sure that there are no bearers left from previous connection attempts before starting a new connection, Otherwise, we may get "interface-in-use-config-match" error from ModemManager. Second, we should not change the initial EPS bearer settings and assume that the same APN should be used for both the initial and the default bearer. This is not always the case and the modem registration may fail when we apply the same APN. However, we might want to make this user configurable through EVE API and the controller. Some background for understanding: LTE connection consists of two IP bearers, the initial EPS bearer and the default bearer. Device must first establish the initial bearer (which shows as transition from the "searching" to "registered" state) and then it connects to a default bearer (transition from "registered" to "connected"). Both bearers require PDP context settings (APN, ip-type, potentially username/password, etc.). Settings for the initial bearer are typically provided by the SIM card while settings for the default bearer are user-configured. It is not necessarily the case that the APNs for the initial and the default bearers are the same. We used to make that assumption but this has led to cases where modem was failing registration because the APN for the initial bearer was wrong. It is better to let the SIM card provide the PDP context setting for the initial EPS bearer. Furthermore, once these settings are changed, there is no straightforward method to revert back to the SIM-provided configuration; for more details, see the discussion here: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1490#note_2628804 Users may only need to override SIM-provided settings in rather rare cases: either when the SIM card has incorrect configuration (we have seen this only once) or when the initial EPS bearer requires username/password authentication (also uncommon). Despite the rarity of these cases, these settings should be user-configurable. We will do this later (requires EVE API and controller changes). Please note, that the same enhancement was recently implemented in NetworkManager (used by Ubuntu and other major Linux distributions): https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1915 Signed-off-by: Milan Lenco <milan@zededa.com>
QCSuper[*] allows to capture raw 2G/3G/4G (and for certain models also 5G) control-plane radio frames from Qualcomm-based modems. This can be super useful when troubleshooting registration/connection establishment issues. [*] https://github.com/P1sec/QCSuper Signed-off-by: Milan Lenco <milan@zededa.com>
2d6c0a3
to
abfaad1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR addresses two issues related to cellular connectivity.
First, make sure that there are no bearers left from previous
connection attempts before starting a new connection, Otherwise, we may get
interface-in-use-config-match
error from ModemManager.Second, we should not change the initial EPS bearer settings and assume that
the same APN should be used for both the initial and the default bearer.
This is not always the case and the modem registration may fail when we
apply the same APN. However, we might want to make this user configurable
through EVE API and the controller.
Some background for understanding: LTE connection consists of two IP bearers,
the initial EPS bearer and the default bearer. Device must first establish
the initial bearer (which shows as transition from the
searching
toregistered
state) and then it connects to a default bearer (transition from
registered
toconnected
). Both bearers require PDP context settings (APN, ip-type, potentiallyusername/password, etc.).
Settings for the initial bearer are typically provided by the SIM card while
settings for the default bearer are user-configured.
It is not necessarily the case that the APNs for the initial and the default bearers
are the same. We used to make that assumption but this has led to cases where modem
was failing registration because the APN for the initial bearer was wrong. It is
better to let the SIM card provide the PDP context setting for the initial EPS bearer.
Furthermore, once these settings are changed, there is no straightforward method to
revert back to the SIM-provided configuration; for more details, see the discussion here:
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1490#note_2628804
Users may only need to override SIM-provided settings in rather rare cases: either when
the SIM card has incorrect configuration (we have seen this only once) or when the initial
EPS bearer requires username/password authentication (also uncommon). Despite the rarity
of these cases, these settings should be user-configurable. We will do this later
(requires EVE API and controller changes).
Please note, that the same enhancement was recently implemented in NetworkManager
(used by Ubuntu and other major Linux distributions):
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1915
Also included in this PR is a documentation how to capture control-plane traffic on
Qualcomm-based modems.