Commit Graph

509 Commits

Author SHA1 Message Date
David Rupprecht 7a481c40ab Added mac prach nr proc error handling 2021-04-08 17:37:36 +02:00
David Rupprecht f9ea02b6bf Added functions for rrc reestablishing procedure if nr reconfig failes 2021-04-08 17:37:36 +02:00
Xavier Arteaga 01990c2e1d SRSUE: Add PHY-MAC SR related interfaces 2021-04-07 14:16:46 +02:00
David Rupprecht 506adca930 Set eutra nr band info based config value 2021-04-07 13:24:26 +02:00
Andre Puschmann d135ae4d29 proc_bsr: initial BSR procedure for NR
* refactor some common methods to mac_common.cc
* add common mux_base class
* move UL PDU generation to mux class
* add logical channel registration to MAC, MUX, BSR
* add initial proc BSR
* add basic MAC NR test
* rework MAC interfaces
2021-03-30 13:46:12 +02:00
Francisco d04a19f8bc refactor - increase code reuse in adt files 2021-03-29 22:11:25 +01:00
Andre Puschmann bde7b49ca3 ue,mac_nr: add basic SR procedure
the current implementation support only one SR config
and doesn't support the prohibit timer
2021-03-26 09:53:03 +01: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
Andre Puschmann 1a0891df51 all: check return value of make_byte_buffer() and handle them safely 2021-03-23 14:31:15 +01:00
Codebot 4523ee6087 rename srsLTE to srsRAN 2021-03-21 21:47:01 +01:00
Xavier Arteaga 2782d96170 SRSUE: compute speed from TA commands 2021-03-19 11:47:09 +01:00
Francisco 3e9f93eb8a refactor - remove old log_filter and logmap libraries from the codebase 2021-03-11 20:10:54 +00:00
David Rupprecht bb3e87302d Added new pcap enable option and mac nr 2021-03-03 09:50:15 +01:00
Xavier Arteaga 1e55d68b55 Removed set RNTI from API 2021-03-01 15:30:33 +01:00
Francisco b329e25bbb move ue phy interfaces to separate interfaces header file 2021-02-26 16:44:57 +01:00
Francisco 13d805ef56 move ue rrc 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 b8bd869d0f move ue rlc 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 eaf20fa4f3 - Removed some logger injections in the ue app.
- Removed old logger setup code not needed anymore.
2021-02-26 13:59:39 +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
Andre Puschmann 9c4146442a mac,phy: refactor NR MAC/PHY UL data passing interface
inspired by accepted (but not yet merged) PR to include the
(unique_)byte_buffer_t for MAC/PHY interfacing, this patch adds
a few more useful bits to that. Buffer management for UL data is now
done in MAC and only a pointer to the data is passed in the UL action.

* Move Tx softbuffer to MAC (until UL HARQ class is ready)
* Remove temparal data member in cc_worker
* Remove memcpy after packing MAC PDU
2021-02-24 20:28:43 +01:00
David Rupprecht f6f6ee406b SRSUE NR: use correct rnti in rar and make NR proc ra 2021-02-23 17:02:23 +01:00
David Rupprecht 1fcd006a7c fixed segfaulting 2021-02-23 17:02:23 +01:00
David Rupprecht 82a8dcc77a Change interface to unique_byte_buffer
logging message for msg3 preparing
2021-02-23 17:02:23 +01:00
David Rupprecht 3af0342418 Added mux class and packing of msg3 2021-02-23 17:02:23 +01:00
Xavier Arteaga 760ad3a746 SRSUE: Interface stack and PHY for NR-RA procedure 2021-02-23 17:02:23 +01:00
David Rupprecht 0f1586dd2d Deleted all HAVE_5GNR in CC and h files
CMakeList and travis yaml
2021-02-22 21:16:04 +01:00
David Rupprecht 1987ddd923 Added phy_nr to ue_stack_lte 2021-02-22 14:26:20 +01:00
David Rupprecht 24123313bf Added MAC NR RA procedure with a minimal test case 2021-02-16 09:42:09 +01:00
Andre Puschmann 6eed6f622f mac_nr: update RA related function in MAC/PHY interface
* expose interface to trigger PRACH from MAC
* indicate PRACH tx from PHY
* add temporary RAR PDU handling with Msg3 grant indication to PHY
2021-02-08 22:15:09 +01:00
Francisco 3265d940ec remove byte buffer pool cached member variables as they are unnecessary now. 2021-02-07 18:48:21 +00:00
Francisco 0c7c317be5 refactor byte_buffer class and move it to separate file 2021-02-07 18:48:21 +00:00
Pedro Alvarez bb0e31feda Reduce log level of SDUs dropped in the stack to info. Added ul_dropped_sdus to stack metrics. 2021-02-05 16:48:04 +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 821925a273 - Upgrade to srslog the loggers in lib/mac.
- Adapted users of these classes and tests.
2021-02-04 18:37:00 +01:00
Andre Puschmann 8e13f04684 mac_pcap: refactor MAC PCAP and include NR RAT into same object
after adding the thread-safe PCAP writer functionality to the EUTRA
MAC object it became clear that we don't wont to replicate the
same for the NR object.

