[Xorp-users] Question on supporting multiple routing tables.

Ben Greear greearb at candelatech.com
Thu Aug 9 18:17:25 PDT 2007


Pavlin Radoslavov wrote:
> Thank you for the info.
> Yes, I like the semantics of SO_BINDTODEVICE, because it simplifies
> various things, but unfortunately it is available only on Linux.
> This doesn't mean that we are definitely opposing using it, it is
> just that I wish there is a similar solution for other OS-es as
> well so we get reasonably consistent behavior.
>
> Question to Bruce: is there a similar equivalent in BSD and Windows
> userland?
>   
I'd be interested to learn if this is supported on other OSs as well.  I 
briefly looked for
something similar on Windows but didn't find anything useful...
>> I'm sure you'll want to be able to bind the socket to a local IP, but
>> if you want to leave out the SO_BINDTODEVICE I can test it and see
>> if it works.  I can add the SO_BINDTODEVICE if needed and send you a patch.
>>     
>
> Currently, we don't bind to the local IP (we do but in certain cases
> only). I believe even if you bind to a local IP you cannot really
> force the unicast IP packet to exit the system on the particular
> interface. Anyway, I might be wrong here, so please let me know if
> you find that bind()-ing only gives us the desired behavior.
>   
If you set up the routing tables and rules correctly, then binding to a 
local IP
is probably sufficient.  If you are certain that you want the pkt to 
leave by a certain
interface, then I don't think it can ever hurt to bind to that local IP, 
but just in case,
it could also be a config option...
> BTW, what protocols are you planning to run? Without SO_BINDTODEVICE
> we might have to use different solution for each type of
> sockets/packets: raw IP packets, TCP, UDP.
> FYI, the I/O system-specific stuff is inside fea/data_plane/io,
> though io_tcpudp_socket.cc itself uses the xorp/libcomm wrapper
> library.
> BGP only doesn't use the FEA (yet) and does its own TCP connection
> (inside bgp/socket.{hh,cc}).
>
> Also, there could be some gotchas with RIP's UDP socket, but lets
> address first the protocols you are actually going to use.
>   
At a minimum, I want to support OSPF.  However, I'd like to have options to
do other protocols as well.  In my own experience, binding UDP is very 
similar
to binding TCP, but if you want some sample code I can post it.  I'm not 
sure
about raw IP packets.

Also, for my application, it will always be running on Linux, so I can 
depend on
SO_BINDTODEVICE being available...

Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com> 
Candela Technologies Inc  http://www.candelatech.com




More information about the Xorp-users mailing list