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

October 2023

  • 1 participants
  • 1843 discussions
[M] Change in osmo-msc[master]: manuals: add section about the SGs interface.
by dexter 23 Oct '23

23 Oct '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/34870?usp=email ) Change subject: manuals: add section about the SGs interface. ...................................................................... manuals: add section about the SGs interface. The SGs interface is currently only casually mentioned in the chapter running, even though the SGs interface is a prominent and often requested feature. Let's give the SGs interface its own section so that users can find the info about it quicker. Related: OS#6008 Change-Id: Ic7c17511ee19cb7f6d5069b27beb661ecb4b0be8 --- M doc/manuals/chapters/running.adoc A doc/manuals/chapters/sgs.adoc M doc/manuals/osmomsc-usermanual.adoc 3 files changed, 70 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/70/34870/1 diff --git a/doc/manuals/chapters/running.adoc b/doc/manuals/chapters/running.adoc index 0db5761..1fa5540 100644 --- a/doc/manuals/chapters/running.adoc +++ b/doc/manuals/chapters/running.adoc @@ -74,15 +74,8 @@ More on MNCC in <<mncc>>. -The SGs interface by default listens on 0.0.0.0:29118. Configure a different IP and/or port for each osmo-msc instance. -You may also want to configure different VLR names: - ----- -sgs - local-ip 127.0.0.1 - local-port 29118 - vlr-name vlr.example.net ----- +The SGs interface by default listens on 0.0.0.0:29118 (SCTP). Each instance of OsmoMSC must use a different IP address +and/or port. For details about the configuration of the SGs interface, see section <<sgs>> For the following links, OsmoMSC acts as a client and does not listen/bind to a specific interface, and will hence not encounter conflicts for multiple instances diff --git a/doc/manuals/chapters/sgs.adoc b/doc/manuals/chapters/sgs.adoc new file mode 100644 index 0000000..4ce4360 --- /dev/null +++ b/doc/manuals/chapters/sgs.adoc @@ -0,0 +1,51 @@ +[[sgs]] +== SGs interface + +OsmoMSC offers an SGs/SGsAP interface. The SGs interface is an optional +interface between a 2G (GERAN) / 3G (UTRAN) MSC and an LTE/EPC MME. It's purpose +is to facilitate both CSFB (Circuit-Switched Fall Back) and SMSoS (SMS over SGs). +It is used for Mobility management (MM) and paging procedures between the EPS +(Evolved Packet Services) and CS (Circuit Switched) domain. + +=== VTY configuration + +The SGs interface implementation in OsmoMSC is automatically active and requires +only minimal configuration. When no specific configuration is provided OsmoMSC +will listen on 0.0.0.0:29118 (SCTP) for incoming connections. + +This is sufficient in the most configurations, but in larger installations, +where services are either tied to specific interfaces and/or more instances of +OsmoMSC run in parallel, a custom configuration is necessary. + +The user has the option to configure the IP address and the SCTP port and also +the vlr-name that OsmoMSC uses to identify itself towards the MME. + +---- +sgs + local-ip 127.0.0.1 + local-port 29118 + vlr-name vlr.example.net +---- + +In order to fine tune the behavior of the SGs interface the user also has +control over the relevant timers (ts5, ts6-2, ts7, ts11, ts14, ts15) and +counters (ns7, ns11). Each timer and counter has to be configured separately. +In the following example we change the value of ts and ns11. + +---- +sgs + timer ts7 23 + counter ns11 100 +---- + + +[NOTE] +==== +In case multiple instances of OsmoMSC run in parallel, it is advised to use a +different vlr-name for each instance. +==== + +=== Connection monitoring + +The user can use the VTY command "show sgs-connections" to list the MMEs that +are currently connected to OsmoMSC diff --git a/doc/manuals/osmomsc-usermanual.adoc b/doc/manuals/osmomsc-usermanual.adoc index ad55e53..45be140 100644 --- a/doc/manuals/osmomsc-usermanual.adoc +++ b/doc/manuals/osmomsc-usermanual.adoc @@ -38,6 +38,8 @@ include::./common/chapters/mgwpool.adoc[] +include::{srcdir}/chapters/sgs.adoc[] + include::./common/chapters/control_if.adoc[] include::./common/chapters/gsup.adoc[] -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/34870?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ic7c17511ee19cb7f6d5069b27beb661ecb4b0be8 Gerrit-Change-Number: 34870 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: neighbor_ident: Use ctrl_interface_setup2() instead of ctrl_interface...
by pespin 23 Oct '23

23 Oct '23
Attention is currently required from: arehbein. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34868?usp=email ) Change subject: neighbor_ident: Use ctrl_interface_setup2() instead of ctrl_interface_setup_dynip2() (deprecated) ...................................................................... Patch Set 1: Code-Review-1 (1 comment) File src/osmo-bsc/neighbor_ident.c: https://gerrit.osmocom.org/c/osmo-bsc/+/34868/comment/0bb11b16_9ff29e0e PS1, Line 492: return ctrl_interface_setup2(net, net->neigh_ctrl.port, NULL, _LAST_CTRL_NODE_NEIGHBOR); I'm not sure this is correct, because this is a separate CTRL interface with specific needs (now deprecated). With this patch you would be applying the same IP address as for the general CTRL interface, which is unexpected here. I don't see net->neigh_ctrl.addr being passed here. -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34868?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I612401b5bac5650e65d3bb4df09fd0310175ffa6 Gerrit-Change-Number: 34868 Gerrit-PatchSet: 1 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Comment-Date: Mon, 23 Oct 2023 14:54:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bsc[master]: neighbor_ident: Use ctrl_interface_setup2() instead of ctrl_interface...
by pespin 23 Oct '23

23 Oct '23
Attention is currently required from: arehbein. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34868?usp=email ) Change subject: neighbor_ident: Use ctrl_interface_setup2() instead of ctrl_interface_setup_dynip2() (deprecated) ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34868?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I612401b5bac5650e65d3bb4df09fd0310175ffa6 Gerrit-Change-Number: 34868 Gerrit-PatchSet: 1 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Comment-Date: Mon, 23 Oct 2023 14:53:07 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bsc[master]: neighbor_ident: Use ctrl_interface_setup2() instead of ctrl_interface...
by arehbein 23 Oct '23

