Commit Graph

98 Commits

Author SHA1 Message Date
Pau Espin ed89689d49 Make PDP-Type and APN from GSUP AuthInfoReq available through all layers
Change-Id: I3f29b00f57f433f8623b9f0a5048c83985e5cced
2024-02-08 19:20:09 +00:00
Alexander Couzens 2ebc823274 GTPv2/S2b: use correct instance id in the F-TEID
I've no idea why, but it seems the GTPu is the EBI, but the GTP-C is always 0.
This way it works with open5gs.

Change-Id: I053fe5661a38ce6fa7995964a0346129b56c823e
2024-02-08 19:05:59 +00:00
Alexander Couzens 969b655390 diameter: rfc7155: move Framed-* AVP into a separate file
The AVP Frame-IP-Address type information isn't included in diameter_3gpp_ts29_273_swx except
when direct inherits. It seems there is still an issue with multiple levels of inherits.
Move the Framed-* into a seperate file to workaround collisions of other AVPs defined by SWX.

Change-Id: I002b1346f68401f4095cfcd57d74fed7de772e4c
2024-02-08 15:54:22 +01:00
Pau Espin 6f4735074c epdg_ue_fsm: Introduce public function to get pid from imsi
Change-Id: Ibc4478d8d48171c302daf8aaebd037227d3e3a98
2024-02-07 15:49:07 +01:00
Pau Espin 288eefba93 epdg_diameter_swm: Update PID if session already exists
If the FSM was recreated, during the first step it may have a different
PID. Update it so that we send the answer back to the proper PID.

Change-Id: I5e4f0ff4292c364f47d61ba629df50e8e3d35017
2024-02-07 14:57:28 +01:00
Pau Espin c61f6697f8 gsup_server: Fix removal of session from set
Change-Id: Iec9bce7494e3849c9e94158516f471f97182725b
2024-02-07 14:31:06 +01:00
Pau Espin fa5e44de99 AAA-Server: s6b: Fetch UE FSM Pid without asking SWm module
Instead, keep the implementation in the UE FSM module itself, and take
advantage of the fact that the PID is registered and can be derived from
the IMSI.

Change-Id: I0e62f3715da61d2d8cfabaf89557aeb1cd95f89a
2024-02-07 14:30:40 +01:00
Pau Espin 4c35d46bc5 gsup_server: Delete session if initial auth failed
It may be that due to a bug the previous session was kept alive and the
related epdg_ue_fsm has actually already terminated.
In any case, there's no use in keeping the session at this initial
transaction after having created it, so simply delete it if it fails.

Change-Id: Iebbab786e9647a026b2937115004747cd1883da0
2024-02-07 14:30:37 +01:00
Pau Espin 0b542baf61 gsup_server: Log error if epdg_ue_fsm:auth_request() fails
Change-Id: Iea5cc5736d8de9d652c15d9bc12ab16833c1ae7b
2024-02-06 19:03:46 +01:00
Pau Espin c85e77902f AAA-Server: Convert binary Imsi coming from internal SWm to string
ePDG handles Imsi as binary, but since all diameter uses strings, better
keep it as a string everywhere inside AAA-Server.
This fixes matching and finding sessions by Imsi.

Change-Id: Iba07ca02d9ca2bd6227d92b1d9c727107f37d9cd
2024-02-06 18:56:59 +01:00
Pau Espin 6ec87fc016 epdg_ue_fsm: Terminate UE FSM when reciving STA from AAA-Server
Change-Id: Ib79af9f965ef2c6aa878b3bfe692e3b139bdffc3
2024-02-06 18:56:59 +01:00
Pau Espin e3b955ee14 Fix all sets() lookup functions
Previous logic was wrong, since the accumulator function was not really
matching properly as the parameter was shadowed and didn't include the
value from the outer function.
The lookup is fixed here by passing the input lookup key (eg Imsi) as part
of the default/initial value of the fold() function.

Change-Id: I3a4a473b45fa54e857c2092d8d2b1e68ff9535e1
2024-02-06 18:56:56 +01:00
Pau Espin 84e4519ffc s2b: Answer CreateBearerReq with CreateBearerResp
Change-Id: I230e71661b289735c11bc7c576f7ff87bc41620d
2024-02-06 17:46:34 +01:00
Pau Espin 8953f75d7c s2b: Session can contain several bearers
Change-Id: I0ccb05a03e808122db085df73c6f0c56cec1b523
2024-02-06 16:33:08 +01:00
Pau Espin 9fd737e1a4 epdg: Do CEAI CancelLocationReq upon rx of S2B Delete Bearer Req
Change-Id: Iee20619902db74da4b8cec5ba767f7c5c9bb3907
2024-02-05 21:01:00 +01:00
Pau Espin 660a6edd20 epdg: Do SWm STR+STA upon rx of Delete Bearer Req
Change-Id: I795d973dc472f55d18048025ef4ffe1552dfdf26
2024-02-05 20:51:16 +01:00
Pau Espin cb765fd767 aaa_ue_fsm: S6b AAR should trigger SWx SAR with type=PGW_UPDATE
Change-Id: If0f0bfa21117c65c0ef7c831746b50eb83908778
2024-02-05 19:21:30 +01:00
Pau Espin f2db66d4d1 Send SAR(DEREGISTRATION) to HSS when all sessions are terminated
Change-Id: I62eba8ef916d52964df4135d1031f3950b6818a2
2024-01-31 19:18:49 +01:00
Pau Espin 68f39794ae AAA-Server: Process S6b, SWx requests async through new aaa_ue_fsm
This will allow keeping per-UE session state, and for instance send a
SAR(USER_DEREGISTRATION) towards HSS when all sessions from all
interfaces (s6b, SWm) are terminated.

