Commit Graph

77 Commits

Author SHA1 Message Date
Sukchan Lee
b7cd0d6a7c Follow-up on #4105 2025-10-17 09:17:02 +09:00
jmasterfunk84
a90544f312 [UDM][UDR] Add support for dataset-names resource (#4105)
* Enable datasets in UDM

* Remove developer comment
2025-10-17 09:16:28 +09:00
Sukchan Lee
932101b919 Merge branch 'main' into home-routed 2025-06-30 10:02:57 +09:00
Sukchan Lee
67ba7f92bb [SBI] guard against NULL http->content in parse_multipart (#3942)
In lib/sbi/message.c parse_multipart(), http->content may be NULL.
This occurs on empty-body multipart POSTs and causes a segfault.

Add guard to check http->content, log an error, and return OGS_ERROR.
2025-06-28 10:12:54 +09:00
Sukchan Lee
ca61a901d5 Implement PDU Session Release for Home-Routed Roaming and fix N4 step ordering in 4.3.4.2
- Add support for PDU Session Release in 3GPP TS 23.502 section 4.3.4.3
  Note: PCF-initiated release flow for Home-Routed Roaming is not implemented;
- Fix N4 release step ordering in 3GPP TS 23.502 section 4.3.4.2 UE or network requested PDU Session Release for Non-Roaming and Roaming with Local Breakout
2025-05-02 21:28:25 +09:00
Sukchan Lee
d66d6f868a Merge branch 'main' into home-routed 2025-04-06 18:37:36 +09:00
Sukchan Lee
46f74c8019 Merge branch 'main' into home-routed 2025-04-06 18:36:57 +09:00
Bostjan Meglic
6a2225bb68 [SBI] retrieve all currently registered NF's on app startup
Before this, there were 2 different ways to search for neighbouring
NF's:

a) in the case AMF was started _before_ UDM, AMF would create
subscription to NRF to notify it when a UDM would (un)register. In this
case, NF instance would remain in AMF's context indefinitely.

b) in the case AMF was started _after_ UDM, AMF would have to use NF
discovery mechanism to search for NF's. In this case, NF instance would
remain in AMF's context for the duration of Search's validity (defaults
to 30 seconds). After validity expires, NF would expire. This means that
for heavy traffic situations, AMF would constantly issue discovery
requests.

[SBI] save only wanted NF instances on NF List Retrieval

