Commit Graph

1159 Commits

Author SHA1 Message Date
Daniel Willmann 21be2dc6be Use default APN if the one from the ESM info resp could not be found 2023-01-27 12:49:39 +01:00
Carlos Giraldo cfe21c61da
Structure AMF and MME metrics code similar to SMF (#1590)
* AMF metrics initial support

* MME metrics initial support

* set amf/mme metrics.[c|h] similar to smf
2022-06-09 21:39:03 +09:00
Carlos Giraldo 109949d335
MME initial metrics support (#1587) 2022-06-09 06:23:51 +09:00
Sukchan Lee afc562f7d5 [MME] refine Pull Request (#1497) 2022-05-15 22:37:38 +09:00
Sukchan Lee 478723203f Merge branch 'sctp_crash_upstream' of https://github.com/althea-net/open5gs into althea-net-sctp_crash_upstream 2022-05-15 22:22:01 +09:00
Sukchan Lee 4d2f7726b9 X2 handover with SGW change (#1367, #1459) 2022-05-12 22:52:36 +09:00
Sukchan Lee de2ecd6400 [GTP2] Fixed handling multi-bearer messages(#1498) 2022-04-29 21:28:16 +09:00
Spencer Sevilla 23ef30553e initial draft of sctp crash fix 2022-04-18 11:56:43 -07:00
Sukchan Lee 433d5f6bf3 Distinguish the type of session creation 2022-04-14 17:34:55 +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
Supreeth Herle 8c22d8a20c
Send EMM Cause when Attach Request type is not same as HSS Network-Access-Mode (#1484)
This commit adds EMM Cause to Attach accept message when
Attach Request has COMBINED EPS IMSI ATTACH but the HSS
Network-Access-Mode is configure for EPS ONLY.
2022-04-13 07:06:49 +09:00
Sukchan Lee 41553de7a4 [MME] Exception handle - APN duplicated (#1431) 2022-03-24 21:52:42 +09:00
Sukchan Lee 37af21a88d [MEM] fix the pkbuf problem (#1431) 2022-03-22 22:47:45 +09:00
Sukchan Lee bf77318602 [MME] re-factor to check a piggybacked ESM (#1431) 2022-03-16 20:48:48 +09:00
Sukchan Lee bcf53124d5 Improve the socket option configuration (#1404)
o GTP-C Option (Default)
  - so_bindtodevice : NULL

  gtpc:
    addr: 127.0.0.7
    option:
      so_bindtodevice: vrf-blue

o GTP-U Option (Default)
  - so_bindtodevice : NULL

  gtpu:
    addr: 127.0.0.7
    option:
      so_bindtodevice: vrf-blue

o PFCP Option (Default)
  - so_bindtodevice : NULL

  pfcp:
    addr: 127.0.0.7
    option:
      so_bindtodevice: vrf-blue

o SBI Option (Default)
  - tcp_nodelay : true
  - so_linger.l_onoff : false

  sbi:
    addr: 127.0.0.10
    option:
      tcp_nodelay: false
      so_linger:
        l_onoff: true
        l_linger: 10

o NGAP Option (Default)
  - sctp_nodelay : true
  - so_linger.l_onoff : false
ngap:
  addr: 127.0.0.5
  option:
    stcp_nodelay: false
    so_linger:
      l_onoff: true
      l_linger: 10

o NGAP SCTP Option (Default)
  - spp_hbinterval : 5000 (5secs)
  - spp_sackdelay : 200 (200ms)
  - srto_initial : 3000 (3secs)
  - srto_min : 1000 (1sec)
  - srto_max : 5000 (5secs)
  - sinit_num_ostreams : 30
  - sinit_max_instreams : 65535
  - sinit_max_attempts : 4
  - sinit_max_init_timeo : 8000(8secs)
ngap:
  addr: 127.0.0.5
  option:
    sctp:
      spp_hbinterval : 5000
      spp_sackdelay : 200
      srto_initial : 3000
      srto_min : 1000
      srto_max : 5000
      sinit_num_ostreams : 30
      sinit_max_instreams : 65535
      sinit_max_attempts : 4
      sinit_max_init_timeo : 8000
2022-03-15 22:03:50 +09:00
Sukchan Lee a1be48ed50 [SGW-C] fix the crash (#1353) 2022-03-05 11:27:22 +09:00
Sukchan Lee 896370c2e4 [MME] Oops! Remove redundant warning (#1411) 2022-03-04 23:49:45 +09:00
Pau Espin d06acc7f37
Fix trailing whitespace (#1402) 2022-03-01 17:13:40 +09:00
Sukchan Lee af3db1770f [SMF] incorrect GTP cause with changed APN (#1360)
SMF setting incorrect Cause when answering
with a changed APN type IPv4v6 ->IPv4/IPv6
2022-02-23 20:16:04 +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 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 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 866ae78f5e [NRF] fix the crash for invalid FQDN (#1333) 2022-01-22 09:34:38 +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 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 6f62839ad3 [MME] apply coding convention (#1295)
- limit 80 column
- Use space instead of tab
2021-12-20 23:25:04 +09:00
EugeneBogush ead9f380a9
update s1ap_handle_e_rab_setup_response (#1295)
* Update s1ap-handler.c

* Update s1ap-handler.c

* update for parse e_rab_setup_response

* Update s1ap-handler.c

* Update s1ap-handler.c

* Update s1ap-handler.c
2021-12-20 23:21:29 +09:00
Kenny Barlee d02507e90a
print cellID in hex for consistency (#1292) 2021-12-17 11:37:36 +09:00
Sukchan Lee 74bbc6ecbf [MME] Add S1AP debug (#1263) 2021-12-11 17:28:05 +09:00
Kenny Barlee 1a691e1d4a
change reject cause to 11 (#1281) 2021-12-08 20:57:54 +09:00
Sukchan Lee 561f1ac2f3 This always true. So I fixed it (#1266) 2021-12-08 20:56:26 +09:00
Sukchan Lee aab8286401 [MME] fix the crash issue if enb_ue is NULL(#1275)
An assert occurs when a NAS message retransmission occurs.

Because there is no `enb_ue` context.

Therefore, before removing enb_ue, all Timers must be stopped
to prevent retransmission of NAS messages.
2021-12-04 10:53:49 +09:00
Sukchan Lee 6ae9ecc697 [MME] check PDN mismatch (#1263)
if PDN mismatched between UE and HSS, PDN connectivitiy reject message
will be sent to eNB.
2021-12-02 22:40:47 +09:00
Sukchan Lee 448e07d5a9 [AMF/MME] fix the crash during reset (#1268) 2021-11-30 22:22:41 +09:00
Sukchan Lee 00a296a1de update log message (#1266)
1. rollback ogs_error() to ogs_warn()
To remove the print-out in the test code,
8/13 open5gs:epc / attach                    OK      10.60 s
bearer-test         : SUCCESS
session-test        : /11/30 15:59:34.556: [esm] ERROR: Invalid APN[ims2] (../src/mme/esm-handler.c:71)
SUCCESS

2. if( to if (
Coding standard in open5gs
2021-11-30 16:01:37 +09:00
EugeneBogush 4f8c34c7aa
Update esm-handler.c (#1266)
added more log info in case problem with APN
2021-11-30 15:52:20 +09:00
Sukchan Lee d8655e07c6 Oops! fix the mistake in previous commit (83aac49) 2021-11-28 17:54:33 +09:00
Sukchan Lee 83aac49fd0 [MME] Add log (#1263) 2021-11-28 17:05:31 +09:00
Sukchan Lee 6a6f214785 [AMF/MME] stop timer when radio failure (#1242) 2021-11-16 12:59:04 +09:00
Sukchan Lee bfa34be222 fix the buffer overflow (CVE-2021-41794) 2021-11-15 15:49:58 +09:00
Sukchan Lee 0ea2142ba6 [MME] fix the crash bug (#1205)
If UE is in Authentication-EMM State and eNB is disconnected,
MME could be crashed.
2021-11-06 22:39:09 +09:00
Sukchan Lee 9ba4b317d2 Improve GTP message (#1201)
Extended Indication
Add Delay Value
2021-10-16 17:26:30 +09:00
Sukchan Lee b35febd9c4 [MME] fix the crash during GTP no context (#1205)
This bug occurs when SGW-C restarts and the next signal occurs
between MME and SGW-C
- Create Session Request/Response
- Modify Bearer Request/Response
2021-10-16 14:11:43 +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 ab7f565dd6 [MME/AMF] Use Non-UE signalling in Paging (#1134) 2021-08-18 19:42:27 +09:00
Sukchan Lee 3564fe5c8c [SMF/UPF] Clarify FALLBACK SUBNET [#1128] 2021-08-14 16:52:53 +09:00
Sukchan Lee af5b3aa931 [MME/AMF] fix the crash during timeout (#1122) 2021-08-08 12:38:15 +09:00
Sukchan Lee 1326fc85dc [MME] fix the bug when GTPv2 conflict (#1095) 2021-07-15 21:20:56 +09:00
Sukchan Lee 50f403279a [AMF/MME] fix the crash bug (#1061) 2021-06-22 16:13:06 +09:00