summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2020-10-12 18:10:06 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2020-10-15 10:48:34 +0200
commit654f85e2b85c3a5b18be8904d1602b98df3c0ae0 (patch)
treeef11f69e96d101dd8d13ec44101f3c39c7f6432c /library
parent5c5b276600c3abf257b69b11600e77599689c20d (diff)
Correctly handle ALIVE/TEST procedure with FR/NS-over-IP without SNS
If IP-SNS is not used we should wait for the RESET procedure to finish before sending NS-ALIVE. For IP-SNS start NS-ALIVE in both roles (sgsn and bss) and don't handle NS-RESET. Also unified the log messages a bit (received -> Rx). Related: SYS#5002 Change-Id: Ie01fee70297255b3d9c091bc2cec75b0f915c588
Diffstat (limited to 'library')
-rw-r--r--library/NS_Emulation.ttcnpp57
1 files changed, 37 insertions, 20 deletions
diff --git a/library/NS_Emulation.ttcnpp b/library/NS_Emulation.ttcnpp
index 5fb2aa6..4d3db4c 100644
--- a/library/NS_Emulation.ttcnpp
+++ b/library/NS_Emulation.ttcnpp
@@ -217,20 +217,9 @@ module NS_Emulation {
f_sendAlive();
}
- [config.role_sgsn] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
- log("Provider Link came up: sending NS-ALIVE");
- f_sendAlive();
- Tns_test.start;
- }
-
- [not config.role_sgsn] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
- log("Provider Link came up: sending NS-RESET");
- f_sendReset();
- }
-
/* Stop t_alive when receiving ALIVE-ACK */
[Tns_alive.running] NSCP.receive(t_NS_ALIVE_ACK) {
- log("NS-ALIVE-ACK received: stopping Tns-alive; starting Tns-test");
+ log("Rx NS-ALIVE-ACK: stopping Tns-alive; starting Tns-test");
Tns_alive.stop;
Tns_test.start;
}
@@ -246,10 +235,36 @@ module NS_Emulation {
/* FIXME */
}
+ [not config.handle_sns] as_handle_reset();
+
+ [config.role_sgsn and config.handle_sns and ischosen(config.provider.ip)] as_sns_sgsn();
+
+ /* default case of handling unknown PDUs */
+ [] NSCP.receive(PDU_NS: ?) -> value rf {
+ log("Rx Unexpected NS PDU ", rf," in state ", g_state);
+ NSCP.send(ts_NS_STATUS(NS_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, rf));
+ }
+ }
+
+ private altstep as_handle_reset() runs on NS_CT {
+ var PDU_NS rf;
+
+ [config.role_sgsn] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
+ log("Provider Link came up: waiting for NS-RESET");
+ }
+
+ [not config.role_sgsn] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
+ log("Provider Link came up: sending NS-RESET");
+ f_sendReset();
+ }
+
/* Respond to RESET with correct NSEI/NSVCI */
[] NSCP.receive(tr_NS_RESET(?, config.nsvci, config.nsei)) -> value rf {
f_change_state(NSE_S_ALIVE_BLOCKED);
NSCP.send(ts_NS_RESET_ACK(config.nsvci, config.nsei));
+ log("Rx NS-RESET: Sending NS-ALIVE");
+ f_sendAlive();
+ Tns_test.start;
}
/* Respond to RESET with wrong NSEI/NSVCI */
@@ -257,20 +272,22 @@ module NS_Emulation {
log("Rx NS-RESET for unknown NSEI/NSVCI");
/* FIXME */
}
-
- [config.role_sgsn and config.handle_sns and ischosen(config.provider.ip)] as_sns_sgsn();
-
- /* default case of handling unknown PDUs */
- [] NSCP.receive(PDU_NS: ?) -> value rf {
- log("Rx Unexpected NS PDU ", rf," in state ", g_state);
- NSCP.send(ts_NS_STATUS(NS_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, rf));
- }
}
/* simple IP Sub-Network Service responder for the SGSN side. This is not a full implementation
* of the protocol, merely sufficient to make the PCU/BSS side happy to proceed */
private altstep as_sns_sgsn() runs on NS_CT {
var PDU_NS rf;
+ [config.role_sgsn] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
+ log("Provider Link came up: sending NS-ALIVE");
+ f_sendAlive();
+ }
+
+ [not config.role_sgsn] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
+ log("Provider Link came up: sending NS-ALIVE");
+ f_sendAlive();
+ }
+
[] NSCP.receive(tr_SNS_SIZE(config.nsei)) -> value rf {
/* blindly acknowledge whatever the PCU sends */
NSCP.send(ts_SNS_SIZE_ACK(config.nsei, omit));