Change-Id: I78ebda4679d0a2f3ecede94598e74b20c2ff8836
2024-01-31 16:31:40 +01:00
Pau Espin f383fa211c UE-initiated detach: Do STR+STA ePDG<->AAA-Server
Change-Id: I6f7554e24b26bfe191b28b56904bc8432690625d
2024-01-29 13:23:35 +01:00
Pau Espin eed8608da0 Make Auth Compl procedure more similar to specs
Properly document our LU Request message matching the 2nd DER in usual
3GPP architecture, which should contain the Auth RES from the MS and be
forwarded up to the AAA-Server.
In our architecture, the auth is handled earlier, in strongswan (part of
ePDG node), hence why our LU Request contains no Auth RES info, and it's
only signalled by strongswan to osmo-epdg to signal the auth completed
successfuly.
Make the handling of LU Req and events triggered by it asynchronous and
clean up a bit some related code paths and states.

Change-Id: I480c110deeb04abf1ff19147a70e10be9cbafae8
2024-01-29 12:51:33 +01:00
Pau Espin cd03bdf9ce s6b: Trigger SAR towards HSS when receiving AAR from PGW
As described in 3GPP TS 29.273 9.1.2.2.3 mentioning procedure from clause 8.1.2.2.2
(SAR/SAA).

Change-Id: I7e0bf449ac6cae550a5934d9d518bb3f2bf64d5b
2024-01-26 16:14:06 +01:00
Pau Espin 796dce18b9 Make SWm MAR+MAA asynchronous
Change-Id: Ie7762843e463f404cd4f0c5fcf03a9566dcf173b
2024-01-26 15:46:19 +01:00
Pau Espin e929452d1a Split auth_handler module into SWm files for ePDG and AAA Server
This allows more easily matching and following the code against the
procedures the specs define.
Also, ensure proper separation of data and proper order of procedures
when later on we may split the AAA Server to be an external process.

Change-Id: Ieb925445fb0cf45a58439fd0c4cd9e4d779a0a79
2024-01-25 18:18:35 +01:00
Pau Espin b8ec908c23 Rename s/epdg_diameter_swx/aaa_diameter_swx
The Swx interface is part of the internal AAA server node implemented in
osmo-epdg. Hence, change the prefix of the module/file name so that it
becomes clear it's part of the AAA and keep it separated from ePDG node
code.

Change-Id: Ie6a056bb8616fcda262f285241d38ba26e47f184
2024-01-25 18:04:36 +01:00
Pau Espin e5473512eb s6b: Answer Diameter STR with STA
Change-Id: I34f803c1f772bab9b267e4eaad7146e7b1ac2894
2024-01-25 17:13:01 +01:00
Pau Espin b450ae914c Rename s/ue_fsm/epdg_ue_fsm/g
osmo-epdg actually contains 2 nodes inside: ePDG and AAA server. The fsm
is for the ePDG node, and ideally we want to keep both nodes as separate
as possible so that we can later on split them or use an external AAA
server.

Change-Id: If0852f4aedd0fb0cb9bf6cfcf77f00acd4a3fcbf
2024-01-25 16:02:36 +01:00
Pau Espin cec9f4cb38 Implement UE-initiated Detach
This commit is a first step towards implementing the full procedure. It
implements handling at the GSUP CEAI interface and operating on the
attached PGW to delete the session. No work towards the HSS from AAA
server now from PGW to the AAA is done yet.

Change-Id: I2e922f76c2fa601c5f61fa23d6df5fb62c3e133d
2024-01-24 21:33:26 +01:00
Pau Espin 5c6832b6fd Use call() instead of cast() in ue_fsm
This allows accounting for problems in the FSM from the calling code,
and act accordingly, eg. rejecting a message.

Change-Id: I235d3c8fb3a863d288b5433c39e0da65f747936b
2024-01-24 18:45:31 +01:00
Pau Espin 21234cb6cc gsup_server: Introduce tx_gsup() internal function
Change-Id: I95d37182da89e39993eb7d5aaf63446e5f99ae2a
2024-01-24 17:55:13 +01:00
Pau Espin 2dffc2d42a gsup_server: Use new GSUP Cause defines from osmo_gsup
Change-Id: Ie19a0d0b81e0a264401ea37e0cfd74802aee68fe
2024-01-24 17:53:49 +01:00
Pau Espin ea42a40ad8 Make CreateSession Req+Resp procedure async
Change-Id: Ib42ed08afa4a06149d2d72ac64487eec808e260f
2024-01-23 18:20:37 +01:00
Pau Espin 2041e002a8 Introduce ue_fsm
Decouple gsup_server from other protocols.

