Commit Graph

964 Commits

Author SHA1 Message Date
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
Xavier Arteaga d5d3594f49 Removed unused attribute 2020-12-12 15:59:26 +01:00
Xavier Arteaga f9643843a0 SRSENB/UE Fixed NR workers 2020-12-12 15:59:26 +01:00
Xavier Arteaga ac930003be SRSUE: Integrated NR workers 2020-12-12 15:59:26 +01:00
Xavier Arteaga a908fb6c5b Fix NR srsue/srsenb. Initial PHY NR in SRSENB. 2020-12-12 15:59:26 +01:00
Xavier Arteaga 2b2db90933 SRSUE: initial NR workers 2020-12-12 15:59:26 +01:00
Xavier Arteaga eed9405e40 Moved NR MAX MIMO layers to carrier 2020-12-12 15:59:26 +01:00
Xavier Arteaga c6798653be SRSUE: created initial PHY LTE worker pool 2020-12-12 15:59:26 +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 53d8319d2b SRSUE: protect secondary serving cell synch from concurrent access 2020-12-12 15:59:25 +01:00
Xavier Arteaga 287e651ef1 SRSUE: Protect nullptr buffer in secondary serving cell synch 2020-12-12 15:59:25 +01:00
Xavier Arteaga 959f37ae81 SRSUE: Renamed PHY scell_state to cell_state 2020-12-12 15:58:33 +01:00
Xavier Arteaga 4b8cd7ce92 SRSUE: protect scell state 2020-12-12 15:58:33 +01:00
Xavier Arteaga c5cb4d9984 SRSUE: Added time accurate SCell activation 2020-12-12 15:58:33 +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
Xavier Arteaga 32ea840a30 INTRA: better ring-buffer protection 2020-11-02 16:31:37 +01:00
Xavier Arteaga 369cffec00 More deterministic SCell search test 2020-11-02 16:31:37 +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
Andre Puschmann ddbf4e1645 metrics_stdout: print new table header if neighbour cells change
this fixes an issue where the stdout metrics isn't readable if the only
neighbour cell gets removed during the 10s where no table header is printed.

--------Signal--------------Neighbor----DL-------------------------------------UL----------------------
cc pci  rsrp    pl    cfo  pci  rsrp  mcs   snr turbo  brate   bler   ta_us  mcs   buff  brate   bler
 0   2   -66    61  -3.3k   1   -76    11    18   1.1   8.4M     3%   0.0    21    262   167k     0%
 0   2   -65    60  -3.3k   1   -76    12    19   1.1   9.6M     2%   0.0    22    476   214k     0%
 0   2   -65    60  -3.3k   1   -76    16    22   1.3    13M     3%   0.0    23   1.1k   734k     0%
 0   2   -64    59  -3.3k   1   -76    17    23   1.3    15M     2%   0.0    23    602   424k     0%
 0   2   -63    58  -3.3k   1   -77    20    25   1.4    19M     3%   0.0    23    501   304k     0%
 0   2   -62    57  -3.3k   1   -77    22    27   1.8    20M    10%   0.0    22    417   418k     0%
 0   2   -61    56  -3.3k   1   -77    24    28   1.8    25M     9%   0.0    23    396   439k     0%
 0   2   -61    56  -3.3k   1   -77    26    29   1.5    23M    22%   0.0    23    841   407k     0%
 0   2   -60    55  -3.3k   1   -77    27    31   1.3    27M    11%   0.0    23    890   1.1M     0%
 0   2   -59    54  -3.3k   1   -77    27    32  1.00    30M     3%   0.0    23    583   524k     0%
 0   2   -59    54  -3.3k   1   -77    27    32  0.92    32M     1%   0.0    23   1.1k   503k     0%

