Date: Tue, 5 Jun 2001 18:30:14 +0200 (CEST) From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/27890: FreeBSD not always seems to take the best route Message-ID: <200106051630.f55GUEt76616@curry.mchp.siemens.de>
next in thread | raw e-mail | index | archive | help
>Number: 27890 >Category: kern >Synopsis: FreeBSD not always seems to take the best route >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 05 09:40:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Andre Albsmeier >Release: FreeBSD 4.3-STABLE i386 >Organization: >Environment: System: 4.3-STABLE #67: Fri Jun 1 12:49:52 CEST 2001 >Description: I have observed this behaviour for a long time now but finally had time to dig into it... I reference syslogd as an example here but I think the problem lies in the network code of the kernel... Simple network: - two routers (1 and 2) - host C with IP 192.168.1.3 - host S with IP 192.168.2.1 All machines are FreeBSD 4.3-STABLE. Router 1 routes pkts between the Internet and 192.168.1.0 Router 2 routes pkts between 192.168.1.0 and 192.168.2.0 +-----+ +-----+ default | | 192.168.1.0 | | 192.168.2.0 -----------| 1 |--------+--------| 2 |--------+-------- more hosts | | | | | | +-----+ | +-----+ | | | +-----+ +-----+ | | | | 192.168.1.3 | C | | S | 192.168.2.1 | | | | +-----+ +-----+ Relevant parts of netstat -rn on C during normal operation: ------------------------------------------------------------- Destination Gateway Flags Netif Expire default 192.168.1.1 UGSc fxp0 127.0.0.1 127.0.0.1 UH lo0 192.168.1 link#1 UC fxp0 => 192.168.1.1 0:e0:18:90:91:bb UHLW fxp0 1182 192.168.1.2 0:e0:18:90:94:c8 UHLW fxp0 1058 192.168.1.3 0:e0:18:90:45:dc UHLW lo0 192.168.1.255 ff:ff:ff:ff:ff:ff UHLWb fxp0 192.168.2 192.168.1.2 UGc fxp0 The syslogd on host C is configured to log messages to syslogd running on host S. This works perfectly, all messages appear on host S. Now we delete the route to net 192.168.2.0 on host C (this can appear automatically if router 2 and/or its routed go down for a while). If syslogd now wants to send a message to S, the kernel uses the default route which is obvious because the route to net 192.168.2.0 is gone. We can see the packets go into router 1. I consider this as the correct behaviour as well. Now we bring back the route to net 192.168.2.0 again on host C exactly as it was before (e.g. by restarting router 2 and/or its routed). We can verify this with netstat -rn on C. We can also ping host S or telnet to it or do other stuff which all work perfectly. The problem is that each time when syslogd on C wants to send a packet to S, the kernel still uses 1 as router even though it should send them through 2. After HUPing or restarting syslogd on C (which means that the UDP socket is closed and opened again) things are back to normal. It seems that as long as packets can be send somewhere, the kernel doesn't bother if there is a better route to the destination until the socket is closed and opened again. >How-To-Repeat: See above. >Fix: Unknown. I am happy to test suggestions, of course. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106051630.f55GUEt76616>