Project

General

Profile

Actions

Feature #6077

closed

Dynamic reconfiguration of SCTP IP addresses & primary flag in an active SCTP association through VTY

Added by pespin about 1 year ago. Updated 10 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
06/28/2023
Due date:
% Done:

100%

Spec Reference:

Description

Right now, libosmo-sccp allows configuring several "local-ip" and several "remote-ip" which will be used during SCTP association setup (socket(), sctp_bindx(), sctp_connectx(), 3-way handhsake, etc.).
It will eventually also support specifying the "primary" local & remote IP addresses, as described in #6076.

local-ip:

SCTP also supports dynamic addition and removal of IP addresses locally as well as announcing those changes to the peer, as per what's described in RFC5061, using the ASCONF/ASCONF-ACK messages.
The linux kernel seems to be implementing those SCTP messages/procedures on the wire.
Furthermore, the kernel allows adding and removing IP addresses on an already created association by using setsockopt(SCTP_SOCKOPT_BINDX_ADD|SCTP_SOCKOPT_BINDX_REM).
These kernel sockopts are used internally by libsctp, which is expected to be used through sctp_bindx() (/usr/include/netinet/sctp.h):

       int sctp_bindx(int sd, struct sockaddr * addrs, int addrcnt,
                      int flags);
       The  flags parameter can be either SCTP_BINDX_ADD_ADDR or SCTP_BINDX_REM_ADDR.  An application can use SCTP_BINDX_ADD_ADDR to associate additional ad‐
       dresses with an endpoint after calling bind(2).  SCTP_BINDX_REM_ADDR directs SCTP to remove the given addresses from the association.   A  caller  may
       not remove all addresses from an association. It will fail with EINVAL.

Hence, if the asociation for the related "asp" is already connected (socket created), extra work is done:
  • if "no local-ip A.B.C.D" is used, "sctp_bindx(fd, addr, 1, SCTP_BINDX_REM_ADDR);" is called (after checking the addr is in the list)
  • if "local-ip A.B.C.D" is used:
    • If the IP address is not in the list, "sctp_bindx(fd, addr, 1, SCTP_BINDX_ADD_ADDR);" is called.
  • if "local-ip A.B.C.D primary" is used:
    • If the IP address is not in the list, "sctp_bindx(fd, addr, 1, SCTP_BINDX_ADD_ADDR);" is as the primary flag is applied (setsockopt(SCTP_SET_PEER_PRIMARY_ADDR)).
    • If the IP address is in the list, the primary flag is applied (setsockopt(SCTP_SET_PEER_PRIMARY_ADDR)).

remote-ip:

- In here changing the IP address doesn't make much sense since the remote-ip configured is only really used to do the initial 3-way handshake. Once connected, the SCTP association uses the remote address list received in INIT/INIT-ACK.
- Setting the primary flag calls (setsockopt(SCTP_SET_PRIMARY_ADDR).

Related RFCs:
https://datatracker.ietf.org/doc/html/rfc4960
https://www.rfc-editor.org/rfc/rfc5061


Related issues

Related to libosmo-sccp + libosmo-sigtran - Feature #6076: Configure SCTP primary path explicitly (local-ip A.B.C.D [primary] && remote-ip A.B.C.D [primary])Resolvedpespin06/28/2023

Actions
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)