lists.osmocom.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
List overview
Download
gerrit-log
July 2025
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
gerrit-log@lists.osmocom.org
1 participants
1142 discussions
Start a n
N
ew thread
[XS] Change in osmo-dev[master]: osmo-hnodeb: Add missing deps
by pespin
pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-dev/+/40747?usp=email
) Change subject: osmo-hnodeb: Add missing deps ...................................................................... osmo-hnodeb: Add missing deps Change-Id: I4440583663bd2bd7643a0786792cb5339acd4d68 --- M all.deps 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/47/40747/1 diff --git a/all.deps b/all.deps index 3fc5ad1..a49eb87 100644 --- a/all.deps +++ b/all.deps @@ -31,7 +31,7 @@ nftables libnftnl osmo-upf libosmocore libosmo-pfcp libgtpnl nftables osmo-cbc libosmo-netif -osmo-hnodeb osmo-iuh +osmo-hnodeb libosmocore libosmo-netif libosmo-abis osmo-iuh osmo-hnbgw osmo-iuh osmo-mgw libosmo-pfcp nftables osmo-e1d libosmocore osmo-remsim simtrace2_host libosmo-abis -- To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/40747?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I4440583663bd2bd7643a0786792cb5339acd4d68 Gerrit-Change-Number: 40747 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 day, 18 hours
1
0
0
0
[M] Change in osmo-ttcn3-hacks[master]: GTPv1U_Emulation: support multiple client ports per GTP1U_ConnHdlr
by pespin
pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40746?usp=email
) Change subject: GTPv1U_Emulation: support multiple client ports per GTP1U_ConnHdlr ...................................................................... GTPv1U_Emulation: support multiple client ports per GTP1U_ConnHdlr This feature is already present in GTP1U code of GTP_Emulation. That part of the code will be removed and ported to use GTPv1U_Emulation, so we need to also support this feature here. Change-Id: I10ce33f30a2da5159f8040725df619844a71d6bc --- M epdg/EPDG_Tests.ttcn M library/GTPv1U_Emulation.ttcnpp M pgw/PGW_Tests.ttcn 3 files changed, 31 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/46/40746/1 diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn index f67fc2c..9d22b15 100644 --- a/epdg/EPDG_Tests.ttcn +++ b/epdg/EPDG_Tests.ttcn @@ -371,8 +371,8 @@ connect(vc_conn:GTP2, vc_GTP2:CLIENT); connect(vc_conn:GTP2_PROC, vc_GTP2:CLIENT_PROC); /* GTP1U */ - connect(vc_conn:GTP1U, vc_GTP1U:CLIENT); - connect(vc_conn:GTP1U_PROC, vc_GTP1U:CLIENT_PROC); + connect(vc_conn:GTP1U[0], vc_GTP1U:CLIENT); + connect(vc_conn:GTP1U_PROC[0], vc_GTP1U:CLIENT_PROC); /* SWx */ vc_conn_swx := DIAMETER_ConnHdlr_CT.create(id); @@ -880,18 +880,18 @@ } private function f_GTP1U_send(octetstring payload) runs on EPDG_ConnHdlr { var Gtp1uPeer peer := valueof(ts_GtpPeerU(f_inet_addr(g_pars.bearer.gtpu_addr_remote))); - GTP1U.send(ts_GTP1U_GPDU(peer, omit /*opt_part*/, g_pars.bearer.teid_remote, payload)); + GTP1U[0].send(ts_GTP1U_GPDU(peer, omit /*opt_part*/, g_pars.bearer.teid_remote, payload)); } private function f_GTP1U_echo_ping_pong(uint16_t seq_nr := 0) runs on EPDG_ConnHdlr { var Gtp1uPeer peer := valueof(ts_GtpPeerU(f_inet_addr(g_pars.bearer.gtpu_addr_remote))); - GTP1U.send(ts_GTPU_PING(peer, seq := seq_nr)); - GTP1U.receive(tr_GTPU_PONG(peer)); + GTP1U[0].send(ts_GTPU_PING(peer, seq := seq_nr)); + GTP1U[0].receive(tr_GTPU_PONG(peer)); } private altstep as_GTPU_rx_icmp4(template (present) PDU_ICMP expected := ?) runs on EPDG_ConnHdlr { var Gtp1uUnitdata rx_msg; var template (value) Gtp1uPeer peer := ts_GtpPeerU(f_inet_addr(g_pars.bearer.gtpu_addr_remote)); - [] GTP1U.receive(tr_GTPU_GPDU(peer, g_pars.bearer.teid_local)) -> value rx_msg { + [] GTP1U[0].receive(tr_GTPU_GPDU(peer, g_pars.bearer.teid_local)) -> value rx_msg { /*TODO: verify gtpu txseq: if (f_verify_gtpu_txseq(ud.gtpu, use_gtpu_txseq) == false) { setverdict(fail); @@ -908,7 +908,7 @@ repeat; } } - [] GTP1U.receive(Gtp1uUnitdata:?) -> value rx_msg { + [] GTP1U[0].receive(Gtp1uUnitdata:?) -> value rx_msg { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unexpected GTP msg rx: ", rx_msg)); } } diff --git a/library/GTPv1U_Emulation.ttcnpp b/library/GTPv1U_Emulation.ttcnpp index b3de2ab..8b76379 100644 --- a/library/GTPv1U_Emulation.ttcnpp +++ b/library/GTPv1U_Emulation.ttcnpp @@ -342,48 +342,50 @@ /*********************************************************************** * Client Component ***********************************************************************/ +/* maximum number of GTP ports a GTP_ConnHdlr component can manage. This allows + * connection one GTP_ConnHdlr to several GTP_Emulation(s). */ +const integer NUM_MAX_GTP := 4; type component GTP1U_ConnHdlr { - port GTP1UEM_PT GTP1U; - port GTP1UEM_PROC_PT GTP1U_PROC; + port GTP1UEM_PT GTP1U[NUM_MAX_GTP]; + port GTP1UEM_PROC_PT GTP1U_PROC[NUM_MAX_GTP]; }; - -function f_gtp1u_register_teid(OCT4 teid) runs on GTP1U_ConnHdlr { - GTP1U_PROC.call(GTP1UEM_register_teid:{teid}) { - [] GTP1U_PROC.getreply(GTP1UEM_register_teid:{teid}); +function f_gtp1u_register_teid(OCT4 teid, integer port_idx := 0) runs on GTP1U_ConnHdlr { + GTP1U_PROC[port_idx].call(GTP1UEM_register_teid:{teid}) { + [] GTP1U_PROC[port_idx].getreply(GTP1UEM_register_teid:{teid}); } } -function f_gtp1u_allocate_teid() runs on GTP1U_ConnHdlr return OCT4 { +function f_gtp1u_allocate_teid(integer port_idx := 0) runs on GTP1U_ConnHdlr return OCT4 { var OCT4 t; - GTP1U_PROC.call(GTP1UEM_allocate_teid:{}) { - [] GTP1U_PROC.getreply(GTP1UEM_allocate_teid:{}) -> value t { + GTP1U_PROC[port_idx].call(GTP1UEM_allocate_teid:{}) { + [] GTP1U_PROC[port_idx].getreply(GTP1UEM_allocate_teid:{}) -> value t { return t; } } } #ifdef GTP1U_EMULATION_HAVE_UECUPS -function f_gtp1u_create_tunnel(template (value) UECUPS_CreateTun gtc) +function f_gtp1u_create_tunnel(template (value) UECUPS_CreateTun gtc, integer port_idx := 0) runs on GTP1U_ConnHdlr { - GTP1U_PROC.call(GTP1UEM_create_tunnel:{valueof(gtc)}) { - [] GTP1U_PROC.getreply(GTP1UEM_create_tunnel:{gtc}); + GTP1U_PROC[port_idx].call(GTP1UEM_create_tunnel:{valueof(gtc)}) { + [] GTP1U_PROC[port_idx].getreply(GTP1UEM_create_tunnel:{gtc}); } } -function f_gtp1u_destroy_tunnel(template (value) UECUPS_DestroyTun gtd) +function f_gtp1u_destroy_tunnel(template (value) UECUPS_DestroyTun gtd, integer port_idx := 0) runs on GTP1U_ConnHdlr { - GTP1U_PROC.call(GTP1UEM_destroy_tunnel:{valueof(gtd)}) { - [] GTP1U_PROC.getreply(GTP1UEM_destroy_tunnel:{gtd}); + GTP1U_PROC[port_idx].call(GTP1UEM_destroy_tunnel:{valueof(gtd)}) { + [] GTP1U_PROC[port_idx].getreply(GTP1UEM_destroy_tunnel:{gtd}); } } -function f_gtp1u_start_program(template (value) UECUPS_StartProgram sprog) +function f_gtp1u_start_program(template (value) UECUPS_StartProgram sprog, integer port_idx := 0) runs on GTP1U_ConnHdlr return UECUPS_StartProgramRes { var UECUPS_StartProgramRes res; - GTP1U_PROC.call(GTP1UEM_start_program:{valueof(sprog)}) { - [] GTP1U_PROC.getreply(GTP1UEM_start_program:{sprog}) -> value res; + GTP1U_PROC[port_idx].call(GTP1UEM_start_program:{valueof(sprog)}) { + [] GTP1U_PROC[port_idx].getreply(GTP1UEM_start_program:{sprog}) -> value res; } return res; } diff --git a/pgw/PGW_Tests.ttcn b/pgw/PGW_Tests.ttcn index 4d225fa..01c4e46 100644 --- a/pgw/PGW_Tests.ttcn +++ b/pgw/PGW_Tests.ttcn @@ -311,8 +311,8 @@ vc_GTP1U := GTPv1U_Emulation_CT.create("GTP1U_EM"); map(vc_GTP1U:GTP1U, system:GTP1U); connect(vc_GTP1U:TEID0, self:TEID0); - connect(vc_GTP1U:CLIENT, self:GTP1U); - connect(vc_GTP1U:CLIENT_PROC, self:GTP1U_PROC); + connect(vc_GTP1U:CLIENT, self:GTP1U[0]); + connect(vc_GTP1U:CLIENT_PROC, self:GTP1U_PROC[0]); vc_GTP1U.start(GTPv1U_Emulation.main(cfg)); } @@ -344,8 +344,8 @@ vc_conn := PGW_Session_CT.create(id); connect(vc_conn:GTP2, vc_GTP2:CLIENT); connect(vc_conn:GTP2_PROC, vc_GTP2:CLIENT_PROC); - connect(vc_conn:GTP1U, vc_GTP1U:CLIENT); - connect(vc_conn:GTP1U_PROC, vc_GTP1U:CLIENT_PROC); + connect(vc_conn:GTP1U[0], vc_GTP1U:CLIENT); + connect(vc_conn:GTP1U_PROC[0], vc_GTP1U:CLIENT_PROC); if (isbound(vc_Gx)) { vc_conn_gx := DIAMETER_ConnHdlr_CT.create(id); -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40746?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I10ce33f30a2da5159f8040725df619844a71d6bc Gerrit-Change-Number: 40746 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 day, 18 hours
1
0
0
0
[XS] Change in osmo-dev[master]: sanitize.opts: Add missing osmo-uecups entry
by osmith
Attention is currently required from: fixeria, pespin. osmith has posted comments on this change by pespin. (
https://gerrit.osmocom.org/c/osmo-dev/+/40743?usp=email
) Change subject: sanitize.opts: Add missing osmo-uecups entry ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/40743?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I2c9f9a7db286117cbf31d3085d7af5ac05a615b2 Gerrit-Change-Number: 40743 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 24 Jul 2025 15:26:02 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 day, 18 hours
1
0
0
0
[M] Change in osmo-ttcn3-hacks[master]: GTP1vU_Emulation: Make UECUPS support optional
by pespin
pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40745?usp=email
) Change subject: GTP1vU_Emulation: Make UECUPS support optional ...................................................................... GTP1vU_Emulation: Make UECUPS support optional Some users may/do want to use the simple UDP/GTPU socket mode, so they don't need to depend on all UECUPS code. Change-Id: I3b4671d8e637f70f790b08ed8e3b5145e7a95703 --- M epdg/gen_links.sh M epdg/regen_makefile.sh R library/GTPv1U_Emulation.ttcnpp M pgw/gen_links.sh M pgw/regen_makefile.sh 5 files changed, 49 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/45/40745/1 diff --git a/epdg/gen_links.sh b/epdg/gen_links.sh index d41e2e1..c3fdf61 100755 --- a/epdg/gen_links.sh +++ b/epdg/gen_links.sh @@ -37,10 +37,6 @@ FILES="MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn " gen_links $DIR $FILES -DIR=$BASEDIR/osmo-uecups/ttcn3 -FILES="UECUPS_CodecPort.ttcn UECUPS_CodecPort_CtrlFunct.ttcn UECUPS_CodecPort_CtrlFunctDef.cc UECUPS_Types.ttcn " -gen_links $DIR $FILES - DIR=$BASEDIR/titan.ProtocolModules.GTP_v13.5.0/src FILES="GTPU_EncDec.cc GTPU_Types.ttcn " gen_links $DIR $FILES @@ -59,7 +55,7 @@ FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp " FILES+="PCO_Types.ttcn GSUP_Types.ttcn GSUP_Templates.ttcn GSUP_Emulation.ttcn " -FILES+="GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1U_Templates.ttcn GTPv1U_Emulation.ttcn " +FILES+="GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1U_Templates.ttcn GTPv1U_Emulation.ttcnpp " FILES+="GTPv2_PrivateExtensions.ttcn GTPv2_Templates.ttcn " FILES+="GTPv2_CodecPort.ttcn GTPv2_CodecPort_CtrlFunctDef.cc GTPv2_CodecPort_CtrlFunct.ttcn GTPv2_Emulation.ttcn " FILES+="ICMP_Templates.ttcn " diff --git a/epdg/regen_makefile.sh b/epdg/regen_makefile.sh index 847c412..1cd2efb 100755 --- a/epdg/regen_makefile.sh +++ b/epdg/regen_makefile.sh @@ -17,7 +17,6 @@ TELNETasp_PT.cc DIAMETER_EncDec.cc DIAMETER_CodecPort_CtrlFunctDef.cc - UECUPS_CodecPort_CtrlFunctDef.cc GTPU_EncDec.cc GTPv1U_CodecPort_CtrlFunctDef.cc GTPv2_CodecPort_CtrlFunctDef.cc diff --git a/library/GTPv1U_Emulation.ttcn b/library/GTPv1U_Emulation.ttcnpp similarity index 91% rename from library/GTPv1U_Emulation.ttcn rename to library/GTPv1U_Emulation.ttcnpp index 7c031b7..b3de2ab 100644 --- a/library/GTPv1U_Emulation.ttcn +++ b/library/GTPv1U_Emulation.ttcnpp @@ -15,23 +15,28 @@ import from IPL4asp_Types all; import from General_Types all; import from Osmocom_Types all; +import from Misc_Helpers all; import from GTPU_Types all; import from GTPv1U_CodecPort all; import from GTPv1U_CodecPort_CtrlFunct all; +#ifdef GTP1U_EMULATION_HAVE_UECUPS import from SCTP_Templates all; import from UECUPS_Types all; import from UECUPS_CodecPort all; import from UECUPS_CodecPort_CtrlFunct all; +#endif /*********************************************************************** * Main Emulation Component ***********************************************************************/ +#ifdef GTP1U_EMULATION_HAVE_UECUPS modulepar { charstring mp_uecups_host := "127.0.0.1"; integer mp_uecups_port := UECUPS_SCTP_PORT; }; +#endif const integer GTP1U_PORT := 2152; @@ -45,9 +50,6 @@ /* Communication with underlying GTP CodecPort */ port GTPU_PT GTP1U; - /* Control port to GTP-U Daemon */ - port UECUPS_CODEC_PT UECUPS; - /* Communication with Clients */ port GTP1UEM_PT TEID0; port GTP1UEM_PT CLIENT; @@ -61,9 +63,13 @@ var OCT1 g_restart_ctr; var uint16_t g_c_seq_nr; var TidTableRec TidTable[256]; - var PidTableRec PidTable[256]; +#ifdef GTP1U_EMULATION_HAVE_UECUPS + /* Control port to GTP-U Daemon */ + port UECUPS_CODEC_PT UECUPS; + var PidTableRec PidTable[256]; var integer g_uecups_conn_id := -1; +#endif }; /* local TEID <-> ConnHdlr mapping */ @@ -72,6 +78,7 @@ GTP1U_ConnHdlr vc_conn }; +#ifdef GTP1U_EMULATION_HAVE_UECUPS /* pid <-> ConnHdlr mapping (for UECUPS process termination indication) */ type record PidTableRec { /* process ID of the running process */ @@ -79,6 +86,7 @@ /* component that started it */ GTP1U_ConnHdlr vc_conn }; +#endif private function f_teid_known(OCT4 teid) runs on GTPv1U_Emulation_CT return boolean { var integer i; @@ -101,6 +109,7 @@ mtc.stop; } +#ifdef GTP1U_EMULATION_HAVE_UECUPS private function f_comp_by_pid(integer pid) runs on GTPv1U_Emulation_CT return GTP1U_ConnHdlr { var integer i; for (i := 0; i < sizeof(PidTable); i := i+1) { @@ -112,6 +121,7 @@ setverdict(fail, "No Component for PID ", pid); mtc.stop; } +#endif private function f_tid_tbl_add(OCT4 teid, GTP1U_ConnHdlr vc_conn) runs on GTPv1U_Emulation_CT { var integer i; @@ -125,6 +135,7 @@ testcase.stop("No Space in TidTable for ", teid); } +#ifdef GTP1U_EMULATION_HAVE_UECUPS private function f_pid_tbl_add(integer pid, GTP1U_ConnHdlr vc_conn) runs on GTPv1U_Emulation_CT { var integer i; for (i := 0; i < sizeof(PidTable); i := i+1) { @@ -136,6 +147,7 @@ } testcase.stop("No Space in PID Table for ", pid); } +#endif /* allocate an unused local teid */ @@ -155,6 +167,7 @@ testcase.stop("Cannot find unused TEID after ", i, " attempts"); } +#ifdef GTP1U_EMULATION_HAVE_UECUPS function tr_UECUPS_RecvFrom_R(template PDU_UECUPS msg) runs on GTPv1U_Emulation_CT return template UECUPS_RecvFrom { var template UECUPS_RecvFrom mrf := { @@ -168,7 +181,6 @@ return mrf; } - private function f_uecups_xceive(template (value) PDU_UECUPS tx, template PDU_UECUPS rx_t := ?, float time_out := 10.0) runs on GTPv1U_Emulation_CT return PDU_UECUPS { @@ -188,6 +200,7 @@ } return mrf.msg; } +#endif private function f_init(Gtp1uEmulationCfg cfg) runs on GTPv1U_Emulation_CT { var Result res; @@ -197,6 +210,7 @@ g_gtp1u_cfg := cfg; if (g_gtp1u_cfg.use_gtpu_daemon) { +#ifdef GTP1U_EMULATION_HAVE_UECUPS map(self:UECUPS, system:UECUPS); res := UECUPS_CodecPort_CtrlFunct.f_IPL4_connect(UECUPS, mp_uecups_host, mp_uecups_port, "", -1, -1, { sctp := valueof(ts_SctpTuple) }); @@ -209,6 +223,9 @@ f_uecups_xceive({reset_all_state := {}}, {reset_all_state_res:=?}, 30.0); /* make sure we always pass incoming UECUPS indications whenever receiving fom the UECUPS port */ activate(as_uecups_ind()); +#else + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Requested UECUPS but built without UECUPS support!"); +#endif } else if (isvalue(cfg.gtpu_bind_ip) and isvalue(cfg.gtpu_bind_port)) { map(self:GTP1U, system:GTP1U); res := GTPv1U_CodecPort_CtrlFunct.f_GTPU_listen(GTP1U, cfg.gtpu_bind_ip, @@ -217,6 +234,7 @@ } } +#ifdef GTP1U_EMULATION_HAVE_UECUPS private altstep as_uecups_ind() runs on GTPv1U_Emulation_CT { var UECUPS_RecvFrom rx; var GTP1U_ConnHdlr vc_conn; @@ -228,15 +246,18 @@ repeat; } } +#endif function main(Gtp1uEmulationCfg cfg) runs on GTPv1U_Emulation_CT { var Gtp1uUnitdata g1u_ud; var GTP1U_ConnHdlr vc_conn; var OCT4 teid; +#ifdef GTP1U_EMULATION_HAVE_UECUPS var PDU_UECUPS rx_uecups; var UECUPS_CreateTun gtc; var UECUPS_DestroyTun gtd; var UECUPS_StartProgram sprog; +#endif f_init(cfg); @@ -268,6 +289,7 @@ f_tid_tbl_add(t, vc_conn); CLIENT_PROC.reply(GTP1UEM_allocate_teid:{} value t) to vc_conn; } +#ifdef GTP1U_EMULATION_HAVE_UECUPS [] CLIENT_PROC.getcall(GTP1UEM_create_tunnel:{?}) -> param(gtc) sender vc_conn { rx_uecups := f_uecups_xceive({create_tun := gtc}, {create_tun_res:={result:=OK}}); CLIENT_PROC.reply(GTP1UEM_create_tunnel:{gtc}) to vc_conn; @@ -284,7 +306,7 @@ } CLIENT_PROC.reply(GTP1UEM_start_program:{sprog} value rx_uecups.start_program_res) to vc_conn; } - +#endif } } } @@ -294,18 +316,27 @@ * Interaction between Main and Client Components ***********************************************************************/ type port GTP1UEM_PT message { - inout Gtp1uUnitdata, UECUPS_ProgramTermInd; + inout Gtp1uUnitdata +#ifdef GTP1U_EMULATION_HAVE_UECUPS + , UECUPS_ProgramTermInd +#endif + ; } with { extension "internal" }; signature GTP1UEM_register_teid(OCT4 teid); signature GTP1UEM_allocate_teid() return OCT4; +#ifdef GTP1U_EMULATION_HAVE_UECUPS signature GTP1UEM_create_tunnel(UECUPS_CreateTun gtc); signature GTP1UEM_destroy_tunnel(UECUPS_DestroyTun gtd); signature GTP1UEM_start_program(UECUPS_StartProgram sprog) return UECUPS_StartProgramRes; +#endif type port GTP1UEM_PROC_PT procedure { - inout GTP1UEM_register_teid, GTP1UEM_allocate_teid, - GTP1UEM_create_tunnel, GTP1UEM_destroy_tunnel, GTP1UEM_start_program; + inout GTP1UEM_register_teid, GTP1UEM_allocate_teid +#ifdef GTP1U_EMULATION_HAVE_UECUPS + , GTP1UEM_create_tunnel, GTP1UEM_destroy_tunnel, GTP1UEM_start_program +#endif + ; } with { extension "internal" }; /*********************************************************************** @@ -333,6 +364,7 @@ } } +#ifdef GTP1U_EMULATION_HAVE_UECUPS function f_gtp1u_create_tunnel(template (value) UECUPS_CreateTun gtc) runs on GTP1U_ConnHdlr { GTP1U_PROC.call(GTP1UEM_create_tunnel:{valueof(gtc)}) { @@ -355,7 +387,6 @@ } return res; } - - +#endif } diff --git a/pgw/gen_links.sh b/pgw/gen_links.sh index fa69ee4..e1bf469 100755 --- a/pgw/gen_links.sh +++ b/pgw/gen_links.sh @@ -60,7 +60,7 @@ DIR=../library FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn IPCP_Templates.ttcn PAP_Types.ttcn " FILES+="GTPv1C_CodecPort.ttcn GTPv1C_CodecPort_CtrlFunct.ttcn GTPv1C_CodecPort_CtrlFunctDef.cc GTPv1C_Templates.ttcn Osmocom_Gb_Types.ttcn " -FILES+="GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1U_Emulation.ttcn " +FILES+="GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1U_Emulation.ttcnpp " FILES+="GTPv2_PrivateExtensions.ttcn GTPv2_Templates.ttcn " FILES+="GTPv2_CodecPort.ttcn GTPv2_CodecPort_CtrlFunctDef.cc GTPv2_CodecPort_CtrlFunct.ttcn GTPv2_Emulation.ttcn " FILES+="DNS_Helpers.ttcn " diff --git a/pgw/regen_makefile.sh b/pgw/regen_makefile.sh index ec40716..2bc71d0 100755 --- a/pgw/regen_makefile.sh +++ b/pgw/regen_makefile.sh @@ -4,6 +4,7 @@ FILES=" *.ttcn + *.ttcnpp BSSGP_EncDec.cc DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_EncDec.cc @@ -25,4 +26,8 @@ UECUPS_CodecPort_CtrlFunctDef.cc " +CPPFLAGS_TTCN3=" + -DGTP1U_EMULATION_HAVE_UECUPS +" + . ../_buildsystem/regen_makefile.inc.sh -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40745?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I3b4671d8e637f70f790b08ed8e3b5145e7a95703 Gerrit-Change-Number: 40745 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 day, 18 hours
1
0
0
0
[L] Change in osmo-ttcn3-hacks[master]: Split GTPv1U out of GTPv2_Emulation
by pespin
pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40744?usp=email
) Change subject: Split GTPv1U out of GTPv2_Emulation ...................................................................... Split GTPv1U out of GTPv2_Emulation GTPv1U and GTPv2C are 2 different protocols, working on 2 different ports, on 2 different sockets. Hence, it makes no sense to put them together, since some tests may want to use only the control-plane, others may want to use the user-plane, etc. Morevoer, GTPv1U can be used together with both GTPv2C anf GTPv1C. This commit also fixes the confusion where TEIC and TEID were not properly separated in GTPv2_Emulation. Change-Id: Ia45307107753294c6761cb588f0ab769821eb213 --- M epdg/EPDG_Tests.ttcn M epdg/gen_links.sh A library/GTPv1U_Emulation.ttcn M library/GTPv2_Emulation.ttcn M mme/MME_Tests.ttcn M mme/gen_links.sh M mme/regen_makefile.sh M pgw/PGW_Tests.cfg M pgw/PGW_Tests.ttcn M pgw/gen_links.sh 10 files changed, 500 insertions(+), 262 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/44/40744/1 diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn index 61476e2..f67fc2c 100644 --- a/epdg/EPDG_Tests.ttcn +++ b/epdg/EPDG_Tests.ttcn @@ -24,9 +24,10 @@ import from DIAMETER_ts29_273_Templates all; import from DIAMETER_Emulation all; -import from GTPv1U_CodecPort all; import from GTPU_Types all; +import from GTPv1U_CodecPort all; import from GTPv1U_Templates all; +import from GTPv1U_Emulation all; import from GTPv2_Types all; import from GTPv2_Templates all; @@ -90,7 +91,10 @@ port IPA_CTRL_PT GSUP_IPA_EVENT; var GTPv2_Emulation_CT vc_GTP2; - port GTP2EM_PT TEID0; + port GTP2EM_PT TEIC0; + + var GTPv1U_Emulation_CT vc_GTP1U; + port GTP1UEM_PT TEID0; port Coord_PT COORD; @@ -133,7 +137,7 @@ } } -type component EPDG_ConnHdlr extends DIAMETER_ConnHdlr, GSUP_ConnHdlr, GTP2_ConnHdlr { +type component EPDG_ConnHdlr extends DIAMETER_ConnHdlr, GSUP_ConnHdlr, GTP2_ConnHdlr, GTP1U_ConnHdlr { var EPDG_ConnHdlrPars g_pars; port DIAMETER_Conn_PT SWx; @@ -298,22 +302,32 @@ f_sleep(int2float(mp_diam_watchdog_initial_wait_sec)); } -private function f_init_gtp(charstring id) runs on MTC_CT { +private function f_init_gtp2c(charstring id) runs on MTC_CT { var Gtp2EmulationCfg cfg := { gtpc_bind_ip := mp_s2b_local_ip, gtpc_bind_port := mp_s2b_local_port, gtpc_remote_ip := mp_s2b_remote_ip, gtpc_remote_port := mp_s2b_remote_port, + sgw_role := false + }; + + vc_GTP2 := GTPv2_Emulation_CT.create(id & "-GTPv2C"); + map(vc_GTP2:GTP2C, system:GTP2C); + connect(vc_GTP2:TEIC0, self:TEIC0); + vc_GTP2.start(GTPv2_Emulation.main(cfg)); +} + +private function f_init_gtp1u(charstring id) runs on MTC_CT { + var Gtp1uEmulationCfg cfg := { gtpu_bind_ip := mp_upf_gtpu_local_ip, gtpu_bind_port := GTP1U_PORT, - sgw_role := false, use_gtpu_daemon := false /* TODO: maybe use, set to true */ }; - vc_GTP2 := GTPv2_Emulation_CT.create(id & "-GTPV2"); - map(vc_GTP2:GTP2C, system:GTP2C); - connect(vc_GTP2:TEID0, self:TEID0); - vc_GTP2.start(GTPv2_Emulation.main(cfg)); + vc_GTP1U := GTPv1U_Emulation_CT.create(id & "-GTPv1U"); + map(vc_GTP1U:GTP1U, system:GTP1U); + connect(vc_GTP1U:TEID0, self:TEID0); + vc_GTP1U.start(GTPv1U_Emulation.main(cfg)); } private function f_init(float t_guard := 40.0) runs on MTC_CT { @@ -323,7 +337,8 @@ f_init_gsup(testcasename()); f_init_diameter(testcasename()); - f_init_gtp(testcasename()); + f_init_gtp2c(testcasename()); + f_init_gtp1u(testcasename()); } private type function void_fn(charstring id) runs on EPDG_ConnHdlr; @@ -352,9 +367,12 @@ connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); - /* GTP2 */ + /* GTP2C */ connect(vc_conn:GTP2, vc_GTP2:CLIENT); connect(vc_conn:GTP2_PROC, vc_GTP2:CLIENT_PROC); + /* GTP1U */ + connect(vc_conn:GTP1U, vc_GTP1U:CLIENT); + connect(vc_conn:GTP1U_PROC, vc_GTP1U:CLIENT_PROC); /* SWx */ vc_conn_swx := DIAMETER_ConnHdlr_CT.create(id); @@ -704,8 +722,8 @@ }*/ /* allocate + register TEID-C on local side */ - g_pars.teic_local := f_gtp2_allocate_teid(); - g_pars.bearer.teid_local := g_pars.teic_local; + g_pars.teic_local := f_gtp2_allocate_teic(); + g_pars.bearer.teid_local := f_gtp1u_allocate_teid(); } /* ePDG Creates session at the PGW. PGW sends Diameter s6b AAR + AAA. */ @@ -862,18 +880,18 @@ } private function f_GTP1U_send(octetstring payload) runs on EPDG_ConnHdlr { var Gtp1uPeer peer := valueof(ts_GtpPeerU(f_inet_addr(g_pars.bearer.gtpu_addr_remote))); - GTP2.send(ts_GTP1U_GPDU(peer, omit /*opt_part*/, g_pars.bearer.teid_remote, payload)); + GTP1U.send(ts_GTP1U_GPDU(peer, omit /*opt_part*/, g_pars.bearer.teid_remote, payload)); } private function f_GTP1U_echo_ping_pong(uint16_t seq_nr := 0) runs on EPDG_ConnHdlr { var Gtp1uPeer peer := valueof(ts_GtpPeerU(f_inet_addr(g_pars.bearer.gtpu_addr_remote))); - GTP2.send(ts_GTPU_PING(peer, seq := seq_nr)); - GTP2.receive(tr_GTPU_PONG(peer)); + GTP1U.send(ts_GTPU_PING(peer, seq := seq_nr)); + GTP1U.receive(tr_GTPU_PONG(peer)); } private altstep as_GTPU_rx_icmp4(template (present) PDU_ICMP expected := ?) runs on EPDG_ConnHdlr { var Gtp1uUnitdata rx_msg; var template (value) Gtp1uPeer peer := ts_GtpPeerU(f_inet_addr(g_pars.bearer.gtpu_addr_remote)); - [] GTP2.receive(tr_GTPU_GPDU(peer, g_pars.bearer.teid_local)) -> value rx_msg { + [] GTP1U.receive(tr_GTPU_GPDU(peer, g_pars.bearer.teid_local)) -> value rx_msg { /*TODO: verify gtpu txseq: if (f_verify_gtpu_txseq(ud.gtpu, use_gtpu_txseq) == false) { setverdict(fail); @@ -890,7 +908,7 @@ repeat; } } - [] GTP2.receive(Gtp1uUnitdata:?) -> value rx_msg { + [] GTP1U.receive(Gtp1uUnitdata:?) -> value rx_msg { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unexpected GTP msg rx: ", rx_msg)); } } @@ -1298,7 +1316,7 @@ private function f_TC_upf_echo_req(charstring id) runs on EPDG_ConnHdlr { f_initial_attach(); /* Dispatch Echo Resp to this component: */ - f_gtp2_register_teid('00000000'O); + f_gtp1u_register_teid('00000000'O); f_GTP1U_echo_ping_pong(seq_nr := 0); /* Send one again, to validate it works several times: */ f_GTP1U_echo_ping_pong(seq_nr := 1); @@ -1316,7 +1334,7 @@ private function f_TC_mt_ipv4_echo_req(charstring id) runs on EPDG_ConnHdlr { f_initial_attach(); /* Dispatch Echo Resp to this component: */ - f_gtp2_register_teid('00000000'O); + f_gtp1u_register_teid('00000000'O); var octetstring echo_req := f_gen_icmpv4_echo(f_inet_addr(mp_upf_gtpu_local_ip), f_inet_addr(g_pars.ue_ip)); f_GTP1U_send(echo_req); as_GTPU_rx_icmp4((tr_ICMPv4_ERP, tr_ICMPv4_DU)); diff --git a/epdg/gen_links.sh b/epdg/gen_links.sh index 889cb9a..d41e2e1 100755 --- a/epdg/gen_links.sh +++ b/epdg/gen_links.sh @@ -59,7 +59,7 @@ FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp " FILES+="PCO_Types.ttcn GSUP_Types.ttcn GSUP_Templates.ttcn GSUP_Emulation.ttcn " -FILES+="GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1U_Templates.ttcn " +FILES+="GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1U_Templates.ttcn GTPv1U_Emulation.ttcn " FILES+="GTPv2_PrivateExtensions.ttcn GTPv2_Templates.ttcn " FILES+="GTPv2_CodecPort.ttcn GTPv2_CodecPort_CtrlFunctDef.cc GTPv2_CodecPort_CtrlFunct.ttcn GTPv2_Emulation.ttcn " FILES+="ICMP_Templates.ttcn " diff --git a/library/GTPv1U_Emulation.ttcn b/library/GTPv1U_Emulation.ttcn new file mode 100644 index 0000000..7c031b7 --- /dev/null +++ b/library/GTPv1U_Emulation.ttcn @@ -0,0 +1,361 @@ +/* GTPv1U Emulation in TTCN-3 + * + * (C) 2018-2020 Harald Welte <laforge(a)gnumonks.org> + * (C) 2025 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * 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 + */ + +module GTPv1U_Emulation { + +import from IPL4asp_Types all; +import from General_Types all; +import from Osmocom_Types all; +import from GTPU_Types all; +import from GTPv1U_CodecPort all; +import from GTPv1U_CodecPort_CtrlFunct all; + +import from SCTP_Templates all; +import from UECUPS_Types all; +import from UECUPS_CodecPort all; +import from UECUPS_CodecPort_CtrlFunct all; + +/*********************************************************************** + * Main Emulation Component + ***********************************************************************/ + +modulepar { + charstring mp_uecups_host := "127.0.0.1"; + integer mp_uecups_port := UECUPS_SCTP_PORT; +}; + +const integer GTP1U_PORT := 2152; + +type record Gtp1uEmulationCfg { + HostName gtpu_bind_ip optional, + IPL4asp_Types.PortNumber gtpu_bind_port optional, + boolean use_gtpu_daemon +}; + +type component GTPv1U_Emulation_CT { + /* Communication with underlying GTP CodecPort */ + port GTPU_PT GTP1U; + + /* Control port to GTP-U Daemon */ + port UECUPS_CODEC_PT UECUPS; + + /* Communication with Clients */ + port GTP1UEM_PT TEID0; + port GTP1UEM_PT CLIENT; + port GTP1UEM_PROC_PT CLIENT_PROC; + + /* Configuration by the user */ + var Gtp1uEmulationCfg g_gtp1u_cfg; + + /* State */ + var integer g_gtp1u_id := -1; + var OCT1 g_restart_ctr; + var uint16_t g_c_seq_nr; + var TidTableRec TidTable[256]; + var PidTableRec PidTable[256]; + + var integer g_uecups_conn_id := -1; +}; + +/* local TEID <-> ConnHdlr mapping */ +type record TidTableRec { + OCT4 teid, + GTP1U_ConnHdlr vc_conn +}; + +/* pid <-> ConnHdlr mapping (for UECUPS process termination indication) */ +type record PidTableRec { + /* process ID of the running process */ + integer pid, + /* component that started it */ + GTP1U_ConnHdlr vc_conn +}; + +private function f_teid_known(OCT4 teid) runs on GTPv1U_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(TidTable); i := i+1) { + if (isbound(TidTable[i].teid) and TidTable[i].teid == teid) { + return true; + } + } + return false; +} + +private function f_comp_by_teid(OCT4 teid) runs on GTPv1U_Emulation_CT return GTP1U_ConnHdlr { + var integer i; + for (i := 0; i < sizeof(TidTable); i := i+1) { + if (isbound(TidTable[i].teid) and TidTable[i].teid == teid) { + return TidTable[i].vc_conn; + } + } + setverdict(fail, "No Component for TEID ", teid); + mtc.stop; +} + +private function f_comp_by_pid(integer pid) runs on GTPv1U_Emulation_CT return GTP1U_ConnHdlr { + var integer i; + for (i := 0; i < sizeof(PidTable); i := i+1) { + if (isbound(PidTable[i].pid) and PidTable[i].pid == pid) { + /* fixme: remove */ + return PidTable[i].vc_conn; + } + } + setverdict(fail, "No Component for PID ", pid); + mtc.stop; +} + +private function f_tid_tbl_add(OCT4 teid, GTP1U_ConnHdlr vc_conn) runs on GTPv1U_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(TidTable); i := i+1) { + if (not isbound(TidTable[i].teid)) { + TidTable[i].teid := teid; + TidTable[i].vc_conn := vc_conn; + return; + } + } + testcase.stop("No Space in TidTable for ", teid); +} + +private function f_pid_tbl_add(integer pid, GTP1U_ConnHdlr vc_conn) runs on GTPv1U_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(PidTable); i := i+1) { + if (not isbound(PidTable[i].pid)) { + PidTable[i].pid := pid; + PidTable[i].vc_conn := vc_conn; + return; + } + } + testcase.stop("No Space in PID Table for ", pid); +} + + +/* allocate an unused local teid */ +private function f_alloc_teid() runs on GTPv1U_Emulation_CT return OCT4 { + var OCT4 teid; + var integer i, j; + for (i := 0; i < 100; i := i+1) { + teid := f_rnd_octstring(4); + for (j := 0; j < sizeof(TidTable); j := j+1) { + if (isbound(TidTable) and TidTable[i].teid == teid) { + continue; + } + } + /* we iterated over all entries and found no match: great! */ + return teid; + } + testcase.stop("Cannot find unused TEID after ", i, " attempts"); +} + +function tr_UECUPS_RecvFrom_R(template PDU_UECUPS msg) +runs on GTPv1U_Emulation_CT return template UECUPS_RecvFrom { + var template UECUPS_RecvFrom mrf := { + connId := g_uecups_conn_id, + remName := ?, + remPort := ?, + locName := ?, + locPort := ?, + msg := msg + } + return mrf; +} + + +private function f_uecups_xceive(template (value) PDU_UECUPS tx, + template PDU_UECUPS rx_t := ?, float time_out := 10.0) +runs on GTPv1U_Emulation_CT return PDU_UECUPS { + timer T := time_out; + var UECUPS_RecvFrom mrf; + + UECUPS.send(t_UECUPS_Send(g_uecups_conn_id, tx)); + T.start; + alt { + [] UECUPS.receive(tr_UECUPS_RecvFrom_R(rx_t)) -> value mrf { } + [] UECUPS.receive(tr_SctpAssocChange) { repeat; } + [] UECUPS.receive(tr_SctpPeerAddrChange) { repeat; } + [] T.timeout { + setverdict(fail, "Timeout waiting for ", rx_t); + mtc.stop; + } + } + return mrf.msg; +} + +private function f_init(Gtp1uEmulationCfg cfg) runs on GTPv1U_Emulation_CT { + var Result res; + + g_restart_ctr := f_rnd_octstring(1); + g_c_seq_nr := f_rnd_int(65535); + g_gtp1u_cfg := cfg; + + if (g_gtp1u_cfg.use_gtpu_daemon) { + map(self:UECUPS, system:UECUPS); + res := UECUPS_CodecPort_CtrlFunct.f_IPL4_connect(UECUPS, mp_uecups_host, mp_uecups_port, "", -1, -1, + { sctp := valueof(ts_SctpTuple) }); + if (not ispresent(res.connId)) { + setverdict(fail, "Could not connect UECUPS socket, check your configuration"); + testcase.stop; + } + g_uecups_conn_id := res.connId; + /* clear all tunnel state in the daemon at start */ + f_uecups_xceive({reset_all_state := {}}, {reset_all_state_res:=?}, 30.0); + /* make sure we always pass incoming UECUPS indications whenever receiving fom the UECUPS port */ + activate(as_uecups_ind()); + } else if (isvalue(cfg.gtpu_bind_ip) and isvalue(cfg.gtpu_bind_port)) { + map(self:GTP1U, system:GTP1U); + res := GTPv1U_CodecPort_CtrlFunct.f_GTPU_listen(GTP1U, cfg.gtpu_bind_ip, + cfg.gtpu_bind_port, {udp:={}}); + g_gtp1u_id := res.connId; + } +} + +private altstep as_uecups_ind() runs on GTPv1U_Emulation_CT { +var UECUPS_RecvFrom rx; +var GTP1U_ConnHdlr vc_conn; +/* handle incoming program_term_ind; dispatch to whatever component started the process */ +[] UECUPS.receive(tr_UECUPS_RecvFrom_R({program_term_ind:=?})) -> value rx { + vc_conn := f_comp_by_pid(rx.msg.program_term_ind.pid); + CLIENT.send(rx.msg.program_term_ind) to vc_conn; + /* FIXME: remove from table */ + repeat; + } +} + +function main(Gtp1uEmulationCfg cfg) runs on GTPv1U_Emulation_CT { + var Gtp1uUnitdata g1u_ud; + var GTP1U_ConnHdlr vc_conn; + var OCT4 teid; + var PDU_UECUPS rx_uecups; + var UECUPS_CreateTun gtc; + var UECUPS_DestroyTun gtd; + var UECUPS_StartProgram sprog; + + f_init(cfg); + + while (true) { + alt { + [] GTP1U.receive(Gtp1uUnitdata:?) -> value g1u_ud { + if (f_teid_known(g1u_ud.gtpu.teid)) { + vc_conn := f_comp_by_teid(g1u_ud.gtpu.teid); + CLIENT.send(g1u_ud) to vc_conn; + } else if (g1u_ud.gtpu.teid == '00000000'O) { + TEID0.send(g1u_ud); + } else { + log("No client registered for TEID=", g1u_ud.gtpu.teid, "!"); + } + } + [] TEID0.receive(Gtp1uUnitdata:?) -> value g1u_ud sender vc_conn { + GTP1U.send(g1u_ud); + } + [] CLIENT.receive(Gtp1uUnitdata:?) -> value g1u_ud sender vc_conn { + GTP1U.send(g1u_ud); + } + + [] CLIENT_PROC.getcall(GTP1UEM_register_teid:{?}) -> param(teid) sender vc_conn { + f_tid_tbl_add(teid, vc_conn); + CLIENT_PROC.reply(GTP1UEM_register_teid:{teid}) to vc_conn; + } + [] CLIENT_PROC.getcall(GTP1UEM_allocate_teid:{}) -> sender vc_conn { + var OCT4 t := f_alloc_teid(); + f_tid_tbl_add(t, vc_conn); + CLIENT_PROC.reply(GTP1UEM_allocate_teid:{} value t) to vc_conn; + } + [] CLIENT_PROC.getcall(GTP1UEM_create_tunnel:{?}) -> param(gtc) sender vc_conn { + rx_uecups := f_uecups_xceive({create_tun := gtc}, {create_tun_res:={result:=OK}}); + CLIENT_PROC.reply(GTP1UEM_create_tunnel:{gtc}) to vc_conn; + } + [] CLIENT_PROC.getcall(GTP1UEM_destroy_tunnel:{?}) -> param(gtd) sender vc_conn { + rx_uecups := f_uecups_xceive({destroy_tun := gtd}, {destroy_tun_res:={result:=OK}}); + CLIENT_PROC.reply(GTP1UEM_destroy_tunnel:{gtd}) to vc_conn; + } + [] CLIENT_PROC.getcall(GTP1UEM_start_program:{?}) -> param(sprog) sender vc_conn { + rx_uecups := f_uecups_xceive({start_program := sprog}, {start_program_res:=?}); + /* if successful: store (pid, vc_conn) tuple so we can route program_term_ind */ + if (rx_uecups.start_program_res.result == OK) { + f_pid_tbl_add(rx_uecups.start_program_res.pid, vc_conn); + } + CLIENT_PROC.reply(GTP1UEM_start_program:{sprog} value rx_uecups.start_program_res) to vc_conn; + } + + } + } +} + + +/*********************************************************************** + * Interaction between Main and Client Components + ***********************************************************************/ +type port GTP1UEM_PT message { + inout Gtp1uUnitdata, UECUPS_ProgramTermInd; +} with { extension "internal" }; + +signature GTP1UEM_register_teid(OCT4 teid); +signature GTP1UEM_allocate_teid() return OCT4; +signature GTP1UEM_create_tunnel(UECUPS_CreateTun gtc); +signature GTP1UEM_destroy_tunnel(UECUPS_DestroyTun gtd); +signature GTP1UEM_start_program(UECUPS_StartProgram sprog) return UECUPS_StartProgramRes; + +type port GTP1UEM_PROC_PT procedure { + inout GTP1UEM_register_teid, GTP1UEM_allocate_teid, + GTP1UEM_create_tunnel, GTP1UEM_destroy_tunnel, GTP1UEM_start_program; +} with { extension "internal" }; + +/*********************************************************************** + * Client Component + ***********************************************************************/ + +type component GTP1U_ConnHdlr { + port GTP1UEM_PT GTP1U; + port GTP1UEM_PROC_PT GTP1U_PROC; +}; + + +function f_gtp1u_register_teid(OCT4 teid) runs on GTP1U_ConnHdlr { + GTP1U_PROC.call(GTP1UEM_register_teid:{teid}) { + [] GTP1U_PROC.getreply(GTP1UEM_register_teid:{teid}); + } +} + +function f_gtp1u_allocate_teid() runs on GTP1U_ConnHdlr return OCT4 { + var OCT4 t; + GTP1U_PROC.call(GTP1UEM_allocate_teid:{}) { + [] GTP1U_PROC.getreply(GTP1UEM_allocate_teid:{}) -> value t { + return t; + } + } +} + +function f_gtp1u_create_tunnel(template (value) UECUPS_CreateTun gtc) +runs on GTP1U_ConnHdlr { + GTP1U_PROC.call(GTP1UEM_create_tunnel:{valueof(gtc)}) { + [] GTP1U_PROC.getreply(GTP1UEM_create_tunnel:{gtc}); + } +} + +function f_gtp1u_destroy_tunnel(template (value) UECUPS_DestroyTun gtd) +runs on GTP1U_ConnHdlr { + GTP1U_PROC.call(GTP1UEM_destroy_tunnel:{valueof(gtd)}) { + [] GTP1U_PROC.getreply(GTP1UEM_destroy_tunnel:{gtd}); + } +} + +function f_gtp1u_start_program(template (value) UECUPS_StartProgram sprog) +runs on GTP1U_ConnHdlr return UECUPS_StartProgramRes { + var UECUPS_StartProgramRes res; + GTP1U_PROC.call(GTP1UEM_start_program:{valueof(sprog)}) { + [] GTP1U_PROC.getreply(GTP1UEM_start_program:{sprog}) -> value res; + } + return res; +} + + + +} diff --git a/library/GTPv2_Emulation.ttcn b/library/GTPv2_Emulation.ttcn index 15720f9..7ef5283 100644 --- a/library/GTPv2_Emulation.ttcn +++ b/library/GTPv2_Emulation.ttcn @@ -14,52 +14,33 @@ import from IPL4asp_Types all; import from General_Types all; import from Osmocom_Types all; -import from GTPU_Types all; -import from GTPv1U_CodecPort all; -import from GTPv1U_CodecPort_CtrlFunct all; import from GTPv2_Types all; import from GTPv2_Templates all; import from GTPv2_CodecPort all; import from GTPv2_CodecPort_CtrlFunct all; -import from SCTP_Templates all; - -import from UECUPS_Types all; -import from UECUPS_CodecPort all; -import from UECUPS_CodecPort_CtrlFunct all; /*********************************************************************** * Main Emulation Component ***********************************************************************/ -modulepar { - charstring mp_uecups_host := "127.0.0.1"; - integer mp_uecups_port := UECUPS_SCTP_PORT; -}; +//modulepar {}; const integer GTP2C_PORT := 2123; -const integer GTP1U_PORT := 2152; type record Gtp2EmulationCfg { HostName gtpc_bind_ip, IPL4asp_Types.PortNumber gtpc_bind_port, HostName gtpc_remote_ip, IPL4asp_Types.PortNumber gtpc_remote_port, - HostName gtpu_bind_ip optional, - IPL4asp_Types.PortNumber gtpu_bind_port optional, - boolean sgw_role, - boolean use_gtpu_daemon + boolean sgw_role }; type component GTPv2_Emulation_CT { /* Communication with underlying GTP CodecPort */ port GTPv2C_PT GTP2C; - port GTPU_PT GTPU; - - /* Control port to GTP-U Daemon */ - port UECUPS_CODEC_PT UECUPS; /* Communication with Clients */ - port GTP2EM_PT TEID0; + port GTP2EM_PT TEIC0; port GTP2EM_PT CLIENT; port GTP2EM_PROC_PT CLIENT_PROC; @@ -68,7 +49,7 @@ /* State */ var Gtp2cPeer g_peer; - var integer g_gtp2c_id, g_gtp1u_id; + var integer g_gtp2c_id; var OCT1 g_restart_ctr; var uint16_t g_c_seq_nr; var TidTableRec TidTable[256]; @@ -76,13 +57,11 @@ var ImsiTableRec ImsiTable[256]; var UdMsgTableRec UdMsgTable[256]; var PidTableRec PidTable[256]; - - var integer g_uecups_conn_id; }; -/* local TEID <-> ConnHdlr mapping */ +/* local TEIC <-> ConnHdlr mapping */ type record TidTableRec { - OCT4 teid, + OCT4 teic, GTP2_ConnHdlr vc_conn }; @@ -112,24 +91,24 @@ GTP2_ConnHdlr vc_conn }; -private function f_teid_known(OCT4 teid) runs on GTPv2_Emulation_CT return boolean { +private function f_teic_known(OCT4 teic) runs on GTPv2_Emulation_CT return boolean { var integer i; for (i := 0; i < sizeof(TidTable); i := i+1) { - if (isbound(TidTable[i].teid) and TidTable[i].teid == teid) { + if (isbound(TidTable[i].teic) and TidTable[i].teic == teic) { return true; } } return false; } -private function f_comp_by_teid(OCT4 teid) runs on GTPv2_Emulation_CT return GTP2_ConnHdlr { +private function f_comp_by_teic(OCT4 teic) runs on GTPv2_Emulation_CT return GTP2_ConnHdlr { var integer i; for (i := 0; i < sizeof(TidTable); i := i+1) { - if (isbound(TidTable[i].teid) and TidTable[i].teid == teid) { + if (isbound(TidTable[i].teic) and TidTable[i].teic == teic) { return TidTable[i].vc_conn; } } - setverdict(fail, "No Component for TEID ", teid); + setverdict(fail, "No Component for TEIC ", teic); mtc.stop; } @@ -187,16 +166,16 @@ mtc.stop; } -private function f_tid_tbl_add(OCT4 teid, GTP2_ConnHdlr vc_conn) runs on GTPv2_Emulation_CT { +private function f_tid_tbl_add(OCT4 teic, GTP2_ConnHdlr vc_conn) runs on GTPv2_Emulation_CT { var integer i; for (i := 0; i < sizeof(TidTable); i := i+1) { - if (not isbound(TidTable[i].teid)) { - TidTable[i].teid := teid; + if (not isbound(TidTable[i].teic)) { + TidTable[i].teic := teic; TidTable[i].vc_conn := vc_conn; return; } } - testcase.stop("No Space in TidTable for ", teid); + testcase.stop("No Space in TidTable for ", teic); } private function f_seq_tbl_add(OCT3 seq, GTP2_ConnHdlr vc_conn) runs on GTPv2_Emulation_CT { @@ -260,21 +239,21 @@ } -/* allocate an unused local teid */ -private function f_alloc_teid() runs on GTPv2_Emulation_CT return OCT4 { - var OCT4 teid; +/* allocate an unused local teic */ +private function f_alloc_teic() runs on GTPv2_Emulation_CT return OCT4 { + var OCT4 teic; var integer i, j; for (i := 0; i < 100; i := i+1) { - teid := f_rnd_octstring(4); + teic := f_rnd_octstring(4); for (j := 0; j < sizeof(TidTable); j := j+1) { - if (isbound(TidTable) and TidTable[i].teid == teid) { + if (isbound(TidTable) and TidTable[i].teic == teic) { continue; } } /* we iterated over all entries and found no match: great! */ - return teid; + return teic; } - testcase.stop("Cannot find unused TEID after ", i, " attempts"); + testcase.stop("Cannot find unused TEIC after ", i, " attempts"); } /* obtain the IMSI from a GTPv2C PDU, if there is any IMSI contained. The way how the TITAN @@ -432,40 +411,6 @@ return false; } -function tr_UECUPS_RecvFrom_R(template PDU_UECUPS msg) -runs on GTPv2_Emulation_CT return template UECUPS_RecvFrom { - var template UECUPS_RecvFrom mrf := { - connId := g_uecups_conn_id, - remName := ?, - remPort := ?, - locName := ?, - locPort := ?, - msg := msg - } - return mrf; -} - - -private function f_uecups_xceive(template (value) PDU_UECUPS tx, - template PDU_UECUPS rx_t := ?, float time_out := 10.0) -runs on GTPv2_Emulation_CT return PDU_UECUPS { - timer T := time_out; - var UECUPS_RecvFrom mrf; - - UECUPS.send(t_UECUPS_Send(g_uecups_conn_id, tx)); - T.start; - alt { - [] UECUPS.receive(tr_UECUPS_RecvFrom_R(rx_t)) -> value mrf { } - [] UECUPS.receive(tr_SctpAssocChange) { repeat; } - [] UECUPS.receive(tr_SctpPeerAddrChange) { repeat; } - [] T.timeout { - setverdict(fail, "Timeout waiting for ", rx_t); - mtc.stop; - } - } - return mrf.msg; -} - private function f_init(Gtp2EmulationCfg cfg) runs on GTPv2_Emulation_CT { var Result res; @@ -482,41 +427,6 @@ remName := g_gtp2_cfg.gtpc_remote_ip, remPort := g_gtp2_cfg.gtpc_remote_port } - - g_uecups_conn_id := res.connId; - - if (g_gtp2_cfg.use_gtpu_daemon) { - map(self:UECUPS, system:UECUPS); - res := UECUPS_CodecPort_CtrlFunct.f_IPL4_connect(UECUPS, mp_uecups_host, mp_uecups_port, "", -1, -1, - { sctp := valueof(ts_SctpTuple) }); - if (not ispresent(res.connId)) { - setverdict(fail, "Could not connect UECUPS socket, check your configuration"); - testcase.stop; - } - - /* clear all tunnel state in the daemon at start */ - f_uecups_xceive({reset_all_state := {}}, {reset_all_state_res:=?}, 30.0); - } else if (isvalue(cfg.gtpu_bind_ip) and isvalue(cfg.gtpu_bind_port)) { - map(self:GTPU, system:GTPU); - res := GTPv1U_CodecPort_CtrlFunct.f_GTPU_listen(GTPU, cfg.gtpu_bind_ip, - cfg.gtpu_bind_port, {udp:={}}); - g_gtp1u_id := res.connId; - } - - /* make sure we always pass incoming UECUPS indications whenever receiving fom the UECUPS port */ - activate(as_uecups_ind()); -} - -private altstep as_uecups_ind() runs on GTPv2_Emulation_CT { -var UECUPS_RecvFrom rx; -var GTP2_ConnHdlr vc_conn; -/* handle incoming program_term_ind; dispatch to whatever component started the process */ -[] UECUPS.receive(tr_UECUPS_RecvFrom_R({program_term_ind:=?})) -> value rx { - vc_conn := f_comp_by_pid(rx.msg.program_term_ind.pid); - CLIENT.send(rx.msg.program_term_ind) to vc_conn; - /* FIXME: remove from table */ - repeat; - } } private function SendToUdMsgTable(Gtp2cUnitdata g2c_ud) runs on GTPv2_Emulation_CT { @@ -536,22 +446,17 @@ function main(Gtp2EmulationCfg cfg) runs on GTPv2_Emulation_CT { var Gtp2cUnitdata g2c_ud; - var Gtp1uUnitdata g1u_ud; var PDU_GTPCv2 g2c; var GTP2_ConnHdlr vc_conn; var hexstring imsi; var OCT1 messageType; - var OCT4 teid; - var PDU_UECUPS rx_uecups; - var UECUPS_CreateTun gtc; - var UECUPS_DestroyTun gtd; - var UECUPS_StartProgram sprog; + var OCT4 teic; f_init(cfg); while (true) { alt { - /* route inbound GTP2-C based on TEID, SEQ or IMSI */ + /* route inbound GTP2-C based on TEIC, SEQ or IMSI */ [] GTP2C.receive(Gtp2cUnitdata:?) -> value g2c_ud { var template hexstring imsi_t := f_gtp2c_extract_imsi(g2c_ud.gtpc); /* if this is a response, route by SEQ: */ @@ -563,17 +468,17 @@ vc_conn := f_comp_by_imsi(valueof(imsi_t)); CLIENT.send(g2c_ud.gtpc) to vc_conn; } else if ((ispresent(g2c_ud.gtpc.tEID) and g2c_ud.gtpc.tEID != '00000000'O) - and f_teid_known(g2c_ud.gtpc.tEID)) { - vc_conn := f_comp_by_teid(g2c_ud.gtpc.tEID); + and f_teic_known(g2c_ud.gtpc.tEID)) { + vc_conn := f_comp_by_teic(g2c_ud.gtpc.tEID); CLIENT.send(g2c_ud.gtpc) to vc_conn; } else if ((not ispresent(g2c_ud.gtpc.tEID) or g2c_ud.gtpc.tEID == '00000000'O) - and f_teid_known('00000000'O)) { - vc_conn := f_comp_by_teid(g2c_ud.gtpc.tEID); + and f_teic_known('00000000'O)) { + vc_conn := f_comp_by_teic(g2c_ud.gtpc.tEID); CLIENT.send(g2c_ud.gtpc) to vc_conn; } else { SendToUdMsgTable(g2c_ud); if (not ispresent(g2c_ud.gtpc.tEID) or g2c_ud.gtpc.tEID == '00000000'O) { - TEID0.send(g2c_ud.gtpc); + TEIC0.send(g2c_ud.gtpc); } } @@ -583,18 +488,8 @@ } } - [] GTPU.receive(Gtp1uUnitdata:?) -> value g1u_ud { - if (f_teid_known(g1u_ud.gtpu.teid)) { - vc_conn := f_comp_by_teid(g1u_ud.gtpu.teid); - CLIENT.send(g1u_ud) to vc_conn; - } else if (g1u_ud.gtpu.teid == '00000000'O) { - TEID0.send(g1u_ud); - } else { - log("No client registered for TEID=", g1u_ud.gtpu.teid, "!"); - } - } - [] TEID0.receive(PDU_GTPCv2:?) -> value g2c sender vc_conn { + [] TEIC0.receive(PDU_GTPCv2:?) -> value g2c sender vc_conn { /* patch in the next sequence number on outbound Initial message */ if (f_gtp2c_is_initial_msg(g2c)) { g2c.sequenceNumber := int2oct(g_c_seq_nr, 3); @@ -607,9 +502,6 @@ f_seq_tbl_add(g2c.sequenceNumber, vc_conn); } } - [] TEID0.receive(Gtp1uUnitdata:?) -> value g1u_ud sender vc_conn { - GTPU.send(g1u_ud); - } [] CLIENT.receive(PDU_GTPCv2:?) -> value g2c sender vc_conn { /* patch in the next sequence number on outbound Initial message */ @@ -624,9 +516,6 @@ f_seq_tbl_add(g2c.sequenceNumber, vc_conn); } } - [] CLIENT.receive(Gtp1uUnitdata:?) -> value g1u_ud sender vc_conn { - GTPU.send(g1u_ud); - } [] CLIENT_PROC.getcall(GTP2EM_register_imsi:{?}) -> param(imsi) sender vc_conn { f_imsi_tbl_add(imsi, vc_conn); @@ -637,32 +526,15 @@ CLIENT_PROC.reply(GTP2EM_register_udmsg:{messageType}) to vc_conn; } - [] CLIENT_PROC.getcall(GTP2EM_register_teid:{?}) -> param(teid) sender vc_conn { - f_tid_tbl_add(teid, vc_conn); - CLIENT_PROC.reply(GTP2EM_register_teid:{teid}) to vc_conn; + [] CLIENT_PROC.getcall(GTP2EM_register_teic:{?}) -> param(teic) sender vc_conn { + f_tid_tbl_add(teic, vc_conn); + CLIENT_PROC.reply(GTP2EM_register_teic:{teic}) to vc_conn; } - [] CLIENT_PROC.getcall(GTP2EM_allocate_teid:{}) -> sender vc_conn { - var OCT4 t := f_alloc_teid(); + [] CLIENT_PROC.getcall(GTP2EM_allocate_teic:{}) -> sender vc_conn { + var OCT4 t := f_alloc_teic(); f_tid_tbl_add(t, vc_conn); - CLIENT_PROC.reply(GTP2EM_allocate_teid:{} value t) to vc_conn; + CLIENT_PROC.reply(GTP2EM_allocate_teic:{} value t) to vc_conn; } - [] CLIENT_PROC.getcall(GTP2EM_create_tunnel:{?}) -> param(gtc) sender vc_conn { - rx_uecups := f_uecups_xceive({create_tun := gtc}, {create_tun_res:={result:=OK}}); - CLIENT_PROC.reply(GTP2EM_create_tunnel:{gtc}) to vc_conn; - } - [] CLIENT_PROC.getcall(GTP2EM_destroy_tunnel:{?}) -> param(gtd) sender vc_conn { - rx_uecups := f_uecups_xceive({destroy_tun := gtd}, {destroy_tun_res:={result:=OK}}); - CLIENT_PROC.reply(GTP2EM_destroy_tunnel:{gtd}) to vc_conn; - } - [] CLIENT_PROC.getcall(GTP2EM_start_program:{?}) -> param(sprog) sender vc_conn { - rx_uecups := f_uecups_xceive({start_program := sprog}, {start_program_res:=?}); - /* if successful: store (pid, vc_conn) tuple so we can route program_term_ind */ - if (rx_uecups.start_program_res.result == OK) { - f_pid_tbl_add(rx_uecups.start_program_res.pid, vc_conn); - } - CLIENT_PROC.reply(GTP2EM_start_program:{sprog} value rx_uecups.start_program_res) to vc_conn; - } - } } } @@ -672,20 +544,17 @@ * Interaction between Main and Client Components ***********************************************************************/ type port GTP2EM_PT message { - inout PDU_GTPCv2, Gtp1uUnitdata, UECUPS_ProgramTermInd; + inout PDU_GTPCv2; } with { extension "internal" }; signature GTP2EM_register_imsi(hexstring imsi); signature GTP2EM_register_udmsg(OCT1 messageType); -signature GTP2EM_register_teid(OCT4 teid); -signature GTP2EM_allocate_teid() return OCT4; -signature GTP2EM_create_tunnel(UECUPS_CreateTun gtc); -signature GTP2EM_destroy_tunnel(UECUPS_DestroyTun gtd); -signature GTP2EM_start_program(UECUPS_StartProgram sprog) return UECUPS_StartProgramRes; +signature GTP2EM_register_teic(OCT4 teic); +signature GTP2EM_allocate_teic() return OCT4; type port GTP2EM_PROC_PT procedure { - inout GTP2EM_register_imsi, GTP2EM_register_udmsg, GTP2EM_register_teid, GTP2EM_allocate_teid, - GTP2EM_create_tunnel, GTP2EM_destroy_tunnel, GTP2EM_start_program; + inout GTP2EM_register_imsi, GTP2EM_register_udmsg, + GTP2EM_register_teic, GTP2EM_allocate_teic; } with { extension "internal" }; /*********************************************************************** @@ -713,44 +582,18 @@ } } -function f_gtp2_register_teid(OCT4 teid) runs on GTP2_ConnHdlr { - GTP2_PROC.call(GTP2EM_register_teid:{teid}) { - [] GTP2_PROC.getreply(GTP2EM_register_teid:{teid}); +function f_gtp2_register_teic(OCT4 teic) runs on GTP2_ConnHdlr { + GTP2_PROC.call(GTP2EM_register_teic:{teic}) { + [] GTP2_PROC.getreply(GTP2EM_register_teic:{teic}); } } -function f_gtp2_allocate_teid() runs on GTP2_ConnHdlr return OCT4 { +function f_gtp2_allocate_teic() runs on GTP2_ConnHdlr return OCT4 { var OCT4 t; - GTP2_PROC.call(GTP2EM_allocate_teid:{}) { - [] GTP2_PROC.getreply(GTP2EM_allocate_teid:{}) -> value t { + GTP2_PROC.call(GTP2EM_allocate_teic:{}) { + [] GTP2_PROC.getreply(GTP2EM_allocate_teic:{}) -> value t { return t; } } } - -function f_gtp2_create_tunnel(template (value) UECUPS_CreateTun gtc) -runs on GTP2_ConnHdlr { - GTP2_PROC.call(GTP2EM_create_tunnel:{valueof(gtc)}) { - [] GTP2_PROC.getreply(GTP2EM_create_tunnel:{gtc}); - } -} - -function f_gtp2_destroy_tunnel(template (value) UECUPS_DestroyTun gtd) -runs on GTP2_ConnHdlr { - GTP2_PROC.call(GTP2EM_destroy_tunnel:{valueof(gtd)}) { - [] GTP2_PROC.getreply(GTP2EM_destroy_tunnel:{gtd}); - } -} - -function f_gtp2_start_program(template (value) UECUPS_StartProgram sprog) -runs on GTP2_ConnHdlr return UECUPS_StartProgramRes { - var UECUPS_StartProgramRes res; - GTP2_PROC.call(GTP2EM_start_program:{valueof(sprog)}) { - [] GTP2_PROC.getreply(GTP2EM_start_program:{sprog}) -> value res; - } - return res; -} - - - } diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn index c006aa4..4885b1e 100644 --- a/mme/MME_Tests.ttcn +++ b/mme/MME_Tests.ttcn @@ -120,7 +120,7 @@ /* S11 interface (GTPv2C) of emulated SGW-C */ var GTPv2_Emulation_CT vc_GTP2; - port GTP2EM_PT TEID0; + port GTP2EM_PT TEIC0; var UeParams g_ue_pars[NUM_UE]; } @@ -371,15 +371,12 @@ gtpc_bind_port := mp_s11_local_port, gtpc_remote_ip := mp_s11_remote_ip, gtpc_remote_port := mp_s11_remote_port, - gtpu_bind_ip := omit, /* using gtpu daemon */ - gtpu_bind_port := omit, /* using gtpu daemon */ - sgw_role := true, - use_gtpu_daemon := false + sgw_role := true }; vc_GTP2 := GTPv2_Emulation_CT.create(id); map(vc_GTP2:GTP2C, system:GTP2C); - connect(vc_GTP2:TEID0, self:TEID0); + connect(vc_GTP2:TEIC0, self:TEIC0); vc_GTP2.start(GTPv2_Emulation.main(cfg)); } @@ -840,9 +837,9 @@ g_pars.ue_pars.bearer.ebi := rx_bctx_ies.ePS_Bearer_ID.ePS_Bearer_ID_Value; /* allocate + register TEID-C on local side */ - g_pars.ue_pars.s11_teic_local := f_gtp2_allocate_teid(); + g_pars.ue_pars.s11_teic_local := f_gtp2_allocate_teic(); g_pars.ue_pars.bearer.s11_teid_local := g_pars.ue_pars.s11_teic_local; - g_pars.ue_pars.s5c_teic_local := f_gtp2_allocate_teid(); + g_pars.ue_pars.s5c_teic_local := f_gtp2_allocate_teic(); g_pars.ue_pars.bearer.s5c_teid_local := g_pars.ue_pars.s5c_teic_local; s11_fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S11_MME_GTPC, g_pars.ue_pars.s11_teic_local, 0, diff --git a/mme/gen_links.sh b/mme/gen_links.sh index af0355f..ea9179f 100755 --- a/mme/gen_links.sh +++ b/mme/gen_links.sh @@ -55,10 +55,6 @@ FILES="GTPv2_Types.ttcn" gen_links $DIR $FILES -DIR=$BASEDIR/osmo-uecups/ttcn3 -FILES="UECUPS_CodecPort.ttcn UECUPS_CodecPort_CtrlFunct.ttcn UECUPS_CodecPort_CtrlFunctDef.cc UECUPS_Types.ttcn " -gen_links $DIR $FILES - DIR=$BASEDIR/titan.ProtocolModules.DIAMETER_ProtocolModule_Generator/src FILES="DIAMETER_EncDec.cc" gen_links $DIR $FILES diff --git a/mme/regen_makefile.sh b/mme/regen_makefile.sh index 4eb0f1a..c1859da 100755 --- a/mme/regen_makefile.sh +++ b/mme/regen_makefile.sh @@ -26,7 +26,6 @@ TCCEncoding.cc TCCInterface.cc TELNETasp_PT.cc - UECUPS_CodecPort_CtrlFunctDef.cc " . ../_buildsystem/regen_makefile.inc.sh diff --git a/pgw/PGW_Tests.cfg b/pgw/PGW_Tests.cfg index ce3076b..68688c1 100644 --- a/pgw/PGW_Tests.cfg +++ b/pgw/PGW_Tests.cfg @@ -20,7 +20,7 @@ PGW_Tests.mp_pcrf_local_ip:= "127.0.0.202" PGW_Tests.mp_ocs_local_ip:= "127.0.0.202" PGW_Tests.mp_aaa_local_ip:= "127.0.0.202" -GTPv2_Emulation.mp_uecups_host := "127.0.0.20" +GTPv1U_Emulation.mp_uecups_host := "127.0.0.20" [MAIN_CONTROLLER] diff --git a/pgw/PGW_Tests.ttcn b/pgw/PGW_Tests.ttcn index 4a4f77f..4d225fa 100644 --- a/pgw/PGW_Tests.ttcn +++ b/pgw/PGW_Tests.ttcn @@ -7,6 +7,8 @@ import from Native_Functions all; import from Misc_Helpers all; +import from GTPv1U_Emulation all; + import from GTPv2_Types all; import from GTPv2_Templates all; import from GTPv2_Emulation all; @@ -47,9 +49,11 @@ } /* main component, we typically have one per testcase */ -type component PGW_Test_CT extends GTP2_ConnHdlr { +type component PGW_Test_CT extends GTP2_ConnHdlr, GTP1U_ConnHdlr { var GTPv2_Emulation_CT vc_GTP2; - port GTP2EM_PT TEID0; + port GTP2EM_PT TEIC0; + var GTPv1U_Emulation_CT vc_GTP1U; + port GTP1UEM_PT TEID0; /* emulated PCRF */ var DIAMETER_Emulation_CT vc_Gx; @@ -100,7 +104,7 @@ /* per-session component; we typically have 1..N per testcase */ -type component PGW_Session_CT extends GTP2_ConnHdlr { +type component PGW_Session_CT extends GTP2_ConnHdlr, GTP1U_ConnHdlr { var SessionPars g_pars; port DIAMETER_Conn_PT Gx; @@ -280,27 +284,44 @@ f_sleep(1.0); } -private function f_init(float guard_timeout := 60.0) runs on PGW_Test_CT { - T_guard.start(guard_timeout); - activate(as_Tguard()); - +private function f_init_gtp2c() runs on PGW_Test_CT { var Gtp2EmulationCfg cfg := { gtpc_bind_ip := mp_local_hostname_c, gtpc_bind_port := GTP2C_PORT, gtpc_remote_ip := mp_pgw_hostname, gtpc_remote_port := GTP2C_PORT, - gtpu_bind_ip := omit, /* using gtpu daemon */ - gtpu_bind_port := omit, /* using gtpu daemon */ - sgw_role := true, - use_gtpu_daemon := true + sgw_role := true }; - vc_GTP2 := GTPv2_Emulation_CT.create("GTP2_EM"); + vc_GTP2 := GTPv2_Emulation_CT.create("GTP2C_EM"); map(vc_GTP2:GTP2C, system:GTP2C); - connect(vc_GTP2:TEID0, self:TEID0); + connect(vc_GTP2:TEIC0, self:TEIC0); connect(vc_GTP2:CLIENT, self:GTP2); connect(vc_GTP2:CLIENT_PROC, self:GTP2_PROC); vc_GTP2.start(GTPv2_Emulation.main(cfg)); +} + +private function f_init_gtp1u() runs on PGW_Test_CT { + var Gtp1uEmulationCfg cfg := { + gtpu_bind_ip := omit, /* using gtpu daemon */ + gtpu_bind_port := omit, /* using gtpu daemon */ + use_gtpu_daemon := true + }; + + vc_GTP1U := GTPv1U_Emulation_CT.create("GTP1U_EM"); + map(vc_GTP1U:GTP1U, system:GTP1U); + connect(vc_GTP1U:TEID0, self:TEID0); + connect(vc_GTP1U:CLIENT, self:GTP1U); + connect(vc_GTP1U:CLIENT_PROC, self:GTP1U_PROC); + vc_GTP1U.start(GTPv1U_Emulation.main(cfg)); +} + +private function f_init(float guard_timeout := 60.0) runs on PGW_Test_CT { + T_guard.start(guard_timeout); + activate(as_Tguard()); + + f_init_gtp2c(); + f_init_gtp1u(); if (mp_pcrf_local_ip != "") { f_init_diameter(testcasename()); @@ -323,6 +344,8 @@ vc_conn := PGW_Session_CT.create(id); connect(vc_conn:GTP2, vc_GTP2:CLIENT); connect(vc_conn:GTP2_PROC, vc_GTP2:CLIENT_PROC); + connect(vc_conn:GTP1U, vc_GTP1U:CLIENT); + connect(vc_conn:GTP1U_PROC, vc_GTP1U:CLIENT_PROC); if (isbound(vc_Gx)) { vc_conn_gx := DIAMETER_ConnHdlr_CT.create(id); @@ -355,9 +378,9 @@ private function f_handler_init(void_fn fn, SessionPars pars) runs on PGW_Session_CT { g_pars := valueof(pars); - /* allocate + register TEID-C on local side */ - g_pars.teic_local := f_gtp2_allocate_teid(); - g_pars.bearer.teid_local := g_pars.teic_local; + /* allocate + register TEI{C,D} on local side */ + g_pars.teic_local := f_gtp2_allocate_teic(); + g_pars.bearer.teid_local := f_gtp1u_allocate_teid(); fn.apply(); } @@ -693,12 +716,12 @@ /* create tunnel in daemon */ if (isbound(g_ip4_addr)) { uecups_create.user_addr := g_ip4_addr; - f_gtp2_create_tunnel(uecups_create); + f_gtp1u_create_tunnel(uecups_create); } if (isbound(g_ip6_addr)) { uecups_create.user_addr_type := IPV6; uecups_create.user_addr := g_ip6_addr; - f_gtp2_create_tunnel(uecups_create); + f_gtp1u_create_tunnel(uecups_create); } } @@ -871,7 +894,7 @@ rx_teid := oct2int(g_pars.bearer.teid_local) }; /* FIXME: what about IPv4/IPv6 differentiation? */ - f_gtp2_destroy_tunnel(uecups_destroy); + f_gtp1u_destroy_tunnel(uecups_destroy); } } @@ -896,7 +919,7 @@ } log("Starting a program: ", command); - var UECUPS_StartProgramRes res := f_gtp2_start_program(sprog); + var UECUPS_StartProgramRes res := f_gtp1u_start_program(sprog); if (res.result != OK) { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unable to start program '", command, "'")); @@ -914,10 +937,10 @@ T.start; alt { - [] GTP2.receive(UECUPS_ProgramTermInd:{pid := pid, exit_code := exit_code}) { + [] GTP1U.receive(UECUPS_ProgramTermInd:{pid := pid, exit_code := exit_code}) { setverdict(pass); } - [] GTP2.receive(UECUPS_ProgramTermInd:?) -> value pti { + [] GTP1U.receive(UECUPS_ProgramTermInd:?) -> value pti { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Received unexpected ProgramTermInd := ", pti)); } diff --git a/pgw/gen_links.sh b/pgw/gen_links.sh index 314050e..fa69ee4 100755 --- a/pgw/gen_links.sh +++ b/pgw/gen_links.sh @@ -59,7 +59,8 @@ DIR=../library FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn IPCP_Templates.ttcn PAP_Types.ttcn " -FILES+="GTPv1C_CodecPort.ttcn GTPv1C_CodecPort_CtrlFunct.ttcn GTPv1C_CodecPort_CtrlFunctDef.cc GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1C_Templates.ttcn Osmocom_Gb_Types.ttcn " +FILES+="GTPv1C_CodecPort.ttcn GTPv1C_CodecPort_CtrlFunct.ttcn GTPv1C_CodecPort_CtrlFunctDef.cc GTPv1C_Templates.ttcn Osmocom_Gb_Types.ttcn " +FILES+="GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1U_Emulation.ttcn " FILES+="GTPv2_PrivateExtensions.ttcn GTPv2_Templates.ttcn " FILES+="GTPv2_CodecPort.ttcn GTPv2_CodecPort_CtrlFunctDef.cc GTPv2_CodecPort_CtrlFunct.ttcn GTPv2_Emulation.ttcn " FILES+="DNS_Helpers.ttcn " -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40744?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia45307107753294c6761cb588f0ab769821eb213 Gerrit-Change-Number: 40744 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 day, 19 hours
1
0
0
0
[XS] Change in osmo-dev[master]: sanitize.opts: Add missing osmo-uecups entry
by pespin
pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-dev/+/40743?usp=email
) Change subject: sanitize.opts: Add missing osmo-uecups entry ...................................................................... sanitize.opts: Add missing osmo-uecups entry Change-Id: I2c9f9a7db286117cbf31d3085d7af5ac05a615b2 --- M sanitize.opts 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/43/40743/1 diff --git a/sanitize.opts b/sanitize.opts index 0ef0a8c..08ab8dc 100644 --- a/sanitize.opts +++ b/sanitize.opts @@ -22,4 +22,5 @@ osmo-cbc --enable-sanitize osmo-hnbgw --enable-sanitize osmo-gsm-shark --enable-sanitize +osmo-uecups --enable-sanitize upf-benchmark --enable-sanitize -- To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/40743?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I2c9f9a7db286117cbf31d3085d7af5ac05a615b2 Gerrit-Change-Number: 40743 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 day, 19 hours
1
0
0
0
[XS] Change in osmo-dev[master]: all.deps: Add missing osmo-uecups dep on libosmo-netif
by fixeria
Attention is currently required from: pespin. fixeria has posted comments on this change by pespin. (
https://gerrit.osmocom.org/c/osmo-dev/+/40742?usp=email
) Change subject: all.deps: Add missing osmo-uecups dep on libosmo-netif ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/40742?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: Ie94a2bf16cc8bdac9a1c886df22aab90b7e5d364 Gerrit-Change-Number: 40742 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 24 Jul 2025 14:43:15 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 day, 19 hours
1
0
0
0
[XS] Change in osmo-dev[master]: all.deps: Add missing osmo-uecups dep on libosmo-netif
by osmith
Attention is currently required from: fixeria, pespin. osmith has posted comments on this change by pespin. (
https://gerrit.osmocom.org/c/osmo-dev/+/40742?usp=email
) Change subject: all.deps: Add missing osmo-uecups dep on libosmo-netif ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/40742?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: Ie94a2bf16cc8bdac9a1c886df22aab90b7e5d364 Gerrit-Change-Number: 40742 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 24 Jul 2025 14:42:46 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 day, 19 hours
1
0
0
0
[XS] Change in osmo-dev[master]: all.deps: Add missing osmo-uecups dep on libosmo-netif
by pespin
pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-dev/+/40742?usp=email
) Change subject: all.deps: Add missing osmo-uecups dep on libosmo-netif ...................................................................... all.deps: Add missing osmo-uecups dep on libosmo-netif Change-Id: Ie94a2bf16cc8bdac9a1c886df22aab90b7e5d364 --- M all.deps 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/42/40742/1 diff --git a/all.deps b/all.deps index dac171e..3fc5ad1 100644 --- a/all.deps +++ b/all.deps @@ -35,7 +35,7 @@ osmo-hnbgw osmo-iuh osmo-mgw libosmo-pfcp nftables osmo-e1d libosmocore osmo-remsim simtrace2_host libosmo-abis -osmo-uecups libosmocore +osmo-uecups libosmocore libosmo-netif osmo-s1gw osmo-epdg -- To view, visit
https://gerrit.osmocom.org/c/osmo-dev/+/40742?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: Ie94a2bf16cc8bdac9a1c886df22aab90b7e5d364 Gerrit-Change-Number: 40742 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 day, 19 hours
1
0
0
0
[L] Change in osmo-ttcn3-hacks[master]: 5gc: Support PDU Session Establishment procedure
by jolly
Attention is currently required from: fixeria, laforge, osmith, pespin. jolly has posted comments on this change by pespin. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40445?usp=email
) Change subject: 5gc: Support PDU Session Establishment procedure ...................................................................... Patch Set 7: Code-Review+1 -- To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40445?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: If0769afd07a4bae7778d7a7c347cebaa5909b5f8 Gerrit-Change-Number: 40445 Gerrit-PatchSet: 7 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 24 Jul 2025 11:48:46 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 day, 22 hours
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
115
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Results per page:
10
25
50
100
200