3

I have created a hotspot in raspberry pi(hostapd) and i have connected my mobile. I am downloading an app in mobile,let say app size is around 11MB.I am started running a network monitoring command in raspberry pi terminal(sudo ifstat -t) this is the result:

 Time           eth0               wlan0
HH:MM:SS   KB/s in  KB/s out   KB/s in  KB/s out

06:20:15     24.46     16.64     16.52     23.69
06:20:16      4.92      7.74      6.59      4.80
06:20:17      1.15      9.53      9.97      0.78
06:20:18    742.25     46.72     35.77    760.74
06:20:19   1855.14     79.12     58.15   1901.20
06:20:20   1801.82    106.43     83.16   1847.07
06:20:21   1757.72     98.27     75.62   1801.48
06:20:22   1535.39     80.23     60.93   1573.92
06:20:23   1743.82    108.16     83.24   1787.66
06:20:24   1685.28     85.97     66.12   1727.63
06:20:25    968.73     54.31     44.55    993.34
06:20:26      3.35      1.48      0.82      1.46
06:20:27      2.95      0.82      1.52      0.00
06:20:28      0.82      1.90      1.85      0.00
06:20:29      0.84      1.30      0.39      0.00
06:20:30      0.77      2.68      3.12      0.22
06:20:31      9.55      1.02      0.33      9.26

Question is since Ethernet is the internet source for WiFi,how come eth0 is showing less data consumption than wlan0? Can anyone please advise me on this or your thoughts? Thanks in advance!

praveen
  • 63
  • 5

2 Answers2

1

Obviously there's some local traffic between your mobile and the hotspot. mDNS would be the first suspect in my list. You can track active connections with netstat to find out what it really is.

Dmitry Grigoryev
  • 28,277
  • 6
  • 54
  • 147
0

interesting observation. such kind of measurements are hard to align. WiFi packets might have a different packet size, error correction etc. compared to eth0. I don't think you will see anything suspicious via netstat - but I suggest that you try another tool: vnstat

apt-get install vnstat

I have been using it for monitoring network traffic since a few years. it offers live observation (with --live) aswell as traffic stats over time (hours, days, months).

Download 200 MB though your setup and then compare vnstat -h -i eth0 and vnstat -h -i wlan0)

Update: Don't forget vnstat updates its database only every x minutes (see etc/vnstat/vnstat.conf)

Another remark regarding throughput speed in bytes/sec: In my opinion, this is a hard task to do accurate. Network traffic (especially when wireless is involved) can be very inhomogeneous, i.e. it might transfer 1 MByte/sec right now, then suddenly stop for 1 sec and then do 2 MByte in the next 1 sec, then go back to 1 MByte/sec. If your tool (vnstat, ifstat) is looking at a 2sec interval, you'd never notice that it was stuck for 1sec. So the refresh rate (interval) should be much shorter, like every 10-100ms. That's just one example why this can become tricky.

Eugen
  • 488
  • 3
  • 13