[sctp-dev] Specifying my local address

Michael Tague tague at win.net
Sat Apr 23 00:01:49 PDT 2011


Hi,

Glad to see Java incorporating an SCTP API.

Until now we have been using the Java SCTP library with an Jini interface provided at i1.dk by Ivan Skytte Jørgensen.   It has worked well enough, but I'm glad to see an API put through the JCP.

In the past using the i1.dk library, we've had a problem that anytime we put more than one IP address on a Linux box (technically, more than one IP on our usual one Ethernet interface), the SCTP won't work.   Upon closer examination, there do appear to be some circumstances where we can make it work, but not in others.

The trouble, I think, seems to boil down to us not being able to specify which IP address we are connecting from.  The open/connect methods are all about specifying the IP address of the other end, but not of our end.  So, we can't control well the source IP address, just the destination IP address.

I've been looking at the new JDK 7 SCTP to see if maybe this is addressed.   I see where I can easily have multiple socket IP addresses on the server side, but for the other end, the .open and .connect methods do not seem to allow one to specify the source address.

I'm hoping that someone on this list can point out how to do this.

Your help would be appreciated.

Here is a concrete example of what I would like to be able to do.

I have two Linux machines, A & B, each with a single Ethernet port/interface.   I run a server on machine A with a local address of:

	A:   10.1.1.1

and I create an SCTP Socket on port 5000.   Then, on B, my addresses are:

	B:   10.2.1.1 and
	       10.2.1.2

it appears that if from machine B I do the following:

	InetSocketAddress serverAddr = new InetSocketAddress("10.1.1.1", 5000);

	SctpChannel sc = SctpChannel.open(serverAddr, 0, 0);

it will work, but machine A will most likely see the IP address of the machine B as the 1st one, 10.2.1.1.    What can I do differently to make sure that machine A believes it is being connected to from 10.2.1.2?   I hoped there would be an option to .open or .connect, or even setOption, but I don't see it.

Any help would be appreciated.

Thanks,
Michael Tague



More information about the sctp-dev mailing list