aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-10-04 22:52:56 +0200
committerHarald Welte <laforge@osmocom.org>2020-10-09 12:27:11 +0200
commit5339b2e37227520e9f355635c8b4193d2b701e69 (patch)
tree49591969a07efa90040c64d3fc86449620d1f6dd
parent23e274919d14a37a9c40163219ce230acd2a100f (diff)
BSSGP_Emulation: Support multiple PTP-BVC within one Entity
The existing BSSGP_Emulation is built around the assumption that every instance of BSSGP_Emulation only servers one signaling-BVC and one PTP-BVC. While this is true for osmo-pcu at this point (BTS-colocated PCU), other BSS/PCU implementations differ. In general, there can always be any number of PTP BVC (one per cell) next to the signaling BVC (one per BSS). Let's represent this in BSSGP_Emulation so we can create more comprehensive tests. Change-Id: I7e30b4c4e188518a574e082962fba457b3a97ce3
-rw-r--r--library/BSSGP_Emulation.ttcnpp1200
-rw-r--r--library/Osmocom_Gb_Types.ttcn68
-rw-r--r--pcu/PCU_Tests.default27
-rw-r--r--pcu/PCU_Tests.ttcn46
-rw-r--r--pcu/PCU_Tests_NS.ttcn12
-rw-r--r--pcu/PCU_Tests_SNS.ttcn42
-rw-r--r--pcu/SGSN_Components.ttcn47
-rw-r--r--sgsn/SGSN_Tests.ttcn126
8 files changed, 1036 insertions, 532 deletions
diff --git a/library/BSSGP_Emulation.ttcnpp b/library/BSSGP_Emulation.ttcnpp
index c1d297d4..81b3c5ba 100644
--- a/library/BSSGP_Emulation.ttcnpp
+++ b/library/BSSGP_Emulation.ttcnpp
@@ -1,13 +1,21 @@
module BSSGP_Emulation {
/* BSSGP Emulation in TTCN-3
- * (C) 2018-2019 Harald Welte <laforge@gnumonks.org>
+ * (C) 2018-2020 Harald Welte <laforge@gnumonks.org>
* All rights reserved.
*
* Released under the terms of GNU General Public License, Version 2 or
* (at your option) any later version.
*
* SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This code implements BSSGP asa hierarchy of components:
+ * - the main BSSGP_CT which runs on top of a NSE (NS Entity).
+ * - demultiplex based on BVCI. BVCI=0 is handled to a user port
+ * - a per-BVC BSSGP_BVC_CT which runs on top of BSSGP_CT, it handles
+ * one PTP BVCI (i.e. one cell)
+ * - demultiplex based on TLLI
+ * - a per-TLLI BSSGP_Client_CT which runs on top of BSSGP_BVC_CT
*/
import from General_Types all;
@@ -35,23 +43,43 @@ modulepar {
}
/***********************************************************************
- * Communication between Client Components and Main Component
+ * Communication between Client Components and per-BVC component
***********************************************************************/
type record BssgpStatusIndication {
- Nsei nsei,
+ Nsei nsei optional,
BssgpBvci bvci,
BvcState state
+};
+
+type record BssgpResetIndication {
+ BssgpBvci bvci
+};
+
+template (value) BssgpStatusIndication
+ts_BssgpStsInd(template (omit) Nsei nsei, template (value) BssgpBvci bvci,
+ template (value) BvcState state) := {
+ nsei := nsei,
+ bvci := bvci,
+ state := state
}
-template BssgpStatusIndication t_BssgpStsInd(template Nsei nsei, template BssgpBvci bvci, template BvcState state) := {
+template (present) BssgpStatusIndication
+tr_BssgpStsInd(template Nsei nsei, template (present) BssgpBvci bvci,
+ template (present) BvcState state) := {
nsei := nsei,
bvci := bvci,
state := state
}
type enumerated BvcState {
+ /* SGSN role: waiting to be reset by the peer */
+ BVC_S_WAIT_RESET,
+ /* PCU role: waiting for NS_ALIVE_UNBLOCKED */
+ BVC_S_WAIT_NS_ALIVE_UNBLOCKED,
+ /* BVC-BLOCKED state */
BVC_S_BLOCKED,
+ /* BVC-UNBLOCKED state */
BVC_S_UNBLOCKED
};
@@ -103,7 +131,7 @@ type port BSSGP_PT message {
;
} with { extension "internal" };
-signature BSSGP_register_client(hexstring imsi, OCT4 tlli, BssgpCellId cell_id);
+signature BSSGP_register_client(hexstring imsi, OCT4 tlli);
signature BSSGP_unregister_client(hexstring imsi);
signature BSSGP_llgmm_assign(OCT4 tlli_old, OCT4 tlli);
@@ -112,101 +140,394 @@ type port BSSGP_PROC_PT procedure {
} with { extension "internal" };
+
/***********************************************************************
* Client Component for a single MS/TLLI
+ ***********************************************************************
+ * This is what most users will want to derive their test cases from. It
+ * provides a set of three different ports (PTP, signaling, procedure)
+ * for (currently up to 3) different Cells. Those ports are all connected
+ * to one or multiple different per-BVC compoennts, depending on whether
+ * they share the same BSS or not.
***********************************************************************/
type component BSSGP_Client_CT {
- port BSSGP_PT BSSGP[3];
- port BSSGP_PT BSSGP_SIG[3];
- port BSSGP_PROC_PT BSSGP_PROC[3];
+ /* one port array for each client; allows talking to up to 3 BVC/Cell (handover, ...) */
+ port BSSGP_PT BSSGP[3]; /* PTP-BVC */
+ port BSSGP_PT BSSGP_SIG[3]; /* Signaling BVC */
+ port BSSGP_PROC_PT BSSGP_PROC[3]; /* registration / deregistration */
};
+function f_bssgp_client_register(hexstring imsi, OCT4 tlli, BSSGP_PROC_PT PT := BSSGP_PROC[0])
+runs on BSSGP_Client_CT {
+ PT.call(BSSGP_register_client:{imsi, tlli}) {
+ [] PT.getreply(BSSGP_register_client:{imsi, tlli}) {};
+ }
+}
+
+function f_bssgp_client_unregister(hexstring imsi, BSSGP_PROC_PT PT := BSSGP_PROC[0])
+runs on BSSGP_Client_CT {
+ PT.call(BSSGP_unregister_client:{imsi}) {
+ [] PT.getreply(BSSGP_unregister_client:{imsi}) {};
+ }
+}
+
+/* TS 44.064 7.2.1.1 LLGMM-ASSIGN */
+function f_bssgp_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_PROC_PT PT := BSSGP_PROC[0])
+runs on BSSGP_Client_CT {
+ PT.call(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {
+ [] PT.getreply(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {};
+ }
+}
+
/***********************************************************************
* Main Component
+ ***********************************************************************
+ * This component exists once, and it runs on to of the NS_Emulation.
+ * It handles the BVC-RESET for the signaling BVCI, and dispatches messages
+ * to the per-BVC components running above it. Messages are routed by:
+ * - PTP BVCI in NS header (if non-0)
+ * - BVCI IE in messages on BVCI=0 in NS header
+ * Messages for which no unique BVC can be identified (like paging without
+ * a BVCI IE set) are broadcast to all BVC components.
+ * We also broadcast state changes (BssgpStatusIndication) and reset events
+ * (BssgpResetIndication) of the signaling BVC to all per-BVC components.
***********************************************************************/
-function BssgpStart(BssgpConfig cfg) runs on BSSGP_CT {
+function BssgpStart(BssgpConfig cfg, charstring id) runs on BSSGP_CT {
g_cfg := cfg;
- f_init();
- f_ScanEvents();
-}
-private function f_init() runs on BSSGP_CT {
- /* Connect the UDP socket */
- f_change_state(BVC_S_BLOCKED);
+ /* create the per-BVC components based on the configuration */
+ for (var integer i := 0; i < lengthof(g_cfg.bvc); i := i+1) {
+ var BssgpBvcConfig bvc_cfg := g_cfg.bvc[i];
+ var charstring bvc_id := id & "-BVCI" & int2str(bvc_cfg.bvci);
+ /* create, connect and start the BVC component */
+ var BSSGP_BVC_CT bvc_ct := BSSGP_BVC_CT.create(bvc_id);
+ connect(bvc_ct:BVC, self:BVC);
+ bvc_ct.start(f_bssgp_bvc_main(bvc_cfg, g_cfg.sgsn_role, bvc_id));
+ /* populate the BVC state table */
+ BvcTable[i] := {
+ bvci := bvc_cfg.bvci,
+ cell_id := bvc_cfg.cell_id,
+ comp_ref := bvc_ct
+ };
+ }
+
+ if (g_cfg.sgsn_role) {
+ /* The SGSN side waits for an inbound BVC-RESET on the signaling BVC */
+ f_sign_change_state(BVC_S_WAIT_RESET);
+ } else {
+ /* The BSS/PCU side waits for an inbound NsStatusIndication to Tx BVC-RESET */
+ f_sign_change_state(BVC_S_WAIT_NS_ALIVE_UNBLOCKED);
+ }
+
+ /* main loop */
+ f_bssgp_ScanEvents();
}
+/* master component, exists once per BSSGP instance (NSE) */
type component BSSGP_CT {
/* UDP ports towards the bottom (IUT) */
port NS_PT BSCP;
- /* NS-User SAP towards the user */
- port BSSGP_SP_PT BSSGP_SP;
- port BSSGP_SP_PT BSSGP_SP_SIG;
- port BSSGP_PROC_PT BSSGP_PROC;
+
+ /* control by the user */
+ port BSSGP_CT_PROC_PT PROC;
var BssgpConfig g_cfg;
- var BvcState g_ptp_bvc_state := BVC_S_BLOCKED;
- timer g_T1 := 15.0;
+ /* Signaling BVC (BVCI=0) */
+ var BvcState g_sign_bvc_state := BVC_S_WAIT_RESET;
timer g_T2 := 60.0;
- var ClientEntity ClientTable[16];
-}
-
-type record length(16) of LLC_Entity LLC_Entities;
+ /* port to per-BVC components */
+ port BSSGP_BVC_SP_PT BVC;
+ /* per-BVC state table */
+ var BvcEntity BvcTable[16];
+};
-type record ClientEntity {
- OCT4 tlli,
- OCT4 tlli_old optional,
- hexstring imsi,
+/* one element in the per-BVC state table */
+type record BvcEntity {
+ /* PTP BVCI of this BVC/Cell */
+ BssgpBvci bvci,
+ /* Cell Identity of this cell */
BssgpCellId cell_id,
- BSSGP_Client_CT comp_ref,
- /* LLC entities, one for each SAPI */
- LLC_Entity llc[16]
+ /* reference to the per-BVC/cell component */
+ BSSGP_BVC_CT comp_ref
};
-type record LLC_Entity {
- boolean sgsn_role,
- /* N(U) on transmit side for next PDU */
- uint9_t n_u_tx_next,
- /* N(U) on receive side, last PDU */
- uint9_t n_u_rx_last optional
-};
+/* find the per-BVC component for a given BVCI */
+private function f_comp_for_bvci(BssgpBvci bvci) runs on BSSGP_CT return BSSGP_BVC_CT {
+ var integer i;
-function f_llc_create(boolean sgsn_role := false) return LLC_Entities {
- var LLC_Entities llc;
- for (var integer i := 0; i < 16; i := i+1) {
- llc[i] := valueof(t_LLC_init(sgsn_role));
+ for (i := 0; i < lengthof(BvcTable); i := i+1) {
+ if (BvcTable[i].bvci == bvci) {
+ return BvcTable[i].comp_ref;
+ }
}
- return llc;
+ return null;
}
-private template LLC_Entity t_LLC_init(boolean sgsn_role := false) := {
- sgsn_role := sgsn_role,
- n_u_tx_next := 0,
- n_u_rx_last := -
+/* We are in BVC_S_WAIT_RSET state (only happens in SGSN role) */
+altstep as_sig_wait_reset() runs on BSSGP_CT {
+ var NsUnitdataIndication udi;
+
+ /* Respond to RESET for signalling BVCI 0 */
+ [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, omit), 0)) -> value udi {
+ log("Rx BVC-RESET for Signaling BVCI=0");
+ BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(0, omit), 0));
+ f_sign_change_state(BVC_S_UNBLOCKED);
+ }
+
+ /* work-around for old, buggy libosmogb before Change-Id Ie87820537d6d616da4fd4bbf73eab06e28fda5e1 */
+ [mp_tolerate_bvc_reset_cellid] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, g_cfg.bvc[0].cell_id), 0)) -> value udi {
+ log("Rx BVC-RESET for Signaling BVCI=0");
+ BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(0, omit), 0));
+ f_sign_change_state(BVC_S_UNBLOCKED);
+ }
}
-type enumerated BssgpDecodeDepth {
- BSSGP_DECODE_DEPTH_BSSGP,
- BSSGP_DECODE_DEPTH_LLC,
- BSSGP_DECODE_DEPTH_SNDCP
+/* We are in BVC_S_UNBLOCKED state */
+altstep as_sig_unblocked() runs on BSSGP_CT {
+ var BSSGP_BVC_CT bvc_comp_ref;
+ var BSSGP_Client_CT vc_conn;
+ var NsUnitdataIndication udi;
+ var NsUnitdataRequest udr;
+
+ /* Messages PTP BVCI in BVCI field of NS: dispatch by that */
+ [] BSCP.receive(f_BnsUdInd(?, (2..65535))) -> value udi {
+ bvc_comp_ref := f_comp_for_bvci(valueof(udi.bvci));
+ if (isbound(bvc_comp_ref) and bvc_comp_ref != null) {
+ /* dispatch to BVC component */
+ BVC.send(udi) to bvc_comp_ref;
+ } else {
+ setverdict(fail, "Rx BSSGP for unknown PTP BVCI ", udi.bvci, ": ", udi.bssgp);
+ BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(udi.bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), udi.bvci));
+ }
+ }
+
+ /* Messages with BVCI = 0 (Signaling) in BVCI field of NS */
+
+ /* Route based on PTP BVCI in payload/IE of signaling PDU */
+ [] BSCP.receive(f_BnsUdInd(?, 0)) -> value udi {
+ var template (omit) BssgpBvci ptp_bvci := f_BSSGP_BVCI_get(udi.bssgp);
+ if (istemplatekind(ptp_bvci, "omit")) {
+ log("Rx on SIG BVCI without PTP BVCI: broadcasting");
+ for (var integer i := 0; i < lengthof(BvcTable); i := i+1) {
+ if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
+ BVC.send(udi) to BvcTable[i].comp_ref;
+ }
+ }
+ } else {
+ bvc_comp_ref := f_comp_for_bvci(valueof(ptp_bvci));
+ if (isbound(bvc_comp_ref) and bvc_comp_ref != null) {
+ /* dispatch to BVC component */
+ BVC.send(udi) to bvc_comp_ref;
+ } else {
+ setverdict(fail, "Rx SIG BSSGP for unknown PTP BVCI ", ptp_bvci, ": ", udi.bssgp);
+ BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(udi.bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0));
+ }
+ }
+ }
+
+ /* Handle PS-PAGING on SIGN BVCI with no conditional BVCI IE */
+ [] BSCP.receive(f_BnsUdInd(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}, 0)) -> value udi {
+ /* FIXME: use LA, RA or BSS Area to dispatch instead of broadcast */
+ for (var integer i := 0; i < lengthof(BvcTable); i := i+1) {
+ if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
+ BVC.send(udi) to BvcTable[i].comp_ref;
+ }
+ }
+ }
+ /* Handle CS-PAGING on SIGN BVCI with no conditional BVCI IE */
+ [] BSCP.receive(f_BnsUdInd(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}, 0)) -> value udi {
+ /* FIXME: use LA, RA or BSS Area to dispatch instead of broadcast */
+ for (var integer i := 0; i < lengthof(BvcTable); i := i+1) {
+ if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
+ BVC.send(udi) to BvcTable[i].comp_ref;
+ }
+ }
+ }
+
+ /* per-BVC component sends us something; forward to NS without any validation */
+ [] BVC.receive(NsUnitdataRequest:?) -> value udr {
+ /* patch in the NSEI, as the per-BVC components have no idea about it */
+ udr.nsei := g_cfg.nsei;
+ BSCP.send(udr);
+ }
+}
+
+/* We are in BVC_S_WAIT_NS_ALIVE_UNBLOCKED (only happens in BSS role) */
+altstep as_sig_wait_ns_alive_unblocked() runs on BSSGP_CT {
+ var NsStatusIndication nsi;
+ [] BSCP.receive(NsStatusIndication:{?,?, complement (NSE_S_ALIVE_UNBLOCKED), NSE_S_ALIVE_UNBLOCKED}) -> value nsi {
+ /* if we just became NS-unblocked, send a BCC-RESET */
+ if (g_cfg.sgsn_role == false) {
+ BSCP.send(f_BnsUdReq(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, 0, omit), 0));
+ g_T2.start;
+ /* The BVC_RESET_ACK is handled in the as_sig_allstate() below */
+ }
+ /* Idea: We could send BVC-UNBLOCK here like some SGSN do */
+ }
+
+}
+
+/* handling of events irrespective of BVC state */
+altstep as_sig_allstate() runs on BSSGP_CT {
+ var BSSGP_Client_CT vc_conn;
+ var NsUnitdataIndication udi;
+ var NsStatusIndication nsi;
+ var ASP_Event evt;
+ var BSSGP_BVC_CT bvc_comp_ref;
+ var BssgpBvci bvci;
+
+ /* Respond to RESET for signalling BVCI 0 */
+ [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, omit), 0)) -> value udi {
+ log("Rx BVC-RESET for Signaling BVCI=0");
+ BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(0, omit), 0));
+ for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {
+ if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
+ BVC.send(BssgpResetIndication:{0}) to BvcTable[i].comp_ref;
+ }
+ }
+ }
+
+ /* any BLOCK or UNBLOCK for the SIGNALING BVCI are illegal */
+ [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(0, ?), 0)) -> value udi {
+ setverdict(fail, "Rx BVC-BLOCK illegal for BVCI=0: ", udi);
+ }
+ [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK(0), 0)) -> value udi {
+ setverdict(fail, "Rx BVC-UNBLOCK illegal for BVCI=0: ", udi);
+ }
+ [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK_ACK(0), 0)) -> value udi {
+ setverdict(fail, "Rx BVC-BLOCK-ACK illegal for BVCI=0: ", udi);
+ }
+ [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK_ACK(0), 0)) -> value udi {
+ setverdict(fail, "Rx BVC-UNBLOCK-ACK illegal for BVCI=0: ", udi);
+ }
+
+ /* Respond to BLOCK for wrong BVCI */
+ [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(?, ?), 0)) -> value udi {
+ setverdict(fail, "Rx BVC-BLOCK for unknown BVCI");
+ BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(0, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0));
+ }
+
+ /* Respond to RESET with wrong BVCI */
+ [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, ?, ?), 0)) -> value udi {
+ var BssgpBvci ptp_bvci := oct2int(udi.bssgp.pDU_BSSGP_BVC_RESET.bVCI.unstructured_value);
+ setverdict(fail, "Rx BVC-RESET for unknown BVCI ", ptp_bvci);
+ BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(ptp_bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0));
+ }
+
+ /* BVC-RESET-ACK for BVCI=0 while T2 is running: Answer to a BVC-RESET we sent earlier */
+ [g_T2.running] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(0, omit), 0)) -> value udi {
+ log("BVCI(0) Rx BVC-RESET-ACK");
+ g_T2.stop;
+ f_sign_change_state(BVC_S_UNBLOCKED);
+ for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {
+ if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
+ BVC.send(BssgpResetIndication:{0}) to BvcTable[i].comp_ref;
+ }
+ }
+ }
+ [] g_T2.timeout {
+ setverdict(fail, "Timeout waiting for BVC-RESET-ACK on BVCI=0");
+ BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(udi.bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0));
+ g_T2.start;
+ }
+
+ /* default case of handling unknown PDUs */
+ [] BSCP.receive(f_BnsUdInd(?, ?)) -> value udi {
+ setverdict(fail, "Rx Unexpected BSSGP PDU ", udi.bssgp," in state ", g_sign_bvc_state);
+ BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(0, BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, udi.bssgp), 0));
+ }
+
+ /* Forwarding of ASP_Event to per-BVC components */
+ [] BSCP.receive(ASP_Event:?) -> value evt {
+ for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {
+ if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
+ BVC.send(evt) to BvcTable[i].comp_ref;
+ }
+ }
+ }
+ /* Keep NS Status Indicaitons to us; no need to inform per-BVC components [for now?] */
+ [] BSCP.receive(NsStatusIndication:?) -> value nsi { }
+
+ /* Procedure port request to resolve the per-BVC component for a given ptp BVCI */
+ [] PROC.getcall(BSSGP_get_bvci_ct:{?}) -> param(bvci) sender vc_conn {
+ for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {
+ if (BvcTable[i].bvci == bvci) {
+ PROC.reply(BSSGP_get_bvci_ct:{bvci} value BvcTable[i].comp_ref) to vc_conn;
+ return;
+ }
+ }
+ }
+}
+
+/* send the highest decoded layer of the message through given port */
+private function f_send_bssgp_dec(BssgpDecoded dec, BSSGP_Client_CT vc_conn, BSSGP_SP_PT pt) {
#ifdef BSSGP_EM_L3
- ,
- BSSGP_DECODE_DEPTH_L3
+ if (ispresent(dec.l3_mt)) {
+ pt.send(dec.l3_mt) to vc_conn;
+ } else if (ispresent(dec.l3_mo)) {
+ pt.send(dec.l3_mo) to vc_conn;
+ } else
#endif
-};
+ if (ispresent(dec.sndcp)) {
+ pt.send(dec.sndcp) to vc_conn;
+ } else if (ispresent(dec.llc)) {
+ pt.send(dec.llc) to vc_conn;
+ } else {
+ pt.send(dec.bssgp) to vc_conn;
+ }
+}
-type record BssgpConfig {
- Nsvci nsei,
- Nsvci bvci,
- BssgpCellId cell_id,
- boolean sgsn_role,
- BssgpDecodeDepth depth
-};
-function f_BnsUdReq(template PDU_BSSGP pdu, BssgpBvci bvci)
+function f_llc_get_n_u_tx(inout LLC_Entity llc) return uint9_t {
+ var uint9_t ret := llc.n_u_tx_next;
+ llc.n_u_tx_next := llc.n_u_tx_next + 1;
+ return ret;
+}
+
+#ifdef BSSGP_EM_L3
+function f_llc_sapi_by_l3_mo(PDU_L3_MS_SGSN l3_mo) return BIT4 {
+ if (ischosen(l3_mo.msgs.gprs_mm)) {
+ return c_LLC_SAPI_LLGMM;
+ } else if (ischosen(l3_mo.msgs.gprs_sm)) {
+ return c_LLC_SAPI_LLGMM;
+ } else if (ischosen(l3_mo.msgs.sms)) {
+ return c_LLC_SAPI_LLSMS;
+ }
+ setverdict(fail, "No LLC SAPI for ", l3_mo);
+ mtc.stop;
+}
+
+private function f_llc_sapi_by_l3_mt(PDU_L3_SGSN_MS l3_mt) return BIT4 {
+ if (ischosen(l3_mt.msgs.gprs_mm)) {
+ return c_LLC_SAPI_LLGMM;
+ } else if (ischosen(l3_mt.msgs.gprs_sm)) {
+ return c_LLC_SAPI_LLGMM;
+ } else if (ischosen(l3_mt.msgs.sms)) {
+ return c_LLC_SAPI_LLSMS;
+ }
+ setverdict(fail, "No LLC SAPI for ", l3_mt);
+ mtc.stop;
+}
+#endif
+
+/* main loop of BSSGP_CT */
+private function f_bssgp_ScanEvents() runs on BSSGP_CT {
+ while (true) {
+ alt {
+ [g_sign_bvc_state == BVC_S_WAIT_RESET] as_sig_wait_reset();
+ [g_sign_bvc_state == BVC_S_WAIT_NS_ALIVE_UNBLOCKED] as_sig_wait_ns_alive_unblocked();
+ [g_sign_bvc_state == BVC_S_UNBLOCKED] as_sig_unblocked();
+ [] as_sig_allstate();
+ }
+ } /* while */
+}
+
+/* generate a send template. Cannot be a real template as we want to use g_cfg.nsei */
+private function f_BnsUdReq(template PDU_BSSGP pdu, BssgpBvci bvci)
runs on BSSGP_CT return NsUnitdataRequest {
var NsUnitdataRequest udr := {
bvci := bvci,
@@ -221,9 +542,10 @@ runs on BSSGP_CT return NsUnitdataRequest {
return udr;
}
-function f_BnsUdInd(template PDU_BSSGP pdu, template BssgpBvci bvci)
-runs on BSSGP_CT return template NsUnitdataIndication {
- var template NsUnitdataIndication udi := {
+/* generate a receive template. Cannot be a real template as we want to use g_cfg.nsei */
+private function f_BnsUdInd(template PDU_BSSGP pdu, template BssgpBvci bvci)
+runs on BSSGP_CT return template (present) NsUnitdataIndication {
+ var template (present) NsUnitdataIndication udi := {
bvci := bvci,
nsei := g_cfg.nsei,
sdu := *,
@@ -232,99 +554,140 @@ runs on BSSGP_CT return template NsUnitdataIndication {
return udi;
}
-private function f_change_state(BvcState new_state) runs on BSSGP_CT {
- log("BSSGP State Transition: ", g_ptp_bvc_state, " -> ", new_state);
- g_ptp_bvc_state := new_state;
- for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {
- if (isbound(ClientTable[i].comp_ref)) {
- BSSGP_SP.send(t_BssgpStsInd(g_cfg.nsei, g_cfg.bvci, g_ptp_bvc_state)) to ClientTable[i].comp_ref;
+/* change state of signaling BVCI; notify per-BVC components */
+private function f_sign_change_state(BvcState new_state) runs on BSSGP_CT {
+ if (new_state == g_sign_bvc_state) {
+ return;
+ }
+ log("BVCI(0) State Transition: ", g_sign_bvc_state, " -> ", new_state);
+ g_sign_bvc_state := new_state;
+ for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {
+ if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
+ BVC.send(ts_BssgpStsInd(g_cfg.nsei, 0, g_sign_bvc_state)) to BvcTable[i].comp_ref;
}
}
}
-private function f_sendReset(BssgpBvci bvci) runs on BSSGP_CT {
- var PDU_BSSGP pdu;
+/* User wants to get per-BVC component reference from BSSGP_CT */
+signature BSSGP_get_bvci_ct(BssgpBvci bvci) return BSSGP_BVC_CT;
- /* The Cell Identifier IE is mandatory in the BVC-RESET PDU sent from BSS to
- * SGSN in order to reset a BVC corresponding to a PTP functional entity. The
- * Cell Identifier IE shall not be used in any other BVC-RESET PDU. */
- if (g_cfg.sgsn_role) {
- pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, bvci, omit));
- } else {
- pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, bvci, g_cfg.cell_id));
- }
- log("PDU: ", pdu);
- log("ENC: ", enc_PDU_BSSGP(pdu));
+type port BSSGP_CT_PROC_PT procedure {
+ inout BSSGP_get_bvci_ct
+} with { extension "internal" };
- /* BVC-RESET is always sent via the SIGNALLING BVCI, see Table 5.4.1 */
- BSCP.send(f_BnsUdReq(pdu, 0));
- g_T2.start;
- //f_change_state(BVC_S_WAIT_RESET);
+/* convenience wrapper function for user */
+function f_bssgp_get_bvci_ct(BssgpBvci bvci, BSSGP_CT_PROC_PT PT) return BSSGP_BVC_CT {
+ var BSSGP_BVC_CT res;
+ PT.call(BSSGP_get_bvci_ct:{bvci}) {
+ [] PT.getreply(BSSGP_get_bvci_ct:{bvci})-> value res {
+ return res;
+ }
+ }
}
-private function f_sendUnblock() runs on BSSGP_CT {
- BSCP.send(f_BnsUdReq(t_BVC_UNBLOCK(g_cfg.bvci), 0));
- g_T1.start;
-}
+/***********************************************************************
+ * per-BVC (Cell) Component
+ ***********************************************************************
+ * Any number of these components runs on top of the BSSGP_CT, each
+ * representing one PTP BVC within this NSE. Users (test cases) can
+ * register with TLLI and/or IMSI via the procedure port.
+ ***********************************************************************/
-private function f_sendBlock(BssgpCause cause) runs on BSSGP_CT {
- BSCP.send(f_BnsUdReq(t_BVC_BLOCK(g_cfg.bvci, cause), 0));
- g_T1.start;
-}
+/* per-BVC component. Exists once per cell within a BSSGP_CT */
+type component BSSGP_BVC_CT {
+ /* port towards the underlying BSSGP_CT */
+ port BSSGP_BVC_PT BVC;
-private function f_sendStatus(BssgpCause cause, PDU_BSSGP pdu) runs on BSSGP_CT {
- /* FIXME: Make sure correct Signaling or PTP BVCI is used! */
- BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(g_cfg.bvci, cause, pdu), g_cfg.bvci));
-}
+ /* BSSGP-User SAP towards the user (Client) */
+ port BSSGP_SP_PT BSSGP_SP;
+ port BSSGP_SP_PT BSSGP_SP_SIG;
+ port BSSGP_PROC_PT BSSGP_PROC;
-/* attempt to extract the TLLI from a BSSGP PDU */
-function f_bssgp_get_tlli(PDU_BSSGP bssgp) return template OCT4 {
- if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) {
- return bssgp.pDU_BSSGP_DL_UNITDATA.tLLI_current;
- } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) {
- return bssgp.pDU_BSSGP_UL_UNITDATA.tLLI;
- } else if (ischosen(bssgp.pDU_BSSGP_RA_CAPABILITY)) {
- return bssgp.pDU_BSSGP_RA_CAPABILITY.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE)) {
- return bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK)) {
- return bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_RADIO_STATUS)) {
- return bssgp.pDU_BSSGP_RADIO_STATUS.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_SUSPEND)) {
- return bssgp.pDU_BSSGP_SUSPEND.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_SUSPEND_ACK)) {
- return bssgp.pDU_BSSGP_SUSPEND_ACK.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_SUSPEND_NACK)) {
- return bssgp.pDU_BSSGP_SUSPEND_NACK.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_RESUME)) {
- return bssgp.pDU_BSSGP_RESUME.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_RESUME_ACK)) {
- return bssgp.pDU_BSSGP_RESUME_ACK.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_RESUME_NACK)) {
- return bssgp.pDU_BSSGP_RESUME_NACK.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_FLUSH_LL)) {
- return bssgp.pDU_BSSGP_FLUSH_LL.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_FLUSH_LL_ACK)) {
- return bssgp.pDU_BSSGP_FLUSH_LL_ACK.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_LLC_DISCARDED)) {
- return bssgp.pDU_BSSGP_LLC_DISCARDED.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_LLC_DISCARDED)) {
- return bssgp.pDU_BSSGP_LLC_DISCARDED.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_PAGING_CS) and
- isvalue(bssgp.pDU_BSSGP_PAGING_CS.tLLI)) {
- return bssgp.pDU_BSSGP_PAGING_CS.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_FLOW_CONTROL_MS)) {
- return bssgp.pDU_BSSGP_FLOW_CONTROL_MS.tLLI.tLLI_Value;
- } else if (ischosen(bssgp.pDU_BSSGP_FLOW_CONTROL_MS_ACK)) {
- return bssgp.pDU_BSSGP_FLOW_CONTROL_MS_ACK.tLLI.tLLI_Value;
+ var BssgpBvcConfig g_cfg;
+ var boolean g_sgsn_role;
+
+ var BvcState g_ptp_bvc_state := BVC_S_BLOCKED;
+ timer g_T1 := 15.0;
+ timer g_T2 := 60.0;
+ var boolean g_t1_waits_for_block_ack := false;
+
+ var ClientEntity ClientTable[16];
+};
+
+/* port between global BSSGP_CT and per-BVC BSSGP_BVC_CT */
+type port BSSGP_BVC_SP_PT message {
+ in NsUnitdataRequest;
+ out ASP_Event,
+ BssgpStatusIndication,
+ BssgpResetIndication,
+ NsUnitdataIndication;
+} with { extension "internal" };
+type port BSSGP_BVC_PT message {
+ in ASP_Event,
+ BssgpStatusIndication,
+ BssgpResetIndication,
+ NsUnitdataIndication;
+ out NsUnitdataRequest;
+} with { extension "internal" };
+
+
+/* one element in the per-TLLI state table */
+type record ClientEntity {
+ OCT4 tlli,
+ OCT4 tlli_old optional,
+ hexstring imsi,
+ BSSGP_Client_CT comp_ref,
+ /* LLC entities, one for each SAPI */
+ LLC_Entity llc[16]
+};
+type record LLC_Entity {
+ boolean sgsn_role,
+ /* N(U) on transmit side for next PDU */
+ uint9_t n_u_tx_next,
+ /* N(U) on receive side, last PDU */
+ uint9_t n_u_rx_last optional
+};
+type record length(16) of LLC_Entity LLC_Entities;
+
+function f_llc_create(boolean sgsn_role := false) return LLC_Entities {
+ var LLC_Entities llc;
+ for (var integer i := 0; i < 16; i := i+1) {
+ llc[i] := valueof(t_LLC_init(sgsn_role));
}
- /* TODO: Handover, PFC, LCS */
- return omit;
+ return llc;
}
+private template LLC_Entity t_LLC_init(boolean sgsn_role := false) := {
+ sgsn_role := sgsn_role,
+ n_u_tx_next := 0,
+ n_u_rx_last := -
+}
+
+/* configuration of BSSGP_CT */
+type record BssgpConfig {
+ Nsvci nsei,
+ boolean sgsn_role,
+ BssgpBvcConfigs bvc
+};
+/* Configuration of one BVC (Cell) BSSGP_BVC_CT */
+type record BssgpBvcConfig {
+ BssgpBvci bvci,
+ BssgpCellId cell_id,
+ BssgpDecodeDepth depth
+};
+type record of BssgpBvcConfig BssgpBvcConfigs;
+type enumerated BssgpDecodeDepth {
+ BSSGP_DECODE_DEPTH_BSSGP,
+ BSSGP_DECODE_DEPTH_LLC,
+ BSSGP_DECODE_DEPTH_SNDCP
+#ifdef BSSGP_EM_L3
+ ,
+ BSSGP_DECODE_DEPTH_L3
+#endif
+};
+
/*
-private function f_tbl_init() runs on BSSGP_CT {
+private function f_tbl_init() runs on BSSGP_BVC_CT {
var integer i;
for (i := 0; i < sizeof(ImsiTable); i := i+1) {
ImsiTable[i] := -;
@@ -336,8 +699,8 @@ private function f_tbl_init() runs on BSSGP_CT {
}
*/
-private function f_tbl_client_add(hexstring imsi, OCT4 tlli, BssgpCellId cell_id, BSSGP_Client_CT vc_conn)
-runs on BSSGP_CT {
+private function f_tbl_client_add(hexstring imsi, OCT4 tlli, BSSGP_Client_CT vc_conn)
+runs on BSSGP_BVC_CT {
var integer i;
for (i := 0; i < sizeof(ClientTable); i := i+1) {
if (not isvalue(ClientTable[i].comp_ref)) {
@@ -346,12 +709,11 @@ runs on BSSGP_CT {
tlli := tlli,
tlli_old := omit,
imsi := imsi,
- cell_id := cell_id,
comp_ref := vc_conn,
llc := -
};
for (var integer j := 0; j < sizeof(ClientTable[i].llc); j := j+1) {
- ClientTable[i].llc[j] := valueof(t_LLC_init(g_cfg.sgsn_role));
+ ClientTable[i].llc[j] := valueof(t_LLC_init(g_sgsn_role));
}
return;
}
@@ -359,7 +721,7 @@ runs on BSSGP_CT {
testcase.stop("Client Table full");
}
-private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_CT {
+private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_BVC_CT {
var integer i;
for (i := 0; i < sizeof(ClientTable); i := i+1) {
if (isvalue(ClientTable[i].imsi) and ClientTable[i].imsi == imsi) {
@@ -373,7 +735,6 @@ private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs
tlli := -,
tlli_old := omit,
imsi := ''H,
- cell_id := -,
comp_ref := null,
llc := - };
return;
@@ -385,7 +746,7 @@ private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs
/* TS 44.064 7.2.1.1 LLGMM-ASSIGN */
private function f_tbl_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_Client_CT vc_conn)
-runs on BSSGP_CT {
+runs on BSSGP_BVC_CT {
var integer i := f_tbl_idx_by_comp(vc_conn);
if (tlli_old == 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) {
@@ -402,7 +763,7 @@ runs on BSSGP_CT {
}
}
-private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_CT return BSSGP_Client_CT {
+private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_BVC_CT return BSSGP_Client_CT {
var integer i;
for (i := 0; i < sizeof(ClientTable); i := i+1) {
if (isvalue(ClientTable[i].imsi) and isvalue(ClientTable[i].comp_ref)
@@ -414,7 +775,7 @@ private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_CT return BSSG
mtc.stop;
}
-private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Client_CT {
+private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_BVC_CT return BSSGP_Client_CT {
var integer i;
for (i := 0; i < sizeof(ClientTable); i := i+1) {
if (isvalue(ClientTable[i].comp_ref) and
@@ -427,7 +788,7 @@ private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Cli
mtc.stop;
}
-private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return integer {
+private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_BVC_CT return integer {
var integer i;
for (i := 0; i < sizeof(ClientTable); i := i+1) {
if (isvalue(ClientTable[i].comp_ref) and ClientTable[i].comp_ref == comp_ref) {
@@ -438,7 +799,7 @@ private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT re
mtc.stop;
}
-private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return OCT4 {
+private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_BVC_CT return OCT4 {
var integer i;
for (i := 0; i < sizeof(ClientTable); i := i+1) {
if (isvalue(ClientTable[i].tlli) and isvalue(ClientTable[i].comp_ref)
@@ -450,134 +811,128 @@ private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT r
mtc.stop;
}
-private function f_send_bvc_reset_ack(BssgpBvci bvci) runs on BSSGP_CT {
- /* The Cell Identifier IE is mandatory in the BVC-RESET-ACK PDU sent from BSS to
- * SGSN in response to reset a BVC corresponding to a PTP functional entity. The Cell
- * Identifier IE shall not be used in any other BVC-RESET-ACK PDU */
- if (g_cfg.sgsn_role) {
- BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(bvci, omit), 0));
- } else {
- BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(bvci, g_cfg.cell_id), 0));
- }
+/* PDU_BSSGP enhanced with LLC and possibly L3 decoded payloads */
+type record BssgpDecoded {
+ PDU_BSSGP bssgp,
+ PDU_LLC llc optional,
+#ifdef BSSGP_EM_L3
+ PDU_L3_MS_SGSN l3_mo optional,
+ PDU_L3_SGSN_MS l3_mt optional,
+#endif
+ PDU_SN sndcp optional
}
-altstep as_allstate() runs on BSSGP_CT {
- var BSSGP_Client_CT vc_conn;
- var NsUnitdataIndication udi;
- var NsStatusIndication nsi;
- var ASP_Event evt;
- var hexstring imsi;
- var OCT4 tlli, tlli_old;
- var BssgpCellId cell_id;
-
- /* Respond to BLOCK for wrong NSVCI */
- [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(?, ?), 0)) -> value udi {
- log("Rx BVC-BLOCK for unknown BVCI");
- f_sendStatus(BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp);
- }
-
- /* Respond to RESET with correct BVCI/CellID */
- [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi {
- log("Rx BVC-RESET for Our BVCI=", g_cfg.bvci);
- f_send_bvc_reset_ack(g_cfg.bvci);
- f_change_state(BVC_S_UNBLOCKED);
- }
-
- /* Respond to RESET for signalling BVCI 0 */
- [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, omit), 0)) -> value udi {
- log("Rx BVC-RESET for Signaling BVCI=0");
- f_send_bvc_reset_ack(0);
- }
+/* Decode a PDU_BSSGP into a BssgpDecoded (i.e. with LLC/L3 decoded, as applicable) */
+private function f_dec_bssgp(PDU_BSSGP bssgp) runs on BSSGP_BVC_CT return BssgpDecoded {
+ var BssgpDecoded dec := {
+ bssgp := bssgp,
+ llc := omit,
+#ifdef BSSGP_EM_L3
+ l3_mo := omit,
+ l3_mt := omit,
+#endif
+ sndcp := omit
+ };
- /* work-around for old, buggy libosmogb before Change-Id Ie87820537d6d616da4fd4bbf73eab06e28fda5e1 */
- [mp_tolerate_bvc_reset_cellid] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, g_cfg.cell_id), 0)) -> value udi {
- log("Rx BVC-RESET for Signaling BVCI=0");
- f_send_bvc_reset_ack(0);
+ /* Decode LLC, if it is a PDU that contains LLC */
+ if (g_cfg.depth >= BSSGP_DECODE_DEPTH_LLC) {
+ if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) {
+ dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_DL_UNITDATA.lLC_PDU.lLC_PDU);
+ } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) {
+ dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU);
+ }
}
- /* Respond to RESET with wrong NSEI/NSVCI */
- [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, ?, ?), 0)) -> value udi {
- log("Rx BVC-RESET for unknown BVCI");
- f_sendStatus(BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp);
+ /* Decode SNDCP, if it is a LLC PDU containing user plane data */
+ if (g_cfg.depth >= BSSGP_DECODE_DEPTH_SNDCP) {
+ if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) {
+ dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI);
+ }
}
- /* default case of handling unknown PDUs */
- [] BSCP.receive(f_BnsUdInd(?, ?)) -> value udi {
- log("Rx Unexpected BSSGP PDU ", udi.bssgp," in state ", g_ptp_bvc_state);
- f_sendStatus(BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, udi.bssgp);
- }
- /* Forwarding of ASP_Event and NsStatusIndication to user */
- [] BSCP.receive(ASP_Event:?) -> value evt {
- for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {
- if (isbound(ClientTable[i].comp_ref)) {
- BSSGP_SP.send(evt) to ClientTable[i].comp_ref;
- }
- }
- }
- [] BSCP.receive(NsStatusIndication:?) -> value nsi {
- /* if we just became NS-unblocked, send a BCC-RESET */
- if (nsi.old_state != NSE_S_ALIVE_UNBLOCKED and nsi.new_state == NSE_S_ALIVE_UNBLOCKED) {
- if (g_cfg.sgsn_role == false) {
- f_sendReset(g_cfg.bvci);
- }
- /* Idea: We could send BVC-UNBLOCK here like some SGSN do */
- }
- for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {
- if (isbound(ClientTable[i].comp_ref)) {
- BSSGP_SP.send(nsi) to ClientTable[i].comp_ref;
+#ifdef BSSGP_EM_L3
+ /* Decode L3, if it is a LLC PDU containing L3 */
+ if (g_cfg.depth >= BSSGP_DECODE_DEPTH_L3) {
+ if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_L3)) {
+ if (g_sgsn_role) {
+ dec.l3_mo := dec_PDU_L3_MS_SGSN(dec.llc.pDU_LLC_UI.information_field_UI);
+ } else {
+ dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI);
}
}
}
+#endif
- [] BSSGP_PROC.getcall(BSSGP_register_client:{?,?,?}) -> param(imsi, tlli, cell_id) sender vc_conn {
- f_tbl_client_add(imsi, tlli, cell_id, vc_conn);
- BSSGP_PROC.reply(BSSGP_register_client:{imsi, tlli, cell_id}) to vc_conn;
- }
- [] BSSGP_PROC.getcall(BSSGP_unregister_client:{?}) -> param(imsi) sender vc_conn {
- f_tbl_client_del(imsi, vc_conn);
- BSSGP_PROC.reply(BSSGP_unregister_client:{imsi}) to vc_conn;
- }
- [] BSSGP_PROC.getcall(BSSGP_llgmm_assign:{?,?}) -> param(tlli_old, tlli) sender vc_conn {
- f_tbl_client_llgmm_assign(tlli_old, tlli, vc_conn);
- BSSGP_PROC.reply(BSSGP_llgmm_assign:{tlli_old, tlli}) to vc_conn;
- }
+ return dec;
+}
+
+private function f_ptp_sendUnblock() runs on BSSGP_BVC_CT {
+ BVC.send(ts_ptp_BnsUdReq(t_BVC_UNBLOCK(g_cfg.bvci), 0));
+ g_t1_waits_for_block_ack := false;
+ g_T1.start;
+}
+private function f_ptp_sendBlock(BssgpCause cause) runs on BSSGP_BVC_CT {
+ BVC.send(ts_ptp_BnsUdReq(t_BVC_BLOCK(g_cfg.bvci, cause), 0));
+ g_t1_waits_for_block_ack := true;
+ g_T1.start;
+}
+
+private function f_ptp_sendStatus(BssgpCause cause, PDU_BSSGP pdu) runs on BSSGP_BVC_CT {
+ /* FIXME: Make sure correct Signaling or PTP BVCI is used! */
+ BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_STATUS(g_cfg.bvci, cause, pdu), g_cfg.bvci));
}
-altstep as_blocked() runs on BSSGP_CT {
- [g_T1.running] g_T1.timeout {
- f_sendUnblock();
+private function f_ptp_sendReset() runs on BSSGP_BVC_CT {
+ var PDU_BSSGP pdu;
+
+ /* The Cell Identifier IE is mandatory in the BVC-RESET PDU sent from BSS to
+ * SGSN in order to reset a BVC corresponding to a PTP functional entity. The
+ * Cell Identifier IE shall not be used in any other BVC-RESET PDU. */
+ if (g_sgsn_role) {
+ pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, g_cfg.bvci, omit));
+ } else {
+ pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, g_cfg.bvci, g_cfg.cell_id));
}
- [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0)) {
+
+ /* BVC-RESET is always sent via the SIGNALLING BVCI, see Table 5.4.1 */
+ BVC.send(ts_ptp_BnsUdReq(pdu, 0));
+ g_T2.start;
+ //f_change_state(BVC_S_WAIT_RESET);
+}
+
+/* PTP-BVC is in BVC_S_BLOCKED state */
+private altstep as_ptp_blocked() runs on BSSGP_BVC_CT {
+ var NsUnitdataIndication udi;
+
+ [g_T1.running and not g_t1_waits_for_block_ack] BVC.receive(tr_ptp_BnsUdInd(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0)) {
g_T1.stop;
- f_change_state(BVC_S_UNBLOCKED);
+ f_ptp_change_state(BVC_S_UNBLOCKED);
+ }
+
+ /* RESET-ACK before T2 timeout: reset successful. In SGSN role, CellID must be present */
+ [g_T2.running and g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi {
+ g_T2.stop;
+ f_ptp_change_state(BVC_S_UNBLOCKED);
}
- [not g_cfg.sgsn_role] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, omit), 0)) {
- f_sendUnblock();
+ /* RESET-ACK before T2 timeout: reset successful. In BSS role, CellID must be absent */
+ [g_T2.running and not g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, omit), 0)) -> value udi {
+ g_T2.stop;
+ f_ptp_change_state(BVC_S_UNBLOCKED);
}
-}
-private function f_send_bssgp_dec(BssgpDecoded dec, BSSGP_Client_CT vc_conn, BSSGP_SP_PT pt := BSSGP_SP) runs on BSSGP_CT {
-#ifdef BSSGP_EM_L3
- if (ispresent(dec.l3_mt)) {
- pt.send(dec.l3_mt) to vc_conn;
- } else if (ispresent(dec.l3_mo)) {
- pt.send(dec.l3_mo) to vc_conn;
- } else
-#endif
- if (ispresent(dec.sndcp)) {
- pt.send(dec.sndcp) to vc_conn;
- } else if (ispresent(dec.llc)) {
- pt.send(dec.llc) to vc_conn;
- } else {
- pt.send(dec.bssgp) to vc_conn;
+ [] g_T2.timeout {
+ /* BVC-RESET-ACK PDU was not received within T2: retransmit */
+ f_ptp_sendReset();
}
}
-
-altstep as_unblocked() runs on BSSGP_CT {
- var BSSGP_Client_CT vc_conn;
+/* PTP-BVC is in UNBLOCKED state */
+private altstep as_ptp_unblocked() runs on BSSGP_BVC_CT {
var NsUnitdataIndication udi;
+ var NsStatusIndication nsi;
+ var BSSGP_Client_CT vc_conn;
+ var ASP_Event evt;
var PDU_BSSGP bs_pdu;
var PDU_LLC llc;
#ifdef BSSGP_EM_L3
@@ -586,68 +941,59 @@ altstep as_unblocked() runs on BSSGP_CT {
#endif
/* bogus unblock, just respond with ACK */
- [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK(g_cfg.bvci), 0)) -> value udi {
- BSCP.send(f_BnsUdReq(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0));
+ [] BVC.receive(tr_ptp_BnsUdInd(t_BVC_UNBLOCK(g_cfg.bvci), 0)) -> value udi {
+ BVC.send(ts_ptp_BnsUdReq(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0));
}
/* Respond to BLOCK with BLOCK-ACK + change state */
- [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(g_cfg.bvci, ?), 0)) -> value udi {
- BSCP.send(f_BnsUdReq(t_BVC_BLOCK_ACK(g_cfg.bvci), 0));
+ [] BVC.receive(tr_ptp_BnsUdInd(t_BVC_BLOCK(g_cfg.bvci, ?), 0)) -> value udi {
+ BVC.send(ts_ptp_BnsUdReq(t_BVC_BLOCK_ACK(g_cfg.bvci), 0));
g_T1.stop;
- f_change_state(BVC_S_BLOCKED);
- }
- [g_T1.running] g_T1.timeout {
- f_sendBlock(BSSGP_CAUSE_OM_INTERVENTION);
+ f_ptp_change_state(BVC_S_BLOCKED);
}
- [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK_ACK(g_cfg.bvci), 0)) -> value udi {
+ /* BLOCK-ACK before T1 timeout: mark as blocked */
+ [g_T1.running and g_t1_waits_for_block_ack] BVC.receive(tr_ptp_BnsUdInd(t_BVC_BLOCK_ACK(g_cfg.bvci), 0)) -> value udi {
g_T1.stop;
- f_change_state(BVC_S_BLOCKED);
+ f_ptp_change_state(BVC_S_BLOCKED);
}
- [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi {
- g_T2.stop;
- f_change_state(BVC_S_UNBLOCKED);
+ /* Re-transmit BLOCK / UNBLOCK on T1 timeout */
+ [not g_t1_waits_for_block_ack] g_T1.timeout {
+ f_ptp_sendUnblock();
+ }
+ [g_t1_waits_for_block_ack] g_T1.timeout {
+ f_ptp_sendBlock(BSSGP_CAUSE_OM_INTERVENTION);
}
- /* simply acknowledge all Flow Control Messages */
- [g_cfg.sgsn_role] BSCP.receive(f_BnsUdInd(tr_BVC_FC_BVC, g_cfg.bvci)) -> value udi {
+ /* simply acknowledge all per-BVC Flow Control Messages */
+ [g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_FC_BVC, g_cfg.bvci)) -> value udi {
var OCT1 tag := udi.bssgp.pDU_BSSGP_FLOW_CONTROL_BVC.tag.unstructured_Value;
- BSCP.send(f_BnsUdReq(t_BVC_FC_BVC_ACK(tag), g_cfg.bvci));
+ BVC.send(ts_ptp_BnsUdReq(t_BVC_FC_BVC_ACK(tag), g_cfg.bvci));
}
/*
- [g_cfg.sgsn_role] BSCP.receive(f_BnsUdInd(t_BVC_FC_MS, g_cfg.bvci)) {
- BSCP.send(f_BnsUdReq(t_BVC_FC_MS_ACK, g_cfg.bvci));
+ [g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(t_BVC_FC_MS, g_cfg.bvci)) {
+ BVC.send(ts_ptp_BnsUdReq(t_BVC_FC_MS_ACK, g_cfg.bvci));
}
*/
-
- /* FIXME: CS PAGING: dispatch by IMSI */
-
- /* PS PAGING: dispatch by IMSI */
- [] BSCP.receive(f_BnsUdInd(tr_BSSGP_PS_PAGING(g_cfg.bvci), g_cfg.bvci)) -> value udi {
- var hexstring imsi := udi.bssgp.pDU_BSSGP_PAGING_PS.iMSI.digits
- vc_conn := f_tbl_comp_by_imsi(imsi);
- f_send_bssgp_dec(f_dec_bssgp(udi.bssgp), vc_conn);
- }
-
- /* Any other PTP BSSGP message: If it has TLLi, route to component; otherwise broadcast */
- [] BSCP.receive(f_BnsUdInd(?, g_cfg.bvci)) -> value udi {
+ /* Any other PTP BSSGP message: If it has TLLI, route to component; otherwise broadcast */
+ [] BVC.receive(tr_ptp_BnsUdInd(?, g_cfg.bvci)) -> value udi {
var BssgpDecoded dec := f_dec_bssgp(udi.bssgp);
var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp);
if (isvalue(tlli)) {
vc_conn := f_tbl_comp_by_tlli(valueof(tlli));
- f_send_bssgp_dec(dec, vc_conn);
+ f_send_bssgp_dec(dec, vc_conn, BSSGP_SP);
} else {
log("No TLLI: Broadcasting ", dec);
/* broadcast this message to all components */
// TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;"
for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {
- if (isbound(ClientTable[i].comp_ref)) {
- f_send_bssgp_dec(dec, ClientTable[i].comp_ref);
+ if (isbound(ClientTable[i].comp_ref) and ClientTable[i].comp_ref != null) {
+ f_send_bssgp_dec(dec, ClientTable[i].comp_ref, BSSGP_SP);
}
}
}
}
- /* Any other SIG BSSGP message: If it has TLLi, route to component; otherwise broadcast */
- [] BSCP.receive(f_BnsUdInd(?, 0)) -> value udi {
+ /* Any other SIG BSSGP message: If it has TLLI, route to component; otherwise broadcast */
+ [] BVC.receive(tr_ptp_BnsUdInd(?, 0)) -> value udi {
var BssgpDecoded dec := f_dec_bssgp(udi.bssgp);
var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp);
if (isvalue(tlli)) {
@@ -658,180 +1004,218 @@ altstep as_unblocked() runs on BSSGP_CT {
/* broadcast this message to all components */
// TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;"
for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {
- if (isbound(ClientTable[i].comp_ref)) {
+ if (isbound(ClientTable[i].comp_ref) and ClientTable[i].comp_ref != null) {
f_send_bssgp_dec(dec, ClientTable[i].comp_ref, BSSGP_SP_SIG);
}
}
}
}
-
- /* ConnHdlr sends BSSGP on BVCI=0 port: forward it to BSSGP Codec Port */
+ /* ConnHdlr sends BSSGP on BVCI=0 port: forward it to BSSGP_CT */
[] BSSGP_SP_SIG.receive(PDU_BSSGP:?)-> value bs_pdu sender vc_conn {
- BSCP.send(f_BnsUdReq(bs_pdu, 0));
+ BVC.send(ts_ptp_BnsUdReq(bs_pdu, 0));
}
- /* ConnHdlr sends BSSGP on BVCI=PTP port: forward it to BSSGP Codec Port */
- [] BSSGP_SP.receive(PDU_BSSGP:?) -> value bs_pdu sender vc_conn {
- BSCP.send(f_BnsUdReq(bs_pdu, g_cfg.bvci));
+ /* ConnHdlr sends BSSGP on BVCI=PTP port: forward it to BSSGP_CT */
+ [] BSSGP_SP.receive(PDU_BSSGP:?)-> value bs_pdu sender vc_conn {
+ BVC.send(ts_ptp_BnsUdReq(bs_pdu, g_cfg.bvci));
}
#ifdef BSSGP_EM_L3
/* ConnHdlr sends L3: Encode and send as UL_UD / DL_UD */
- [g_cfg.sgsn_role] BSSGP_SP.receive(PDU_L3_SGSN_MS:?) -> value l3_mt sender vc_conn {
+ [g_sgsn_role] BSSGP_SP.receive(PDU_L3_SGSN_MS:?) -> value l3_mt sender vc_conn {
var integer idx := f_tbl_idx_by_comp(vc_conn);
var octetstring l3_enc := enc_PDU_L3_SGSN_MS(l3_mt);
var BIT4 sapi := f_llc_sapi_by_l3_mt(l3_mt);
var integer n_u := f_llc_get_n_u_tx(ClientTable[idx].llc[bit2int(sapi)]);
var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u)));
- BSCP.send(f_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));
+ BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));
}
- [not g_cfg.sgsn_role] BSSGP_SP.receive(PDU_L3_MS_SGSN:?) -> value l3_mo sender vc_conn {
+ [not g_sgsn_role] BSSGP_SP.receive(PDU_L3_MS_SGSN:?) -> value l3_mo sender vc_conn {
var integer idx := f_tbl_idx_by_comp(vc_conn);
var octetstring l3_enc := enc_PDU_L3_MS_SGSN(l3_mo);
var BIT4 sapi := f_llc_sapi_by_l3_mo(l3_mo);
var integer n_u := f_llc_get_n_u_tx(ClientTable[idx].llc[bit2int(sapi)]);
var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u)));
- BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci));
+ BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, g_cfg.cell_id, llc_enc), g_cfg.bvci));
}
#endif
/* ConnHdlr sends raw LLC: Encode and send as UL_UD / DL_UD */
- [not g_cfg.sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {
+ [not g_sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {
var integer idx := f_tbl_idx_by_comp(vc_conn);
var octetstring llc_enc := enc_PDU_LLC(llc);
- BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci));
+ BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, g_cfg.cell_id, llc_enc), g_cfg.bvci));
}
- [g_cfg.sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {
+ [g_sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {
var integer idx := f_tbl_idx_by_comp(vc_conn);
var octetstring llc_enc := enc_PDU_LLC(llc);
- BSCP.send(f_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));
+ BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));
}
-
}
-function f_llc_get_n_u_tx(inout LLC_Entity llc) return uint9_t {
- var uint9_t ret := llc.n_u_tx_next;
- llc.n_u_tx_next := llc.n_u_tx_next + 1;
- return ret;
-}
+/* Events permitted in all states */
+private altstep as_ptp_allstate() runs on BSSGP_BVC_CT {
+ var NsUnitdataIndication udi;
+ var BSSGP_Client_CT vc_conn;
+ var OCT4 tlli, tlli_old;
+ var hexstring imsi;
-#ifdef BSSGP_EM_L3
-function f_llc_sapi_by_l3_mo(PDU_L3_MS_SGSN l3_mo) return BIT4 {
- if (ischosen(l3_mo.msgs.gprs_mm)) {
- return c_LLC_SAPI_LLGMM;
- } else if (ischosen(l3_mo.msgs.gprs_sm)) {
- return c_LLC_SAPI_LLGMM;
- } else if (ischosen(l3_mo.msgs.sms)) {
- return c_LLC_SAPI_LLSMS;
+ /* Signaling BVC was reset */
+ [] BVC.receive(BssgpResetIndication:{0}) {
+ if (not g_sgsn_role) {
+ f_ptp_change_state(BVC_S_BLOCKED);
+ /* when the BSS side signaling PTP is RESET, all PTP BVC must start the
+ * reset procedure */
+ f_ptp_sendReset();
+ } else {
+ f_ptp_change_state(BVC_S_UNBLOCKED);
+ }
}
- setverdict(fail, "No LLC SAPI for ", l3_mo);
- mtc.stop;
-}
-private function f_llc_sapi_by_l3_mt(PDU_L3_SGSN_MS l3_mt) return BIT4 {
- if (ischosen(l3_mt.msgs.gprs_mm)) {
- return c_LLC_SAPI_LLGMM;
- } else if (ischosen(l3_mt.msgs.gprs_sm)) {
- return c_LLC_SAPI_LLGMM;
- } else if (ischosen(l3_mt.msgs.sms)) {
- return c_LLC_SAPI_LLSMS;
+ /* we are a SGSN: BSS/PCU-originated RESET must have a cell ID */
+ [g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi {
+ log("Rx BVC-RESET from BVCI=", g_cfg.bvci);
+ /* Respond to RESET with correct BVCI but without CellID */
+ BVC.send(ts_ptp_BnsUdReq(ts_BVC_RESET_ACK(g_cfg.bvci, omit), 0));
+ /* FIXME: reset all state? What about clients? */
+ f_ptp_change_state(BVC_S_UNBLOCKED);
+ }
+ /* we are a BSS/PCU: SGSN-originated RESET must not have a cell ID */
+ [not g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, omit), 0)) -> value udi {
+ log("Rx BVC-RESET from BVCI=", g_cfg.bvci);
+ /* Respond to RESET with correct BVCI with CellID */
+ BVC.send(ts_ptp_BnsUdReq(ts_BVC_RESET_ACK(g_cfg.bvci, g_cfg.cell_id), 0));
+ /* FIXME: reset all state? What about clients? */
+ f_ptp_change_state(BVC_S_UNBLOCKED);
}
- setverdict(fail, "No LLC SAPI for ", l3_mt);
- mtc.stop;
-}
-#endif
+ /* Ignore those for now */
+ [] BVC.receive(ASP_Event:?) { }
+ [] BVC.receive(BssgpStatusIndication:?) { }
+ /* catch-all */
+ [] BVC.receive(tr_ptp_BnsUdInd(?, 0)) -> value udi {
+ setverdict(fail, "Received unexpected NS (SIG): ", udi);
+ }
+ [] BVC.receive(tr_ptp_BnsUdInd(?, ?)) -> value udi {
+ setverdict(fail, "Received unexpected NS (PTP): ", udi);
+ }
+ [] BVC.receive {
+ setverdict(fail, "Received unexpected message from BSSGP_CT");
+ }
-private function f_ScanEvents() runs on BSSGP_CT {
- log("matching against ", tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id));
+ /* registration/deregistration of Clients (per-TLLI components) */
+ [] BSSGP_PROC.getcall(BSSGP_register_client:{?,?}) -> param(imsi, tlli) sender vc_conn {
+ f_tbl_client_add(imsi, tlli, vc_conn);
+ BSSGP_PROC.reply(BSSGP_register_client:{imsi, tlli}) to vc_conn;
+ }
+ [] BSSGP_PROC.getcall(BSSGP_unregister_client:{?}) -> param(imsi) sender vc_conn {
+ f_tbl_client_del(imsi, vc_conn);
+ BSSGP_PROC.reply(BSSGP_unregister_client:{imsi}) to vc_conn;
+ }
+ [] BSSGP_PROC.getcall(BSSGP_llgmm_assign:{?,?}) -> param(tlli_old, tlli) sender vc_conn {
+ f_tbl_client_llgmm_assign(tlli_old, tlli, vc_conn);
+ BSSGP_PROC.reply(BSSGP_llgmm_assign:{tlli_old, tlli}) to vc_conn;
+ }
+}
+/* main loop for per-BVC component */
+private function f_bssgp_bvc_ScanEvents() runs on BSSGP_BVC_CT {
while (true) {
alt {
- [g_ptp_bvc_state == BVC_S_BLOCKED] as_blocked();
- [g_ptp_bvc_state == BVC_S_UNBLOCKED] as_unblocked();
- [] as_allstate();
+ [g_ptp_bvc_state == BVC_S_BLOCKED] as_ptp_blocked();
+ [g_ptp_bvc_state == BVC_S_UNBLOCKED] as_ptp_unblocked();
+ [] as_ptp_allstate();
}
- } /* while */
+ }
}
-/* PDU_BSSGP enhanced with LLC and possibly L3 decoded payloads */
-type record BssgpDecoded {
- PDU_BSSGP bssgp,
- PDU_LLC llc optional,
-#ifdef BSSGP_EM_L3
- PDU_L3_MS_SGSN l3_mo optional,
- PDU_L3_SGSN_MS l3_mt optional,
-#endif
- PDU_SN sndcp optional
+/* main function for per-BVC Component */
+private function f_bssgp_bvc_main(BssgpBvcConfig cfg, boolean sgsn_role, charstring id) runs on BSSGP_BVC_CT {
+ g_cfg := cfg;
+ g_sgsn_role := sgsn_role;
+ f_bssgp_bvc_ScanEvents();
}
-/* Decode a PDU_BSSGP into a BssgpDecoded (i.e. with LLC/L3 decoded, as applicable) */
-private function f_dec_bssgp(PDU_BSSGP bssgp) runs on BSSGP_CT return BssgpDecoded {
- var BssgpDecoded dec := {
- bssgp := bssgp,
- llc := omit,
-#ifdef BSSGP_EM_L3
- l3_mo := omit,
- l3_mt := omit,
-#endif
- sndcp := omit
- };
+template (value) NsUnitdataRequest ts_ptp_BnsUdReq(template (value) PDU_BSSGP pdu, template (value) BssgpBvci bvci) := {
+ bvci := bvci,
+ nsei := 0, // overwritten in BSSGP_CT
+ /* for some weird reason we get "Dynamic test case error: Text encoder: Encoding an
+ * unbound integer value." when trying to send the reocrd rather than the octetstring */
+ //sdu := omit,
+ //bssgp := valueof(pdu)
+ sdu := enc_PDU_BSSGP(valueof(pdu)),
+ bssgp := omit
+}
- /* Decode LLC, if it is a PDU that contains LLC */
- if (g_cfg.depth >= BSSGP_DECODE_DEPTH_LLC) {
- if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) {
- dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_DL_UNITDATA.lLC_PDU.lLC_PDU);
- } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) {
- dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU);
- }
- }
+template (present) NsUnitdataIndication tr_ptp_BnsUdInd(template (present) PDU_BSSGP pdu, template (present) BssgpBvci bvci) := {
+ bvci := bvci,
+ nsei := ?,
+ sdu := *,
+ bssgp := pdu
+}
- /* Decode SNDCP, if it is a LLC PDU containing user plane data */
- if (g_cfg.depth >= BSSGP_DECODE_DEPTH_SNDCP) {
- if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) {
- dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI);
- }
+/* change state of PTP BVC; broadcast state change to clients */
+private function f_ptp_change_state(BvcState new_state) runs on BSSGP_BVC_CT {
+ if (new_state == g_ptp_bvc_state) {
+ return;
}
-
-#ifdef BSSGP_EM_L3
- /* Decode L3, if it is a LLC PDU containing L3 */
- if (g_cfg.depth >= BSSGP_DECODE_DEPTH_L3) {
- if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_L3)) {
- if (g_cfg.sgsn_role) {
- dec.l3_mo := dec_PDU_L3_MS_SGSN(dec.llc.pDU_LLC_UI.information_field_UI);
- } else {
- dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI);
- }
+ log("BVCI(", g_cfg.bvci, ") State Transition: ", g_ptp_bvc_state, " -> ", new_state);
+ g_ptp_bvc_state := new_state;
+ for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {
+ if (isbound(ClientTable[i].comp_ref) and ClientTable[i].comp_ref != null) {
+ BSSGP_SP.send(ts_BssgpStsInd(omit, g_cfg.bvci, g_ptp_bvc_state)) to ClientTable[i].comp_ref;
}
}
-#endif
-
- return dec;
-}
-
-function f_bssgp_client_register(hexstring imsi, OCT4 tlli, BssgpCellId cell_id, BSSGP_PROC_PT PT := BSSGP_PROC[0])
-runs on BSSGP_Client_CT {
- PT.call(BSSGP_register_client:{imsi, tlli, cell_id}) {
- [] PT.getreply(BSSGP_register_client:{imsi, tlli, cell_id}) {};
- }
}
-function f_bssgp_client_unregister(hexstring imsi, BSSGP_PROC_PT PT := BSSGP_PROC[0])
-runs on BSSGP_Client_CT {
- PT.call(BSSGP_unregister_client:{imsi}) {
- [] PT.getreply(BSSGP_unregister_client:{imsi}) {};
+/* attempt to extract the TLLI from a BSSGP PDU */
+function f_bssgp_get_tlli(PDU_BSSGP bssgp) return template OCT4 {
+ if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) {
+ return bssgp.pDU_BSSGP_DL_UNITDATA.tLLI_current;
+ } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) {
+ return bssgp.pDU_BSSGP_UL_UNITDATA.tLLI;
+ } else if (ischosen(bssgp.pDU_BSSGP_RA_CAPABILITY)) {
+ return bssgp.pDU_BSSGP_RA_CAPABILITY.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE)) {
+ return bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK)) {
+ return bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_RADIO_STATUS)) {
+ return bssgp.pDU_BSSGP_RADIO_STATUS.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_SUSPEND)) {
+ return bssgp.pDU_BSSGP_SUSPEND.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_SUSPEND_ACK)) {
+ return bssgp.pDU_BSSGP_SUSPEND_ACK.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_SUSPEND_NACK)) {
+ return bssgp.pDU_BSSGP_SUSPEND_NACK.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_RESUME)) {
+ return bssgp.pDU_BSSGP_RESUME.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_RESUME_ACK)) {
+ return bssgp.pDU_BSSGP_RESUME_ACK.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_RESUME_NACK)) {
+ return bssgp.pDU_BSSGP_RESUME_NACK.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_FLUSH_LL)) {
+ return bssgp.pDU_BSSGP_FLUSH_LL.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_FLUSH_LL_ACK)) {
+ return bssgp.pDU_BSSGP_FLUSH_LL_ACK.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_LLC_DISCARDED)) {
+ return bssgp.pDU_BSSGP_LLC_DISCARDED.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_LLC_DISCARDED)) {
+ return bssgp.pDU_BSSGP_LLC_DISCARDED.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_PAGING_CS) and
+ isvalue(bssgp.pDU_BSSGP_PAGING_CS.tLLI)) {
+ return bssgp.pDU_BSSGP_PAGING_CS.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_FLOW_CONTROL_MS)) {
+ return bssgp.pDU_BSSGP_FLOW_CONTROL_MS.tLLI.tLLI_Value;
+ } else if (ischosen(bssgp.pDU_BSSGP_FLOW_CONTROL_MS_ACK)) {
+ return bssgp.pDU_BSSGP_FLOW_CONTROL_MS_ACK.tLLI.tLLI_Value;
}
+ /* TODO: Handover, PFC, LCS */
+ return omit;
}
-/* TS 44.064 7.2.1.1 LLGMM-ASSIGN */
-function f_bssgp_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_PROC_PT PT := BSSGP_PROC[0])
-runs on BSSGP_Client_CT {
- PT.call(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {
- [] PT.getreply(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {};
- }
-}
}
diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn
index c5b0953d..8101712e 100644
--- a/library/Osmocom_Gb_Types.ttcn
+++ b/library/Osmocom_Gb_Types.ttcn
@@ -1555,6 +1555,74 @@ octetstring sdu) := {
}
+/* extract the BVCI IE of given PDU + return it */
+function f_BSSGP_BVCI_IE_get(PDU_BSSGP pdu) return template (omit) BVCI {
+ select (pdu) {
+ case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL:=?}) {
+ return pdu.pDU_BSSGP_FLUSH_LL.bVCI_old;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL_ACK:=?}) {
+ return pdu.pDU_BSSGP_FLUSH_LL_ACK.bVCI_new;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_LLC_DISCARDED:=?}) {
+ return pdu.pDU_BSSGP_LLC_DISCARDED.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK:=?}) {
+ return pdu.pDU_BSSGP_BVC_BLOCK.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK_ACK:=?}) {
+ return pdu.pDU_BSSGP_BVC_BLOCK_ACK.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK:=?}) {
+ return pdu.pDU_BSSGP_BVC_UNBLOCK.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK_ACK:=?}) {
+ return pdu.pDU_BSSGP_BVC_UNBLOCK_ACK.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET:=?}) {
+ return pdu.pDU_BSSGP_BVC_RESET.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET_ACK:=?}) {
+ return pdu.pDU_BSSGP_BVC_RESET_ACK.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_STATUS:=?}) {
+ return pdu.pDU_BSSGP_STATUS.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_REQUEST:=?}) {
+ return pdu.pDU_BSSGP_PERFORM_LOCATION_REQUEST.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_RESPONSE:=?}) {
+ return pdu.pDU_BSSGP_PERFORM_LOCATION_RESPONSE.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_ABORT:=?}) {
+ return pdu.pDU_BSSGP_PERFORM_LOCATION_ABORT.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_POSITION_COMMAND:=?}) {
+ return pdu.pDU_BSSGP_POSITION_COMMAND.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_POSITION_RESPONSE:=?}) {
+ return pdu.pDU_BSSGP_POSITION_RESPONSE.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_PAGING_PS:={?,?,*,{bVCI:=?},*,*,?,*,*}}) {
+ return pdu.pDU_BSSGP_PAGING_PS.paging_Field4.bVCI;
+ }
+ case (PDU_BSSGP:{pDU_BSSGP_PAGING_CS:={?,?,?,{bVCI:=?},*,*,*,*,*}}) {
+ return pdu.pDU_BSSGP_PAGING_CS.paging_Field4.bVCI;
+ }
+ case else {
+ return omit;
+ }
+ }
+}
+
+/* extract the BVCI IE of given PDU + convert it to integer value */
+function f_BSSGP_BVCI_get(PDU_BSSGP pdu) return template (omit) BssgpBvci {
+ var template (omit) BVCI bvci_raw := f_BSSGP_BVCI_IE_get(pdu);
+ if (istemplatekind(bvci_raw, "omit")) {
+ return omit;
+ }
+ return oct2int(valueof(bvci_raw.unstructured_value));
+}
} with { encode "RAW" };
diff --git a/pcu/PCU_Tests.default b/pcu/PCU_Tests.default
index a2dba4f2..99440435 100644
--- a/pcu/PCU_Tests.default
+++ b/pcu/PCU_Tests.default
@@ -10,18 +10,23 @@ ConsoleMask := ERROR | WARNING | TESTCASE | TIMEROP_START | DEBUG_ENCDEC | USER
[MODULE_PARAMETERS]
SGSN_Components.mp_gb_cfg := {
nsei := 1234,
- bvci := 1234,
- cell_id := {
- ra_id := {
- lai := {
- mcc_mnc := '262F42'H, lac := 13135
+ sgsn_role := true,
+ bvc := {
+ {
+ bvci := 1234,
+ cell_id := {
+ ra_id := {
+ lai := {
+ mcc_mnc := '262F42'H, lac := 13135
+ },
+ rac := 0
+ },
+ cell_id := 20960
},
- rac := 0
- },
- cell_id := 20960
- },
- sgsn_role := true
-}
+ depth := BSSGP_DECODE_DEPTH_BSSGP
+ }
+ }
+};
Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoPCU";
PCUIF_Types.mp_pcuif_version := 10;
StatsD_Checker.mp_enable_stats := true;
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index f68485a2..b2f8b756 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -83,7 +83,7 @@ friend template (value) PCUIF_info_ind ts_PCUIF_INFO_default := {
cell_id := 20960,
repeat_time := 5 * 50,
repeat_count := 3,
- bvci := mp_gb_cfg.bvci,
+ bvci := mp_gb_cfg.bvc[0].bvci,
t3142 := 20,
t3169 := 5,
t3191 := 5,
@@ -215,12 +215,12 @@ runs on RAW_PCU_Test_CT {
activate(as_Tguard_RAW());
/* Init PCU interface component */
- vc_PCUIF := RAW_PCUIF_CT.create("PCUIF-" & id);
+ vc_PCUIF := RAW_PCUIF_CT.create("PCUIF");
connect(vc_PCUIF:MTC, self:PCUIF);
map(vc_PCUIF:PCU, system:PCU);
/* Create one BTS component (we may want more some day) */
- vc_BTS := RAW_PCU_BTS_CT.create("BTS-" & id);
+ vc_BTS := RAW_PCU_BTS_CT.create("BTS");
connect(vc_BTS:PCUIF, vc_PCUIF:BTS);
connect(vc_BTS:TC, self:BTS);
@@ -239,7 +239,7 @@ runs on RAW_PCU_Test_CT {
}
testcase TC_pcuif_suspend() runs on RAW_PCU_Test_CT {
- var octetstring ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.cell_id.ra_id);
+ var octetstring ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.bvc[0].cell_id.ra_id);
var GprsTlli tlli := 'FFFFFFFF'O;
timer T;
@@ -256,7 +256,7 @@ testcase TC_pcuif_suspend() runs on RAW_PCU_Test_CT {
T.start(2.0);
alt {
- [] BSSGP_SIG[0].receive(tr_BSSGP_SUSPEND(tlli, mp_gb_cfg.cell_id.ra_id)) {
+ [] BSSGP_SIG[0].receive(tr_BSSGP_SUSPEND(tlli, mp_gb_cfg.bvc[0].cell_id.ra_id)) {
setverdict(pass);
}
[] T.timeout {
@@ -890,7 +890,7 @@ testcase TC_countdown_procedure() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
/* receive one message on BSSGP with all aggregated data in payload: */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, total_payload));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, total_payload));
}
/* Verify PCU handles correctly CS1..4 with all possible LLC payload sizes fitting alone in one RLC block */
@@ -936,7 +936,7 @@ testcase TC_ul_all_sizes() runs on RAW_PCU_Test_CT {
/* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
/* receive one message on BSSGP with all aggregated data in payload: */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, payload));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, payload));
/* Test sending LLC PDUS of incrementing size */
var integer max_size := 49;
@@ -962,7 +962,7 @@ testcase TC_ul_all_sizes() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ul_data);
/* receive one message on BSSGP with all aggregated data in payload: */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, payload));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, payload));
/* we will receive UL ACK/NACK from time to time, handle it. */
f_rx_rlcmac_dl_block(dl_block, dl_fn);
@@ -1007,7 +1007,7 @@ function f_TC_ul_data_toolong_fills_padding_cs(inout GprsMS ms, CodingScheme cs,
T.start(0.5);
alt {
- [] BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, ?)) {
+ [] BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, ?)) {
setverdict(fail, "LLC PDU in Malformed RLC block was forwarded");
f_shutdown(__BFILE__, __LINE__);
}
@@ -1082,7 +1082,7 @@ private function f_TC_mo_ping_pong_1phase_access(template (present) CodingScheme
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
/* UL block should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));
/* Now SGSN sends some DL data, PCU will page on CCCH (PCH) */
BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data));
@@ -1172,7 +1172,7 @@ runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
/* UL block should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));
/* Now SGSN sends some DL data, PCU will page on PACCH */
BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data));
@@ -1287,7 +1287,7 @@ private function f_TC_mt_ping_pong(template (omit) MSRadioAccessCapabilityV_BSSG
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
/* UL block should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));
f_shutdown(__BFILE__, __LINE__, final := true);
}
@@ -1383,7 +1383,7 @@ testcase TC_ul_intermediate_retrans() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
/* receive one message on BSSGP with all aggregated data in payload: */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, total_payload));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, total_payload));
}
/* Verify that if PCU doesn't get an ACK for first DL block after IMM ASS, it
@@ -1581,7 +1581,7 @@ testcase TC_ul_flow_multiple_llc_blocks() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ul_data);
/* UL block dataA should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, dataA));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataA));
/* UL RlcDataBlock(dataB finished, dataC starts and finishes, dataD starts) [BSN=2, CV=1] */
ul_data := t_RLCMAC_UL_DATA_TLLI(tfi := ms.ul_tbf.tfi,
@@ -1598,8 +1598,8 @@ testcase TC_ul_flow_multiple_llc_blocks() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ul_data);
/* UL block dataB and dataC should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, dataB));
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, dataC));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataB));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataC));
/* UL RlcDataBlock(dataD finishes) [BSN=3, CV=0] */
ul_data := t_RLCMAC_UL_DATA_TLLI(tfi := ms.ul_tbf.tfi,
@@ -1613,7 +1613,7 @@ testcase TC_ul_flow_multiple_llc_blocks() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ul_data);
/* UL block dataB and dataD should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, dataD));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataD));
f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn);
/* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */
@@ -1656,7 +1656,7 @@ testcase TC_ul_tbf_reestablish_with_pkt_resource_req() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true);
/* UL block should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));
acknack_tmpl := tr_RLCMAC_UL_ACK_NACK_GPRS(ms.ul_tbf.tfi,
tr_UlAckNackGprs(ms.tlli,
@@ -1677,7 +1677,7 @@ testcase TC_ul_tbf_reestablish_with_pkt_resource_req() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := false); /* TODO: send using cs_mcs */
/* UL block should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));
f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn, acknack_tmpl);
/* ACK the ACK */
@@ -1811,7 +1811,7 @@ testcase TC_paging_cs_from_sgsn_sign() runs on RAW_PCU_Test_CT {
}
testcase TC_paging_cs_from_sgsn_ptp() runs on RAW_PCU_Test_CT {
- f_tc_paging_cs_from_sgsn(mp_gb_cfg.bvci);
+ f_tc_paging_cs_from_sgsn(mp_gb_cfg.bvc[0].bvci);
}
/* Test PS paging over Gb (SGSN->PCU->BTS[CCCH]).
@@ -1858,7 +1858,7 @@ testcase TC_paging_ps_from_sgsn_sign() runs on RAW_PCU_Test_CT {
}
testcase TC_paging_ps_from_sgsn_ptp() runs on RAW_PCU_Test_CT {
- f_tc_paging_ps_from_sgsn(mp_gb_cfg.bvci);
+ f_tc_paging_ps_from_sgsn(mp_gb_cfg.bvc[0].bvci);
}
/* Verify osmo-pcu handles DL UNIT_DATA from SGSN with IMSI IE correctly. See OS#4729 */
@@ -1894,7 +1894,7 @@ testcase TC_bssgp_dl_unitdata_with_valid_imsi() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
/* UL block should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));
/* Now SGSN sends some DL data, PCU will page on CCCH (PCH) */
BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, imsi := ts_BSSGP_IMSI(ms.imsi)));
@@ -1953,7 +1953,7 @@ testcase TC_bssgp_dl_unitdata_with_invalid_imsi() runs on RAW_PCU_Test_CT {
f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
/* UL block should be received in SGSN */
- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));
+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));
/* Now SGSN sends some DL data with an invalid IMSI */
BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, imsi := ts_BSSGP_IMSI('1122'H)));
diff --git a/pcu/PCU_Tests_NS.ttcn b/pcu/PCU_Tests_NS.ttcn
index 6a62f292..5ab5f8d8 100644
--- a/pcu/PCU_Tests_NS.ttcn
+++ b/pcu/PCU_Tests_NS.ttcn
@@ -55,7 +55,7 @@ function f_init_pcuif() runs on RAW_PCU_CT {
/* Wait for PCU_VERSION and return INFO_IND */
PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, ?)));
- /* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */
+ /* FIXME: make sure to use parameters from mp_gb_cfg.bvc[0].cell_id in the PCU INFO IND */
var template PCUIF_Message info_ind_msg := ts_PCUIF_INFO_IND(0, info_ind);
PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind_msg));
}
@@ -194,16 +194,16 @@ testcase TC_ns_full_bringup() runs on RAW_Test_CT {
/* Expect BVC-RESET for signaling (0) and ptp BVCI */
if (mp_tolerate_bvc_reset_cellid) {
- as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true);
+ as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.bvc[0].cell_id, oneshot := true);
} else {
as_rx_bvc_reset_tx_ack(0, omit, oneshot := true);
}
- as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true);
- as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);
+ as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, oneshot := true);
+ as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);
/* wait for one FLOW-CONTROL BVC and then ACK any further in the future */
- as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true);
- activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci));
+ as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);
+ activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci));
setverdict(pass);
}
diff --git a/pcu/PCU_Tests_SNS.ttcn b/pcu/PCU_Tests_SNS.ttcn
index 524d35cf..dc4cd82c 100644
--- a/pcu/PCU_Tests_SNS.ttcn
+++ b/pcu/PCU_Tests_SNS.ttcn
@@ -187,13 +187,13 @@ testcase TC_sns_so_config_success() runs on RAW_Test_CT {
f_outgoing_ns_alive();
/* Expect BVC-RESET for signaling (0) and ptp BVCI */
- as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true);
- as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true);
- as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);
+ as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.bvc[0].cell_id, oneshot := true);
+ as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, oneshot := true);
+ as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);
/* wait for one FLOW-CONTROL BVC and then ACK any further in the future */
- as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true);
- activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci));
+ as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);
+ activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci));
setverdict(pass);
}
@@ -220,20 +220,20 @@ private function f_sns_bringup_1c1u(boolean sgsn_originated_reset := false) runs
f_outgoing_ns_alive(1);
if (sgsn_originated_reset) {
- f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.cell_id);
- f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id);
+ f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.bvc[0].cell_id);
+ f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id);
} else {
/* Expect BVC-RESET for signaling (0) and ptp BVCI */
- as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true);
- as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true);
+ as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.bvc[0].cell_id, oneshot := true);
+ as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, oneshot := true);
}
/* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==0) */
- as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);
+ as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);
/* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow
* control happens on the p-t-p BVCI and hence on index 1 */
- as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 1);
- activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, idx := 1));
+ as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 1);
+ activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, idx := 1));
}
/* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only */
@@ -270,20 +270,20 @@ private function f_sns_bringup_1c1u_separate(boolean sgsn_originated_reset := fa
f_outgoing_ns_alive_no_ack(idx := 0);
if (sgsn_originated_reset) {
- f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.cell_id, idx := 1);
- f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, idx := 1);
+ f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.bvc[0].cell_id, idx := 1);
+ f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, idx := 1);
} else {
/* Expect BVC-RESET for signaling BVCI=0 and ptp BVCI */
- as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true, idx := 1);
- as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true, idx := 1);
+ as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.bvc[0].cell_id, oneshot := true, idx := 1);
+ as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, oneshot := true, idx := 1);
}
/* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==1) */
- as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 1);
+ as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 1);
/* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow
* control happens on the p-t-p BVCI and hence on index 1 */
- as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 2);
- activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, idx := 2));
+ as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 2);
+ activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, idx := 2));
}
/* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only - and where
@@ -322,8 +322,8 @@ testcase TC_sns_1c1u_so_bvc_reset_too_early() runs on RAW_Test_CT {
f_outgoing_ns_alive_no_ack(idx := 0);
/* Transmit BVC-RESET and expect no ACK*/
- f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.cell_id, idx := 1, exp_ack := false);
- f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, idx := 1, exp_ack := false);
+ f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.bvc[0].cell_id, idx := 1, exp_ack := false);
+ f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, idx := 1, exp_ack := false);
}
/* Test adding new IP endpoints at runtime */
diff --git a/pcu/SGSN_Components.ttcn b/pcu/SGSN_Components.ttcn
index 4a94c034..2f1fa75c 100644
--- a/pcu/SGSN_Components.ttcn
+++ b/pcu/SGSN_Components.ttcn
@@ -20,18 +20,22 @@ import from GPRS_Context all;
modulepar {
BssgpConfig mp_gb_cfg := {
nsei := 1234,
- bvci := 1234,
- cell_id := {
- ra_id := {
- lai := {
- mcc_mnc := '262F42'H, lac := 13135
- },
- rac := 0
- },
- cell_id := 20960
- },
sgsn_role := true,
- depth := BSSGP_DECODE_DEPTH_BSSGP
+ bvc := {
+ {
+ bvci := 1234,
+ cell_id := {
+ ra_id := {
+ lai := {
+ mcc_mnc := '262F42'H, lac := 13135
+ },
+ rac := 0
+ },
+ cell_id := 20960
+ },
+ depth := BSSGP_DECODE_DEPTH_BSSGP
+ }
+ }
};
NSConfiguration mp_nsconfig := {
@@ -55,6 +59,7 @@ modulepar {
type component bssgp_CT extends BSSGP_Client_CT {
var NS_CT ns_component;
var BSSGP_CT bssgp_component;
+ port BSSGP_CT_PROC_PT PROC;
var boolean g_initialized := false;
}
@@ -75,16 +80,22 @@ function f_init_bssgp() runs on bssgp_CT {
/* create a new NS component */
ns_component := NS_CT.create;
bssgp_component := BSSGP_CT.create;
- /* connect our BSSGP port to the BSSGP Emulation */
- connect(self:BSSGP[0], bssgp_component:BSSGP_SP);
- connect(self:BSSGP_SIG[0], bssgp_component:BSSGP_SP_SIG);
- connect(self:BSSGP_PROC[0], bssgp_component:BSSGP_PROC);
/* connect lower-end of BSSGP with BSSGP_CODEC_PORT (maps to NS_PT*/
connect(bssgp_component:BSCP, ns_component:NS_SP);
+ connect(self:PROC, bssgp_component:PROC);
ns_component.start(NSStart(mp_nsconfig));
- bssgp_component.start(BssgpStart(mp_gb_cfg));
+ bssgp_component.start(BssgpStart(mp_gb_cfg, testcasename()));
- f_bssgp_client_register(mmctx.imsi, mmctx.tlli, mp_gb_cfg.cell_id);
+ for (var integer i := 0; i < lengthof(mp_gb_cfg.bvc); i := i+1) {
+ var BSSGP_BVC_CT vc_BVC;
+ /* obtain reference for BVC component (created by BssgpStart) */
+ vc_BVC := f_bssgp_get_bvci_ct(mp_gb_cfg.bvc[i].bvci, PROC);
+ /* connect our BSSGP port to the BSSGP Emulation */
+ connect(self:BSSGP[i], vc_BVC:BSSGP_SP);
+ connect(self:BSSGP_SIG[i], vc_BVC:BSSGP_SP_SIG);
+ connect(self:BSSGP_PROC[i], vc_BVC:BSSGP_PROC);
+ f_bssgp_client_register(mmctx.imsi, mmctx.tlli);
+ }
}
/* Establish BSSGP connection to PCU */
@@ -93,7 +104,7 @@ function f_bssgp_establish() runs on BSSGP_Client_CT {
T.start
alt {
- [] BSSGP[0].receive(t_BssgpStsInd(?, ?, BVC_S_UNBLOCKED)) { }
+ [] BSSGP[0].receive(tr_BssgpStsInd(*, ?, BVC_S_UNBLOCKED)) { }
[] BSSGP[0].receive { repeat; }
[] T.timeout {
setverdict(fail, "Timeout establishing BSSGP connection");
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 8a87ee27..53ecdff3 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -130,9 +130,11 @@ modulepar {
}
};
+const integer NUM_BVC_PER_NSE := 1;
type record GbInstance {
NS_CT vc_NS,
BSSGP_CT vc_BSSGP,
+ BSSGP_BVC_CT vc_BSSGP_BVC[NUM_BVC_PER_NSE],
BssgpConfig cfg
};
@@ -154,6 +156,9 @@ type component test_CT {
/* only to get events from IPA underneath GSUP */
port IPA_CTRL_PT GSUP_IPA_EVENT;
+ /* only needed at start to get the per-BVC references */
+ port BSSGP_CT_PROC_PT PROC;
+
var GTP_Emulation_CT vc_GTP;
port TELNETasp_PT SGSNVTY;
@@ -223,7 +228,13 @@ private function f_init_gb(inout GbInstance gb, charstring id, integer offset) r
connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP);
gb.vc_NS.start(NSStart(mp_nsconfig[offset]));
- gb.vc_BSSGP.start(BssgpStart(gb.cfg));
+ gb.vc_BSSGP.start(BssgpStart(gb.cfg, testcasename()));
+ /* resolve the per-BVC component references */
+ for (var integer i := 0; i < lengthof(gb.cfg.bvc); i := i+1) {
+ connect(self:PROC, gb.vc_BSSGP:PROC);
+ gb.vc_BSSGP_BVC[i] := f_bssgp_get_bvci_ct(gb.cfg.bvc[i].bvci, PROC);
+ disconnect(self:PROC, gb.vc_BSSGP:PROC);
+ }
}
private function f_init_gsup(charstring id) runs on test_CT {
@@ -297,45 +308,63 @@ function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT {
g_initialized := true;
g_gb[0].cfg := {
nsei := 96,
- bvci := 196,
- cell_id := {
- ra_id := {
- lai := {
- mcc_mnc := mcc_mnc, lac := 13135},
- rac := 0
- },
- cell_id := 20960
- },
sgsn_role := false,
- depth := BSSGP_DECODE_DEPTH_L3
+ bvc := {
+ {
+ bvci := 196,
+ cell_id := {
+ ra_id := {
+ lai := {
+ mcc_mnc := mcc_mnc,
+ lac := 13135
+ },
+ rac := 0
+ },
+ cell_id := 20960
+ },
+ depth := BSSGP_DECODE_DEPTH_L3
+ }
+ }
};
g_gb[1].cfg := {
nsei := 97,
- bvci := 210,
- cell_id := {
- ra_id := {
- lai := {
- mcc_mnc := mcc_mnc, lac := 13200},
- rac := 0
- },
- cell_id := 20961
- },
sgsn_role := false,
- depth := BSSGP_DECODE_DEPTH_L3
+ bvc := {
+ {
+ bvci := 210,
+ cell_id := {
+ ra_id := {
+ lai := {
+ mcc_mnc := mcc_mnc,
+ lac := 13200
+ },
+ rac := 0
+ },
+ cell_id := 20961
+ },
+ depth := BSSGP_DECODE_DEPTH_L3
+ }
+ }
};
g_gb[2].cfg := {
nsei := 98,
- bvci := 220,
- cell_id := {
- ra_id := {
- lai := {
- mcc_mnc := mcc_mnc, lac := 13300},
- rac := 0
- },
- cell_id := 20962
- },
sgsn_role := false,
- depth := BSSGP_DECODE_DEPTH_L3
+ bvc := {
+ {
+ bvci := 220,
+ cell_id := {
+ ra_id := {
+ lai := {
+ mcc_mnc := mcc_mnc,
+ lac := 13300
+ },
+ rac := 0
+ },
+ cell_id := 20962
+ },
+ depth := BSSGP_DECODE_DEPTH_L3
+ }
+ }
};
f_init_vty();
@@ -413,7 +442,11 @@ runs on test_CT return BSSGP_ConnHdlr {
tlli := f_gprs_tlli_random(),
tlli_old := omit,
ra := omit,
- bssgp_cell_id := { gb[0].cfg.cell_id, gb[1].cfg.cell_id, gb[2].cfg.cell_id },
+ bssgp_cell_id := {
+ gb[0].cfg.bvc[0].cell_id,
+ gb[1].cfg.bvc[0].cell_id,
+ gb[2].cfg.bvc[0].cell_id
+ },
rnc_send_initial_ue := true,
vec := omit,
net := net_pars,
@@ -428,15 +461,18 @@ runs on test_CT return BSSGP_ConnHdlr {
}
vc_conn := BSSGP_ConnHdlr.create(id);
- connect(vc_conn:BSSGP[0], gb[0].vc_BSSGP:BSSGP_SP);
- connect(vc_conn:BSSGP_SIG[0], gb[0].vc_BSSGP:BSSGP_SP_SIG);
- connect(vc_conn:BSSGP_PROC[0], gb[0].vc_BSSGP:BSSGP_PROC);
- connect(vc_conn:BSSGP[1], gb[1].vc_BSSGP:BSSGP_SP);
- connect(vc_conn:BSSGP_SIG[1], gb[1].vc_BSSGP:BSSGP_SP_SIG);
- connect(vc_conn:BSSGP_PROC[1], gb[1].vc_BSSGP:BSSGP_PROC);
- connect(vc_conn:BSSGP[2], gb[2].vc_BSSGP:BSSGP_SP);
- connect(vc_conn:BSSGP_SIG[2], gb[2].vc_BSSGP:BSSGP_SP_SIG);
- connect(vc_conn:BSSGP_PROC[2], gb[2].vc_BSSGP:BSSGP_PROC);
+
+ connect(vc_conn:BSSGP[0], gb[0].vc_BSSGP_BVC[0]:BSSGP_SP);
+ connect(vc_conn:BSSGP_SIG[0], gb[0].vc_BSSGP_BVC[0]:BSSGP_SP_SIG);
+ connect(vc_conn:BSSGP_PROC[0], gb[0].vc_BSSGP_BVC[0]:BSSGP_PROC);
+
+ connect(vc_conn:BSSGP[1], gb[1].vc_BSSGP_BVC[0]:BSSGP_SP);
+ connect(vc_conn:BSSGP_SIG[1], gb[1].vc_BSSGP_BVC[0]:BSSGP_SP_SIG);
+ connect(vc_conn:BSSGP_PROC[1], gb[1].vc_BSSGP_BVC[0]:BSSGP_PROC);
+
+ connect(vc_conn:BSSGP[2], gb[2].vc_BSSGP_BVC[0]:BSSGP_SP);
+ connect(vc_conn:BSSGP_SIG[2], gb[2].vc_BSSGP_BVC[0]:BSSGP_SP_SIG);
+ connect(vc_conn:BSSGP_PROC[2], gb[2].vc_BSSGP_BVC[0]:BSSGP_PROC);
/* FIXME: support multiple RNCs */
if (g_ranap_enable) {
@@ -470,7 +506,7 @@ runs on BSSGP_ConnHdlr {
llc := f_llc_create(false);
/* register with BSSGP core */
- f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id[0]);
+ f_bssgp_client_register(g_pars.imsi, g_pars.tlli);
/* tell GSUP dispatcher to send this IMSI to us */
f_create_gsup_expect(hex2str(g_pars.imsi));
/* tell GTP dispatcher to send this IMSI to us */
@@ -1091,7 +1127,7 @@ private function f_TC_attach_closed_foreign(charstring id) runs on BSSGP_ConnHdl
/* Simulate a foreign IMSI */
g_pars.imsi := '001010123456789'H;
- f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id[0]);
+ f_bssgp_client_register(g_pars.imsi, g_pars.tlli);
g_pars.net.expect_auth := false;
@@ -2344,7 +2380,7 @@ private function f_TC_attach_closed_imsi_added(charstring id) runs on BSSGP_Conn
f_bssgp_client_unregister(g_pars.imsi);
/* Simulate a foreign IMSI */
g_pars.imsi := '001010123456700'H;
- f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id[0]);
+ f_bssgp_client_register(g_pars.imsi, g_pars.tlli);
/* there is no auth */
g_pars.net.expect_auth := false;
@@ -2522,7 +2558,7 @@ private function f_TC_attach_rau_a_b(charstring id) runs on BSSGP_ConnHdlr {
log("rau complete unregistering");
f_bssgp_client_unregister(g_pars.imsi);
- f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id[1], BSSGP_PROC[1]);
+ f_bssgp_client_register(g_pars.imsi, g_pars.tlli, BSSGP_PROC[1]);
log("sending second RAU via different RA");
f_routing_area_update(f_cellid_to_RAI(g_pars.bssgp_cell_id[1]), 1);