Commit Graph

531 Commits

Author SHA1 Message Date
Pedro Alvarez 492ea2a5a8 Addressing reviewers comments to #2290.
Removing unecessary \n for logs and changed log of PDCP info queue
 capacity to debug to avoid log spam.
Changed log level for unhandled S1AP messages from error to warning
 in EPC to avoid failing tests because of error message.
Changed usage of allocate_unique_buffer to make_unique_buffer()
2021-02-11 15:49:00 +00:00
Pedro Alvarez fcaaf72187 Starting to add discard functionality to PDCP LTE entity.
This includes:
  - Adding a queue (implemented with std::map) for undelivered PDUs.
    This queue uses the SN used for TX as the key.
  - Added discard timer that is started upon reception of the SDU. Upon
    expiry of the timeout a discard callback removes undelivered PDUs
from the queue.
  - Added the mechanisms to the notify_delivery to remove PDUs from the
    undelivered queue when the PDU is ACK'ed.
  - Added test case for both timer expiry and acknowledgment.
  - Fix up the getter for buffered SDUs to return the undelivered SDUs
  - Changed default PDCP discard timer, so AM has a discard timer by
    default.
2021-02-11 15:49:00 +00:00
faluco 57f66febfc Ported the RLC classes to srslog in the lib dir. 2021-02-11 14:37:27 +01:00
faluco f424f2e113 - Upgraded PDCP classes in lib to use srslog.
- Update tests to new changes.
2021-02-11 14:37:27 +01:00
faluco 9d15a44c73
Port lib/phy to srslog (#2298)
* - Ported the channel class to srslog.
- Removed all newlines of log messages in lib/phy.

* Remove more newlines that use the C debug macros.
2021-02-10 13:46:25 +01:00
Andre Puschmann 01acf95566 mac_rar_pdu_nr: update public interface to make it easier to access
* provide all subPDUs as const vector&
* return UL grant directly
2021-02-08 22:15:09 +01:00
Francisco 3265d940ec remove byte buffer pool cached member variables as they are unnecessary now. 2021-02-07 18:48:21 +00:00
Francisco 04ab4eefcd use new make_byte_buffer() helper method to create unique_byte_buffers 2021-02-07 18:48:21 +00:00
Francisco 8a9c326bcb remove old direct uses of byte_buffer_pool 2021-02-07 18:48:21 +00:00
Francisco 1e2153769e remove byte buffer pool cleanup method and unnecessary mutexes 2021-02-07 18:48:21 +00:00
Andre Puschmann 30216fe1fc mac_pdu_nr_test: add packing test for UL-SCH PDU with CRNTI, PHR and SBSR 2021-02-05 15:55:21 +01:00
Andre Puschmann 4ca43c6804 mac_sch_pdu_nr: add unpacking helpers for CRNTI, SBSR and PHR CEs
* unpackers for CEs
* testcase with TV
2021-02-05 15:55:21 +01:00
Xavier Arteaga a19671802e Added SRSUE NR-PUSCH initial procedures 2021-02-05 15:55:03 +01:00
Pedro Alvarez 7b25eac47c Fix race condition in rlc_am_stress test and other fixes related to this
test. The race condition was being cause by write_sdu being called
simultanously to read_pdu, which could cause the read_pdu to try to get
the SDU info before it had been written by the write_sdu.

Changes in this commit include:
 - Make sure PDCP sn in included in RLC AM stress test.
 - Stop handling control PDU when TX is not enabled in RLC AM.
 - Fixed issue with length of the PDCP SN in rlc_stress_test.
 - Moved the place were sdu info erase was called to avoid double calls to erase
 - Tentative fix for race condition in rlc_am_stress test.
 - Added function to print information about undelivered_sdu_info_queue
   for debugging.
2021-02-05 12:24:50 +00:00
Pedro Alvarez d0ef6ce00b Fix typos and bad comments in rlc_am_lte.cc and rlc_am_test.cc
Added checks for the nack_sn in the status reports of the rlc_am_test.
2021-02-05 12:24:50 +00:00
Pedro Alvarez 24db20bcca Removed some unused variables after changing method of tracking notifications. Removed rlc_am_notify_pdcp test file. Testing is now in rlc_am_test.cc 2021-02-05 12:24:50 +00:00
Pedro Alvarez 6c071a784c Changed notification mechanisms to use map of acked SNs instead of acked bytes.
This was required due to an issue where bytes were counted twice when a
packet had been lost.
2021-02-05 12:24:50 +00:00
Pedro Alvarez 649d642776 Moved notification tests from rlc_am_notify_pdcp_test.cc to rlc_am_test.cc.
This added some tests to resegmentation.
2021-02-05 12:24:50 +00:00
Pedro Alvarez de669d214a Fix test header and queue_capacity check in RLC notifications.
Also, remove unecessary nullptr initializaion and fixup some newlines.
2021-02-05 12:24:50 +00:00
Pedro Alvarez de90b4753f Added the ability of the RLC AM to notify the PDCP of the acknowledged
PDCP PDUs. This includes:

- Modifying the byte_buffer_t to include PDCP SN meta-data. This way,
  the RLC can keep track of the ack'ed bytes for a specific PDCP PDU.
- Added in the RLC an `undelivered_sdu_info queue`, to keep track of the
  amount of ack'ed bytes and the total size of the PDCP PDU,
  so the RLC can know when delivery is finished.
- Added an interface between the PDCP and the RLC so that the RLC can
  notify the PDCP when it receives an ack from the status PDUs. The RLC
  passes to the PDCP a vector of all the ack'ed pdus in a rx'ed status PDU.
- Added some tests to the notify functionality. This includes some tests
  where the PDUs are acked imediatly, and one test where the PDU is
  retx'ed.
2021-02-05 12:24:50 +00:00
faluco 821925a273 - Upgrade to srslog the loggers in lib/mac.
- Adapted users of these classes and tests.
2021-02-04 18:37:00 +01:00
Andre Puschmann 8e13f04684 mac_pcap: refactor MAC PCAP and include NR RAT into same object
after adding the thread-safe PCAP writer functionality to the EUTRA
MAC object it became clear that we don't wont to replicate the
same for the NR object.

This patch therefore refactors the class that now supports both EUTRA and
NR rats. The old mac_nr_pcap.[h/cc] has been deleted. All test-cases
and usages now use the new object that needs to pass the RAT type in
the ctor.

this patch addresses the last open point of #2160
2021-02-03 17:21:57 +01:00
faluco b014233662 - Port time related classes to srslog.
- Adapt tti_point_test to srslog.
2021-02-03 14:15:27 +01:00
faluco 1a5799a6ca - Replace loggers is network utils.
- Adapt tests that use network utils and callers.
2021-02-03 14:15:27 +01:00
faluco 79eca0980d - Ported fsm.h to srslog.
- Adapted and removed old loggers in tests and code that used fsm.h
2021-02-03 14:15:27 +01:00
Xavier Arteaga 2421f2cd99 Multiple PHY fixes and NR-PHY configuration refactor 2021-02-02 15:23:14 +01:00
Xavier Arteaga b652cd68a5 Refactored NR PHY configuration to accept multiple CORESETs/SearchSpaces 2021-02-02 15:23:14 +01:00
faluco 806268f6cf
Por asn1 code in lib directory to srslog (#2253)
* Match hex dump indentation with srslog.

* Port asn1 utils to use srslog. Converted logging functions from taking varargs to variadic template functions.

* Remove trailing new lines in log lines from asn1 utils.

* First round of upgrades to srslog to asn1 tests.

* Second round of porting asn1 tests to srslog.
2021-02-01 11:58:28 +01:00
Andre Puschmann f88943653b mac: implement MAC RAR PDU unpacking for NR
* add class for mac_rar_pdu_nr
* extend test case
2021-01-30 11:58:25 +01:00
Andre Puschmann da9e3363f1 mac_pdu_nr: rename MAC PDU class for NR to adhere naming conventions
* mainly to have _nr as trailing name for filename and class
* also add "sch" to class and filename (RAR PDU will have extra class)
2021-01-30 11:58:25 +01:00
faluco 711438f756
Port enb specific classes to use srslog (#2155)
* - Started porting the enb PHY layer to use srslog loggers.
- Updated srslog to manage the none level.

* Finished porting enb phy layer including the NR part.

* Ported MAC, GTPU, PDCP, RLC and S1AP enb classes to use srslog.

* Use new stack logger.

* Ported the enb RRC clases to use srslog.

* Remove unused log macros.

* Replace loggers in sched, sched_carrier, sched_helpers.

* Replaced loggers in sched grid.

* Replaced loggers in sched harq.

* Replaced loggers in sched ue.

* Replaced loggers in sched ue ctrl.

* Replace loggers in sched ue ctrl TPC.

* Replaced loggers in sched subclasses.

* Replaced loggers in rrc_meascfg_test

* Configure loggers in rrc_mobility_test.

* Fix compilation errors left out after the rebase.

* - Implement a custom log sink that will serve as a test spy to intercept and count the number of error and warning log entries.
- Adapt the erab_test_setup and rrc_mobility tests to use this new class and make them pass again.

* - Remove trailing new lines introduced in the rebase.
- Ported the sched_ue_cell class to srslog.

* Remove unused log member.

* Ported mac tests to srslog.

* - Removed remaining trailing newlines from log entries.

* Fix compiler errors detected in CI.

* Fix another static variable without definition passed to log lines.

* Fixed a bug in srslog::flush that would never end when the backend queue is full.

* Fetch the RRC logger instead of injecting it in the constructor.
2021-01-28 12:17:18 +01:00
David Rupprecht 306bb6b38b Added function for derive keys 2021-01-27 10:37:09 +01:00
David Rupprecht a6046ca875 Added funcs for asn flat config RLC and PDCP 2021-01-27 10:37:09 +01:00
David Rupprecht 145528ad32 Added unpacking test for RRC reconfig 2021-01-27 10:37:09 +01:00
David Rupprecht 99c3aa9ba2 Refactor assert to TESTASSERT in unit test 2021-01-26 21:19:37 +01:00
Pedro Alvarez 350e90a030 Make RLC retransmissions deterministic. It was creating unpredictablity
in the RLC AM tests. See issue #2228
2021-01-25 14:29:17 +00:00
Pedro Alvarez 6ca8bc12ec Fix wrong SN in RLC status PDU when packet is dropped. 2021-01-21 21:12:30 +01:00
Ismael Gomez a6423442c2
Refactor NR RA files and fix header includes all over library (#2162)
* Refactor NR resource allocation classes. Use DCI instead of grant for dummy PDSCH UE/eNB test

* Minor refactors in NR workers and ue_dl

* Fix include issues

* fix compilation issues
2021-01-20 15:46:46 +01:00
Andre Puschmann 10da7df194 pdu_test: add TC with malformed RAR PDU
a malformed RAR PDU should not be decoded further if the payload
indicates a length beyond the actual PDU size.
2021-01-12 20:24:20 +01:00
Francisco Paisana f8b7351e1b implementation of object memory pool via class-specific operator new/delete 2021-01-12 16:22:10 +01:00
Francisco Paisana e96b8c263a add mem pool test. fix mem pool leak bug 2021-01-12 16:22:10 +01:00
Andre Puschmann 4fa89b7039 pcap: make PCAP write thread-safe
* offload PCAP writing to background thread
* use blocking_queue between writer and clients to make it thread-safe
* add basic test case

this fixes point 1-3 of #2161
2021-01-04 11:05:02 +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
Xavier Arteaga 13443c3f8c Added number of DMRS CDM groups without data to NR grant 2020-12-28 10:11:08 +01:00
Francisco Paisana 74ffe393c6 asn1 update: s1ap asn1 is now v16.1 (2020-03) 2020-12-22 16:28:24 +01:00
Francisco Paisana 66aa34d173 update RRC NR ASN1 to 2020-09 v15.11 2020-12-18 12:50:37 +01:00
Andre Puschmann d5daf60773 pdu_test: add unpacking test for DL-SCH PDU containing TA command 2020-12-18 12:28:52 +01:00
Francisco Paisana e27c0869e5 update RRC ASN1 to 2020-09 v15.11 2020-12-17 17:55:58 +01:00
Andre Puschmann bc4c9606ce rlc_am: add extended bearer metrics
this patch adds support for measuring the:
* SDU rx latency (Average time in ms from first RLC segment to full SDU)
* amount of buffered bytes (sum of payload of PDUs buffered in rx_window)

the implementation is using std::chrono
2020-12-17 17:46:55 +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