Commit Graph

126 Commits

Author SHA1 Message Date
Andre Puschmann 79cdc28015 nas_test_common: call NAS layer from stack thread context
since NAS layers insn't thread safe, all calls must come from
the same thread
2021-08-31 17:00:59 +02:00
Andre Puschmann 78d60bc138 nas: remove all uses of atomic from 4G and 5G classes
the NAS classes aren't thread safe and thread-safety shouldn't be
pretended by using atomics. Remove them and add explicit notice.
2021-08-31 17:00:59 +02:00
David Rupprecht 3217c00cfc Adjusting NAS base security function to 5G 2021-08-19 11:03:06 +02:00
Andre Puschmann 99dc94ab38 nas: make state variables atomics
NAS states and substates maybe be requested from other threads so
they need to be protected.

Note that the caller still needs to hold it's own mutex if different
actions are required based on the state.
2021-08-01 11:41:11 +02:00
David Rupprecht 04ef6e120d Added new SIM functions to get MCC, MNC and MSIN 2021-07-27 09:26:52 +02:00
David Rupprecht 2563a78f34 Added basic 5G NAS metrics 2021-07-22 19:41:26 +02:00
David Rupprecht 9172059078 Supply ctor with logger instead of fetching 2021-07-22 14:12:39 +02:00
David Rupprecht fb92118bb7 Add 5G NAS infrastructure 2021-07-14 13:38:08 +02:00
David Rupprecht 505225d845 Added ue nas base class with security functions 2021-07-14 13:38:08 +02:00
David Rupprecht 7fa85ab336 Added nas test common file 2021-07-14 13:38:08 +02:00
Andre Puschmann 0a16f48869 gw: fix race condition
GW thread was checking the default_eps_bearer variable without
protection. RRC could update it when deleting DRB or receiving RRC
connection release.
2021-06-28 17:35:02 +02:00
Andre Puschmann 5313fb99d6 tft: add helper to delete all TFTs for EPS bearer
when a EPS bearer is removed, all associated TFTs need
to be removed as well.
2021-06-24 16:52:58 +02:00
Andre Puschmann 483a216bd5 ue,stack: refactor handling of radio bearears in UE stack
this is a rather large commit that is hard to split because
it touches quite a few components.

It's a preparation patch for adding NR split bearers in the next
step.

We realized that managing RLC and PDCP bearers for both NR and LTE
in the same entity doesn't work. This is because we use the LCID
as a key for all accesses. With NR dual connectivity however we
can have the same LCID active at the same time for both LTE and NR
carriers.

The patch solves that by creating a dedicated NR instance for RLC/PDCP
in the stack. But then the question arises for UL traffic on, e.g. LCID 4
what PDCP instance the GW should use for pushing SDUs. It doesnt' know
that. And in fact it doesn't need to. It just needs to know EPS
bearer IDs. So the next change was to remove the knowledge of what
LCIDs are from the GW. Make is agnostic and only work on EPS bearer IDs.

The handling and mapping between EPS bearer IDs and LCIDs for LTE
or NR (mainly PDCP for pushing data) is done in the Stack because
it has access to both.

The NAS also has a EPS bearer map but only knows about default and
dedicated bearers. It doesn't know on which logical channels they
are transmitted.
2021-06-24 16:52:58 +02:00
David Rupprecht 8c194b887b Allow NAS init function to fail 2021-05-04 19:18:22 +02:00
David Rupprecht 617fb2ba7e Added default destructor for args 2021-05-04 19:17:34 +02:00
David Rupprecht cc6d8128ad Added gw interface if it is running 2021-04-08 17:37:36 +02:00
David Rupprecht 8c86d2084d Adding NR phy config RRC parsing
Added error handling

