Solved Ping: 22% packet loss

Hello, everybody!

I used FreeBSD for some time, but did not dig so deep in Network Connections Parameters… Installed FreeBSD 10.1 on a NetBook (with a broken screen) Samsung NP‑NC10‑KA04RU (Intel® Atom™ N270 Diamondville-SC 1.60 GHz, HT, Mobile Intel® Calistoga‑GSE i945GSE, 1024 MB DDR2‑667, Marvell Yukon 88E8040 PCI-E Fast Ethernet Controller). It works, but I get constant packet loss 22% - 27%, when pinging this Machine. This server is connected with another machine (Ubuntu Linux) via switch D‑Link DES‑1005A.
Code:
uname -a
FreeBSD CrazyMihey.HopTo.Org 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 22:51:51 UTC 2014  [email]root@releng1.nyi.freebsd.org[/email]:/usr/obj/usr/src/sys/GENERIC  i386

ifconfig -a
ath0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
   ether 00:21:63:[COLOR=#bfbfbf]XX[/COLOR]:[COLOR=#bfbfbf]XX[/COLOR]:[COLOR=#bfbfbf]XX[/COLOR]
   nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
   media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
   status: no carrier
msk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
   options=8010a<TXCSUM,VLAN_MTU,TSO4,LINKSTATE>
   ether 00:13:77:[COLOR=#bfbfbf]XX[/COLOR]:[COLOR=#bfbfbf]XX[/COLOR]:[COLOR=#bfbfbf]XX[/COLOR]
   inet 192.168.[COLOR=#bfbfbf]XXX[/COLOR].[COLOR=#bfbfbf]XXX[/COLOR] netmask 0xfffffff8 broadcast 192.168.[COLOR=#bfbfbf]XXX[/COLOR].[COLOR=#bfbfbf]XXX[/COLOR][COLOR=#b3b300]# My Internal NetWork.[/COLOR]
   inet 10.226.[COLOR=#bfbfbf]XXX[/COLOR].[COLOR=#bfbfbf]XXX[/COLOR] netmask 0xffffe000 broadcast 10.226.[COLOR=#bfbfbf]XXX[/COLOR].[COLOR=#bfbfbf]XXX [COLOR=#b3b300]# Given by ISP.[/COLOR][/COLOR]
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: Ethernet autoselect (100baseTX <full-duplex,flowcontrol,rxpause,txpause>)
   status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
   options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
   inet6 ::1 prefixlen 128
   inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
   inet 127.0.0.1 netmask 0xff000000
   nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

I used the following command to check the network:: ping -c 1024 -s 1472 -f 192.168.….…

Ping FreeBSD -> Linux 1.065 ms, 0.0% packet loss
Ping FreeBSD -> Yandex.Ru 5.883 ms, 0.0% packet loss
Ping Linux -> FreeBSD 1.008 ms, 22% packet loss
Ping FreeBSD -> LocalHost 0.041 ms, 27.0% packet loss
Ping Linux -> LocalHost 0.017 ms, 0% packet loss

I think, that the trouble is in the some FreeBSD network settings, because I encountered about the same results on another machine (P4+RealTek NIC) on FreeBSD 9.1 and on a virtual machine (VMWare WorkStation) too.

Can anyone tell me, please, which way to dig to fix this behavior?
 
Last edited by a moderator:
Hi

I'm by no means a network expert so you may get better insight from someone else, but is there a reason your using the -f flag with ping(8)? It may be a bit aggressive with a netbook NIC. Do you get the same results running ping(8) without that flag?
 
Hi

I'm by no means a network expert so you may get better insight from someone else, but is there a reason your using the -f flag with ping(8)? It may be a bit aggressive with a netbook NIC. Do you get the same results running ping(8) without that flag?
No, without "-f" Packets are not lost, but running aggressive Tests gives a little guarantee, that the System can do more, than just Echo.
Furthermore:
1. The System must be able to run at very extremal level of load.
2. System, running Linux does not loose any Packets.
3. FreeBSD has a constant loose percent 22% — 27% on two very different physical Machines and on a several Virtuals. So I'm inclined to believe that something is wrong with the FreeBSD default NetWork settings, but I don't know, witch and how to tweak…
Just at this Time I started Linux (ELive from USB-Flash) on that NetBook and try to Ping It from another Linux Machine:
Ping Linux -> NetBook_Linux_ELive 0.787 ms, 0% packet loss.
 
If the systems are connected a switch, have you tried changing the switch ports they're operating on? It may be beneficial to rule out the switch being the problem, D-Links can be flaky.

Beyond that, Marvell NICs are just plain terrible. The drivers have a proprietary firmware that is buggy on Linux and FreeBSD.

As I wrote before, this situation repeats on Another Computer with another NIC and on a Virtual Machine too. And in all cases the Packet Loss Percentage is a Constant Value between Tests. To ensure, that the Trouble is in FreeBSD, yesterday I ran ELive Linux (just from USB-Flash) on this NetBook, connected to the same Port and Ping from Ubuntu worked perfectly.
 
I really don't think this is an issue with FreeBSD and as mentioned already, is more of a hardware issue to be honest. Keep in mind that the FreeBSD ping(8) and Linux ping tools, while very similar, are not exactly same thing and have slight differences. I have 6 FreeBSD computers in my home network(2 of them netbooks). All of them have absolutely no network tuning outside of the defaults, and none of them exhibit this behavior even when using the -f flag with ping(8).
 
So if You type ping -c 1024 -s 1472 -f LocalHost on any of Your Computers, You will get
Code:
0.0% packet loss
? It is very strange, but it seems to Me, when pinging LocalHost, HardWare is not used at all…
 
So if You type ping -c 1024 -s 1472 -f LocalHost on any of Your Computers, You will get
Code:
0.0% packet loss
? It is very strange, but it seems to Me, when pinging LocalHost, HardWare is not used at all…

Of course not, the lo0 interface and the equivalent interfaces in other operating systems are implemented in software only.
 
I get ~ 23% packet loss when I run ping -c 1024 -s 1472 -f localhost here, but I also get this message on the console:
Code:
Limiting icmp ping response from 274 to 200 packets/sec
so FreeBSD seems to rate limit pings.

It seems you can adjust this limit with the net.inet.icmp.icmplim sysctl.
I set it to 0 as an experiment and get 0% packet loss afterwards.
 
so FreeBSD seems to rate limit pings.

It seems you can adjust this limit with the net.inet.icmp.icmplim sysctl.
I set it to 0 as an experiment and get 0% packet loss afterwards.

This is brilliant!
A Casket just opened!
But I did't get Message «Limiting icmp ping response…», and decided, that is't an Error or something…
Thank You very much for explaining, now I also got 0% packet loss.
The Question is closed.
 
Back
Top