Commit Graph
120 Commits
Author SHA1 Message Date
Robert Schmidt 859494112a Merge remote-tracking branch 'origin/e1ap-lib-improvements' into integration_2025_w06 (!3219)
E1AP enc/dec lib improvements

This MR is including some fixes and improvements for the E1AP library,
focusing mostly on Bearer Context Management:

- struct reorganization: split setup and modification request messages
  into distinct structures, ensuring compliance with 3GPP TS 38.463
  specifications
- add encoding/decoding sub-functions for different IEs
- improvements to Bearer Context Management: Implemented various
  improvements to the E1 Bearer Context Setup Response and Request,
  including the adoption of encoding/decoding sub-functions for
  different IEs
- use lib functions whenever need (e.g. cp_bearer_context_setup_request
  in cucp_cuup_e1ap.c)
- handle optional struct members as pointers
- updated copy/equality check utility functions

EDIT: The MR is also including the changes from !3222 (closed):

> While testing E1 with security enabled for DRBs, it was found that
> data traffic was not functional.
>
> The problem was that security settings were modified in the PDCP
> reestablishment happening when receiving Bearer Context Modification
> Request.
>
> So some restructuring was done.
>
> The actual fix is in 18176297, the others are for support. Basically
> we introduce a boolean to check if the security settings are present in
> Bearer Context Modification Request and we change PDCP security settings
> only if they are.
>
> (Note that in OAI CU security settings are not sent in Bearer Context
> Modification Request, so we could also remove all this, but we need to
> be compatible with other cu-up and/or cu-cp.)
2025-02-11 17:53:40 +01:00
Cedric Roux 182b05bd5c e1: security information is optional in bearer modification
Check if the IE is memory allocated to deal with presence/absence of this information
element in Bearer Context Modification Request and add encoding/decoding
in the code.

Note that for decoding the integrity settings may be absent, in which
case we consider NIA0 to be used (no integrity protection). To be refined
if needed.

And for encoding, we always encode integrity settings, even if it's NIA0.
May also be refined if needed.
2025-02-11 14:04:32 +01:00
Guido Casati 627f8171ec Add test for Bearer Context Modification Request 2025-02-11 14:04:19 +01:00
Guido Casati b854f97130 Enable pDCP_Reestablishment in test_bearer_context_setup_request 2025-02-11 13:15:01 +01:00
Guido Casati b061b57698 Add Bearer Context Modification Request enc/dec lib 2025-02-11 13:10:21 +01:00
Guido Casati cd7218c976 Improvements to E1 Bearer Context Setup Request/Response
* Add enc/dec/cp/eq sub-functions to E1 library and adopt in stack
  * eq_drb_to_mod
  * encode_dl_up_parameters
  * decode_dl_up_parameters
  * e1_decode_snssai
  * e1_encode_snssai
  * eq_security_ind
* Check result of enc/dec functions in Bearer Context Setup enc/dec libs
2025-02-11 13:10:21 +01:00
Guido Casati 1ef24796f9 Add compile definitions E1AP_LOG_ERRORS
* this is necessary to enable the error logs in the E1 libs
* also, updated the define name in the E1AP lib
2025-02-11 13:10:21 +01:00
Guido Casati 2146f29c44 Refactor E1 Bearer Context Management structs
Bearer context setup request and modification request messages
differ in various IEs according to 9.2.2 of 3GPP TS 38.463, e.g.
the Bearer context setup request does not contain a list of
DRBs to modify and does not contain an UP TL configuration.

Thus, the goal of this commit is to split the setup request message
and the modification request into two different structs:
* adopt e1ap_bearer_mod_req_t where necessary (e.g. fill_e1_bearer_modif)

Also, reorganized existing struct members according to specs:
* remove irrelevant struct members from the setup request
* group members from the same IEs into structs
* set optional struct members IEs as pointers
* add and adopt enc/dec/cp/eq lib functions for single IEs
* add UP_TL_information_t struct with TEID and TL address info and adopt in stack
* use int instead of long for count types
* update the relevant copy/equality check utility functions

