Note that there are some explanatory texts on larger screens.

plurals
  1. POSCTP multi-homing not working as expected
    text
    copied!<p>I'm facing a problem in implementing multi-homing in SCTP as the server side. The server has 2 IPs it is listening to. I'm almost there, but there are 2 problems:</p> <ol> <li>First IP returns the INIT-ACK with 2 different IPs inside the header as it should but the other IP return twice the same IP in the INIT-ACK header.</li> <li>Seems like I’m not supporting 100 % in multi-homing, for example, if one of the links is down I don’t see a fail over.</li> </ol> <p>So I don’t know if except the setsockopt with the option SCTP_SOCKOPT_BINDX_ADD I need anything else (maybe SCTP_PRIMARY_ADDR?) or what is wrong in my implementation.</p> <p>Following is the code, I enter this code twice, first time I do bind and then save the socket and the first address, second time again bind (for the second IP) and then running setsockopt for both of the addresses and sockets.</p> <pre><code> bind(socket, &amp;sock_addr.addr.sock_addr, sock_addr_len); if(SHARED.num_used_entries_in_sockaddr_array == 0) { SHARED.saved_socket = socket; SHARED.sockaddr_array[1] = sock_addr.addr.sock_addr; } else { SHARED.sockaddr_array[0] = sock_addr.addr.sock_addr; } if(SHARED.num_used_entries_in_sockaddr_array &gt; 0) { sock_rc = setsockopt(SHARED.saved_socket, IPPROTO_SCTP, SCTP_SOCKOPT_BINDX_ADD, (char*)SHARED.sockaddr_array, sizeof(SCKOS_SOCK_ADDR)); sock_rc = setsockopt(socket, IPPROTO_SCTP, SCTP_SOCKOPT_BINDX_ADD, (char*)SHARED.sockaddr_array, sizeof(SCKOS_SOCK_ADDR)); } SHARED.num_used_entries_in_sockaddr_array++; </code></pre> <p>Thanks!!!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload