首页 > 解决方案 > 试图了解 wwan0 上传输的数据量?

问题描述

我有一个通过 lte 调制解调器连接到互联网的 linux 系统,我通过 modemManager 与它通信。所以我在理解消耗的数据字节数方面有点困难。

root@raspberrypi-cm3:~# mmcli -b 0
-------------------------
 Status     | connected : 'yes'
            | suspended : 'no'
            | interfaces: 'wwan0'
            | IP timeout: '20'
 -------------------------
 Properties |       apn: 'myapn'
            |   roaming: 'allowed'
            |   IP type: 'none'
            |      user: 'none'
            |  password: 'none'
            |    number:  'none'
 -------------------------
 Stats      |            Duration: '105060'
            |      Bytes received: '6300'
            |   Bytes transmitted: '6209'

root@raspberrypi-cm3:~# ping -c 1 -s 0 www.opendns.com
8 bytes from ****.****.****.*** seq =0 ttl=50
1 packet transmitted, 1 packet received, 0% packet loss

root@raspberrypi-cm3:~# mmcli -b 0
-------------------------
 Status     | connected : 'yes'
            | suspended : 'no'
            | interfaces: 'wwan0'
            | IP timeout: '20'
 -------------------------
 Properties |       apn: 'myapn'
            |   roaming: 'allowed'
            |   IP type: 'none'
            |      user: 'none'
            |  password: 'none'
            |    number:  'none'
 -------------------------
 Stats      |            Duration: '105090'
            |      Bytes received: '6512'
            |   Bytes transmitted: '6359'

所以根据调制解调器管理器。我正在消耗 150 字节的数据来向 opendns 发送 ping 并且我正在接收 212 字节的数据?

但这怎么可能。我正在传输 8 个字节并使用 ICMP 标头接收 8 个字节,总共将收到 16 个字节的数据。

有人能解释一下这些附加数据字节来自哪里吗?当我与我的名称服务器通信时,它们只是一种开销吗?如果那是开销,是否有某种公式可以用来计算消耗的近似数据?

我的最终目标只是交叉验证消耗的总数据字节数

标签: linuxnetworkingmmcli

解决方案


我通过使用tcpdump创建 pcap 文件找到了答案。感谢您对我的问题投了反对票,但没有提供任何答案。对于像我这样的其他初学者。如果您面临类似的问题。请使用tcpdump它会给您详细解释您的设备发送和接收的数据包。


推荐阅读