182 Commits

Author SHA1 Message Date
Sukchan Lee
94cf8ee0e0 [HR] Implement handling of UE-initiated PDU Session Modification (#2194)
This commit consolidates the entire ue-mod feature branch
into a single update on top of the latest home-routed code.
2025-06-30 10:07:06 +09:00
Sukchan Lee
f0005164a2 Merge branch 'main' into home-routed 2025-06-01 16:54:26 +09:00
Matej Gradišar
799103257b [AMF] Fix UE context transfer when only NRF is client (#3880)
* [AMF] Fix UE context transfer when only NRF is client

If UE context transfer is initiated and the new AMF does not get the
old AMF from NRF or no UE context is retrieved from the old AMF,
we do not want to reject UE registration. Send identity request instead.
Test "transfer-error-case" is added into the commit.

* [tests] Unite tests for UE context transfer

All tests for UE context transfer with different configs are placed
into test folder transfer.

* [tests] Make two binaries for UE context transfer tests

For each test config a different test binary is created.
2025-05-31 20:51:06 +09:00
Sukchan Lee
ae4d8433eb [HR] Implement Network-Initiated PDU Session Modification (Home-Routed Roaming) (#2194)
This commit adds support for processing network-initiated PDU Session
Modification in a home-routed roaming context, following section 4.3.3.3
of the specification.
2025-05-31 15:44:44 +09:00
Sukchan Lee
46f74c8019 Merge branch 'main' into home-routed 2025-04-06 18:36:57 +09:00
Sukchan Lee
1abc3b6d5f [SMF] Separate EPC-only attach config to avoid NRF register timeout
Previously, sample.yaml was used for both 5GC and EPC attach tests.
Because SMF had SBI configured, it sent a register PUT to NRF even in
EPC-only tests (where nrf/scp was not run), leading to a missing HTTP
response and connection timer expiry.

Now, attach.yaml is used for EPC, preventing the unwanted NRF registration.
2025-03-10 09:53:00 +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
Sukchan Lee
fce22ca069 Fix the example configuration for AMF-TLS 2025-01-02 22:08:38 +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
be5a7e1ded [SBI] Added support for custom port numbers in SBI configuration with FQDN.(#3385)
This update allows the parsing and handling of user-defined port numbers
in the `advertise` field or explicitly in the `server` configuration for
SBI. Users can now specify non-default ports for both binding and
advertising while maintaining compatibility with existing configurations.
The feature includes logic to handle FQDNs with embedded port numbers
(e.g., `example.com:8080`) and ensures proper memory management during
parsing. Updated the client association logic to utilize custom ports
when specified.

Examples:
- Bind to the address on the eth0 and advertise as open5gs-amf.svc.local
```
  sbi:
    server:
      - dev:eth0
        advertise: open5gs-amf.svc.local
```

- Specify a custom port number 7777 while binding to the given address
```
  sbi:
    server:
      - address: amf.localdomain
        port: 7777
```

- Bind to 127.0.0.5 and advertise as open5gs-amf.svc.local
```
  sbi:
    server:
      - address: 127.0.0.5
        port: 7777
        advertise: open5gs-amf.svc.local
```

- Bind to port 7777 but advertise with a different port number 8888
```
  sbi:
    server:
      - address: 127.0.0.5
        port: 7777
        advertise: open5gs-amf.svc.local:8888
```
2024-12-31 22:04:55 +09:00
Sukchan Lee
3f6f2a8846 [SBI] Enable SSL Key Logging for Enhanced Debugging and Analysis (#3647)
- Add `sslkeylogfile` configuration options to `*.yaml.in` in NFs.
- Update `open5gs-common.dirs` to include `var/log/open5gs/tls` directory
- Extend `ogs_sbi_context_s` structure in `context.h` to include `sslkeylog`
- Modify `context.c` to parse and handle `sslkeylogfile` settings
- Update `server.c` and `server.h` to manage the `sslkeylog` field
  in server structures
- Update `ogs_sbi_client_add` and `ogs_sbi_client_remove` functions to handle
  `sslkeylog` field.
- Adjust `meson.build` to create the TLS log directory during installation

This commit introduces SSL key logging functionality to Open5GS,
enabling the capture of SSL/TLS keys. This feature is essential
for debugging encrypted traffic and allows integration with tools
like Wireshark for decrypting TLS sessions.
2024-12-30 21:21:41 +09:00
Sukchan Lee
b0bfd35c63 [SCTP] Support setting local address (#3344)
Added support for binding to local IP addresses in ogs_sctp_client and
ogs_sctp_server, and correct SGsAP configuration

Implemented the ability to bind to one or multiple local IP addresses using
`sctp_bindx()` in both the `ogs_sctp_client()` and `ogs_sctp_server()` APIs.

Users can now specify local addresses in the configuration files under the new
`local_addresses` field, reducing unnecessary complexity and signaling caused
by binding to `ANY_ADDR`.

This update addresses issue https://osmocom.org/issues/6509 by ensuring
correct operation in multi-interface and complex networking setups.

Additionally, corrected the `sgsap` configuration by changing it
from `server` to `client`, and added support for specifying `local_addresses`
for local binding as follows:

```
sgsap:
  client:
    - address: msc.open5gs.org # SCTP server address configured on the MSC/VL
      local_address: 127.0.0.2 # SCTP local IP addresses to be bound in the M
```
2024-12-23 21:16:15 +09:00
nick
1c2098bf71 fix indentation issue in srsenb.yaml and rename srslte.yaml to srsenb.yaml in guide02 docs 2024-11-19 08:43:16 +09:00
Sukchan Lee
70c888f4c9 Merge branch 'main' into home-routed 2024-11-07 17:52:48 +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
Sukchan Lee
778d0cbc59 [PCRF/HSS] Enable Metrics (#3442) 2024-09-05 21:26:27 +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
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
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
Sukchan Lee
90475696f6 [HR] Configuration Update (#2194)
Fixed SMF/NSSF configuration to use FQDNs for Home Routed Roaming.
2024-08-12 15:19:42 +09:00
Pau Espin Pedrol
c0a520f32a systemd: network: Add explicit routes towards tundev for UE pool of addresses
When running the open5gs package with systemd network config, the 1st IP address
of the UE pool configured in open5gs-upfd config file for ogstun is
being assigned to the interface through this file.
That was discussed as being a desirable default setup.

However, in the event a user wants a setup where no IP address is
assigned to the tundev, then it's not enough removing the IP address,
because then the implicit routing rules regarding the subnet of the IP
address added automatically by the kernel are also removed.

This patch adds config sections to set up the routing explicitly, with
the aim to get the routing still applied if the user decides to comment
out the IP address, so that packets are still forwarded properly in that
case.

Related: https://osmocom.org/issues/6361
2024-04-19 08:32:19 +09:00
Oliver Smith
8abd35580b configs, docs: adjust to logger config change 2024-04-18 21:08:35 +09:00
Sukchan Lee
f960047ccb [SMF/UPF] Follow-up on Pull #3137 (Issues #2975) 2024-04-14 09:19:07 +09:00
Sukchan Lee
a6830b30a0 [SMF/UPF] Changes subnet configuration (#2975)
The way subnet is set up has changed as shown below.

```
<OLD Format>
smf:
  session:
    - subnet: 10.45.0.1/16

<NEW Format>
smf:
  session:
    - subnet: 10.45.0.0/16
      gateway: 10.45.0.1
```

For more information, please refer to Pull Request #2975.
2024-04-13 19:31:19 +09:00
Oliver Smith
be7d08bffc logrotate: fix reload failures
Do not attempt to run "systemctl reload" on the open5gs services, unless
they are running. This fixes the logrotate service failing on this
postrotate script, if units are not running or not installed.
2024-03-27 20:37:36 +09:00
Sukchan Lee
dcaccb4105 Added open5gs-sepp in debian package 2023-12-17 10:22:39 +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
Šimon Lukašík
7a98baf627 Typo fix in systemd open5gs-scpd.service 2023-10-24 07:15:31 +09:00
Sukchan Lee
d33d67b2af [AMF/MME] Defaults 9 minutes for T3412/T3512 2023-08-13 11:16:06 +09:00
Pau Espin Pedrol
e222557f88 [MME] rework sgsn default route config in mme.yaml
Move the config to the sgsn node instead of having a specific route with
specific format "default: route", since anyway internally it's already
applied to the sgsn object.
2023-07-20 06:29:20 +09:00
Sukchan Lee
64a35611d8 [MME] Temporarily disable sgsn settings (#2441) 2023-07-19 21:54:14 +09:00
Pau Espin Pedrol
84ed735204 mme: Introduce initial Gn iface (GTPv1C) support
This interface allows supporting several inter-RAT mobility features
towards pre-rel8-SGSNs (SGSNs without S3/S4 GTPV2C interface).

Related specs:
- 3GPP TS 23.401:
-- "5.6 Network Assisted Cell Change"
-- "5.15 RAN Information Management (RIM) procedures"
--  "Annex D"
- 3GPP TS 23.060 (general GERAN<->GERAN mobility)
- 3GPP TS 29.060
2023-07-15 23:44:57 +09:00
Sukchan Lee
63df530bb4 [SBI] Fixed a bug with encoder/decoder of scpPorts
(#2310, #2274)
2023-05-14 07:05:23 +09:00
Shigeru Ishida
0c3fd10c24 [MME] add facility to select smf(pgwu) by tac and e_cell_id.
[mme.yaml]
# o SMF selection by eNodeB TAC
#   (either single TAC or multiple TACs, DECIMAL representation)
#
#   gtpc:
#     - addr: 127.0.0.4
#       tac: 26000
#     - addr: 127.0.2.4
#       tac: [25000, 27000, 28000]
#
# o SMF selection by e_cell_id(28bit)
#   (either single or multiple e_cell_id, HEX representation)
#
#   gtpc:
#     - addr: 127.0.0.4
#       e_cell_id: abcde01
#     - addr: 127.0.2.4
#       e_cell_id: [12345, a9413, 98765]
2023-05-05 10:23:46 +05:00
Sukchan Lee
d469809192 [AMF/MME] PLMN access control
These mechanisms are described in the GSMA roaming guidelines.
Chapters called Access Control.

For 4g: https://www.gsma.com/newsroom/wp-content/uploads//IR.88-v21.0.pdf
For 5g: https://www.gsma.com/newsroom/wp-content/uploads//NG.113-v6.0.pdf
2023-03-25 09:59:20 +09:00
Sukchan Lee
7e1848f5de [SMF] Remove PFCP RR selection (#2186)
Missing to remove PFCP RR setting when setting is modified in #953.
2023-03-24 15:56:46 +09:00
Sukchan Lee
424f382265 [AMF/MME] Support TAI Range 2023-03-19 18:31:45 +09:00
Sukchan Lee
cf0a94f369 [BSF] Removed MongoDB in BSF configuration file 2023-03-11 18:52:26 +09:00
mitmitmitm
1d8324af9f [PFCP] Support pfcp advertise address 2023-02-24 20:53:28 +09:00
Sukchan Lee
0df402bd49 [SBI] Move HNET PKI conf inside UDM 2023-02-18 12:41:08 +09:00
Sukchan Lee
05fbaf6958 [SBI] HTTP2-TLS verification - ConfFile Changed
You should add the following configuration if you would not use TLS.

sbi:
    server:
      no_tls: true
    client:
      no_tls: true
2023-02-18 10:58:29 +09:00
jmasterfunk84
1e6b1d4f7b [MME] Implicit Network-initiated Deregistration (#2013)
* [MME] Introduce aging timers

* Creating three new timers
* mirroring work done by gstaa on the AMF
* Implicit detach procedures added
* Fix for detach from unknown UE

* no Purge Timer, no config, expanded code
2023-01-26 21:22:17 +09:00
Sukchan Lee
8373d0e331 SIDF only required in UDM, not AUSF (#1779) 2022-12-25 20:12:26 +09:00
Sukchan Lee
79d46be086 Introduced Subscription identifier de-concealing
o Generate the private key as below.
   $ openssl genpkey -algorithm X25519 -out /etc/open5gs/hnet/curve25519-1.key
   $ openssl ecparam -name prime256v1 -genkey -conv_form compressed -out /etc/open5gs/hnet/secp256r1-2.key

 o The private and public keys can be viewed with the command.
   The public key is used when creating the SIM.
   $ openssl pkey -in /etc/open5gs/hnet/curve25519-1.key -text
   $ openssl ec -in /etc/open5gs/hnet/secp256r1-2.key -conv_form compressed -text

In ausf/udm.yaml

 hnet:
    o Home network public key identifier(PKI) value : 1
      Protection scheme identifier : ECIES scheme profile A
    - id: 1
      scheme: 1
      key: /etc/open5gs/hnet/curve25519-1.key

    o Home network public key identifier(PKI) value : 2
      Protection scheme identifier : ECIES scheme profile B
    - id: 2
      scheme: 2
      key: /etc/open5gs/hnet/secp256r1-2.key

    o Home network public key identifier(PKI) value : 3
      Protection scheme identifier : ECIES scheme profile A
    - id: 3
      scheme: 1
      key: /etc/open5gs/hnet/curve25519-1.key

    o Home network public key identifier(PKI) value : 4
      Protection scheme identifier : ECIES scheme profile B
    - id: 4
      scheme: 2
      key: /etc/open5gs/hnet/secp256r1-2.key

Related to #1779
2022-12-24 20:22:45 +09:00
Sukchan Lee
13fd9afbd1 Update document 2022-12-11 11:55:31 +09:00
Sukchan Lee
fbd9ada101 Follow-up on #1940 2022-12-06 22:59:06 +09:00
Gaber Stare
0c2a3b0f39 [PCF] Add metrics support
Expose metrics with labels according to ETSI TS 128 552 V16.13.0 in
PCF by using hash.

The metrics are named respecting the rule:
<generation>_<measurement_object_class>_<measurement_family_name>_<metric_name_as_in_TS_128_552>

Since slice itself is not unique, the plmnid label is exposed in
addition to snssai.

AM policy:
fivegs_pcffunction_pa_policyamassoreq and
fivegs_pcffunction_pa_policyamassosucc do not expose snssai label
since it is not available at the time of exposure.
plmnid is defined during AM policy processing, so not to lose the
difference to ...succ, the basic metric
fivegs_pcffunction_pa_policyamassoreq is preserved.

SM policy:
snssai is defined during SM policy processing, so not to lose the
difference to ...succ, the basic metric
fivegs_pcffunction_pa_policysmassoreq is preserved.

Those 2 basic metrics retain their position but are exposed with empty
labels.
Metrics with labels are called later, when the label values are known.

Exposed metrics example:
-standard counters:
fivegs_pcffunction_pa_policyamassoreq{plmnid=""} 3
fivegs_pcffunction_pa_policyamassoreq{plmnid="99970"} 3
fivegs_pcffunction_pa_policyamassosucc{plmnid="99970"} 3
fivegs_pcffunction_pa_policysmassoreq{plmnid="",snssai=""} 3
fivegs_pcffunction_pa_policysmassoreq{plmnid="99970",snssai="1000009"} 3
fivegs_pcffunction_pa_policysmassosucc{plmnid="99970",snssai="1000009"} 3

-nonstandard gauge (added for controlling purposes -
same metric as existing metric on AMF and SMF):
fivegs_pcffunction_pa_sessionnbr{plmnid="99970",snssai="1000009"} 0
2022-12-06 22:57:24 +09:00