pespin has submitted this change. (
https://gerrit.osmocom.org/c/libosmo-sigtran/+/40501?usp=email )
(
6 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: asp: Support Tx DAUD when ASP becomes activated
......................................................................
asp: Support Tx DAUD when ASP becomes activated
Otherwise the local Signalling Point has no way to know whether the
remote Signalling Points it wants to talk to are actually already
connected to the STP when it becomes active after the process starts
up, unless it attempts to transmit a message to it.
This pocedure is documented both for M3UA and SUA:
* RFC4666 4.6, RFC3868 4.6
* RFC4666 4.5.3, RFC3868 4.5.3 "ASP Auditing"
* RFC4666 5.5.1.1.3 "Support for ASP Querying of SS7 Destination States"
The M3UA specs (RFC4666 5.5.1.1.3) explicitly state that the point codes to audit are not
to be provided by uppers layers, so picking the ones from the locally
configured address book for now:
"""
Note: there is no primitive for the
MTP3-User to request this audit from the M3UA layer, as this is
initiated by an internal M3UA management function.
"""
This is not enabled by default since it's optional according to specs,
and some SGs may actually return errors (it's possible according to
RFC4666 to deny access to auditing by the SG).
Related: OS#5917
Related: SYS#7501
Change-Id: I7c8c5099d4d00ea6f4a8db59ed6b833fb0ffa43d
---
M src/ss7_asp.h
M src/ss7_asp_vty.c
M src/xua_asp_fsm.c
M tests/vty/osmo_stp_test.vty
4 files changed, 120 insertions(+), 17 deletions(-)
Approvals:
fixeria: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/ss7_asp.h b/src/ss7_asp.h
index 6bc0201..ec74e82 100644
--- a/src/ss7_asp.h
+++ b/src/ss7_asp.h
@@ -113,6 +113,9 @@
uint8_t qos_class;
uint32_t quirks;
+ /* Whether to Tx xUA DAUD during ASP activation when in ASP role. */
+ bool daud_act;
+
/* T_defs used by the default_lm: */
struct osmo_tdef *T_defs_xua;
diff --git a/src/ss7_asp_vty.c b/src/ss7_asp_vty.c
index 0c79b0f..c69b66b 100644
--- a/src/ss7_asp_vty.c
+++ b/src/ss7_asp_vty.c
@@ -548,6 +548,36 @@
return CMD_SUCCESS;
}
+/* TODO: "destination-audit periodic <time_inteval(s)>" See M3UA RFC4666
4.5.3 "Periodic". */
+DEFUN_ATTR(asp_destination_audit_asp_active, asp_destination_audit_asp_active_cmd,
+ "destination-audit asp-active",
+ "Configure ASP Auditing (xUA DAUD)\n"
+ "Transmit DAUD after ASP successful activate (for remote PCs in sccp
address-book)\n",
+ CMD_ATTR_NODE_EXIT)
+{
+ struct osmo_ss7_asp *asp = vty->index;
+
+ if (asp->cfg.role != OSMO_SS7_ASP_ROLE_ASP) {
+ vty_out(vty, "%% 'destination-audit' only possible in role ASP!%s",
VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ asp->cfg.daud_act = true;
+ return CMD_SUCCESS;
+}
+
+DEFUN_ATTR(asp_no_destination_audit_asp_active, asp_no_destination_audit_asp_active_cmd,
+ "no destination-audit asp-active",
+ NO_STR "Configure ASP Auditing (xUA DAUD)\n"
+ "Transmit xUA DAUD after ASP successful activate (for remote PCs in sccp
address-book)\n",
+ CMD_ATTR_NODE_EXIT)
+{
+ struct osmo_ss7_asp *asp = vty->index;
+
+ asp->cfg.daud_act = false;
+ return CMD_SUCCESS;
+}
+
DEFUN_ATTR(asp_block, asp_block_cmd,
"block",
"Allows a SCTP Association with ASP, but doesn't let it become
active\n",
@@ -1259,6 +1289,9 @@
if (asp->cfg.tcp.user_timeout_present)
vty_out(vty, " tcp-param user-timeout %u%s",
asp->cfg.tcp.user_timeout_value, VTY_NEWLINE);
+ if (asp->cfg.daud_act)
+ vty_out(vty, " destination-audit asp-active%s", VTY_NEWLINE);
+
for (i = 0; i < sizeof(uint32_t) * 8; i++) {
if (!(asp->cfg.quirks & ((uint32_t) 1 << i)))
continue;
@@ -1350,6 +1383,8 @@
install_lib_element(L_CS7_ASP_NODE, &asp_no_tcp_param_keepalive_cfg_cmd);
install_lib_element(L_CS7_ASP_NODE, &asp_tcp_param_user_timeout_cmd);
install_lib_element(L_CS7_ASP_NODE, &asp_no_tcp_param_user_timeout_cmd);
+ install_lib_element(L_CS7_ASP_NODE, &asp_destination_audit_asp_active_cmd);
+ install_lib_element(L_CS7_ASP_NODE, &asp_no_destination_audit_asp_active_cmd);
install_lib_element(L_CS7_ASP_NODE, &asp_quirk_cmd);
install_lib_element(L_CS7_ASP_NODE, &asp_no_quirk_cmd);
gen_asp_timer_xua_cmd_strs(&asp_timer_xua_cmd);
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index b7c6947..8000839 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -31,6 +31,7 @@
#include "ss7_asp.h"
#include "ss7_internal.h"
#include "ss7_xua_srv.h"
+#include "sccp_internal.h"
#include "xua_asp_fsm.h"
#include "xua_as_fsm.h"
#include "xua_internal.h"
@@ -146,6 +147,54 @@
xua_asp_send_xlm_prim_simple(asp, prim_type, op);
}
+static void xua_asp_tx_snm_daud_address_book(struct osmo_ss7_asp *asp)
+{
+ struct osmo_ss7_instance *inst = asp->inst;
+ uint32_t rctx[OSMO_SS7_MAX_RCTX_COUNT];
+ unsigned int num_rctx;
+ uint32_t *aff_pc = NULL;
+ unsigned int num_aff_pc = 0;
+ struct osmo_sccp_addr_entry *entry;
+
+ num_rctx = ss7_asp_get_all_rctx_be(asp, rctx, ARRAY_SIZE(rctx), NULL);
+
+ /* First count required size of num_aff_pc array: */
+ llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) {
+ if (!(entry->addr.presence & OSMO_SCCP_ADDR_T_PC))
+ continue;
+ if (osmo_ss7_pc_is_local(inst, entry->addr.pc))
+ continue;
+ num_aff_pc++;
+ }
+ if (num_aff_pc == 0) {
+ LOGPASP(asp, DLSS7, LOGL_NOTICE, "Skip Tx DAUD: No SCCP in address book\n");
+ return;
+ }
+ aff_pc = talloc_array(asp, uint32_t, num_aff_pc);
+ OSMO_ASSERT(aff_pc);
+
+ num_aff_pc = 0;
+ llist_for_each_entry(entry, &inst->cfg.sccp_address_book, list) {
+ uint32_t curr_aff_pc;
+ unsigned int i;
+ if (!(entry->addr.presence & OSMO_SCCP_ADDR_T_PC))
+ continue;
+ if (osmo_ss7_pc_is_local(inst, entry->addr.pc))
+ continue;
+ LOGPASP(asp, DLSS7, LOGL_DEBUG, "Tx DAUD: Requesting status of DPC=%u=%s\n",
+ entry->addr.pc, osmo_ss7_pointcode_print2(inst, entry->addr.pc));
+ curr_aff_pc = htonl(entry->addr.pc); /* mask = 0 */
+ for (i = 0; i < num_aff_pc; i++)
+ if (aff_pc[i] == curr_aff_pc)
+ break;
+ if (i == num_aff_pc) /* not found in array */
+ aff_pc[num_aff_pc++] = curr_aff_pc;
+ }
+
+ xua_tx_snm_daud(asp, rctx, num_rctx, aff_pc, num_aff_pc,
"Isolation-ASP-ACTIVE");
+ talloc_free(aff_pc);
+}
+
/* determine the osmo_ss7_as_traffic_mode to be used by this ASP; will
* iterate over all AS configured for this ASP. If they're compatible,
* a single traffic mode is returned as enum osmo_ss7_as_traffic_mode.
@@ -699,6 +748,18 @@
struct xua_asp_fsm_priv *xafp = fi->priv;
struct osmo_ss7_asp *asp = xafp->asp;
+ if (asp->cfg.role == OSMO_SS7_ASP_ROLE_ASP && asp->cfg.daud_act) {
+ /* RFC4666 4.6, RFC3868 4.6: "The ASP MAY choose to audit the availability
+ * of unavailable destinations by sending DAUD messages.
+ * This would be the case when, for example, an AS becomes active at an ASP
+ * and does not have current destination statuses."
+ * See also RFC4666 4.5.3, RFC3868 4.5.3 "ASP Auditing".
+ * See also RFC4666 5.5.1.1.3 "Support for ASP Querying of SS7 Destination
States"
+ */
+ LOGPFSML(fi, LOGL_INFO, "Tx DAUD\n");
+ xua_asp_tx_snm_daud_address_book(asp);
+ }
+
dispatch_to_all_as(fi, XUA_ASPAS_ASP_ACTIVE_IND, asp);
}
diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty
index a253c5a..0d6ffff 100644
--- a/tests/vty/osmo_stp_test.vty
+++ b/tests/vty/osmo_stp_test.vty
@@ -289,6 +289,8 @@
no tcp-param keepalive (time|intvl|probes)
tcp-param user-timeout <0-65535>
no tcp-param user-timeout
+ destination-audit asp-active
+ no destination-audit asp-active
quirk (no_notify|daud_in_asp|snm_inactive)
no quirk (no_notify|daud_in_asp|snm_inactive)
timer xua (ack|beat) <1-999999>
@@ -300,27 +302,29 @@
OsmoSTP(config-cs7-asp)# ?
...
- description Save human-readable description of the object
- remote-ip Specify Remote IP Address of ASP
- no Negate a command or set its defaults
- local-ip Specify Local IP Address from which to contact ASP
- qos-class Specify QoS Class of ASP
- role Specify the xUA role for this ASP
- transport-role Specify the transport layer role for this ASP
- sctp-param Configure SCTP parameters
- tcp-param Configure TCP parameters
- quirk Enable quirk to work around interop issues
- timer Configure ASP default timer values
- block Allows a SCTP Association with ASP, but doesn't let it become
active
- shutdown Terminates SCTP association; New associations will be rejected
+ description Save human-readable description of the object
+ remote-ip Specify Remote IP Address of ASP
+ no Negate a command or set its defaults
+ local-ip Specify Local IP Address from which to contact ASP
+ qos-class Specify QoS Class of ASP
+ role Specify the xUA role for this ASP
+ transport-role Specify the transport layer role for this ASP
+ sctp-param Configure SCTP parameters
+ tcp-param Configure TCP parameters
+ destination-audit Configure ASP Auditing (xUA DAUD)
+ quirk Enable quirk to work around interop issues
+ timer Configure ASP default timer values
+ block Allows a SCTP Association with ASP, but doesn't let it become
active
+ shutdown Terminates SCTP association; New associations will be rejected
...
OsmoSTP(config-cs7-asp)# no ?
...
- sctp-param Configure SCTP parameters
- tcp-param Configure TCP parameters
- quirk Disable quirk to work around interop issues
- shutdown Terminates SCTP association; New associations will be rejected
+ sctp-param Configure SCTP parameters
+ tcp-param Configure TCP parameters
+ destination-audit Configure ASP Auditing (xUA DAUD)
+ quirk Disable quirk to work around interop issues
+ shutdown Terminates SCTP association; New associations will be rejected
...
OsmoSTP(config-cs7-asp)# remote-ip 127.0.0.200
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/40501?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I7c8c5099d4d00ea6f4a8db59ed6b833fb0ffa43d
Gerrit-Change-Number: 40501
Gerrit-PatchSet: 7
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>