Commit Graph

1521 Commits

Author SHA1 Message Date
Vadim Yanitskiy 7b38286864 srsue/extnas: implement RRCTL codec and message handling
RRCTL is a simple protocol (inspired by Osmocom's L1CTL) that allows
an external NAS entity to control the RRC layer of srsUE. The most
notable primitives are PLMN search, selection, and PDU transfer.

The protocol assumes traditional master-slave communication, where
one side (an external NAS entity) initiates various processes,
while the other (srsUE) executes them and indicates the outcome.

Each RRCTL message starts with a header that can be defined as follows:

  +-------------------------------+--------------------------+
  | Message type                  | 6 bits                   |
  +-------------------------------+--------------------------+
  | Message sub-type              | 2 bits                   |
  +-------------------------------+--------------------------+
  | Spare (RFU)                   | 8 bits                   |
  +-------------------------------+--------------------------+
  | Payload length                | 2 octets (big endian)    |
  +-------------------------------+--------------------------+
  | Payload (optional)            | (see payload length)     |
  +-------------------------------+--------------------------+

The following message types are defined at the moment:

  - RRCTL_RESET - reset internal state of the external NAS interface
                  (does nothing for now, may be useful in the future);

  - RRCTL_PLMN_SEARCH - initiates PLMN (carrier) search on pre-configured
                        EARFCN (Absolute Radio Freqency Number);

  - RRCTL_PLMN_SELECT - binds the UE to one of the previously detected
                        carriers (see RRCTL_PLMN_SEARCH) defined by a
                        given pair of MCC and MNC;

  - RRCTL_CONN_ESTABLISH - establishes connection to the serving cell
                           (previously selected using RRCTL_PLMN_SELECT)
                           with a given cause and NAS PDU;

  - RRCTL_CONN_RELEASE - releases previously established dedicated connection
                         (currently does nothing because the RRC layer does
                          not expose any API for that);

  - RRCTL_DATA - encapsulates a received (Downlink) or to be transmitted
                 (Uplink) NAS PDU (the former also contains LCID).

Each message type has at least two of the following sub-types:

  - RRCTL_REQ - request (usually comes from an external NAS entity),
                used to initiate some process (e.g. PLMN search);

  - RRCTL_IND - indication that something has happened without a prior
                request (for example, a Downlink NAS PDU was received);

  - RRCTL_CNF - confirmation (positive conslusion) of the requested task;

  - RRCTL_ERR - negative conslusion of the requested task (error).

The protocol definition (enums ans structs) and codec functions are
defined in a separate namespaces: 'rrctl::proto' and 'rrctl::codec'
respectively. The codec functions may throw exceptions of type
'rrctl::codec::error' if something goes wrong.
2022-01-31 17:17:57 +06:00
Vadim Yanitskiy d56863ff4e srslte/common: constify the argument of byte_buffer_t::append_bytes()
This function does not modify the input buffer. Let's make it
possible to pass 'const uint8_t *' pointers without loosing
the const qualifier and making GCC unhappy.
2020-11-09 05:34:03 +07:00
Vadim Yanitskiy d4f1310fca srslte/interfaces: mark to_number() of struct plmn_id_t as const
This function does not modify any fields of the structure. Without
the 'const' qualifier it's impossible to call to_number() through
a const pointer of type 'struct plmn_id_t'.
2020-11-09 05:34:03 +07:00
Xavier Arteaga 58be68f856 Changed cell gain command from cell index to cell id 2020-10-26 10:13:02 +01:00
Francisco Paisana 4cb6ed27eb updated scheduler ue mcs computation to account for new 256QAM tables 2020-10-22 19:55:46 +02:00
Francisco Paisana 698af97ec4 updated asn1 utils to account for conversion from 0 to bitstring. Added asn1 utils test to repository. 2020-10-20 16:29:44 +01:00
faluco 8376111419 - LGTM fixes. 2020-10-20 14:45:18 +02:00
Andre Puschmann bb1dd0f4cf gnb_interface: remove FIXME 2020-10-18 15:56:16 +02:00
Francisco Paisana 665b3996bb now the phy controller handles the scenario where the phy cell selection failed to be initialized 2020-10-16 15:54:42 +01:00
Pedro Alvarez 4c1416b84f Remove redundant declaration of EIA2 2020-10-16 11:11:51 +01:00
Francisco Paisana 9b10acff06 implemented logical channel prioritization in DL scheduler 2020-10-14 22:55:12 +01:00
Andre Puschmann fab86382c1 mac,rrc: add interface to set SR config explicitly without touching any other MAC function
when releasing PUCCH/SRS (see 5.3.13 in 36.331) we need to reset the SR config as well.
In our case, SR is handled by MAC so we need to (re-)configure MAC, not all of
MAC though, just SR.
2020-10-13 17:38:45 +02:00
Francisco Paisana e7239163e9 silence noisy unhandled in_sync_ev logs 2020-10-12 18:24:14 +01:00
Francisco Paisana b7ed8b1858 - added react method to to_state<...> transitions
- s1 handover composite state simplified
- the eNB now starts a HO cancellation when it receives an invalid
Handover Command
- the FSM log now prints the current state when it receives an unhandled
event
2020-10-12 18:24:14 +01:00
Andre Puschmann 30b8848ea9 metrics_hub: protect access to vector of metrics_listener
prevent potential race between metrics hub thread trying
to access the metrics vector and another thread
adding another element to it
2020-10-08 12:30:57 +02:00
Pedro Alvarez b43e724b4c Remove packing/unpacking code for M2AP. 2020-10-08 11:02:50 +01:00
Pedro Alvarez 5a4e71a6e4 Created k_enb_context structure that holds k_enb, NCC and NH to make it easier to restore context from failed handover. 2020-10-08 09:46:34 +01:00
Pedro Alvarez 00ac85e1b3 Small compilation fixes for GCC 10.1 2020-10-07 15:38:57 +02:00
Xavier Arteaga da54e2b501 Better docs in RRC interface types and apply clang-format 2020-10-07 09:58:23 +02:00
Xavier Arteaga 6ae47b6510 SRSUE: Deafult PUCCH/SRS does not imply full PHY dedicated defaults 2020-10-07 09:58:23 +02:00
Francisco Paisana 137e554eb3 reestablish pdcp bearers is required in case of AM bearers 2020-10-01 16:57:08 +01:00
faluco 079ae70e64 - Fix logs entries having two newlines instead of one. The old log formatter will delegate this to the new one. 2020-10-01 17:06:41 +02:00
Xavier Arteaga ef9d77c966 SRSUE: add PRACH config present field in PHY configuration structure 2020-09-30 17:10:48 +02:00
faluco 51b27fc255
Import latest srslog version (#1796)
* - Import latest srslog version.
- Adjusted the nas_test to create logs correctly.
- Remove timestamp formatting now that is provided by srslog.
2020-09-30 15:52:42 +02:00
faluco dfeed52514 - Rename out_stream function to console. 2020-09-29 17:38:13 +02:00
faluco 62faef7c71 - Replaced all uses of the log::console method. 2020-09-29 17:38:13 +02:00
faluco 302f9793ca - Add common utils to print to stdout and stderr as a first step to remove the log::console method. 2020-09-29 17:38:13 +02: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
Sylvain Munaut 2890bd07ea liblte_mme.h: Adjust LIBLTE_MME_PACKET_FILTER_MAX_SIZE for IPv6
Original was 20 but TS 24.008, section 10.5.6.12 specifies a max
of 60 for ipv6 packet filter
2020-09-28 16:08:28 +02:00
Xavier Arteaga d375e305ec Initial NR DMRS for PDSCH 2020-09-25 11:28:04 +02:00
Ismael Gomez 76bfc78147
Fix issues with Sounding-RS (#1761)
* Fix deadlock caused by update_measurements calling in_sync

* Fix overlapping SRS condition

* Do not use shortened PUSCH in transmissions and retx from RAR

* Revert "Fix deadlock caused by update_measurements calling in_sync"

This reverts commit f58c8c8c766f8f95baa3a3bf8287d8e25b2057ba.
2020-09-24 22:25:24 +02:00
Pedro Alvarez 86f4d469c6 Added some functions to save and restore AS keys for the case of failed handover in the USIM 2020-09-24 13:30:08 +01:00
Ismael Gomez b94d24ed98
Take into account CRS from neigbhour cells when measuring interference (#1757)
* Take into account CRS from neigbhour cells when measuring interference

* fix std::isnormal compilation

* Fixed compilation of test

* Address comments

* Remove unused overrides
2020-09-23 21:46:03 +02:00
Xavier Arteaga ede58319ae Vector: added conjugate complex float to short 2020-09-23 09:06:03 +02:00
Xavier Arteaga c20d4ff5cc Added ringbuffer zerocopy a timeout 2020-09-23 09:06:03 +02:00
Andre Puschmann 1afc137032
[REBASE] Make PHY non-blocking and fefactor HO procedure (#1753)
* Make PHY non-blocking and fefactor HO procedure

* makes entire PHY non-blocking through command interface
* adds dedicated queue for cell_search/cell_select commands
* refactor HO procedure to run faster, in one stack cycle. Looks closer to the specs
* force ue to always apply SIB2 configuration during reestablishment
* Run update_measurements in all workers

Co-authored-by: Ismael Gomez <ismagom@gmail.com>
2020-09-22 21:47:16 +02:00
faluco c1e680769c - Remove stray code left behind. 2020-09-22 18:00:50 +02:00
faluco f604506858 - Fixed missing initialization issues in nas that caused several jumps in liblte_mme to use uninitialized memory.
- Fixed missing initialization in spgw that caused recvfrom to use an unitialized argument.
2020-09-22 18:00:50 +02:00
faluco f0d651ae8e - Fixed a leak in the MME class not releasing the static byte buffer pool.
- Now the pool gets destroyed on program exit using a unique_ptr.
- Removed manual cleanup() calls in all the code base to free the pool instance.
2020-09-22 18:00:50 +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
faluco b892da0294 - Calculate the FFT of the PRACH on demand.
- Fixed a PRACH test that was failing with ASAN.
2020-09-21 09:50:20 +02:00
Xavier Arteaga 44c2412be2 SRSUE: silent PUSCH encoding error by dropping invalid grant 2020-09-17 22:39:56 +02:00
Andre Puschmann 6dc7841369 epoll_helper: move code to block OS signals into own helper function
before epoll can handle signals, the calling thread needs to block
them. the blocking needs to happen before any other threads get
spawned so they inherit the mask.
2020-09-14 21:20:00 +02:00
faluco 5e8a4c898d
Bring back the circular array object. (#1712) 2020-09-09 17:16:47 +02:00
Andre Puschmann 6a56476b2a rlc: increase RLC Tx SDU queue
the Tx SDU has been set to 128 PDUs because this gives approx.
150kByte UL buffer state (max value for Rel 8 BSR).

Previously, however, we've always reported too much pending UL
data because we weren't subtracting the transmitted data from
the reported data.

with this newer BSR reporting, however, even with full buffers we would
never report full buffers because the queues size is too short.

This seems to cause issues for iperf TCP sessions not resulting
in full DL rate, see isse #1703. It seems that the TCP bandwitdh
probing works better with larger buffers (in our case this can
only be achieved with more PDUs in the pool).

This should fix #1703
2020-09-08 22:27:21 +02: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 e80aa0a553 add circular array class to simplify access to truly circular arrays 2020-09-07 15:56:48 +02:00
yagoda b5a8d82058 -adding more prach tests to make test, removing some variables from stack
-PRACH time offset to TA unit conversion
2020-09-07 14:56:12 +01:00
yagoda 59082770d3 moving some arrays to the heap, fixing formatting, setting dft norm 2020-09-07 14:56:12 +01:00
yagoda f6ea431555 -adopting new PRACH equalization approach for successive cancellation
-adding frequency domain time offset detection
-adding to testing of PRACH
2020-09-07 14:56:12 +01:00