Commit Graph

2569 Commits

Author SHA1 Message Date
Ismael Gomez 0de984d12f srsue: protect access to phy common shared measurement 2021-10-21 21:31:21 +02:00
Pedro Alvarez 7155de91ca Added command to forcefully flush the buffers on srsenb and srsue. 2021-10-21 14:50:44 +01:00
Codebot e39b9f3191 Adding AGPL copyright to new files 2021-10-21 12:36:22 +02:00
Codebot 9d7836817c Merge branch 'next' into agpl_next
# Conflicts:
#	lib/include/srsran/common/signal_handler.h
2021-10-21 12:36:20 +02:00
faluco d7e8d6bf65 Fix data race in mux_nr::add_bsr_ce. 2021-10-20 18:08:41 +02:00
Carlo Galiotto 4e3564a8a2 mac,stdout: add PUSCH and PUCCH SINR to stdout
This commit implements the PUCCH and PUSCH metrics in the MAC,
to be displayed in the eNB console.

Signed-off-by: Carlo Galiotto <carlo@srs.io>
2021-10-20 17:47:00 +02:00
Carlo Galiotto ebaa71d190 ue,stdout: fix the SNR formatting in UE console (NR)
When the SNR value is INF, the conversion to (int) causes
-2147483648 to be displayed in the UE console.
This commit fixes the formatting, so that the values INF or
NaN would be displayed as N/A

NOTE: The issue of getting an INF value for the reported SNR metric
still needs to be addressed separately.
2021-10-20 17:47:00 +02:00
Ismael Gomez d32bfa3756 remove warning when UE is already in camping 2021-10-19 15:16:52 +02:00
Andre Puschmann 97d43eb044 mac_nr_test: add PDU packing test for two SDUs from different LCs 2021-10-19 11:51:39 +02:00
Andre Puschmann d4a4da7ecc mux_nr: fix tiny issue in mux unit when adding SDUs of different logical channels
this issue has a tiny affect when adding new SDUs from different logical channels
to an UL MAC PDU.

Since the MAC subPDU header is accounted for twice, less SDU payload may be packed.

The patch calculates the required header space and accounts for it in the scheduling.
Howerver, it is only substracted from the available space when an SDU was actually added.
2021-10-19 11:51:39 +02:00
Andre Puschmann cc87af2986 ue,rrc: simplify code 2021-10-16 21:50:07 +02:00
Francisco 08c96b0e35 nr,ue,mac: added TODO comment warning about missing functionality in srsue::mac_nr::reset method 2021-10-15 18:28:09 +01:00
Francisco 81174bda64 nr,ue,rrc: release NR logical channels during RRC release 2021-10-15 18:28:09 +01:00
Xavier Arteaga e93503bae3 Minor changes 2021-10-15 18:19:04 +02:00
Xavier Arteaga 3c40cd2840 Improved NR PHY logging info 2021-10-15 18:19:04 +02:00
faluco dacf40f63e Delete move constructor and move assignment operator explictly for mac_pcap_base and s1ap_pcap classes.
Move emergency handlers header file into the support folder.

