Commit Graph

690 Commits

Author SHA1 Message Date
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