Change-Id: I0c960c4c250458384ed706a99582ec52083019f6
2024-01-23 17:30:03 +01:00
Pau Espin d7e7484ceb Forward IP Address from CreateSessionresponse in GSUP EPDG Tunnel Result
Related: OS#6091
Change-Id: I2a9130d242830daa826414a287f54862752017d2
2024-01-23 12:03:28 +01:00
Pau Espin cdae73d56c Update osmo_gsup dependency in rebar.config and update rebar.lock
osmo_gsup dep was pointing to a temporary branch of mine which is no
longer existing, because the fix required was applied in
osmo-ttcn3-hacks.git.

Change-Id: I523acb49e4604e8a62d41d07d53d512158b28670
2024-01-19 14:30:15 +01:00
Pau Espin 4f3b01bfb9 cosmetic: sys.config: Clean up formatting of logging section
Content is not changed, simply rearranged.

Change-Id: I6a992ddef6f9807f360f770d6d5e9185f36559d1
2024-01-18 14:04:04 +01:00
Pau Espin 1bda89c5cf swx: Rename diameter related parameters
This allows easily identifying and differntiating the config parameters
from other diameter interfaces present such as s6b.

Change-Id: I63fe4c7acc7460575a921b254adf066134c0527f
2024-01-18 14:03:23 +01:00
Pau Espin 978159d58e diameter: Make diameter_watchdog_config configurable
This allows tweaking values in config file of TTCN3 tests to speed up
test setup.

Change-Id: I99b5e02264c2c35a3fbfcd2d6083a07e2cfea566
2024-01-16 18:22:38 +01:00
Pau Espin b400adc819 diameter: Allow configuring (re)connect timer in s6b and swx
TTCN3 tests will require lower values to avoid timing out.

Change-Id: I7d280f83f4f375eaf34ea3b69a421372af54ffdb
2024-01-16 18:20:18 +01:00
Pau Espin 7ea49bbff9 gsup_server: Improve log line when listening on gsup
Change-Id: I7dccc20b6c2c0f58cdd3a43469053624927c9acd
2024-01-16 18:14:10 +01:00
Pau Espin 139703e86d gsup_server: Remove incorrect log about reconnecting
osmo-epdg is a GSUP server, so if conn goes down it won't reconnect.
That's the duty of the client.

Change-Id: Ib5a8f1eb6d873f85d526222f76768d2b81f08d90
2024-01-16 18:14:10 +01:00
Alexander Couzens 2c53a2a336 epdg_gtpc_s2b: fix encoding of the IP address
Change-Id: I6a96f5d62fa0b327a462670e40cc6a42cf6b2d3c
2023-12-06 11:33:42 +00:00
Alexander Couzens 278a99358f epdg_gtpc_s2b: add TLV Serving Network
The open5gs requires Serving Network TLV.

Change-Id: I2a9459859fc660e6433cd8178ab9d1f92ae74fc0
2023-12-06 11:33:42 +00:00
Alexander Couzens ffe4e0b084 dia: 3gpp_ts29_273_s6b: add missing include of rfc4004
Erlang diameter compiler doesn't track includes of includes
resulting in missing AVPs. It was missing MIP-Home-Agent-Address.

Change-Id: I986154f057f84e131845f6aff79e3ec81aea6a81
2023-12-06 11:33:34 +00:00
Alexander Couzens 53265bc7de dia: 3gpp_ts29_273_s6b: add missing *[ AVP ] to AAA
AAA allows to have unknown AVPs.

Change-Id: I934c87e912882ddef1cbac1466dec66c72b9c77c
2023-12-05 15:29:40 +00:00
Pau Espin d6600aae20 s2b: Implement GTPv2C DeleteBearerReq
Sessions are now stored/kept upon CreateSession time until deleted
through DeleteBearerReq.

Related: OS#6046
Change-Id: I1e5af1ead17385d2e494f4c90ffe6455aee850da
2023-10-25 18:03:40 +02:00
Pau Espin 757cca01d8 Fix sysmocom copyright typo
Change-Id: Ia6a3748ac3eb7c5587ed978d60afd315dae07a3c
2023-10-23 14:46:27 +02:00
Pau Espin bffb425812 Initial S6b support
So far only the Rx of AAR msg and Tx of AAA is supported.
This allows already going forward during the session creation, where PGW
sends AAR to the AAA server and expects AAA message.

Related: OS#6229
Change-Id: Ia2b138317cb291a95882853f5403949c5e6a5a1b
2023-10-23 14:44:53 +02:00
Pau Espin 6b2e105570 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
2023-10-23 14:44:09 +02:00
Pau Espin 8c095b84f3 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
2023-10-23 14:42:48 +02:00