Extra:
* add a function to handle Security Information in RRC in the process
* add create_up_tl_info and adopt in unit tests
2025-02-11 13:10:21 +01:00
Guido Casati 4f613ab2af Remove incomplete activityNotificationLevel handling 2025-02-11 13:10:21 +01:00
Guido Casati b862963a95 Add macro to check result of dec lib functions and return with a failure 2025-02-11 13:09:50 +01:00
Robert Schmidt deba3ae066 Reset CU-UP E1 UE contexts after E1 Setup Response
38.463 sec. 8.2.3 says

> This procedure also re-initialises the E1AP UE-related contexts (if
> any) and erases all related signalling connections in the two nodes like
> a Reset procedure would do.

Hence, delete all contexts after reception of E1 Setup Response. This
minimizes a risk of receiving an E1 bearer setup req for an existing UE,
which currently leads to an assert [we trust the CU-CP does not send the
same UE ID twice, as we only "mirror" the existing UE ID].
2025-02-10 18:19:15 +01:00
Guido Casati 212fe8d2f3 Add common enc/dec E1AP libs to e1ap_lib_common.c
* these functions are used in both interface management
  and bearer context management libraries
2025-02-09 22:48:54 +01:00
Guido Casati e9ff628844 Add macros to deep copy and compare optional E1 IEs 2025-01-28 10:18:45 +01:00
Guido Casati a0da096351 Fix equality check types in Bearer Context Setup Request/Response 2025-01-28 10:18:45 +01:00
Guido Casati bf3b8b19ef Fix missing line break in e1ap.c 2025-01-28 10:18:45 +01:00
Robert Schmidt 377ff8970e Merge remote-tracking branch 'origin/e1-setup-encdec-tests' into integration_2025_w04 (!3152)
E1 Setup enc/dec library and unit test

This MR is adding a library for E1 Setup enc/dec functions:

- E1 CU-UP Setup Request
- E1 CU-UP Setup Response
- E1 Setup Failure

and relevant unit tests
2025-01-27 11:43:46 +01:00
Guido Casati 5ea432c081 Use CU-UP E1 Setup Failure enc/dec lib in stack 2025-01-24 11:13:17 +01:00
Guido Casati 75b238633c Add test for E1 CUUP Setup Failure 2025-01-24 11:13:17 +01:00
Guido Casati beb74b3e62 Add GNB-CU-UP E1 Setup failure enc/dec library 2025-01-24 11:13:14 +01:00
Guido Casati 5176199aa2 Use GNB-CU-UP E1 Setup Response enc/dec lib in stack 2025-01-23 17:37:52 +01:00
Guido Casati 5b4a45b694 Add test for E1 CUUP Setup Response 2025-01-23 17:37:52 +01:00
Guido Casati 422e82df70 Add GNB-CU-UP E1 Setup Response enc/dec lib 2025-01-23 17:37:50 +01:00
Guido Casati 02e1c3589b Use E1 CU-UP Setup Request enc/dec lib in stack 2025-01-23 17:34:03 +01:00
Guido Casati 8fbfcf48f6 Add test for E1 CUUP Setup Request 2025-01-23 17:34:03 +01:00
Guido Casati 414fc2e9a2 Add E1 CU-UP Setup Request enc/dec lib 2025-01-23 17:34:00 +01:00
Guido Casati 6cfa3e3722 Add E1AP Interface Management lib files 2025-01-20 13:48:47 +01:00
Guido Casati c0db34077a Explicitly include the mandatory IE cn_support in the E1 Setup Request
* this commit is making explicit the mandatory IE cn_support
  in the E1 Setup Request message
* also, init cn_support in E1 Setup Request initial message preparation
2025-01-20 13:45:29 +01:00
Guido Casati 9e9bd278a9 Minor: RCconfig_NR_CU_E1 function description and logging 2025-01-14 14:13:49 +01:00
Guido Casati bcd1270237 Refactor SCTP association response handler
* this function is used by both CU-CP and CU-UP
* it behaves differently depending on the type of E1 instance:
  CU-CP: inform RRC of E1 connection loss with CU-UP
  CU-UP: trigger a new SCTP association request by sending an ITTI to the CU-UP task
* after receiving the E1AP register request, the CU-UP will send a new association request to
  SCTP until new E1 connection is achieved by sending a TIMER_HAS_EXPIRED message to the CU-UP
  task. The function e1apHandleTimer() is basically triggering a new E1 association request
  until new E1 connection is achieved
