rmnet iproute2 support added in iproute2-next

rmnet is the name of Qualcomm proprietary mobile broadband interface type available in today’s Qualcomm based modems.

rmnet USB modem are managed through the kernel module qmi_wwan that creates both a control device (cdc-wdm), in which qmi messages pass, and a network interface, for data connections (for more details on these arguments I suggest reading this always interesting document from Aleksander Morgado).

rmnet device

Besides the difficulties of dealing with a proprietary protocol not publicly documented (apart from the information that could be read in the code of the old Gobi SDK), the couple libqmi + qmi_wwan proved to work brilliantly, allowing Linux users to get the most out of their modems.

Recently Qualcomm, under the umbrella of the CodeAurora project, decided to directly add support for rmnet devices, contributing to the Linux kernel with a new ethernet driver (linux/drivers/net/ethernet/qualcomm/rmnet), available since version 4.14-rc1.

The interesting thing is that this new module is specifically targeted to provide a transport agnostic MAP (multiplexing and aggregation protocol) used by all Qualcomm recent chipset, meaning that the physical transports could be USB, HSIC, PCIe…

QMAP support was already added in qmi_wwan to provide multiple PDNs management, but, being linked to qmi_wwan, it was just for USB based modems.

According to the module documentation it is possible to use this kind of device also with qmi_wwan, however the driver needs to be modified in order to forward packets directly to the rmnet device, without any processing. A patch for this has been already proposed and is currently discussed in the netdev mailing list.

Waiting for qmi_wwan patch to be accepted upstream, I contributed to iproute2 to add rmnet support, since the suggested tool for userspace configuration was a bit outdated and I needed something to test the feature. rmnet patch was accepted in iproute2-next and hopefully will be available in the next release of iproute2.

With that patch, the command for creating a rmnet device with a specific mux id is:

ip link add link ${qmi_wwan network interface} name ${rmnet device network interface name} type rmnet mux_id ${mux id}

e.g.

ip link add link wwp0s20u5i2 name rmnet0 type rmnet mux_id 1

On the whole Qualcomm direct support for rmnet is a really good thing: hopefully it will bring also to the disclosure of parts of the QMI protocol and to the enrichment of the libqmi API.