Sierra Wireless EM7345 and IPv6

Bjørn Mork bjorn at mork.no
Wed May 28 04:30:43 PDT 2014


Looks like I'm going to have lots of fun with this modem.  Interesting
stuff noted so far:

The contexts seem to be dynamically updated and not stored in flash.
Upon a clean boot, the list is initialized with the default bearer(?)
apn (haven't even opened the MBIM channel yet here):

at+cgdcont?
+CGDCONT: 1,"IP","telenor.mbb.mnc001.mcc242.gprs","10.126.218.51",0,0,0,0,0,0

OK


After opening the MBIM channel and connecting IP session #0 to an IPv6 APN, I get:

at+cgdcont?
+CGDCONT: 1,"IP","telenor.mbb.mnc001.mcc242.gprs","10.126.218.51",0,0,0,0,0,0

+CGDCONT: 2,"IPV6","telenor.ipv6","254.128.0.0.0.0.0.0.0.0.0.23.64.95.105.1",0,0,0,0,0,0

OK

But any attempt to activate *another* IPv4 context does not seem to work.
After connecting IP session #1 using the IPv4 APN "telenor" ends up with
the same list of contexts, and looking at the IP configuration it is
obvious that the default bearer was used instead of the requested APN:


03 00 00 80 80 00 00 00 0b 00 00 00 01 00 00 00 00 00 00 00 a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0f 00 00 00 00 00 00 00 50 00 00 00 01 00 00 00 07 00 00 00 00 00 00 00 01 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 4c 00 00 00 00 00 00 00 02 00 00 00 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c1 d5 70 04 82 43 0f c6 18 00 00 00 0a 7e da 33 0a 7e da 01 
---
MBIM_MESSAGE_HEADER
  MessageType:  0x80000003 (MBIM_COMMAND_DONE)
  MessageLength:        128
  TransactionId:        11
MBIM_FRAGMENT_HEADER
  TotalFragments:       0x00000001
  CurrentFragment:      0x00000000
BASIC_CONNECT (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)
MBIM_CID_IP_CONFIGURATION (15)
MBIM_STATUS_SUCCESS (0)
InformationBuffer [80]:
  SessionId:    1
  IPv4ConfigurationAvailable:   0x00000007 address, gateway, dns
  IPv6ConfigurationAvailable:   0x00000000 None
  IPv4AddressCount:     1
    10.126.218.51/24
  IPv6AddressCount:     0
  IPv4Gateway:  10.126.218.1
  IPv6Gateway:  100:0:700::100:0
  IPv4DnsServerCount:   2
    193.213.112.4
    130.67.15.198
  IPv6DnsServerCount:   0
  IPv4Mtu:      0
  IPv6Mtu:      0


This is not so nice, IMHO.  I was expecting a non-RFC1918 address here,
which would be assigned if the requested APN was used.

And if I attempt to disconnect IP session #1 (which IMHO should not be
expected to have any side effect), it seems that I disconnect the
default bearer as well:

at+cgdcont?
+CGDCONT: 1,"IPV4V6","","",0,0,0,0,0,0

+CGDCONT: 2,"IPV6","telenor.ipv6","254.128.0.0.0.0.0.0.0.0.0.23.64.95.105.1",0,0,0,0,0,0

OK


After this, any further attempt to connect using MBIM results in 

03 00 00 80 30 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00 a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0c 00 00 00 1c 00 00 00 00 00 00 00 
---
MBIM_MESSAGE_HEADER
  MessageType:  0x80000003 (MBIM_COMMAND_DONE)
  MessageLength:        48
  TransactionId:        17
MBIM_FRAGMENT_HEADER
  TotalFragments:       0x00000001
  CurrentFragment:      0x00000000
BASIC_CONNECT (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)
MBIM_CID_CONNECT (12)
MBIM_STATUS_OPERATION_NOT_ALLOWED (28)
InformationBuffer [0]:


But if I configure and connect the context using AT commands:

at+cgdcont=1,"IP","telenor"
at+cgact=1,1


Then that APN is used:

at+cgdcont?
+CGDCONT: 1,"IP","telenor","109.179.18.47",0,0,0,0,0,0

+CGDCONT: 2,"IPV6","telenor.ipv6","254.128.0.0.0.0.0.0.0.0.0.23.64.95.105.1",0,0,0,0,0,0

OK

and I can "connect" MBIM IP session #1 to this APN:

