lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • 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
gerrit-log@lists.osmocom.org

August 2022

  • 3 participants
  • 2402 discussions
Change in libosmo-pfcp[master]: gtlv: fix repeated IEIs to several struct members
by neels 16 Aug '22

16 Aug '22
Attention is currently required from: neels. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-pfcp/+/29042 to look at the new patch set (#2). Change subject: gtlv: fix repeated IEIs to several struct members ...................................................................... gtlv: fix repeated IEIs to several struct members Coverity Scan has brought my attention to a problem with decoding repeated IEIs, where there are multiple struct members in the decoded struct that these are decoded to. Before this patch, gtlv aborts with an error as soon as the first struct member for a given tag is full, not parsing following IEIs into subsequent struct members. After this patch, gtlv continues to look whether subsequent entries in the message coding also decode the same tag, but to a different struct member. First commit without changing the gtlv regression test, to show that all current tests still succeed. The test for this particular issue follow in I994d0fb1f1435d2c27a8630a43fe106652ac6e41 Related: CID#275415 Related: SYS#5599 Change-Id: Ie37585178ff27306d425b75d8e407b71f92f1cdc --- M src/libosmo-gtlv/gtlv_dec_enc.c 1 file changed, 70 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-pfcp refs/changes/42/29042/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-pfcp/+/29042 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-pfcp Gerrit-Branch: master Gerrit-Change-Id: Ie37585178ff27306d425b75d8e407b71f92f1cdc Gerrit-Change-Number: 29042 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in libosmo-pfcp[master]: gtlv: check memory bounds 3/3: encoding to str
by neels 16 Aug '22

16 Aug '22
Attention is currently required from: neels. Hello Jenkins Builder, laforge, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-pfcp/+/29041 to look at the new patch set (#2). Change subject: gtlv: check memory bounds 3/3: encoding to str ...................................................................... gtlv: check memory bounds 3/3: encoding to str See Id8d997c9d5e655ff1842ec69eab6c073875c6330 Related: CID#275417 Related: SYS#5599 Change-Id: I63d52a4f5dba32d3a3887dd9c5e42e1695fb2aa3 --- M include/osmocom/gtlv/gtlv_dec_enc.h M src/libosmo-gtlv/gtlv_dec_enc.c M src/libosmo-gtlv/gtlv_gen.c M tests/libosmo-gtlv/gtlv_dec_enc_test.c M tests/libosmo-gtlv/test_gtlv_gen/gtlv_gen_test.c M tests/libosmo-gtlv/test_tliv/tliv_test.c 6 files changed, 30 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-pfcp refs/changes/41/29041/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-pfcp/+/29041 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-pfcp Gerrit-Branch: master Gerrit-Change-Id: I63d52a4f5dba32d3a3887dd9c5e42e1695fb2aa3 Gerrit-Change-Number: 29041 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-ci[master]: jobs/master-builds: archive core, testsuite.log
by osmith 16 Aug '22

16 Aug '22
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29094 ) Change subject: jobs/master-builds: archive core, testsuite.log ...................................................................... jobs/master-builds: archive core, testsuite.log In case one of the master-buils is segfaulting or has an error in the testsuite, collect the relevant files and store them as artifacts. It was asked in the related issue to do this only on error, however while there's an option to archive only artifacts when a build is successful, there is not an option to do it only on failure. So just do it always, the testsuite.log file is typically just a few kb in size. core files should only get generated on error. Closes: OS#5642 Change-Id: I91d4b995b16c8e028a5dff19b0e0f09c01d8c8c6 --- M jobs/master-builds.yml 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/94/29094/1 diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index abeb4d6..eb1bf38 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -478,6 +478,9 @@ - shell: '{obj:cmd}' publishers: + - archive: + allow-empty: true + artifacts: '**/core, **/testsuite.log' - warnings: console-log-parsers: - 'GNU C Compiler 4 (gcc)' -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29094 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I91d4b995b16c8e028a5dff19b0e0f09c01d8c8c6 Gerrit-Change-Number: 29094 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-hnbgw[master]: manual: update overview chart with PFCP
by neels 16 Aug '22

16 Aug '22
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29076 ) Change subject: manual: update overview chart with PFCP ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29076 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ifd8843aeb8ff28fec53323c8fb37b10d4d1f2f9b Gerrit-Change-Number: 29076 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Tue, 16 Aug 2022 13:49:43 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-hnbgw[master]: manual: update overview chart with PFCP
by neels 16 Aug '22

16 Aug '22
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29076 ) Change subject: manual: update overview chart with PFCP ...................................................................... Patch Set 3: (1 comment) Patchset: PS3: re-add previous +1 after splitting patch in two -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29076 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ifd8843aeb8ff28fec53323c8fb37b10d4d1f2f9b Gerrit-Change-Number: 29076 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 16 Aug 2022 13:49:31 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: hnbgw: test PS RAB GTP mapping
by neels 16 Aug '22

