Subject: Re: ping A->B != ping B->A ?
To: None <tech-net@netbsd.org>
From: Ian Zagorskih <ianzag@megasignal.com>
List: tech-net
Date: 07/07/2004 22:55:44
Sorry, All, looks like i was auto-unsubscribed some time ago from tech-net@ 
and lost your replies. As always, "due to extensive bounces" thanks to Mr. 
Majordomo..

So, in short:
A = 192.168.100.37, my workstation, IP obtained from DHCP. DNS is configured.
B = 192.168.100.250, target machine, IP is statically assigned, DNS is not 
configured.

Full A dmesg can be found at http://ianzag.megasignal.com/tmp/dmesgA
Full B dmesg can be found at http://ianzag.megasignal.com/tmp/dmesgB

ping A->B works fine, ping B->A fails.

> clock drift on one of the boxes ?

Dosn't looks like this. At least even if it does it isn't too significant.

> Maybe try to run a tcpdump on both system, and look at the timestamps.

A: ping 192.168.100.250
B: tcpdump -c10 icmp | tee log

---cut A---
# ping 192.168.100.250
PING 192.168.100.250 (192.168.100.250): 56 data bytes
64 bytes from 192.168.100.250: icmp_seq=0 ttl=255 time=0.280 ms
64 bytes from 192.168.100.250: icmp_seq=1 ttl=255 time=0.310 ms
64 bytes from 192.168.100.250: icmp_seq=2 ttl=255 time=1.303 ms
64 bytes from 192.168.100.250: icmp_seq=3 ttl=255 time=1.273 ms
64 bytes from 192.168.100.250: icmp_seq=4 ttl=255 time=1.262 ms
64 bytes from 192.168.100.250: icmp_seq=5 ttl=255 time=1.258 ms
^C
----192.168.100.250 PING Statistics----
6 packets transmitted, 6 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.280/0.948/1.303/0.506 ms
---cut A---

---cut B---
# cat log
22:36:43.352907 192.168.100.37 > 192.168.100.250: icmp: echo request seq 0
22:36:43.363294 192.168.100.250 > 192.168.100.37: icmp: echo reply seq 0
22:36:44.110139 192.168.100.37 > 192.168.100.250: icmp: echo request seq 1
22:36:44.113455 192.168.100.250 > 192.168.100.37: icmp: echo reply seq 1
22:36:45.328112 192.168.100.37 > 192.168.100.250: icmp: echo request seq 2
22:36:45.336845 192.168.100.250 > 192.168.100.37: icmp: echo reply seq 2
22:36:46.338028 192.168.100.37 > 192.168.100.250: icmp: echo request seq 3
22:36:46.348794 192.168.100.250 > 192.168.100.37: icmp: echo reply seq 3
22:36:47.339406 192.168.100.37 > 192.168.100.250: icmp: echo request seq 4
22:36:47.349386 192.168.100.250 > 192.168.100.37: icmp: echo reply seq 4
---cut B---

A->B looks fine to me.

A: tcpdump icmp
B: ping -n -c10 192.168.100.37 | tee log

---cut A---
# tcpdump icmp
tcpdump: listening on rtk0
22:39:41.711857 192.168.100.250 > 192.168.100.37: icmp: echo request seq 0
22:39:41.711885 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 0
22:39:48.809249 192.168.100.250 > 192.168.100.37: icmp: echo request seq 1
22:39:48.809276 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 1
22:39:49.609254 192.168.100.250 > 192.168.100.37: icmp: echo request seq 2
22:39:49.609281 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 2
22:40:07.210211 192.168.100.250 > 192.168.100.37: icmp: echo request seq 3
22:40:07.210237 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 3
22:40:07.600214 192.168.100.250 > 192.168.100.37: icmp: echo request seq 4
22:40:07.600242 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 4
22:40:25.021156 192.168.100.250 > 192.168.100.37: icmp: echo request seq 5
22:40:25.021184 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 5
22:40:25.571182 192.168.100.250 > 192.168.100.37: icmp: echo request seq 6
22:40:25.571210 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 6
22:40:42.912132 192.168.100.250 > 192.168.100.37: icmp: echo request seq 7
22:40:42.912161 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 7
22:40:43.592142 192.168.100.250 > 192.168.100.37: icmp: echo request seq 8
22:40:43.592168 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 8
22:40:59.192976 192.168.100.250 > 192.168.100.37: icmp: echo request seq 9
22:40:59.193002 192.168.100.37 > 192.168.100.250: icmp: echo reply seq 9
---cut A---

---cut B---
PING 192.168.100.37 (192.168.100.37): 56 data bytes
64 bytes from 192.168.100.37: icmp_seq=0 ttl=255 time=53.798 ms
64 bytes from 192.168.100.37: icmp_seq=1 ttl=255 time=48.679 ms
64 bytes from 192.168.100.37: icmp_seq=2 ttl=255 time=49.832 ms
64 bytes from 192.168.100.37: icmp_seq=3 ttl=255 time=53.813 ms
64 bytes from 192.168.100.37: icmp_seq=4 ttl=255 time=54.165 ms
64 bytes from 192.168.100.37: icmp_seq=5 ttl=255 time=54.893 ms
64 bytes from 192.168.100.37: icmp_seq=6 ttl=255 time=54.293 ms
64 bytes from 192.168.100.37: icmp_seq=7 ttl=255 time=52.639 ms
64 bytes from 192.168.100.37: icmp_seq=8 ttl=255 time=54.390 ms
64 bytes from 192.168.100.37: icmp_seq=9 ttl=255 time=54.551 ms

----192.168.100.37 PING Statistics----
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 48.679/53.105/54.893/2.134 ms
---cut B---

B -> A looks like to be veery delayed.

> Well...it's a bit of a long shot, but I've seen similar problems in
> circumstances that lead me to speculate that on B, the interrupt the
> card is actually generating and the interrupt the driver is expecting
> are different.  (The dmesg, which I cut, says "irq 11"; that's what the
> driver is expecting interrupts on, so my speculation amounts to
> guessing that the card is actually interrupting on some other IRQ.)

Part of dmesg on B:

---cut---
rtk0 at pci0 dev 10 function 0: Realtek 8139 10/100BaseTX
rtk0: interrupting at irq 15
rtk0: Ethernet address 00:05:b7:00:2a:f6
ohci0 at pci0 dev 19 function 0: Compaq USB Controller (rev. 0x06)
ohci0: interrupting at irq 15
ohci0: OHCI version 1.0, legacy support
---cut---

According to BIOS output at boot time NIC is pre-configured to use IRQ 15 same 
as USB controller. Maybe shared PCI IRQs is the problem ?

> That looks rather like a reverse DNS issue.
> Try 'ping -n'

No, disabling DNS lookup dosn't make any difference.

> What mediaopts did you specify? Maybe try to play with the 'media'
> and 'mediaopt' parameters to ifconfig.
> Some NIC/Switch combination need hardwiring of media type and opts.

On A ifconfig rtk0:

---cut---
rtk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 00:20:ed:42:63:05
        media: Ethernet autoselect (100baseTX)
        status: active
        inet 192.168.100.37 netmask 0xffffff00 broadcast 192.168.100.255
---cut---

On B ifconfig rtk0:

---cut---
rtk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 00:05:b7:00:2a:f6
        media: Ethernet autoselect (100baseTX)
        status: active
        inet 192.168.100.250 netmask 0xffffff00 broadcast 192.168.100.255
---cut---

// wbr