Commit Graph

3605 Commits

Author SHA1 Message Date
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
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 137ed99dd5
[GTPv1C] Send conditional IE Reordering Required in CreatePDPCtxResp (#1374)
It seems to be actually mandatory in GGSN->SGN directon, though it is
ignored in Release99 upwards. Let's hardcode it to 0 for now, should be
fine in the majority of cases.
2022-02-19 06:36:54 +09:00
Pau Espin f7999a2cad
[GTPv1C] Fix outer message length field containing wrong value (#1373)
The mandatory part of the header must be excluded from the header, that
is flags(1)+type(1)+length(2)+teid(4) = 8 bytes.
2022-02-19 06:36:40 +09:00
Pau Espin 2056a5b500
[PCRF] Fix trailing whitespace (#1372) 2022-02-19 06:33:46 +09:00
Pau Espin 8b1bdf42a2
[SMF] Fix adding 2 IP addresses to one GSN Address IE (#1371)
In the event we have 2 local IP addresses available for use, put the one
having same IP version in "GGSN Address *" IE, and the one with the
other IP version in "Alternative GGSN Address *" IE.
2022-02-19 06:33:19 +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 3eab4be135 fix MacOSX compile error (#1354, #1355) 2022-02-18 22:00:57 +09:00
Matthew Johnson 7df65e832e
Relax systemd requirements (#1368)
* [configs] Remove requires systemd-networkd dep from smfd service

The smf no longer has (never had?) a dependency on systemd-networkd,
and can start and remain operational without systemd-networkd
specifically running.

* [configs] Relax upf dependency on systemd-networkd

The upf relies on systemd-networkd to create the ogstun interface, but
does not communicate with it at runtime. It currently has a "Requires"
dependency specified, which means that the upf will be stopped if
systemd-networkd is ever stopped. Since the upf doesn't actually care
if systemd-networkd is later stopped after ogstun is created, it can
use the weaker "Wants" dependency type, which allows it to keep
running even if systemd-networkd were to be stopped.

Regardless, since it does rely on systemd-networkd specifically to
create the ogstun interface, it should sequence itself "After"
systemd-networkd has been started.

Since the true dependency is ogstun, not systemd-networkd, a cleaner
approach would depend on the specific tunnel device being
available. Systemd exposes this information via device units, but I'm
not sure if they are always consistently named across platforms.
2022-02-16 17:56:14 +09:00
Matthew Johnson c0ffe1ffe4
Systemd sequencing (#1366)
* [configs] Do not require ogstun for system online

Systemd-networkd will wait for all managed interfaces to be configured
before determining the system is online. Since the ogstun and upf are
more logically an application rather than a system networking service,
don't wait for them to be configured by default.

This breaks the circular dependency between the userspace cellular
core network services and the system's network, which will allow the
cellular core network services to sequence themselves cleanly after
the system's network is up and configured.

* [configs] Sequence network-dependent units after network-online

Since open5gs targets platforms with both ifupdown (debian) and
systemd-networkd (Ubuntu) as core networking providers, this commit
sequences network-dependent core network components after the generic
network-online.target instead of one of the specific provider
targets. This allows the core network to operate correctly with both
systemd-networkd and ifupdown (networking), and fixes the issue
observed in https://github.com/open5gs/open5gs/issues/826 where some
platforms may fail to start cleanly.
2022-02-15 22:33:33 +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 906e7c5046 [UPF] Consider RS message for IP spoofing (#1354) 2022-02-14 20:07:08 +09:00
Sukchan Lee 0e1ab26ee5 Check if Source IP address spoofing (#1354, #1355) 2022-02-14 17:34:22 +09:00
Sukchan Lee 6e30f97097 Fixed typo in Airspan gNodeB 2022-02-13 20:19:21 +09:00
Sukchan Lee 4145b8b543 Added Airpsan 5G commercial gNodeB to the tested 2022-02-12 14:43:14 +09:00
Sukchan Lee ffcd92c2f3 [SBI] Remove Accept-Encoding in HTTP client 2022-02-12 14:40:48 +09:00
Sukchan Lee 900e888dc1 [SBI] fix crash when no mandatory item (#1350)
NRF crashed if NFService does not have a versions.
Versions are mandatory, we've modified the SBI interface for the safety.
2022-02-05 20:20:45 +09:00
Sukchan Lee acfcbda8fa [PFCP] remove be32toh() in TLV u32 leaf (#1349) 2022-02-04 00:26:27 +09:00
Pau Espin 5fff69306f
logging improvements (#1348)
* [SMF] Fix typo in debug message

* [SMF] Add debug messages to follow messages received in N4
2022-02-02 23:23:12 +09:00
Sukchan Lee 9b7ebf9927 Update document 2022-02-01 15:17:04 +09:00
Sukchan Lee 4018833b3a Relase v2.4.4 2022-02-01 15:07:24 +09:00
Sukchan Lee 8bc584ce80 [CX] Update test code 2022-02-01 14:51:54 +09:00
Sukchan Lee a7d164c28d [NRF] fix the crash (#1347)
`reqNfInstanceId` is optional in the Subscription.
So, we need to consider it.
2022-01-31 23:19:26 +09:00
Sukchan Lee 83d56fe40d [ALL] Fix the memory leak (#1282) 2022-01-31 22:58:52 +09:00
Sukchan Lee 340b23af94 [SMF] Fixed case without transportLayerAddr(#1341)
Fixed the crash if TransportLayerAddress in GTPTunnel does not exist
2022-01-26 08:09:26 +09:00
Sukchan Lee 3b275edec7 [SBI] Remove one octet length in FQDN (#1333) 2022-01-23 13:49:03 +09:00
Sukchan Lee 866ae78f5e [NRF] fix the crash for invalid FQDN (#1333) 2022-01-22 09:34:38 +09:00
Pau Espin 68407efa16
[CORE] tlv_test: Fix trailing whitespace (#1337) 2022-01-22 06:44:08 +09:00
Pau Espin c071bf3c6d
[CORE]: tlv: Fix trailing whitespace (#1334) 2022-01-21 21:41:36 +09:00
Sukchan Lee 23647f643b [FQDN] fix the fqdn_parse bug (#1335) 2022-01-21 21:32:35 +09:00
Sukchan Lee 99d03f9d03 Document release v2.4.3 2022-01-20 17:22:10 +09:00
Sukchan Lee 9215b69ee1 Release v2.4.3 2022-01-20 17:12:51 +09:00
Sukchan Lee 0ff9c3e297 Update document srsRAN (#1326, #1322) 2022-01-19 21:39:37 +09:00
Sukchan Lee 776892e09d [PFCP] xact: avoid exporting internal (#1329) 2022-01-19 20:03:28 +09:00
Pau Espin ed3a3a527a
[GTP] xact: Avoid exporting internally used functions (#1329)
* [GTP] xact: Fix trailing whitespace

* [GTP] xact: Avoid exporting internally used functions

This simplifies the API header hiding unneeded APIs from external
components, and lets the compiler further optimize by
marking the functions as static.

* [GTP] xact: Drop unused API ogs_gtp_xact_find

After making it static, it became clear to the compiler that this
function is not used anywhere, warning about it. Let's drop it.
2022-01-19 19:54:44 +09:00
Sukchan Lee 8955fdcd5d [SBI] FQDN bug from talloc (#1328) 2022-01-19 17:10:39 +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 79239d8eff [IMPORTANT] changed network_access_mode: 0 (#1323)
The network access mode of HSS has been changed to 0 (Packet and Circuit).

Versions of MME prior to v2.4.2 did not use this value. Open5GS set
the attach result of Attach Complete message as it is by looking
at the attach type of the Attach Request message.

Now, if the network access mode of HSS is set to 2 (Only Packet),
this value is affected by MME from v2.4.3. Regardless of the attach type
of the Attach Request, the MME will set EPS Only to the attach result
of Attach Complete.
2022-01-16 12:35:55 +09:00
Sukchan Lee 522e835101 Update document v2.4.2 2022-01-14 21:03:27 +09:00
Sukchan Lee 13dbdb1b18 Release v2.4.2 2022-01-14 20:46:44 +09:00
Sukchan Lee e4f864c1f5 Change IPv6 Prefix (#1321) 2022-01-14 11:53:15 +09:00
Julian Lemmerich f75e51ca46
changed default ipv6 prefix to 2001:db8:cafe:: (#1321)
to be compliant with RFC3849
2022-01-14 11:50:27 +09:00
Sukchan Lee ea6675879c [ALL] GNB/NF Memory pool from 32 to 64 2022-01-13 17:55:36 +09:00
Sukchan Lee fdddeaca98 [S6A] Change PUR-Flags to Optional (#1298) 2022-01-13 17:53:54 +09:00
Sukchan Lee bbd1412a9e [SMF] change log-level from WARN to ERR (#1313) 2022-01-12 20:06:26 +09:00
Sukchan Lee cfd0193bbd [PCRF] fix the crash in flow->description (#1313) 2022-01-12 10:15:36 +09:00
Sukchan Lee 2ed35f245d Fix the ciphered test program 2022-01-08 12:26:23 +09:00
Sukchan Lee 070cdbc657 [ALL] fix the epoll(map) crash (#1311) 2022-01-06 22:28:24 +09:00
Sukchan Lee 715e4c0b50 Shall cipher in the NAS message container IE
3GPP TS 24.501 version 16.6.0 Release 16
4.4 NAS security
4.4.6 Protection of initial NAS signalling messages

1) the UE needs to send non-cleartext IEs in a REGISTRATION REQUEST
or SERVICE REQUEST message, the UE includes the entire REGISTRATION
REQUEST or SERVICE REQUEST message (i.e. containing both cleartext IEs
and non-cleartext IEs) in the NAS message container IE and shall cipher
the value part of the NAS message container IE. The UE shall then send
a REGISTRATION REQUEST or SERVICE REQUEST message containing
the cleartext IEs and the NAS message container IE;
2022-01-05 22:39:06 +09:00
Sukchan Lee 5e5a61b982 Update document for v2.4.1 2022-01-04 17:58:47 +09:00