Commit Graph

1628 Commits

Author SHA1 Message Date
David Rupprecht a89477a805 Hardcoded Samsung caps can be activated with if 1 in rrc_nr.cc 2021-01-12 20:23:35 +01:00
David Rupprecht bc2e230461 Enable UM mode for Amarisoft 2021-01-12 20:23:35 +01:00
David Rupprecht da0e64c51a Add non_crit_ext for irat parameter 2021-01-12 11:07:52 +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 020d0dacc8 add the additional sec cap to NAS attach request
use same capabilities that are signaled for EUTRA
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 910dc5af86 Merge branch 'next' into agpl_next 2021-01-02 17:41:50 +01:00
Xavier Arteaga b3200d9ef5 Renaming common UL/DL DMRS related types and initial NR PUSCH implementation 2020-12-30 13:39:08 +01:00
Andre Puschmann 52da9eb46f srsue,phy: fix setting of PHY log level
probably a regression from the new log system integration.
it was disabling PHY logs, from PRACH for example.
2020-12-28 21:21:44 +01:00
Andre Puschmann 3573644624 srsue: fix stdout metrics print when scells aren't configured yet
during MAC reset, scells are reset to and their PCI is set to UINT32_MAX
which results in malformatted stdout prints, see below:

Random Access Transmission: seq=16, ra-rnti=0x2
Random Access Transmission: seq=14, ra-rnti=0x2
 0   4   -24    24  -1.1u   1.0   140  0.50    0.0     0%   0.0   0.0    0.0    0.0    67%
 14294967295   0.0   0.0  -1.1u   0.0   0.0   0.0    0.0     0%   0.0   0.0    0.0    0.0     0%
 24294967295   0.0   0.0  -1.1u   0.0   0.0   0.0    0.0     0%   0.0   0.0    0.0    0.0     0%
 34294967295   0.0   0.0  -1.1u   0.0   0.0   0.0    0.0     0%   0.0   0.0    0.0    0.0     0%

this patch checks the configured PCI value against UINT32_MAX and
prints "n/a" in case the scells aren't set yet.
2020-12-28 21:21:44 +01:00
Xavier Arteaga 909e5de34f Fix NR workers 2020-12-28 10:11:08 +01:00
Francisco Paisana e27c0869e5 update RRC ASN1 to 2020-09 v15.11 2020-12-17 17:55:58 +01:00
Francisco Paisana 6803f48cc0 cell selection and reest rrc procedures were causing a callstack reentrancy problem. This issue was circumvented with a defer_task call 2020-12-17 01:39:59 +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
Francisco Paisana 0f693b36b2 changed pdu latency calculation to std chrono 2020-12-14 13:47:05 +01:00
Codebot 98425e0b2b Adding AGPL copyright to new files 2020-12-13 23:12:56 +01:00
Codebot 43082e8d6a enb/ue: turn various warning messages into info
turn events that may happen in the normal life of a eNB/UE
into info rather than warning to allow strict
warning/error checking in tests.
2020-12-12 15:59:27 +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 2e51cfc1a5 Added black cells with index function
Added new index functios
Use asn1 list functions for toAddMod and toRem lists
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 c0883291f6 rlc: pass TTI to get_metrics to calculate "real" LTE rx/tx rate
when retrieving the RLC metrics, the number of TTIs since the last
call are passed. This allows to calculate the actual rate
based on the LTE timing rather than only the system timing.
2020-12-12 15:59:27 +01:00
Andre Puschmann 1de2abb5f7 sync: log TTI and TTI jumps before calling Stack thread 2020-12-12 15:59:27 +01:00
Andre Puschmann 346c07a9f2 sync: update log TTI before logging first message 2020-12-12 15:59:27 +01:00
Xavier Arteaga c635b1e467 Initial NR DCI blind-search 2020-12-12 15:59:27 +01:00
Xavier Arteaga ebd87e63c0 Fix worker NR compilation 2020-12-12 15:59:26 +01:00
Xavier Arteaga d5d3594f49 Removed unused attribute 2020-12-12 15:59:26 +01:00
Xavier Arteaga d72820ddaa SRSUE: fix compilation 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 b501f2eeaf SRSENB/UE: Added 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 85afdf8ce3 SRSENB: moved phy workers to lte worker pool 2020-12-12 15:59:26 +01:00
Xavier Arteaga df5e3414dc Fix segmentation fault 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 6d3bf7089f SRSUE: use available carriers for inter-frequency measurement 2020-12-12 15:59:25 +01:00
Francisco 66712023bb remove unneeded includes of full rrc asn1 lib 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 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
Andre Puschmann 35373d1385 enb,ue: add cmdline arg to enable usage of default LTE sample rate
some RF boards might have issues with the sharp filters that are needed
for the reduced sample rate operation that we use by default.

