sgsn: Implement TLLI assignment/modification/unassignment
It's important that we implement the proper TLLI handling whenever our P-TMSI changes. Change-Id: I5b95b9e49f0a1db9659714c4d01f340fd44fafe8
This commit is contained in:
parent
311ec27f42
commit
f70997db90
|
@ -63,9 +63,10 @@ type port BSSGP_PT message {
|
||||||
|
|
||||||
signature BSSGP_register_client(hexstring imsi, OCT4 tlli, BssgpCellId cell_id);
|
signature BSSGP_register_client(hexstring imsi, OCT4 tlli, BssgpCellId cell_id);
|
||||||
signature BSSGP_unregister_client(hexstring imsi);
|
signature BSSGP_unregister_client(hexstring imsi);
|
||||||
|
signature BSSGP_llgmm_assign(OCT4 tlli_old, OCT4 tlli);
|
||||||
|
|
||||||
type port BSSGP_PROC_PT procedure {
|
type port BSSGP_PROC_PT procedure {
|
||||||
inout BSSGP_register_client, BSSGP_unregister_client;
|
inout BSSGP_register_client, BSSGP_unregister_client, BSSGP_llgmm_assign;
|
||||||
} with { extension "internal" };
|
} with { extension "internal" };
|
||||||
|
|
||||||
|
|
||||||
|
@ -303,6 +304,25 @@ private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs
|
||||||
self.stop;
|
self.stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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 {
|
private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_CT return BSSGP_Client_CT {
|
||||||
var integer i;
|
var integer i;
|
||||||
for (i := 0; i < sizeof(ClientTable); i := i+1) {
|
for (i := 0; i < sizeof(ClientTable); i := i+1) {
|
||||||
|
@ -357,7 +377,7 @@ altstep as_allstate() runs on BSSGP_CT {
|
||||||
var NsStatusIndication nsi;
|
var NsStatusIndication nsi;
|
||||||
var ASP_Event evt;
|
var ASP_Event evt;
|
||||||
var hexstring imsi;
|
var hexstring imsi;
|
||||||
var OCT4 tlli;
|
var OCT4 tlli, tlli_old;
|
||||||
var BssgpCellId cell_id;
|
var BssgpCellId cell_id;
|
||||||
|
|
||||||
/* Respond to BLOCK for wrong NSVCI */
|
/* Respond to BLOCK for wrong NSVCI */
|
||||||
|
@ -421,6 +441,11 @@ altstep as_allstate() runs on BSSGP_CT {
|
||||||
f_tbl_client_del(imsi, vc_conn);
|
f_tbl_client_del(imsi, vc_conn);
|
||||||
BSSGP_PROC.reply(BSSGP_unregister_client:{imsi});
|
BSSGP_PROC.reply(BSSGP_unregister_client:{imsi});
|
||||||
}
|
}
|
||||||
|
[] 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});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
altstep as_blocked() runs on BSSGP_CT {
|
altstep as_blocked() runs on BSSGP_CT {
|
||||||
|
@ -620,6 +645,14 @@ runs on BSSGP_Client_CT {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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)
|
||||||
|
runs on BSSGP_Client_CT {
|
||||||
|
PT.call(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {
|
||||||
|
[] PT.getreply(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template BssgpDecoded tr_BD_BSSGP(template PDU_BSSGP bg) := {
|
template BssgpDecoded tr_BD_BSSGP(template PDU_BSSGP bg) := {
|
||||||
bssgp := bg,
|
bssgp := bg,
|
||||||
llc := *,
|
llc := *,
|
||||||
|
@ -627,7 +660,6 @@ template BssgpDecoded tr_BD_BSSGP(template PDU_BSSGP bg) := {
|
||||||
l3_mt := *
|
l3_mt := *
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template BssgpDecoded tr_BD_L3_MT(template PDU_L3_SGSN_MS mt) := {
|
template BssgpDecoded tr_BD_L3_MT(template PDU_L3_SGSN_MS mt) := {
|
||||||
bssgp := ?,
|
bssgp := ?,
|
||||||
llc := ?,
|
llc := ?,
|
||||||
|
@ -644,5 +676,4 @@ template BssgpDecoded tr_BD_L3_MO(template PDU_L3_MS_SGSN mo) := {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ type record BSSGP_ConnHdlrPars {
|
||||||
OCT3 p_tmsi_sig optional,
|
OCT3 p_tmsi_sig optional,
|
||||||
/* TLLI of the simulated MS */
|
/* TLLI of the simulated MS */
|
||||||
OCT4 tlli,
|
OCT4 tlli,
|
||||||
|
OCT4 tlli_old optional,
|
||||||
RoutingAreaIdentificationV ra optional,
|
RoutingAreaIdentificationV ra optional,
|
||||||
BssgpCellId bssgp_cell_id,
|
BssgpCellId bssgp_cell_id,
|
||||||
AuthVector vec optional,
|
AuthVector vec optional,
|
||||||
|
@ -168,6 +169,7 @@ runs on test_CT return BSSGP_ConnHdlr {
|
||||||
p_tmsi := omit,
|
p_tmsi := omit,
|
||||||
p_tmsi_sig := omit,
|
p_tmsi_sig := omit,
|
||||||
tlli := f_gprs_tlli_random(),
|
tlli := f_gprs_tlli_random(),
|
||||||
|
tlli_old := omit,
|
||||||
ra := omit,
|
ra := omit,
|
||||||
bssgp_cell_id := gb.cfg.cell_id,
|
bssgp_cell_id := gb.cfg.cell_id,
|
||||||
vec := omit,
|
vec := omit,
|
||||||
|
@ -278,6 +280,14 @@ function f_gmm_auth () runs on BSSGP_ConnHdlr {
|
||||||
deactivate(di);
|
deactivate(di);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function f_upd_ptmsi_and_tlli(OCT4 p_tmsi) runs on BSSGP_ConnHdlr {
|
||||||
|
g_pars.p_tmsi := p_tmsi;
|
||||||
|
/* update TLLI */
|
||||||
|
g_pars.tlli_old := g_pars.tlli;
|
||||||
|
g_pars.tlli := g_pars.p_tmsi or4b 'c0000000'O;
|
||||||
|
f_bssgp_client_llgmm_assign(g_pars.tlli_old, g_pars.tlli);
|
||||||
|
}
|
||||||
|
|
||||||
function f_process_attach_accept(PDU_GMM_AttachAccept aa) runs on BSSGP_ConnHdlr {
|
function f_process_attach_accept(PDU_GMM_AttachAccept aa) runs on BSSGP_ConnHdlr {
|
||||||
/* mandatory IE */
|
/* mandatory IE */
|
||||||
g_pars.ra := aa.routingAreaIdentification;
|
g_pars.ra := aa.routingAreaIdentification;
|
||||||
|
@ -286,8 +296,7 @@ function f_process_attach_accept(PDU_GMM_AttachAccept aa) runs on BSSGP_ConnHdlr
|
||||||
setverdict(fail, "unexpected P-TMSI allocation");
|
setverdict(fail, "unexpected P-TMSI allocation");
|
||||||
self.stop;
|
self.stop;
|
||||||
}
|
}
|
||||||
g_pars.p_tmsi := aa.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets;
|
f_upd_ptmsi_and_tlli(aa.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets);
|
||||||
/* update TLLI? */
|
|
||||||
}
|
}
|
||||||
if (ispresent(aa.msIdentity)) {
|
if (ispresent(aa.msIdentity)) {
|
||||||
setverdict(fail, "unexpected TMSI allocation in non-combined attach");
|
setverdict(fail, "unexpected TMSI allocation in non-combined attach");
|
||||||
|
|
Loading…
Reference in New Issue