Commit Graph

246 Commits

Author SHA1 Message Date
Andre Puschmann 6d3af2d2bd rlc_um: fix bearer name in logging after re-configuration
the RLC bearer name was empty after reestablishing a UM bearer.

we need to pass the RLF config and RB name to the internal configure()
call of the Rx entity, like we already do for the Tx side
2020-12-12 15:59:25 +01:00
Andre Puschmann 795db30338 pdcp: drop PDCP control PDUs
this patch adds a check to drop all PDCP control PDUs
in order to prevent handling them as data PDUs.

This could happen when the size exceeded the arbitrary length check.

This should fix #1787
2020-09-29 15:29:04 +02:00
Francisco Paisana dcf5a727f2 do not send RRC release in case the eNB receives a S1AP UEContextRelease command and the UE is doing handover. Handle GTPU end marker 2020-09-22 16:51:45 +01:00
Andre Puschmann 569d8ee860 rlc: remove unused macro
this seems to be a legacy copy of the RLC_TX_QUEUE_LEN macro
in rlc_interfaces_types.h
2020-09-08 22:27:21 +02:00
Andre Puschmann 55336665b9 rlc: remove timers and sdu queue length from RLC TM ctor
timers aren't used in RLC TM, also the default queue length is
fine to be used at all times.
2020-08-21 12:03:07 +02:00
Andre Puschmann 9550bd3ef8 rlc: revisit interface for MAC and RRC
* add locked and unlocked version of has_data() since one is
  called from stack and one from PHY threads

* add comments in each interface section as to why locking
  is required or not

* remove RLC rwlock when not required

* move calls only used by RRC to RRC section
2020-07-21 11:56:43 +02:00
Andre Puschmann c8b4ba885b rename rlc_tx_queue to byte_buffer_queue
this data structure will be used by the PDCP layer as well.
2020-07-14 18:18:32 +02: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 1a9c04bf2f use of task scheduler handle in pdcp 2020-07-13 11:19:25 +01:00
Andre Puschmann ff96336f91 rlc_um: fix reestablishment for sending UM entity
we've reset the rx state variables during reestablishment but not
the tx state variable.
2020-07-02 17:52:55 +02:00
Andre Puschmann df50dd7d3c rlc: extend RLC metrics
extend RLC metrics to count Rx/Tx PDUs/SDUs bytes/#
2020-06-26 17:58:36 +02:00
Andre Puschmann 82f811ed52 rlc_am: change return value when writing SDU
return false when SDU couldn't be added to SDU tx queue so
to count dropped SDUs in base
2020-06-26 17:58:36 +02:00
Andre Puschmann fc3cd24177 rlc_um: fix counting of lost PDUs
* change try_push() return value to indicate whether the addition
  of the SDU to the tx queue was successful or not
