Commit Graph

34 Commits

Author SHA1 Message Date
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
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
Francisco Paisana f0874b780b add radio_base/null classes 2020-06-18 23:37:26 +01:00
Francisco Paisana b4b5cd7cd6 added nr gnb and ue interfaces 2020-05-25 11:48:16 +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
Francisco Paisana 30ae2226c1 common interface for stack multiqueue tasks, background tasks and timers 2020-03-31 13:42:06 +01: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
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 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 5f39c79bda Moved some more packing functions to base class. 2020-02-20 20:53:27 +01:00
Pedro Alvarez fdd67c3865 Fix issue in integrity check in PDCP SRBs. Moved some helper functions to the pdcp base class 2020-02-20 20:53:27 +01:00
Pedro Alvarez e68956bcf6 Adding discard timer timeout to PDCP config. 2019-12-04 18:21:14 +01:00
Pedro Alvarez d4fb4d8c86 Fixup clang-format in pdcp before PR. 2019-11-21 13:18:30 +01:00
Pedro Alvarez 15613465cf Moving some initialization from init function to constructor in the PDCP entities. 2019-11-21 13:18:30 +01:00
Andre Puschmann 2d126371f6 adopt PDCP NR to use new timer class 2019-11-07 14:12:08 +01:00
Pedro Alvarez b7fdcaabc5 Starting to add reordering timers at PDCP NR entity. Timeout seems to be triggered correctly and pass the SDUs to the upper layers when it expires. First tests passing. 2019-11-07 14:12:08 +01:00
Pedro Alvarez ff15ed5018 Starting to add timers to the NR PDCP. 2019-11-07 14:12:08 +01:00
Pedro Alvarez 6efa944b5e Removed srslte prefix from pdcp_config_t 2019-07-30 15:01:50 +02:00
Pedro Alvarez 0e7c5634f1 Added comment to PDCP maximum SDU size. 2019-07-30 15:01:50 +02:00
Pedro Alvarez dd56d08269 Replaced byte_buffer by array in PDCP base 2019-07-30 15:01:50 +02:00
Pedro Alvarez 491695ab77 Clang-formated PDCP NR PR. 2019-07-30 15:01:50 +02:00
Pedro Alvarez adfe9f950e Fixed issue in computing the SN. Added test for packets received in sequence for PDCP NR. Test is passing now. 2019-07-30 15:01:50 +02:00
Pedro Alvarez d3b6828082 Changed PDCP configuration to explicitly have tx and rx direction. Decrypt on PDCP NR seems fine. 2019-07-30 15:01:50 +02:00
Pedro Alvarez 73e30743d1 Added enum to PDCP config to replace two bools. 2019-07-30 15:01:50 +02:00
Pedro Alvarez 2081b22465 Added PDCP_SN_LEN constants. Added bearer_id and direction back to the pdcp_entity_base. 2019-07-30 15:01:50 +02:00
Pedro Alvarez d7a2721bb0 Adding algorithm to get COUNT for PDCP NR. Added convinience functions to manipulate HFN, SN and COUNT. 2019-07-30 15:01:50 +02:00
Pedro Alvarez bd91678d98 Continuing to split pdcp_entity into pdcp_entity_lte and pdcp_entity_nr 2019-07-30 15:01:50 +02:00
Pedro Alvarez 005d03cb1a Starting to split pdcp_entity into pdcp_entity_lte and pdcp_entity_nr to support NR PDCP 2019-07-30 15:01:50 +02:00