Refactored signal handling:
- Remove the dependency with the running static variable in the header file.
- Move implementations down to cc files.
- Allow specifying a new signal handler that will be used to stop the applications.
- Move signal handling files to support.
2021-10-15 15:05:37 +02:00
faluco 9075251627 Move the cleanup code from the signal handlers down to the new emergency handlers for the ue, epc and enb. 2021-10-15 15:05:37 +02:00
Bedran Karakoc 0507d9df2b nas,nr: Fix ciphering and sequence numbers in NAS 2021-10-15 14:47:22 +02:00
Andre Puschmann c467c3c0e6 ue,rrc_nr: remove warning when zp_csi_rs_res_to_add_mod_list is not present
we currently don't enable ZP CSI in the eNB so the warning can be removed.
2021-10-15 10:58:31 +02:00
faluco 5f648d195c Implement JSON reporting in the scell search test. 2021-10-15 10:44:37 +02:00
Andre Puschmann 908c469f30 sync: don't fail camping on cell if current and target srate match
this fixes #3437. The check/requirement for target srate to be different
to current srate isn't needed, and in fact fails for 6 PRBs where both are
indentical always.
2021-10-14 21:21:58 +02:00
Andre Puschmann 1068a84bd0 sync: fix typo 2021-10-14 21:21:58 +02:00
Andre Puschmann fed53c91d0 mac_nr_test: add TC to reproduce #3325
extend the rlc_dummy to allow providing different RLC PDUs.
add TC for issue #3325 but leave the original TV because it is very large.
2021-10-14 11:16:37 +02:00
Andre Puschmann 7cbd3d50b7 mac_sch_pdu_nr,bsr: fix length check for BSR
fix nasty bug where the length calucation for the LCID
was taking the bsr_format_nr_t that was having the same name.
2021-10-14 11:16:37 +02:00
Xavier Arteaga 1bffebe0bf Removed cached PRACH signals 2021-10-14 09:46:15 +02:00
Alejandro Leal Conejos 1a64c6adad Enum fixes so clang 12 can build the repo 2021-10-14 08:48:04 +02:00
Xavier Arteaga 753edc7d7b Force NR PRACH scaling to 0.99 of the DAC dynamic range 2021-10-13 11:00:03 +02:00
Xavier Arteaga c7940f455c More clear equation to calculate number of PRACH subframes 2021-10-13 11:00:03 +02:00
Xavier Arteaga 4cea3d92bd NR PHY accepts multiple SF PRACH sequence 2021-10-13 11:00:03 +02:00
David Rupprecht 5c44d774d0 Added 5G Metrics 2021-10-12 10:48:10 +02:00
David Rupprecht 59e847ba08 Added NAS 5G args 2021-10-12 10:48:10 +02:00
David Rupprecht 5910d8847a Split NAS security ctxt 2021-10-12 10:48:10 +02:00
Codebot cf4b0f1739 Merge branch 'next' into agpl_next 2021-10-10 23:12:22 +02:00
Francisco b8976ca463 nr,ue,rrc: avoid configuring the CSI until NR RA is complete 2021-10-08 12:15:55 +01:00
Xavier Arteaga 9d4fd1c5cc Add NR SFN from SSB assertion and fix dummy SSB scheduling 2021-10-08 09:49:07 +02:00
Xavier Arteaga 954d6f5f8d Removed sfn_4lsb from debug trace 2021-10-08 09:49:07 +02:00
Xavier Arteaga 5afe20e7da UE loads SSB config from helper method 2021-10-08 09:49:07 +02:00
Francisco 47e5e85449 refactor: clean unnecessary includes of the asn1/rrc_nr.h 2021-10-07 23:08:07 +01:00
Joaquim 82ae0e6c37
nr_phy test: add AWGN channel simulator, add High Speed Train channel (#3288)
Add channel simulator to nr_phy tests.

UL and DL channel simulators added, with AWGN and CFO using the HST scenario. The DL AWGN is adjusted according to signal power.
2021-10-07 16:14:46 +02:00
Ismael Gomez 9d35c5d018 srsue: stop rx stream after finishing sync thread to avoid deadlock at stop 2021-10-07 15:28:10 +02:00
Ismael Gomez 8fff7f6646 Fix potential overflow in rssi_read_cnt 2021-10-07 11:38:45 +02:00
Bedran Karakoc 1e1e1420b1 Return AUTS in authentication failure for case AUTH_SYNCH_FAILURE 2021-10-06 20:01:00 +02:00
Bedran Karakoc 361ff3f37a Extend identity type handling in Identity Response 2021-10-06 20:01:00 +02:00
Bedran Karakoc de750fad09 Added helper function for replayed security capabilities 2021-10-06 20:01:00 +02:00
Bedran Karakoc 193ec4abfa Trigger switch_off in NAS 2021-10-06 20:01:00 +02:00
Bedran Karakoc 441251bdd1 Remove unused parameter 2021-10-06 20:01:00 +02:00
Bedran Karakoc a4cc9b6ca0 Fix handle_authentication_request and add handler for authentication reject 2021-10-06 20:01:00 +02:00
Bedran Karakoc e8bcc0a61e Added handler for identity request and sender for identity response 2021-10-06 20:01:00 +02:00
Bedran Karakoc 1adf67c559 Extend NAS failure causes 2021-10-06 20:01:00 +02:00
Bedran Karakoc 850606f20b Added deregistration (UE terminating) 2021-10-06 20:01:00 +02:00
Xavier Arteaga d5b34696b4 Sepparate CSI report configuration from quantification and integrate in nr_phy_test with assertions 2021-10-06 16:33:51 +02:00
faluco a9c65bd369 UE: Implement a thread safe wrapper class for accessing the mac_grant_ul_t member in ul_harq_process.
This fixes many race conditions detected by TSAN around this class.
2021-10-06 14:47:23 +02:00
faluco 6c4548c243 Fix several data races in LTE and NR harq classes. 2021-10-06 14:47:23 +02:00
Fabian Eckermann 991013ca2c Fix order of dl/ul common cfg. dl must be first. 2021-10-06 14:44:55 +02:00
Ismael Gomez 6bdeb2d6b6 Fix division by zero in JSON metrics 2021-10-05 17:19:07 +02:00
Andre Puschmann ea21232f61 ue,rrc_nr: fix SSB config warning
first read freqInfoDL then try to build SSB config
2021-10-04 12:12:32 +02:00
Xavier Arteaga c9d7db7314 Minor changes 2021-10-04 10:28:34 +02:00
Xavier Arteaga e3bd92d87c Fix SSB pattern in UE 2021-10-04 10:28:34 +02:00
Xavier Arteaga 8f90ee847a Refactor carrier frequency from PHY and fix OFDM phase compensation 2021-10-04 10:28:34 +02:00
Xavier Arteaga 2ab3971ef1 Fix NR PBCH encoding/decoding 2021-10-04 10:28:34 +02:00
Codebot 8c3332f894 Merge branch 'next' into agpl_next
# Conflicts:
#	srsenb/hdr/stack/upper/pdcp_nr.h
#	srsenb/hdr/stack/upper/rlc_nr.h
#	srsenb/src/stack/upper/pdcp_nr.cc
#	srsenb/src/stack/upper/rlc_nr.cc
2021-10-03 23:13:30 +02:00
Ismael Gomez 6b506ec357
phy_common: clear tx_hold flag before releasing the semaphore (#3342) 2021-10-03 20:05:38 +02:00
faluco 666cb73cc9 Fix data race in phy_common::set_neighbour_cells. 2021-10-02 17:40:34 +02:00
faluco 72088dadb5 Fix race conditions in intra measure class. 2021-10-02 17:40:34 +02:00
Andre Puschmann 3cd2de1ffe ue,rrc_nr: accept RRC Reconfigs with disable NZP and ZP configs 2021-10-01 12:21:54 +02:00
Francisco Paisana 78dad52cc8 rrc,nr,gnb: disable CQI configuration in gNB until gNB PHY supports it 2021-09-30 11:34:22 +02:00
Andre Puschmann bf2606f94e ue,mac_nr: fix race condition by using thread-safe RNTI class 2021-09-30 10:36:29 +02:00
Ismael Gomez c09f09b7be Move rrc_common from srsue to lib 2021-09-29 21:39:56 +02:00
Fabian Eckermann 8830c2796f Add support for NSA FDD on band n3, n5 and n7. 2021-09-29 16:03:44 +02:00
Andre Puschmann ca6ea55cb6 mac_nr_test: fix test vector after making padding BSR work 2021-09-27 21:15:30 +02:00
Andre Puschmann bed4cfb5e5 ue,mac_nr: fix generation of padding BSRs
* in Msg3 don't add explicit SBSR (rely on padding BSR to add)
* fix padding BSR generation to always use padding bytes to add it
2021-09-27 21:15:30 +02:00
Ismael Gomez 1c77998df5 Stop PDCP for data bearers before initiating HO 2021-09-27 13:54:51 +02:00
faluco fa351cd285 Rename functions that contain the unsafe word to nolock.
The term "unsafe" does not clearly state that the function is not locking the shared date and it sounds "dangerous", so use a more explicit term.
2021-09-27 13:26:21 +02:00
Codebot ecd0580b9e Merge branch 'next' into agpl_next 2021-09-26 23:12:44 +02:00
Bedran Karakoc 43915550cc NGAP GTP Bearer Establishment 2021-09-22 15:15:47 +02:00
David Rupprecht 3712983308 Added PDU Session est request 2021-09-22 15:15:47 +02:00
David Rupprecht c670383ae9 Added NAS 5G functions incoming msg and reg proc 2021-09-22 15:15:47 +02:00
David Rupprecht 107eba9d66 Fixed srsue namespace 2021-09-22 15:15:47 +02:00
faluco 55f5f74ff3 Fixed case where calling gw::setup_if_addr after ue attachment would spawn a new thread without closing the current one.
This would end up being a resource leak as the number of threads grow forever until the application crashes.
2021-09-22 13:26:59 +02:00
Andre Puschmann 26cc6d7886 ue: remove stack type parameter
for the moment we always use the LTE stack (also for NSA mode).
For SA we likely pick a smarter approach to pick the stack type, i.e.
using the ARFCN specified in the config.
2021-09-22 10:56:56 +02:00
Xavier Arteaga 0324806d6c Packed NR TDD config in duplex configuration and created test case for FDD 2021-09-21 18:11:16 +02:00
Fabian Eckermann dd8db1a929 Replaced inet_addr() with inet_pton. 2021-09-21 11:59:40 +02:00
Xavier Arteaga 1f6c950dae SRSUE: Fix speed and distance from TA metrics 2021-09-21 11:30:56 +02:00
Andre Puschmann fbfca42ef3 ue,mux_nr: add missing break 2021-09-21 11:18:04 +02:00
Ismael Gomez ad646f436c Ignore PDSCH during cell selection 2021-09-21 11:09:34 +02:00
Xavier Arteaga de00b80228 Review NR NSA CFO estimation and compensation 2021-09-20 20:48:08 +02:00
Xavier Arteaga 63bb86bce1 Added SS type conversion to string 2021-09-20 20:48:08 +02:00
Codebot b87b760326 Merge branch 'next' into agpl_next 2021-09-19 23:12:23 +02:00
faluco c2b705c5ce Fix several data races in proc_phr, class needs to be fully protected since most member variables are accessed by different threads. 2021-09-17 11:34:28 +02:00
faluco 6b07e886b7 Fix data race in is_first_ul_grant. 2021-09-17 11:34:28 +02:00
faluco 1e3ba607ce Fix data race in is_pending_tx_end. 2021-09-17 11:34:28 +02:00
faluco f96ee097b4 Fix data race in ue mac metrics. 2021-09-17 11:34:28 +02:00
faluco 7dae4a491e Fix data race in ue_stack_lte::ul_dropped_sdus. 2021-09-17 11:34:28 +02:00
faluco 1796e12084 Fix data race in ul_harq_entity. 2021-09-17 11:34:28 +02:00
faluco 2b73beb3dd Fix data race in ul_harq. 2021-09-17 11:34:28 +02:00
faluco d02012b588 Fix data race in bsr_proc. 2021-09-17 11:34:28 +02:00
faluco 8d802e2aca Fix a data race in the simulate_rf global variable. 2021-09-17 11:34:28 +02:00
David Rupprecht e8a464228d Cleaned string helpers 2021-09-16 15:24:32 +02:00
Andre Puschmann 36af79b9d5 ue,proc_bsr_nr: add missing mutex when redeading SBSR
detected with TSAN
2021-09-16 15:22:59 +02:00
Andre Puschmann ab6210b1fc ue,proc_sr_nr: add mutex to protect access from PHY and Stack
also detected by TSAN
2021-09-16 15:22:59 +02:00
Andre Puschmann 2248e63219 ue,proc_ra_nr: add mutex to protect access from PHY and Stack
detected with TSAN
2021-09-16 15:22:59 +02:00
Andre Puschmann cc2d71183e ue,phy,nr: fix race condition when setting UL grant for Msg3
the Msg3 UL grant requires the TTI in which the RAR has been received
to calcualte the correct timing. There was a race between PHY and Stack
thread.

This patch circumvents the issue by removing a PHY state member that only holds
the RAR Rx timing. In the new interface the RA proc passes the Rx TTI
to the PHY again when setting the UL grant so the PHY can calculate the
correct timing without any state.
2021-09-16 15:22:59 +02:00
faluco 485ec2edab Implement a new option to flush the file sink contents on every write. 2021-09-14 10:22:37 +02:00
Andre Puschmann 07019a5bd6 nr: refactor DL/UL frequency deriviation
* add separate DL/UL freq point a in NR carrier struct
* use freqInfoDL/freqInfoUL to get freq point a
* simplify carrier tuning logic
2021-09-13 10:27:16 +02:00
Codebot 958542dc2b Merge branch 'next' into agpl_next 2021-09-12 23:12:24 +02:00
Andre Puschmann f382a7c7db Revert "ue,proc_ra_nr: add temporary flag to skip RAR reception"
This reverts commit 28668aac34.
2021-09-09 14:29:04 +02:00
Andre Puschmann a518b81a10 phy,nr: don't print hex content of failed PDSCH 2021-09-09 14:29:04 +02:00
Andre Puschmann 5a936d9940 ue,rrc: handle DRB removal correctly
when RRC receives a command to remove a DRB, it also needs to delete
the bearer at RLC and PDCP
2021-09-09 14:29:04 +02:00
Andre Puschmann 54ab64327a ue,mac_nr: move BSR levels lookup table into lib header
prepare for shared use with gNB
2021-09-09 14:29:04 +02:00
Andre Puschmann ba17b64c70 worker_pool: fix newline 2021-09-09 12:04:27 +02:00
David Rupprecht 285aae8e36 Fixing srsue namespace in rrc meas test 2021-09-08 11:28:17 +02:00
David Rupprecht a9a23214b0 Added more 5G security kdfs
Added new 5G SIM functions

Added const parameters for security functions
2021-09-07 11:06:56 +02:00
David Rupprecht a645d74eaf USIM functions for res star
Added gen_res_star in security.h

Added USIM interfaces for res star

Added RES star test case
2021-09-07 11:06:56 +02:00
David Rupprecht bce6b5cc0f Added kdf common
Use kdf functions in 5G KDF

Moved EPS KDF function to new KDF structure
2021-09-07 11:06:56 +02:00
David Rupprecht 15eaef21e2 Update test f12345 function
Moved XOR functions to lib

Added testcase for KDF

Minor liblte_security updates
2021-09-07 11:06:56 +02:00
Andre Puschmann 272fc47bc2 ue,worker_pool: fix logging of Msg3 UL grant 2021-09-06 10:35:59 +02:00
Codebot de59c88954 Merge branch 'next' into agpl_next
# Conflicts:
#	srsue/hdr/stack/bearer_manager.h
#	srsue/src/stack/bearer_manager.cc
2021-09-05 23:12:20 +02:00
Andre Puschmann 548c45a8fc enb,mac_nr: add RAR packing 2021-09-03 12:09:41 +02:00
Andre Puschmann ede81be5e4 mac_rar_pdu_nr: add packing routines
* add packing for RAR PDUs
* rewrite to_string() to use fmt lib
* add test case for packer
2021-09-03 12:09:41 +02:00
Andre Puschmann b20fefbe45 mac_nr_test: flush srslog at the end of test
fixes stack use after free detected by ASAN

2021-08-31T17:21:44.885938 [MAC-NR ] [D] [    0] Building new MAC PDU (9 B)
==10908==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffc481b5340 at pc 0x563c0486d489 bp 0x7ffc481b4470 sp 0x7ffc481b4460
READ of size 1 at 0x7ffc481b5340 thread T0
    #0 0x563c0486d488 in srsran::mac_sch_subpdu_nr::to_string(fmt::v7::basic_memory_buffer<char, 500ul, std::allocator<char> >&) (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0x139488)
    #1 0x563c0486db87 in srsran::mac_sch_pdu_nr::to_string(fmt::v7::basic_memory_buffer<char, 500ul, std::allocator<char> >&) (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0x139b87)
    #2 0x563c0481c127 in srsue::mux_nr::get_pdu(unsigned int) (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0xe8127)
    #3 0x563c0484e62b in srsue::ul_harq_entity_nr::ul_harq_process_nr::new_grant_ul(srsue::mac_interface_phy_nr::mac_nr_grant_ul_t const&, bool const&, srsue::mac_interface_phy_nr::tb_action_ul_t*) (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0x11a62b)
    #4 0x563c04850de4 in srsue::ul_harq_entity_nr::new_grant_ul(srsue::mac_interface_phy_nr::mac_nr_grant_ul_t const&, srsue::mac_interface_phy_nr::tb_action_ul_t*) (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0x11cde4)
    #5 0x563c047bb004 in srsue::mac_nr::new_grant_ul(unsigned int, srsue::mac_interface_phy_nr::mac_nr_grant_ul_t const&, srsue::mac_interface_phy_nr::tb_action_ul_t*) (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0x87004)
    #6 0x563c04760cdc in msg3_test() (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0x2ccdc)
    #7 0x563c0475f762 in main (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0x2b762)
    #8 0x7fae1cf400b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #9 0x563c047601bd in _start (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0x2c1bd)

Address 0x7ffc481b5340 is located in stack of thread T0 at offset 320 in frame
    #0 0x563c0486d78f in srsran::mac_sch_pdu_nr::to_string(fmt::v7::basic_memory_buffer<char, 500ul, std::allocator<char> >&) (/home/ubuntu/workspace/srslte_ubuntu_20.04_pull_request/srslte/build/srsue/src/stack/mac_nr/test/mac_nr_test+0x13978f)
2021-09-03 12:09:41 +02:00
Andre Puschmann 9b4f6cb8bb mac_nr: pretty-print received/transmitted MAC PDUs in logs 2021-09-03 12:09:41 +02:00
Francisco Paisana f4df55c245 stack lte: separate bearer manager into two classes, one for the ue and one for the enb 2021-09-03 12:06:17 +02:00
Andre Puschmann db8b710442 bearer_manager: move to lib folder and extend for multiple users
prepare bearer manager to be used by eNB which requires
to support multiple RNTIs
2021-09-02 17:12:04 +02:00
faluco 5f9aceb8b6 Fix alignment issue with the stdout metrics in srsue. 2021-09-02 17:10:56 +02:00
Andre Puschmann 4ef1ac2649 gw: (re-)use class mutex when updating the DL/UL metrics 2021-08-31 17:01:50 +02:00
Andre Puschmann aa43e3c8d6 ue,mac: adding missing mutex when updating metrics 2021-08-31 17:01:50 +02:00
Andre Puschmann e1776f8d28 ue,phy: update the PRACH params inside the lambda that also executes the reconfig
setting the new PRACH params (writing the the local var) needs to protected as well
because it is called from the RRC context and the PHY worker will call configure_prach_params()
if it sees changes to it.
2021-08-31 17:01:50 +02:00
Andre Puschmann 40499e6b6d ue_stack_lte: use std::atomic for running var 2021-08-31 17:01:50 +02:00
Andre Puschmann 79cdc28015 nas_test_common: call NAS layer from stack thread context
since NAS layers insn't thread safe, all calls must come from
the same thread
2021-08-31 17:00:59 +02:00
Andre Puschmann 78d60bc138 nas: remove all uses of atomic from 4G and 5G classes
the NAS classes aren't thread safe and thread-safety shouldn't be
pretended by using atomics. Remove them and add explicit notice.
2021-08-31 17:00:59 +02:00
Codebot 522ca4b43a Adding AGPL copyright to new files 2021-08-29 23:12:37 +02:00
Codebot d1d38d1826 Merge branch 'next' into agpl_next 2021-08-29 23:12:35 +02:00
Xavier Arteaga 8aa7ae7d95 Remove unused attribute 2021-08-26 09:34:43 +02:00
Xavier Arteaga 4cb633e6e6 UE dicards NR CFO measurement if SNR is negative 2021-08-26 09:34:43 +02:00
Xavier Arteaga 83b9b2d1ff Implemented UE open loop CFO compensation for NR 2021-08-26 09:34:43 +02:00
Xavier Arteaga 9c3dd56398 Added PDCCH DMRS interleaved mapping 2021-08-26 09:34:43 +02:00
Xavier Arteaga d61d6aa59f Integrated CORESET0 into UE's RRC 2021-08-26 09:34:43 +02:00
Francisco Paisana 7a527cd09e fix,lte: zero-initialize phy_meas_t in rlf test 2021-08-24 20:15:33 +02:00
Francisco Paisana 36eee0ab40 test,nr: add ra_search_space configuration to phy_cfg_nr; now the test ue searches for RA-RNTI while expecting a RAR 2021-08-24 20:15:22 +02:00
Francisco Paisana f518861ebc fix location of support/ folder. Created macros for ASSERT_EQ and ASSERT_NEQ 2021-08-23 16:47:54 +02:00
Ismael Gomez 7839ab09dc Add RLF-Reportv9 to srsUE 2021-08-23 16:34:33 +02:00
Codebot 83f103fe4b Merge branch 'next' into agpl_next 2021-08-22 23:12:22 +02:00
David Rupprecht 3217c00cfc Adjusting NAS base security function to 5G 2021-08-19 11:03:06 +02:00
Codebot 60fb9ae9a6 Merge branch 'next' into agpl_next 2021-08-15 23:12:19 +02:00
Codebot 635d0bc6e9 Merge branch 'next' into agpl_next 2021-08-08 23:12:19 +02:00
Andre Puschmann fc2b6a7fb5 ue,rrc: fail NR reconfiguration if mac-logicalChannelConfig is not present 2021-08-07 12:33:10 +02:00
Andre Puschmann e6d9ec40ef ue,rrc: let RRC reconfig fail when LCID cannot be derived from DRB id 2021-08-07 12:33:10 +02:00
Xavier Arteaga cba6df3722 Extended NR PHY robustnes against wrong RRC configuration 2021-08-03 17:30:08 +02:00
Andre Puschmann 28668aac34 ue,proc_ra_nr: add temporary flag to skip RAR reception
this will be removed again as soon as the eNB supports full RAR
transmission.
2021-08-02 15:18:47 +02:00
Andre Puschmann d78cbdf9bb ue,proc_ra_nr: fix retransmission of PRACH after failed RAR rx
if the backoff value is calculated to be zero, don't start
a timer but tx new preamble directly
2021-08-02 15:18:47 +02:00
Andre Puschmann 99dc94ab38 nas: make state variables atomics
NAS states and substates maybe be requested from other threads so
they need to be protected.

Note that the caller still needs to hold it's own mutex if different
actions are required based on the state.
2021-08-01 11:41:11 +02:00
Xavier Arteaga c9183326ce Clean up some code and minor change 2021-07-28 12:14:37 +02:00
Xavier Arteaga dbb10dd6a2 Hold worker thread until baseband is transmitted 2021-07-28 12:14:37 +02:00
Xavier Arteaga 0c7239e5df SRSUE: add RF channel offset 2021-07-28 12:14:37 +02:00
Xavier Arteaga b57df4db10 Refactored worker_end mechanism for concurrent workers 2021-07-28 12:14:37 +02:00
Andre Puschmann e833751031 rrc_nr: add CSI config packing 2021-07-28 10:26:09 +02:00
Andre Puschmann f181733c7e rrc_nr,enb: add more fields to spcell cfg dedicated 2021-07-28 10:26:09 +02:00
David Rupprecht 04ef6e120d Added new SIM functions to get MCC, MNC and MSIN 2021-07-27 09:26:52 +02:00
Andre Puschmann 9c298b203d srsue: reduce the default RRC release to 8 (minimum value) 2021-07-26 11:04:02 +02:00
Codebot 2dd440bb76 Adding AGPL copyright to new files 2021-07-25 23:12:23 +02:00
Codebot a8ef3ba6b2 Merge branch 'next' into agpl_next
# Conflicts:
#	srsenb/test/common/dummy_nr_classes.h
2021-07-25 23:12:21 +02:00
David Rupprecht 2563a78f34 Added basic 5G NAS metrics 2021-07-22 19:41:26 +02:00
David Rupprecht 9172059078 Supply ctor with logger instead of fetching 2021-07-22 14:12:39 +02:00
Xavier Arteaga bb4f469794 Integrated SR decoder in gNb 2021-07-21 10:40:40 +02:00
Andre Puschmann fc8fe032ff rrc_nr,endc: add more fields to NR RRC Reconfig for EN-DC activation
adds a big chunk of new fields to the reconfig packing code,
tested with srsUE
2021-07-19 12:53:09 +02:00
Codebot 3a5ee8d41a Adding AGPL copyright to new files 2021-07-18 23:12:23 +02:00
Codebot ccf8cfb65f Merge branch 'next' into agpl_next
# Conflicts:
#	lib/include/srsran/common/basic_pnf.h
#	lib/include/srsran/common/basic_vnf.h
#	lib/include/srsran/common/basic_vnf_api.h
#	lib/src/common/basic_vnf.cc
#	lib/test/common/pnf_bridge.cc
#	lib/test/common/pnf_dummy.cc
#	srsenb/hdr/phy/vnf_phy_nr.h
#	srsenb/hdr/stack/mac/nr/sched_nr_common.h
#	srsenb/hdr/stack/mac/nr/sched_nr_phy_helpers.h
#	srsenb/src/phy/vnf_phy_nr.cc
#	srsenb/src/stack/mac/nr/sched_nr_common.cc
#	srsenb/src/stack/mac/nr/sched_nr_phy_helpers.cc
#	srsue/hdr/phy/vnf_phy_nr.h
#	srsue/src/phy/vnf_phy_nr.cc
2021-07-18 23:12:20 +02:00
David Rupprecht 0217bf5332 Fixed name space for rrc ue 2021-07-16 10:09:07 +02:00
faluco 7b7ecb7983 Add a new configuration option that controls PDSCH baseband sample dump to a file on KO. 2021-07-14 16:17:23 +02:00
Xavier Arteaga b25681f9de gnb,prach: add PRACH to gNB
rebase of Xavier's feature_gnb_prach branch
2021-07-14 14:30:58 +02:00
David Rupprecht fb92118bb7 Add 5G NAS infrastructure 2021-07-14 13:38:08 +02:00
David Rupprecht 505225d845 Added ue nas base class with security functions 2021-07-14 13:38:08 +02:00
David Rupprecht 7fa85ab336 Added nas test common file 2021-07-14 13:38:08 +02:00
David Rupprecht 59ca11db68 Added missing target_link_libs 2021-07-14 09:41:37 +02:00
Andre Puschmann 9d6d437ba5 mac_nr,ue: don't decode RAR PDU that couldn't be decoded
ignore RAR PDU when PDSCH wasn't OK
2021-07-14 09:28:51 +02:00
Andre Puschmann c7d29f4af1 ttcn3: fix potential deadlock
* fix a few races detected with TSAN in SR proc of the DUT
* fix deadlock caused by sync_queue_size set to 1
2021-07-13 10:16:36 +02:00
Andre Puschmann e0d9afc342 proc_ra: fix race detected with TSAN
rar_received is accessed from PHY worker and Stack thread
2021-07-13 10:16:36 +02:00
Andre Puschmann 6c82d63aa6 remove legacy PNF/VNF code
the code hasn't been maintained for a while an likely needs to be
adapted for a real-world scenarios.

in order to avoid having to maintain two MAC/PHY interfaces we
remove the code from now.
2021-07-12 19:24:02 +02:00
Codebot 516951c41c Merge branch 'next' into agpl_next
# Conflicts:
#	lib/include/srsran/interfaces/rrc_nr_interface_types.h
#	lib/include/srsran/phy/enb/enb_dl_nr.h
#	test/phy/nr_dl_flood.cc
2021-07-11 23:12:20 +02:00
Xavier Arteaga 54a12870ec SRSUE: avoid negative SR transmission in NR 2021-07-09 22:32:40 +02:00
Andre Puschmann f2f9082d09 ue,rrc_meas: fix invalid access to field when eport_quant_cell_nr_r15 is not present 2021-07-06 21:57:44 +02:00
Xavier Arteaga e764a26136 Integrated PUCCH decoding in gNb 2021-07-05 17:51:27 +02:00
Xavier Arteaga e3afd945bc Refactored NR HARQ ACK feedback 2021-07-05 17:51:27 +02:00
Xavier Arteaga eecaccb541 Added NR PHY helpers 2021-07-05 17:51:27 +02:00
Andre Puschmann 5dbeecdbb5 ue,upper: fix linking on 32bit platforms with missing atomic libs 2021-07-05 08:59:19 +02:00
Codebot 58ca99d22a Adding AGPL copyright to new files 2021-07-04 23:12:21 +02:00
Codebot 585e3c51c1 Merge branch 'next' into agpl_next
# Conflicts:
#	srsenb/hdr/phy/nr/cc_worker.h
#	srsenb/hdr/phy/nr/sf_worker.h
#	srsenb/src/phy/nr/cc_worker.cc
#	srsenb/src/phy/nr/sf_worker.cc
#	test/phy/nr_phy_test.cc
2021-07-04 23:12:19 +02:00
Andre Puschmann 5999b0d3a5 ue: move blocking wait for detach outside of stack class
the thread sleep waiting for the UE release should not run
on the stack thread. Move it to the UE class therefore.
2021-07-02 17:22:49 +02:00
Andre Puschmann 3173dedf0a ue_stack_lte: make sure to execute stack commands on Stack thread
some commands were executed from the calling thread which may lead
to concurrent access to members. Detected by TSAN. The patch
moves all remaining calls (the majority was alread moved) to the
Stack task queue.
2021-07-02 17:22:49 +02:00
Andre Puschmann fb4dd3ba7b ttcn3: fix various races between SS and Stack thread detected by TSAN
fixed through the right usage of mutexes in both TTCN PHY and syssim.
nested mutex locking is solved by calling SS from the PHY after
releaseing the PHY lock again.
2021-07-02 17:22:49 +02:00
Ismael Gomez 4e39982a19
Fix TSAN warnings in UE (#3021)
* Protect PHY SR signal management in a class

* Protect intra_freq_meas vector

* Protect cell and srate shared variables in thread-safe classes

* srsue,srsenb: include TSAN options header

* Protect ue_rnti_t and rnti scheduling windows behind thread-safe classes

* Protect access to state variable in sync_state

* Protect access to metrics configuration

* Protect access to is_pending_sr

* Protect access to UE prach worker

* Protect UE mux

* Avoid unlocking mutex twice

* Fix data races in RF/ZMQ

* Fix data races in intra_measure and PHY

* Fix minor data races in MAC

* Make TSAN default behaviour to not halt on error

* Fix blocking in intra cell measurement

* Address comments

Co-authored-by: Andre Puschmann <andre@softwareradiosystems.com>
2021-07-01 17:39:54 +02:00
Pedro Alvarez 1b676aa406 Moved lib GTPU to its own folder 2021-06-30 18:19:20 +01:00
Pedro Alvarez 865298f8d5 Moved lib PDCP to its own folder 2021-06-30 18:19:20 +01:00
Pedro Alvarez 171d5727be Moved lib RLC into it's own folder 2021-06-30 18:19:20 +01:00
Andre Puschmann 8087bb01e4 nas: log message when airplane mode timer expires 2021-06-28 17:35:02 +02:00
Andre Puschmann 0a16f48869 gw: fix race condition
GW thread was checking the default_eps_bearer variable without
protection. RRC could update it when deleting DRB or receiving RRC
connection release.
2021-06-28 17:35:02 +02:00
Andre Puschmann 4d11e5552a rrc,ue: for RRC conn release, delay transition to RRC idle by 60ms as per TS 36.331
when receiving RRC connection release all actions shall be delayed by 60ms as
per the standard
2021-06-28 17:35:02 +02:00
Andre Puschmann 368c7b9e4f ue,stack: clear all EPS bearers when going RRC idle
the EPS bearer manager was only informed when a single DRB
was removed but not when entering idle which requires to
remove all bearers.

This cause the service request to fail.
2021-06-28 17:35:02 +02:00
Xavier Arteaga aef3e5a40a More NR PHY test and GNB PHY development 2021-06-28 00:27:36 +02:00
Xavier Arteaga d49734b1bc SRSENB: Refactor to accomodate 5G NR 2021-06-28 00:27:36 +02:00
Codebot bfa1215b89 Merge branch 'next' into agpl_next 2021-06-27 23:12:19 +02:00
Andre Puschmann e248e086ed ttcn3_dut: reset TFT matcher object when DUT is switched off 2021-06-24 16:52:58 +02:00
Andre Puschmann 7a85191323 nas: call GW for all removed EPS bearers
this makes sure that GW can also remove all associated TFTs
2021-06-24 16:52:58 +02:00
Andre Puschmann ab0fba5449 gw: try to remove TFTs for all non-default EPS bearer
GW needs to reset its default EPS bearer when it is removed
and also try to remove all TFTs for a non-default bearere when
it is removed.
2021-06-24 16:52:58 +02:00
Andre Puschmann 5313fb99d6 tft: add helper to delete all TFTs for EPS bearer
when a EPS bearer is removed, all associated TFTs need
to be removed as well.
2021-06-24 16:52:58 +02:00
Andre Puschmann eef9eb80c4 ttcn3_ue: fix removal of dedicated EPS bearer 2021-06-24 16:52:58 +02:00
Andre Puschmann 60f8a8db1c nas,tft: add support for TFT modification 2021-06-24 16:52:58 +02:00
Andre Puschmann 483a216bd5 ue,stack: refactor handling of radio bearears in UE stack
this is a rather large commit that is hard to split because
it touches quite a few components.

It's a preparation patch for adding NR split bearers in the next
step.

We realized that managing RLC and PDCP bearers for both NR and LTE
in the same entity doesn't work. This is because we use the LCID
as a key for all accesses. With NR dual connectivity however we
can have the same LCID active at the same time for both LTE and NR
carriers.

The patch solves that by creating a dedicated NR instance for RLC/PDCP
in the stack. But then the question arises for UL traffic on, e.g. LCID 4
what PDCP instance the GW should use for pushing SDUs. It doesnt' know
that. And in fact it doesn't need to. It just needs to know EPS
bearer IDs. So the next change was to remove the knowledge of what
LCIDs are from the GW. Make is agnostic and only work on EPS bearer IDs.

The handling and mapping between EPS bearer IDs and LCIDs for LTE
or NR (mainly PDCP for pushing data) is done in the Stack because
it has access to both.

The NAS also has a EPS bearer map but only knows about default and
dedicated bearers. It doesn't know on which logical channels they
are transmitted.
2021-06-24 16:52:58 +02:00
Andre Puschmann 3f9c069ff7 ue_stack_lte: add RLC and PDCP entities for NR 2021-06-24 16:52:58 +02:00
Andre Puschmann 7113e55d53 rlc: refactor RLC entity to use smart pointers for holding bearers
this patch mainly modernizes the bearer creation to use smart pointers.
that allows to simplify the error handling.

ue_stack is changed to match new interface. This commit compiles
but doesn't work.
2021-06-24 16:52:58 +02:00
David Rupprecht 6d5391756c Refactor build of RLC NR config 2021-06-24 16:52:58 +02:00
David Rupprecht d1d8500ce5 Add testcase for reconfiguration 2021-06-24 16:52:58 +02:00
Andre Puschmann e2c496d825 srsue,mac: fix race between PHY and MAC when stopping UE
the issue let to unwanted log warning at the end of the UE
execution when the PHY was still pushing DL PDUs while MAC
was already stopped.

This fixes #3003
2021-06-24 16:46:25 +02:00
Xavier Arteaga b1e4720721 SRSUE/SRSENB: added tx_enable flag in worker_end 2021-06-21 18:07:53 +02:00
Xavier Arteaga 027201d457 SRSUE/SRSENB: Refactor NR workers to generalise lower PHY 2021-06-21 18:07:53 +02:00
Ismael Gomez 9c60ef092c Fix test for non-contention HO 2021-06-21 11:46:21 +02:00
Ismael Gomez 66eb6f20f1 Fix non-contention HO missing the T-CRNTI 2021-06-21 11:46:21 +02:00
Codebot f77261927d Adding AGPL copyright to new files 2021-06-20 23:12:22 +02:00
Codebot a2cc847747 Merge branch 'next' into agpl_next 2021-06-20 23:12:20 +02:00
Ismael Gomez 5aa5a8e997 Revert UE changes 2021-06-18 23:17:14 +02:00
Ismael Gomez e35a0d72fa Revert UE changes 2021-06-18 23:17:14 +02:00
Ismael Gomez aa5944da78 Fix T-CRNTI push pdu 2021-06-18 23:17:14 +02:00
Ismael Gomez c206d3c0fa fix ttcn3 tests 2021-06-18 23:17:14 +02:00
Ismael Gomez dd9889e07c Add carrier index to uplink PCAP captures 2021-06-18 23:17:14 +02:00
Francisco 9139f88b31 fix,srsue: defer enqueuing of the rrc reconf complete message to avoid that it goes in the UL grant whose PDCCH was scheduled in the TTI as the PDSCH that carried the HO command 2021-06-14 19:27:55 +01:00
Xavier Arteaga fc5d069743 SRSUE: Default PHY measurements to NAN 2021-06-14 09:21:29 +02:00
Codebot 20f62def63 Adding AGPL copyright to new files 2021-06-13 23:12:25 +02:00
Codebot d9cb5d01ff Merge branch 'next' into agpl_next 2021-06-13 23:12:22 +02:00
Andre Puschmann 94959b5318 srsue,test: reorganize test folders and move to components like we in PHY 2021-06-10 15:18:42 +02:00
Pedro Alvarez a53b321ab8 Release UE upon reception of integrity error. 2021-06-08 18:52:22 +01:00
Pedro Alvarez 299d2ee35d Added interface to make the PDCP notify the RRC of integrity check
failures.
2021-06-08 18:52:22 +01:00
Xavier Arteaga 6123926353 Fix NR cell search frequency 2021-06-08 14:55:12 +02:00
Xavier Arteaga a79d518799 Added SSB search measure/decode file test 2021-06-08 14:55:12 +02:00
Xavier Arteaga 5181a9d64c Implemented PBCH blind decode 2021-06-08 14:55:12 +02:00
Xavier Arteaga a31f3d42ce Added RF NR search tool and added baseband file 2021-06-08 14:55:12 +02:00
Xavier Arteaga 157af40417 Fix shadow variables in sync.cc 2021-06-08 10:21:38 +02:00
Xavier Arteaga 3a011155db SRSUE: Make sure PHY reset is done when SYNC is IDLE 2021-06-08 10:21:38 +02:00
Codebot 73a61b884e Merge branch 'next' into agpl_next 2021-06-06 23:12:31 +02:00
Andre Puschmann c0be8187c8 rlc interface: convert entire read_pdu() interface to return uint32_t
we had it returning int but had a bug in using the return value properly,
i.e. handling when -1 was returned in RLC TM.

Thinking about it more, it doesn't make sense to have a negative return
value here anyway. Either the RLC can return a PDU or not. If it can't the
returned lenght is zero.
2021-06-04 13:23:54 +02:00
Andre Puschmann aaffdeb326 rrc,rlc: add method to signal protocol failure to RRC
general-purpose method for lower layers to signal protocol
failures to higher layers, i.e. RRC.

In the current case, implement a direct release of the UE (enb) or
a reestablishment (UE).
2021-06-03 21:11:47 +02:00
Andre Puschmann 107f6334dd compile: fix compilation on 32bit systems that require -latomic 2021-06-03 20:45:02 +02:00
Francisco 486823e5de sched,bugfix: The PHR handling scheme now considers the number of PRBs of the UL grant that carried the PHR. Before, it was assuming the most conservative scenario of Nprb=1 2021-06-03 15:33:38 +01:00
Xavier Arteaga d74f70289e SRSUE: fix last reported RI state 2021-06-02 18:12:36 +02:00
Andre Puschmann b0a2f31478 prach: protect configuration and state getters with mutex
purely TSAN with unit-test based approach that protects
the state getters and configuration routines with a mutex
2021-06-02 09:36:44 +02:00
Andre Puschmann d2ec3ca5e1 intra_measure_base: fix race detected with TSAN
use mutex to protect state getters
2021-06-02 09:36:44 +02:00
Andre Puschmann f43e82a8a6 ue_phy_test: fix test 2021-06-02 09:36:44 +02:00
Andre Puschmann 98a91a2057 sync: protect sync_state, access ue_sync object only from one thread
races detected with TSAN, primarily the ue_sync object which isn't
thread-safe is accessed by all workers to set the CFO and by the
sync thread to receive samples (which read the CFO).

The patch introduces shadow variables that are updates from the
main thread before/after the sync is executed. The atomic shadow
variables can then be read from otherthreads without holding a
mutex, i.e. blocking the sync.
2021-06-02 09:36:44 +02:00
Andre Puschmann 2c975732dc metrics_stdout: fix race detected by TSAN 2021-06-01 22:44:12 +02:00
Andre Puschmann 8ab512c2be nas_test: fix TSAN warnings
remove mutex and cvar again that we used to circumvent the startup.
we now use a atomic variable to sync the main thread and the stack.
2021-06-01 22:44:12 +02:00
Xavier Arteaga 2d0a21f779 Move radio frequency mapping out of the PHY common into the PHY reset method 2021-06-01 16:38:55 +02:00