WDS Get Packet Statistics
Bjørn Mork
bjorn at mork.no
Fri Jun 21 08:46:57 PDT 2013
Aleksander Morgado <aleksander at lanedo.com> writes:
> Hey,
>
> I added recently support for retrieving packet statistics during a
> connection. You can use the qmicli '--wds-get-packet-statistics' command
> to get those.
>
> My MC7710 here reports only TX/RX successful packets and bytes, but the
> protocol seems to support other values as well, like TX/RX error packets
> or TX/RX overflows.
>
> Question being, is there any modem out there exposing those additional
> statistics?
I got the same result with the Huawei E392u-12:
[21 Jun 2013, 17:29:36] [Debug] [/dev/cdc-wdm0] Received message (translated)...
>>>>>> QMUX:
>>>>>> length = 83
>>>>>> flags = 0x80
>>>>>> service = "wds"
>>>>>> client = 5
>>>>>> QMI:
>>>>>> flags = "response"
>>>>>> transaction = 1
>>>>>> tlv_length = 71
>>>>>> message = "Get Packet Statistics" (0x0024)
>>>>>> TLV:
>>>>>> type = "Result" (0x02)
>>>>>> length = 4
>>>>>> value = 00:00:00:00
>>>>>> translated = SUCCESS
>>>>>> TLV:
>>>>>> type = "Rx Bytes Ok" (0x1a)
>>>>>> length = 8
>>>>>> value = BD:8E:E8:03:00:00:00:00
>>>>>> translated = 65572541
>>>>>> TLV:
>>>>>> type = "Tx Bytes Ok" (0x19)
>>>>>> length = 8
>>>>>> value = 72:46:8A:00:00:00:00:00
>>>>>> translated = 9062002
>>>>>> TLV:
>>>>>> type = "Rx Overflows" (0x15)
>>>>>> length = 4
>>>>>> value = FF:FF:FF:FF
>>>>>> translated = 4294967295
>>>>>> TLV:
>>>>>> type = "Tx Overflows" (0x14)
>>>>>> length = 4
>>>>>> value = FF:FF:FF:FF
>>>>>> translated = 4294967295
>>>>>> TLV:
>>>>>> type = "Rx Packets Error" (0x13)
>>>>>> length = 4
>>>>>> value = FF:FF:FF:FF
>>>>>> translated = 4294967295
>>>>>> TLV:
>>>>>> type = "Tx Packets Error" (0x12)
>>>>>> length = 4
>>>>>> value = FF:FF:FF:FF
>>>>>> translated = 4294967295
>>>>>> TLV:
>>>>>> type = "Rx Packets Ok" (0x11)
>>>>>> length = 4
>>>>>> value = 5B:BB:00:00
>>>>>> translated = 47963
>>>>>> TLV:
>>>>>> type = "Tx Packets Ok" (0x10)
>>>>>> length = 4
>>>>>> value = 51:2F:00:00
>>>>>> translated = 12113
[/dev/cdc-wdm0] Connection statistics:
TX packets OK: 12113
RX packets OK: 47963
TX bytes OK: 9062002
RX bytes OK: 65572541
I believe the RX/TX bytes is quite valuable info to the end users, so it
would be nice if we had some way to let them use it. These counters
will be different from the interface RX/TX bytes as reported by the
driver, because the driver has to account for additional ARP traffic and
ethernet headers. And it's the modem counters you will pay for.
Sample difference here after a short connection running a couple of
speed tests:
nemi:/home/bjorn# ifconfig wwan0
wwan0 Link encap:Ethernet HWaddr 2e:fd:84:93:cb:37
inet addr:46.156.187.21 Bcast:46.156.187.23 Mask:255.255.255.252
inet6 addr: fe80::2cfd:84ff:fe93:cb37/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:98408 errors:0 dropped:0 overruns:0 frame:0
TX packets:19873 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:137891200 (131.5 MiB) TX bytes:11585374 (11.0 MiB)
nemi:/home/bjorn# qmicli -d /dev/cdc-wdm0 --wds-get-packet-statistics
[/dev/cdc-wdm0] Connection statistics:
TX packets OK: 19859
RX packets OK: 98405
TX bytes OK: 11304444
RX bytes OK: 137890560
Hmm, that's actually surprisingly matching. Makes me wonder if the
modem counters are all that useful anyway. They seem to count the
netdev on the other end of the USB link, making the driver accounting
just as good. The ethernet header is removed from the modem TX bytes,
but that is the only difference (11585374 - 11304444 =~ 14 * 19859).
Well, so much for that wish.
I'm certainly hoping the NCM/MBIM modems do better. Those drivers send
and account for lots of zero bytes to fill up the frames. None of these
will ever hit your bill. But they will show up on the interface
counters, making you believe that you have been using more much more of
your quota than you really have. If the modem counts real mobile
network bytes, then those numbers would be very useful.
Other than that, I do have additional driver counters on my todo list.
But I don't know when that will happen.
Bjørn
More information about the libqmi-devel
mailing list