03 00 00 80 54 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00 a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0c 00 00 00 00 00 00 00 24 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 7e 5e 2a 7e 4e 6f 72 72 73 6b 65 6e 7e 5e 2a 7e 00 00 00 00 
---
MBIM_MESSAGE_HEADER
  MessageType:  0x80000003 (MBIM_COMMAND_DONE)
  MessageLength:        84
  TransactionId:        17
MBIM_FRAGMENT_HEADER
  TotalFragments:       0x00000001
  CurrentFragment:      0x00000000
BASIC_CONNECT (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)
MBIM_CID_CONNECT (12)
MBIM_STATUS_SUCCESS (0)
InformationBuffer [36]:
  SessionId:    1
  ActivationState:      MBIMActivationStateActivated (1)
  VoiceCallState:       MBIMVoiceCallStateNone (0)
  IPType:       MBIMContextIPTypeIPv4 (1)
  ContextType:  7e5e2a7e-4e6f-7272-736b-656e7e5e2a7e (MBIMContextTypeInternet)
  NwError:      0 (none)


03 00 00 80 80 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00 a2 89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0f 00 00 00 00 00 00 00 50 00 00 00 01 00 00 00 07 00 00 00 00 00 00 00 01 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 4c 00 00 00 00 00 00 00 02 00 00 00 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c1 d5 70 04 82 43 0f c6 18 00 00 00 6d b3 12 2f 6d b3 12 01 
---
MBIM_MESSAGE_HEADER
  MessageType:  0x80000003 (MBIM_COMMAND_DONE)
  MessageLength:        128
  TransactionId:        17
MBIM_FRAGMENT_HEADER
  TotalFragments:       0x00000001
  CurrentFragment:      0x00000000
BASIC_CONNECT (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)
MBIM_CID_IP_CONFIGURATION (15)
MBIM_STATUS_SUCCESS (0)
InformationBuffer [80]:
  SessionId:    1
  IPv4ConfigurationAvailable:   0x00000007 address, gateway, dns
  IPv6ConfigurationAvailable:   0x00000000 None
  IPv4AddressCount:     1
    109.179.18.47/24
  IPv6AddressCount:     0
  IPv4Gateway:  109.179.18.1
  IPv6Gateway:  100:0:700::100:0
  IPv4DnsServerCount:   2
    193.213.112.4
    130.67.15.198
  IPv6DnsServerCount:   0
  IPv4Mtu:      0
  IPv6Mtu:      0



There are some relations here which I do not know if we are currently
expecting.  But then we aren't relly supporting multiple IP sessions at
all yet, are we? At least I couldn't figure out how to do that using
libmbim, which is the reason the output above is from my primitive perl
script.



The NCM support is another story...  I believe it can be used with
AT+CGACT, but there doesn't seem to be any "NETWORK_CONNECTION"
notification, which means than the current cdc_ncm driver won't work at
all.

And the psycho MAC address must also be ignored.  As noted earlier, the
NCM descriptors list an invalid address:


    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass     13 
      bInterfaceProtocol      0 
      iInterface              5 Sierra Wireless EM7345 4G LTE (NCM)
      CDC Header:
        bcdCDC               1.20
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      CDC NCM:
        bcdNcmVersion        1.00
        bmNetworkCapabilities 0x00
      CDC Ethernet:
        iMacAddress                      6 FFFFFFFFFFFF
        bmEthernetStatistics    0x00000000
        wMaxSegmentSize               1514
        wNumberMCFilters            0x0000
        bNumberPowerFilters              0

Which we currently believe in and stupidly try to use:

May 28 12:07:27 nemi kernel: [46749.312813] cdc_ncm 1-1:1.0: dwNtbInMaxSize=15360 dwNtbOutMaxSize=15360 wNdpOutPayloadRemainder=0 wNdpOutDivisor=32 wNdpOutAlignment=4 wNtbOutMaxDatagrams=32 flags=0x0
May 28 12:07:27 nemi kernel: [46749.320726] cdc_ncm 1-1:1.0: MAC-Address: ff:ff:ff:ff:ff:ff
May 28 12:07:27 nemi kernel: [46749.334236] cdc_ncm 1-1:1.0 usb0: register 'cdc_ncm' at usb-0000:00:1a.7-1, CDC NCM, ff:ff:ff:ff:ff:ff


But the netdev cannot be brought up with this address.  I'll go add a
fix for that in the driver.  But I don't know how to work around the
missing notification.  That's violating the NCM spec.  Maybe add a
quirk?  Or just drop it and assume that noone will ever want to use this
modem in NCM mode?


Bjørn


More information about the libmbim-devel mailing list