pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/40710?usp=email )
Change subject: sccp: Handle N-NOTICE.ind (Routing Failure of SCCP CL messages)
......................................................................
sccp: Handle N-NOTICE.ind (Routing Failure of SCCP CL messages)
ITU Q.714 2.8:
"""
When an end node is informed of a routing failure, this information
is forwarded towards the SCCP user by using the N-DISCONNECT primitive
(refer to reason for release in 2.1.1.2.4/Q.711) or the N-NOTICE primitive
(refer to reason for return in 2.2.2.2.4/Q.711)
"""
We are already handling N-DISCONNECT.ind for CO messages, but
N-NOTICE.ind for CL messages was not being handled.
If CL messages are not arriving to the RAN peer, then reset the link
and mark the peer as disconnected, until a new RESET can successfully fo
through.
Change-Id: Iddd10c8f97310b600374ff0141ea06e03087da8f
Related: OS#5917
---
M src/libmsc/sccp_ran.c
1 file changed, 35 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/10/40710/1
diff --git a/src/libmsc/sccp_ran.c b/src/libmsc/sccp_ran.c
index 71d250e..bc3d659 100644
--- a/src/libmsc/sccp_ran.c
+++ b/src/libmsc/sccp_ran.c
@@ -60,6 +60,36 @@
return sri;
}
+static void handle_notice_ind(struct sccp_ran_inst *sri, const struct osmo_scu_notice_param *ni)
+{
+ struct ran_peer *rp;
+
+ rp = ran_peer_find_by_addr(sri, &ni->calling_addr);
+ if (!rp) {
+ LOGP(DMSC, LOGL_DEBUG, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u didn't match any ran_peer, ignoring\n",
+ osmo_sccp_addr_dump(&ni->calling_addr),
+ ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->importance);
+ return;
+ }
+
+ LOG_RAN_PEER(rp, LOGL_NOTICE, "N-NOTICE.ind cause=%u='%s' importance=%u\n",
+ ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->importance);
+
+ switch (ni->cause) {
+ case SCCP_RETURN_CAUSE_SUBSYSTEM_CONGESTION:
+ case SCCP_RETURN_CAUSE_NETWORK_CONGESTION:
+ /* Transient failures (hopefully), keep going. */
+ return;
+ default:
+ break;
+ }
+
+ /* Messages are not arriving to ran_peer. Signal it is unavailable to update local state. */
+ osmo_fsm_inst_dispatch(rp->fi, RAN_PEER_EV_UNAVAILABLE, NULL);
+}
+
static void handle_pcstate_ind(struct sccp_ran_inst *sri, const struct osmo_scu_pcstate_param *pcst)
{
struct osmo_ss7_instance *cs7 = osmo_sccp_get_ss7(sri->sccp);
@@ -232,6 +262,11 @@
rc = sri->ran->sccp_ran_ops.up_l2(sri, peer_addr, false, 0, oph->msg);
break;
+ case OSMO_PRIM(OSMO_SCU_PRIM_N_NOTICE, PRIM_OP_INDICATION):
+ handle_notice_ind(sri, &prim->u.notice);
+ rc = 0;
+ break;
+
case OSMO_PRIM(OSMO_SCU_PRIM_N_PCSTATE, PRIM_OP_INDICATION):
handle_pcstate_ind(sri, &prim->u.pcstate);
rc = 0;
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/40710?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Iddd10c8f97310b600374ff0141ea06e03087da8f
Gerrit-Change-Number: 40710
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/40704?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: sigtran: Avoid potential uninitialized ptr dereference
......................................................................
sigtran: Avoid potential uninitialized ptr dereference
Use osmo_sccp_addr_dump() instead of osmo_sccp_addr_name(), since msc
may be uninitialized and hence ss7 may not be available.
Change-Id: I682567e88f61c9ec3cfa25c50f2c12fc9d1f6e4f
---
M src/osmo-bsc/osmo_bsc_sigtran.c
1 file changed, 2 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/04/40704/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/40704?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I682567e88f61c9ec3cfa25c50f2c12fc9d1f6e4f
Gerrit-Change-Number: 40704
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/40708?usp=email )
Change subject: iu_client: Initial N-NOTICE.ind support (Routing Failure of SCCP CL messages)
......................................................................
iu_client: Initial N-NOTICE.ind support (Routing Failure of SCCP CL messages)
ITU Q.714 2.8:
"""
When an end node is informed of a routing failure, this information
is forwarded towards the SCCP user by using the N-DISCONNECT primitive
(refer to reason for release in 2.1.1.2.4/Q.711) or the N-NOTICE primitive
(refer to reason for return in 2.2.2.2.4/Q.711)
"""
We are already handling N-DISCONNECT.ind for CO messages, but
N-NOTICE.ind for CL messages was not being handled.
If CL messages are not arriving to the peer (rnc), then reset the link
and mark the peer as disconnected, until a new RESET can successfully fo
through.
There's currently no way to submit the indication to upper layers (app).
It's not worth changing the API now since anyway sole user of this API
(osmo-sgsn) will actually merged the implementation directly and get rid
of this layer at some point.
Related: OS#5487
Related: OS#3403
Related: OS#5917
Change-Id: Ifc59cdcb9ef910274b0580e9baba2b3a7b5e5354
---
M src/iu_client.c
1 file changed, 44 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/08/40708/1
diff --git a/src/iu_client.c b/src/iu_client.c
index 75be457..e1b7af3 100644
--- a/src/iu_client.c
+++ b/src/iu_client.c
@@ -35,6 +35,7 @@
#include <osmocom/gprs/gprs_msgb.h>
#include <osmocom/sigtran/sccp_sap.h>
#include <osmocom/sigtran/sccp_helpers.h>
+#include <osmocom/sccp/sccp_types.h>
#include <osmocom/ranap/ranap_common_cn.h>
#include <osmocom/ranap/ranap_ies_defs.h>
#include <osmocom/ranap/ranap_msg_factory.h>
@@ -1017,6 +1018,44 @@
ranap_iu_free_ue(ue);
}
+static void handle_notice_ind(struct osmo_ss7_instance *cs7, const struct osmo_scu_notice_param *ni)
+{
+ struct ranap_iu_rnc *rnc;
+
+ LOGPIU(LOGL_DEBUG, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u\n",
+ osmo_sccp_addr_dump(&ni->calling_addr),
+ ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->importance);
+
+ switch (ni->cause) {
+ case SCCP_RETURN_CAUSE_SUBSYSTEM_CONGESTION:
+ case SCCP_RETURN_CAUSE_NETWORK_CONGESTION:
+ /* Transient failures (hopefully), keep going. */
+ return;
+ default:
+ break;
+ }
+
+ /* Messages are not arriving to RNC. Signal to user that all related ue_ctx are invalid. */
+ llist_for_each_entry(rnc, &rnc_list, entry) {
+ struct ranap_ue_conn_ctx *ue_ctx, *ue_ctx_tmp;
+ if (osmo_sccp_addr_ri_cmp(&rnc->sccp_addr, &ni->calling_addr))
+ continue;
+ LOGPIU(LOGL_NOTICE,
+ "RNC %s now unreachable: N-NOTICE.ind cause=%u='%s' importance=%u\n",
+ osmo_rnc_id_name(&rnc->rnc_id),
+ ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->importance);
+ llist_for_each_entry_safe(ue_ctx, ue_ctx_tmp, &ue_conn_ctx_list, list) {
+ if (ue_ctx->rnc != rnc)
+ continue;
+ ue_ctx_link_invalidated_free(ue_ctx);
+ }
+ /* TODO: ideally we'd have some event to submit to upper
+ * layer to inform about peer availability change... */
+ }
+}
+
static void handle_pcstate_ind(struct osmo_ss7_instance *cs7, const struct osmo_scu_pcstate_param *pcst)
{
struct osmo_sccp_addr rem_addr;
@@ -1209,6 +1248,11 @@
osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
rc = ranap_cn_rx_cl(cn_ranap_handle_cl, prim, msgb_l2(oph->msg), msgb_l2len(oph->msg));
break;
+ case OSMO_PRIM(OSMO_SCU_PRIM_N_NOTICE, PRIM_OP_INDICATION):
+ LOGPIU(LOGL_DEBUG, "N-NOTICE.ind(%s)\n",
+ osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+ handle_notice_ind(osmo_sccp_get_ss7(sccp), &prim->u.notice);
+ break;
case OSMO_PRIM(OSMO_SCU_PRIM_N_PCSTATE, PRIM_OP_INDICATION):
handle_pcstate_ind(osmo_sccp_get_ss7(sccp), &prim->u.pcstate);
break;
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/40708?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Ifc59cdcb9ef910274b0580e9baba2b3a7b5e5354
Gerrit-Change-Number: 40708
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: daniel, fixeria, laforge, osmith, pespin.
Hello Jenkins Builder, daniel, fixeria, laforge, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/40706?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: sccp: Handle N-NOTICE.ind (Routing Failure of SCCP CL messages)
......................................................................
sccp: Handle N-NOTICE.ind (Routing Failure of SCCP CL messages)
ITU Q.714 2.8:
"""
When an end node is informed of a routing failure, this information
is forwarded towards the SCCP user by using the N-DISCONNECT primitive
(refer to reason for release in 2.1.1.2.4/Q.711) or the N-NOTICE primitive
(refer to reason for return in 2.2.2.2.4/Q.711)
"""
We are already handling N-DISCONNECT.ind for CO messages, but
N-NOTICE.ind for CL messages was not being handled.
If CL messages are not arriving to the peer (MSC), then reset the link
and mark the peer as disconnected, until a new RESET can successfully fo
through.
Related: OS#5917
Change-Id: I3f6c120183a53a80255de71366935b6c07fcfbc8
---
M src/osmo-bsc/osmo_bsc_sigtran.c
1 file changed, 38 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/40706/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/40706?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3f6c120183a53a80255de71366935b6c07fcfbc8
Gerrit-Change-Number: 40706
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/40706?usp=email )
Change subject: sccp: Handle N-NOTICE.ind (Routing Failure of SCCP CL messages)
......................................................................
sccp: Handle N-NOTICE.ind (Routing Failure of SCCP CL messages)
ITU Q.714 2.8:
"""
When an end node is informed of a routing failure, this information
is forwarded towards the SCCP user by using the N-DISCONNECT primitive
(refer to reason for release in 2.1.1.2.4/Q.711) or the N-NOTICE primitive
(refer to reason for return in 2.2.2.2.4/Q.711)
"""
We are already handling N-DISCONNECT.ind for CO messages, but
N-NOTICE.ind for CL messages was not being handled.
If CL messages are not arriving to the peer (MSC), then reset the link
and mark the peer as disconnected, until a new RESET can successfully fo
through.
Related: OS#5917
Change-Id: I3f6c120183a53a80255de71366935b6c07fcfbc8
---
M src/osmo-bsc/osmo_bsc_sigtran.c
1 file changed, 38 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/40706/1
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 0b48a02..3f97d36 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -1,4 +1,4 @@
-/* (C) 2017 by sysmocom s.f.m.c. GmbH, Author: Philipp Maier
+/* (C) 2017-2025 by sysmocom s.f.m.c. GmbH, Author: Philipp Maier
* (C) 2017-2018 by Harald Welte <laforge(a)gnumonks.org>
* All Rights Reserved
*
@@ -22,6 +22,7 @@
#include <osmocom/core/fsm.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include <osmocom/sigtran/sccp_sap.h>
+#include <osmocom/sccp/sccp_types.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/gsm0808.h>
#include <osmocom/gsm/protocol/ipaccess.h>
@@ -157,6 +158,37 @@
return rc;
}
+static int handle_notice_ind(struct osmo_ss7_instance *cs7, const struct osmo_scu_notice_param *ni)
+{
+ int rc = 0;
+ struct bsc_msc_data *msc = get_msc_by_addr(&ni->calling_addr);
+ if (!msc) {
+ LOGP(DMSC, LOGL_DEBUG, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u didn't match any MSC, ignoring\n",
+ osmo_sccp_addr_dump(&ni->calling_addr),
+ ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->importance);
+ return rc;
+ }
+
+ LOG_MSC(msc, LOGL_NOTICE, "(calling_addr=%s) N-NOTICE.ind cause=%u='%s' importance=%u\n",
+ osmo_sccp_addr_dump(&ni->calling_addr),
+ ni->cause, osmo_sccp_return_cause_name(ni->cause),
+ ni->importance);
+
+ switch (ni->cause) {
+ case SCCP_RETURN_CAUSE_SUBSYSTEM_CONGESTION:
+ case SCCP_RETURN_CAUSE_NETWORK_CONGESTION:
+ /* Transient failures (hopefully), keep going. */
+ return rc;
+ default:
+ /* continue below: */
+ }
+
+ /* Messages are not arriving to MSC. Kick the BSSMAP back to DISC state. */
+ bssmap_reset_set_disconnected(msc->a.bssmap_reset);
+ return rc;
+}
+
static int handle_n_connect_from_msc(struct osmo_sccp_user *scu, struct osmo_scu_prim *scu_prim)
{
struct bsc_msc_data *msc = get_msc_by_addr(&scu_prim->u.connect.calling_addr);
@@ -317,6 +349,11 @@
rc = handle_unitdata_from_msc(&scu_prim->u.unitdata.calling_addr, oph->msg, scu);
break;
+ case OSMO_PRIM(OSMO_SCU_PRIM_N_NOTICE, PRIM_OP_INDICATION):
+ DEBUGP(DMSC, "N-NOTICE.ind(%s)\n", osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
+ rc = handle_notice_ind(osmo_sccp_get_ss7(sccp), &scu_prim->u.notice);
+ break;
+
case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION):
/* Handle inbound connections */
DEBUGP(DMSC, "N-CONNECT.ind(X->%u)\n", scu_prim->u.connect.conn_id);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/40706?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3f6c120183a53a80255de71366935b6c07fcfbc8
Gerrit-Change-Number: 40706
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>