23 Oct '23
Attention is currently required from: pespin. arehbein has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34868?usp=email ) Change subject: neighbor_ident: Use ctrl_interface_setup2() instead of ctrl_interface_setup_dynip2() (deprecated) ...................................................................... Patch Set 1: (1 comment) This change is ready for review. Patchset: PS1: Hi, not sure if this wasn't changed on purpose ( @msuraev@sysmocom.de worked on this this, but it's related to an issue I was assigned due to the similarity). Should I abandon this or activate the patch? -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34868?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I612401b5bac5650e65d3bb4df09fd0310175ffa6 Gerrit-Change-Number: 34868 Gerrit-PatchSet: 1 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-CC: msuraev <msuraev(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 23 Oct 2023 14:52:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in docker-playground[master]: ttcn3-epdg-test: Update config file to set up GTPv2C socket
by pespin 23 Oct '23

23 Oct '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/34834?usp=email ) Change subject: ttcn3-epdg-test: Update config file to set up GTPv2C socket ...................................................................... ttcn3-epdg-test: Update config file to set up GTPv2C socket Depends: osmo-epdg.git I6f00b7fce2d5fcdc484bfd45629b9141f16bc579 Depends: osmo-ttcn3-hacks.git I8f18c927b1897806233cc9d049c25694c1e639d4 Change-Id: I05ae2d87e16cef9772bc5c3690f687e5ecbd5f51 --- M ttcn3-epdg-test/osmo-epdg.config 1 file changed, 19 insertions(+), 1 deletion(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/ttcn3-epdg-test/osmo-epdg.config b/ttcn3-epdg-test/osmo-epdg.config index ac8828a..8036b2c 100644 --- a/ttcn3-epdg-test/osmo-epdg.config +++ b/ttcn3-epdg-test/osmo-epdg.config @@ -14,5 +14,12 @@ {vendor_id, 0}, {origin_host, "epdg.localdomain"}, {origin_realm, "localdomain"}, - {context_id, "epdg@localdomain"}]} + {context_id, "epdg@localdomain"}, + % GTPv2C Connection parameters + {gtpc_local_ip, "172.18.10.20"}, + {gtpc_local_port, 2123}, + {gtpc_remote_ip, "172.18.10.103"}, + {gtpc_remote_port, 2123} + ] + } ]. -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/34834?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: I05ae2d87e16cef9772bc5c3690f687e5ecbd5f51 Gerrit-Change-Number: 34834 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: epdg: Test GTPv2C CreateSession triggerd by EPDG_Tunnel Req
by pespin 23 Oct '23

23 Oct '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34833?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: epdg: Test GTPv2C CreateSession triggerd by EPDG_Tunnel Req ...................................................................... epdg: Test GTPv2C CreateSession triggerd by EPDG_Tunnel Req Change-Id: I8f18c927b1897806233cc9d049c25694c1e639d4 --- M epdg/EPDG_Tests.ttcn 1 file changed, 84 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved osmith: Looks good to me, but someone else must approve diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn index f93b77b..3a0c3a6 100644 --- a/epdg/EPDG_Tests.ttcn +++ b/epdg/EPDG_Tests.ttcn @@ -2,6 +2,7 @@ import from Misc_Helpers all; import from General_Types all; +import from Native_Functions all; import from Osmocom_Types all; import from L3_Common all; @@ -13,6 +14,8 @@ import from DIAMETER_Templates all; import from DIAMETER_Emulation all; +import from GTPv2_Types all; +import from GTPv2_Templates all; import from GTPv2_Emulation all; modulepar { @@ -108,6 +111,17 @@ type record EPDG_ConnHdlrPars { hexstring imsi, + charstring ue_ip, + + /* TEI (Data) local side */ + OCT4 teid, + /* TEI (Control) local side */ + OCT4 teic, + /* TEI (Data) remote side */ + OCT4 teid_remote optional, + /* TEI (Control) remote side */ + OCT4 teic_remote optional, + AuthVector vec optional }; @@ -122,11 +136,15 @@ } } - private function f_init_pars(integer imsi_suffix := 1) runs on MTC_CT return EPDG_ConnHdlrPars { var EPDG_ConnHdlrPars pars := { imsi := f_gen_imsi(imsi_suffix), + ue_ip := "192.168.123.50", + teid := '00000000'O, + teic := '00000000'O, + teid_remote := omit, + teic_remote := omit, vec := f_gen_auth_vec_3g() }; return pars; @@ -231,7 +249,7 @@ use_gtpu_daemon := false /* TODO: maybe use, set to true */ }; - vc_GTP2 := GTPv2_Emulation_CT.create("GTP2_EM"); + 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)); @@ -255,6 +273,9 @@ /* tell GSUP dispatcher to send this IMSI to us */ f_create_gsup_expect(hex2str(g_pars.imsi)); + /* tell GTPv2 dispatcher to send this IMSI to us */ + f_gtp2_register_imsi(g_pars.imsi); + fn.apply(id); } @@ -266,9 +287,14 @@ vc_conn := EPDG_ConnHdlr.create(id); + /* GSUP */ connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + /* GTP2 */ + connect(vc_conn:GTP2, vc_GTP2:CLIENT); + connect(vc_conn:GTP2_PROC, vc_GTP2:CLIENT_PROC); + /* SWx */ vc_conn_swx := DIAMETER_ConnHdlr_CT.create(id); connect(vc_conn_swx:DIAMETER, vc_SWx:DIAMETER_CLIENT); @@ -336,6 +362,36 @@ } } +/* Diameter SWx SAR + SAA. */ +private altstep as_GTP2C_CreateSession_success() runs on EPDG_ConnHdlr { + var PDU_GTPCv2 rx_msg; + var template (value) FullyQualifiedTEID fteid_c_ie, fteid_u_ie; + var template (value) PDN_AddressAllocation paa; + + [] GTP2.receive(tr_GTP2C_CreateSessionReq(g_pars.imsi)) -> value rx_msg { + /* TODO: parse TEIC and TEID and store it in g_pars.remote_tei{c,d} */ + + /* allocate + register TEID-C on local side */ + g_pars.teic := f_gtp2_allocate_teid(); + g_pars.teid := g_pars.teic; + + fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S2b_ePDG_GTPC, g_pars.teic, 0, + f_inet_addr(mp_s2b_local_ip), omit); + fteid_u_ie := ts_GTP2C_FTEID(FTEID_IF_S2bU_ePDG_GTPU, g_pars.teid, 2, + f_inet_addr(mp_s2b_local_ip), omit); + paa := ts_GTP2C_PdnAddrAlloc_v4(f_inet_addr(g_pars.ue_ip)); + GTP2.send(ts_GTP2C_CreateSessionResp({ fteid_c_ie }, paa)); + setverdict(pass); + } + [] GTP2.receive(PDU_GTPCv2:?) -> value rx_msg { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unexpected GTP2C msg rx: ", rx_msg)); + } +} +private function f_GTP2C_CreateSession_success() runs on EPDG_ConnHdlr { + f_gtp2_register_udmsg('20'O); + as_GTP2C_CreateSession_success(); +} + /* GSUP AuthInfo Req + Resp, triggers SWx MAR + MAA. */ private function f_GSUP_AI_success() runs on EPDG_ConnHdlr { var GSUP_PDU rx_gsup; @@ -363,7 +419,7 @@ var template octetstring destination_name := *; GSUP.send(ts_GSUP_UL_REQ(g_pars.imsi)); as_DIA_SWx_SA_success(); - /* Expect a positive response back to the translator; expect AIA */ + /* Expect a positive response back to the translator */ alt { [] GSUP.receive(tr_GSUP_UL_RES(g_pars.imsi, destination_name)); [] GSUP.receive(GSUP_PDU:?) -> value rx_gsup { @@ -373,9 +429,25 @@ setverdict(pass); } +/* GSUP TunnelEPDG Tunnel Req + Resp, triggers S2b CreateSession Req + Response. */ +private function f_GSUP_EPDGTunnel_success() runs on EPDG_ConnHdlr { + var GSUP_PDU rx_gsup; + GSUP.send(ts_GSUP_EPDGTunnel_REQ(g_pars.imsi)); + f_GTP2C_CreateSession_success(); + /* Expect a positive response back to the translator; */ + alt { + [] GSUP.receive(tr_GSUP_EPDGTunnel_RES(g_pars.imsi)); + [] GSUP.receive(GSUP_PDU:?) -> value rx_gsup { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unexpected GSUP msg rx: ", rx_gsup)); + } + } + setverdict(pass); +} + private function f_TC_authinfo_normal(charstring id) runs on EPDG_ConnHdlr { f_GSUP_AI_success(); f_GSUP_LU_success(); + f_GSUP_EPDGTunnel_success(); } testcase TC_authinfo_normal() runs on MTC_CT { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34833?usp=email 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: I8f18c927b1897806233cc9d049c25694c1e639d4 Gerrit-Change-Number: 34833 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GSUP_Types: Add EDPG_Tunnel messages
by pespin 23 Oct '23

23 Oct '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34832?usp=email ) Change subject: GSUP_Types: Add EDPG_Tunnel messages ...................................................................... GSUP_Types: Add EDPG_Tunnel messages Change-Id: Iadba149e6d299e5e666b2debdc23a00d37e78da5 --- M library/GSUP_Types.ttcn 1 file changed, 40 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 739dcbc..c3563bc 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -138,7 +138,11 @@ OSMO_GSUP_MSGT_E_CLOSE ('01000111'B), OSMO_GSUP_MSGT_E_ABORT ('01001011'B), - OSMO_GSUP_MSGT_E_ROUTING_ERROR ('01001110'B) + OSMO_GSUP_MSGT_E_ROUTING_ERROR ('01001110'B), + + OSMO_GSUP_MSGT_EPDG_TUNNEL_REQUEST ('01010000'B), + OSMO_GSUP_MSGT_EPDG_TUNNEL_ERROR ('01010001'B), + OSMO_GSUP_MSGT_EPDG_TUNNEL_RESULT ('01010010'B) } with { variant "FIELDLENGTH(8)" }; type enumerated GSUP_CancelType { @@ -687,6 +691,32 @@ tr_GSUP(OSMO_GSUP_MSGT_CHECK_IMEI_ERROR, f_gen_tr_ies(imsi, cause := cause, destination_name := destination_name)); +/* EPDG Tunnel */ +template (value) GSUP_PDU ts_GSUP_EPDGTunnel_REQ(hexstring imsi, GSUP_CnDomain dom := OSMO_GSUP_CN_DOMAIN_PS, + template (omit) octetstring source_name := omit) := + ts_GSUP(OSMO_GSUP_MSGT_EPDG_TUNNEL_REQUEST, f_gen_ts_ies(imsi, dom := dom, + source_name := source_name)); + +template (present) GSUP_PDU tr_GSUP_EPDGTunnel_REQ(template (present) hexstring imsi := ?) := + tr_GSUP_IMSI(OSMO_GSUP_MSGT_EPDG_TUNNEL_REQUEST, imsi); + +template (value) GSUP_PDU ts_GSUP_EPDGTunnel_RES(hexstring imsi, octetstring destination_name := ''O) := + ts_GSUP(OSMO_GSUP_MSGT_EPDG_TUNNEL_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)), + valueof(ts_GSUP_IE_Destination_Name(destination_name))}); + +template (present) GSUP_PDU tr_GSUP_EPDGTunnel_RES(template (present) hexstring imsi, template octetstring destination_name := omit) := + tr_GSUP(OSMO_GSUP_MSGT_EPDG_TUNNEL_RESULT, f_gen_tr_ies(imsi, destination_name := destination_name)); + +template (value) GSUP_PDU ts_GSUP_EPDGTunnel_ERR(hexstring imsi, integer cause) := + ts_GSUP(OSMO_GSUP_MSGT_EPDG_TUNNEL_ERROR, { + valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); + +template (present) GSUP_PDU tr_GSUP_EPDGTunnel_ERR(template (present) hexstring imsi, template (present) integer cause := ?, + template octetstring destination_name := omit) := + tr_GSUP(OSMO_GSUP_MSGT_EPDG_TUNNEL_ERROR, + f_gen_tr_ies(imsi, cause := cause, destination_name := destination_name)); + + template (value) GSUP_IE ts_GSUP_IE_CancelType(GSUP_CancelType ctype) := { tag := OSMO_GSUP_CANCEL_TYPE_IE, len := 0, /* overwritten */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34832?usp=email 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: Iadba149e6d299e5e666b2debdc23a00d37e78da5 Gerrit-Change-Number: 34832 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GSUP_Types: Add EDPG_Tunnel messages
by pespin 23 Oct '23

23 Oct '23
Attention is currently required from: fixeria, lynxis lazus, osmith. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34832?usp=email ) Change subject: GSUP_Types: Add EDPG_Tunnel messages ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34832?usp=email 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: Iadba149e6d299e5e666b2debdc23a00d37e78da5 Gerrit-Change-Number: 34832 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Mon, 23 Oct 2023 14:46:14 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[L] Change in ...osmo-epdg[master]: diameter: Add spec definitions for S6b (TS 28.273 and dep RFC 5777)
by pespin 23 Oct '23