This switch allows to use the default LTE sampling rates and
configure this at run-time, not compile time.
2020-12-12 15:58:33 +01:00
David Rupprecht a8074fe39d Fixed TTCN UE for starting a service request in rrc_idle 2020-12-12 15:58:33 +01:00
Pedro Alvarez 38822873e8 Stop T3402 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 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
Ismael Gomez 67690136be Select strongest cell after cell search (#2001)
* Select strongest cell in all frequencies when

* Change variable name
2020-12-12 15:58:33 +01:00
Ismael Gomez 709d69d55f Reset rv_idx after an adaptive retx in UE 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
Xavier Arteaga a5f9ea5654 SRSUE: force paging for every cell reselection procedure end 2020-10-28 16:50:18 +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 465c3d9186 proc_sr: remove info log when starting SR proc
this was a very noisy log that was printed in pretty much
every TTI because the BSR procedure starts a SR whenever
it needs to send a regular BSR. The SR is canceled when a UL
grant arrives but the log line stays there.

Since we are printing a log when we actually signal a SR
to the PHY, this line is not needed.
2020-10-28 12:05:53 +01:00
Andre Puschmann 1e3ad5b0dc proc_bsr: fix high priority channel trigger logic
this fixes the trigger logic for periodic BSRs. Previously we
would always trigger the "new data for highest priority LCID"
whenever new data becomes available for a LCID for which
a BSR has already been sent.

However, a BSR should only be sent if the priority is in fact higher
(lower int number).
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
Andre Puschmann d1ef5bd915 demux: log DL PDUs
instead of just printing the LCIDs that contain SDUs,
we use the to_string() function to log the entire MAC DL-SCH PDU
2020-10-28 12:05:53 +01:00
Andre Puschmann 0740154bff rrc,sync: fix two uninit vars
detected by Valgrind when running UE with TDD cell
2020-10-25 14:42:30 +01:00
Andre Puschmann 58776bc227
ue,sync: increase timeout for entering IDLE to 2s (#1941)
in ZMQ runs we've seen that entering idle could take quite
a bit of time depending how quickly workers get their samples
sent or reconfigurations done.

In one example up to ~160ms

this patch increases the maximum wait time to 2s.
2020-10-22 22:13:03 +02:00
Francisco Paisana 514deaf25b fix resetting of phy and mac during reestablishment 2020-10-22 19:55:46 +02:00
Xavier Arteaga caf37b8e62 Added serving cell index in UCI/CSI report trace 2020-10-20 11:53:28 +02:00
Francisco Paisana 0842ed9db1 fixed phy cell selection state update for the fail path 2020-10-16 15:54:42 +01: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 287c653755 proc_bsr: improve BSR logging to print name of triggered BSR instead of enum 2020-10-16 09:16:54 +02:00
Andre Puschmann 3994407f46 proc_bsr: fix BSR insertion in UL PDUs
the BSR trigger wasn't reset after includinga regular or periodic
BSR inside a PDU. This caused the muxing to include another BSR in the
next UL grant. For very small grants, for example with 6 PRBs, this
causes the UE to send way too many BSRs.
2020-10-15 11:52:13 +02: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 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
Francisco Paisana cae116932b rewrite the rrc::leave_connected() function to better match the standard. The measurements should not stop while in RRC_IDLE. 2020-10-08 10:51:18 +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
Xavier Arteaga 08e24d00af Fix TA console trace 2020-10-08 09:21:00 +02: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
Andre Puschmann 5e95fd4a43 ul_harq: reduce log level for new_grant_ul() if RNTI isn't found
this avoid logging a warning on UE shutdown if the MAC is already reset
but one of the PHY workers still decodes an UL grant for the old RTNI

21:30:29.254844 [RRC ] [I] Going RRC_IDLE
21:30:29.254848 [RRC ] [I] Proc "Go Idle" - Left connected state
21:30:29.259499 [PHY0] [I] [ 3865] Finished setting new PHY configuration cc_idx=0
21:30:29.259512 [PHY0] [I] [ 3865] Setting new PHY configuration cc_idx=0...
21:30:29.264190 [PHY0] [I] [ 3867] Finished setting new PHY configuration cc_idx=0
21:30:29.275036 [PHY1] [I] [ 3872] PHICH: hi=1, corr=1.0, I_lowest=1, n_dmrs=0, I_phich=0
21:30:29.275050 [MAC ] [W] [ 3872] Received grant for unknown rnti=0x46
2020-10-06 20:51:46 +02:00
Andre Puschmann 362461329a rrc: improve log message when detecting RLF 2020-10-06 20:51:46 +02:00
Andre Puschmann 76c648106f rrc: remove varMeasState for unknown neighbor cells
this fixes issue #1846 that appears to be related
to the enter/exit state for measurements that is kept
even after a cell disappears from the neighbor list
2020-10-06 16:28:09 +02:00
Andre Puschmann 829dfc4e60 metrics_stdout: fix precision calculation for 100%
the precision for 100% was causing the default value of -1 which in turn
cause to print the full precision resulting in ugly stdout plots.

before:
--------Signal--------------DL-------------------------------------UL----------------------
cc pci  rsrp    pl    cfo   mcs   snr turbo  brate   bler   ta_us  mcs   buff  brate   bler
 0   0   -10    74    0.0   0.0   0.0   0.0   200k     0%   0.0   0.0    0.0    0.0     0%
 1   0   0.0   0.0    0.0   0.0   0.0   0.0   150k100.000000%   0.0   0.0    0.0    0.0     0%

after:
--------Signal--------------DL-------------------------------------UL----------------------
cc pci  rsrp    pl    cfo   mcs   snr turbo  brate   bler   ta_us  mcs   buff  brate   bler
 0   0   -10    74    0.0   0.0   0.0   0.0   200k     0%   0.0   0.0    0.0    0.0     0%
 1   0   0.0   0.0    0.0   0.0   0.0   0.0   150k   100%   0.0   0.0    0.0    0.0     0%
2020-10-05 22:42:04 +02:00
Andre Puschmann e72219789e ul_harq: don't clear payload buffer during HARQ reset
this fixes #1791 which was caused by a race between
the PHY workers preparing a new UL-SCH PDU and the Stack resetting
the MAC, which in turn resets the HARQ processeses, which cleared
the buffer and set the length to zero.

Not explicitly clearing the buffer on a HARQ reset seems to be
fine since the PHY worker clears the buffer before starting to
pack a new PDU anyway.
2020-10-05 22:41:12 +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 8a917bdd06 fix RRC phy controller call to phy->set_config. Only the PCell was being configured 2020-10-05 12:08:16 +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 cfc77118d3 disable console print of scell activation command during handover 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 d02e8135fb metrics_stdout: reset n_reports var after writing intermediate table header 2020-10-02 17:00:19 +02: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 6e0abd30dd ue,phy_common: include Pcell PCI in cell measurements
this allows easier plotting in RRC when PHY cell
measurements already include the PCI
2020-10-01 20:15:41 +02:00
Andre Puschmann baf171d446 rrc: improve SR configuration logging
* move logging of SR max attempts into MAC logging
* log new MAC config whenever it is updated
2020-10-01 20:12:19 +02:00
Andre Puschmann bf7c2b800e proc_sr: log error when trying to enable faulty SR config 2020-10-01 20:12:19 +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 edd5c50f9a pass nas pdus after sending rrc reconf complete 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
Andre Puschmann 5a9b1865e4 proc_bsr: fix typo 2020-09-30 17:17:21 +02:00
Xavier Arteaga ef9d77c966 SRSUE: add PRACH config present field in PHY configuration structure 2020-09-30 17:10:48 +02:00
Francisco Paisana 924cc4f937 during cell selection, if the serving cell is ok, avoid calling serving cell configuration if the sibs are already acquired 2020-09-30 15:10:06 +02:00
Ismael Gomez 4e88daae21
Set DCI unpacking errors to info (#1781) 2020-09-30 10:04:08 +02:00
faluco dfeed52514 - Rename out_stream function to console. 2020-09-29 17:38:13 +02:00
faluco 62faef7c71 - Replaced all uses of the log::console method. 2020-09-29 17:38:13 +02:00
Francisco Paisana b3eb9651d6 disable cqi in scells during handover procedure 2020-09-29 12:10:42 +01:00
Ismael Gomez f4c7021a5f Appy phy configuration to current_phy_cfg before sending to PHY after HO 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 af3ff5985e removal of console print of last selected cell during the cell selection procedure. 2020-09-29 09:38:05 +01:00
Francisco Paisana c33e94fede fix conformace 8_5_1_1 failure 2020-09-28 23:45:13 +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
Ismael Gomez d671e39c93 Fix SINR not correctly considering noise. Missed dBm conversion 2020-09-28 20:50:12 +02: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
Sylvain Munaut 5783c01cbb tf_packet_filter: Improve support for the different filter types 2020-09-28 16:08:28 +02:00
Ismael Gomez bb691f0cbe
Fix priority order in BSR trigger. Was not being triggered if SRB2 data was pending in the buffer (#1771) 2020-09-25 21:02:06 +02:00
Ismael Gomez 8c30822350 Fix bug in update_measurements() not reporting in_sync in single carrier 2020-09-25 15:39:15 +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
Ismael Gomez 76bfc78147
Fix issues with Sounding-RS (#1761)
* Fix deadlock caused by update_measurements calling in_sync

* Fix overlapping SRS condition

* Do not use shortened PUSCH in transmissions and retx from RAR

* Revert "Fix deadlock caused by update_measurements calling in_sync"

This reverts commit f58c8c8c766f8f95baa3a3bf8287d8e25b2057ba.
2020-09-24 22:25:24 +02:00
Francisco Paisana 2d321231df fix reest proc. The reest proc state has to be set before launching the procedure, because the procedure can complete immediately on launch call 2020-09-24 14:00:31 +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 81ab4c1a65 make sure ho procedure waits for t304 expiry in all cases 2020-09-24 10:19:13 +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 d068d594af implemented rrc reestablishment procedure part after sending reest request 2020-09-23 14:59:38 +01:00
Francisco Paisana 7d6c9a1751 Add cause and cell pci to reestablishment console message 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
Ismael Gomez 399b986d0b
Fix deadlock caused by update_measurements calling in_sync (#1760) 2020-09-22 18:25:12 +02:00
Francisco Paisana eb370642ab verify cell selection observer is set before calling it 2020-09-22 17:09:18 +01: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
faluco f0d651ae8e - Fixed a leak in the MME class not releasing the static byte buffer pool.
- Now the pool gets destroyed on program exit using a unique_ptr.
- Removed manual cleanup() calls in all the code base to free the pool instance.
2020-09-22 18:00:50 +02: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
Andre Puschmann eeb2b904aa ue,rach: fix failing RACH proc when Msg3 grant RNTI matches current CRNTI
this was preventing that the Temp-CRNTI used in the RAR to be identical
to the currently configured C-RNTI of the UE.

The issue simply was that the RACH procedure was declared successful too
early, even before the Msg3 UL grant was filled with the Msg3 content.

The patch moves the logic that detects the successful completion of
the RACH procedure below the Msg3 packing.
2020-09-22 14:03:39 +02:00
faluco e14cb4b405 - Fix a missing thread join in the phy which caused a memory leak. 2020-09-22 09:17:01 +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 b6bbe8761a - Remove left over printf. 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
Francisco Paisana 97133894e6 the Ocs value used in the measReport triggering decision was not being set correctly. The enum of the cell individual offset in the measCfg was being cast to an int and stored. Instead what we want is to store the actual offset value using the ASN1 enum->number lookup table. 2020-09-18 13:17:32 +01:00
Xavier Arteaga 44c2412be2 SRSUE: silent PUSCH encoding error by dropping invalid grant 2020-09-17 22:39:56 +02:00
Francisco Paisana 739c0c5c00 altered plmn search procedure handling of failed cell searches. If a cell search procedure fails due to inability to select a cell or acquire SIB1, the plmn search carries on for other frequencies. 2020-09-17 16:43:58 +01:00
Andre Puschmann 8df388ba3e usim: fix typo in log 2020-09-14 21:20:59 +02:00
Ismael Gomez b397878d25 Fix comments in ue.conf 2020-09-14 16:54:47 +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 4c1d3ef7e8
Fix implementation of Random Access problem (#1689)
* Fix implementation of Random Access problem

* Apply AS activated condition on RLF before calling Reestablishment
2020-09-04 13:13:42 +02:00
Ismael Gomez f49fbd6d02
Fix the order of HO/reest measurement actions (#1696) 2020-09-04 12:18:12 +02:00
Andre Puschmann c16ac6c890 ue_stack: only push sync event to event queue is stack is still running
stopping the UE in ZMQ mode caused a dead-lock because the Stack was
stopped before the PHY causing the sync queue to overflow. Since we
use a queue-length of 1 in ZMQ, mode, the PHY sync thread was blocking to
push a new sync event while the stack thread was already stopped.

this patch makes sure no new sync events are queued after the stack has
been terminated.
2020-09-03 18:28:49 +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 51521ad8e4 Improved PDCCH blind search and fixed a few issues with ambiguous DCI size with Release 10 2020-09-03 10:45:06 +02:00
Andre Puschmann 14289ebcc6 dl_harq: lower log level when MCS changes in DL grant to debug
fixes #1489

this is normal behavior and should not result in a warning message.
2020-09-01 16:17:23 +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 46e1e101d3 removal of unecessary ho_ra_complete(false) in mac. In case of HO failure, the rrc should let the t304 expire 2020-08-29 20:06:08 +01:00
Francisco Paisana aed9120458 in case of RA problem during handover, the UE cannot trigger RLF. It has to let t304 expire, which will then trigger the reestablishment procedure with the right cause 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
Andre Puschmann 49a7a90698 mac: simplify BSR packing logic
simplify logic to check whether a BSR fits and, if so, which type.
before the check has been done in two places.

we now also accomodate for the CE subheader size.
2020-08-27 23:46:28 +02:00
Andre Puschmann 6364a4513c mac_pdu: fix issue when packing CE but no space left in PDU
we've not checked the return value when adding a new CE, like BSR or PHR,
for a UL MAC PDU. For very small UL grants, this could fail and
we need to remove the subheader again before packing the PDU.

This fixes issue #1649.
2020-08-27 23:46:28 +02:00
Francisco Paisana 5242f9422b fix deadlock in handover 2020-08-27 13:43:18 +01:00
Ismael Gomez 72cc4e0ca5 Stop ContentionResolutionTimer on RA error. Updated test 2020-08-27 10:04:42 +02:00
Xavier Arteaga df2c949417 Radio: add individual Rx gain and integrate in srsue
Fix compilation

Fix compilation

Add missing variable. Wasn't compiling

Radio: revert some changes
2020-08-27 09:31:05 +02:00
Xavier Arteaga 029f36b449 srsLTE: added efficient integer resampler and srsue/srsenb integration 2020-08-25 16:19:52 +02:00
Xavier Arteaga 1ff74da078 Remove wrong error message 2020-08-25 10:16:04 +02:00
Francisco Paisana 75b204bc52 fix phy ctrl call to cell selection observers 2020-08-24 22:10:32 +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 997552ee45 stop t304 when handover is successful 2020-08-24 17:48:50 +01:00
Francisco Paisana 1d8286eb62 always wait for t304 to expire in case of failed handover 2020-08-24 17:48:50 +01:00
Francisco Paisana ccc8ab70ef stop t304 on handover procedure exit 2020-08-24 17:48:50 +01:00
Francisco Paisana db15f43a77 set reestablishment cause correctly on handover failure 2020-08-24 17:48:50 +01:00
Francisco Paisana b1670c005b remove shadowed variables for reestablishment during handover 2020-08-24 17:48:50 +01:00
Xavier Arteaga 0e96ef3df0 Channel emulator takes SNR as input parameter 2020-08-24 10:46:11 +02:00
Francisco Paisana 8c9e596f89 refactored s1ap handover request interface. cleaned up rrc tenb s1 handover code 2020-08-21 00:05:58 +01:00
Francisco Paisana 7cd4f45d62 fsm refactor.
- avoid triggering directly a subfsm
- improved metafunctions
- other cleanups
2020-08-18 16:07:21 +01:00
Francisco Paisana 841b884796 remove extern C flags from common_helper.h 2020-08-18 13:54:23 +01:00
Francisco Paisana 5be5409f62 scaling governor function moved to common header file 2020-08-18 13:54:23 +01:00
Francisco Paisana 087805d222 add warning if scaling governor is not performance mode 2020-08-18 13:54:23 +01:00
Francisco Paisana 8d10aa906e move defer_task to switch case in the rrc 2020-08-17 22:49:40 +01:00
Andre Puschmann 24dfb03b9d rrc: defer manipulations of the RLC/PDCP arrays
all calls that manipulate the RLC and/or PDCP arrays suffer
from a high deadlock risk if a PHY worker holds the RLC
AM Rx mutex at the same time when the stack wants to carry
out this reconfiguration.

this applies to RRC Reconfigs, but potentially also to RRC Connection
Reestablishment or even RRC Connection Setup, although this should
seldom be the case.

By breaking the call stack between RLC->PDCP->RRC->RCL and
carrying out the reconfig as a single task without holding the
RLC readlock the deadlock should not happen anymore.

This should fix issue #1593
2020-08-17 22:49:40 +01:00
Xavier Arteaga 202ec283ff SRSUE: fix erroneous code in MUX 2020-07-28 09:31:34 +02:00
Xavier Arteaga 4e1e8cea1a SRSUE: MAC HARQ entities vector is fixed 2020-07-28 09:31:34 +02:00