pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40184?usp=email )
Change subject: hnbgw: Introduce test TC_{cs,ps}_rua_dt_during_sccp_wait_cc
......................................................................
hnbgw: Introduce test TC_{cs,ps}_rua_dt_during_sccp_wait_cc
Related: SYS#7453
Change-Id: I97767db5560edf951202c876726d0c52b5b5b49f
---
M hnbgw/HNBGW_Tests.ttcn
M hnbgw/expected-results.xml
2 files changed, 55 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index 28b41d2..a123dda 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -1567,6 +1567,56 @@
f_shutdown_helper();
}
+/* scenario: HNB transmits a RUA DirectTransfer after having transmitted a RUA Connect
+ * (with RANAP payload) and conn is still being established on SCCP side (HNBGW sent CR,
+ * waiting for CC from CN). */
+private function f_tc_rua_dt_during_sccp_wait_cc(charstring id) runs on ConnHdlr {
+ /* HNB->MSC: InitialUE */
+ var RANAP_PDU tx_ranap_pdu := f_build_initial_ue(g_pars);
+ f_iuh2iu_connect(f_build_initial_ue(g_pars));
+
+ /* CREQ was received at CN, now UE/HNB decides to transmit RANAP PDU (Iu Release REq).
+ * This has been seen in a production setup on the field, with a high
+ * latency+jitter satellite network between HNB and HNBGW.
+ * We expect HNBGW to queue the msg until the SCCP conn is confirmed. */
+ tx_ranap_pdu := valueof(ts_RANAP_IuReleaseRequest(ts_RanapCause_nas_normal));
+ RUA.send(tx_ranap_pdu);
+
+ /* Let some time for RUA DirectTransfer to reach the HNBGW: */
+ f_sleep(1.0);
+
+ /* Now tx SCCP CC from CN to HNBGW: */
+ BSSAP.send(ts_MSC_CONN_PRIM_CONNECT_RES);
+
+ /* now that SCCP conn is connected, HNBGW should forward the previously queued RANAP PDU: */
+ f_bssap_expect(tx_ranap_pdu);
+
+ /* Validate that we can indeed forward some Downlink data CN may have sent to HNBGW meanwhile.
+ * This would usually be for instance a Attach Accept or similar. */
+ tx_ranap_pdu := valueof(ts_RANAP_DirectTransfer(f_rnd_octstring(10)));
+ f_iu2iuh(tx_ranap_pdu);
+
+ f_cn_iu_release_procedure();
+}
+private function f_TC_rua_dt_during_sccp_wait_cc(boolean is_ps) runs on test_CT {
+ var ConnHdlr vc_conn;
+ g_num_hnbs := 1;
+ /* Instruct RAN_Emulation to avoid accepting the conn, we'll trigger an
+ * SCCP CC by sending a N-CONNECT RESP primitive in ConnHdlr. */
+ g_ran_ops.ranap_connect_ind_auto_res := false;
+ f_init();
+
+ vc_conn := f_start_handler_with_pars(refers(f_tc_rua_dt_during_sccp_wait_cc), f_TestHdlrParams(6, is_ps));
+ vc_conn.done;
+
+ f_shutdown_helper();
+}
+testcase TC_cs_rua_dt_during_sccp_wait_cc() runs on test_CT {
+ f_TC_rua_dt_during_sccp_wait_cc(false);
+}testcase TC_ps_rua_dt_during_sccp_wait_cc() runs on test_CT {
+ f_TC_rua_dt_during_sccp_wait_cc(true);
+}
+
friend function f_tc_ps_rab_assignment(charstring id) runs on ConnHdlr {
var RANAP_PDU tx;
@@ -1578,7 +1628,6 @@
f_cn_iu_release_procedure(pfcp_teardown := g_pars.pfcp_pars.pfcp_enabled);
}
-
testcase TC_ps_rab_assignment() runs on test_CT {
var ConnHdlr vc_conn;
g_num_hnbs := 1;
@@ -2603,6 +2652,8 @@
execute(TC_cs_rua_disconnect_during_sccp_cr_cc());
execute(TC_cs_iu_release_req_rua_disconnect());
execute(TC_ps_iu_release_req_rua_disconnect());
+ execute(TC_cs_rua_dt_during_sccp_wait_cc());
+ execute(TC_ps_rua_dt_during_sccp_wait_cc());
execute(TC_ps_rab_assignment());
execute(TC_ps_rab_assignment_concurrent());
diff --git a/hnbgw/expected-results.xml b/hnbgw/expected-results.xml
index 3fca542..3777715 100644
--- a/hnbgw/expected-results.xml
+++ b/hnbgw/expected-results.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<testsuite name='Titan' tests='58' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'>
+<testsuite name='Titan' tests='60' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'>
<testcase classname='HNBGW_Tests' name='TC_hnb_register' time='MASKED'/>
<testcase classname='HNBGW_Tests' name='TC_hnb_register_duplicate' time='MASKED'/>
<testcase classname='HNBGW_Tests' name='TC_hnb_register_duplicate_reuse_sctp_assoc' time='MASKED'/>
@@ -29,6 +29,8 @@
<testcase classname='HNBGW_Tests' name='TC_cs_rua_disconnect_during_sccp_cr_cc' time='MASKED'/>
<testcase classname='HNBGW_Tests' name='TC_cs_iu_release_req_rua_disconnect' time='MASKED'/>
<testcase classname='HNBGW_Tests' name='TC_ps_iu_release_req_rua_disconnect' time='MASKED'/>
+ <testcase classname='HNBGW_Tests' name='TC_cs_rua_dt_during_sccp_wait_cc' time='MASKED'/>
+ <testcase classname='HNBGW_Tests' name='TC_ps_rua_dt_during_sccp_wait_cc' time='MASKED'/>
<testcase classname='HNBGW_Tests' name='TC_ps_rab_assignment' time='MASKED'/>
<testcase classname='HNBGW_Tests' name='TC_ps_rab_assignment_concurrent' time='MASKED'/>
<testcase classname='HNBGW_Tests' name='TC_mscpool_L3Compl_on_1_cnlink' time='MASKED'/>
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40184?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I97767db5560edf951202c876726d0c52b5b5b49f
Gerrit-Change-Number: 40184
Gerrit-PatchSet: 4
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: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40218?usp=email )
Change subject: hnbgw: Configure local ASP/AS in osmo-hnbgw.cfg
......................................................................
hnbgw: Configure local ASP/AS in osmo-hnbgw.cfg
This allows us using known port for the SCTP assoc, which can then be
used to look up ASP in osmo-stp VTY.
Change-Id: Ic04702b597f7217890ee58734c11b866fb14af8b
---
M hnbgw/osmo-hnbgw.cfg
1 file changed, 9 insertions(+), 0 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
diff --git a/hnbgw/osmo-hnbgw.cfg b/hnbgw/osmo-hnbgw.cfg
index 677be22..423cec5 100644
--- a/hnbgw/osmo-hnbgw.cfg
+++ b/hnbgw/osmo-hnbgw.cfg
@@ -37,6 +37,15 @@
cs7 instance 0
point-code 0.23.5
+ asp asp-clnt-msc-0 2905 2906 m3ua
+ local-ip 127.0.0.1
+ remote-ip 127.0.0.1
+ role asp
+ sctp-role client
+ as as-clnt-msc-0 m3ua
+ asp asp-clnt-msc-0
+ routing-key 0 0.23.5
+
sccp-address msc-naught
point-code 0.23.4
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40218?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic04702b597f7217890ee58734c11b866fb14af8b
Gerrit-Change-Number: 40218
Gerrit-PatchSet: 2
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>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40190?usp=email )
Change subject: xua_asp_fsm: Reuse ss7_asp_get_all_rctx_be() in xua_msg_add_asp_rctx()
......................................................................
xua_asp_fsm: Reuse ss7_asp_get_all_rctx_be() in xua_msg_add_asp_rctx()
Change-Id: I6fe4f388b11991e7c7396c9d632b376e8591a8f3
---
M src/xua_asp_fsm.c
1 file changed, 5 insertions(+), 23 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 4603734..11a34b4 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -173,32 +173,14 @@
/* add M3UA_IEI_ROUTE_CTX to xua_msg containig all routing keys of ASs within ASP */
static int xua_msg_add_asp_rctx(struct xua_msg *xua, struct osmo_ss7_asp *asp)
{
- struct osmo_ss7_as *as;
uint32_t rctx[OSMO_SS7_MAX_RCTX_COUNT];
- unsigned int i = 0;
+ unsigned int cnt;
- /* iterate over all ASs and build array of routing contexts */
- llist_for_each_entry(as, &asp->inst->as_list, list) {
- if (!osmo_ss7_as_has_asp(as, asp))
- continue;
- rctx[i++] = htonl(as->cfg.routing_key.context);
- if (i >= ARRAY_SIZE(rctx)-1) {
- break;
- }
- }
- /* add xUA IE with routing contests to the message (if any) */
- if (i) {
- /* bail out (and not add the IE) if there's only one routing context (and hence
- * only one AS) within this ASP, and that routing context is zero, meaning no routing
- * context IE shall be used */
- if (i == 1 && rctx[0] == 0)
- return 0;
-
- xua_msg_add_data(xua, M3UA_IEI_ROUTE_CTX, i*sizeof(uint32_t), (uint8_t *)rctx);
- }
-
+ cnt = ss7_asp_get_all_rctx_be(asp, rctx, ARRAY_SIZE(rctx), NULL);
+ if (cnt > 0)
+ xua_msg_add_data(xua, M3UA_IEI_ROUTE_CTX, cnt*sizeof(uint32_t), (uint8_t *)rctx);
/* return count of routing contexts added */
- return i;
+ return cnt;
}
/* ask the xUA implementation to transmit a specific message */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40190?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: I6fe4f388b11991e7c7396c9d632b376e8591a8f3
Gerrit-Change-Number: 40190
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40193?usp=email )
Change subject: asp: Make sure asp->{client,server} is nulled before destroy callback
......................................................................
asp: Make sure asp->{client,server} is nulled before destroy callback
disconnect_cb() in case of stream_cli and closed_cb() in case of
stream_srv may call some libosmo-sigtran code. Make sure we don't access
the pointer anymore in that case for safety.
Change-Id: I3f0774eac630c8bc7e9a10f874e1c72763fd14a0
---
M src/osmo_ss7_asp.c
1 file changed, 7 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index c054369..4044003 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -686,22 +686,27 @@
* announce disconnection to upper layers. */
int ss7_asp_disconnect_stream(struct osmo_ss7_asp *asp)
{
+ struct osmo_stream_cli *cli;
+ struct osmo_stream_srv *srv;
+
/* First tear down previous state if existing: */
if (asp->cfg.is_server) {
/* We are in server mode now */
if (asp->client) {
/* if we previously were in client mode,
* destroy it */
- osmo_stream_cli_destroy(asp->client);
+ cli = asp->client;
asp->client = NULL;
+ osmo_stream_cli_destroy(cli);
}
} else {
/* We are in client mode now */
if (asp->server) {
/* if we previously were in server mode,
* destroy it */
- osmo_stream_srv_destroy(asp->server);
+ srv = asp->server;
asp->server = NULL;
+ osmo_stream_srv_destroy(srv);
}
if (asp->client) {
/* Make sure we close the previous stream before starting a new one: */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40193?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: I3f0774eac630c8bc7e9a10f874e1c72763fd14a0
Gerrit-Change-Number: 40193
Gerrit-PatchSet: 1
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-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40194?usp=email )
Change subject: asp: Make sure previous stream_srv is immediatelly destroyed when requested
......................................................................
asp: Make sure previous stream_srv is immediatelly destroyed when requested
This will be needed when the asp is in SCTP=server mode and we request
it to shutdown/restart.
Path in xua_accept_cb() for dynamic ASPs in SCTP=server mode needs to be
fixed since it was wrongly calling osmo_ss7_asp_restart() and taking
advantage of the fact that the asp->server was not being freed in that
case.
Change-Id: I8edd64234654ba987f35de2d7ad610e96bda27eb
---
M src/osmo_ss7_asp.c
M src/osmo_ss7_xua_srv.c
2 files changed, 12 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index 4044003..02dbcb8 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -699,6 +699,12 @@
asp->client = NULL;
osmo_stream_cli_destroy(cli);
}
+ if (asp->server) {
+ /* Make sure we close the previous stream right now: */
+ srv = asp->server;
+ asp->server = NULL;
+ osmo_stream_srv_destroy(srv);
+ }
} else {
/* We are in client mode now */
if (asp->server) {
diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c
index 52a3508..5483aae 100644
--- a/src/osmo_ss7_xua_srv.c
+++ b/src/osmo_ss7_xua_srv.c
@@ -153,7 +153,12 @@
oxs->cfg.local.host_cnt);
ss7_asp_peer_set_hosts(&asp->cfg.remote, asp,
&hostbuf_ptr, 1);
- osmo_ss7_asp_restart(asp);
+ if ((rc = xua_asp_fsm_start(asp, asp->cfg.role, LOGL_DEBUG)) < 0) {
+ talloc_free(sock_name);
+ osmo_ss7_asp_destroy(asp);
+ return rc;
+ }
+ OSMO_ASSERT(asp->fi);
}
}
if (!asp) {
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40194?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: I8edd64234654ba987f35de2d7ad610e96bda27eb
Gerrit-Change-Number: 40194
Gerrit-PatchSet: 2
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: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>