Commit Graph

4740 Commits

Author SHA1 Message Date
Sukchan Lee
c888e2d62a [SBI] Fixed an issue in SCP TLS communication for Open5GS (#3541)
Fixed an issue in SCP TLS communication for Open5GS where omitted port numbers
in HTTP/HTTPS URIs (e.g., "https://scp.localdomain" implying port 443) were not
handled correctly.

Updated the code to ensure that during FQDN and port comparisons,
cases where the port number is set to 0 are accounted for.

This fix resolves the problem with indirect SBI communication over SCP using TLS
allowing proper connectivity between network functions like BSF and NRF.
2024-11-03 21:47:29 +09:00
Sukchan Lee
2031f7d8a1 [SBI] Make 'global' configuration optional instead of mandatory (#3466)
Previously, the global configuration section was required for NF to start,
which differed from earlier versions where it was optional. This commit modifies
the implementation to make the global section optional again,
allowing NF to start without explicitly defining global settings.

This change restores the previous behavior and improves usability for users
who do not need to customize global settings.
2024-11-01 15:32:46 +09:00
Sukchan Lee
1f42ddace1 [SCP/SEPP] Fixed memory leak in specific exception handling scenarios
The memory leaks occurring in specific exception handling scenarios have been
resolved. For instance, when an HTTP2 connection closes, memory associated
with objects like response messages was not being freed properly.

This update addresses and fixes these issues.
2024-11-01 14:31:11 +09:00
Sukchan Lee
bc02e48d1a [ePDG] Add Node-Identifier IE support in GTPv2 S2b Create-Session-Request for SMF Diameter S6b Routing (#3507)
Implement support for Node-Identifier IE in GTPv2 S2b Create-Session-Request
to SMF for Diameter S6b integration

This patch adds support for processing the Node-Identifier IE within GTPv2
Create-Session-Request messages sent via the S2b interface to the SMF.
When the ePDG includes the Node-Identifier IE containing both host and realm
of the AAA-Server, the SMF now uses this information to populate
the Destination-Realm and Destination-Host AVPs in the Diameter S6b AAR message.

This enables seamless integration and allows the SMF to route requests directly
to the appropriate AAA-Server, enhancing interoperability in setups
where the host and realm data are required by the Diameter network.
2024-10-31 22:22:25 +09:00
Sukchan Lee
ce36143f5c [PFCP] Add Missing 3GPP Interface Type in PFCP Messages
This field was previously omitted, which could lead to
improper handling of interface-specific logic in certain scenarios.

The addition of the 3GPP Interface Type ensures correct behavior
in compliance with the 3GPP standards for PFCP message handling.
2024-10-20 22:54:08 +09:00
Sukchan Lee
151275d708 [PFCP] Fix SGW-U/UPF Bugs and Improve Header Handling
1. Fix SGW-U/UPF bug by comparing QFI only when PDI's QFI is present
Resolved an issue where the QoS Flow Identifier in the GTP-U Extension Header
was incorrectly compared regardless of the presence of PDI's QFI.
Updated the implementation to perform the comparison
only when PDI's QFI is present.

2. Add Outer Header Removal settings to SGW's PDR where necessary
Addressed the absence of Outer Header Removal in the SGW's PDR
by adding it to all required locations, ensuring proper header handling.

3. Remove unnecessary GTP-U Extension Header Removals
Eliminated all instances of GTP-U Extension Header Removal
since they should only be used during handover from 5GS to EPS.
This cleanup prevents improper header removals in other scenarios.

4. Delete unnecessary usage of Network Interface and UE IP Address
Removed all redundant references to Network Interface and UE IP Address,
streamlining the codebase and reducing potential confusion.

5. Change precedence so that Control has higher priority than Data
Adjusted the precedence settings to ensure that Control messages
are given higher priority over Data, enhancing the system's efficiency
and responsiveness.
2024-10-20 18:52:21 +09:00
Sukchan Lee
0e441cf710 [MME] TAI and E_CGI IEs in SGs (#3518)
Added UE's current TAI and E-CGI to SGsAP-LOCATION-UPDATE-REQUEST message
as per TS 29.118 5.2.2.2.1
2024-10-20 16:40:49 +09:00
Sukchan Lee
e3790b45b4 [PFCP] Fix memory free issue causing crash (#3497)
This commit fixes an issue where the system would crash
due to improper memory release after receiving crafted PFCP packets from UEs.
2024-10-17 23:30:04 +09:00
Sukchan Lee
a50c313b81 [SMF] Update QoS Rule Handling (#3513)
1. Set packet filter identifier values to 0 when the UE requests to:
  - Create new QoS rule
  - Modify existing QoS rule and replace all packet filters
  - Modify existing QoS rule and add packet filters - As specified in TS24.501, section 9.11.4.13, Table 9.11.4.13.1.

2. Revise QoS rule modification logic:
  - Instead of replacing packet filters based on their identifiers (EPC approach), update the implementation to delete all existing packet filters within the QoS rule and add new ones.
  - This ensures that when modifying an existing QoS rule to replace all packet filters, the packet filters are correctly reset and updated per 5G Core requirements.
2024-10-17 15:55:34 +09:00
Sukchan Lee
5dc3905c39 [SMF] Fix Packet Filter Identifier handling and limit maximum number (#3505)
- **Correct Packet Filter Identifier Handling:**
  Remove the addition of +1 when searching for the packet filter context using `smf_pf_find_by_identifier()` in the 5G Core SMF. According to 3GPP TS24.008 Section 10.5.6.12 and TS24.501 Section 9.11.4.13, the Packet Filter Identifier should range from 1 to 15 (or 0 to 15) depending on the operation and should be used directly as received from the UE.

- **Adjust Maximum Number of Packet Filter Identifiers:**
  Change the maximum number of Packet Filter Identifiers from **16** to **15** in the SMF to comply with the 3GPP specifications. The standards specify that the number of packet filters shall be greater than 0 and less than or equal to 15 for certain operations.

**Background:**

In the current 5GC implementation, the SMF incorrectly adds +1 to the identifier received from the UE and allows up to 16 identifiers, leading to mismatches and potential communication issues. These discrepancies cause the SMF to fail in correctly locating the packet filter context, resulting in improper QoS rule enforcement.

**Changes Made:**

- **For Packet Filter Identifier Handling:**
  - Updated the SMF code to use the identifier received from the UE directly without modification:
    ```c
    // Corrected code for 5GC:
    pf = smf_pf_find_by_identifier(
            qos_flow, qos_rule[i].pf[j].identifier);
    ```

- **For Maximum Number of Packet Filter Identifiers:**
  - Adjusted the code to enforce a maximum of 15 packet filters as per the specifications.

**Impact:**

- **Compliance:**
  - Ensures that the 5GC implementation of Open5GS adheres to the 3GPP TS24.008 and TS24.501 specifications regarding Packet Filter Identifier handling and limits.

- **Functionality:**
  - Corrects the mapping and management of packet filters between the UE and SMF in 5GC, preventing potential communication issues and misconfigurations.

- **EPC Implementation:**
  - The EPC implementation remains unaffected by these changes. EPC correctly handles the Packet Filter Identifier by decrementing it by 1 before sending it to the UE and adding +1 when searching for the packet filter context.

**Conclusion:**

By making these adjustments, we ensure proper synchronization between the UE and SMF in the 5G Core and maintain compliance with the 3GPP specifications. This fix resolves the mismatches caused by incorrect identifier handling and enforces the correct limit on the number of packet filters, enhancing the reliability and standards compliance of the 5GC implementation without impacting the existing correct behavior in EPC.
2024-10-16 17:24:55 +09:00
Sukchan Lee
063fa42a28 Revert "[SMF] Fix Packet Filter Identifier handling in SMF (#3505)"
This reverts commit f82fc85cc2.
2024-10-16 09:32:16 +09:00
Sukchan Lee
f82fc85cc2 [SMF] Fix Packet Filter Identifier handling in SMF (#3505)
Decrement the Packet Filter Identifier by 1 before sending it to the UE
during GSM message construction. This correction ensures proper synchronization
between the UE and SMF, allowing `smf_pf_find_by_identifier()` to accurately
locate the corresponding `pf` context without adjusting the identifier
during the search.

This fix aligns the 5GC implementation with the EPC behavior,
where the identifier was correctly decremented before transmission to the UE,
preventing mismatches and synchronization issues.
2024-10-15 17:57:11 +09:00
Sukchan Lee
606788361c [SMF] Fixed incorrect prefix length in GTPv2 PAA IE (#3495)
I have modified the PAA's IPv6 prefix length from 8 to 64.
This adjustment ensures that the prefix length now correctly reflects
the standard /64 notation, in accordance with the specifications.
2024-10-11 14:58:14 +09:00
Sukchan Lee
55e5fc92dd [SMF] Fixed interface-type in the Create Bearer Request (#3484)
I wanted to let you know that I have modified the SMF configuration
to send S2b PGW GTP-U instead of S5/S8 PGW GTP-U in WLAN.

This adjustment should ensure that the correct interface type is used,
as per the specifications.
2024-10-11 14:52:09 +09:00
Sukchan Lee
cf4bbe83fc [HR] Control Plane between V-SMF/H-SMF (#2194)
Implement Control Message handling between V-SMF and H-SMF
during Home Routed Roaming process

Completed the implementation of control messages exchanged
between V-SMF and H-SMF as part of the Home Routed Roaming process
2024-10-10 17:30:20 +09:00
Sukchan Lee
af85bc0a66 [MME] Incorrectly being retrieved from the PLMN-ID (#3480)
The issue was that the PLMN-ID of the TAI was incorrectly being
retrieved from the PLMN-ID of the EUTRAN_CGI.

As a result, when the PLMN-IDs of the TAI and EUTRAN_CGI were improperly set,
the MME would crash.

All issues have now been resolved.
2024-10-07 22:10:39 +09:00
Sukchan Lee
6834bdf819 [HR] SMF selection (#2194)
SMF selection according to 4.3.2.2.3 of TS23.502.

V-SMF makes discovery in the V-NRF according to V-NSSF.

H-SMF makes discovery in the H-NRF according to H-NSSF.
(The AMF goes through the V-NSSF and forwards the message seeking the NRF to the H-NSSF.)
2024-09-16 08:55:52 +09:00
Pau Espin Pedrol
6d80d4322a [PCRF] Support retrieving metrics from freeDiameter thread 2024-09-05 21:51:12 +09:00
Pau Espin Pedrol
0c348cac68 [PCRF] Initial metrics support
This commit doesn't add any PCRF specific metrics, only all the
boilerplate code to instantiate libmetrics and hence have the generic
prometheus metrics available.
2024-09-05 21:51:12 +09:00
Sukchan Lee
3d3f18e342 [PCRF/HSS] Added missing files for enabling metrics (#3442) 2024-09-05 21:28:30 +09:00
Sukchan Lee
778d0cbc59 [PCRF/HSS] Enable Metrics (#3442) 2024-09-05 21:26:27 +09:00
Pau Espin Pedrol
787e555501 [PCRF] Enable ogs_app pollset
This will be needed once metrics are included.
2024-09-05 08:12:46 +09:00
Pau Espin Pedrol
7bf057ce00 [PCRF] Improve diameter logging 2024-09-05 08:11:59 +09:00
Pau Espin Pedrol
95e885bfba [PCRF] cosmetic: Fix trailing whitespace 2024-09-05 08:11:59 +09:00
Pau Espin Pedrol
34220b94cf diameter: stats: Fix unit typo in log 2024-09-05 08:11:59 +09:00
Sukchan Lee
219cda9b4f [MME/AMF] Fixed problem in MacOSX machine
1. transfer needs 192.168.x.50
2. Compilation error in namf-build.c in MaxOSX
3. enb_ue can be NULL in esm-sm.c
2024-09-04 22:00:29 +09:00
Pau Espin Pedrol
3e154f9571 [HSS] Initial support for SWx diameter metrics 2024-09-04 21:28:59 +09:00
Pau Espin Pedrol
5b66e3159a [HSS] Improve SWx diameter debug logs 2024-09-04 21:28:59 +09:00
Pau Espin Pedrol
b2f56b9641 [HSS] Initial support for S6a diameter metrics 2024-09-04 06:36:32 +09:00
Pau Espin Pedrol
7293b5f3e4 [HSS] Initial support for Cx diameter metrics 2024-09-04 06:36:32 +09:00
Pau Espin Pedrol
9db907a56e [HSS] First diameter metric
This commit showcases how to add diameter based metrics to an app.
Follow-up commits will add further metrics for different diameter based
interfaces.
2024-09-04 06:36:32 +09:00
Pau Espin Pedrol
a37a2099fc diameter: Support updating app with private metrics 2024-09-04 06:36:32 +09:00
Pau Espin Pedrol
902a602a2b diameter: Support configuring stats interval through config file 2024-09-04 06:36:32 +09:00
Pau Espin Pedrol
4308ba7f37 [HSS] Improve diameter based interface debug logs
This way it's immediate to know whether stuff happens o nthe rx or the
tx path when looking at logs or even at the code.
2024-09-03 23:16:36 +09:00
Pau Espin Pedrol
91674ffa8a diameter: stats: Split logging to helper function 2024-09-03 22:20:19 +09:00
Pau Espin Pedrol
36d2fb3ebb diameter: stats: Move stats struct outside of context 2024-09-03 22:20:19 +09:00
Pau Espin Pedrol
7fb0690950 diameter: stats: use monotonic clock & avoid drift
We simply want to trigger the event at fixed intervals, we don't really
need the wall time.
2024-09-03 22:20:19 +09:00
Pau Espin Pedrol
9cabb279c0 diameter: stats: Integrate into main loop
There's no real need for a separate thread, it all can run with a timer.
Furthermore, this will ease submitting events towards app so that they
can update diameter metrics.
2024-09-03 22:20:19 +09:00
Pau Espin Pedrol
b5d1e8ac61 diameter: split stats and logger modules
Those 2 modules actually share nothing in common, so they can be totally
separated, making it easy to improve diameter stats in follo-up patches.
2024-09-03 22:20:19 +09:00
Pau Espin Pedrol
9e87c6b1c6 cosmetic: diameter: Fix trailing whitespace 2024-09-03 22:20:19 +09:00
Pau Espin Pedrol
34c922a857 diameter: logger: Use typedef for ogs_diam_logger_t
Same as done mostly everywhere in open5gs types.
2024-09-03 22:20:19 +09:00
Sukchan Lee
b530221dea [AMF] Follow-up on #3409 2024-09-03 22:11:02 +09:00
Matej Gradisar
dab131d375 [AMF] Add UE context transfer and Registration status update states 2024-09-03 22:09:56 +09:00
Matej Gradisar
1a344aeb65 [Tests] Delete unnecessary code 2024-09-03 22:09:56 +09:00
Matej Gradisar
8c293bc710 [AMF] Registation status update and tests 2024-09-03 22:09:56 +09:00
Bostjan Meglic
5cf92c9851 [tests] Upgrade tests for multiple NFs
The test scenario can now deploy multiple AMFs and other NFs.
2024-09-03 22:09:56 +09:00
Sukchan Lee
ed68d0b016 [MME] Follow-up on #3429 #3422 2024-09-03 21:48:25 +09:00
Jiaxun Yang
deef017dfe [MME] config: Document hss_map yaml entry
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
2024-08-29 16:39:45 +09:00
Jiaxun Yang
9d83eba550 [MME] Implement HSS Selection process
Implement HSS selection process as described in TS 29.272 Section 7.16.
Use hss_map config entry to map between plmn and HSS realm & host.

Closes: https://github.com/open5gs/open5gs/issues/3422
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
2024-08-29 16:39:45 +09:00
Pau Espin Pedrol
51aca2826f [MME] 2g->4g: Delay SGSN Context Ack after UE becomes authorized
This commit is a follow-up from previous one, split to ease review.
In this commit, the SGSN Context Ack towards SGSN plus session creation
towards SGW is further delayed until authorizing + SecurityModeCommand
against UE has succeeded, hence meaning we have a fully operating
context to communicate with it.
2024-08-28 11:17:38 +09:00