Subject: Re: asymetric ping
To: None <netbsd-help@NetBSD.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 08/16/2005 21:24:45
3 weeks ago, James K. Lowden wrote:
> I think I'm having a local Ethernet problem.  I've swapped cables and
> rebooted the hardware, even used different interfaces to the extent I
> can, but my LAN is still partly broken, afaict.  

A follow-up.  Having now replaced the Soekris ("Cherry"), I found that I
could still not reliably transfer files to Oak.  Swapping out oak's 3c905
(ex0) in favor of the on-board VIA VT6102 (vr0) fixed that problem. 
Perhaps in fact that was the only problem all along.  

I had tested many combinations, and I think I was misled by ping(1).  

With the LAN now functioning properly -- i.e. able to ftp the kernel at
~1.0 MB/s -- my ping times are still miserable, no matter who the
respondent is:

cherry$ for H in localhost exit sandbox oak; do ping -c 10 $H; done | grep
round-trip
round-trip min/avg/max/stddev = 47.401/207.427/1407.328/421.831 ms
round-trip min/avg/max/stddev = 61.175/93.161/149.710/30.087 ms
round-trip min/avg/max/stddev = 44.120/71.877/91.842/17.231 ms
round-trip min/avg/max/stddev = 43.894/72.612/89.674/12.270 ms

where: 

localhost is 127.0.0.1
exit is the gateway provided by my ISP (on sip2)
sandbox and oak are on the LAN (on sip0)

What's up with that?  Cf. oak's report:

oak$ for H in localhost exit sandbox cherry; do ping -c 10 $H; done | grep
round-trip
round-trip min/avg/max/stddev = 0.057/0.069/0.093/0.009 ms
round-trip min/avg/max/stddev = 14.786/35.488/126.199/35.590 ms
round-trip min/avg/max/stddev = 0.369/0.431/0.703/0.100 ms
round-trip min/avg/max/stddev = 0.460/0.496/0.504/0.013 ms

Is something potentially amiss in the sip(4) driver?  Or does my kernel
misunderstand the clock somehow?  

I was using the NetBSD 2.0 release kernel.  I since compiled my own based
on the same sources (stripping out unneeded buses and adding temperature
support for monitoring with envstat).  

As observed behavior is now OK, I am now reduced to trying to figure out
why ping reports such long delays.  

Many thanks for any advice.  

--jkl


> 
> Ping times one way are < 1 ms; the other way > 60 ms.  In one direction,
> I can ftp a file at 20% of the Ethernet's raw bit capacity; the other
> way doesn't work at all.  I'm afraid my quite-new Soekris box is flaking
> out on me.  
> 
> Details follow, but here's the kicker: ping localhost is *really* slow
> on Cherry:
> 
> bash-3.00# ping -c15  localhost
> PING localhost (127.0.0.1): 56 data bytes
> 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=47.141 ms
> 64 bytes from 127.0.0.1: icmp_seq=1 ttl=255 time=95.676 ms
> 64 bytes from 127.0.0.1: icmp_seq=2 ttl=255 time=95.261 ms
> ...
> ----localhost PING Statistics----
> 15 packets transmitted, 15 packets received, 0.0% packet loss
> round-trip min/avg/max/stddev = 47.141/80.453/95.676/11.152 ms
> 
> What in the world could cause that?  
> 
> Thanks for any help.  Details follow.  
> 
> --jkl
> 
> OAK-[ex0]---100baseTX---+
>                         |
>                         +--[sip0]--CHERRY
>                                      |
>                                    [sip2]
>                                      |
>                                   (internet)
> 
> 
> [There are other nodes, but they're powered off. Cherry and Oak are both
> plugged into an old hub.]
> 
> Ping Cherry -> Oak:
> 
> # ping -c15 oak
> PING oak.schemamania.org (192.168.1.5): 56 data bytes
> 64 bytes from 192.168.1.5: icmp_seq=0 ttl=255 time=57.281 ms
> 64 bytes from 192.168.1.5: icmp_seq=1 ttl=255 time=92.153 ms
> 64 bytes from 192.168.1.5: icmp_seq=2 ttl=255 time=86.697 ms
> ...
> ----oak.schemamania.org PING Statistics----
> 15 packets transmitted, 15 packets received, 0.0% packet loss
> round-trip min/avg/max/stddev = 37.582/78.588/92.153/18.424 ms
> 
> # ifconfig sip0
> sip0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         address: 00:00:24:c1:50:c0
>         media: Ethernet autoselect (100baseTX)
>         status: active
>         inet 192.168.1.254 netmask 0xffffff00 broadcast 192.168.1.255
>         inet alias 192.168.1.16 netmask 0xffffff00 broadcast
>         192.168.1.255 inet6 fe80::200:24ff:fec1:50c0%sip0 prefixlen 64
>         scopeid 0x1
> 
> Ping Oak -> Cherry:
> 
> jklowden@oak$ ping -c 15 cherry
> PING cherry.schemamania.org (192.168.1.254): 56 data bytes
> 64 bytes from 192.168.1.254: icmp_seq=0 ttl=255 time=0.300 ms
> 64 bytes from 192.168.1.254: icmp_seq=1 ttl=255 time=0.314 ms
> ...
> ----cherry.schemamania.org PING Statistics----
> 15 packets transmitted, 15 packets received, 0.0% packet loss
> round-trip min/avg/max/stddev = 0.300/0.322/0.344/0.012 ms
> 
> jklowden@oak$ ifconfig ex0
> ex0:
> flags=8a63<UP,BROADCAST,NOTRAILERS,RUNNING,ALLMULTI,SIMPLEX,MULTICAST>
> mtu 1500
>         address: 00:10:4b:22:15:d8
>         media: Ethernet autoselect (100baseTX)
>         status: active
>         inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
>         inet6 fe80::210:4bff:fe22:15d8%ex0 prefixlen 64 scopeid 0x1
> 
> Using FTP, Oak as server:
> 
> ftp> get /netbsd t
> local: t remote: /netbsd
> 229 Entering Extended Passive Mode (|||65216|)
> 100% |*************************************|  7389 KB  205.40 KB/s   
> 00:00 ETA
> 226 Transfer complete.
> 7567027 bytes received in 00:36 (204.78 KB/s)
> ftp> put /netbsd t
> local: /netbsd remote: t
> 229 Entering Extended Passive Mode (|||65215|)
> 150 Opening BINARY mode data connection for 't'.
>   0% |                                     | 65536       0.74 KB/s  -
> stalled -^C
> send aborted. Waiting for remote to finish abort.
> 421 Service not available, remote server timed out. Connection closed
> 65536 bytes sent in 02:25 (0.43 KB/s)
> 
> 
>