Subject: Source Address Selection on multihomed host

From: "Eng Se-Hsieng" <[email-masked]>
Date: Fri, 9 May 2003 12:13:16 +0800

Dear Brian,

Thank you for your advice on the NATs. 

I am now trying to select by which interface a message is emitted on a
multihomed host. 

The best way I can think of is to specify the source address but
modifying that in the ip header does not determine by which interface
the packet leaves.

I tried to setsockopt SOL_IP IP_PKTINFO which should allow me to specify
the interface, src address and destination address. 

In lksctp where sendmsg and recvmsg are already used, the IP_PKTINFO
behaviour is undetermined. Regardless of whether I specify the interface
index of eth0 or eth1, all the traffic is leaving through eth1.  For the
moment, I do not specify the src address ip_spec_dst and destination
address ipi_addr in the in_pktinfo structure. The man ip (7) pages are
quite confusing between src and dest addresses for this structure.

eth0 and eth1 are valid interfaces and both of their addresses are part
of the association.

Eventually, I would like to choose the src address in Randall's
reference implementation, i.e. on the raw sockets created.

Would you kindly advise if there are any fundamental problems with this
approach? i.e. does the packet follow the routing tables or cache no
matter what?? 

Is it really impossible to specify the source interface by which a
packet in the SCTP association is routed using IPv4, since it is
"destination-based"? How can one choose the src address in user space?

Thank you very much for your comments.

Regards,
Se-Hsieng

---

From: Caitlin Bestler <[email-masked]>
Date: Fri, 9 May 2003 13:06:50 -0500

On 5/9/03, Eng Se-Hsieng wrote:

>I am now trying to select by which interface a message is
>emitted on a multihomed host. 
>

The definition of "Primary Path" in RFC 2960 implies that
a source address can specify which local interface will be
used to transmit the packet.

To be totally proper, though, this is not an SCTP issue.
It is an IP issue. Unless you are performing PNAT, routing
decisions are supposed to be based only on L3 headers.

If an IP host is an IP router, it will almost certainly
route the packet based upon the destination address. Just as
though it had arrived on the interface that matches the
source address.

If an IP host is not supposed to act as a general purpose
router (a proposition I strongly endores, and I don't even
work for a company that sells routers) then the local
firewall rules should not only ensure that a given source
address will leave via a given port, they will absolutely
prevent packets with the wrong source address from leaving
via any other interface.

So check your local IP routing/firewall configuration.
There's a chance it can give you the control desired totally
independent of SCTP.

If the SCTP implementation can't be controlled by the local
firewall, then I suggest dealing with that problem first.

Caitlin Bestler
http://asomi.com/CaitlinBestler/