Commit Graph

1709 Commits

Author SHA1 Message Date
Xavier Arteaga 959f37ae81 SRSUE: Renamed PHY scell_state to cell_state 2020-12-12 15:58:33 +01:00
Xavier Arteaga 008ef3c10c Fixed override methods in MAC test 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
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
Andre Puschmann cd1ca4d095 mac_test: add LBSR test
the test checks the correct packing of an LBSR when a SDU couldn't
be added before. This happended because RLC couldn't provide a new PDU.
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 454162cea7 Deleted nas_interface_stack. 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 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
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 debbab93e8 mac_test: cosmetic change 2020-10-28 12:05:53 +01:00
Andre Puschmann e89254ad1f mac_test: fix mac_ra_test according to BSR changes
the BSR routine had a bug in which it would generate a BSR even
before the reTx timer expires if new data becomes availble
for a LCID that already had data and a BSR was already sent.

The RA test here relies on a BSR in the generated MAC PDU to pass.

However, since after fixing the BSR bug the PDU the MUX unit
no longer generates a BSR, we need generate data for a LCID
which has higher priority than the one for which a BSR has
already been sent.
2020-10-28 12:05:53 +01:00
Andre Puschmann d6ef66b0dc mac_test: add periodic BSR test 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 03b88f6149 Added noise to neighbour cell search test 2020-10-20 11:53:28 +02:00
Xavier Arteaga caf37b8e62 Added serving cell index in UCI/CSI report trace 2020-10-20 11:53:28 +02:00
Andre Puschmann 3b1ae970b9 metrics_test: fix uninit variable 2020-10-18 15:56:16 +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
Andre Puschmann d51a060bfa nas_test: fix potential out of bounds access 2020-10-18 15:56:16 +02:00
Andre Puschmann 1bbbc9d717 rrc_phy_ctrl_test: fix uninit memory 2020-10-18 15:56:16 +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 7352bfa4bd mac_test: add unit test for retxBSR timer
this test varifies the correct operation of the retxBSR timer.
the first PDU includes a long BSR to indicate more LCGs have
data to transmit. The retxBSR timer is started and subsequent
PDUs should not send a regular BSR.

After the retxBSR timer expires, a UL PDU should again include
a BSR.
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 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