23 Oct '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34857?usp=email ) Change subject: diameter: Add spec definitions for S6b (TS 28.273 and dep RFC 5777) ...................................................................... diameter: Add spec definitions for S6b (TS 28.273 and dep RFC 5777) S6b interface HSS<->PGW is defined in TS 28.273 section 9. TS 28.273 depends on some types defined in RFC 5777, which was missing so far. Some enumareated types in RFC 5777 whose enums fields are declared in yet other dependent RFCs are left with a dummy value, as TODO for the future if they are ever needed. Related: OS#6229 Change-Id: I8075dd54a5fec386feecdf797d710a2524413acc --- A dia/diameter_3gpp_ts29_273_s6b.dia A dia/diameter_rfc5777.dia 2 files changed, 553 insertions(+), 0 deletions(-) Approvals: lynxis lazus: Looks good to me, approved Jenkins Builder: Verified diff --git a/dia/diameter_3gpp_ts29_273_s6b.dia b/dia/diameter_3gpp_ts29_273_s6b.dia new file mode 100644 index 0000000..b009e20 --- /dev/null +++ b/dia/diameter_3gpp_ts29_273_s6b.dia @@ -0,0 +1,166 @@ +;; +;; %CopyrightBegin% +;; +;; Copyright (C) 2023 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +;; Author: Pau Espin Pedrol <pespin(a)sysmocom.de> +;; +;; This resembles 3GPP TS 29.273 version 17.6.0 Release 17 +;; +;; Licensed under the Apache License, Version 2.0 (the "License"); +;; you may not use this file except in compliance with the License. +;; You may obtain a copy of the License at +;; +;; http://www.apache.org/licenses/LICENSE-2.0 +;; +;; Unless required by applicable law or agreed to in writing, software +;; distributed under the License is distributed on an "AS IS" BASIS, +;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +;; See the License for the specific language governing permissions and +;; limitations under the License. +;; +;; %CopyrightEnd% +;; + +;; +;; Edits: +;; +;; + + +@id 16777272 +@name diameter_3gpp_ts29_273_s6b +;;@prefix diameter_3gpp +@vendor 10415 3GPP + +@inherits diameter_gen_base_rfc6733 +@inherits diameter_3gpp_base +@inherits diameter_3gpp_break_circles +@inherits diameter_3gpp_ts29_212 +@inherits diameter_3gpp_ts29_214 +@inherits diameter_3gpp_ts29_229 +@inherits diameter_3gpp_ts29_272 +@inherits diameter_3gpp_ts29_273 +@inherits diameter_3gpp_ts32_299 +@inherits diameter_etsi_es283_034 +@inherits diameter_rfc4006_cc +@inherits diameter_rfc5447 +@inherits diameter_rfc5580 +@inherits diameter_rfc5777 +@inherits diameter_rfc5778 +@inherits diameter_rfc7683 +@inherits diameter_rfc7944 +@inherits diameter_rfc8583 + +@messages + +;; 9. S6b +;; 9.2.2.2.1 AA-Request (AAR) + + AAR ::= < Diameter Header: 265, REQ, PXY > + < Session-Id > + { Auth-Application-Id } + { Origin-Host } + { Origin-Realm } + { Destination-Realm } + { Auth-Request-Type } + [ User-Name ] + [ MIP6-Agent-Info ] + [ MIP6-Feature-Vector ] + [ Visited-Network-Identifier ] + [ QoS-Capability ] + [ Service-Selection ] + [ OC-Supported-Features ] + [ Origination-Time-Stamp ] + [ Maximum-Wait-Time ] + *[ Supported-Features ] + [ Emergency-Services ] + *[ AVP ] + +;; 9.2.2.2.2 AA-Answer (AAA) + AAA ::= < Diameter Header: 265, PXY > + < Session-Id > + { Auth-Application-Id } + { Auth-Request-Type } + { Result-Code } + { Origin-Host } + { Origin-Realm } + [ MIP6-Feature-Vector ] + [ Session-Timeout ] + [ APN-Configuration ] + [ QoS-Resources ] + [ AN-Trusted ] + *[ Redirect-Host ] + [ Trace-Info ] + [ OC-Supported-Features ] + [ OC-OLR ] + *[ Load ] + +;; 9.2.2.3.1 Session-Termination-Request (STR) +;; 9.2.2.4.3 Session-Termination-Request (STR) + STR ::= < Diameter Header: 275, REQ, PXY > + < Session-Id > + { Auth-Application-Id } + { Origin-Host } + { Origin-Realm } + { Destination-Realm } + { Termination-Cause } + [ User-Name ] + [ OC-Supported-Features ] + *[ AVP ] + +;; 9.2.2.3.2 Session-Termination-Answer (STA) +;; 9.2.2.4.4 Session-Termination-Answer (STA) + STA ::= < Diameter Header: 275, PXY > + < Session-Id > + { Result-Code } + { Origin-Host } + { Origin-Realm } + [ OC-Supported-Features ] + [ OC-OLR ] + *[ Load ] + *[ AVP ] + +;; 9.2.2.4.1 Abort-Session-Request (ASR) + ASR ::= < Diameter Header: 274, REQ, PXY > + < Session-Id > + { Origin-Host } + { Origin-Realm } + { Destination-Realm } + { Destination-Host } + { Auth-Application-Id } + [ User-Name ] + [ Auth-Session-State ] + *[ AVP ] + +;; 9.2.2.4.2 Abort-Session-Answer (ASA) + ASA ::= < Diameter Header: 274, PXY > + < Session-Id > + { Result-Code } + { Origin-Host } + { Origin-Realm } + *[ AVP ] + +;; TODO: 9.2.2.5 Commands for S6b MIPv4 FACoA Authorization Procedures + +;; 9.2.2.6.1 Re-Auth-Request (RAR) + RAR ::= < Diameter Header: 258, REQ, PXY > + < Session-Id > + { Origin-Host } + { Origin-Realm } + { Destination-Realm } + { Destination-Host } + { Auth-Application-Id } + { Re-Auth-Request-Type } + [ User-Name ] + [RAR-Flags ] + *[ AVP ] + +;; 9.2.2.6.2 Re-Auth-Answer (RAA) + + RAA ::= < Diameter Header: 258, PXY > + < Session-Id > + { Result-Code } + { Origin-Host } + { Origin-Realm } + [ User-Name ] + *[ AVP ] diff --git a/dia/diameter_rfc5777.dia b/dia/diameter_rfc5777.dia new file mode 100644 index 0000000..916e08d --- /dev/null +++ b/dia/diameter_rfc5777.dia @@ -0,0 +1,368 @@ +;; +;; %CopyrightBegin% +;; +;; Transcribed from RFC 5777 by Pau Espin Pedrol <pespin(a)sysmocom.de> +;; +;; Licensed under the Apache License, Version 2.0 (the "License"); +;; you may not use this file except in compliance with the License. +;; You may obtain a copy of the License at +;; +;; http://www.apache.org/licenses/LICENSE-2.0 +;; +;; Unless required by applicable law or agreed to in writing, software +;; distributed under the License is distributed on an "AS IS" BASIS, +;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +;; See the License for the specific language governing permissions and +;; limitations under the License. +;; +;; %CopyrightEnd% +;; + +;; +;; RFC 5777, Traffic Classification and Quality of Service (QoS) Attributes for Diameter +;; + +@id 1 + +@inherits diameter_gen_base_rfc6733 +;;@inherits diameter_rfc4004 + +;; =========================================================================== + +@avp_types + +QoS-Resources 508 Grouped - ;; 3.1 +Filter-Rule 509 Grouped - ;; 3.2 +Filter-Rule-Precedence 510 Unsigned32 - ;; 3.3 +Classifier 511 Grouped - ;; 4.1.1 +Classifier-ID 512 OctetString - ;; 4.1.2 +Protocol 513 Enumerated - ;; 4.1.3 +Direction 514 Enumerated - ;; 4.1.4 +From-Spec 515 Grouped - ;; 4.1.5 +To-Spec 516 Grouped - ;; 4.1.6 +Negated 517 Enumerated - ;; 4.1.7.1 +IP-Address 518 Address - ;; 4.1.7.2 +IP-Address-Range 519 Grouped - ;; 4.1.7.3 +IP-Address-Start 520 Address - ;; 4.1.7.4 +IP-Address-End 521 Address - ;; 4.1.7.5 +IP-Address-Mask 522 Grouped - ;; 4.1.7.6 +IP-Mask-Bit-Mask-Width 523 Unsigned32 - ;; 4.1.7.7 +MAC-Address 524 OctetString - ;; 4.1.7.8 +MAC-Address-Mask 525 Grouped - ;; 4.1.7.9 +MAC-Address-Mask-Pattern 526 OctetString - ;; 4.1.7.10 +EUI64-Address 527 OctetString - ;; 4.1.7.11 +EUI64-Address-Mask 528 Grouped - ;; 4.1.7.12 +EUI64-Address-Mask-Pattern 529 OctetString - ;; 4.1.7.13 +Port 530 Integer32 - ;; 4.1.7.14 +Port-Range 531 Grouped - ;; 4.1.7.15 +Port-Start 532 Integer32 - ;; 4.1.7.16 +Port-End 533 Integer32 - ;; 4.1.7.17 +Use-Assigned-Address 534 Enumerated - ;; 4.1.7.18 +Diffserv-Code-Point 535 Enumerated - ;; 4.1.8.1 +Fragmentation-Flag 536 Enumerated - ;; 4.1.8.2 +IP-Option 537 Grouped - ;; 4.1.8.3 +IP-Option-Type 538 Enumerated - ;; 4.1.8.4 +IP-Option-Value 539 OctetString - ;; 4.1.8.5 +TCP-Option 540 Grouped - ;; 4.1.8.6 +TCP-Option-Type 541 Enumerated - ;; 4.1.8.7 +TCP-Option-Value 542 OctetString - ;; 4.1.8.8 +TCP-Flags 543 Grouped - ;; 4.1.8.9 + +TCP-Flag-Type 544 Unsigned32 - ;; 4.1.8.10 +ICMP-Type 545 Grouped - ;; 4.1.8.11 +ICMP-Type-Number 546 Enumerated - ;; 4.1.8.12 +ICMP-Code 547 Enumerated - ;; 4.1.8.13 +ETH-Option 548 Grouped - ;; 4.1.8.14 +ETH-Proto-Type 549 Grouped - ;; 4.1.8.15 +ETH-Ether-Type 550 OctetString - ;; 4.1.8.16 +ETH-SAP 551 OctetString - ;; 4.1.8.17 +VLAN-ID-Range 552 Grouped - ;; 4.1.8.18 +S-VID-Start 553 Unsigned32 - ;; 4.1.8.19 +S-VID-End 554 Unsigned32 - ;; 4.1.8.20 +C-VID-Start 555 Unsigned32 - ;; 4.1.8.21 +C-VID-End 556 Unsigned32 - ;; 4.1.8.22 +User-Priority-Range 557 Grouped - ;; 4.1.8.23 +Low-User-Priority 558 Unsigned32 - ;; 4.1.8.24 +High-User-Priority 559 Unsigned32 - ;; 4.1.8.25 +Time-Of-Day-Condition 560 Grouped - ;; 4.2.1 +Time-Of-Day-Start 561 Unsigned32 - ;; 4.2.2 +Time-Of-Day-End 562 Unsigned32 - ;; 4.2.3 +Day-Of-Week-Mask 563 Unsigned32 - ;; 4.2.4 +Day-Of-Month-Mask 564 Unsigned32 - ;; 4.2.5 +Month-Of-Year-Mask 565 Unsigned32 - ;; 4.2.6 +Absolute-Start-Time 566 Time - ;; 4.2.7 +Absolute-Start-Fractional-Seconds 567 Unsigned32 - ;; 4.2.8 +Absolute-End-Time 568 Time - ;; 4.2.9 +Absolute-End-Fractional-Seconds 569 Unsigned32 - ;; 4.2.10 +Timezone-Flag 570 Enumerated - ;; 4.2.11 +Timezone-Offset 571 Integer32 - ;; 4.2.12 +Treatment-Action 572 Enumerated - ;; 5.1, wrongly defined as Grouped in RFC table +QoS-Profile-Id 573 Unsigned32 - ;; 5.2 +QoS-Profile-Template 574 Grouped - ;; 5.3 +QoS-Semantics 575 Enumerated - ;; 5.4 +QoS-Parameters 576 Grouped - ;; 5.5 +Excess-Treatment 577 Grouped - ;; 5.6 +QoS-Capability 578 Grouped - ;; 6 + +;; =========================================================================== + +@grouped + +;; 3.1 +QoS-Resources ::= < AVP Header: 508 > + 1*{ Filter-Rule } + *[ AVP ] + +;; 3.2 +Filter-Rule ::= < AVP Header: 509 > + [ Filter-Rule-Precedence ] +;; Condition part of a Rule +;; ------------------------ + [ Classifier ] + *[ Time-Of-Day-Condition ] +;; Action and Meta-Data +;; -------------------- + [ Treatment-Action ] + +;; Info about QoS related Actions +;; ------------------------------ + [ QoS-Semantics ] + [ QoS-Profile-Template ] + [ QoS-Parameters ] + [ Excess-Treatment ] +;; Extension Point +;; --------------- + *[ AVP ] + +;; 4.1.1. +Classifier ::= < AVP Header: 511 > + { Classifier-ID } + [ Protocol ] + [ Direction ] + *[ From-Spec ] + *[ To-Spec ] + *[ Diffserv-Code-Point ] + [ Fragmentation-Flag ] + *[ IP-Option ] + *[ TCP-Option ] + [ TCP-Flags ] + *[ ICMP-Type ] + *[ ETH-Option ] + *[ AVP ] + +;; 4.1.5. +From-Spec ::= < AVP Header: 515 > + *[ IP-Address ] + *[ IP-Address-Range ] + *[ IP-Address-Mask ] + *[ MAC-Address ] + *[ MAC-Address-Mask] + *[ EUI64-Address ] + *[ EUI64-Address-Mask] + *[ Port ] + *[ Port-Range ] + [ Negated ] + [ Use-Assigned-Address ] + *[ AVP ] + +;; 4.1.6 +To-Spec ::= < AVP Header: 516 > + *[ IP-Address ] + *[ IP-Address-Range ] + *[ IP-Address-Mask ] + *[ MAC-Address ] + *[ MAC-Address-Mask] + *[ EUI64-Address ] + *[ EUI64-Address-Mask] + *[ Port ] + *[ Port-Range ] + [ Negated ] + [ Use-Assigned-Address ] + *[ AVP ] + +;; 4.1.7.3. +IP-Address-Range ::= < AVP Header: 519 > + [ IP-Address-Start ] + [ IP-Address-End ] + *[ AVP ] + +;; 4.1.7.6 +IP-Address-Mask ::= < AVP Header: 522 > + { IP-Address } + { IP-Mask-Bit-Mask-Width } + *[ AVP ] + +;; 4.1.7.9. +MAC-Address-Mask ::= < AVP Header: 525 > + { MAC-Address } + { MAC-Address-Mask-Pattern } + *[ AVP ] + +;; 4.1.7.12. +EUI64-Address-Mask ::= < AVP Header: 528 > + { EUI64-Address } + { EUI64-Address-Mask-Pattern } + *[ AVP ] + +;; 4.1.7.15. +Port-Range ::= < AVP Header: 531 > + [ Port-Start ] + [ Port-End ] + *[ AVP ] + +;; 4.1.8.3. +IP-Option ::= < AVP Header: 537 > + { IP-Option-Type } + *[ IP-Option-Value ] + [ Negated ] + *[ AVP ] + +;; 4.1.8.6. +TCP-Option ::= < AVP Header: 540 > + { TCP-Option-Type } + *[ TCP-Option-Value ] + [ Negated ] + *[ AVP ] + +;; 4.1.8.9. +TCP-Flags ::= < AVP Header: 543 > + { TCP-Flag-Type } + [ Negated ] + *[ AVP ] + +;; 4.1.8.11 +ICMP-Type ::= < AVP Header: 545 > + { ICMP-Type-Number } + *[ ICMP-Code ] + [ Negated ] + *[ AVP ] + +;; 4.1.8.14 +ETH-Option ::= < AVP Header: 548 > + { ETH-Proto-Type } + *[ VLAN-ID-Range ] + *[ User-Priority-Range ] + *[ AVP ] + +;; 4.1.8.15 +ETH-Proto-Type ::= < AVP Header: 549 > + *[ ETH-Ether-Type ] + *[ ETH-SAP ] + *[ AVP ] + +;; 4.1.8.18 +VLAN-ID-Range ::= < AVP Header: 552 > + [ S-VID-Start ] + [ S-VID-End ] + [ C-VID-Start ] + [ C-VID-End ] + *[ AVP ] + +;; 4.1.8.23 +User-Priority-Range ::= < AVP Header: 557 > + *[ Low-User-Priority ] + *[ High-User-Priority ] + *[ AVP ] + +;; 4.2.1 +Time-Of-Day-Condition ::= < AVP Header: 560 > + [ Time-Of-Day-Start ] + [ Time-Of-Day-End ] + [ Day-Of-Week-Mask ] + [ Day-Of-Month-Mask ] + [ Month-Of-Year-Mask ] + [ Absolute-Start-Time ] + [ Absolute-End-Time ] + [ Timezone-Flag ] + *[ AVP ] + +;; 5.3 +QoS-Profile-Template ::= < AVP Header: 574 > + { Vendor-Id } + { QoS-Profile-Id } + *[ AVP ] + +;; 5.5 +QoS-Parameters ::= < AVP Header: 576 > + *[ AVP ] + +;; 5.6 +Excess-Treatment ::= < AVP Header: 577 > + { Treatment-Action } + [ QoS-Profile-Template ] + [ QoS-Parameters ] + *[ AVP ] + +;; 6. +QoS-Capability ::= < AVP Header: 578 > + 1*{ QoS-Profile-Template } + *[ AVP ] + +;; =========================================================================== + +;; 4.1.3. +@enum Protocol + PROTOCOL_TODO_CHECK_RFC2780 0 + +;; 4.1.4. +@enum Direction + DIRECTION_IN 0 + DIRECTION_OUT 1 + DIRECTION_BOTH 2 + +;; 4.1.7.1. +@enum Negated + NEGATED_FALSE 0 + NEGATED_TRUE 1 + +;; 4.1.7.18 +@enum Use-Assigned-Address + USE_ASSIGNED_ADDRESS_FALSE 0 + USE_ASSIGNED_ADDRESS_TRUE 1 + +;; 4.1.8.1. +@enum Diffserv-Code-Point + DIFFSERV_CODE_POINT_TODO_CHECK_RFC2474 0 + +;; 4.1.8.2. +@enum Fragmentation-Flag + FRAGMENTATION_FLAG_DF 0 + FRAGMENTATION_FLAG_MF 1 + +;; 4.1.8.4 +@enum IP-Option-Type + IP_OPTION_TYPE_TODO_CHECK_RFC2780 0 + +;; 4.1.8.7. +@enum TCP-Option-Type + TCP_OPTION_TYPE_TODO_CHECK_RFC2780 0 + +;; 4.1.8.12. +@enum ICMP-Type-Number + ICMP_TYPE_NUMBER_TODO_CHECK_RFC2780 0 + +;; 4.1.8.13. +@enum ICMP-Code + ICMP_CODE_TODO_CHECK_RFC2780 0 + + +;; 4.2.11. +@enum Timezone-Flag + TIMEZOME_FLAG_UTC 0 + TIMEZOME_FLAG_LOCAL 1 + TIMEZOME_FLAG_OFFSET 2 + +;; 5.1. +@enum Treatment-Action + TREATMENT_ACTION_DROP 0 + TREATMENT_ACTION_SHAPE 1 + TREATMENT_ACTION_MARK 2 + TREATMENT_ACTION_PERMIT 3 + +;; 5.4. +@enum QoS-Semantics + QOS_SEMANTICS_DESIRED 0 + QOS_SEMANTICS_AVAILABLE 1 + QOS_SEMANTICS_DELIVERED 2 + QOS_SEMANTICS_MINIMUM 3 + QOS_SEMANTICS_AUTHORIZE 4 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34857?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I8075dd54a5fec386feecdf797d710a2524413acc Gerrit-Change-Number: 34857 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[L] Change in ...osmo-epdg[master]: Handle GSUP EPDG_Tunnel through GTPv2C CreateSession Req+Resp
by pespin 23 Oct '23

