I have been testing the SCTP support on Java + lksctp. I wrote a simple client in order to see just the inital setup of a SCTP association which is basically the "INIT" and "INIT ACK". I have tested 2 ways for a Client to send the "INIT" to a SERVER which is basically:
create the SctpChannel object with "open(SocketAddress)"
try { InetSocketAddress socketAddress = new InetSocketAddress("192.168.52.197", 2905); SctpChannel sctpChannel = SctpChannel.open(socketAddress,1,1); sctpChannel.bind(new InetSocketAddress("192.168.1.251",2906)); sctpChannel.connect(socketAddress, 1 ,1);
so in this way, I can see in Wireshark that I have the "IPv4 Address parameter" for all my network interfaces (3 as you can see bellow), but the Source Port is getting a aleatory port number instead the 2906 as I would like to have and it's in the bind.
So... once the bind of local IP/Port is happening after the "open"... so I have changed the code to:
create the SctpChannel object which just "open()"
binding the local client IP and Port
"connect" to the remote Server IP and Port
try { InetSocketAddress socketAddress = new InetSocketAddress("192.168.52.197", 2905); SctpChannel sctpChannel = SctpChannel.open(); sctpChannel.bind(new InetSocketAddress("192.168.1.251",2906)); sctpChannel.connect(socketAddress, 1 ,1);
In this way, I can see in wireshark that Source/Destination ports are expected (2906/2905), but the INIT does not have the "IPv4 Address parameter".
So does anyone know why the 2nd code I'm missing the "IPv4 address parameter" in the INIT ? Do I miss something?
Any help would be really welcome.
Thanks.