16 Aug '22
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28818 ) Change subject: hnbgw: test PS RAB GTP mapping ...................................................................... hnbgw: test PS RAB GTP mapping Related: SYS#5895 Change-Id: I93c4689ddc016eb4eb25f8cbdd0142936c6f972b --- M hnbgw/HNBGW_Tests.ttcn M hnbgw/gen_links.sh M hnbgw/osmo-hnbgw.cfg M hnbgw/regen_makefile.sh M library/ranap/RANAP_Templates.ttcn 5 files changed, 294 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn index 81d9f1a..7429c38 100644 --- a/hnbgw/HNBGW_Tests.ttcn +++ b/hnbgw/HNBGW_Tests.ttcn @@ -57,6 +57,11 @@ import from MGCP_CodecPort all; import from SDP_Types all; +import from PFCP_Types all; +import from PFCP_Emulation all; +import from PFCP_Templates all; +import from PFCP_CodecPort all; + modulepar { /* IP address at which the HNodeB can be reached */ charstring mp_hnodeb_ip := "127.0.0.1"; @@ -91,6 +96,13 @@ sio := '83'O, rctx := 2 }; + + /* IP address at which we listen for PFCP to emulate a UPF in ttcn3 */ + charstring mp_pfcp_ip_local := "127.0.0.1"; + + /* IP address from which the SUT (osmo-hnbgw) sends PFCP requests, and to which the ttcn3 UPF emulation sends + * PFCP responses. */ + charstring mp_pfcp_ip_remote := "127.0.0.2"; } function MSC_UnitdataCallback(RANAP_PDU ranap) runs on RAN_Emulation_CT return template RANAP_PDU { @@ -168,7 +180,8 @@ boolean ps_domain, MgcpParameters mgcp_pars optional, HnbConfig hnb optional, - boolean separate_sccp_cr + boolean separate_sccp_cr, + charstring pfcp_local_addr } /* We extend: @@ -176,7 +189,7 @@ * RAN_ConnHdlr (for the Iu side, emulating the MSC) * MGCP_ConnHdlr (for the MGCP side, emulating the MGW) */ -type component ConnHdlr extends RAN_ConnHdlr, MGCP_ConnHdlr, RUA_ConnHdlr { +type component ConnHdlr extends RAN_ConnHdlr, MGCP_ConnHdlr, RUA_ConnHdlr, PFCP_ConnHdlr { var integer g_sccp_conn_id; var TestHdlrParams g_pars; timer g_Tguard; @@ -267,6 +280,23 @@ vc_MGCP.start(MGCP_Emulation.main(ops, pars, id)); } +function f_init_pfcp(charstring id) runs on ConnHdlr { + id := id & "-PFCP"; + + var PFCP_Emulation_Cfg pfcp_cfg := { + pfcp_bind_ip := mp_pfcp_ip_local, + pfcp_bind_port := PFCP_PORT, + pfcp_remote_ip := mp_pfcp_ip_remote, + pfcp_remote_port := PFCP_PORT, + role := UPF + }; + + vc_PFCP := PFCP_Emulation_CT.create(id) alive; + connect(self:PFCP, vc_PFCP:CLIENT); + connect(self:PFCP_PROC, vc_PFCP:CLIENT_PROC); + vc_PFCP.start(PFCP_Emulation.main(pfcp_cfg)); +} + function f_init_hnodeb(charstring id, integer hnb_idx, RuaOps rua_ops) runs on test_CT { id := id & "-Iuh" & int2str(hnb_idx); @@ -417,6 +447,9 @@ function f_init_handler(TestHdlrParams pars, float t_guard := 20.0) runs on ConnHdlr { /* make parameters available via component variable */ g_pars := pars; + + f_init_pfcp(testcasename()); + /* start guard timer and activate it as default */ g_Tguard.start(t_guard); activate(as_Tguard_ConnHdlr()); @@ -643,7 +676,8 @@ imsi := f_gen_imsi(imsi_suffix), ps_domain := ps_domain, hnb := omit, /* filled in later */ - separate_sccp_cr := separate_sccp_cr + separate_sccp_cr := separate_sccp_cr, + pfcp_local_addr := mp_pfcp_ip_local } /* Create an Iuh connection; send InitialUE; expect it to appear on new SCCP conenction */ @@ -1139,8 +1173,152 @@ vc_conn.done; } +type record FTeid { + HostName addr, + OCT4 teid +} + +type record FTeids { + FTeid local, + FTeid remote +} +/* 'local' and 'remote' refer to the GTP information from the UPF's point of view: + * HNB UPF CN + * access.remote <---> access.local | core.local <---> core.remote + */ +type record GtpParameters { + FTeids core, + FTeids access +} + +/* HNB UPF CN + * access.remote <---> access.local | core.local <---> core.remote + * 127.0.0.4 127.0.0.3 127.0.0.2 127.0.0.1 + * 0x44004400 0x30303030 0x22002200 0x10101010 + */ +template GtpParameters t_GtpParameters := { + core := { + local := { + addr := "127.0.0.2", + teid := '22002200'O + }, + remote := { + addr := "127.0.0.1", + teid := '10101010'O + } + }, + access := { + local := { + addr := "127.0.0.3", + teid := '30303030'O + }, + remote := { + addr := "127.0.0.4", + teid := '44004400'O + } + } +} + +friend function f_tc_ps_rab_assignment(charstring id, TestHdlrParams pars) runs on ConnHdlr { + var RANAP_PDU tx; + var RANAP_PDU rx; + timer T := 5.0; + + f_init_handler(pars); + + f_pfcp_register(); + + var PDU_PFCP m; + var Node_ID upf_node_id := valueof(ts_PFCP_Node_ID_fqdn("\07osmocom\03org")); + + PFCP.receive(tr_PFCP_Assoc_Setup_Req()) -> value m; + PFCP.send(ts_PFCP_Assoc_Setup_Resp(m.sequence_number, upf_node_id, + ts_PFCP_Cause(REQUEST_ACCEPTED), 1234)); + + tx := f_build_initial_ue(g_pars); + f_iuh2iu_connect(tx); + + var GtpParameters gtp_pars := valueof(t_GtpParameters); + var template RAB_SetupOrModifyList rab_sml; + + /* Send RAB Assignment Request */ + rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.core.remote.addr), gtp_pars.core.remote.teid); + tx := valueof(ts_RANAP_RabAssReq(rab_sml)); + BSSAP.send(tx); + + /* Expect PFCP Session Establishment Request. */ + PFCP.receive(tr_PFCP_Session_Est_Req()) -> value m; + var F_SEID hnbgw_f_seid := m.message_body.pfcp_session_establishment_request.CP_F_SEID; + var PFCP_Session_Establishment_Request serq := m.message_body.pfcp_session_establishment_request; + + /* Acting as UPF, invent a new PFCP SEID to send to HNBGW. Respond to the Session Establishment. + * The PFCP response must have the same sequence_number as the request. */ + var F_SEID up_f_seid := valueof(ts_PFCP_F_SEID_ipv4("127.0.0.1", '1111111111111111'O)); + var template PDU_PFCP r := ts_PFCP_Session_Est_Resp(m.sequence_number, upf_node_id, hnbgw_f_seid.seid); + r.message_body.pfcp_session_establishment_response := { + offending_ie := omit, + UP_F_SEID := up_f_seid, + created_PDR_list := { + ts_PFCP_Created_PDR(pdr_id := serq.create_PDR_list[0].grouped_ie.pdr_id, + local_F_TEID := ts_PFCP_F_TEID_ipv4(gtp_pars.core.local.teid, + gtp_pars.core.local.addr)), + ts_PFCP_Created_PDR(pdr_id := serq.create_PDR_list[1].grouped_ie.pdr_id, + local_F_TEID := ts_PFCP_F_TEID_ipv4(gtp_pars.access.local.teid, + gtp_pars.access.local.addr)) + }, + load_control_information := omit, + overload_control_information := omit, + node_list := omit, + failed_rule_id := omit, + created_traffic_endpoint_list := omit + }; + PFCP.send(r); + + /* Expect on Iuh: RAB Assignment Request with IP/port from PFCP Session Est Resp */ + rab_sml := ts_RAB_SML_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.access.local.addr), + gtp_pars.access.local.teid); + rx := valueof(ts_RANAP_RabAssReq(rab_sml)); + RUA.receive(rx); + + /* Send back RAB Assignment Response via Iuh */ + var template RAB_SetupOrModifiedList rab_smdl; + rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.access.remote.addr), + gtp_pars.access.remote.teid); + tx := valueof(ts_RANAP_RabAssResp(rab_smdl)); + RUA.send(tx); + T.start; + + PFCP.receive(tr_PFCP_Session_Mod_Req(up_f_seid.seid)) -> value m; + r := ts_PFCP_Session_Mod_Resp(m.sequence_number, hnbgw_f_seid.seid); + PFCP.send(r); + + rab_smdl := ts_RAB_SMdL_ps(t_RAB_id(23), f_ts_RAB_TLA(gtp_pars.core.local.addr), gtp_pars.core.local.teid); + BSSAP.receive(tr_RANAP_RabAssResp(rab_smdl)); + + f_sleep(2.0); + tx := valueof(ts_RANAP_IuReleaseCommand(ts_RanapCause_om_intervention)); + f_iu2iuh(tx); + + tx := valueof(ts_RANAP_IuReleaseComplete()); + f_iuh2iu(tx); + + PFCP.receive(tr_PFCP_Session_Del_Req(up_f_seid.seid)) -> value m; + PFCP.send(ts_PFCP_Session_Del_Resp(m.sequence_number, hnbgw_f_seid.seid)); + + f_sleep(2.0); +} + +testcase TC_ps_rab_assignment() runs on test_CT { + var ConnHdlr vc_conn; + f_init(); + f_start_hnbs(); + f_sleep(1.0); + + vc_conn := f_start_handler_with_pars(refers(f_tc_ps_rab_assignment), t_pars(7, ps_domain := true)); + vc_conn.done; +} control { execute(TC_hnb_register()); @@ -1156,6 +1334,7 @@ execute(TC_rab_assign_mgcp_to()); execute(TC_ranap_cs_mo_disconnect()); execute(TC_ranap_ps_mo_disconnect()); + execute(TC_ps_rab_assignment()); } } diff --git a/hnbgw/gen_links.sh b/hnbgw/gen_links.sh index aabc8c0..4be3b53 100755 --- a/hnbgw/gen_links.sh +++ b/hnbgw/gen_links.sh @@ -22,6 +22,7 @@ gen_links $DIR $FILES # Required by MGCP and IPA +# Required by PFCP/UDP DIR=$BASEDIR/titan.TestPorts.IPL4asp/src FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES @@ -76,6 +77,10 @@ FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.PFCP_v15.1.0/src +FILES="PFCP_Types.ttcn" +gen_links $DIR $FILES + DIR=../library/hnbap FILES="HNBAP_CommonDataTypes.asn HNBAP_Constants.asn HNBAP_Containers.asn HNBAP_IEs.asn HNBAP_PDU_Contents.asn HNBAP_PDU_Descriptions.asn " FILES+="HNBAP_EncDec.cc HNBAP_Types.ttcn HNBAP_Templates.ttcn " @@ -95,6 +100,7 @@ FILES="Iuh_Types.ttcn Iuh_CodecPort.ttcn Iuh_CodecPort_CtrlFunctDef.cc Iuh_CodecPort_CtrlFunct.ttcn Iuh_Emulation.ttcn DNS_Helpers.ttcn " FILES+="MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc " FILES+="RAN_Adapter.ttcnpp RAN_Emulation.ttcnpp BSSAP_CodecPort.ttcn SCCP_Templates.ttcn " +FILES+="PFCP_CodecPort.ttcn PFCP_CodecPort_CtrlFunct.ttcn PFCP_CodecPort_CtrlFunctDef.cc PFCP_Emulation.ttcn PFCP_Templates.ttcn " FILES+="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn " FILES+="StatsD_Types.ttcn StatsD_CodecPort.ttcn StatsD_CodecPort_CtrlFunct.ttcn StatsD_CodecPort_CtrlFunctdef.cc StatsD_Checker.ttcn " diff --git a/hnbgw/osmo-hnbgw.cfg b/hnbgw/osmo-hnbgw.cfg index f11f613..e4dfed2 100644 --- a/hnbgw/osmo-hnbgw.cfg +++ b/hnbgw/osmo-hnbgw.cfg @@ -33,3 +33,8 @@ remote-addr msc iups remote-addr sgsn + pfcp + remote-addr 127.0.0.1 + local-addr 127.0.0.2 + local-port 8805 + timer pfcp x26 5 diff --git a/hnbgw/regen_makefile.sh b/hnbgw/regen_makefile.sh index 47f7ee8..13db985 100755 --- a/hnbgw/regen_makefile.sh +++ b/hnbgw/regen_makefile.sh @@ -27,6 +27,7 @@ RANAP_EncDec.cc MGCP_CodecPort_CtrlFunctDef.cc UD_PT.cc + PFCP_CodecPort_CtrlFunctDef.cc " export CPPFLAGS_TTCN3=" diff --git a/library/ranap/RANAP_Templates.ttcn b/library/ranap/RANAP_Templates.ttcn index 11947d9..7fac3a4 100644 --- a/library/ranap/RANAP_Templates.ttcn +++ b/library/ranap/RANAP_Templates.ttcn @@ -1291,6 +1291,86 @@ } } } +template (value) TransportLayerInformation ts_TLI_ps(template (value) TransportLayerAddress tla, + template (value) GTP_TEI gtp_tei) := { + transportLayerAddress := tla, + iuTransportAssociation := { + gTP_TEI := gtp_tei + }, + iE_Extensions := omit +} +template TransportLayerInformation tr_TLI_ps(template TransportLayerAddress tla, + template (value) GTP_TEI gtp_tei) := { + transportLayerAddress := tla, + iuTransportAssociation := { + gTP_TEI := gtp_tei + }, + iE_Extensions := * +} + +template (value) RAB_SetupOrModifyList ts_RAB_SML_ps(template (value) RAB_ID rab_id, + template (value) TransportLayerAddress tla, + template (value) GTP_TEI gtp_tei) := { { + { + id := id_RAB_SetupOrModifyItem, + firstCriticality := reject, + firstValue := { + rAB_SetupOrModifyItemFirst := { + rAB_ID := rab_id, + nAS_SynchronisationIndicator := omit, + rAB_Parameters := ts_RabParams, + userPlaneInformation := ts_UserPlaneInfo, + transportLayerInformation := ts_TLI_ps(tla, gtp_tei), + service_Handover := omit, + iE_Extensions := omit + } + }, + secondCriticality := ignore, + secondValue := { + rAB_SetupOrModifyItemSecond := { + pDP_TypeInformation := omit, + dataVolumeReportingIndication := omit, + dl_GTP_PDU_SequenceNumber := omit, + ul_GTP_PDU_SequenceNumber := omit, + dl_N_PDU_SequenceNumber := omit, + ul_N_PDU_SequenceNumber := omit, + iE_Extensions := omit + } + } + } +} } +template RAB_SetupOrModifyList tr_RAB_SML_ps(template (present) RAB_ID rab_id, + template TransportLayerAddress tla, + template (value) GTP_TEI gtp_tei) := { { + { + id := id_RAB_SetupOrModifyItem, + firstCriticality := reject, + firstValue := { + rAB_SetupOrModifyItemFirst := { + rAB_ID := rab_id, + nAS_SynchronisationIndicator := *, + rAB_Parameters := ts_RabParams, + userPlaneInformation := ts_UserPlaneInfo, + transportLayerInformation := tr_TLI_ps(tla, gtp_tei), + service_Handover := *, + iE_Extensions := * + } + }, + secondCriticality := ignore, + secondValue := { + rAB_SetupOrModifyItemSecond := { + pDP_TypeInformation := omit, + dataVolumeReportingIndication := omit, + dl_GTP_PDU_SequenceNumber := omit, + ul_GTP_PDU_SequenceNumber := omit, + dl_N_PDU_SequenceNumber := omit, + ul_N_PDU_SequenceNumber := omit, + iE_Extensions := omit + } + } + } +} } + template (value) RAB_SetupOrModifiedList ts_RAB_SMdL(template (value) RAB_ID rab_id, template (value) TransportLayerAddress tla, template (value) BindingID binding_id) := { { @@ -1311,6 +1391,26 @@ } } } +template (value) RAB_SetupOrModifiedList ts_RAB_SMdL_ps(template (value) RAB_ID rab_id, + template (value) TransportLayerAddress tla, + template (value) GTP_TEI gtp_tei) := { { + { + id := id_RAB_SetupOrModifiedItem, + criticality := ignore, + value_ := { + rAB_SetupOrModifiedItem := { + rAB_ID := rab_id, + transportLayerAddress := tla, + iuTransportAssociation := { + gTP_TEI := gtp_tei + }, + dl_dataVolumes := omit, + iE_Extensions := omit + } + } + } +} } + template RAB_SetupOrModifiedList tr_RAB_SMdL(template (present) RAB_ID rab_id, template TransportLayerAddress tla, template BindingID binding_id) := { { 4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28818 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I93c4689ddc016eb4eb25f8cbdd0142936c6f972b Gerrit-Change-Number: 28818 Gerrit-PatchSet: 6 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-hnbgw[master]: manual: update overview chart with PFCP
by neels 16 Aug '22