23 Oct '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34804?usp=email ) Change subject: Handle GSUP EPDG_Tunnel through GTPv2C CreateSession Req+Resp ...................................................................... Handle GSUP EPDG_Tunnel through GTPv2C CreateSession Req+Resp Initial GTPv2C infrastructure to send GTPv2C CreateSession Request upon receival of GSUP EPDG_Tunnel Request, and answer with EPDG_Tunnel Resp/err when creating the session fails. Related: OS#6046 Change-Id: I6f00b7fce2d5fcdc484bfd45629b9141f16bc579 --- M config/sys.config M rebar.config M rebar.lock A src/epdg_gtpc_s2b.erl M src/gsup_server.erl M src/osmo_epdg.app.src M src/osmo_epdg_sup.erl 7 files changed, 320 insertions(+), 7 deletions(-) Approvals: lynxis lazus: Looks good to me, approved Jenkins Builder: Verified diff --git a/config/sys.config b/config/sys.config index 8d751b9..1b89e86 100755 --- a/config/sys.config +++ b/config/sys.config @@ -13,7 +13,13 @@ {vendor_id, 0}, {origin_host, "epdg.localdomain"}, {origin_realm, "localdomain"}, - {context_id, "epdg@localdomain"}]}, + {context_id, "epdg@localdomain"}, + % GTPv2C Connection parameters + {gtpc_local_ip, "127.0.0.2"}, + {gtpc_local_port, 2123}, + {gtpc_remote_ip, "127.0.0.1"}, + {gtpc_remote_port, 2123} + ]}, %% =========================================== %% SASL config %% =========================================== diff --git a/rebar.config b/rebar.config index 03e0e7c..d834c32 100644 --- a/rebar.config +++ b/rebar.config @@ -4,6 +4,7 @@ {deps, [ {lager, {git, "https://github.com/erlang-lager/lager", {tag, "3.9.2"}}}, + {gtplib, "3.2.0"}, {osmo_ss7, {git, "https://gitea.osmocom.org/erlang/osmo_ss7", {ref, "9f294d3612f998860004820d1d85b4264721577b"}}}, {osmo_gsup, {git, "https://gitea.osmocom.org/erlang/osmo_gsup", {ref, "07672d8ab1608aa9c9e50ca035521876558fcd42"}}} ]}. diff --git a/rebar.lock b/rebar.lock index 4aeafea..8f00ea6 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,16 +1,18 @@ {"1.2.0", -[{<<"epcap">>, +[{<<"cut">>,{pkg,<<"cut">>,<<"1.0.3">>},1}, + {<<"epcap">>, {git,"https://github.com/msantos/epcap", {ref,"d5c03caf608c1369e68cfed0a606d3eb82ddfd21"}}, 1}, {<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1}, + {<<"gtplib">>,{pkg,<<"gtplib">>,<<"3.2.0">>},0}, {<<"lager">>, {git,"https://github.com/erlang-lager/lager", {ref,"459a3b2cdd9eadd29e5a7ce5c43932f5ccd6eb88"}}, 0}, {<<"osmo_gsup">>, {git,"https://gitea.osmocom.org/erlang/osmo_gsup", - {ref,"07672d8ab1608aa9c9e50ca035521876558fcd42"}}, + {ref,"e23f118e6e8f7ee1247db34e4cb79e4cecdb0947"}}, 0}, {<<"osmo_ss7">>, {git,"https://gitea.osmocom.org/erlang/osmo_ss7", @@ -23,10 +25,17 @@ {<<"pkt">>, {git,"https://github.com/msantos/pkt", {ref,"67a4a14f596fded5ad5f2d8f94318faa8ad2c288"}}, - 1}]}. + 1}, + {<<"ppplib">>,{pkg,<<"ppplib">>,<<"1.0.0">>},1}]}. [ {pkg_hash,[ - {<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>}]}, + {<<"cut">>, <<"1577F2F3BC0F2BF3B97903B7426F8A3D79523687B6A444D0F59A095EF69A0E81">>}, + {<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>}, + {<<"gtplib">>, <<"41E8E14BE21DD6E08B2CBB9D708BCF8FDD47CA49D7FFA480219CAB29F5AE2760">>}, + {<<"ppplib">>, <<"F9EC2690532BAF590277A305A2276FCFAD0285557E1055552F8A2FCAF1BF081A">>}]}, {pkg_hash_ext,[ - {<<"goldrush">>, <<"99CB4128CFFCB3227581E5D4D803D5413FA643F4EB96523F77D9E6937D994CEB">>}]} + {<<"cut">>, <<"1A4A25DB2B7C5565FD28B314A4EEB898B1ED3CAFFA1AB09149345FB5731ED04B">>}, + {<<"goldrush">>, <<"99CB4128CFFCB3227581E5D4D803D5413FA643F4EB96523F77D9E6937D994CEB">>}, + {<<"gtplib">>, <<"264626E6993C17B00CA3C083B9BF23D16B88BEEDDDE35F62C954832C21B57AEF">>}, + {<<"ppplib">>, <<"32440D630F55DD29F849847DD8F15F69175FDDC210AA88517AC8AD2854CD6FA1">>}]} ]. diff --git a/src/epdg_gtpc_s2b.erl b/src/epdg_gtpc_s2b.erl new file mode 100644 index 0000000..82985a5 --- /dev/null +++ b/src/epdg_gtpc_s2b.erl @@ -0,0 +1,252 @@ +% S2b: GTPv2C towards PGW +% +% 3GPP TS 29.274 +% +% (C) 2023 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +% Author: Pau Espin Pedrol <pespin(a)sysmocom.de> +% +% All Rights Reserved +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU Affero General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU Affero General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% Additional Permission under GNU AGPL version 3 section 7: +% +% If you modify this Program, or any covered work, by linking or +% combining it with runtime libraries of Erlang/OTP as released by +% Ericsson on http://www.erlang.org (or a modified version of these +% libraries), containing parts covered by the terms of the Erlang Public +% License (http://www.erlang.org/EPLICENSE) the licensors of this +% Program grant you additional permission to convey the resulting work +% without the need to license the runtime libraries of Erlang/OTP under +% the GNU Affero General Public License. Corresponding Source for a +% non-source form of such a combination shall include the source code +% for the parts of the runtime libraries of Erlang/OTP used as well as +% that of the covered work. + + +-module(epdg_gtpc_s2b). +-author('Pau Espin Pedrol <pespin(a)sysmocom.de>'). + +-behaviour(gen_server). + +-include_lib("gtplib/include/gtp_packet.hrl"). + +%% API Function Exports +-export([start_link/5]). +-export([terminate/2]). +%% gen_server Function Exports +-export([init/1, handle_call/3, handle_cast/2, handle_info/2]). +-export([code_change/3]). +-export([create_session_req/1]). + +%% Application Definitions +-define(SERVER, ?MODULE). +-define(SVC_NAME, ?MODULE). +-define(APP_ALIAS, ?MODULE). +-define(CALLBACK_MOD, epdg_gtpc_s2b_cb). +-define(ENV_APP_NAME, osmo_epdg). + +%% TODO: make APN configurable? get it from HSS? +-define(APN, <<"internet">>). + +-record(gtp_state, { + socket, + laddr_str, + laddr :: inet:ip_address(), + lport :: non_neg_integer(), + raddr_str, + raddr :: inet:ip_address(), + rport :: non_neg_integer(), + restart_counter :: 0..255, + seq_no :: 0..16#ffffffff, + sess_list %% TODO: fill it, list of gtp_session +}). + +-record(gtp_bearer, { + ebi :: non_neg_integer(), + local_data_tei = 0 :: non_neg_integer(), + remote_data_tei = 0 :: non_neg_integer() +}). + +-record(gtp_session, { + imsi :: binary(), + apn :: binary(), + ue_ip :: inet:ip_address(), + local_control_tei = 0 :: non_neg_integer(), + remote_control_tei = 0 :: non_neg_integer(), + bearer :: gtp_bearer %% FIXME: only one bearer for now +}). + +start_link(LocalAddr, LocalPort, RemoteAddr, RemotePort, Options) -> + gen_server:start_link({local, ?SERVER}, ?MODULE, [LocalAddr, LocalPort, RemoteAddr, RemotePort, Options], []). + +peer_down(API, SvcName, {PeerRef, _} = Peer) -> + % fixme: why do we still have ets here? + (catch ets:delete(?MODULE, {API, PeerRef})), + gen_server:cast(?SERVER, {peer_down, SvcName, Peer}), + ok. + +init(State) -> + lager:info("epdg_gtpc_s2b: init(): ~p", [State]), + [LocalAddr | [LocalPort | [RemoteAddr | [RemotePort | _]]]] = State, + lager:info("epdg_gtpc_s2b: Binding to IP ~s port ~p~n", [LocalAddr, LocalPort]), + {ok, LocalAddrInet} = inet_parse:address(LocalAddr), + {ok, RemoteAddrInet} = inet_parse:address(RemoteAddr), + Opts = [ + binary, + {ip, LocalAddrInet}, + {active, true}, + {reuseaddr, true} + ], + Ret = gen_udp:open(LocalPort, Opts), + case Ret of + {ok, Socket} -> + lager:info("epdg_gtpc_s2b: Socket is ~p~n", [Socket]), + ok = connect({Socket, RemoteAddr, RemotePort}), + St = #gtp_state{ + socket = Socket, + laddr_str = LocalAddr, + laddr = LocalAddrInet, + lport = LocalPort, + raddr_str = RemoteAddr, + raddr = RemoteAddrInet, + rport = RemotePort, + restart_counter = 0, + seq_no = 0 + }, + {ok, St}; + {error, Reason} -> + lager:error("GTPv2C UDP socket open error: ~w~n", [Reason]) + end. + +create_session_req(Imsi) -> + gen_server:call(?SERVER, + {gtpc_create_session_req, {Imsi}}). + +handle_call({gtpc_create_session_req, {Imsi}}, _From, State) -> + Sess = new_gtp_session(Imsi, State), + Req = gen_create_session_request(Sess, State), + %TODO: increment State.seq_no. + tx_gtp(Req, State), + lager:debug("Waiting for CreateSessionResponse~n", []), + receive + {udp, _Socket, IP, InPortNo, RxMsg} -> + try + Resp = gtp_packet:decode(RxMsg), + logger:info("s2b: Rx from IP ~p port ~n ~p~n", [IP, InPortNo, Resp]), + %% TODO: store Sess in State. + {reply, {ok, Resp}, State} + catch Any -> + logger:error("Error sending message to receiver, ERROR: ~p~n", [Any]), + {reply, {error, decode_failure}, State} + end + after 5000 -> + logger:error("Timeout waiting for CreateSessionResponse for ~p~n", [Req]), + {reply, timeout, State} + end. + +%% @callback gen_server +handle_cast(stop, State) -> + {stop, normal, State}; +handle_cast(_Req, State) -> + {noreply, State}. + +%% @callback gen_server +handle_info(_Info, State) -> + {noreply, State}. + +%% @callback gen_server +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + +%% @callback gen_server +terminate(normal, State) -> + udp_gen:close(State#gtp_state.socket), + ok; +terminate(shutdown, _State) -> + ok; +terminate({shutdown, _Reason}, _State) -> + ok; +terminate(_Reason, _State) -> + ok. + +%% ------------------------------------------------------------------ +%% Internal Function Definitions +%% ------------------------------------------------------------------ + +%% connect/2 +connect(Name, {Socket, RemoteAddr, RemotePort}) -> + lager:info("~s connecting to IP ~s port ~p~n", [Name, RemoteAddr, RemotePort]), + gen_udp:connect(Socket, RemoteAddr, RemotePort). + +connect(Address) -> + connect(?SVC_NAME, Address). + +tx_gtp(Req, State) -> + lager:info("s2b: Tx ~p~n", [Req]), + Msg = gtp_packet:encode(Req), + gen_udp:send(State#gtp_state.socket, State#gtp_state.raddr, State#gtp_state.rport, Msg). + +new_gtp_session(Imsi, _State) -> + % TODO: find non-used local TEI inside State + Bearer = #gtp_bearer{ + ebi = 5, + local_data_tei = 1 + }, + #gtp_session{imsi = Imsi, + apn = ?APN, + local_control_tei = 0, + bearer = Bearer + }. + +%% 7.2.1 Create Session Request +gen_create_session_request(#gtp_session{imsi = Imsi, + apn = Apn, + local_control_tei = LocalCtlTEI, + bearer = Bearer}, + #gtp_state{laddr = LocalAddr, + restart_counter = RCnt, + seq_no = SeqNo}) -> + BearersIE = [#v2_bearer_level_quality_of_service{ + pci = 1, pl = 10, pvi = 0, label = 8, + maximum_bit_rate_for_uplink = 0, + maximum_bit_rate_for_downlink = 0, + guaranteed_bit_rate_for_uplink = 0, + guaranteed_bit_rate_for_downlink = 0 + }, + #v2_eps_bearer_id{eps_bearer_id = Bearer#gtp_bearer.ebi}, + #v2_fully_qualified_tunnel_endpoint_identifier{ + instance = 0, + interface_type = 31, %% "S2b-U ePDG GTP-U" + key = Bearer#gtp_bearer.local_data_tei, + ipv4 = LocalAddr + } + ], + IEs = [#v2_recovery{restart_counter = RCnt}, + #v2_international_mobile_subscriber_identity{imsi = Imsi}, + #v2_rat_type{rat_type = 3}, %% 3 = WLAN + #v2_fully_qualified_tunnel_endpoint_identifier{ + instance = Bearer#gtp_bearer.ebi, + interface_type = 30, %% "S2b ePDG GTP-C" + key = LocalCtlTEI, + ipv4 = LocalAddr + }, + #v2_access_point_name{instance = 0, apn = [Apn]}, + #v2_selection_mode{mode = 0}, + #v2_pdn_address_allocation{type = ipv4, address = <<0,0,0,0>>}, + #v2_bearer_context{group = BearersIE} + ], + #gtp{version = v2, type = create_session_request, tei = 0, seq_no = SeqNo, ie = IEs}. + + diff --git a/src/gsup_server.erl b/src/gsup_server.erl index 923d020..14d2364 100644 --- a/src/gsup_server.erl +++ b/src/gsup_server.erl @@ -177,6 +177,23 @@ % epdg tunnel request / trigger the establishment to the PGW and prepares everything for the user traffic to flow % When sending a epdg_tunnel_response everything must be ready for the UE traffic handle_info({ipa, Socket, ?IPAC_PROTO_EXT_GSUP, GsupMsgRx = #{message_type := epdg_tunnel_request, imsi := Imsi}}, S) -> + lager:info("GSUP: Rx ~p~n", [GsupMsgRx]), + Result = epdg_gtpc_s2b:create_session_req(Imsi), + case Result of + {ok, _} -> + Resp = #{message_type => epdg_tunnel_result, + imsi => Imsi, + message_class => 5 + }; + {error, _} -> + Resp = #{message_type => epdg_tunnel_error, + imsi => Imsi, + message_class => 5, + cause => 16#11 % FIXME: Use proper defines as cause code and use Network failure + } + end, + lager:info("GSUP: Tx ~p~n", [Resp]), + ipa_proto:send(Socket, ?IPAC_PROTO_EXT_GSUP, Resp), {noreply, S}; handle_info(Info, S) -> diff --git a/src/osmo_epdg.app.src b/src/osmo_epdg.app.src index 483d339..ec60bd2 100644 --- a/src/osmo_epdg.app.src +++ b/src/osmo_epdg.app.src @@ -8,6 +8,7 @@ kernel, stdlib, lager, + gtplib, diameter, osmo_gsup, osmo_ss7 diff --git a/src/osmo_epdg_sup.erl b/src/osmo_epdg_sup.erl index 457d993..c679b39 100644 --- a/src/osmo_epdg_sup.erl +++ b/src/osmo_epdg_sup.erl @@ -8,6 +8,10 @@ -define(ENV_APP_NAME, osmo_epdg). -define(ENV_DEFAULT_GSUP_LOCAL_IP, "0.0.0.0"). -define(ENV_DEFAULT_GSUP_LOCAL_PORT, 4222). +-define(ENV_DEFAULT_GTPC_LOCAL_IP, "127.0.0.2"). +-define(ENV_DEFAULT_GTPC_LOCAL_PORT, 2123). +-define(ENV_DEFAULT_GTPC_REMOTE_IP, "127.0.0.1"). +-define(ENV_DEFAULT_GTPC_REMOTE_PORT, 2123). start_link() -> supervisor:start_link({local, ?SERVER}, ?MODULE, []). @@ -15,11 +19,20 @@ init([]) -> GsupLocalIp = application:get_env(?ENV_APP_NAME, gsup_local_ip, ?ENV_DEFAULT_GSUP_LOCAL_IP), GsupLocalPort = application:get_env(?ENV_APP_NAME, gsup_local_port, ?ENV_DEFAULT_GSUP_LOCAL_PORT), + GtpcLocalIp = application:get_env(?ENV_APP_NAME, gtpc_local_ip, ?ENV_DEFAULT_GTPC_LOCAL_IP), + GtpcLocalPort = application:get_env(?ENV_APP_NAME, gtpc_local_port, ?ENV_DEFAULT_GTPC_LOCAL_PORT), + GtpcRemoteIp = application:get_env(?ENV_APP_NAME, gtpc_remote_ip, ?ENV_DEFAULT_GTPC_REMOTE_IP), + GtpcRemotePort = application:get_env(?ENV_APP_NAME, gtpc_remote_port, ?ENV_DEFAULT_GTPC_REMOTE_PORT), DiaServer = {epdg_diameter_swx, {epdg_diameter_swx,start_link,[]}, permanent, 5000, worker, [epdg_diameter_swx_cb]}, + GtpcServer = {epdg_gtpc_s2b, {epdg_gtpc_s2b,start_link, [GtpcLocalIp, GtpcLocalPort, GtpcRemoteIp, GtpcRemotePort, []]}, + permanent, + 5000, + worker, + [epdg_gtpc_s2b]}, GsupServer = {gsup_server, {gsup_server, start_link, [GsupLocalIp, GsupLocalPort, []]}, permanent, 5000, @@ -30,4 +43,4 @@ 5000, worker, [auth_handler]}, - {ok, { {one_for_all, 5, 10}, [DiaServer, GsupServer, AuthHandler]} }. + {ok, { {one_for_all, 5, 10}, [DiaServer, GtpcServer, GsupServer, AuthHandler]} }. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/34804?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I6f00b7fce2d5fcdc484bfd45629b9141f16bc579 Gerrit-Change-Number: 34804 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • ...
  • 185
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.