Date: Mon, 19 Jan 2004 06:13:25 -0600 From: "Randall R. Stewart (home)" <randall@stewart.chicago.il.us> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: net@freebsd.org Subject: Re: Multihomed UDP server Message-ID: <400BC9E5.8010609@stewart.chicago.il.us> In-Reply-To: <92245.1074513480@critter.freebsd.dk> References: <92245.1074513480@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote: >In message <20040119143315.N81347@news1.macomnet.ru>, Maxim Konovalov writes: > > >>On Mon, 19 Jan 2004, 12:07+0100, Poul-Henning Kamp wrote: >> >> >> >>>Simple question: >>> >>>Very simple UDP server daemon. >>> >>>Many clients (connect(2)'ing a socket for each is not an option) >>> >>>Multihomed machine. >>> >>>What's the simple trick to replying with the same source-IP as the >>>client used as destination-IP ? >>> >>> >>Probably bin/58012 worth to look (Multihomed tftpd enhancement). Yes, >>it relies on protocol but still. >> >> > >But that's not a general solution, and it certainly doesn't solve >the problem for my application. > >I'm considering ways to make sendmsg(2)/recvmsg(2) DTRT, and my >current candidate is give them a flag bit which says "msg_name has >both addresses". > > > Poul: One of the problems I think that is fundamental to BSD and multi-homing is the lack of supports for multiple-default routes. And even in O/S's that do support multiple default routes (aka Linux and winXP) they really don't deal with them correctly... If you have multiple default gateways (which you probably do if your multi-homed) what you really would like to do is use both of them. One way to do that, that would aid TCP (which probably does not help you) is to have built into the routing system a way to allocate a alternate route... That way when TCP starts hitting RTX-Timeouts it could do something like: newroute = rtalloc_alt(dst, tcb->old_rt); if ( newroute != tcb->old_rt && newroute) { RT_FREE(tcb->old_rt); tcb->old_rt = newroute } Now for TCP this would mean a more robust use of a multi-homed host.. For your situation you COULD use something like that but UDP would have to do a heck of a lot more than it currently does with routing .. which I think is zilch right now :--0 sigh... someday BSD's will decide to better support M-Homing.. for now hacks are appropriate :-/ R -- Randall R. Stewart 815-477-2127 (office) 815-342-5222 (cell phone)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?400BC9E5.8010609>