I'm looking for the way to read packet loss counters from WiFi network.
It should be over adb shell or Java or C (NDK) or your way
Android is not rooted.
I have an Access Point where I configured packet loss 2% with Dummynet
service.
I use wget
command from PC and download 50 Mb file from local server (Band Width for LAN should be `100Mb). I see that after packet loss configuration Band Width reduced from 100Mb to 3Mb, its mean that all works fine.
So far so good,
My device (Android) is connected to above mentioned AP by WiFi.
I try to download the same 50 Mb file , download rate is 3M but I don't see any error or retransmission counters rise.
I use adb shell
CLI and entered to: sys/class/net/eth0/statistics
where I see:
-r--r--r-- root root 4096 2012-12-04 15:42 rx_packets
-r--r--r-- root root 4096 2012-12-04 15:42 tx_packets
-r--r--r-- root root 4096 2012-12-04 15:41 rx_bytes
-r--r--r-- root root 4096 2012-12-04 15:41 tx_bytes
-r--r--r-- root root 4096 2012-12-04 15:43 rx_errors
-r--r--r-- root root 4096 2012-12-04 15:43 tx_errors
-r--r--r-- root root 4096 2012-12-04 15:43 rx_dropped
-r--r--r-- root root 4096 2012-12-04 15:43 tx_dropped
-r--r--r-- root root 4096 2012-12-04 15:43 multicast
-r--r--r-- root root 4096 2012-12-04 15:43 collisions
-r--r--r-- root root 4096 2012-12-04 15:43 rx_length_errors
-r--r--r-- root root 4096 2012-12-04 15:43 rx_over_errors
-r--r--r-- root root 4096 2012-12-04 15:43 rx_crc_errors
-r--r--r-- root root 4096 2012-12-04 15:38 rx_frame_errors
-r--r--r-- root root 4096 2012-12-04 15:38 rx_fifo_errors
-r--r--r-- root root 4096 2012-12-04 15:38 rx_missed_errors
-r--r--r-- root root 4096 2012-12-04 15:38 tx_aborted_errors
-r--r--r-- root root 4096 2012-12-04 15:38 tx_carrier_errors
-r--r--r-- root root 4096 2012-12-04 15:38 tx_fifo_errors
-r--r--r-- root root 4096 2012-12-04 15:38 tx_heartbeat_errors
-r--r--r-- root root 4096 2012-12-04 15:38 tx_window_errors
-r--r--r-- root root 4096 2012-12-04 15:38 rx_compressed
-r--r--r-- root root 4096 2012-12-04 15:38 tx_compressed
So I run cat *
and get all above mentioned files with 0 value except 4:
tx/rx_packets/bytes
are active , it's mean that I use write interface:
cat rx_packets
9106
If any know other way to detect packet loss or get it programmatically would be greatly appreciated