16 Aug '22
Attention is currently required from: neels. Hello Jenkins Builder, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29076 to look at the new patch set (#3). Change subject: manual: update overview chart with PFCP ...................................................................... manual: update overview chart with PFCP Change from ascii art to the dotty chart, taken from the osmocom.org wiki. No need to keep a separate representation here. Change-Id: Ifd8843aeb8ff28fec53323c8fb37b10d4d1f2f9b --- M doc/manuals/chapters/overview.adoc 1 file changed, 51 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/76/29076/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29076 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ifd8843aeb8ff28fec53323c8fb37b10d4d1f2f9b Gerrit-Change-Number: 29076 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-hnbgw[master]: manual: update IuCS/IuPS protocol stack chart
by neels 16 Aug '22

16 Aug '22
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29093 ) Change subject: manual: update IuCS/IuPS protocol stack chart ...................................................................... manual: update IuCS/IuPS protocol stack chart We use SCCP/M3UA now, not SUA. Change-Id: I4496a6ffdda511875208bebbe68dbc9e69541fc0 --- M doc/manuals/chapters/overview.adoc 1 file changed, 12 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/93/29093/1 diff --git a/doc/manuals/chapters/overview.adoc b/doc/manuals/chapters/overview.adoc index 47cfc37..278b8ca 100644 --- a/doc/manuals/chapters/overview.adoc +++ b/doc/manuals/chapters/overview.adoc @@ -72,17 +72,18 @@ ---- Iuh IuCS/IuPS - -NAS +----+----+ +----+----+ -Non-Access Stratum | CC | MM | | CC | MM | -- - - - - - - - - - - +----+----+-------+ +----+----+ - | RANAP | | H | RANAP | -Access Stratum +---------+ HNBAP | N +---------+ - - SCCP USER SAP - | RUA | | B | SUA | \ - +---------+-------+ - +---------+ | - | SCTP | G | SCTP | } SIGTRAN - +-----------------+ W +---------+ | - | IP | | IP | / + +----+----+ + | CC | MM | +NAS +----+----+ . . +----+----+ +Non-Access Stratum | CC | MM | . | RANAP | +- - - - - - - - - - - +----+----+-------+ +---------+ + | RANAP | | H | SCCP | +Access Stratum +---------+ HNBAP | N +---------+ + | RUA | | B | M3UA | + +---------+-------+ - +---------+ + | SCTP | G | SCTP | + +-----------------+ W +---------+ + | IP | | IP | +-----------------+ +---------+ ---- -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29093 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I4496a6ffdda511875208bebbe68dbc9e69541fc0 Gerrit-Change-Number: 29093 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: add library/PFCP_*, deps/PFCP
by neels 16 Aug '22

