Commit Graph

80 Commits

Author SHA1 Message Date
Sukchan Lee c391ac1334 [SMF] Apply 5G Core into GSM (#1498) 2022-05-15 06:27:54 +09:00
Sukchan Lee e2159b1240 [SMF] memory free Charging Characteristics (#1532) 2022-05-13 18:18:04 +09:00
Pau Espin 5d478e2488
Pespin/pr (#1529)
* [SMF] rename function s/gtp/gtp2/

* [SMF] Store GTPC version in session

So far we always depended on an xact being present in the code path in
order to know which kind of session it is (GTPv1C vs GTPv2C). Let's
instead store that information in smf_sess_t so that we have it always
available in an easy way.

* [SMF] Move smf_sess_t GTPv1C specifics into gtp substruct

* [SMF] Gy CCR: append 3GPP-NSAPI AVP
2022-05-12 21:42:45 +09:00
Sukchan Lee 3508e09a41 [GTPU] IPv6 RS/RA with QFI Extended Header (#1506) 2022-04-30 11:50:30 +09:00
Sukchan Lee 79de674fd8 [PFCP] F-TEID allocation by SMF (#1466) 2022-04-16 14:08:56 +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 2be12903cb
[SMF] Introduce optional Gy interface support (#1479)
The use of the Gy interface (SMF acting as CTF towards an OCS node) is
mandated through configuration file. Default value "enable: auto" will
only make use of it in case a Diameter peer announcing support for the
Credit-Control Application is found.

Upon subscriber session creation, and after auth check over Gx, the SMF
will create a Gy session with the OCS and only after that step the SMF
will accept the session back to the subscriber.
The OCS may then grant some traffic volumes/time and ask to be notified
back with updated measurements.
In order to get the measurements, the SMF relies on PFCP URR configured
to the UPF through Session Repoort Request messages.
When closing the subscriber session, the SMF will also terminate the Gy
session at the OCS.

So far only some specifics parts of the Gy interface as well as the PFCP
side are implemented. Those should be enough to at least have
volume/time thresholds granted by the OCS, which then will be able to
track subsriber resource use.

This patch doesn't implement the OCS side of the Gy interface, that's
left as a future exercise. The interface was tested using an OCS
emulator implemented in TTCN-3 [1]

[1] https://cgit.osmocom.org/osmo-ttcn3-hacks/
2022-04-09 08:26:28 +09:00
Sukchan Lee 224d1caca1 change log-level WARNING to INFO 2022-03-22 22:52:10 +09:00
Sukchan Lee 72ecd1c005 [SMF] Remove T_RELEASE_HOLDING timer 2022-03-17 16:07:19 +09:00
Pau Espin ba3a046c62
[SMF] Avoid crash if smf_ue_pool is full (1024 UEs) (#1397) 2022-02-28 21:27:27 +09:00
Sukchan Lee d61127afcc [SMF] fix the seperate DNS in PCO IPCP (#1358) 2022-02-23 17:38:07 +09:00
Sukchan Lee 420c1d5ad3 [SMF] fix the PCO bug (#1357, #1358)
- SMF can handle PCO ID PAP (0xc023)
- SMF adds DNS servers to PCO IPCP only if UE requested
2022-02-19 16:05:07 +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
Sukchan Lee 866ae78f5e [NRF] fix the crash for invalid FQDN (#1333) 2022-01-22 09:34:38 +09:00
Pau Espin b3ac5b35eb
[SMF] Fix potential null pointer dereference (#1324)
* [SMF] Fix potential null pointer dereference

Pointer "sess" was first dereferenced and later on checked for nullness.
This is clearly wrong. Rearrange the code path to make sure the check is
done first, then dereferenced.

* gitignore: Add subprojects/libtins

* cosmetic: Fix whitespace
2022-01-18 11:23:40 +09:00
Sukchan Lee bfa34be222 fix the buffer overflow (CVE-2021-41794) 2021-11-15 15:49:58 +09:00
Sukchan Lee 0fb8279e36 VoNR added but not tested! 2021-11-14 21:07:56 +09:00
Sukchan Lee 5e016937c7 Update URR contribution (#1190) 2021-10-04 22:28:32 +09:00
Sukchan Lee 13f1b390ae CVE-2021-41794 from NCC Group by Mark Tedman
When connecting to the UPF port for the PFCP protocol (8805) and sending
an association setup request followed by a session establishment request
with a PDI Network Instance set to ‘internet’, it causes a stack corruption
to occur.

So, ogs_fqdn_parse() fixed.
2021-10-01 22:41:03 +09:00
Sukchan Lee 9c589ac584 [PFCP] include outer header removal(ext-deletion) 2021-09-04 18:03:04 +09:00
Sukchan Lee e2fe15d2ae [SMF] TAI/ECGI is not required in WLAN (#1039) 2021-08-27 11:40:58 +09:00
Sukchan Lee 3564fe5c8c [SMF/UPF] Clarify FALLBACK SUBNET [#1128] 2021-08-14 16:52: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 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
Sukchan Lee 039b9d0aaa SBI updated
- openapi-generator version 5.2.0
- add priority/capacity/load in NFProfile/NFService
- add AllowedNfTypes in NFProfile/NFService
2021-07-16 17:02:33 +09:00
Sukchan Lee 4537142929 [EPC] Support ePDG Interface (#1039) 2021-06-21 22:36:38 +09:00
Sukchan Lee 118d62d42d Add more memory log 2021-06-06 22:35:46 +09:00
Sukchan Lee 80a9497afd [PFCP] Add more error log (#1012) 2021-05-30 20:35:30 +09:00
herlesupreeth 4d6692d8fe fix: DRB lost issue when additional TFTs needs to be added to existing bearer with TFTs
This commit address the issue where a bearer with particular
PCC rule name exists with TFTs and addtional TFTs needs to be added
to same bearer and DRB lost is reported by UE.

This is achieved by creating EPS Bearer Level Traffic Flow Template
with TFT operation code as 'OGS_GTP_TFT_CODE_ADD_PACKET_FILTERS_TO_EXISTING_TFT' in
above scenario rather than use 'OGS_GTP_TFT_CODE_CREATE_NEW_TFT' at all times.
And, not remove existing packet filters for the bearer.
2021-05-27 15:57:32 +02:00
Sukchan Lee dfaf2f1567 [SMF] PF precedence generated by Pool (#1001) 2021-05-16 11:26:40 +09:00
Sukchan Lee 3b19190f56 [AMF] fix crash due to malformed NGAP (#960) 2021-05-08 15:09:10 +09:00
Sukchan Lee fc27f7499b [SMF/SGW-C] fix the PFCP RR selection (#953)
The configuration has changed. PFCP node rr=0 is removed as shown below.
sgwc:
  pfcp
    rr: 0 <-- Removed

Introduced a new configuration method for SMF/SGW-C

parameter:
  no_pfcp_rr_select: true

By default, PFCP round robin selection is allowed.
The above parameters prohibit selecting PFCP in a round robin manner.
2021-04-24 20:56:14 +09:00
Sukchan Lee 829123dad0 fix: managing multiple calls (#869)
If PCRF sends RAR, it generates different Charging-Rule-Name.
2021-03-29 10:28:08 +09:00
Sukchan Lee 37e0a714f9 Fixes UE IPv6 BUG (#808) 2021-03-15 10:01:55 +09:00
Sukchan Lee 9af4268bab arch: DB schema Changes (#796)
- New function : NSSF
- New feature : SMF selection
2021-03-08 21:25:09 +09:00
Sukchan Lee 5e839e25fe fix: amf crash bug (#793) 2021-02-03 23:49:16 -05:00
Sukchan Lee 0311d2255c Oops! remove debug info 2021-02-01 10:17:49 -05:00
Sukchan Lee d9417be9a6 feat: Handling Duplicated PDU Session ID
TS29.502 5.2.2.3.11 AMF requested PDU Session Release due to duplciated
PDU Session Id
2021-02-01 10:14:27 -05:00
Sukchan Lee ff5236f3e0 feat: Indirect Data Forwarding in N2-Handover 2021-01-31 23:01:15 -05:00
Sukchan Lee c9363b1320 5gc: Paging was added 2021-01-18 11:48:35 -05:00
Sukchan Lee b4358fe703 fix: Add dedicated bearer activation reject (#755) 2021-01-08 15:09:02 -05:00
Sukchan Lee 235a041b8d feat: Add dedicated QoS flow 2020-12-31 21:07:08 -05:00
Sukchan Lee 198abc6e8b Add PCF(Policy Control Function) 2020-12-11 14:03:20 -05:00
Sukchan Lee 33edd12335 fix: UPF is not working with Landslide (#685)
* Flow-Description use 'to assigned' in Gx Interface
* Support SDF Filter ID
* Support F-TEID's Choose
* BAR(Buffering) is added in PFCP session
* Default Apply Action uses NOCP|BUFF
2020-12-03 01:16:57 -05:00
R. Medeiros 3c99af7736
Update to generate SMF Log for Session Removed. (#677)
Create info log to show when the user disconnect the APN, with IMSI, APN and IPv4/IPv6.
2020-11-19 16:11:28 -05:00
Sukchan Lee ad85c12513 checking for APN/DNN in case insensitive #617 2020-11-02 11:45:14 -05:00
Sukchan Lee a470131489 Now, F-TEID is allocated in the UP function. 2020-10-25 22:43:53 -04:00
Sukchan Lee edf83b37fa Add debug message for issues [#551] 2020-09-10 21:50:20 -04:00
Kenny Barlee 242a352a1c
Change PFCP node search order, fix typo, add feature to disable RR for a node (#560)
* change search order to APN/cellID/TAC

* typo in SGWC default config

* Feature to disable RR for particular node
2020-09-09 18:13:58 -04:00