diff --git a/library/BSSGP_Emulation.ttcnpp b/library/BSSGP_Emulation.ttcnpp
index c1d297d..81b3c5b 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 @@
 }
 
 /***********************************************************************
- * 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 @@
 		;
 } 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,60 +140,506 @@
 } 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();
+
+	/* 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();
 }
 
-private function f_init() runs on BSSGP_CT {
-	/* Connect the UDP socket */
-	f_change_state(BVC_S_BLOCKED);
-}
-
+/* 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 */
+
+	/* control by the user */
+	port BSSGP_CT_PROC_PT PROC;
+
+	var BssgpConfig g_cfg;
+
+	/* Signaling BVC (BVCI=0) */
+	var BvcState g_sign_bvc_state := BVC_S_WAIT_RESET;
+	timer g_T2 := 60.0;
+
+	/* port to per-BVC components */
+	port BSSGP_BVC_SP_PT BVC;
+	/* per-BVC state table */
+	var BvcEntity BvcTable[16];
+};
+
+/* 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,
+	/* reference to the per-BVC/cell component */
+	BSSGP_BVC_CT comp_ref
+};
+
+/* 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;
+
+	for (i := 0; i < lengthof(BvcTable); i := i+1) {
+		if (BvcTable[i].bvci == bvci) {
+			return BvcTable[i].comp_ref;
+		}
+	}
+	return null;
+}
+
+/* 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);
+	}
+}
+
+/* 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
+	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;
+	}
+}
+
+
+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,
+		nsei := g_cfg.nsei,
+		/* 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
+	}
+	return udr;
+}
+
+/* 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 := *,
+		bssgp := pdu
+	}
+	return udi;
+}
+
+/* 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;
+		}
+	}
+}
+
+/* User wants to get per-BVC component reference from BSSGP_CT */
+signature BSSGP_get_bvci_ct(BssgpBvci bvci) return BSSGP_BVC_CT;
+
+type port BSSGP_CT_PROC_PT procedure {
+	inout BSSGP_get_bvci_ct
+} with { extension "internal" };
+
+/* 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;
+		}
+	}
+}
+
+/***********************************************************************
+ * 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.
+ ***********************************************************************/
+
+/* 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;
+
+	/* 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;
 
-	var BssgpConfig g_cfg;
+	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];
-}
+};
 
-type record length(16) of LLC_Entity LLC_Entities;
+/* 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,
-	BssgpCellId cell_id,
 	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 */