* count lost PDUs
2020-06-26 17:58:36 +02:00
Francisco Paisana 0259d31b13 fix lack of final in pdcp virtual methods 2020-06-18 23:37:26 +01:00
Francisco Paisana 2f8dad03cc add rlc nr locking 2020-06-18 23:37:26 +01:00
Francisco Paisana f0874b780b add radio_base/null classes 2020-06-18 23:37:26 +01:00
Pedro Alvarez 9c1a7d2cf1 Removed get_bearer_status in PDCP. Renamed get_state/set_state to
get_bearer_state/set_bearer_state.
2020-06-18 12:13:57 +01:00
Pedro Alvarez 08578a7331 Switched to use a struct to hold the PDCP entity state variables. Deleted some unecessary setters. 2020-06-18 12:13:57 +01:00
Pedro Alvarez 66d4f320e5 Added intereface to set PDCP state after reestablishment. 2020-06-18 12:13:57 +01:00
Pedro Alvarez 33567d81db Added interface to get internal PDCP state. 2020-06-18 12:13:57 +01:00
Pedro Alvarez 4093e75237 Starting to add getters and setters of the state in PDCP lte entity. 2020-06-18 12:13:57 +01:00
Francisco Paisana b4b5cd7cd6 added nr gnb and ue interfaces 2020-05-25 11:48:16 +01:00
Ismael Gomez a1f0f8de35
Add callback to RLC to indicate BSR for TX and reTX queues (used in ENB) (#1361) 2020-05-22 11:20:33 +02:00
Andre Puschmann 1eaa99530f rlc_am: tiny refactor of rlc_amd_pdu_header_t
mainly turning header into proper class and adding default init value
2020-05-21 10:33:55 +02:00
Francisco Paisana 791d84e639 created error_type and cleaned up expected 2020-05-11 16:08:20 +01:00
Francisco Paisana 975d004224 fix compilation error 2020-05-11 16:08:20 +01:00
Francisco Paisana a2b76a4a5f use references rather than pointers 2020-05-11 16:08:20 +01:00
Andre Puschmann 99c3975f83 remove CMake option to disable glibc header for IPv6
we've added this to allow building for older glibc
version that cause issues with redefining some structs.

this patch removes the flag and auto-detects it using the glibc version
2020-05-05 19:04:14 +01:00
Francisco Paisana 3da8464a21 fix compilation issue with lack of override keyword and scoping in fsm 2020-04-27 22:19:08 +01:00
Xavier Arteaga 01e224348c Fix compilation for NR HL 2020-04-22 18:01:43 +02:00
Xavier Arteaga 77d5dedddc Fix LGTM warnings and recommendations 2020-04-22 18:01:43 +02:00
Pedro Alvarez ad0abe740b Added support to PDCP SN len of 7. Also added a check for valid configs in pdcp entity. 2020-04-22 17:44:00 +02:00
Francisco Paisana c09f76ed6c unified stack task defer method 2020-04-10 22:30:59 +01: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
Andre Puschmann 9307a54512 pdcp: adding enable_security_timed() method
this is an extension to the currently available security
configuration and activation methods provided by PDCP.
The new call allows to specify a Rx and Tx SN after which the
entire security config, i.e. integrity and ciphering, should
be enabled.

this is mainly required for the PDCP entity of the conformance
testing SS but could potentially also be used by the eNB
to enable security for PDCP after sending the SecModeCommand
for example.

the extra call was added to not break the existing API.
2020-04-09 10:55:13 +02:00
Pedro Alvarez f4d648b26e Removed rx_count state variable from PDCP LTE entity. Updated get_bearer_status(...) acordingly. Added get_last_submitted_rx_count() getter. 2020-04-09 10:55:13 +02:00
Francisco Paisana 30ae2226c1 common interface for stack multiqueue tasks, background tasks and timers 2020-03-31 13:42:06 +01:00
Francisco Paisana 575475962f the rlc um rx does not need a mutex bc it is always called in the stack thread 2020-03-26 20:11:35 +00:00
Francisco Paisana 8aa44928e9 fix 5g compilation errors 2020-03-25 15:50:30 +00:00
Francisco Paisana 344eaf49ec use logmap in the whole enb and ue 2020-03-25 15:50:30 +00:00
Francisco Paisana 9bde6d442c removed the uneeded locks from the pdcp 2020-03-23 19:58:18 +00:00
Francisco Paisana f3890b2908 use of mutexed cache to store the valid lcids that can be checked from gw thread 2020-03-23 19:58:18 +00:00
Francisco Paisana 46a1be3e76 updated mac-rlc interface to use unique_byte_buffer 2020-03-22 11:50:58 +00:00
Francisco Paisana 597334c4bf limit the rlc queue size for suspended bearers 2020-03-18 13:22:08 +00:00
Xavier Arteaga e832769ae6 Updated copyright 2020-03-16 11:26:06 +01:00
Pedro Alvarez 96c82b3fc6 Moved PDCP configs to pdcp_config.h. Added `as_security_cfg_t` structure to hold access stratum keys.
Refactored PDCP, RRC and USIM accordingly.
2020-03-11 09:00:38 +00:00
Andre Puschmann 9e113f8b27 pdcp: allow to configure security for rx/tx seperately
previously PDCP security (integrity and ciphering) could only
be enabled for both Rx and Tx at the same time.

this, however, caused an issue during the conformance testing in which,
in TC_8_2_1_1() for example, the eNB sends a SecModeCommand and a
RRC Reconfiguration in the same MAC TB. In this case, the eNB
needs to be able to enable DL security right after sending the SecModeCmd
in order to send the RRCReconfig encrypted. However, enabling UL security needs
to be postponed until after the SecModeComplete is received.

This patch allows to enable PDCP security for rx/tx independently if
that is needed. The default way is like before, enabling it for tx/rx at
the same time.
2020-03-01 18:26:45 +01:00
Pedro Alvarez aecfb151ce Apply clang-format to the lib in preperation for PR. 2020-02-20 20:53:27 +01:00
Pedro Alvarez d98b888ca4 Separating PDCP read_header function from discard_header_function. Starting to add DRB unit test. 2020-02-20 20:53:27 +01:00
Pedro Alvarez 284a0f7b4e Starting to add PDCP LTE unit tests. Test failing for now. 2020-02-20 20:53:27 +01:00