--------Signal--------------DL-------------------------------------UL----------------------
cc pci  rsrp    pl    cfo   mcs   snr turbo  brate   bler   ta_us  mcs   buff  brate   bler
 0   2   -59    54  -3.3k    27    31   1.1    30M     4%   0.0    23   1.2k   529k     0%
 0   2   -60    55  -3.3k    27    30   1.4    25M    18%   0.0    23    540   442k     0%
 0   2   -61    56  -3.3k    26    29   1.6    23M    21%   0.0    23    536   429k     0%
 0   2   -62    57  -3.3k    24    28   1.8    23M    13%   0.0    23    834   456k     0%
 0   2   -62    57  -3.3k   1   -78    21    26   1.6    20M     7%   0.0    23    723   425k     0%
 0   2   -63    58  -3.3k   1   -76    17    22   1.1    15M     3%   0.0    23    470   267k     0%
 0   2   -64    59  -3.3k   1   -77    17    22   1.3    15M     3%   0.0    23    167   280k     0%
 0   2   -65    60  -3.3k   1   -76    14    21   1.3    11M     2%   0.0    22     57   223k     0%
 0   2   -65    60  -3.3k   1   -76    12    19   1.2   9.0M     3%   0.0    21    135   182k     0%
 0   2   -66    61  -3.4k   1   -70   9.3    17   1.0   6.9M     2%   0.0    21    246   126k     0%
 0   2   -67    62  -3.3k   1   -75   8.2    16   1.1   4.9M     3%   0.0    20    0.0   122k     0%