@@ -173,6 +647,7 @@
 	/* 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;
@@ -188,6 +663,19 @@
 	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,
@@ -198,83 +686,488 @@
 #endif
 };
 
-type record BssgpConfig {
-	Nsvci nsei,
-	Nsvci bvci,
-	BssgpCellId cell_id,
-	boolean sgsn_role,
-	BssgpDecodeDepth depth
-};
-
-function f_BnsUdReq(template PDU_BSSGP pdu, BssgpBvci bvci)
-runs on BSSGP_CT return NsUnitdataRequest {
-	var NsUnitdataRequest udr := {
-		bvci := bvci,
-		nsei := g_cfg.nsei,
-		/* 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
+/*
+private function f_tbl_init() runs on BSSGP_BVC_CT {
+	var integer i;
+	for (i := 0; i < sizeof(ImsiTable); i := i+1) {
+		ImsiTable[i] := -;
 	}
-	return udr;
-}
 
-function f_BnsUdInd(template PDU_BSSGP pdu, template BssgpBvci bvci)
-runs on BSSGP_CT return template NsUnitdataIndication {
-	var template NsUnitdataIndication udi := {
-		bvci := bvci,
-		nsei := g_cfg.nsei,
-		sdu := *,
-		bssgp := pdu
+	for (i := 0; i < sizeof(TlliTable); i := i+1) {
+		TlliTable[i] := -;
 	}
-	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;
+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)) {
+			log("Adding Client=", vc_conn, ", IMSI=", imsi, ", TLLI=", tlli, ", index=", i);
+			ClientTable[i] := {
+				tlli := tlli,
+				tlli_old := omit,
+				imsi := imsi,
+				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_sgsn_role));
+			}
+			return;
 		}
 	}
+	testcase.stop("Client Table full");
 }
 
-private function f_sendReset(BssgpBvci bvci) 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) {
+			if (ClientTable[i].comp_ref != vc_conn) {
+				setverdict(fail, "Cannot unregister index=", i, " IMSI ", imsi, " registred to ",
+					   ClientTable[i].comp_ref, " from ", vc_conn);
+				mtc.stop;
+			}
+			log("Removing Client IMSI=", imsi, ", index=", i);
+			ClientTable[i] := {
+				tlli := -,
+				tlli_old := omit,
+				imsi := ''H,
+				comp_ref := null,
+				llc := - };
+			return;
+		}
+	}
+	log("Warning: Could not find client for IMSI ", imsi);
+	return;
+}
+
+/* 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_BVC_CT {
+	var integer i := f_tbl_idx_by_comp(vc_conn);
+
+	if (tlli_old == 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) {
+		/* TLLI assignment */
+		ClientTable[i].tlli := tlli_new;
+		ClientTable[i].tlli_old := omit;
+	} else if (tlli_old != 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) {
+		/* TLLI change: both active */
+		ClientTable[i].tlli := tlli_new;
+		ClientTable[i].tlli_old := tlli_old;
+	} else if (tlli_old != 'FFFFFFFF'O and tlli_new == 'FFFFFFFF'O) {
+		/* TLLI unassignment: old shall be unassigned; new stays */
+		ClientTable[i].tlli_old := omit;
+	}
+}
+
+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)
+		    and ClientTable[i].imsi == imsi) {
+			return ClientTable[i].comp_ref;
+		}
+	}
+	setverdict(fail, "Couldn't find Component for IMSI ", imsi);
+	mtc.stop;
+}
+
+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
+		    (isvalue(ClientTable[i].tlli) and (ClientTable[i].tlli == tlli or
+		     isvalue(ClientTable[i].tlli_old) and ClientTable[i].tlli_old == tlli) )) {
+			return ClientTable[i].comp_ref;
+		}
+	}
+	setverdict(fail, "Couldn't find Component for TLLI ", tlli);
+	mtc.stop;
+}
+
+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) {
+			return i;
+		}
+	}
+	setverdict(fail, "Couldn't find Client for Component ", comp_ref);
+	mtc.stop;
+}
+
+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)
+		    and ClientTable[i].comp_ref == comp_ref) {
+			return ClientTable[i].tlli;
+		}
+	}
+	setverdict(fail, "Couldn't find TLLI for Component ", comp_ref);
+	mtc.stop;
+}
+
+/* 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
+}
+
+/* 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
+	};
+
+	/* 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);
+		}
+	}
+
+	/* 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);
+		}
+	}
+
+#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
+
+	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));
+}
+
+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_cfg.sgsn_role) {
-		pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, bvci, omit));
+	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, bvci, g_cfg.cell_id));
+		pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, g_cfg.bvci, g_cfg.cell_id));
 	}
-	log("PDU: ", pdu);
-	log("ENC: ", enc_PDU_BSSGP(pdu));
 
 	/* BVC-RESET is always sent via the SIGNALLING BVCI, see Table 5.4.1 */
-	BSCP.send(f_BnsUdReq(pdu, 0));
+	BVC.send(ts_ptp_BnsUdReq(pdu, 0));
 	g_T2.start;
 	//f_change_state(BVC_S_WAIT_RESET);
 }
 
-private function f_sendUnblock() runs on BSSGP_CT {
-	BSCP.send(f_BnsUdReq(t_BVC_UNBLOCK(g_cfg.bvci), 0));
-	g_T1.start;
+/* 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_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);
+	}
+	/* 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);
+	}
+
+	[] g_T2.timeout {
+		/* BVC-RESET-ACK PDU was not received within T2: retransmit */
+		f_ptp_sendReset();
+	}
 }
 
-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;
+/* 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
+	var PDU_L3_MS_SGSN l3_mo;
+	var PDU_L3_SGSN_MS l3_mt;
+#endif
+
+	/* bogus unblock, just respond with ACK */
+	[] 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 */
+	[] 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_ptp_change_state(BVC_S_BLOCKED);
+	}
+	/* 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_ptp_change_state(BVC_S_BLOCKED);
+	}
+	/* 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 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;
+		BVC.send(ts_ptp_BnsUdReq(t_BVC_FC_BVC_ACK(tag), 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));
+	}
+*/
+	/* 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, 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) 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 */
+	[] 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)) {
+			vc_conn := f_tbl_comp_by_tlli(valueof(tlli));
+			f_send_bssgp_dec(dec, vc_conn, BSSGP_SP_SIG);
+		} 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) 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_CT */
+	[] BSSGP_SP_SIG.receive(PDU_BSSGP:?)-> value bs_pdu sender vc_conn {
+		BVC.send(ts_ptp_BnsUdReq(bs_pdu, 0));
+	}
+
+	/* 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_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)));
+		BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));
+	}
+	[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)));
+		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_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);
+		BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, g_cfg.cell_id, llc_enc), g_cfg.bvci));
+	}
+	[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);
+		BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));
+	}
 }
 
-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));
+/* 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;
+
+	/* 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);
+		}
+	}
+
+	/* 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);
+	}
+
+	/* 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");
+	}
+
+	/* 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_ptp_blocked();
+		[g_ptp_bvc_state == BVC_S_UNBLOCKED] as_ptp_unblocked();
+		[] as_ptp_allstate();
+		}
+	}
+}
+
+/* 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();
+}
+
+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
+}
+
+template (present) NsUnitdataIndication tr_ptp_BnsUdInd(template (present) PDU_BSSGP pdu, template (present) BssgpBvci bvci) := {
+	bvci := bvci,
+	nsei := ?,
+	sdu := *,
+	bssgp := pdu
+}
+
+/* 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;
+	}
+	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;
+		}
+	}
 }
 
 /* attempt to extract the TLLI from a BSSGP PDU */
