Skip to content

PDP Type needs to be IPV4V6 #12396

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

Merged
merged 1 commit into from
Feb 14, 2020
Merged

PDP Type needs to be IPV4V6 #12396

merged 1 commit into from
Feb 14, 2020

Conversation

felser
Copy link
Contributor

@felser felser commented Feb 7, 2020

1.Testing with Verizon and AT&T SIMs, PDP type is automatically set to IPV4V6.
2. Testing with AT&T IoT SIM, PDP type automatically sets to IP. It will connect
but not communicate. Setting a subsequent APN to IPV4V6 with the same APN communicates.

Summary of changes

Enable stack/PDP type IPV4V6 and not IPV4 for this platform. Verizon and AT&T LTE SIM cards automatically set the PDP type to IPV4V6. AT&T IoT SIM cards automatically set PDP type to IPV4 but mbed-os is not able to communicate with that setting passed to LWIP. With only IPV4V6 enabled, mbed-os will configure the next available context with IPV4V6 in the PDP type and set the APN included in the json file. This allows for successful communication.

Impact of changes

Migration actions required

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


1.Testing with Verizon and AT&T SIMs, PDP type is automatically set to IPV4V6.
2. Testing with AT&T IoT SIM, PDP type automatically sets to IP. It will connect
but not communicate. Setting a subsequent APN to IPV4V6 with the same APN communicates.
@ciarmcom ciarmcom requested review from a team February 8, 2020 00:00
@ciarmcom
Copy link
Member

ciarmcom commented Feb 8, 2020

@felser, thank you for your changes.
@ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

@@ -32,9 +32,9 @@ static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = {
1, // AT_CSMP
1, // AT_CMGF
1, // AT_CSDH
1, // PROPERTY_IPV4_STACK
0, // PROPERTY_IPV4_STACK

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably define all IPV4, IPV6 and IPV4V6 to 1, or AT_CellularContext::get_context() fails to find IPV4/IPV6 only contexts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling IPV4 results in failed communication with AT&T IoT SIMs. The ublox radio automatically populates context 1 with IP as the PDP type and doesn't allow the user to change it to IPV4V6. If mbed detects a PDP type of IPV4, it sets the LWIP stack to IPV4 which fails to communicate. However if the LWIP stack is set/forced to IPV4V6 communication is successful. With the change I made, mbed sets context 2 with the same APN as context 1 but PDP type as IPV4V6. Though probably not ideal, it works with all the SIM cards we have. I plan to put a note on our mbed page describing where and why users might need to change this setting.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felser Do you mean that the initial context PDP type is IP, but it has actually just IPV6 address? Can you have traces with cellular.debug-at: true?

It seems your modem allows multiple contexts with the same APN name, but that's not a generic case. It could be better to force the initial context to IPV4V6? For that, you need to disable initial context activation (e.g. AT+CIPCA could work if you are not in LTE), or detach from the network, delete the one modem created and create a new PDP with IPV4V6 before attaching again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example of what it returns from AT+CGDCONT?...
+CGDCONT: 1,”IP”,”m2m.com.attz”,”10.254.68.252”,0,0,0,0
I was unable to find a way to force context 1 to be IPV4V6. Every time I change it then register it goes back to IP. I don't see the command AT+CIPCA or any other command in the ublox manual to disable initial context activation. I'm not sure I'd want to use that if I could given that this change appears to work without complication.

The radio (kind of) allows multiple contexts with the same APN. According to ublox, after I sent them debug capture with their debug tool, the call on CID 2 is actually routed to CID 1. So all this change is really doing is telling mbed to use IPV4V6 stack.

Our code is specific to this ublox radio. We have no other radio on this platform. This change is working well for all SIMs I have tested.

FYI, I can connect and send data on context 1 using the radio stack or Windows dial up networking but mbed-os does not work. At one point I edited the AT_CellularContext code to force IPV4V6 to the nsapi_ppp_connect(...) call. That works on context 1.

@mergify mergify bot added needs: CI and removed needs: review labels Feb 10, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 10, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 10, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 11, 2020

Moved to needs: review to finalize the reivew

@AriParkkila
Copy link

@ARMmbed/team-ublox please comment

@fahimalavi
Copy link
Contributor

First apologies, some more information is required

  1. What exact SARA-R4xx version you are using ?
  2. Have you set and enabled mnoprofiles feature ?

@0xc0170 0xc0170 requested a review from a team February 12, 2020 13:06
@felser
Copy link
Contributor Author

felser commented Feb 12, 2020

This is the SARA-R410-02B. If I recall correctly, setting +UMNOPROF to AT&T or letting it auto select didn't matter.

@fahimalavi
Copy link
Contributor

fahimalavi commented Feb 13, 2020

  1. Without MNO =1 (SIM ICCID select), the parameters shouldn't change. If you had set +UMNOPROF to AT&T then inserting AT&T IoT sim shouldn't change parameters. If user has selected MNO=1 (SIM ICCID select) ?
  2. If the SIM is not inserted or the SIM IIN does not match any MNO, the last valid MNO remains active and is consequently shown with those parameters.
  3. Can you send response for AT&V (Reports a summary of the current configuration and of the stored user profiles. ) ?

@felser
Copy link
Contributor Author

felser commented Feb 13, 2020

With +UMNOPROF=0, the context still changes. Even worse, if I set +UMNOPROF=2, it locks up the radio serial port! The second problem is something we are working on with Steve Brown at ublox. Please see the attached. Note: I had previously been using and AT&T SIM that provide a context populated as IPV4V6 and APN = phone.
ublox_at&t_IoT.txt

@felser
Copy link
Contributor Author

felser commented Feb 13, 2020

UPDATE: When changing +UMNOPROF from 0 to 2, PSM mode gets enabled. That's what appeared to cause the serial port lock up. However, once set to 2 with PSM disabled, the PDP type is still over written. So with +UMNOPROF 0 or 2, the PDP type changes from IPV4V6 to IP with my IoT SIM installed.

@fahimalavi
Copy link
Contributor

  1. At line 96 in logs, user is setting PDNType and APN between sending +UMNOPROF and reboot commands. That is why your APN is incorrect later at line 109. Please follow the procedure specified in AT command manual for setting MNOProfile. I have verified the behavior using AT&T sim.
  2. As you have specified "Every time I change it then register it goes back to IP". CGDCONT read command returns the current settings for each defined context. Look like from network you are allowed for IPv4 only.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 14, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Feb 14, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@mergify mergify bot removed the needs: CI label Feb 14, 2020
@0xc0170 0xc0170 added the release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 label Feb 14, 2020
@0xc0170 0xc0170 merged commit 3d038e5 into ARMmbed:master Feb 14, 2020
@mergify mergify bot removed the ready for merge label Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants