# SCTP connection reset after about 5 seconds



## Annemarie (Feb 23, 2015)

After opening a one-to-one sctp connection between 2 FreeBSD 8.3 units using socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP) sctp_sendmsg/sctp_recvmsg works for about 5 seconds before returning _Connection Reset by Peer_.

If the connection is opened, but no messages are send, the connection is closed after about 48 seconds. A call to getsockopt(SCTP_AUTOCLOSE) returns 0, which means the connection should never auto close. Also auto close should not occur on a one-to-one connection.

Could the connection reset be caused by an address event or a heartbeat interval (although both should not be happening in a one-to-one connection)?


----------



## Annemarie (Mar 24, 2015)

The solution is interesting. The SCTP connection is made on em0. The units also have a msk0 interface which were not connected and both units had the same IP address for this interface. When changing the IPs on the msk0 interface to be different, the connection reset by peer of the SCTP connection on the em0 interface disappeared. Making them the same again and the problem is back. Why would the IP addresses on another interface have an influence on a SCTP connection?


----------