This patch therefore refactors the class that now supports both EUTRA and
NR rats. The old mac_nr_pcap.[h/cc] has been deleted. All test-cases
and usages now use the new object that needs to pass the RAT type in
the ctor.

this patch addresses the last open point of #2160
2021-02-03 17:21:57 +01:00
faluco d37a07a47f Replaced loggers in buffer_pool.h 2021-02-03 14:15:27 +01:00
Andre Puschmann ecf7eaec5c ue_stack_lte: expose MAC NR interface for NSA configs 2021-02-03 10:23:18 +01:00
Andre Puschmann f5c945dc2f mac_nr: add interface to set C-RNTI and contention ID from RRC
used during contention-based/free RA
2021-02-02 14:13:25 +01:00
Andre Puschmann 1aadc5c53e mac_nr: tiny cleanups of MAC class, use of new logger 2021-02-01 09:58:43 +01:00
Andre Puschmann 73cb0dabf2 mac_nr: move UE MAC class into own subfolder
this should simplify further MAC NR extensions and lead
to a more organized folder structure
2021-02-01 09:58:43 +01:00
Andre Puschmann da9e3363f1 mac_pdu_nr: rename MAC PDU class for NR to adhere naming conventions
* mainly to have _nr as trailing name for filename and class
* also add "sch" to class and filename (RAR PDU will have extra class)
2021-01-30 11:58:25 +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
Andre Puschmann 4709bacefd srsue: add DL NR-ARFCN param
* add PHY param to set DL NR-ARFCN
* use new band_helper class to convert ARFCNs to supported bands
* signal supported NR bands in UE capabilities
2021-01-28 12:06:02 +01:00
David Rupprecht 9ccc36d4fa Make fake measurement frequency depend on measurement config 2021-01-27 10:37:09 +01:00
David Rupprecht 1b19ee40e7 Added usim features for key derivation 2021-01-27 10:37:09 +01:00
David Rupprecht ceda458bb3 Added MAC NR to EUTRA and NR with stack interfaces including MAC config build
Moved MAC logical channel config to MAC interface types
2021-01-27 10:37:09 +01:00
David Rupprecht e0420049e3 Build infrastucture for reconfig 2021-01-27 10:37:09 +01:00
David Rupprecht 64299960bd Added procedure for NR reconfiguration and RRC with NR complete 2021-01-27 10:37:09 +01:00
Andre Puschmann a09fb95c25 proc_ra: protect RA procedure from concurrent thread access
that patch addreses issue #2199 by defering RA-related calls that
are executed from within PHY workers.

