multiple associations on same local IP

39 views
Skip to first unread message

Ruapehu

unread,
Jan 17, 2018, 6:37:01 AM1/17/18
to mobicents-public
Hi guys,
I am trying to connect gmlc with HLR using M3UA/SCTP.
HLR has multiple IP addresses on their side.
Locally I have only 1 IP address for gmlc.
Doing this:
sctp association create stp1_assoc1 CLIENT <remote_ip1> 2905 <local_ip1> 2905 sockettype SCTP
sctp association create stp1_assoc2 CLIENT <remote_ip2> 2905 <local_ip1> 2906 sockettype SCTP

Associations are created successfully.
However gmlc is complaining in the logs:

13:12:23,869 ERROR [AssociationImpl] (Thread-37) Error while initiating a connection

java.net.BindException: Address already in use

at sun.nio.ch.Net.bind0(Native Method)

at sun.nio.ch.Net.bind(Net.java:463)

at sun.nio.ch.Net.bind(Net.java:455)

at sun.nio.ch.SctpChannelImpl.bind(SctpChannelImpl.java:187)

at org.mobicents.protocols.sctp.AssociationImpl.doInitiateConnectionSctp(AssociationImpl.java:779)

at org.mobicents.protocols.sctp.AssociationImpl.initiateConnection(AssociationImpl.java:745)

at org.mobicents.protocols.sctp.SelectorThread.run(SelectorThread.java:121)

at java.lang.Thread.run(Thread.java:748)




Does it mean I cannot use the same local IP address and different ports for many associations?

gmlc was installed from master branch back in July 2017.

Appreciate your help in advance.



Ibrahima Gaye

unread,
Jan 17, 2018, 6:48:07 AM1/17/18
to mobicent...@googlegroups.com, restcomm
Hi,
you can test if it's really REALLY related to that usage by just using one command and restart. If it works then try with the other command.
If it's confirmed then you can confirm it's related to "multiple associations on same local IP"

PS: most of the time what we think is the cause is not really the cause so to save time first need to confirm it's really the cause.

Best regards,

Ibrahima GAYE,

Senior OSS/BSS Support & Project Management 

Technologies Integration Specialist


--
You received this message because you are subscribed to the Google Groups "mobicents-public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobicents-public+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobicents-public/afd21600-33a4-4fb2-bb6c-61fc3335deb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruapehu

unread,
Jan 17, 2018, 8:54:32 AM1/17/18
to mobicents-public
apologies, the problem turned out to be actually caused by a kernel bug, this one:

Red Hat Enterprise Linux 6.8 and above
Red Hat Enterprise Linux 7
SCTP
Вопрос
SCTP application says "Address already in use" or EADDRINUSE
An SCTP client connects to a server. The SCTP handshake of INIT, INIT_ACK, COOKIE_ECHO, COOKIE_ACK, DATA, ACK works fine. The server sends SHUTDOWN and the client cannot connect to the server again.
Решение
For RHEL 7, update to kernel 3.10.0-514.6.1.el7 to avoid this issue.

As a workaround in RHEL 6, set address reuse (SO_REUSEADDR socket option) on the client.

Причина
The SCTP patchset below caused a problem where a sock can end up in an unexpected state after SCTP SHUTDOWN. This is a race condition which may occur if SCTP is attempting to send a chunk at the exact moment a SHUTDOWN is received. References to the sock are torn down but the sock itself still exists. This means future attempts to bind to this socket will fail unless SO_REUSEADDR is set. The only other workaround is to reboot.

Raw
Patchset [0/2] fix the issue "kernel BUG at net/sctp/sm_make_chunk.c:1396"
    [net] sctp: hold the chunks only after the chunk is enqueued in outq
    [net] sctp: only drop the reference on the datamsg after sending a msg
RHEL 7 kernel 3.10.0-514.6.1.el7 includes a more recent patchset which resolves the issue. As of January 2017 this patchset is not present in any available RHEL 6 kernel. Due to the complexity of this patchset and RHEL 6's position in the Product Life Cycle there are no current plans to address this in RHEL 6. Please open a case with Red Hat Technical Support if you believe you are experiencing this issue.

Raw
sctp: fix the transmit err process
  sctp: remove the unnecessary state check in sctp_outq_tail
  sctp: do not return the transmit err back to sctp_sendmsg
  sctp: free msg->chunks when sctp_primitive_SEND return err
  sctp: save transmit error to sk_err in sctp_outq_flush
  sctp: make sctp_outq_flush/tail/uncork return void
  sctp: not return ENOMEM err back in sctp_packet_transmit
For the workaround, man 7 socket:

Raw
       SO_REUSEADDR
              Indicates that the rules used in validating addresses supplied in
              a bind(2) call should allow reuse of local addresses. For AF_INET
              sockets this means that a socket may bind, except when there is
              an active listening socket bound to the address. When the
              listening socket is bound to INADDR_ANY with a specific port then
              it is not possible to bind to this port for any local address.
              Argument is an integer boolean flag.

After linux kernel was patched, the problem is gone.
To unsubscribe from this group and stop receiving emails from it, send an email to mobicents-publ...@googlegroups.com.

Ibrahima Gaye

unread,
Jan 17, 2018, 9:04:15 AM1/17/18
to mobicent...@googlegroups.com
so nice :)
Troubleshooting rule: Always find a method to confirm what is said in the error message.

Ibrahima GAYE,

Senior OSS/BSS Support & Project Management 

Technologies Integration Specialist



To unsubscribe from this group and stop receiving emails from it, send an email to mobicents-public+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobicents-public/304d7d6f-97a1-45aa-bf5c-0c8fe89c3071%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages