245 Commits (0396ebae1773e6c4ca2f72baf31e5d4bd24d55fe)

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
4 years ago
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 4 years ago
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
4 years ago
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.
4 years ago
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
4 years ago
Andre Puschmann c8b4ba885b rename rlc_tx_queue to byte_buffer_queue
this data structure will be used by the PDCP layer as well.
4 years ago
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
4 years ago
Francisco Paisana 1a9c04bf2f use of task scheduler handle in pdcp 4 years ago
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.
4 years ago
Andre Puschmann df50dd7d3c rlc: extend RLC metrics
extend RLC metrics to count Rx/Tx PDUs/SDUs bytes/#
4 years ago
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
4 years ago
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
4 years ago
Francisco Paisana 0259d31b13 fix lack of final in pdcp virtual methods 4 years ago
Francisco Paisana 2f8dad03cc add rlc nr locking 4 years ago
Francisco Paisana f0874b780b add radio_base/null classes 4 years ago
Pedro Alvarez 9c1a7d2cf1 Removed get_bearer_status in PDCP. Renamed get_state/set_state to
get_bearer_state/set_bearer_state.
4 years ago
Pedro Alvarez 08578a7331 Switched to use a struct to hold the PDCP entity state variables. Deleted some unecessary setters. 4 years ago
Pedro Alvarez 66d4f320e5 Added intereface to set PDCP state after reestablishment. 4 years ago
Pedro Alvarez 33567d81db Added interface to get internal PDCP state. 4 years ago
Pedro Alvarez 4093e75237 Starting to add getters and setters of the state in PDCP lte entity. 4 years ago
Francisco Paisana b4b5cd7cd6 added nr gnb and ue interfaces 5 years ago
Ismael Gomez a1f0f8de35
Add callback to RLC to indicate BSR for TX and reTX queues (used in ENB) (#1361) 5 years ago
Andre Puschmann 1eaa99530f rlc_am: tiny refactor of rlc_amd_pdu_header_t
mainly turning header into proper class and adding default init value
5 years ago
Francisco Paisana 791d84e639 created error_type and cleaned up expected 5 years ago
Francisco Paisana 975d004224 fix compilation error 5 years ago
Francisco Paisana a2b76a4a5f use references rather than pointers 5 years ago
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
5 years ago
Francisco Paisana 3da8464a21 fix compilation issue with lack of override keyword and scoping in fsm 5 years ago
Xavier Arteaga 01e224348c Fix compilation for NR HL 5 years ago
Xavier Arteaga 77d5dedddc Fix LGTM warnings and recommendations 5 years ago
Pedro Alvarez ad0abe740b Added support to PDCP SN len of 7. Also added a check for valid configs in pdcp entity. 5 years ago
Francisco Paisana c09f76ed6c unified stack task defer method 5 years ago
Francisco Paisana a2ade9edd1 break down rrc_interface_types.h into multiple files. moved pdcp_config.h to same folder 5 years ago
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.
5 years ago
Pedro Alvarez f4d648b26e Removed rx_count state variable from PDCP LTE entity. Updated get_bearer_status(...) acordingly. Added get_last_submitted_rx_count() getter. 5 years ago
Francisco Paisana 30ae2226c1 common interface for stack multiqueue tasks, background tasks and timers 5 years ago
Francisco Paisana 575475962f the rlc um rx does not need a mutex bc it is always called in the stack thread 5 years ago
Francisco Paisana 8aa44928e9 fix 5g compilation errors 5 years ago
Francisco Paisana 344eaf49ec use logmap in the whole enb and ue 5 years ago
Francisco Paisana 9bde6d442c removed the uneeded locks from the pdcp 5 years ago
Francisco Paisana f3890b2908 use of mutexed cache to store the valid lcids that can be checked from gw thread 5 years ago
Francisco Paisana 46a1be3e76 updated mac-rlc interface to use unique_byte_buffer 5 years ago
Francisco Paisana 597334c4bf limit the rlc queue size for suspended bearers 5 years ago
Xavier Arteaga e832769ae6 Updated copyright 5 years ago
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.
5 years ago
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.
5 years ago
Pedro Alvarez aecfb151ce Apply clang-format to the lib in preperation for PR. 5 years ago
Pedro Alvarez d98b888ca4 Separating PDCP read_header function from discard_header_function. Starting to add DRB unit test. 5 years ago
Pedro Alvarez 284a0f7b4e Starting to add PDCP LTE unit tests. Test failing for now. 5 years ago
Pedro Alvarez b841859220 Moved pdcp test functionality to a common header. Fixed linking issue in 5GNR PDCP 5 years ago