Reworked flattening error handling
2021-03-25 11:34:53 +01:00
Codebot 4523ee6087 rename srsLTE to srsRAN 2021-03-21 21:47:01 +01:00
Francisco 3e9f93eb8a refactor - remove old log_filter and logmap libraries from the codebase 2021-03-11 20:10:54 +00:00
Francisco b329e25bbb move ue phy interfaces to separate interfaces header file 2021-02-26 16:44:57 +01:00
Francisco b1706b9197 move ue nas interfaces to separate interfaces header file 2021-02-26 16:44:57 +01:00
Francisco a988351f46 move ue pdcp interfaces to separate interfaces header file 2021-02-26 16:44:57 +01:00
Francisco ea04104e8e move ue gw interfaces to separate interfaces header file 2021-02-26 16:44:57 +01:00
Francisco 186285ffd3 move ue usim interfaces to separate interfaces header file 2021-02-26 16:44:57 +01:00
faluco 3ce7454105 - Remove old loggers from ue_stack_lte, ue gw.
- Remove old loggers setting up for these classes.
2021-02-26 13:59:39 +01:00
Francisco 3265d940ec remove byte buffer pool cached member variables as they are unnecessary now. 2021-02-07 18:48:21 +00:00
David Rupprecht 3dab82c42f Added interface that allows to update the lcid in case of a nr reconfiguration
nr rrc updates gw lcid if reconf was received
2021-02-05 11:08:08 +01:00
faluco 5981469f9f
Upgrade loggers in srsue (#2163)
* Replaced UE logger in the ue class.

* Replaced loggers in the main phy class and prach.

* Replaced loggers in phy common and ta_control.

* Replace loggers in cc and sf workers.

* Replaced loggers in intra_measure, scell_recv, search, sfn_sync, sync.

* Remove last uses of the old loggers in the main phy class.

* Remove stray newline in logs.

* Replaced loggers in ue gw.

* - Started to replace loggers in the ue stack.
- Replaced loggers in usim and pcsc.
- Adapted nas and usim tests.

* Replace loggers in nas.

* Added missing log init calls in two previously modified tests.

* Replaced logger in nas idle procs.

* Replaced loggers in nas emm state.

* Replaced loggers in tft packet filter and adapted tft test.

* Replaced loggers in main RRC class.

* Replaced loggers in RRC cell.

* Replaced loggers in RRC meas.

* Replaced loggers in rrc procedures.

* Started logger replacement in MAC layer, more precisely in demux and dl_harq classes.
Been unable to inject loggers in construction for dl_tb_process due to very weird static assertions in the std::vector code being the type not constructible which is not true, so instead use the main MAC logger directly.

* Replaced loggers in mac mux class.

* Replaced loggers in mac pro_bsr.

* Replaced loggers in mac proc phr.

* Replaced loggers in mac proc SR and RA.

* Replace loggers in mac UL HARQ.

* Replaced loggers in main ue stack class.

* Fixed nas test crashing due to a null string.

* Ported mac_test to use the new loggers.

* Removed TTI reporting for the PHY log as the old logger did.

* Replaced loggers in UE phy tests.

* Configure loggers in nas_test.

* Replaced loggers in rrc_meas_test.

* Replaced loggers in rrc_reconfig_test.

* Added missing newline in tft_test.

* Fix compilation errors in TTCN3 tests.

* Fix linker error detected in CI and warning.

* Replaced loggers in TTCN3 tests.

* Fix a text replace error in some log messages.

* Remove trailing newlines from log entries.

* Remove old logger from rrc.

* Flush backend before printing the test status.

* - Fix compilation error from previous rebase.
- Remove trailing newlines from some missing log entries.
2021-01-28 17:17:43 +01:00
David Rupprecht 1b19ee40e7 Added usim features for key derivation 2021-01-27 10:37:09 +01:00
Andre Puschmann c8801578df gw: use std::chrono for metrics and fix nan display
* replace gettimeofday with std::chrono
* fix nan printing when nof_tti is zero (at startup)
2020-12-16 20:39:21 +01:00
Andre Puschmann ab598dae3b gw: calculate GW throughput based on TTI timing
similiar like the RLC patch, MAC TTIs are passed to GW so the
rx/tx rate can be calculated based on the LTE timing
2020-12-12 15:59:27 +01:00
Andre Puschmann 07d2bc4fe8 change license header to agnostic version with hint to root LICENSE file 2020-12-12 15:59:25 +01:00
Pedro Alvarez 454162cea7 Deleted nas_interface_stack. 2020-12-12 15:58:33 +01:00
Pedro Alvarez 604e79214d Changed NAS is_attached interface to is_registered. 2020-12-12 15:58:33 +01:00
Pedro Alvarez 5649ecaab0 Renamed nas_common.h to nas_config.h. Moved emm_state_t into nas_emm_state.h and nas_emm_state.cc. 2020-12-12 15:58:33 +01:00
Pedro Alvarez 96f39da5d7 Fixes for airplane simulator. 2020-12-12 15:58:33 +01:00
Pedro Alvarez 14844a168a Created new class to hold all NAS states for the NAS state machine. Added EMM-DEREGISTERED substates and EMM-REGISTERED substates.
Decoupled PLMN selection, attach request and service request. Removed RRC connect procedure from NAS.
2020-12-12 15:58:33 +01:00
Andre Puschmann 082e002b67 nas: fix airplane mode simulation
the current implementation was somehow broken after a
NAS refactor. It was undetected because we didn't really
use it.

this fixes the simulation by using a single timer to simulate
airplane mode transitions.
the timer is rearmed in the timer_expire() function
if the correspondig event is set.

Has been tested to work well with, e.g.:

--sim.airplane_t_on_ms 5000 --sim.airplane_t_off_ms 10000
2020-11-06 09:33:36 +01:00
Pedro Alvarez 5a4e71a6e4 Created k_enb_context structure that holds k_enb, NCC and NH to make it easier to restore context from failed handover. 2020-10-08 09:46:34 +01:00
Pedro Alvarez bcb422736c Save and restore NH on handover and handover failure. 2020-10-08 09:46:34 +01:00
Pedro Alvarez 3eb525563a Fix issue reading MNC length in USIM. 2020-10-07 10:04:50 +01:00
Pedro Alvarez 22a6dc305f Moved common variables and functions from the usim and pcsc_usim classes into usim_base class. 2020-10-05 12:14:46 +01:00
Pedro Alvarez 2f0125ef4e Fix issue recovering key state, when the first HO fails (specifically, is_first_ncc was not recovered). Minor improvements in key logging. 2020-10-01 18:48:07 +01:00
Pedro Alvarez b3bfe336a9 Make sure that remote address test has a ip mask 2020-09-28 16:08:28 +02:00
Sylvain Munaut 5783c01cbb tf_packet_filter: Improve support for the different filter types 2020-09-28 16:08:28 +02:00
Pedro Alvarez 86f4d469c6 Added some functions to save and restore AS keys for the case of failed handover in the USIM 2020-09-24 13:30:08 +01:00
Francisco Paisana 1a9c04bf2f use of task scheduler handle in pdcp 2020-07-13 11:19:25 +01:00
Ismael Gomez e378a45db0 Reorganized priorities to avoid GW starve the CPU 2020-07-02 11:52:14 +02:00
Xavier Arteaga de230826b9 Added string helper for removing spaces and parsing list
Fix

Fix string parser
2020-06-16 11:00:51 +02:00
faluco 9efa24bfa9 More warning fixes. 2020-05-07 10:10:24 +02:00