Change in ...osmo-sgsn[master]: Iu: implement a user inactivity timer

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/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Tue Oct 8 11:10:56 UTC 2019


lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/15483 )

Change subject: Iu: implement a user inactivity timer
......................................................................

Iu: implement a user inactivity timer

The user inactivity timer is similiar to the Gb READY timer and reduces
the resources taken by an idle UE.

Change-Id: I66c2ac0350cb074aefd9a22c5121acf723f239d3
---
M include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
M src/sgsn/gprs_mm_state_iu_fsm.c
M src/sgsn/sgsn_vty.c
M tests/test_nodes.vty
4 files changed, 29 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h b/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
index 7f02bcc..05342f9 100644
--- a/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
+++ b/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
@@ -19,6 +19,7 @@
 	E_PMM_PS_CONN_ESTABLISH,
 	E_PMM_IMPLICIT_DETACH, /* = E_PS_ATTACH_REJECT, E_RAU_REJECT */
 	E_PMM_RA_UPDATE, /* = Serving RNC relocation */
+	E_PMM_USER_INACTIVITY, /* when the inactivity timer runs out */
 };
 
 extern struct osmo_fsm mm_state_iu_fsm;
diff --git a/src/sgsn/gprs_mm_state_iu_fsm.c b/src/sgsn/gprs_mm_state_iu_fsm.c
index b098f20..e6b80d7 100644
--- a/src/sgsn/gprs_mm_state_iu_fsm.c
+++ b/src/sgsn/gprs_mm_state_iu_fsm.c
@@ -12,7 +12,8 @@
 
 static const struct osmo_tdef_state_timeout mm_state_iu_fsm_timeouts[32] = {
 	[ST_PMM_DETACHED] = { },
-	[ST_PMM_CONNECTED] = { },
+	/* non-spec -T3314 (User inactivity timer) */
+	[ST_PMM_CONNECTED] = { .T=-3314 },
 	[ST_PMM_IDLE] = { },
 };
 
@@ -47,6 +48,10 @@
 static void st_pmm_connected(struct osmo_fsm_inst *fi, uint32_t event, void *data)
 {
 	struct sgsn_mm_ctx *ctx = fi->priv;
+	const struct RANAP_Cause user_inactive_cause = {
+		.present = RANAP_Cause_PR_radioNetwork,
+		.choice.radioNetwork = RANAP_CauseRadioNetwork_user_inactivity,
+	};
 
 	switch(event) {
 	case E_PMM_PS_CONN_RELEASE:
@@ -57,6 +62,10 @@
 		sgsn_ranap_iu_release_free(ctx, NULL);
 		mm_state_iu_fsm_state_chg(fi, ST_PMM_DETACHED);
 		break;
+	case E_PMM_USER_INACTIVITY:
+		sgsn_ranap_iu_release_free(ctx, &user_inactive_cause);
+		mm_state_iu_fsm_state_chg(fi, ST_PMM_DETACHED);
+		break;
 	case E_PMM_RA_UPDATE:
 		break;
 	}
@@ -81,6 +90,18 @@
 	}
 }
 
+static int pmm_state_fsm_timer_cb(struct osmo_fsm_inst *fi)
+{
+	switch(fi->state) {
+	case ST_PMM_CONNECTED:
+		/* timer for pmm state. state=CONNECTED: -T3314 (User inactivity timer) */
+		osmo_fsm_inst_dispatch(fi, E_PMM_USER_INACTIVITY, NULL);
+		break;
+	}
+
+	return 0;
+}
+
 static struct osmo_fsm_state mm_state_iu_fsm_states[] = {
 	[ST_PMM_DETACHED] = {
 		.in_event_mask = X(E_PMM_PS_ATTACH) | X(E_PMM_IMPLICIT_DETACH),
@@ -89,7 +110,8 @@
 		.action = st_pmm_detached,
 	},
 	[ST_PMM_CONNECTED] = {
-		.in_event_mask = X(E_PMM_PS_CONN_RELEASE) | X(E_PMM_RA_UPDATE) | X(E_PMM_IMPLICIT_DETACH),
+		.in_event_mask = X(E_PMM_PS_CONN_RELEASE) | X(E_PMM_RA_UPDATE)
+			| X(E_PMM_IMPLICIT_DETACH) | X(E_PMM_USER_INACTIVITY),
 		.out_state_mask = X(ST_PMM_DETACHED) | X(ST_PMM_IDLE),
 		.name = "Connected",
 		.action = st_pmm_connected,
@@ -109,6 +131,7 @@
 	OSMO_VALUE_STRING(E_PMM_PS_CONN_ESTABLISH),
 	OSMO_VALUE_STRING(E_PMM_IMPLICIT_DETACH),
 	OSMO_VALUE_STRING(E_PMM_RA_UPDATE),
+	OSMO_VALUE_STRING(E_PMM_USER_INACTIVITY),
 	{ 0, NULL }
 };
 
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 9200822..17b64c8 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -104,6 +104,8 @@
 	{ .T=3386, .default_val=GSM0408_T3386_SECS, .desc="Wait for MODIFY PDP CTX ACK timer (s)" },
 	{ .T=3395, .default_val=GSM0408_T3395_SECS, .desc="Wait for DEACT PDP CTX ACK timer (s)" },
 	{ .T=3397, .default_val=GSM0408_T3397_SECS, .desc="Wait for DEACT AA PDP CTX ACK timer (s)" },
+	/* non spec timers */
+	{ .T=-3314, .default_val=GSM0408_T3314_SECS, .desc="Iu User inactivity timer. On expiry release Iu connection (s)" },
 	{}
 };
 
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index 2ef926a..b9cf91e 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -12,6 +12,7 @@
 T3386 = 8 s	Wait for MODIFY PDP CTX ACK timer (s) (default: 8 s)
 T3395 = 8 s	Wait for DEACT PDP CTX ACK timer (s) (default: 8 s)
 T3397 = 8 s	Wait for DEACT AA PDP CTX ACK timer (s) (default: 8 s)
+X3314 = 44 s	Iu User inactivity timer. On expiry release Iu connection (s) (default: 44 s)
 OsmoSGSN# configure terminal
 OsmoSGSN(config)# list
 ...

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I66c2ac0350cb074aefd9a22c5121acf723f239d3
Gerrit-Change-Number: 15483
Gerrit-PatchSet: 10
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191008/7e65560b/attachment.htm>


More information about the gerrit-log mailing list