Commit Graph

38 Commits

Author SHA1 Message Date
Sukchan Lee 41d8934677 [SMF] Added Bi-Directional Flow (#2909)
For bi-directions, the rules are created in the same form as for downlink
as shown below, so to apply them for uplink, we need to swap the rules
according to the interface.

RX : permit out from <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT> to <UE_IP> <UE_PORT>
GX : permit out from <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT> to <UE_IP> <UE_PORT>
PFCP : permit out from <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT> to <UE_IP> <UE_PORT>
RULE : Source <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT> Destination <UE_IP> <UE_PORT>
TFT : Local <UE_IP> <UE_PORT> REMOTE <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT>

RX : permit in from <UE_IP> <UE_PORT> to <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT>
GX : permit out from <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT> to <UE_IP> <UE_PORT>
PFCP : permit out from <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT> to <UE_IP> <UE_PORT>
RULE : Source <UE_IP> <UE_PORT> Destination <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT>
TFT : Local <UE_IP> <UE_PORT> REMOTE <P-CSCF_RTP_IP> <P-CSCF_RTP_PORT>
2024-02-17 20:43:15 +01:00
Pau Espin 64598fab2e Document Gx interface spec references 2024-01-25 07:05:33 +09:00
Sukchan Lee e92293e0af
[SEPP] Initial Update for 5G Roaming (#2739)
[SEPP] Initial Update for 5G Roaming
2023-11-19 19:34:51 +09:00
Daniel Willmann ef60207c1e [SMF] Fix Gx/Gy assert() if more than 64 CCRs are sent
The current code uses the cc request number as an index to the
transaction array (xact/xact_data). Since cc request number is a 32 bit
integer this is unfeasible for longer sessions and if more than a
handful of messages are exchanged per session.

The array size was already increased in #2038 which simply delays the
issue.
Furthermore, the current code asserts that cc_request_number is <=
MAX_CC_REQUEST_NUMBER which leads to an out-of-bounds write if
cc_request_number == MAX_CC_REQUEST_NUMBER.

Instead use a smaller array and index into it using cc_request_number
% array size. More than 2 requests should never be in flight at any one
time (initial or update request together with a termination request) so
an array size of 4 should be fine.
2023-06-21 22:07:32 +09:00
Pau Espin 3a4116123f [SMF] Fix typo in log line 2023-06-07 22:34:22 +09:00
Eugene Bogush b391cc589d relocation of user-location-info on top level 2023-05-25 22:42:54 +09:00
Sukchan Lee 79f73fae2a [Gx/Gy] MAX_CC_REQUESTER_NUMBER(32->64) (#2038)
Incrased MAX_CC_REQUESTER_NUMBER from 32 to 64
2023-02-04 20:53:44 +09:00
Sukchan Lee c6fd4ae6b8 [LOG] remove ogs_expect_or_return()/return_val() 2023-01-24 00:01:36 +09:00
Sukchan Lee 1d17e68c56 [ALL] Removing trailing whitespace and tab 2022-09-02 23:38:39 +09:00
Alexander Couzens b175394839 [SMF] fixup send 3GPP-Charging-Characteristics on Gx if received on S5/8c
- Gy instead of Gx AVP was used.
- Use correct avp position and avp variables.

Fixes: 657eef9169 ("[SMF] send 3GPP-Charging-Characteristics on Gx if received on S5/8c")
2022-08-31 06:38:08 +09:00
Sukchan Lee eab29fad9a Follow up on #1715
* Changed <TAB> to <SPACE>*4

* Changed snprintf to ogs_snprintf
2022-08-27 18:43:34 +09:00
Alexander Couzens 657eef9169 [SMF] send 3GPP-Charging-Characteristics on Gx if received on S5/8c
The 3GPP-Charging-Characteristics is an operator specific AVP
(optional). The 3GPP-Charging-Characteristics can be filled by the HSS
and forwarded by the MME towards the SMF.
2022-08-27 18:36:54 +09:00
Sukchan Lee e6a14cb73d Move src/../nf-sm.[ch] to lib/sbi/nf-sm.[ch] 2022-08-12 14:03:53 +09:00
Sukchan Lee 5e18b2bd13 [SCP] Support of Indirect Communication 2022-07-16 13:27:18 +09:00
Supreeth Herle aba1867902
Fix AN-Trusted AVP sent in CCR (#1542)
AN-Trusted AVP is only relevant for non-3GPP access networks e.g. WLAN.
This commit adds a check for non-3GPP access network in order to include
AN-Trusted AVP in CCR or not.
Also, clears the M bit for AN-trusted AVP as per TS 29.212 version 16.4.0, Table 5.4.0.1
2022-05-19 13:25:49 +09:00
Pau Espin 46621538af
[SMF] Improve 3GPP-User-Location-Info in Gn,Gx,Gy (#1539)
* [GTP] Fix trailing whitespace

* [SMF] Improve 3GPP-User-Location-Info in Gn,Gx,Gy
2022-05-17 10:29:11 +09:00
Sukchan Lee 4d2f7726b9 X2 handover with SGW change (#1367, #1459) 2022-05-12 22:52:36 +09:00
Pau Espin 2de12e32f4
[SMF] Integrate session tear down cycle into sess->sm (#1500)
* [SMF] smf_sm.c Fix indentation

* [SMF] gsm-sm: log fsm events

* [SMF] Integrate session tear down cycle into sess->sm
2022-04-20 21:42:18 +09:00
Pau Espin e3da7c9934
Rename GTPv2C specifics to gtp2 prefix (#1485)
In the past only GTPv2C was supported, and had the "gtp" generic prefix.
Later on, GTPv1C support was added, and "gtp1" prefix was used.
Let's move GTPv2C specific bits to have "gtp2" prefix too, and leave
"gtp" prefix for generic stuff among different GTP versions.
2022-04-13 07:07:39 +09:00
Pau Espin 8286b1c417
[SMF] Gx: Fix crash receiving DIAMETER_UNABLE_TO_DELIVER (#1469) 2022-04-06 23:57:55 +09:00
Pau Espin 5be48be634
[SMF] Gx: Prevent sending Gx messages to non-PCRF Diameter peers (#1468) 2022-04-06 20:48:26 +09:00
Sukchan Lee 110a63fdfa [SMF] Handle for PCRF not to respond (#1445) 2022-04-03 22:49:12 +09:00
Sukchan Lee 88016a769f [SMF] fix missing initialization memory (#1458) 2022-03-28 22:22:24 +09:00
Pau Espin acd6610508
[SMF] Gx: Add Destination-Host AVP to CCR (#1458)
Catch Origin-Host during CCA and set it as Destination-Host during
subsequent CCRs. This way we ensure UPDATE/TERMINATION Requests are sent
back explicitly to the same Diameter peer. Moreover, it seems
freediameter relies on this AVP to properly send the message over the
correct SCTP association when several diameter peers are available.
2022-03-28 22:00:28 +09:00
Supreeth Herle bc69ddfc6d
[SMF]: Fix Framed-IPv6-Prefix AVP length in CCR (#1398) 2022-03-01 17:11:28 +09:00
Supreeth Herle 03280d1f5a
Fix prefix length in Gx CCR Framed-IPv6-Prefix AVP (#1396)
As per 3GPP TS 23.401 version 15.12.0, section 5.3.1.2.2
The PDN GW allocates a globally unique /64
IPv6 prefix via Router Advertisement to a given UE.

After the UE has received the Router Advertisement message, it
constructs a full IPv6 address via IPv6 Stateless Address
autoconfiguration in accordance with RFC 4862 using the interface
identifier assigned by PDN GW.

For stateless address autoconfiguration however, the UE can
choose any interface identifier to generate IPv6 addresses, other
than link-local, without involving the network.

And, from section 5.3.1.1, Both EPS network elements and UE shall
support the following mechanisms:

/64 IPv6 prefix allocation via IPv6 Stateless Address
autoconfiguration according to RFC 4862, if IPv6 is
supported.
2022-02-26 15:25:08 +09:00
Sukchan Lee b4f382d360 [MEM] fix pkbuf problem in multi-threads (#1353)
We should use talloc in multi-threads instead of pkbuf.
Now, pkbuf library only uses single-thread environment.
2022-02-19 09:47:44 +09:00
Pau Espin 8cc70694db
Introduce Gn interface (GTPv1C) Support to PGW (#1351)
* [CORE] tlv: Store mode in ogs_tlv_t

This allows specifying the format of the IE for each individual IE,
hence allowing messages containing IEs formatted in different ways.

This is needed in order to support parsing GTPv1-C, since messages
contain IEs with different structure (TLV vs TV). Hence, this is a
preparation patch to add support for parsing TVs in ogs-tlv.c/.h.

* [CORE] tlv: Support parsing msg with both TLV and TV in it

IEs of type TV are sometimes used in GTPv1-C. Current tlv parser/builder
doesn't provide with ways to parse messages which contain TV formatted
IEs. This patch adds the relevant types and ways to encode/decode them.

Furthermore, the current parser/builder allows parsing/building messages
containing the exact same format in all its IEs. A new parser function
is added which allows parsing messages of different types (TV, TLV)
mixed in the same message. In order to be able to do so, it uses the
general msg_mode passed to it in order to know the general TLV format
(in essence, the length of the Tag field, and also the length of the
Length field if applicable each IE).

Looking up the instance in the TLV description is left undone and
hadcoded to 0, since the only user so far requiring this API is GTPv1-C,
which has no instances.

* [CORE] tlv: Support repeated tag+instance parsing TLV message

In GTPv2C, repeated IEs (same tag) are easily differentiated by the
Instance byte, which provides info to match different decoded
structures. In GTPv1C though, there's no Instance byte, and we still
encounter repeated IEs (like GSN Address in Create PDP Context Request).
Hence, the TLV decoder needs to be updated to track count of IEs found
(identified by tag+instance, where instance is always 0 in GTPv1C) and
get the proper description index + offset into the decoded structure.

* [GTP]: Move GTPv2-C specifics to its own libgtp subdir

This will allow adding GTPv1-C code by the side. Most GTPv2 code is left
in this patch as "gtp" instead of renaming it to "gtp2" in order to
avoid massive changes. It can be done at a later stage if wanted.

* [GTP] Support generating GTPv1-C messages

* [SMF] Add Gn interface support

This patch introduces GTPv1C support to open5gs-smfd. With it,
open5gs-becomes a GGSN too, where SGSN can connect to, hence supporting
GERAN and UTRAN networks.
2022-02-18 22:23:45 +09:00
Pau Espin 757285bf25
Fix trailing whitespace (#1365)
* [SMF] Fix trailing whitespace

* [CORE] Fix trailing whitespace

* [GTP] Fix trailing whitespace
2022-02-14 20:11:04 +09:00
Sukchan Lee 489b633e08 Update Supported-Feature AVP (#1202)
Add the Vendor-Id AVP in Supported-Features AVP in
CCR(Credit-Control-Request)
2021-10-16 17:41:53 +09:00
Sukchan Lee 68edcd6438 fix the SMF crash when num of flow > 8 (#1108) 2021-08-07 14:23:20 +09:00
Sukchan Lee 7e5a5d7511 fix the SMF/PCRF crash when bearer > 8 (#1108) 2021-07-29 18:10:28 +09:00
Sukchan Lee acb4db5dd1 Fix the crash when number of flow > 8 (#1108) 2021-07-28 14:00:03 +09:00
Sukchan Lee c6b13be92a do the finishing touches (#1108) 2021-07-27 20:33:46 +09:00
herlesupreeth bd6eea4fa5 Introduce checks for maximum accepted flow rules for a bearer in Gx path 2021-07-23 14:22:55 +02:00
Sukchan Lee e1c79647e2 [SMF] session data was accessed when NULL (#1105) 2021-07-23 16:24:59 +09:00
Supreeth Herle 362393d0ff
fix: session data was accessed when NULL resulting in crash (#1105) 2021-07-23 16:22:46 +09:00
Sukchan Lee 4537142929 [EPC] Support ePDG Interface (#1039) 2021-06-21 22:36:38 +09:00