From owner-freebsd-hackers Fri Jan 24 09:04:44 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id JAA07369 for hackers-outgoing; Fri, 24 Jan 1997 09:04:44 -0800 (PST) Received: from smyrno.sol.net (smyrno.sol.net [206.55.64.117]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA07364 for ; Fri, 24 Jan 1997 09:04:41 -0800 (PST) Received: from solaria.sol.net (solaria.sol.net [206.55.65.75]) by smyrno.sol.net (8.8.3/8.8.3) with SMTP id LAA01939; Fri, 24 Jan 1997 11:04:32 -0600 (CST) Received: from localhost by solaria.sol.net (8.5/8.5) id LAA28841; Fri, 24 Jan 1997 11:04:30 -0600 From: Joe Greco Message-Id: <199701241704.LAA28841@solaria.sol.net> Subject: Re: Fault-tolerant network with 2 ethernets To: jdp@polstra.com (jgfbsd) Date: Fri, 24 Jan 97 11:04:28 CST Cc: hackers@freebsd.org In-Reply-To: <199701222351.PAA04715@austin.polstra.com> from "jgfbsd" at Jan 24, 97 10:55:50 am X-Mailer: ELM [version 2.4dev PL65] MIME-Version: 1.0 Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > This is probably a routing 101 question. But I've never had to do much > with routing, so I could use some advice. :-) > A client wants a fault-tolerant LAN setup like this: > > ethernet A (100BaseT) > ---+------+------+------+------+------+--- > | | | | | | > host host host host host host > | | | | | | > ---+------+------+------+------+------+--- > ethernet B (100BaseT) > > The goal is that either ethernet could go down, yet all the hosts could > still talk to each other. Or, one of the ethernet cards on a host could > go down, and it could still talk to all the other hosts. In either > case, it has to happen automatically, without manual intervention. Load > balancing isn't a goal, just fault-tolerance. > > At first I was hoping that routed could do this for me, without > the applications even being aware of it. But now I'm not so sure. > Each ethernet will have to have its own IP network number (right?), > and so each host will have to have 2 IP addresses. A given packet > will be addressed to only a single IP address, and that implies > it's headed for a particular ethernet. If that ethernet is down, > all addresses on it are down, and the packet won't be delivered > no matter what routed does. > > Is this analysis correct? Is there a simple way to get what I want? > How about a non-simple way? Hi, You are talking about something that I've been working on for a long time, because I'm paranoid, I've experienced failures, and I hate single points of failure. You have a problem because you can legitimately run dual ethernets, but each is addressed differently. So when your application connects to "box1", with IP addresses a.b.1.1 and a.b.2.1, it randomly picks one address (maybe a.b.1.1). So you are now bound to that interface, and if the interface, wire, or hub goes away, you are toast. You can get around that by putting a virtual interface on each machine (maybe an alias for the loopback device, or a separate lo1 interface) and numbering it uniquely (a.b.3.1). Now, if you are real careful, you make sure all your applications bind to this address. In particular, when you open a socket, make sure that you are bound to your local "virtual" interface. Otherwise the kernel will conveniently wire you down to a real one, which defeats all of this. Now you are bound, on each end, to interfaces that are (theoretically) 100% reliable. Enable packet forwarding, and use OSPF to fill in the holes. OSPF will allow you to route to your hearts content even through a very broken network, as long as a path exists. I'm not sure how easy it would be to make a third-party application "network-independent" in this manner. You could do it, of course, with a modified shared libc. I hope this covers your question, it's the only "true" solution I know of, and I hope my answer is clear. ;-) Drop me a line if not. ... Joe ------------------------------------------------------------------------------- Joe Greco - Systems Administrator jgreco@ns.sol.net Solaria Public Access UNIX - Milwaukee, WI 414/342-4847