Reputation: 574
I tried to use tc to simulate packets corruption and view the network interface statistics via ifconfig or cat /proc/net/dev.
The packets corruption worked as expected, However I was wondering if we could inspect the result via ifconfig?
Step 1. Create packet corruption
~$ tc qdisc add dev eth0 root netem corrupt 10%
Step 2. Send packets
~$ ping 8.8.8.8
Step 3. Inspect ping result, icmp_seq 85,89 and 90 is missing as expected.
64 bytes from 8.8.8.8: icmp_seq=84 ttl=109 time=7.41 ms
64 bytes from 8.8.8.8: icmp_seq=86 ttl=109 time=7.45 ms
64 bytes from 8.8.8.8: icmp_seq=87 ttl=109 time=7.45 ms
64 bytes from 8.8.8.8: icmp_seq=89 ttl=109 time=7.51 ms
64 bytes from 8.8.8.8: icmp_seq=91 ttl=109 time=7.43 ms
Step 4. Inspect network interface
~$ ifconfig
eth0: flags=4163 mtu 9001
inet 10.100.100.41 netmask 255.255.255.224 broadcast 10.100.100.63
inet6 fe80::af:d5ff:fe32:eb24 prefixlen 64 scopeid 0x20
ether 02:af:d5:33:eb:24 txqueuelen 1000 (Ethernet)
RX packets 522086 bytes 693054828 (693.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 238600 bytes 23556732 (23.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I was wondering why ifconfig shows there is no packet errors, dropped?
Any advice would be appreciated.
Upvotes: 0
Views: 324