Multihomed UDP server

Randall R. Stewart (home) randall at stewart.chicago.il.us
Thu Jan 22 08:57:07 PST 2004


Poul-Henning Kamp wrote:

>In message <20040119143315.N81347 at 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)




More information about the freebsd-net mailing list