The time-critical bits of more complex functions such as tb_decoded()
are still executed in the PHY worker thread but the state machine
manipulation is defered.
2021-01-20 17:12:10 +01:00
Ismael Gomez a6423442c2
Refactor NR RA files and fix header includes all over library (#2162)
* Refactor NR resource allocation classes. Use DCI instead of grant for dummy PDSCH UE/eNB test

* Minor refactors in NR workers and ue_dl

* Fix include issues

* fix compilation issues
2021-01-20 15:46:46 +01:00
David Rupprecht 1a10c783b5 Faking measurements 2021-01-08 17:20:08 +01:00
David Rupprecht f7d313147a Added infrastrukture for measurements
Init rrc_nr as part of the LTE stack
2021-01-08 17:20:08 +01:00
David Rupprecht 4305929ec7 Hardcoded NR/MRDC-Capabilities 2021-01-08 17:20:08 +01:00
David Rupprecht b79eef0860 Introducing nr_rrc <-> rrc interface for eutra and nr cap query 2021-01-08 17:20:08 +01:00
David Rupprecht 9eb0b72cb4 Added rrc function has_nr_dc 2021-01-08 17:20:08 +01:00
Andre Puschmann 37fc1c59e3 fix DRB release logging
this caused wrong logs because the LCID was printed based on the assumption
that the DRB LCID is alwasy 2 + drb ID

Use drb_id as drb_cfg key
2021-01-08 17:20:08 +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
David Rupprecht 81609d48dd Added measurment report for interrat nr15
Added function for removing interrat triggers
2020-12-16 14:12:38 +01:00
David Rupprecht 5df2fb1fa1 Added rrc has nr neighbour cells 2020-12-16 14:12:38 +01:00
David Rupprecht 0e4d77da76 Refactor eutra reporting code and add report triggers for inter rat measurements 2020-12-16 14:12:38 +01:00
David Rupprecht e4e67eebce Added infrastucture to process measurments and evaluate interrat triggers 2020-12-16 14:12:38 +01:00
David Rupprecht 25e5b88704 Added NR range_to_value function and debug logging for measurements 2020-12-16 14:12:38 +01:00
David Rupprecht ce4526a935 Extended measurements interrat nr r15 testcase with measurements 2020-12-16 14:12:38 +01:00
David Rupprecht 826dd32c89 Rename meas_cell to meas_cell_eutra
Added meas_cell_nr class

Make meas_cell list as template class

Inheritance rrc_cell to meas_cell_nr
Added process_new_cell_meas_nr function
2020-12-16 14:12:38 +01:00
David Rupprecht 62b558fccf Move rat type to common header
Removed phy measurement from rrc interface phy

Updated rrc interface for handling measurements
2020-12-16 14:12:38 +01:00
David Rupprecht 848496bb0f Moved get_earfcn to srslte get_carrier_freq func 2020-12-12 15:59:27 +01:00
David Rupprecht d4fb2dfb16 Added handling of inter rat measurement config function
Make report config more agonistic
2020-12-12 15:59:27 +01:00
David Rupprecht f4b0042c10 Added minimal interrat and nr measurement testcase
Added the handling of nr_r15 meas config
Added seperate handling of reportConfig for eutra
2020-12-12 15:59:27 +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
Xavier Arteaga f64c268a69 SRSUE: Refactored MAC/RRC SCell Activation/Deactivation 2020-12-12 15:58:33 +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 2be85217fd mac,ue: reset demux when restting MAC
this potentially fixes the issue we see during HO and RLF
under high DL load.

The issue happens because buffered DL PDUs are delivered to
RLC after reestablishing RLC that confuse the receiving
RLC entity bc the sequence numbers are very high, as opposed
to begin with zero again after reestablishment.
2020-12-12 15:58:33 +01:00
Andre Puschmann 7cf919e2af Fix MAC PDU packing after sending Truncated BSR (#2004)
* mac_test: add extended TBSR unit test

unit test to MAC UL packing after sending a TBSR

this fixes the MAC issues described in issue #2002

* mux: fix updating of LCG buffer state after packing PDU

we've previously lowered the buffer state of the LCG according
to the bytes that have been scheduled, but not according to
those that have been actually included in the PDU.

* proc_bsr: fix LCG buffer state updating for TBSR

when sending a TBSR do not update the internal buffer
state of the BSR proc.

This caused issues because the buffer state for all LCG that
are not included in the TBSR are set to zero, although at least
one LCG does have data to transmit.

* rlc_am: include LCID when logging retx of SN
2020-12-12 15:58:32 +01:00
Francisco Paisana 510959b50f update nr asn1 files, and asn1 tests 2020-12-12 15:58:32 +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
Andre Puschmann fd5cde525c proc_bsr: fix race condition in BSR reporting
fix for #1934

This fixes a race condition between Stack thread and DL
PDU processing that lead to updates of the RLC buffer that
are undetected by the BSR routine.

What happens is that in a UL SCH PDU all outstanding data is transmitted
and and a LBSR with all zero buffers is sent.

14:39:47.327301 [MAC ] [D] [ 3793] BSR:   LCID=3 old_buffer=59
14:39:47.330600 [MAC ] [I] [ 3793] UL LCID=3 len=58 LBSR: b=0 0 0 0

Note that "old_buffer" isn't set to zero here.

At the same time (same TTI), the MAC PDU processing thread handles DL-SCH PDUs
that may generate new UL PDUs:

14:39:47.330749 [RLC ] [I] DRB1 Tx SDU (54 B, tx_sdu_queue_len=1)
14:39:47.330762 [RLC ] [I] DRB1 Tx SDU (54 B, tx_sdu_queue_len=2)
14:39:47.330775 [RLC ] [I] DRB1 Tx SDU (54 B, tx_sdu_queue_len=3)
..

Those PDUs are "new data" since the previous buffer state was zero.

Here is the race now between the threads, at the end of the bsr::step() function
old_buffer of each LCG is updated with the previous new_buffer, so
the buffer state of LCG=2 is now 59.

Now MAC starts the next TTI:

14:39:47.331910 [MAC ] [D] [ 3794] Running MAC tti=3794
14:39:47.331928 [MAC ] [D] [ 3794] Update Bj: lcid=0, Bj=0
14:39:47.331934 [MAC ] [D] [ 3794] Update Bj: lcid=1, Bj=0
14:39:47.331938 [MAC ] [D] [ 3794] Update Bj: lcid=2, Bj=0
14:39:47.331941 [MAC ] [D] [ 3794] Update Bj: lcid=3, Bj=-1752
14:39:47.331951 [MAC ] [D] [ 3794] BSR:   LCID=0 update new buffer=0
14:39:47.331960 [MAC ] [D] [ 3794] BSR:   LCID=1 update new buffer=0
14:39:47.331964 [MAC ] [D] [ 3794] BSR:   LCID=2 update new buffer=0
14:39:47.331971 [MAC ] [D] [ 3794] BSR:   LCID=3 update new buffer=335
14:39:47.331976 [MAC ] [D] [ 3794] BSR:    check_new_data() -> get_buffer_state_lcg(0)=0
14:39:47.331980 [MAC ] [D] [ 3794] BSR:    check_new_data() -> get_buffer_state_lcg(1)=0
14:39:47.331984 [MAC ] [D] [ 3794] BSR:    check_new_data() -> get_buffer_state_lcg(2)=59
14:39:47.331988 [MAC ] [D] [ 3794] BSR:    check_new_data() -> get_buffer_state_lcg(3)=0
14:39:47.331993 [MAC ] [D] [ 3794] BSR:   LCID=0 old_buffer=0
14:39:47.332000 [MAC ] [D] [ 3794] BSR:   LCID=1 old_buffer=0
14:39:47.332003 [MAC ] [D] [ 3794] BSR:   LCID=2 old_buffer=0
14:39:47.332007 [MAC ] [D] [ 3794] BSR:   LCID=3 old_buffer=335

And since the buffer state of LCG=2 isn't zero, the new data for LCID=3 of that LCG is considered.
So effectivly, the BSR missed the "empty" buffer state for a fraction of time and doesn't
consider the outgoing data generated in the same TTI as new. It therefore
doesn't transmit a BSR.

in which a BSR wasn't
2020-10-28 12:05:53 +01:00
Andre Puschmann d5286e70aa proc_bsr: refactor and add extra print_state() method
allows to call the print_state() routine from other places in the BSR
2020-10-28 12:05:53 +01:00
Francisco Paisana 514deaf25b fix resetting of phy and mac during reestablishment 2020-10-22 19:55:46 +02:00
Andre Puschmann a366500a78 rrc_proc: init cs_result to none
detected by Coverity CID 363053
2020-10-18 15:56:16 +02:00
Francisco Paisana 665b3996bb now the phy controller handles the scenario where the phy cell selection failed to be initialized 2020-10-16 15:54:42 +01:00
Andre Puschmann 937067a205 proc_phr: rename start_periodic_timer() and make sure its only started if a valid config is present 2020-10-13 17:38:45 +02:00
Andre Puschmann fab86382c1 mac,rrc: add interface to set SR config explicitly without touching any other MAC function
when releasing PUCCH/SRS (see 5.3.13 in 36.331) we need to reset the SR config as well.
In our case, SR is handled by MAC so we need to (re-)configure MAC, not all of
MAC though, just SR.
2020-10-13 17:38:45 +02:00
Francisco Paisana e7239163e9 silence noisy unhandled in_sync_ev logs 2020-10-12 18:24:14 +01:00
Francisco Paisana f185272367 added comments explaining the meaning of the cell reselection procedures 2020-10-12 13:42:46 +01:00
Francisco Paisana 49e7b8e36e - Change periodicity of cell reselection after a new serving cell has been selected
- Enable PHY intra measurements during RRC_IDLE
2020-10-12 13:42:46 +01:00
Francisco Paisana 585d7c923a refactor and simplification of cell selection procedure. Using now a SIB3 threshold to decide whether to select neighbor cell while in RRC_IDLE 2020-10-12 13:42:46 +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
Xavier Arteaga 6ae47b6510 SRSUE: Deafult PUCCH/SRS does not imply full PHY dedicated defaults 2020-10-07 09:58:23 +02: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
Francisco Paisana 4ebe92f6a3 refactor phy configuration in the rrc to keep track of activated scells, and cells configurations 2020-10-02 18:50:29 +01:00
Francisco Paisana d910c910a4 rrc::meas_cell now uses stack timers instead of system timers. 2020-10-02 17:53:02 +01:00
Francisco Paisana 023d32975a avoid use of pointers to meas_cells in ho_proc as they may become dangling 2020-10-02 17:53:02 +01:00
Francisco Paisana 072b7be582 renamed rrc::cell_t to rrc::meas_cell 2020-10-02 17:53:02 +01:00
Andre Puschmann 0ef8e1fdac rrc: include pci when logging serving cell measurement
this should facilitate easier log parsing and plotting
if the cell measurements _always_ include the PCI, even
in the case of the serving cell

15:49:11.357447 [RRC ] [I] MEAS:  New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=+0.1 Hz
15:49:11.391610 [RRC ] [I] MEAS:  New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=-0.4 Hz
15:49:11.427325 [RRC ] [I] MEAS:  New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=-0.6 Hz
15:49:11.463101 [RRC ] [I] MEAS:  New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=-0.7 Hz
15:49:11.499817 [RRC ] [I] MEAS:  New measurement serving cell: earfcn=0, pci=1, rsrp=-11.51 dBm, cfo=+0.1 Hz
15:49:11.499828 [RRC ] [I] MEAS:  New measurement neighbour cell: earfcn=2850, pci=0, rsrp=-12.16 dBm, cfo=-0.8 Hz
15:49:11.535027 [RRC ] [I] MEAS:  New measurement serving cell: earfcn=0, pci=1, rsrp=-11.46 dBm, cfo=-0.8 Hz
15:49:11.571707 [RRC ] [I] MEAS:  New measurement serving cell: earfcn=0, pci=1, rsrp=-11.46 dBm, cfo=-0.9 Hz
15:49:11.607932 [RRC ] [I] MEAS:  New measurement serving cell: earfcn=0, pci=1, rsrp=-11.52 dBm, cfo=-0.8 Hz
2020-10-01 20:15:41 +02: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
Francisco Paisana 1f2cca8909 in the rrc reconf procedure, handle the scenario where the rrc reconfiguration message does not config the phy 2020-10-01 11:25:21 +01:00
Francisco Paisana c6f4776a6f send the nassdus sooner in the rrc reconf procedure 2020-10-01 11:25:21 +01:00
Francisco Paisana fc49b5a030 implemented rrc reconfiguration procedure that includes a continuation when phy configuration is complete 2020-10-01 11:25:21 +01:00
Francisco Paisana b3eb9651d6 disable cqi in scells during handover procedure 2020-09-29 12:10:42 +01:00
Francisco Paisana 8a9a95a937 ensure sibs are acquired if cell selection calls cell search 2020-09-29 11:06:32 +01:00
Francisco Paisana 045f647914 fix edge case where serving cell is good enough for reestablishment but the sibs are not yet acquired 2020-09-28 23:45:13 +01:00
Francisco Paisana 5ecbe8fb17 cleanup of the reestablishment procedure state machine. It does not need to wait for the serving cell configuration because such procedure is already included in the cell selection procedure 2020-09-28 18:39:28 +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
Francisco Paisana 0997daa7a0 now the handover procedure in the srsUE does not wait for the phy cell selection result. It only waits for the RA result 2020-09-25 13:03:50 +01: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 cf89d6645b add comments explaining each function of the reest procedure 2020-09-23 14:59:38 +01:00
Francisco Paisana d068d594af implemented rrc reestablishment procedure part after sending reest request 2020-09-23 14:59:38 +01:00
Francisco Paisana 73e21daeb2 refactor reestablishment procedure to more closely follow TS. 2020-09-23 14:59:38 +01:00
Andre Puschmann 1afc137032
[REBASE] Make PHY non-blocking and fefactor HO procedure (#1753)
* Make PHY non-blocking and fefactor HO procedure

* makes entire PHY non-blocking through command interface
* adds dedicated queue for cell_search/cell_select commands
* refactor HO procedure to run faster, in one stack cycle. Looks closer to the specs
* force ue to always apply SIB2 configuration during reestablishment
* Run update_measurements in all workers

Co-authored-by: Ismael Gomez <ismagom@gmail.com>
2020-09-22 21:47:16 +02:00
Francisco Paisana 7f8af023b8 added a callback that always gets triggered when the phy cell selection completes. This callback checks if cell selection failed, and if so, sets the rsrp of the selected cell to -infinity 2020-09-22 17:09:18 +01:00
Andre Puschmann b616944a13 ue,rrc: fix security config during HO/reestablishment
we fix a number of very related issues for HO/reestablishment
in the success/error case:

* this patch removes the hard-coded check that intra-cell HO aren't
allowed. There are cases where eNBs use this method to update
the security context.

* the patch also fixes an issue after failed HO where the security context
of the source eNB should be used for the reestablishment.

* update security keys according to specs when mobilitycontrol
indicated change of key
2020-09-21 09:27:07 +02:00
Andre Puschmann 6827c2df21 rrc_meas: disable layer3 filtering until quantity config is received
the filter alpha was initialized to zero by default which causes an
issue because the first measurement for a cell can't be updated,
because the filtering function will always return the current value.

According to 36.331 Sec 5.5.3.2 Note 2, a k-value of 0 should turn
off filtering, which should be used as the default value until
an update is received from the network.
2020-09-21 09:27:07 +02:00
Ismael Gomez f49fbd6d02
Fix the order of HO/reest measurement actions (#1696) 2020-09-04 12:18:12 +02:00
Andre Puschmann aec18a93d1 mux,bsr: refactor UL buffer status reporting
this patch fixes the UL BSR as per TS 36.321, it includes following
main changes:

* report UL buffer state to reflect the UEs transmit buffer after
  the MAC UL PDU containing the BSR has been built.
  In other words, if the UE, for example, can transmit all outstanding
  data in an UL grant, it will not report any pending data to transmit.

* refactor MUX routines and subheader space calculation
2020-09-03 15:00:36 +02:00
Ismael Gomez 06a5bdaab2 Process all calls to RLF in the main RRC task 2020-09-01 11:03:02 +02:00
Francisco Paisana 92221eb780 update of rrc_interface_mac to remove signal from mac to rrc that RA failed in case of handover failure 2020-08-29 20:06:08 +01:00
Francisco Paisana fca1273b3e avoid spurious warnings of trying to start the PRACH when it is already running during handover 2020-08-28 10:14:23 +01:00
Francisco Paisana fddcc3d8ea In the case of Handover, postpone the activation of the CQI and SR config present in the HO command for after the RA proc completion to the target eNB 2020-08-28 10:14:23 +01:00
Francisco Paisana 5242f9422b fix deadlock in handover 2020-08-27 13:43:18 +01:00
Francisco Paisana 834c0b3929 integrated new observer pattern into phy controller fsm 2020-08-24 22:10:32 +01:00
Francisco Paisana 48dd436d86 integrated observer pattern into rrc phy ctrl fsm 2020-08-24 22:10:32 +01:00
Francisco Paisana b1670c005b remove shadowed variables for reestablishment during handover 2020-08-24 17:48:50 +01:00
Francisco Paisana 8d10aa906e move defer_task to switch case in the rrc 2020-08-17 22:49:40 +01:00
Xavier Arteaga 4e1e8cea1a SRSUE: MAC HARQ entities vector is fixed 2020-07-28 09:31:34 +02:00
Francisco Paisana 4fb8011a6d updated phy controller to use task scheduler 2020-07-14 13:33:50 +01:00
Francisco Paisana 9c5471b094 more ergonomic event callback 2020-07-14 13:33:50 +01:00
Francisco Paisana 58a9610efa use of stack event loop to propagate cell search and selection results 2020-07-14 13:33:50 +01:00
Francisco Paisana d48a45976e moved cell selection/search complete event signalling out of phy_controller 2020-07-14 13:33:50 +01:00
Francisco Paisana 48138b5281 removal of phy cell selection procedure as it now it is replaced by phy controller 2020-07-14 13:33:50 +01:00
Francisco Paisana 489969722e implemented phy controller FSM to perform cell selection & search. The controller also tracks the phy sync state 2020-07-14 13:33:50 +01:00
Andre Puschmann a7911f0dab pdcp,rlc: refactor SDU queueing policy
this patch refactors the SDU queuing and dropping policy of the RLC and PDCP layer.
the previous design had issues when packets have been generated at a higher
rate above the PDCP than they could be consumed below the RLC.

When the RLC SDU queues were full, we allowed two policies, one to block on the write
and the other to drop the SDU. Both options are not ideal because they either
lead to a blocking stack thread or to lost PDCP PDUs.

To avoid this, this patch makes the following changes:

* PDCP monitors RLC's SDU queue and drops packets on its north-bound SAP if queues are full
  * a new method sdu_queue_is_full() has been added to the RLC interface for PDCP
* remove blocking write from pdcp and rlc write_sdu() interface
  * all writes into queues need to be non-blocking
  * if Tx queues are overflowing, SDUs are dropped above PDCP, not RLC
* log warning if RLC still needs to drop SDUs
  * this case should be avoided with the monitoring mechanism
2020-07-13 17:05:28 +02:00
Francisco Paisana 5e06430455 removal of stack handler interface 2020-07-13 11:19:25 +01:00
Francisco Paisana 7c364070ee creation of task scheduler interface for classes/functions running outside the main control thread 2020-07-13 11:19:25 +01:00
Francisco Paisana 039977aeb5 renamed interfaces 2020-07-13 11:19:25 +01:00
Francisco Paisana 1a9c04bf2f use of task scheduler handle in pdcp 2020-07-13 11:19:25 +01:00
Francisco Paisana 4f5e65781f created task scheduler class to deal with timers, thread pool, multiqueue, internal tasks 2020-07-13 11:19:25 +01:00
Francisco Paisana 8c920837d6 fix issue when adding neighbour cell that matches serving cell 2020-07-08 00:19:18 +01:00
Francisco Paisana d746115130 moved serving cell to meas_cell_list 2020-07-08 00:19:18 +01:00
Francisco Paisana 928459408e fix cell meas sorting issue 2020-07-08 00:19:18 +01:00
Francisco Paisana d2dd30c8cb rrc_meas_test failing 2020-07-08 00:19:18 +01:00
Francisco Paisana 9a1f69113f created class for managing neighbor cells of rrc 2020-07-08 00:19:18 +01:00
Francisco Paisana 069dc1f751 moved cell struct of srsue::rrc to separate file 2020-07-08 00:19:18 +01:00
Andre Puschmann bd0c13aad0 ue_stack: bump priority of stack thread
the stack thread should really run with the next highest priority after
sync + phy workers to make sure it gets enough CPU
2020-07-05 16:56:06 +02:00
Francisco Paisana d12b037e0d make cell reselection periodic and with period of 20msec 2020-07-03 18:35:53 +01:00
Francisco Paisana c6f422d23e improved cell selection test in srsue::rrc 2020-07-03 14:00:14 +01:00
Francisco Paisana 3e016b8095 select serving cell during cell selection if it is stronger than neighbors 2020-07-03 10:26:49 +01:00
Ismael Gomez e378a45db0 Reorganized priorities to avoid GW starve the CPU 2020-07-02 11:52:14 +02:00
Andre Puschmann a5c0f96fa7 srsue: limit sync queue length to 1 for ZMQ radio
apply same change that we've done on the eNB also on the UE
to avoid the PHY processing TTIs faster than the stack.

Without that, we see lots of those in the logs:

...
08:39:17.580325 [STCK] [W] Detected slow task processing (sync_queue_len=7).
...
2020-06-30 10:36:01 +02:00
Andre Puschmann e981d5ee70 rrc,ue: refactor wait conditions before transition to RRC idle
before entering RRC idle, after receiving a RRC connection release for example,
we need to wait until the RLC for SRB1 or SRB2 have been flushed, i.e.
the RLC has acknowledged the reception of the message.

Previously we have only waited for SRB1 but the message can also be received on SRB2
and in this case both bearers need to be checked.

The method is now streamlined to check both SRBs and is also used when
checking the msg transmission of an detach request.
2020-06-29 21:19:42 +02:00
Francisco Paisana fddcbc9879 fix vnf-ue stack interface 2020-06-24 23:28:53 +01:00
Daniel Willmann 31f1516d74 Use callback to establish connection before sending PDUs in TestmodeB 2020-06-23 12:12:58 +02:00
Francisco Paisana f0874b780b add radio_base/null classes 2020-06-18 23:37:26 +01:00
Ismael Gomez 54b331c504
Adds best neighbour to CSV and stdout metrics (#1440) 2020-06-17 12:11:06 +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
Francisco Paisana 81848deae2 extended handover procedure to accommodate all the handover (phy cell select + ra) 2020-06-02 19:11:26 +01:00
Francisco Paisana 556fcb69e7 fix handover my defering to next tti the reestablishment of bearers 2020-06-02 19:11:26 +01:00
Francisco Paisana 37ce475398 fix+refactor of the ue rrc handover preparation procedure to avoid deadlocking 2020-06-02 19:11:26 +01:00
Francisco Paisana 8f4f37e89b remove more unused rrc variables 2020-06-01 19:59:50 +01:00
Francisco Paisana 29fd147d41 remove unused rrc variables 2020-06-01 19:59:50 +01:00
Francisco Paisana b2aae8763b made mac_nr and rrc_nr final to avoid using virtual dtors 2020-06-01 19:59:50 +01:00
Francisco Paisana 452c043370 created a global map of lcids to srbs/drbs for NR 2020-05-29 14:11:23 +01:00
Francisco Paisana 4cf756434f add srsue::rrc_nr srsue::ue_stack_nr 2020-05-29 14:11:23 +01:00
Francisco Paisana 6a164e032d added srsue::rrc_nr 2020-05-29 14:11:23 +01:00
Francisco Paisana edba7f57e4 corrected mac_nr_pdu includes 2020-05-26 10:02:08 +01:00
Francisco Paisana 0b701022a3 added ue nr mac 2020-05-26 10:02:08 +01:00
Ismael Gomez b5ccbf1891 Simplify relationship between BSR, SR and RA procedures. Fix issue #1346 2020-05-21 15:36:44 +01:00
faluco 9efa24bfa9 More warning fixes. 2020-05-07 10:10:24 +02:00
faluco 7ff251f112 - Fixed warnings caught by Clang 9.0.0 2020-05-07 10:10:24 +02:00
Pedro Alvarez 2ea78c8feb Added configuration options for stack logging. 2020-05-05 14:34:47 +01:00
Francisco Paisana de4d58d8fe fix coverity scan issues in master 2020-04-29 11:17:00 +02:00
Francisco Paisana af9ca9f9e5 remove unecessary moves 2020-04-27 22:19:08 +01:00
yagoda 8e0b106c22 fixing some warnings from LGTM 2020-04-27 20:59:40 +02:00
Xavier Arteaga 89dcd6339f More LGTM fixes 2020-04-22 18:01:43 +02:00
Xavier Arteaga 77d5dedddc Fix LGTM warnings and recommendations 2020-04-22 18:01:43 +02:00
Francisco Paisana 6ddedd5972 moved pdu to common mac folder 2020-04-22 10:06:08 +01:00
Francisco Paisana c09f76ed6c unified stack task defer method 2020-04-10 22:30:59 +01:00
Andre Puschmann d35c9e2b89 nas: add support ot UE test loop mode B
extend GW-NAS interface to signal test mode activation.
The method is a noop in the normal GW but is implemented in
the TTCN3 DUT according to TS 36.509 for Mode B
2020-04-10 21:18:43 +02:00
Andre Puschmann 66a799661e gw,tft: move traffic flow template matching into own class
this prepares the reuse of the matching functions for the TTCN3 DUT.
create own matcher class that the GW uses.
2020-04-10 21:18:43 +02:00
Francisco Paisana a2ade9edd1 break down rrc_interface_types.h into multiple files. moved pdcp_config.h to same folder 2020-04-09 10:10:04 +01:00
Daniel Willmann 925225dbeb Implement Close UE Test Loop/Complete messages
This commit implements support for the CLOSE_UE_TEST_LOOP message.
Currently the mode is not saved and looping the data is not implemented.
Only the *_COMPLETE message is sent back as a response.
2020-04-04 22:51:43 +02:00
Andre Puschmann acc2948b45 nas: fix security handling
First of all, with this the NAS conformance tests pass with ciphering and
integrity turned on. Before only integrity was working.

Mainly the NAS was applying the integrity protection and/or ciphering
incorrectly because it wasn't taking the secuirty status of the PDUs
into account. Some where already correct, some not. The patch
streamlines the handling for all outgoing messages.
2020-04-03 22:22:04 +02:00
Xavier Arteaga 25312e81b4 SRSUE: cell select RRC MEAS CFO is carried to PHY Cell object 2020-04-02 13:52:23 +02:00
Xavier Arteaga 051e8fcc52 SRSUE: Apply default PHY config to SCell as well 2020-04-02 13:52:23 +02:00
Xavier Arteaga 6d355ab61e SRSUE: Fix HO initial CFO 2020-04-02 13:52:23 +02:00
Francisco Paisana 30ae2226c1 common interface for stack multiqueue tasks, background tasks and timers 2020-03-31 13:42:06 +01:00
Andre Puschmann 62e4bd9469 log_ptr: fix issue if accessing log_ptr that was reset already
during deinit of the UE/eNB it could happen that the log_ptr
was already set to null but the stack thread was still accessing
it through log_h->info()

i've moved the old macro into a new header and used as as much
as possible. there are still places in the code where similar
macros are used but we would need to change the variable name
to replace them
2020-03-31 12:32:52 +02:00
Andre Puschmann dbb8b6a360 nas: add helper for entering new state in FSM
the helper will log the event
2020-03-30 11:23:40 +02:00
Andre Puschmann d8680cc9a8 nas: add helper to pack attach request and send to RRC 2020-03-30 11:23:40 +02:00