DSS usage

Bjørn Mork bjorn at mork.no
Thu May 1 15:13:00 PDT 2014


Bjørn Mork <bjorn at mork.no> writes:

> So my only working proposal is to add another "magic" VLAN which, if
> created by userspace, will replace wwan0 as the IP interface associated
> with session 0, leaving wwan0 as a upper netdev *only*. If userspace
> doesn't create this magic VLAN for session 0, then wwan0 will continue
> playing its current dual role, making sure we don't break the simple
> "single IP session" usecase.
>
> But I'm not yet convinced this is a good idea, so I'd like to have more
> people thinking it over before implementing it.
>
> Pros:
>  - allows MTU to be set independently for all IP and DSS sessions
>  - allows bringing up and down the netdev associated with IP session 0
>    without interfering with any other session
>
> Cons:
>  - obfuscated and complex user interface
>  - IP session 0 will be associated with a somewhat illogical VLAN ID
>  - inconsequent mapping of IP session 0 can confuse users and software
>
> And probably more.  But that's what I came up with right now.

I think I'll try this out.  I have experimented a bit and found that we
can avoid the illogical VLAN ID by simply abusing 802.1p for this, i.e
just use "VLAN 0".

We'll then end up, optionally, having something like this for IP
Session 0:


wwan0     Link encap:Ethernet  HWaddr 26:b4:4e:8f:96:44  
          inet6 addr: fe80::24b4:4eff:fe8f:9644/64 Scope:Link
          UP BROADCAST RUNNING NOARP MULTICAST  MTU:2048  Metric:1
          RX packets:149 errors:0 dropped:0 overruns:0 frame:0
          TX packets:150 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:15868 (15.4 KiB)  TX bytes:15392 (15.0 KiB)

wwan0.0   Link encap:Ethernet  HWaddr 26:b4:4e:8f:96:44  
          inet addr:77.16.217.234  Bcast:77.16.217.235  Mask:255.255.255.252
          inet6 addr: fe80::24b4:4eff:fe8f:9644/64 Scope:Link
          inet6 addr: 2a02:2121:1:85f0:24b4:4eff:fe8f:9644/64 Scope:Global
          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:149 errors:0 dropped:0 overruns:0 frame:0
          TX packets:150 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:15868 (15.4 KiB)  TX bytes:17492 (17.0 KiB)


Note the MTUs, and that the IP session 0 network interface now can be
managed by e.g. a DHCP client taking it down without affecting any other
session. But if you really want to, then you can still bring the master
netdev down, stopping usbnet rx.

The implementation is like this: Once you add VLAN ID 0, the driver
changes behaviour:
- untagged packets are unconditionally dropped on tx (so you don't need
  to remember to disable the IPv6 Router Solicitaions on wwan0)
- packets received for IP Session 0 are tagged for VLAN ID 0

I believe this should make it easier to e.g open a DSS session
completely independently if any IP sessions. 

Thoughs?

If I should push this, should I also include code to automatically
adjust the MTU up to wMaxSegmentSize on the master dev once the VLAN 0
subdev is added?  How about the other way?  Reset to wMTU or ethernet
default (1500) when the subdev is deleted?

I honestly think this is going to solve most problems in a cleaner
manner than trying to modify usbnet.  And you get consistent interface
name mapping for multiple IP sessions as a bonus.  No more special IP
session 0 naming.

Note that using this feature is completely optional and the existing API
is not changed. There is nothing new unless you create wlan0.0.  And if
you only care about IP session 0, then that is fine.



Bjørn (who once again managed to shoot himself in the leg with his
ip6tables RA rules - whoever thought of matching against wwan0.0?)


More information about the libmbim-devel mailing list