When retrieving a list of NF Instances from NRF, save only the NF's that
we want. Check the NF instance against our subscription list for either
the NF type or NF Service.
This can still cause a DoS on NRF when NF starts in case there are 100's
of NF's in the network, but prevents using too much memory on NF.
2025-02-20 20:13:18 +09:00
Sukchan Lee
8715915469 [UDM/UDR] Follow up on #3690 2025-02-11 07:04:42 +09:00
jmasterfunk84
600a7629ad [UDM][UDR] Add support for nssai resource in nudm-sdm (#3690)
* [UDM][UDR] Add support for nssai resource in nudm-sdm

* Resolve Memory Issue

* Protect from multiple field entries, remove macros

* remove request_from_server, make use of xact state

* typo....

* definition cleanup
2025-02-11 07:03:06 +09:00
Sukchan Lee
90afca821b Merge branch 'main' into home-routed 2025-02-09 11:15:55 +09:00
Sukchan Lee
07cb42110e [DBI] Improve YAML policy config by adding SUPI range filtering
Previously, policies were configured via YAML files without MongoDB.
This update enhances the YAML approach by adding the 'supi_range' key to
filter policies based on UE SUPI ranges. When both 'supi_range' and
'plmn_id' are provided, both conditions must be met.

Note that PLMN-ID filtering will be deprecated in a future release.
2025-02-05 21:56:15 +09:00
Sukchan Lee
3f38d66790 Merge branch 'main' into home-routed 2025-01-19 17:11:20 +09:00
Bostjan Meglic
c331207233 [all] allow value of 0 for S-NSSAI SST
3GPP TS 23.003: 28.4.2 Format of the S-NSSAI

The SST field may have standardized and non-standardized values. Values
0 to 127 belong to the standardized SST range and they are defined in
3GPP TS 23.501 [119]. Values 128 to 255 belong to the Operator-specific
range.
2025-01-11 20:22:46 +09:00
Sukchan Lee
f04497ac31 [SBI] Allow direct NRF communication in Model C by configuring delegation modes (#3399)
Introduce client_delegated_config to manage delegation settings for NRF and SCP
separately. This ensures that in Model C, all NRF-related procedures
(registration, heartbeat, deregistration, etc.) communicate directly with the
NRF without routing through the SCP. This change aligns Open5GS behavior with
3GPP standards, providing consistent direct communication for both discovery
and management in Model C, and maintaining indirect communication in Model D.

- Direct Communication with NRF
```
sbi:
  client:
    nrf:
      - uri: http://127.0.0.10:7777
```

- Indirect Communication by Delegating to SCP
```
sbi:
  client:
    scp:
      - uri: http://127.0.0.200:7777
```

- Indirect Communication without Delegation
```
sbi:
  client:
    nrf:
      - uri: http://127.0.0.10:7777
    scp:
      - uri: http://127.0.0.200:7777
    delegated:
      nrf:
        nfm: no    # Directly communicate NRF management functions
        disc: no   # Directly communicate NRF discovery
      scp:
        next: no   # Do not delegate to SCP for next-hop
```

- Indirect Communication with Delegated Discovery
```
sbi:
  client:
    nrf:
      - uri: http://127.0.0.10:7777
    scp:
      - uri: http://127.0.0.200:7777
    delegated:
      nrf:
        nfm: no    # Directly communicate NRF management functions
        disc: yes  # Delegate discovery to SCP
      scp:
        next: yes  # Delegate to SCP for next-hop communications
```

- Default delegation: all communications are delegated to the SCP
```
sbi:
  client:
    nrf:
      - uri: http://127.0.0.10:7777
    scp:
      - uri: http://127.0.0.200:7777
    # No 'delegated' section; defaults to AUTO delegation
```
2025-01-02 17:49:40 +09:00
Sukchan Lee
70c888f4c9 Merge branch 'main' into home-routed 2024-11-07 17:52:48 +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
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
Matej Gradisar
8c293bc710 [AMF] Registation status update and tests 2024-09-03 22:09:56 +09:00
Bostjan Meglic
d2e9583d77 [SMF] Handle SDM subscription to UDM during PDU session lifetime
- create SDM subscription to UDM when PDU session is created, just
before sending SMF registration to UDM
- delete SDM subscription when PDU session is released
- handle SDM Change Notification, but not yet process items in it
2024-08-16 15:51:06 +09:00
Sukchan Lee
7062b9c0d6 [AMF] Follow-up on Context transfer (#3052) 2024-05-26 14:40:11 +09:00
Matej Gradišar
e1820e4e54 UE context transfer (#3052)
* [SBI] Handle and store AMF info

* [SBI] Add "target GUAMI" discovery option

* [SBI] Handle UeContextTransfer request and response messages

* [AMF] Handle NF discovery from AMF to AMF

* [AMF] Add UE Context Transfer Request/Response from AMF to AMF

* [SCP] Handle UeContextTransfer

* Follow-up on #3052

* [AMF] force authentication after 'Ue context transfer' for now

* [AMF] force authentication after 'Ue context transfer' for now

---------

Co-authored-by: Sukchan Lee <acetcom@gmail.com>
2024-03-21 07:07:25 +09:00
Bostjan Meglic
f66c65b9cf [SBI] Fix handling "dnn" URL parameter
Split handling discovery and other URL parameters into 2 distinct sets,
to prevent bugs with overlaps.
2024-03-18 17:59:57 +09:00
Sukchan Lee
7063d853e7 [SBI] Preamble parsing issues in MIME (#3058)
When building the MIME Multipart Media Encapsulation format
within an SBI message in the NF of a third-party product,
Open5GS does not parse properly if it contains a Preamble CRLF.

For example,

```
    TCP/HTTP2
    Stream: Data, Stream ID: 1, Length 841
    MIME Multipart Media Encapsulation, Type: multipart/related, Boundary: "gc0pJq08jU534c"
--->Preamble: 0d0a
    First boundary: --gc0pJq08jU534c\r\n
    Encapsulated multipart part: (application/json)
    Boundary: \r\n--gc0pJq08jU534c\r\n
    Encapsulated multipart part: (application/vnd.3gpp.5gnas)
    Boundary: \r\n--gc0pJq08jU534c\r\n
    Encapsulated multipart part: (application/vnd.3gpp.ngap)
    Last Boundary: \r\n--gc0pJq08jU534c--\r\n
```
2024-03-17 10:36:29 +09:00
Sukchan Lee
ab1c3493c6 [NRF] Fixed crash due to invalid PATCH body (#2735) 2023-11-25 22:03:28 +09:00
Bostjan Meglic
adcdcf6426 [SBI] Change discovery option TAI from array to single item (#2725)
According to 3GPP TS 29.510, the search parameter "tai" should be a
single item, not an array of items.

TS 29.510: Table 6.2.3.2.3.1-1:
URI query parameters supported by the GET method on this resource

Revert "[SBI] Change discovery option TAI from array to single item"

This reverts commit b4beff1ae16c64b3c6d84d8bdb47c36e19b705f2.

wip
2023-11-22 20:37:06 +09:00
Bostjan Meglic
18b1095697 [SBI] Fix minor memleak when creating S-NSSAI discovery option (#2740) 2023-11-21 21:39:04 +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
Sukchan Lee
d406fbeb92 Fixed incorrect SMF selection in Multi-SMF (#2557) 2023-10-23 22:40:35 +09:00
Sukchan Lee
fc4072590e [SMF] Added SMF registrations (#2514, #2524) 2023-08-18 20:21:08 +09:00
Sukchan Lee
31f95ce2e0 [SBI] Fixed Invalid S-NSSAI format (#2337) 2023-05-28 21:53:52 +09:00
Sukchan Lee
888e58a94e [AMF] Network Deregister (#2056, #2014, #2021)
Fixed a crash on explicit network-initiated deregister
with SUBSCRIPTION_WITHDRAWN
2023-02-10 23:09:39 +09:00
Sukchan Lee
b7905725ac [SBI] HTTP/2 user-agent header (#2048)
Open5GS now checks User-AGENT only in SCP.
2023-02-05 09:50:44 +09:00
Sukchan Lee
131ecb4a44 [CORE] Add defense code to ogs_pkbuf_copy (#2032)
Added a defense code to prevent NF crash when ogs_pkbuf_copy() size is 0.
2023-01-29 16:45:42 +09:00
Sukchan Lee
f50591a8f7 Added Service-MAP to Requester-Features (#2027)
ALWAYS Added Service-MAP to Requester-Features in Discovery Option
2023-01-29 01:35:47 +09:00
Sukchan Lee
218b31d006 [CORE] Increase SDU buffer to 32k (#2008) 2023-01-24 21:43:20 +09:00
Sukchan Lee
c6fd4ae6b8 [LOG] remove ogs_expect_or_return()/return_val() 2023-01-24 00:01:36 +09:00
Sukchan Lee
a5fd315e11 [SBI] Case-Insensitive inside MIME message (#1939) 2022-12-05 21:30:24 +09:00
mitmitmitm
3870216a6b [AMF] Add support for SDM subscription and authentication deletion 2022-11-29 23:10:49 +09:00
Sukchan Lee
5ccb5f0f99 SCP(Model D) is now the default setting. 2022-10-22 11:26:04 +09:00
Bostjan Meglic
a99a76d916 [AMF,UDM] Add support to subscribe to SDM changes
AMF subscribes to UDM for each registered UE.

At the moment, UDM does not send callback to AMF when any of the UE's
properties in the database changes.
At the moment, AMF does properly parse the ModificationNotification, but
does not do anything useful.
2022-10-06 21:20:10 +09:00
Sukchan Lee
7c8722d9d4 [SBI] Client Request timeout
TS29.500
Ch 6.11 Detection and handling of late arriving requests

In Open5GS, this part was hard-corded.

HTTP2 Client sends a request and waits for 10 seconds.
If no response is received from the HTTP2 Server,
HTTP2 Client performs the exception handling.

In this commit, HTTP2 client sends Header with setting Max-Rsp-Time to 10 seconds.
However, HTTP2 server has not yet been implemented to process this value.
The server is still processing using hard-corded values (10 seconds).
2022-10-03 11:43:34 +09:00
Bostjan Meglic
9c84570a48 [SBI] Send NF discovery query with service-names delimited with comma
OpenAPI specification for sending NF discovery query with
"service-names" parameter is defined as folowing:

- name: service-names
  ...
  style: form
  explode: false

According to OpenAPI specification, this means array items
should be delimited with a comma character (example: /users?id=3,4,5).
2022-09-03 10:43:59 +09:00
Sukchan Lee
9f98d421a0 [SBI] Added config for service-names discovery 2022-08-27 10:49:07 +09:00
Sukchan Lee
f020732ce9 [SBI] Support service-names in discovery option 2022-08-27 00:12:22 +09:00
Sukchan Lee
9b10d70c77 [NRF] Fixed library load error 2022-08-26 10:57:11 +09:00
Sukchan Lee
c835556623 Fixed Defects reported by Coverity Scan 2022-08-13 23:49:55 +09:00
Sukchan Lee
9b762158a6 Refine code of discovery option param (#1671) 2022-07-24 19:47:04 +09:00
Sukchan Lee
a5010a61ef Support Discovery Optional Parameter (#1671)
To support target-nf-instance-id in the discovery,
Discovery optional parameter is implemeted
2022-07-24 15:10:09 +09:00
Sukchan Lee
5e18b2bd13 [SCP] Support of Indirect Communication 2022-07-16 13:27:18 +09:00