@@ -323,515 +1216,6 @@
 	return omit;
 }
 
-/*
-private function f_tbl_init() runs on BSSGP_CT {
-	var integer i;
-	for (i := 0; i < sizeof(ImsiTable); i := i+1) {
-		ImsiTable[i] := -;
-	}
-
-	for (i := 0; i < sizeof(TlliTable); i := i+1) {
-		TlliTable[i] := -;
-	}
-}
-*/
-
-private function f_tbl_client_add(hexstring imsi, OCT4 tlli, BssgpCellId cell_id, BSSGP_Client_CT vc_conn)
-runs on BSSGP_CT {
-	var integer i;
-	for (i := 0; i < sizeof(ClientTable); i := i+1) {
-		if (not isvalue(ClientTable[i].comp_ref)) {
-			log("Adding Client=", vc_conn, ", IMSI=", imsi, ", TLLI=", tlli, ", index=", i);
-			ClientTable[i] := {
-				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));
-			}
-			return;
-		}
-	}
-	testcase.stop("Client Table full");
-}
-
-private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_CT {
-	var integer i;
-	for (i := 0; i < sizeof(ClientTable); i := i+1) {
-		if (isvalue(ClientTable[i].imsi) and ClientTable[i].imsi == imsi) {
-			if (ClientTable[i].comp_ref != vc_conn) {
-				setverdict(fail, "Cannot unregister index=", i, " IMSI ", imsi, " registred to ",
-					   ClientTable[i].comp_ref, " from ", vc_conn);
-				mtc.stop;
-			}
-			log("Removing Client IMSI=", imsi, ", index=", i);
-			ClientTable[i] := {
-				tlli := -,
-				tlli_old := omit,
-				imsi := ''H,
-				cell_id := -,
-				comp_ref := null,
-				llc := - };
-			return;
-		}
-	}
-	log("Warning: Could not find client for IMSI ", imsi);
-	return;
-}
-
-/* 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 {
-	var integer i := f_tbl_idx_by_comp(vc_conn);
-
-	if (tlli_old == 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) {
-		/* TLLI assignment */
-		ClientTable[i].tlli := tlli_new;
-		ClientTable[i].tlli_old := omit;
-	} else if (tlli_old != 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) {
-		/* TLLI change: both active */
-		ClientTable[i].tlli := tlli_new;
-		ClientTable[i].tlli_old := tlli_old;
-	} else if (tlli_old != 'FFFFFFFF'O and tlli_new == 'FFFFFFFF'O) {
-		/* TLLI unassignment: old shall be unassigned; new stays */
-		ClientTable[i].tlli_old := omit;
-	}
-}
-
-private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_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)
-		    and ClientTable[i].imsi == imsi) {
-			return ClientTable[i].comp_ref;
-		}
-	}
-	setverdict(fail, "Couldn't find Component for IMSI ", imsi);
-	mtc.stop;
-}
-
-private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Client_CT {
-	var integer i;
-	for (i := 0; i < sizeof(ClientTable); i := i+1) {
-		if (isvalue(ClientTable[i].comp_ref) and
-		    (isvalue(ClientTable[i].tlli) and (ClientTable[i].tlli == tlli or
-		     isvalue(ClientTable[i].tlli_old) and ClientTable[i].tlli_old == tlli) )) {
-			return ClientTable[i].comp_ref;
-		}
-	}
-	setverdict(fail, "Couldn't find Component for TLLI ", tlli);
-	mtc.stop;
-}
-
-private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_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) {
-			return i;
-		}
-	}
-	setverdict(fail, "Couldn't find Client for Component ", comp_ref);
-	mtc.stop;
-}
-
-private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_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)
-		    and ClientTable[i].comp_ref == comp_ref) {
-			return ClientTable[i].tlli;
-		}
-	}
-	setverdict(fail, "Couldn't find TLLI for Component ", comp_ref);
-	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));
-	}
-}
-
-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);
-	}
-
-	/* 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);
-	}
-
-	/* 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);
-	}
-
-	/* 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;
-			}
-		}
-	}
-
-	[] 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;
-		}
-
-}
-
-altstep as_blocked() runs on BSSGP_CT {
-	[g_T1.running] g_T1.timeout {
-		f_sendUnblock();
-	}
-	[] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0)) {
-		g_T1.stop;
-		f_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();
-	}
-}
-
-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;
-	}
-}
-
-
-altstep as_unblocked() runs on BSSGP_CT {
-	var BSSGP_Client_CT vc_conn;
-	var NsUnitdataIndication udi;
-	var PDU_BSSGP bs_pdu;
-	var PDU_LLC llc;
-#ifdef BSSGP_EM_L3
-	var PDU_L3_MS_SGSN l3_mo;
-	var PDU_L3_SGSN_MS l3_mt;
-#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));
-	}
-	/* 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));
-		g_T1.stop;
-		f_change_state(BVC_S_BLOCKED);
-	}
-	[g_T1.running] g_T1.timeout {
-		f_sendBlock(BSSGP_CAUSE_OM_INTERVENTION);
-	}
-	[] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK_ACK(g_cfg.bvci), 0)) -> value udi {
-		g_T1.stop;
-		f_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);
-	}
-
-	/* simply acknowledge all Flow Control Messages */
-	[g_cfg.sgsn_role] BSCP.receive(f_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));
-	}
-/*
-	[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));
-	}
-*/
-
-	/* 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 {
-		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);
-		} 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);
-				}
-			}
-		}
-	}
-
-	/* Any other SIG BSSGP message: If it has TLLi, route to component; otherwise broadcast */
-	[] BSCP.receive(f_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)) {
-			vc_conn := f_tbl_comp_by_tlli(valueof(tlli));
-			f_send_bssgp_dec(dec, vc_conn, BSSGP_SP_SIG);
-		} 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, BSSGP_SP_SIG);
-				}
-			}
-		}
-	}
-
-
-	/* ConnHdlr sends BSSGP on BVCI=0 port: forward it to BSSGP Codec Port */
-	[] BSSGP_SP_SIG.receive(PDU_BSSGP:?)-> value bs_pdu sender vc_conn {
-		BSCP.send(f_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));
-	}
-
-#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 {
-		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));
-	}
-	[not g_cfg.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));
-	}
-#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 {
-		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));
-	}
-	[g_cfg.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));
-	}
-
-}
-
-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
-
-
-
-private function f_ScanEvents() runs on BSSGP_CT {
-	log("matching against ", tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id));
-
-	while (true) {
-		alt {
-		[g_ptp_bvc_state == BVC_S_BLOCKED] as_blocked();
-		[g_ptp_bvc_state == BVC_S_UNBLOCKED] as_unblocked();
-		[] as_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
-}
-
-/* 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
-	};
-
-	/* 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);
-		}
-	}
-
-	/* 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);
-		}
-	}
-
-#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);
-			}
-		}
-	}
-#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}) {};
-	}
-}
-
-/* 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 c5b0953..8101712 100644
--- a/library/Osmocom_Gb_Types.ttcn
+++ b/library/Osmocom_Gb_Types.ttcn
@@ -1555,6 +1555,74 @@
 	}
 
 
+/* 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 a2dba4f..9944043 100644
--- a/pcu/PCU_Tests.default
+++ b/pcu/PCU_Tests.default
@@ -10,18 +10,23 @@
 [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 f68485a..b2f8b75 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -83,7 +83,7 @@
 	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 @@
 	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 @@
 }
 
 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 @@
 
 	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 @@
 	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 @@
 	/* 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 @@
 		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 @@
 
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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_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_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 @@
 	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 @@
 	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 6a62f29..5ab5f8d 100644
--- a/pcu/PCU_Tests_NS.ttcn
+++ b/pcu/PCU_Tests_NS.ttcn
@@ -55,7 +55,7 @@
 
 	/* 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 @@
 
 	/* 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 524d35c..dc4cd82 100644
--- a/pcu/PCU_Tests_SNS.ttcn
+++ b/pcu/PCU_Tests_SNS.ttcn
@@ -187,13 +187,13 @@
 	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 @@
 	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 @@
 	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 @@
 	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 4a94c03..2f1fa75 100644
--- a/pcu/SGSN_Components.ttcn
+++ b/pcu/SGSN_Components.ttcn
@@ -20,18 +20,22 @@
 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 @@
 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 @@
 	/* 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 @@
 
 	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 8a87ee2..53ecdff 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -130,9 +130,11 @@
 	}
 };
 
+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 @@
 	/* 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 @@
 	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 @@
 	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 @@
 		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 @@
 	}
 
 	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 @@
 	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 @@
 
 	/* 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 @@
 	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 @@
 
 	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);