16 Aug '22
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28817 ) Change subject: add library/PFCP_*, deps/PFCP ...................................................................... Patch Set 7: (1 comment) Patchset: PS5: > you appear to have fixed ctags meanwhile. […] https://github.com/universal-ctags/ctags/pull/3456 I wouldn't say "never" and see a tradeoff between effort and benefit. So far i didn't see the benefit of template restrictions, but after you made it clear that the restrictions are important the tradeoff shifted to submitting a PR. It was easier than I thought and I'm very glad that u-ctags now tags all of the restricted templates everywhere, so happy end =) -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28817 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I0723b931b3f755ea291bffa2f27c34ba446c2f2f Gerrit-Change-Number: 28817 Gerrit-PatchSet: 7 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 16 Aug 2022 13:42:34 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: add library/PFCP_*, deps/PFCP
by neels 16 Aug '22

16 Aug '22
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28817 ) Change subject: add library/PFCP_*, deps/PFCP ...................................................................... add library/PFCP_*, deps/PFCP Will soon be used by new subdir 'upf' (test osmo-upf), and by 'hnbgw' (test GTP mapping via UPF). Related: SYS#5599 Change-Id: I0723b931b3f755ea291bffa2f27c34ba446c2f2f --- M deps/Makefile M library/General_Types.ttcn A library/PFCP_CodecPort.ttcn A library/PFCP_CodecPort_CtrlFunct.ttcn A library/PFCP_CodecPort_CtrlFunctDef.cc A library/PFCP_Emulation.ttcn A library/PFCP_Templates.ttcn 7 files changed, 926 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/deps/Makefile b/deps/Makefile index 2a906eb..f284f69 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -47,6 +47,7 @@ titan.ProtocolModules.NS_v7.3.0 \ titan.ProtocolModules.SGsAP_13.2.0 \ titan.ProtocolModules.SNDCP_v7.0.0 \ + titan.ProtocolModules.PFCP_v15.1.0 \ titan.TestPorts.Common_Components.Socket-API \ titan.TestPorts.Common_Components.Abstract_Socket \ titan.TestPorts.HTTPmsg \ @@ -111,6 +112,7 @@ titan.ProtocolModules.SUA_commit= R.5.A-5-gcf1137a titan.ProtocolModules.TCP_commit= R.3.A-5-g39e5f45 titan.ProtocolModules.UDP_commit= R.4.A-5-geea8aa3 +titan.ProtocolModules.PFCP_v15.1.0_commit= d550ad9ddb6f9c823c9a555254cd76cf0e738d18 titan.TestPorts.AF_PACKET_commit= 0.1-5-g89ebea6 titan.TestPorts.Common_Components.Socket-API_commit= R.6.A-6-gf4380d0 titan.TestPorts.Common_Components.Abstract_Socket_commit= R.9.B-4-gbd41994 diff --git a/library/General_Types.ttcn b/library/General_Types.ttcn index 9a8489f..c818313 100644 --- a/library/General_Types.ttcn +++ b/library/General_Types.ttcn @@ -286,6 +286,7 @@ type integer LIN2_BO_LAST (0..65535) with { variant "FIELDLENGTH(16), COMP(nosign), BYTEORDER(last)" }; type integer LIN3_BO_LAST (0..16777215) with { variant "FIELDLENGTH(24), COMP(nosign), BYTEORDER(last)" }; type integer LIN4_BO_LAST (0..4294967295) with { variant "FIELDLENGTH(32), COMP(nosign), BYTEORDER(last)" }; + type integer LIN8_BO_LAST (0..18446744073709551616) with { variant "FIELDLENGTH(64), COMP(nosign), BYTEORDER(last)" }; //integer with fixed bit number type integer INT1b (0..1) with { variant "FIELDLENGTH(1)" }; diff --git a/library/PFCP_CodecPort.ttcn b/library/PFCP_CodecPort.ttcn new file mode 100644 index 0000000..8d4078d --- /dev/null +++ b/library/PFCP_CodecPort.ttcn @@ -0,0 +1,56 @@ +/* dual-faced port sitting on top of IPL4_asp UDP to encode/decode PFCP + * + * (C) 2022 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 PFCP_CodecPort { + +import from IPL4asp_PortType all; +import from IPL4asp_Types all; +import from PFCP_Types all; + +/* identifies a remote peer (sender or receiver) */ +type record PFCP_Peer { + ConnectionId conn_id, + HostName remote_name, + PortNumber remote_port +} + +type record PFCP_Unitdata { + PFCP_Peer peer, + PDU_PFCP pdu +} + +/* Translation port on top of IPL4asp; ASP_Event passed through transparently */ +type port PFCP_PT message { + out PFCP_Unitdata; + in PFCP_Unitdata, + ASP_ConnId_ReadyToRelease, + ASP_Event; +} with { extension "user IPL4asp_PT + out(PFCP_Unitdata -> ASP_SendTo: function(f_enc_pfcp_unitdata)) + in(ASP_RecvFrom -> PFCP_Unitdata: function(f_dec_pfcp_unitdata); + ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple; + ASP_Event -> ASP_Event: simple)" } + +private function f_enc_pfcp_unitdata(in PFCP_Unitdata in_ud, out ASP_SendTo out_ud) { + out_ud.connId := in_ud.peer.conn_id; + out_ud.remName := in_ud.peer.remote_name; + out_ud.remPort := in_ud.peer.remote_port; + out_ud.proto := { udp := {} }; + out_ud.msg := enc_PDU_PFCP(in_ud.pdu); +} with { extension "prototype(fast)" }; + +private function f_dec_pfcp_unitdata(in ASP_RecvFrom in_ud, out PFCP_Unitdata out_ud) { + out_ud.peer.conn_id := in_ud.connId; + out_ud.peer.remote_name := in_ud.remName; + out_ud.peer.remote_port := in_ud.remPort; + out_ud.pdu := dec_PDU_PFCP(in_ud.msg); +} with { extension "prototype(fast)" }; + +} diff --git a/library/PFCP_CodecPort_CtrlFunct.ttcn b/library/PFCP_CodecPort_CtrlFunct.ttcn new file mode 100644 index 0000000..bd6af4b --- /dev/null +++ b/library/PFCP_CodecPort_CtrlFunct.ttcn @@ -0,0 +1,43 @@ +module PFCP_CodecPort_CtrlFunct { + +import from PFCP_CodecPort all; +import from IPL4asp_Types all; + +external function f_IPL4_listen( + inout PFCP_PT portRef, + in HostName locName, + in PortNumber locPort, + in ProtoTuple proto, + in OptionList options := {} + ) return Result; + +external function f_IPL4_connect( + inout PFCP_PT portRef, + in HostName remName, + in PortNumber remPort, + in HostName locName, + in PortNumber locPort, + in ConnectionId connId, + in ProtoTuple proto, + in OptionList options := {} + ) return Result; + +external function f_IPL4_close( + inout PFCP_PT portRef, + in ConnectionId id, + in ProtoTuple proto := { unspecified := {} } + ) return Result; + +external function f_IPL4_setUserData( + inout PFCP_PT portRef, + in ConnectionId id, + in UserData userData + ) return Result; + +external function f_IPL4_getUserData( + inout PFCP_PT portRef, + in ConnectionId id, + out UserData userData + ) return Result; + +} diff --git a/library/PFCP_CodecPort_CtrlFunctDef.cc b/library/PFCP_CodecPort_CtrlFunctDef.cc new file mode 100644 index 0000000..1b51633 --- /dev/null +++ b/library/PFCP_CodecPort_CtrlFunctDef.cc @@ -0,0 +1,55 @@ +#include "IPL4asp_PortType.hh" +#include "IPL4asp_PT.hh" +#include "PFCP_CodecPort.hh" + +namespace PFCP__CodecPort__CtrlFunct { + + IPL4asp__Types::Result f__IPL4__listen( + PFCP__CodecPort::PFCP__PT& portRef, + const IPL4asp__Types::HostName& locName, + const IPL4asp__Types::PortNumber& locPort, + const IPL4asp__Types::ProtoTuple& proto, + const IPL4asp__Types::OptionList& options) + { + return f__IPL4__PROVIDER__listen(portRef, locName, locPort, proto, options); + } + + IPL4asp__Types::Result f__IPL4__connect( + PFCP__CodecPort::PFCP__PT& portRef, + const IPL4asp__Types::HostName& remName, + const IPL4asp__Types::PortNumber& remPort, + const IPL4asp__Types::HostName& locName, + const IPL4asp__Types::PortNumber& locPort, + const IPL4asp__Types::ConnectionId& connId, + const IPL4asp__Types::ProtoTuple& proto, + const IPL4asp__Types::OptionList& options) + { + return f__IPL4__PROVIDER__connect(portRef, remName, remPort, + locName, locPort, connId, proto, options); + } + + IPL4asp__Types::Result f__IPL4__close( + PFCP__CodecPort::PFCP__PT& portRef, + const IPL4asp__Types::ConnectionId& connId, + const IPL4asp__Types::ProtoTuple& proto) + { + return f__IPL4__PROVIDER__close(portRef, connId, proto); + } + + IPL4asp__Types::Result f__IPL4__setUserData( + PFCP__CodecPort::PFCP__PT& portRef, + const IPL4asp__Types::ConnectionId& connId, + const IPL4asp__Types::UserData& userData) + { + return f__IPL4__PROVIDER__setUserData(portRef, connId, userData); + } + + IPL4asp__Types::Result f__IPL4__getUserData( + PFCP__CodecPort::PFCP__PT& portRef, + const IPL4asp__Types::ConnectionId& connId, + IPL4asp__Types::UserData& userData) + { + return f__IPL4__PROVIDER__getUserData(portRef, connId, userData); + } + +} diff --git a/library/PFCP_Emulation.ttcn b/library/PFCP_Emulation.ttcn new file mode 100644 index 0000000..05a07b1 --- /dev/null +++ b/library/PFCP_Emulation.ttcn @@ -0,0 +1,202 @@ +/* PFCP Emulation in TTCN-3 + * + * (C) 2022 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 PFCP_Emulation { + +import from IPL4asp_Types all; +import from General_Types all; +import from Osmocom_Types all; +import from PFCP_Types all; +import from PFCP_CodecPort all; +import from PFCP_CodecPort_CtrlFunct all; + +/*********************************************************************** + * Main Emulation Component + ***********************************************************************/ + +const integer PFCP_PORT := 8805; + +type enumerated PFCP_Role { + CPF, + UPF +}; + +type record PFCP_Emulation_Cfg { + HostName pfcp_bind_ip, + PortNumber pfcp_bind_port, + HostName pfcp_remote_ip, + PortNumber pfcp_remote_port, + PFCP_Role role +}; + +type component PFCP_Emulation_CT { + /* Communication with underlying PFCP CodecPort */ + port PFCP_PT PFCP; + + /* Communication with Clients */ + port PFCPEM_PT CLIENT; + port PFCPEM_PROC_PT CLIENT_PROC; + + /* Configuration by the user */ + var PFCP_Emulation_Cfg g_pfcp_cfg; + + /* State */ + var integer g_pfcp_conn_id; + var integer g_recovery_timestamp; + + var PFCPEM_conns g_conns; + + var integer g_next_sequence_nr_state; +}; + +private function f_PFCPEM_next_sequence_nr() runs on PFCP_Emulation_CT return integer { + g_next_sequence_nr_state := g_next_sequence_nr_state + 1; + if (g_next_sequence_nr_state > 16777215) { + g_next_sequence_nr_state := 1; + } + return g_next_sequence_nr_state; +} + +type record PFCPEM_conn { + PFCP_ConnHdlr vc_conn, + OCT8 seid optional, + LIN3_BO_LAST pfcp_msg_sequence_number optional +}; + +type record of PFCPEM_conn PFCPEM_conns; + +private function f_PFCPEM_conn_by_seid_or_seqnr(OCT8 seid, LIN3_BO_LAST seqnr) runs on PFCP_Emulation_CT return PFCP_ConnHdlr { + log("looking for seid ", seid, " seqnr ", seqnr, " in conns ", g_conns); + for (var integer i := 0; i < lengthof(g_conns); i := i + 1) { + if (isbound(g_conns[i].pfcp_msg_sequence_number) + and seqnr == g_conns[i].pfcp_msg_sequence_number) { + return g_conns[i].vc_conn; + } + if (isbound(g_conns[i].seid) + and seid == g_conns[i].seid) { + return g_conns[i].vc_conn; + } + } + return null; +}; + +private function f_PFCPEM_add_conn(PFCP_ConnHdlr vc_conn) runs on PFCP_Emulation_CT { + for (var integer i := 0; i < lengthof(g_conns); i := i + 1) { + if (g_conns[i].vc_conn == vc_conn) { + return; + } + } + /* Not in the list yet, add. */ + var PFCPEM_conn conn := { vc_conn := vc_conn }; + g_conns := g_conns & { conn }; +} + +private function f_init(PFCP_Emulation_Cfg cfg) runs on PFCP_Emulation_CT { + var Result res; + + map(self:PFCP, system:PFCP); + res := PFCP_CodecPort_CtrlFunct.f_IPL4_listen(PFCP, cfg.pfcp_bind_ip, cfg.pfcp_bind_port, {udp:={}}); + g_pfcp_conn_id := res.connId; + + g_recovery_timestamp := f_rnd_int(4294967296); + g_pfcp_cfg := cfg; + + g_conns := {}; + + g_next_sequence_nr_state := (1 + f_rnd_int(1000)) * 10000; +} + +function main(PFCP_Emulation_Cfg cfg) runs on PFCP_Emulation_CT { + var PFCP_ConnHdlr vc_conn; + var PFCP_Unitdata ud; + var PDU_PFCP pdu; + + f_init(cfg); + + while (true) { + alt { + [] PFCP.receive(PFCP_Unitdata:?) -> value ud { + log("PFCP_Emulation main() PFCP.receive: ", ud); + vc_conn := null; + if (ud.pdu.s_flag == '1'B) { + /* There is a SEID */ + vc_conn := f_PFCPEM_conn_by_seid_or_seqnr(ud.pdu.seid, ud.pdu.sequence_number); + } + if (vc_conn != null) { + log("found destination ", vc_conn); + CLIENT.send(ud.pdu) to vc_conn; + } else { + log("sending to all conns: ", g_conns); + for (var integer i := 0; i < lengthof(g_conns); i := i + 1) { + CLIENT.send(ud.pdu) to g_conns[i].vc_conn; + } + } + } + + [] CLIENT.receive(PDU_PFCP:?) -> value pdu sender vc_conn { + log("PFCP_Emulation main() CLIENT.receive from ", vc_conn, ": ", pdu); + if (pdu.sequence_number == 0) { + pdu.sequence_number := f_PFCPEM_next_sequence_nr(); + } + ud := { + peer := { + conn_id := g_pfcp_conn_id, + remote_name := g_pfcp_cfg.pfcp_remote_ip, + remote_port := g_pfcp_cfg.pfcp_remote_port + }, + pdu := pdu + }; + + f_PFCPEM_add_conn(vc_conn); + + PFCP.send(ud); + } + + [] CLIENT_PROC.getcall(PFCPEM_register:{}) -> sender vc_conn { + log("PFCP_Emulation main() CLIENT_PROC.getcall(PFCPEM_register)"); + f_PFCPEM_add_conn(vc_conn); + CLIENT_PROC.reply(PFCPEM_register:{}) to vc_conn; + } + } + } +} + + +/*********************************************************************** + * Interaction between Main and Client Components + ***********************************************************************/ +type port PFCPEM_PT message { + inout PDU_PFCP; +} with { extension "internal" }; + +signature PFCPEM_register(); + +type port PFCPEM_PROC_PT procedure { + inout PFCPEM_register; +} with { extension "internal" }; + +/*********************************************************************** + * Client Compoennt + ***********************************************************************/ + +type component PFCP_ConnHdlr { + port PFCPEM_PT PFCP; + port PFCPEM_PROC_PT PFCP_PROC; + var PFCP_Emulation_CT vc_PFCP; +}; + +function f_pfcp_register() runs on PFCP_ConnHdlr { + PFCP_PROC.call(PFCPEM_register:{}) { + [] PFCP_PROC.getreply(PFCPEM_register:{}); + } +} + +} diff --git a/library/PFCP_Templates.ttcn b/library/PFCP_Templates.ttcn new file mode 100644 index 0000000..d0e8b67 --- /dev/null +++ b/library/PFCP_Templates.ttcn @@ -0,0 +1,567 @@ +/* PFCP Templates in TTCN-3 + * (C) 2022 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 PFCP_Templates { + +import from General_Types all; +import from Native_Functions all; +import from Osmocom_Types all; +import from PFCP_Types all; + +type enumerated e_PFCP_Cause { + RESERVED (0), + REQUEST_ACCEPTED (1), + MORE_USAGE_REPORT_TO_SEND (2), + REQUEST_REJECTED (64), + SESSION_CTX_NOT_FOUND (65), + MANDATORY_IE_MISSING (66), + CONDITIONAL_IE_MISSING (67), + INVALID_LENGTH (68), + MANDATORY_IE_INCORRECT (69), + INVALID_FORW_POLICY (70), + INVALID_F_TEID_ALLOC_OPTION (71), + NO_ESTABLISHED_PFCP_ASSOC (72), + RULE_CREATION_MOD_FAILURE (73), + PFCP_ENTITY_IN_CONGESTION (74), + NO_RESOURCES_AVAILABLE (75), + SERVICE_NOT_SUPPORTED (76), + SYSTEM_FAILURE (77), + REDIRECTION_REQUESTED (78), + ALL_DYNAMIC_ADDRESSES_ARE_OCCUPIED (79) +}; + +template (value) Cause ts_PFCP_Cause(e_PFCP_Cause cause) := { + elementIdentifier := 19, + lengthIndicator := 0, + causeValue := int2oct(enum2int(cause), 1) +}; + +template (present) Cause tr_PFCP_Cause(e_PFCP_Cause cause) := { + elementIdentifier := 19, + lengthIndicator := ?, + causeValue := int2oct(enum2int(cause), 1) +}; + +const INT4b PFCP_Node_ID_IPv4 := 0; +const INT4b PFCP_Node_ID_IPv6 := 1; +const INT4b PFCP_Node_ID_FQDN := 2; + +template (value) Node_ID ts_PFCP_Node_ID(INT4b id_type, octetstring id_value) := { + elementIdentifier := 60, + lengthIndicator := 0, + node_id_type := id_type, + spare := '0000'B, + node_id_value := id_value +}; + +template (present) Node_ID tr_PFCP_Node_ID(template (present) INT4b id_type := ?, + template (present) octetstring id_value := ?) := { + elementIdentifier := 60, + lengthIndicator := ?, + node_id_type := id_type, + spare := ?, + node_id_value := id_value +}; + +/* t_PFCP_Node_ID_IPv4(f_inet_addr("127.0.0.1")) */ +template (value) Node_ID ts_PFCP_Node_ID_ipv4(OCT4 ip_value) := ts_PFCP_Node_ID(PFCP_Node_ID_IPv4, ip_value); +template (value) Node_ID ts_PFCP_Node_ID_fqdn(charstring fqdn) := ts_PFCP_Node_ID(PFCP_Node_ID_FQDN, char2oct(fqdn)); + +template (value) Recovery_Time_Stamp ts_PFCP_Recovery_Timestamp(LIN4_BO_LAST time_value) := { + elementIdentifier := 96, + lengthIndicator := 0, + time_value := time_value +}; + +template (present) Recovery_Time_Stamp tr_PFCP_Recovery_Timestamp(template (present) LIN4_BO_LAST time_value := ?) := { + elementIdentifier := 96, + lengthIndicator := ?, + time_value := time_value +}; + +template (value) PDU_PFCP ts_PDU_PFCP_ := { + s_flag := '0'B, + mp := '0'B, + spare := '000'B, + version := 1, + message_type := 0, + lengthIndicator := 0, + seid := omit, + sequence_number := 0, + spare2 := '0000'B, + mp_or_spare := '0000'B, + message_body := - +}; + +template (present) PDU_PFCP tr_PDU_PFCP_ := { + s_flag := ?, + mp := ?, + spare := ?, + version := 1, + message_type := ?, + lengthIndicator := ?, + seid := *, + sequence_number := ?, + spare2 := ?, + mp_or_spare := ?, + message_body := ? +}; + +template (value) PDU_PFCP ts_PDU_PFCP(LIN3_BO_LAST sequence_number := 0, template (omit) OCT8 seid := omit) +modifies ts_PDU_PFCP_ := { + seid := seid, + sequence_number := sequence_number +}; + +template (present) PDU_PFCP tr_PDU_PFCP(template OCT8 seid := *) +modifies tr_PDU_PFCP_ := { + seid := seid +}; + +template (value) PDU_PFCP ts_PFCP_Assoc_Setup_Req(template (value) Node_ID node_id, LIN4_BO_LAST recovery_timestamp) +modifies ts_PDU_PFCP_ := { + message_body := { + pfcp_association_setup_request := { + node_id := node_id, + time_stamp := ts_PFCP_Recovery_Timestamp(recovery_timestamp), + up_function_features := omit, + cp_function_features := omit, + UP_IP_resource_list := omit + } + } +}; + +function tr_PFCP_Assoc_Setup_Req(template (present) Node_ID node_id := ?) return template (present) PDU_PFCP { + var template PDU_PFCP t := tr_PDU_PFCP(); + t.message_body := { + pfcp_association_setup_request := { + node_id := node_id, + time_stamp := ?, + up_function_features := *, + cp_function_features := *, + UP_IP_resource_list := * + } + }; + return t; +}; + +template (value) PDU_PFCP ts_PFCP_Assoc_Setup_Resp(LIN3_BO_LAST sequence_number, + template (value) Node_ID node_id, + template (value) Cause cause, + LIN4_BO_LAST recovery_timestamp) +modifies ts_PDU_PFCP_ := { + sequence_number := sequence_number, + message_body := { + pfcp_association_setup_response := { + node_id := node_id, + cause := cause, + time_stamp := ts_PFCP_Recovery_Timestamp(recovery_timestamp), + up_function_features := omit, + cp_function_features := omit, + UP_IP_resource_list := omit + } + } +}; + +function tr_PFCP_Assoc_Setup_Resp(template (present) Node_ID node_id := ?, + template (present) Cause cause := ?) return template (present) PDU_PFCP { + var template PDU_PFCP t := tr_PDU_PFCP(); + t.message_body := { + pfcp_association_setup_response := { + node_id := node_id, + cause := cause, + time_stamp := ?, + up_function_features := *, + cp_function_features := *, + UP_IP_resource_list := * + } + }; + return t; +}; + +function ts_PFCP_Assoc_Release_Req(template (value) Node_ID node_id) return template (value) PDU_PFCP { + var template (value) PDU_PFCP t := ts_PDU_PFCP(); + + t.message_body := { + pfcp_association_release_request := { + node_id := node_id + } + }; + return t; +}; + +function tr_PFCP_Assoc_Release_Resp(template (present) Node_ID node_id := ?, template (present) Cause cause := ?) + return template (present) PDU_PFCP { + var template PDU_PFCP t := tr_PDU_PFCP(); + t.message_body := { + pfcp_association_release_response := { + node_id := node_id, + cause := cause + } + }; + return t; +}; + +template (value) F_SEID ts_PFCP_F_SEID_ipv4(charstring addr_v4, OCT8 seid) := { + elementIdentifier := 57, + lengthIndicator := 0, + v6 := '0'B, + v4 := '1'B, + spare := '000000'B, + seid := seid, + ipv4_address := f_inet_addr(addr_v4), + ipv6_address := omit +} + +type enumerated e_PFCP_Src_Iface { + ACCESS (0), + CORE (1), + SGI_LAN_N6_LAN (2), + CP_FUNCTION (3), + x_5G_VN_INTERNAL (4) +}; + +template (value) Source_Interface ts_PFCP_Src_Iface(e_PFCP_Src_Iface iface) := { + elementIdentifier := 20, + lengthIndicator := 0, + interfacevalue := enum2int(iface), + spare := '0000'B +} + +template (value) UE_IP_Address ts_PFCP_UE_IP_Address_v4(charstring addr_v4, boolean is_destination := true) := { + elementIdentifier := 93, + lengthIndicator := 0, + v6 := '0'B, + v4 := '1'B, + sd := bool2bit(is_destination), + spare := '00000'B, + ipv4_address := f_inet_addr(addr_v4), + ipv6_address := omit +} + +template (value) F_TEID ts_PFCP_F_TEID_ipv4(OCT4 teid, charstring addr_v4) := { + elementIdentifier := 21, + lengthIndicator := 0, + v4 := '1'B, + v6 := '0'B, + ch := '0'B, + chid := '0'B, + spare := '0000'B, + teid := teid, + ipv4_address := f_inet_addr(addr_v4), + ipv6_address := omit, + choose_id := omit +} + +template (value) F_TEID ts_PFCP_F_TEID_choose_v4(template (omit) OCT1 choose_id := omit) := { + elementIdentifier := 21, + lengthIndicator := 0, + v4 := '1'B, + v6 := '0'B, + ch := '1'B, + chid := '0'B, + spare := '0000'B, + teid := omit, + ipv4_address := omit, + ipv6_address := omit, + choose_id := choose_id +} + +template (value) PDI_IE ts_PFCP_PDI(e_PFCP_Src_Iface src_iface, + template (omit) F_TEID local_F_TEID := omit, + template (omit) UE_IP_Address ue_addr_v4 := omit) := { + elementIdentifier := 2, + lengthIndicator := 0, + grouped_ie := { + source_interface := ts_PFCP_Src_Iface(src_iface), + local_F_TEID := local_F_TEID, + pdn_instance := omit, + ue_ip_address := ue_addr_v4, + traffic_endpoint_id := omit, + sdf_filter_list := omit, + application_id := omit, + ethernet_packet_filter_list := omit, + qfi_list := omit + } +} + +template (value) Apply_Action ts_PFCP_Apply_Action(BIT1 forw := '0'B, BIT1 drop := '0'B, BIT1 buff := '0'B) := { + elementIdentifier := 44, + lengthIndicator := 0, + drop := drop, + forw := forw, + buff := buff, + nocp := '0'B, + dupl := '0'B, + spare := '000'B +} + +function ts_PFCP_Apply_Action_FORW() return template (value) Apply_Action { + return ts_PFCP_Apply_Action(forw := '1'B); +} +template (value) Apply_Action ts_PFCP_Apply_Action_DROP := ts_PFCP_Apply_Action(drop := '1'B); +template (value) Apply_Action ts_PFCP_Apply_Action_BUFF := ts_PFCP_Apply_Action(buff := '1'B); + +type enumerated e_PFCP_Dest_Iface { + ACCESS (0), + CORE (1), + SGI_LAN_N6_LAN (2), + CP_FUNCTION (3), + LI_FUNCTION (4), + x_5G_VN_INTERNAL (5) +}; + +template (value) Destination_Interface ts_PFCP_Destination_Interface(e_PFCP_Dest_Iface di) := { + elementIdentifier := 42, + lengthIndicator := 0, + interface_value := enum2int(di), + spare := '0000'B +} + +template (value) Outer_Header_Creation ts_PFCP_Outer_Header_Creation_GTP_ipv4(OCT4 remote_teid, charstring remote_addr_v4) := { + elementIdentifier := 84, + lengthIndicator := 0, + ohc_description_oct5 := '00000001'B, + ohc_description_oct6 := '00000000'B, + teid := remote_teid, + ipv4 := f_inet_addr(remote_addr_v4), + ipv6 := omit, + udp_port := omit +} + +type enumerated e_PFCP_Outer_Header_Removal { + GTP_U_UDP_IPV4 (0), + GTP_U_UDP_IPV6 (1), + UDP_IPV4 (2), + UDP_IPV6 (3), + IPV4 (4), + IPV6 (5), + GTP_U_UDP_IP (6), + VLAN_S_TAG (7), + S_TAG_AND_C_TAG (8) +}; + +template (value) Outer_Header_Removal ts_PFCP_Outer_Header_Removal(e_PFCP_Outer_Header_Removal ohr) := { + elementIdentifier := 95, + lengthIndicator := 0, + ohc_description := enum2int(ohr) +} + +template (value) Forwarding_Parameters ts_PFCP_Forwarding_Parameters( + e_PFCP_Dest_Iface dest_iface, + template (omit) Outer_Header_Creation outer_header_creation := omit + ) := { + elementIdentifier := 4, + lengthIndicator := 0, + grouped_ie := { + destination_interface := ts_PFCP_Destination_Interface(dest_iface), + pdn_Instance := omit, + redirect_information := omit, + outer_header_creation := outer_header_creation, + transport_level_marking := omit, + forwarding_policy := omit, + header_enrichment := omit, + traffic_endpoint_ID := omit + } +} + +template (value) FAR_ID ts_PFCP_FAR_ID(LIN4_BO_LAST far_id) := { + elementIdentifier := 108, + lengthIndicator := 0, + id_value := far_id +} + +template (value) Create_FAR ts_PFCP_Create_FAR(LIN4_BO_LAST far_id, template (value) Apply_Action aa, Forwarding_Parameters fp) := { + elementIdentifier := 3, + lengthIndicator := 0, + grouped_ie := { + far_id := ts_PFCP_FAR_ID(far_id), + apply_action := aa, + forwarding_parameters := fp, + duplicating_parameters := omit, + bar_id := omit + } +} + +template (value) PDR_ID ts_PFCP_PDR_ID(OCT2 pdr_id) := { + elementIdentifier := 56, + lengthIndicator := 0, + rule_id := pdr_id +} + +template (value) Precedence ts_PFCP_Precedence(LIN4_BO_LAST val) := { + elementIdentifier := 29, + lengthIndicator := 0, + precedence_value := val +} + +template (value) Create_PDR ts_PFCP_Create_PDR(integer pdr_id, template (value) PDI_IE pdi, + template (omit) Outer_Header_Removal outer_header_removal := omit, + LIN4_BO_LAST far_id) := { + elementIdentifier := 1, + lengthIndicator := 0, + grouped_ie := { + pdr_id := ts_PFCP_PDR_ID(int2oct(pdr_id, 2)), + precedence := ts_PFCP_Precedence(0), + pdi := pdi, + outer_header_removal := outer_header_removal, + FAR_ID_list := { ts_PFCP_FAR_ID(far_id) }, + uRR_ID_list := omit, + qER_ID_list := omit, + activate_predefined_rules := omit + } +} + +function ts_PFCP_Session_Est_Req(charstring node_id, OCT8 cp_seid, Create_PDR_list create_pdr, Create_FAR_list create_far) + return template (value) PDU_PFCP { + var template (value) PDU_PFCP t := ts_PDU_PFCP(); + t.message_body := { + pfcp_session_establishment_request := { + node_id := ts_PFCP_Node_ID_ipv4(f_inet_addr(node_id)), + CP_F_SEID := ts_PFCP_F_SEID_ipv4(node_id, cp_seid), + create_PDR_list := create_pdr, + create_FAR_list := create_far, + create_URR_list := omit, + create_QER_list := omit, + create_BAR := omit, + create_traffic_endpoint_list := omit, + pdn_type := omit, + node_list := omit, + up_inactivity_timer := omit + } + }; + return t; +} + +function tr_PFCP_Session_Est_Req() return template (present) PDU_PFCP { + var template PDU_PFCP t := tr_PDU_PFCP(?); + t.message_body := { + pfcp_session_establishment_request := { + node_id := ? + } + }; + return t; +} + +template (value) Created_PDR ts_PFCP_Created_PDR(PDR_ID pdr_id, template (value) F_TEID local_F_TEID) := { + elementIdentifier := 8, + lengthIndicator := 0, + grouped_ie := { + pdr_id := pdr_id, + local_F_TEID := local_F_TEID + } +} + +function ts_PFCP_Session_Est_Resp(LIN3_BO_LAST seq_nr, template (value) Node_ID node_id, OCT8 seid) + return template (value) PDU_PFCP { + var template (value) PDU_PFCP t := ts_PDU_PFCP(seq_nr, seid); + t.sequence_number := seq_nr; + t.message_body := { + pfcp_session_establishment_response := { + node_id := node_id, + cause := ts_PFCP_Cause(REQUEST_ACCEPTED) + } + }; + return t; +} + +function tr_PFCP_Session_Est_Resp(template (present) OCT8 hdr_seid := ?) return template (present) PDU_PFCP { + var template PDU_PFCP t := tr_PDU_PFCP(hdr_seid); + t.message_body := { + pfcp_session_establishment_response := { + node_id := ?, + cause := tr_PFCP_Cause(REQUEST_ACCEPTED), + offending_ie := *, + UP_F_SEID := ?, + created_PDR_list := ?, + load_control_information := *, + overload_control_information := *, + node_list := *, + failed_rule_id := *, + created_traffic_endpoint_list := * + } + }; + return t; +} + +function tr_PFCP_Session_Mod_Req(template (present) OCT8 seid := ?) return template (present) PDU_PFCP { + var template PDU_PFCP t := tr_PDU_PFCP(seid); + t.message_body := { + pfcp_session_modification_request := ? + }; + return t; +} + +function ts_PFCP_Session_Mod_Resp(LIN3_BO_LAST seq_nr, OCT8 seid) return template (value) PDU_PFCP { + var template (value) PDU_PFCP t := ts_PDU_PFCP(seq_nr, seid); + t.message_body := { + pfcp_session_modification_response := { + cause := ts_PFCP_Cause(REQUEST_ACCEPTED), + offending_IE := omit, + created_PDR := omit, + load_control_information := omit, + overload_control_information := omit, + usage_report := omit, + failed_rule_id := omit, + additional_usage_reports_information := omit, + created_updated_traffic_endpoint := omit + } + }; + return t; +} + +function ts_PFCP_Session_Del_Req(OCT8 seid) return template (value) PDU_PFCP { + var template (value) PDU_PFCP t := ts_PDU_PFCP(seid := seid); + t.message_body := { + pfcp_session_deletion_request := { } + }; + return t; +} + +function tr_PFCP_Session_Del_Req(template (present) OCT8 seid := ?) return template (present) PDU_PFCP { + var template PDU_PFCP t := tr_PDU_PFCP(seid); + t.message_body := { + pfcp_session_deletion_request := ? + }; + return t; +} + +function ts_PFCP_Session_Del_Resp(LIN3_BO_LAST seq_nr, OCT8 seid, e_PFCP_Cause cause := REQUEST_ACCEPTED) + return template (value) PDU_PFCP { + var template (value) PDU_PFCP t := ts_PDU_PFCP(seq_nr, seid); + t.message_body := { + pfcp_session_deletion_response := { + cause := ts_PFCP_Cause(cause), + offending_IE := omit, + load_control_information := omit, + overload_control_information := omit, + usage_report := omit + } + }; + return t; +} + +function tr_PFCP_Session_Del_Resp(template (present) OCT8 seid := ?, + template (present) Cause cause := tr_PFCP_Cause(REQUEST_ACCEPTED)) + return template (present) PDU_PFCP { + var template PDU_PFCP t := tr_PDU_PFCP(seid); + t.message_body := { + pfcp_session_deletion_response := { + cause := cause, + offending_IE := *, + load_control_information := *, + overload_control_information := *, + usage_report := * + } + }; + return t; +} + +} -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28817 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I0723b931b3f755ea291bffa2f27c34ba446c2f2f Gerrit-Change-Number: 28817 Gerrit-PatchSet: 7 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • ...
  • 241
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.