2020-10-01 20:09:16 +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
Ismael Gomez c75c463263
Use SNR instead of SINR for RLF threshold (#1769)
* Use SNR instead of SINR for RLF threshold

* Send in/out-sync only for cc_idx=0
2020-09-24 22:26:05 +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
Ismael Gomez b94d24ed98
Take into account CRS from neigbhour cells when measuring interference (#1757)
* Take into account CRS from neigbhour cells when measuring interference

* fix std::isnormal compilation

* Fixed compilation of test

* Address comments

* Remove unused overrides
2020-09-23 21:46:03 +02: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
Ismael Gomez 5968157ea5
Protect better the access to shared variables in phy_common and metrics (#1750) 2020-09-22 14:32:08 +02:00
faluco 5acc1c9a73 - Cleaned up style in the PRACH class:
* Removed magic numbers.
* Reduced indentation of statements with early exists.
* Removed elses after a return statement.
* Trimmed unnecessary include files.
* Default initialized members in the class.
2020-09-21 09:50:20 +02:00
faluco 79f5b62551 - Calculate PRACH buffers on the fly when required instead of pregenerating all of them. 2020-09-21 09:50:20 +02: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
faluco 5e8a4c898d
Bring back the circular array object. (#1712) 2020-09-09 17:16:47 +02:00
Xavier Arteaga 52355024e7 SRSUE PHY: move mutex lock to cc worker and unlock for stack calls 2020-09-04 14:01:25 +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
faluco cfd3f51931
Import of srslog into srsepc and srsenb. (#1574)
* - Import of srslog into srsepc and srsenb.
* - Removed logger_file and logger_stdout files.
2020-07-30 19:17:23 +02:00
Xavier Arteaga 4e1e8cea1a SRSUE: MAC HARQ entities vector is fixed 2020-07-28 09:31:34 +02:00
Andre Puschmann 1199a79851 fix Scell sync for large cells
the PSS detection needs more temporary buffer than a full subframe.
we therefore need to allocate and initialize the sync object with
larger maximum size to support Scell search of large cells, e.g.
20 MHz

this fixes issue #1538
2020-07-21 18:35:53 +02:00
Xavier Arteaga 0192130742 SRSUE/SRSENB: UCI bits are carrier by the lowest serving cell index
SRSENB: Fix UCI in lowest serving cell index PUSCH transmission
2020-07-15 07:34:14 +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 d16897c09a scell_sync: fix missing dtor freeing sync object 2020-06-30 09:30:31 +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
Xavier Arteaga f8cc2d176d Fix typo 2020-06-25 17:42:56 +02:00
Xavier Arteaga 2f0c38fc70 SRSUE: avoid deadlock while configuring cell from stack 2020-06-25 17:42:56 +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
Xavier Arteaga 0e415260e9 SRSUE: scell_sync vector changed to map 2020-06-18 09:51:51 +02:00
Xavier Arteaga e0e8405285 SRSUE: initial scell sync
SRSUE: SCell Synch feedbacks delay

SRSUE: Implemented SCell Radio offset correction
2020-06-18 09:51:51 +02:00
Ismael Gomez 54b331c504
Adds best neighbour to CSV and stdout metrics (#1440) 2020-06-17 12:11:06 +02:00
Xavier Arteaga f04cf2090a Integrates number of samples in radio buffer
Fix minor issue

Radio: Fix minor bug and add unit test
2020-06-16 11:00:51 +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
Xavier Arteaga 89b24b54e5 Refactored radio class for acommodating multiple RF devices 2020-06-16 11:00:51 +02:00
Francisco Paisana 0d38c33a60 rename ue phy nr class 2020-06-11 15:50:36 +01:00
Francisco Paisana 27e5d98ef9 added vnf phy nr 2020-06-11 15:50:36 +01: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
Xavier Arteaga ac0e347d94 SRSUE: refactored sync.cc and clean up 2020-05-12 15:56:23 +02:00
Xavier Arteaga dc927b745a SRSUE Removed async_scell_recv.h 2020-05-12 15:56:23 +02: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
Francisco Paisana 12b2ea7dde remove warnings for base classes with no virtual dtors 2020-04-27 22:19:08 +01:00
yagoda 8e0b106c22 fixing some warnings from LGTM 2020-04-27 20:59:40 +02:00
Andre Puschmann 1e0c8ead4c srsue,sync: fix TTI gap calculation and reporting
The current TTI gap calculation assumes strict continuity
of radio time stamps, even when retuning, changing sample rate, etc.

This is certainly desireble but not necessaritly the case and may cause
issues when negative time gaps or too large gaps are detected and reported
to the stack.

this patch makes the assumption that valid TTI jumps are between 1ms
and 1s and that larger gaps are the result of screwed time-stamps
or too long radio operations.
2020-04-27 17:01:02 +02:00
Xavier Arteaga 58803d1b3e Added UL EARFCN map and UE PHY interface cleanup 2020-04-23 09:00:45 +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
Xavier Arteaga 11a2d2cc4a Fix and tidy up time offset in srsue 2020-04-20 16:10:01 +02: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
Xavier Arteaga 198684ce32 SRSUE: all TA control logic into a single class and faster TA response 2020-04-10 15:57:41 +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 e9813375eb SRSUE: set SNR threshold for MIB decoding 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
Andre Puschmann cf28276a3a nas: add helper function to reset NAS security context 2020-03-30 11:23:40 +02:00
Andre Puschmann 94c6034339 nas: rename start_attach_request to start_attach_proc
this is to better differentiate from "send_attach_request" that
only packs and send the actual attach request message. The
entire attach procedure may include PLMN search, etc.
2020-03-30 11:23:40 +02:00
Andre Puschmann 15c47fab56 nas: adding t3402 to restart attach after initial attach attempt counter expired 2020-03-27 18:15:37 +01:00
Andre Puschmann 7ef56cb637 nas: add an attach attempt counter as described in 24.301 2020-03-27 18:15:37 +01:00
Francisco Paisana 599588ff51 removed uneeded locks in the rlc, moved ue stack get_metrics to stack thread, solved the idle procedure double-locking 2020-03-25 19:18:00 +00:00
Ismael Gomez 95c6916987
Improve robustness in RF Overflow (#1124)
* Use task id to track old background tasks in RA procedure

* Improve robustness against RF overflow in PHY

* Increase SNR out-of-sync threshold

* Do not change frequency if it's the same

* Increase sync priority

* Increase time to start receiving to reduce input buffer occupation

* Use scoped lock in sf_worker
2020-03-25 16:56:32 +01:00
Francisco Paisana 8e837e173d printf has already a way to pad spaces. If we use it, we can avoid accidentally adding extra logs because we did srslte::logmap::get("MAC") instead of srslte::logmap::get("MAC ") 2020-03-24 22:36:27 +00:00
Francisco Paisana aeed623734 removed pdu processing from the ue rrc cmd queue. Instead, now the rrc processes the incoming pdus right away. This is essential to fix the security cmd issue in the ue 2020-03-24 12:28:12 +00:00
Andre Puschmann b9a2217355 fix uninit vars reported by Coverity 2020-03-24 09:47:07 +01:00
Andre Puschmann 3f10224729 refactor airplane mode simulation and move to NAS
- move handling to NAS
- use switch off to enable airplane mode (don't wait for EPC response)
- add tiny FSM to control airplane mode activation/deactivation
- only start on/off counter after state has been entered
2020-03-23 13:36:25 +01:00
Francisco Paisana e91a7ea513 removed stack-mac interface dedicated methods. We use now the task dispatch methods instead 2020-03-22 11:50:58 +00:00
Francisco Paisana de03c96c3b mac::process_pdus now uses the stack task dispatch interface 2020-03-22 11:50:58 +00:00
Francisco Paisana 7f6bde59fc move write_pdu_pcch and write_pdu_bcch_bch to stack thread 2020-03-22 11:50:58 +00:00
Francisco Paisana de3c28e52d added task dispatch capabilities to stack interface 2020-03-22 11:50:58 +00:00
Francisco Paisana 46a1be3e76 updated mac-rlc interface to use unique_byte_buffer 2020-03-22 11:50:58 +00:00
Francisco Paisana 82cb6baef0 now the whole ue and enb mac uses the logmap 2020-03-20 11:32:03 +00:00
Francisco Paisana 45bc123967 remove manual tti counters from the rrc 2020-03-19 21:52:53 +00:00
Francisco Paisana 138347b6b5 nas using stack timers 2020-03-19 21:52:53 +00:00
Francisco Paisana 770f04b92a the rrc now only works with the stack latest tti, instead of mac's tti 2020-03-19 16:47:55 +00:00
Francisco Paisana e3e5b5be11 removed tti from some mac subcomponent interfaces 2020-03-19 16:47:55 +00:00
Francisco Paisana d3f49d0e3c changed interface sync-stack to allow tti jumps > 1 2020-03-19 16:47:55 +00:00
Francisco Paisana e73cbb09b0 created tprof statistic for sliding windows 2020-03-19 10:59:37 +00:00
Ismael Gomez cf4f4508ce Normalize throughput in CSV/stdout metrics with respect to number of TTIs 2020-03-16 22:58:09 +01:00
Ismael Gomez a1f1b44e26 Fixed flush period 2020-03-16 11:39:39 +01:00
Ismael Gomez 1da7b2c8b9 Fix compilation issue 2020-03-16 11:39:39 +01:00
Ismael Gomez 23cc42ce9f CSV metrics per carrier. Add options to flush file earlier and append to file 2020-03-16 11:39:39 +01:00
Xavier Arteaga e832769ae6 Updated copyright 2020-03-16 11:26:06 +01:00
Andre Puschmann 70ffe79b43 add support for periodic airplane mode simulation in srsUE 2020-03-13 17:35:03 +01:00
Ismael Gomez e8b8c9922e
Add RF per-channel frequency band constraints (#1026) 2020-03-12 23:06:09 +01:00
Xavier Arteaga 76408b195e Rename TX_DELAY and FDD_HARQ_DELAY_MS 2020-03-11 21:16:36 +01:00
Xavier Arteaga e8f9bfc6ba Addition of PRACH TA correction 2020-03-11 16:25:56 +01:00
Pedro Alvarez 96c82b3fc6 Moved PDCP configs to pdcp_config.h. Added `as_security_cfg_t` structure to hold access stratum keys.
Refactored PDCP, RRC and USIM accordingly.
2020-03-11 09:00:38 +00:00
Andre Puschmann 5b8b718482 simplify NAS security handling and fix missing call in act test mode complete
add extra method to apply NAS security config, if configured,
that can be used by each NAS message sender
2020-03-06 18:07:21 +01:00
Ismael Gomez 4e12405fff
Remove radio_multi class and organize channels, ports and carrier buffers (#1019) 2020-03-06 15:26:48 +01:00
Andre Puschmann 664170fec6 pcap: add CC index when writing PCAP 2020-03-05 20:46:14 +01:00
Andre Puschmann df31a5c4cc store CC idx in DL/UL HARQ entity 2020-03-05 20:46:14 +01:00
Francisco Paisana fed06138b9 moved rach_detected to stack thread. Created a more friendly interface to enqueue tasks in stack 2020-03-03 21:03:21 +00:00
Andre Puschmann 8e4f2a4d59 add UE parameter to enable TTI stats calculations 2020-03-03 16:22:04 +01:00
Andre Puschmann a8bbe551ac move thread class into srslte namespace to avoid ambiguity between std::thread 2020-03-03 16:22:04 +01:00
Andre Puschmann 8b46f631c1 add basic TTI stats in stack 2020-03-03 16:22:04 +01:00
Andre Puschmann ae4cfb50f2 print warning to console if TUN interface couldn't be setup 2020-03-03 15:25:53 +01:00
Andre Puschmann 51864bc03c rrc: print release cause when receiving rrc connection release 2020-03-01 18:26:45 +01:00
Francisco Paisana ac52208409 removed most of clang-tidy warnings, introduced logmap in asn1, fixed info object naming in s1ap and ngap for successful and unsuccessful outcomes 2020-02-28 18:03:29 +00:00
Andre Puschmann dffa2af461 fix NAS re-attach after detach request from network
needed to add a timer to delay transmission of attach request
to allow RRC release on eNB side
2020-02-28 18:09:21 +01:00
Francisco Paisana e859d622c7 added logref class to forbid logmap pointer invalidation. Created a test for the logref, and introduced it in the scheduler, rrc and nas 2020-02-28 11:33:26 +00:00
Francisco Paisana 5a64fc0a93 sib_acquire_proc is not tti-driven anymore. No need to call run explicitly 2020-02-20 20:48:36 +01:00
Francisco Paisana 925ac862cb sib acquiring is failing for sib2 2020-02-20 20:48:36 +01:00
Francisco Paisana c29f08d8d5 refactored si acquisition procedure to use stack timers. Also created an interface that is going to be used for the task/timer handling 2020-02-20 20:48:36 +01:00
Francisco Paisana 22f51bb30b made cell select non-blocking using background threads 2020-02-18 09:47:33 +01:00
Ismael Gomez 72e6fa40fc Fix multiple issues with DCI sizes when using CA. 2020-02-17 11:21:34 +01:00
Ismael Gomez 4fb83ae26d Run configure_prach_params as a background task 2020-02-16 21:27:24 +01:00
Andre Puschmann 265037c202 some tiny MAC code refactoring and typo fixing 2020-02-15 19:33:25 +01:00
Xavier Arteaga 6672f6df0f Minor aesthetic changes in intra measure class and changed scell_search test arguments 2020-02-13 14:25:00 +01:00
Xavier Arteaga 344016ef0a Refactored and commented SRSUE's Intra measure component 2020-02-13 14:25:00 +01:00
Francisco Paisana c76cdc6cea refactored the serving cell config procedure. there was one more state than it was needed. 2020-02-10 22:03:16 +01:00
Andre Puschmann c7343cf6d8 protect sf_buffer from overrun in receive_samples
this patch adds a buffer len paramter to the receive_samples() call
that protects the (also) provided buffer from overflowing.

currently each call to srslte_ue_sync_zerocopy() which then calls receive_samples()
relies on a buffer that is "big enough". But that buffer is sometimes
2 subframes, sometimes 3 or 5, sometimes has space for the maximum PRB size, sometimes
only for 6 PRBs (i.e. during cell search).

By extending the interface to pass the buffer size we can make sure that
only samples are received that actually fit inside the provided buffer.
2020-02-07 10:21:30 +01:00
Andre Puschmann 7c1b4c1f12 add support for IMEISV when requesting UE idendity 2020-02-07 10:19:42 +01:00
Ismael Gomez f2851b037e Fix concurrency issue in set_crnti() 2020-02-06 20:30:09 +01:00
Xavier Arteaga 4d3c28ff97 SRSUE: wait for valid RSRP measurement before adquiring SIBs during cell search 2020-02-06 09:14:05 +01:00
Xavier Arteaga fe199e6be2 SRSUE: Undo enable/disable RA procedure flag 2020-02-03 12:51:46 +01:00
Xavier Arteaga f8294fb9df SRSUE: RRC measurements refactor and more fixes 2020-02-03 12:51:46 +01:00
Ismael Gomez 52716f8716 Process HO complete in the background to avoid heap-after-use bug when PHY measurements are reported during a HO
rrc_meas refactor. Need to split commit

Fix typo

Temporal commit

Apply rx_gain_offset to neighbour cell measurements

srsLTE: modify TESTASSERT Macro to follow codeline

SRSUE: prevent RRC from having serving cell in neighbour list

SRSUE: DL HARQ does not need Time Aligment Timer. UL is disabled using PUCCH resources release

SRSUE: extend intra-frequency to CA SCell

SRSUE: fix confusing/ambiguous code in the RRC measurements and fix concurrency issue

SRSUE: remove RRC measurement report triggers when measurements are modified or HO succesful

SRSUE: fix compilation issues and Reest SIB indexes

Fixes sync using incorrect cell configuration when search cell does not find a correct cell

Small refactor to remove measurement report triggers always after removing measurement

SRSUE: Removed SIC PSS from UE

SRSUE: fix inter-frequency reestablishment and added more traces

SRSUE: Fix compilation issue
2020-02-03 12:51:46 +01:00
Francisco Paisana ea777d92e8 applied new logmap class to nas 2020-01-29 14:20:43 +00:00
Ismael Gomez 17f9ff326b Expose in-sync and out-of-sync constants to ue.conf 2020-01-29 11:46:55 +01:00
Andre Puschmann b0bfc7956d use const& in metrics interface 2020-01-14 20:52:09 +01:00
Andre Puschmann 77522a6b69 add srsUE parameter to change netns before creating TUN in GW 2020-01-14 20:52:09 +01:00
yagoda 260648582e small formatting fix 2020-01-14 16:53:57 +01:00
yagoda fc1c506d1f refactoring TA command structure in UE 2020-01-14 16:53:57 +01:00
Xavier Arteaga c92dce71b7 srsLTE: AGC only uses boundaries for requesting gain to Radio 2019-12-23 22:57:37 +01:00
Xavier Arteaga 384c420c7c SRSUE: fix phy workers concurrency issue 2019-12-19 13:01:05 +01:00
Andre Puschmann 4a9e3728c9 add condtional variable for PHY initialization and configuration
adding a cond variable and mutex to protect init and (re-)config of PHY
currently this is only used during init. If the stack couldn't be
initialized but the PHY init thread was already started, we need to
properly wait until this is done
2019-12-18 11:25:36 +01:00
Andre Puschmann 3127f59b4c wait with init of GUI until cell is found and initialized
with the stack refactor we've introduced a regression in which
the GUI was started too early when no cell was found yet.

this caused the GUI to be initilized with only one Tx port. When connecting
to a cell with ports, the GUI plotter would then write
into unitialized memory.
2019-12-16 21:03:08 +01:00
Pedro Alvarez c5979f59eb Clang format UE, eNB and lib (#850)
* Clang-formated UE, eNB and lib.
* Fixed compiling errors from clang-format.
* Fix linking issues introduced by clang-format
* Fix poor formating in initializing arrays of arrays.
* Fix mistake in conflict resolution on rm_turbo.c
* Re-apply clang format to gtpc_ies.h
2019-12-16 16:04:22 +01:00
Andre Puschmann 8a064cd3a6 pass msg_type from caller when logging RRC message
before the type of some message wasn't displayed correctly,
like SIBs, for example because the logger didn't
know the filed to retrieve the type string
2019-12-16 12:49:07 +01:00
Andre Puschmann fa2821a4e7 fixing periodic measurment reporting
fixes various issues with unset timers, interval parameters, etc.
with those fixes, TC_8_3_1_1 and TC_8_3_1_2 pass
2019-12-13 13:25:24 +01:00
Francisco Paisana d59016ae68 use of srslte::log* type for ASN1 logging. Initialization of the asn1 and rrc_asn1 loggers done now in both the ue and enb 2019-12-12 15:45:24 +00:00
Xavier Arteaga bcde542111 SRSUE: fix typo 2019-12-12 12:04:36 +01:00
Xavier Arteaga a8763cb7a0 SRSUE: Added Cell PCI in console trace 2019-12-04 15:30:07 +01:00
Xavier Arteaga d96836a0fa SRSUE: Stack TTI based purely in radio timestamp 2019-12-04 15:29:43 +01:00
Xavier Arteaga 6d896ee453 Fixed more static code analysis warnings 2019-12-02 09:47:22 +01:00
Xavier Arteaga b48bb0d754 Removed atof, atoll and atoi calls 2019-12-02 09:47:22 +01:00
Xavier Arteaga b4b1ab94af SRSUE RRC: new PHY unknown sync state, cell select waits for PHY in-sync 2019-11-28 16:33:35 +01:00
Xavier Arteaga 67935d2b99 SRSUE: RRC blocks MAC RA procedure during reestablishment 2019-11-28 16:33:35 +01:00
Andre Puschmann 8ef0d6c6ca do not automatically consider cells for which a measurment has been received as "in sync"
the in_sync flag has been misused in some parts of the code
receiving a PHY measurement for a cell does not automatically
mean that we are "in sync", as it is used in RRC as a condition
to indicate if we are camping on cell

the in_sync/out_of_sync condition should only be altered by the
corresponding functions sent from the PHY for the currently selected
cell (and not automatically for all cells)

the commit also removes the deletion of cells which are not "in sync"
from the list of neighbor cells. Instead, RRC calls a clean-up function
peridically that deletes old cells eventually.
2019-11-28 16:33:35 +01:00
Xavier Arteaga f5e4ff9f4d SRSUE: RRC Reest Procedure Refactor 2019-11-28 16:33:35 +01:00
Xavier Arteaga f37a096f10 SRSUE: Refactored/Fixed RRC connection Re-establishment and minor CLang Format/Tidy fixes 2019-11-28 16:33:35 +01:00
Francisco Paisana 54992e72f1 fixed and simplified multiqueue task api to avoid dangling pointers. 2019-11-28 11:57:41 +00:00
Francisco Paisana b2d3c2a150 fix compilation issue 2019-11-28 11:57:41 +00:00
Francisco Paisana ac4d3b9624 std::functions do not accept move-only captures. So I had to create a wrapper earlier. In this PR, I cleaned a bit the previous API for the code to be a bit more readable 2019-11-28 11:57:41 +00:00
Francisco Paisana 177e880293 removed extra threads from enb rrc 2019-11-11 15:20:10 +00:00
Andre Puschmann 1a7142d73f fix GW init procedure and set pool instance in ctor 2019-11-07 16:25:36 +01:00
Andre Puschmann d25a734200 fix uninit value in NAS and move emm_info on stack 2019-10-25 10:32:35 +02:00
Francisco Paisana d2c56caf7e applied new timer class to the whole code base 2019-10-23 19:33:25 +01:00
Francisco Paisana b254bdbb93 typedefed the proc_result_t<void> to become proc_state_t 2019-10-23 18:19:25 +02:00
Francisco Paisana f2d88e5a5b simplified NAS rrc connection request procedure
move non-type-specific methods of proc_t to its base class.
procedure state machine was simplified via a future-type. Now procedures dont get stuck until the user reads the procedure outcome.
made the NAS procedures more event trigger/reaction-based.
2019-10-23 18:19:25 +02:00
Francisco Paisana 8864787f59 added the continuation functionality to procedures via the "then()" method. 2019-10-23 18:19:25 +02:00
Francisco Paisana c1be118d1d new wrapper-based design for stack procedures. Removes extra base class, gets rid of spurious copies/moves during the pop(), and allows the use of a non-default ctor() 2019-10-23 18:19:25 +02:00
Francisco Paisana 8980810061 added some util print functions and fixed the issue with sync::cell_select when the last cell search was not successful 2019-10-23 17:32:32 +02:00
Andre Puschmann 82e3fd1052 fix uninitialized vars in RRC 2019-10-18 16:38:55 +02:00
Andre Puschmann 891a66a2e5 make the establishment cause a paramter when sending a connection request
needed to signal a mo_sig establishment cause after a RLF
2019-10-18 16:38:55 +02:00
Andre Puschmann c24b25f42e after RLF store PCI of current serving cell
the PCI is needed for the reestablishment request in case
the new serving cell has changed
2019-10-18 16:38:55 +02:00
Francisco Paisana 9bcb268421 added for-range loop and bool decay checks to clang-tidy. Applied some of the recommendations of clang-tidy to nas.cc 2019-10-18 12:36:17 +02:00
Andre Puschmann cf548fe807 nas: add handling of T3410/T3411 2019-10-15 10:13:21 +02:00
Andre Puschmann 35307a047a make UE switch_on non-blocking
this allows a simpler main that just signals NAS to switch on the UE
but doesn't block until the action is completed.

For making sure the UE also attached if the first attempt failed
the NAS needs to be extended to support the correct timers.
2019-10-15 10:13:21 +02:00
Francisco Paisana 81a466a641 since we moved cell search to the background thread, cell reselection prints a error message that it cannot start. In fact it already started. It is just waiting for the cell search to finish. This PR fixes this 2019-10-14 15:18:15 +02:00
Francisco Paisana e67f66e539 moved cell search completed signal from the background thread to the stack thread 2019-10-14 11:44:40 +02:00
Ismael Gomez 1d83bb08e2 Changes in ACK procedure to support CA. Tested 1 cell in SISO/MIMO 2019-10-14 11:20:35 +02:00
Francisco Paisana b1496317d5 fixed the pcch proc issue by letting the cell selection explicitly propagate its result to the pcch_process_proc 2019-10-11 15:22:32 +02:00
Andre Puschmann 3c6ff0da30 make NAS logging less verbose 2019-10-09 11:53:27 +02:00
Andre Puschmann c5f52adfba nas: fix issue in which NAS wouldn't allow to attach once it failed
the main issue was the plmn_selected variable. the solution
was to create a function to enter the deregistered state that resets the variable
and performs all other actions that need to be performed, like clearing
EPS bearers.

The patch also extends the SS to support AT commands to enable/disable
data services and now succesfully passes TC_9_2_2_1_7
2019-10-09 11:34:49 +02:00
Francisco Paisana 2fb830fcfa moved cell search to background task thread pool, and provided a stack interface to rrc to call "start_cell_search". Once completed, the background task signals back to RRC 2019-10-04 22:01:44 +02:00
Andre Puschmann 0467d8bc84 rework neighbor cell handling 2019-10-04 16:25:02 +02:00
Andre Puschmann c7f0caa24a add TTI field to MAC dl/ul grants and fix PCAP to include TTI 2019-10-02 16:49:46 +02:00
Francisco Paisana 6db0e474be moved RA waiting procedure to a background task of the stack thread pool 2019-10-02 11:04:47 +02:00
Xavier Arteaga efdec15964 Renamed lock_guard (lg) to lock 2019-10-02 11:03:03 +02:00
Xavier Arteaga 665f899a74 Fixed some coverity and Clang tidy warnings 2019-10-02 11:03:03 +02:00
Andre Puschmann f94d2537a3 nas: send identity response integrity protected if security ctxt is present 2019-10-01 20:59:00 +02:00
Andre Puschmann bb84b27f0b fix RRC connect proc in NAS to allow reattch after detach 2019-10-01 20:59:00 +02:00
Francisco Paisana e92632e729 zero-initialized mbms rrc interface types 2019-09-30 21:05:32 +02:00
Francisco Paisana fc9bb3c934 removed rrc asn1 header include from the ue_interfaces and phy 2019-09-30 21:05:32 +02:00
Andre Puschmann 2f47010eb6 fix various uninitialized vars 2019-09-24 13:23:30 +02:00