Change in osmo-ttcn3-hacks[master]: Correctly handle ALIVE/TEST procedure with FR/NS-over-IP without SNS

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Oct 15 10:10:52 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20636 )

Change subject: Correctly handle ALIVE/TEST procedure with FR/NS-over-IP without SNS
......................................................................

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
---
M library/NS_Emulation.ttcnpp
1 file changed, 40 insertions(+), 23 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



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 @@
 			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,17 +235,7 @@
 			/* FIXME */
 		}
 
-		/* 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));
-		}
-
-		/* Respond to RESET with wrong NSEI/NSVCI */
-		[] NSCP.receive(tr_NS_RESET(?, ?, ?)) -> value rf {
-			log("Rx NS-RESET for unknown NSEI/NSVCI");
-			/* FIXME */
-		}
+		[not config.handle_sns] as_handle_reset();
 
 		[config.role_sgsn and config.handle_sns and ischosen(config.provider.ip)] as_sns_sgsn();
 
@@ -267,10 +246,48 @@
 		}
 	}
 
+	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 */
+		[] NSCP.receive(tr_NS_RESET(?, ?, ?)) -> value rf {
+			log("Rx NS-RESET for unknown NSEI/NSVCI");
+			/* FIXME */
+		}
+	}
+
 	/* 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));

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20636
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie01fee70297255b3d9c091bc2cec75b0f915c588
Gerrit-Change-Number: 20636
Gerrit-PatchSet: 3
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201015/fbd06ee1/attachment.htm>


More information about the gerrit-log mailing list