* print SCTP association state in e1ap.c whenever needed

Related to #878
2025-01-14 14:13:49 +01:00
Robert Schmidt 5473ee904f E1AP: Replace AssertFatal with static_assert
See parent commit
2024-12-19 03:22:30 +01:00
Laurent THOMAS 279d49415f remove un-necessary global variables 2024-12-04 12:26:36 +01:00
Guido Casati 927b157714 Add test for E1 Bearer Context Setup Response 2024-11-27 10:18:20 +01:00
Guido Casati 10b07c774d Use enc/dec lib for E1 Bearer Context Setup Response in stack 2024-11-27 10:18:19 +01:00
Guido Casati d56e8a2de1 Add enc/dec library for E1AP Bearer Context Setup Response 2024-11-27 10:17:46 +01:00
Guido Casati ccab22f41f Add test for E1AP Bearer Context Setup Request enc/dec library 2024-11-27 10:17:46 +01:00
Guido Casati 254a0e9ad5 Use E1AP Bearer Context Setup Request enc/dec library in stack 2024-11-27 10:17:46 +01:00
Guido Casati e439a4359c Add enc/dec library for E1AP Bearer Context Setup Request 2024-11-27 10:17:46 +01:00
Guido Casati 2a1f5ac5ed Introduce library for E1AP message encoding/decoding 2024-11-27 10:17:46 +01:00
Guido Casati ac8da484db Replace cell_group_t with CELL_GROUP_ID_t
* simplified number of Cell Group types
2024-11-27 10:17:46 +01:00
Guido Casati 4829fa0543 Refactor E1AP Bearer Context Setup Request struct members
* cleanup struct members not compliant to specs 3GPP TS 38.463
* add defines whenever necessary
2024-11-27 10:17:46 +01:00
Jaroslava Fiedlerova cab28f0f5a Merge remote-tracking branch 'origin/misc-fixes' into integration_2024_w41 2024-10-11 11:09:00 +02:00
Bartosz Podrygajlo 01066a3f0d Fix some sizeof and switch-case errors reported by CodeChecker
CodeChecker is a python application that collects reports from static analyzers like
clang-tidy, clangsa, cppcheck.
2024-10-07 09:35:24 +02:00
Robert SchmidtandGuido Casati ba208c0fc2 Group 5G platform types for common 5G-specific types
Co-authored-by: Guido Casati <hello@guidocasati.com>
2024-09-25 16:00:32 +02:00
Jaroslava Fiedlerova b915482e9b Merge remote-tracking branch 'origin/nr-pdcp-suspend' into integration_2024_w17 2024-04-30 09:01:28 +02:00
Guido Casati 105e9b5f58 Handling Bearer Context Status Change IE in Bearer Context Modification Request
- E1 encoding /decoding
- new enum for E1 Bearer Status Change

see 9.2.2.4 BEARER CONTEXT MODIFICATION REQUEST of 3GPP TS 38.463
2024-04-21 10:23:59 +02:00
Robert Schmidt 3011b706ba Merge remote-tracking branch 'origin/fix-sctp-f1' into integration_2024_w15 2024-04-15 14:33:05 +02:00
Robert Schmidt 4b2a59b027 Remove AMF Network Interface sections's interface names: not used 2024-04-15 13:16:09 +02:00
Robert Schmidt dfa012162b Rewrite sctp_create_new_listener() to handle DNS, IPv6
Rewrite sctp_create_new_listener() to use getaddrinfo() to look up
IPv4/IPv6 addresses via a common interface. This allows to use e.g. DNS,
and enables the SCTP library to listen on IPv6 ports.

To support the above, the corresponding message is changed to not take
an IPv4 address on 4 bytes (and separate IPv6), but a single name that
will be resolved via getaddrinfo()

The previous init message used to allow multiple IPv4/IPv6 addresses;
since this is not used anywhere, remove the corresponding functionality.

Modify all uses of this ITTI message to copy te SCTP init bind addr into
ITTI message.
2024-04-13 05:15:11 +02:00
francescomani 8404da759f nullPointerRedundantCheck 2024-04-09 16:55:51 +02:00
Laurent THOMAS 2129ee3c9c remove global visibility of log variables, remove circular .h dependancy 2024-03-06 08:51:24 +01:00