Commit Graph

2808 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 be400503b9 Add pass criteria to PRACH USRP test 2020-10-27 21:12:21 +01:00
Xavier Arteaga 28bb4709ff Solved possible high impact PHY out-of-bounds issues 2020-10-27 20:33:48 +01:00
Pedro Alvarez e4f143059e Simple log fix to make it easier to compare PDCP RX and TX. 2020-10-27 20:30:56 +01:00
Xavier Arteaga 58be68f856 Changed cell gain command from cell index to cell id 2020-10-26 10:13:02 +01:00
Andre Puschmann 0740154bff rrc,sync: fix two uninit vars
detected by Valgrind when running UE with TDD cell
2020-10-25 14:42:30 +01:00
Andre Puschmann 723ca2dd48 ra_dl: fix TDD reference symbol extraction
reported/provided by user softdev86 in https://github.com/srsLTE/srsLTE/issues/566

author tested with local 4 port cell. I am not able to verify locally but
it looks ok, we'll revise later if needed.
2020-10-25 14:42:30 +01:00
gracid f67a152a2a Remove unnecessary Lime calibration step from Soapy implementation
When using srsLTE with Lime devices, calibration was performed before any configuration steps have happened, thus making calibration values invalid. Removing Lime specific calibration step from rf_soapy_imp makes so that devices will be automatically calibrated by SoapyLMS on rf_soapy_start_stream call.

Tested and working with srsENB using LimeSDR-USB v1.4 and LimeSDR-Mini v1.2 boards.
2020-10-25 14:32:08 +01:00
gracid 78b63c9465 Set same antennas for all Soapy channels
This commit adresses an issue where two or more channels could have different antennas, despite being explicitly set in the configuration file
2020-10-25 14:30:42 +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 c7697b62a6 fix asn1_utils_test. arrays used for equal comparison where not being initialized. 2020-10-22 12:33:11 +01:00
Xavier Arteaga fac6d40a45 SRSENB: fix PUSCH max number of iterations 2020-10-22 09:24:40 +02:00
Xavier Arteaga 791c979063 Vector: fix cf to cs conjugate conversion 2020-10-22 09:24:40 +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
Andre Puschmann 5e7de0a95b cmake: install individual libraries (common, phy, etc)
this seems to be important for package maintainers
or people who use srslte components in other projects
thar require to link against static libs

so besides installing headers, the apps and the RF lib, we also
install all individual libraries

this fixes https://github.com/srsLTE/srsLTE/issues/500#
and https://github.com/softwareradiosystems/srsLTE/issues/1754
2020-10-20 14:47:03 +02:00
faluco 8376111419 - LGTM fixes. 2020-10-20 14:45:18 +02:00
Xavier Arteaga caf37b8e62 Added serving cell index in UCI/CSI report trace 2020-10-20 11:53:28 +02:00
Douglas Anderson fe21b2717c Fix "Comparison is always true because ret >= 0" LGTM warnings
... and refactor out some other dead code in the vacinity of these warnings
2020-10-19 18:10:36 +02:00
Andre Puschmann 48e7734188 phy_dl_test: fix uninit var 2020-10-18 15:56:16 +02:00
Andre Puschmann 1a03839f78 rlc_am_lte: fix potential bug when setting uint32_t to -1
discovered in Coverity CID 359664
2020-10-18 15:56:16 +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
Andre Puschmann 5a31c5765b rf_soapy: fix auto selection of Soapy device
when the default RF args are used, NULL is passed as argument
to the RF driver. In this case, we should use the previous
SoapySDRDevice_enumerate() and let Soapy pick the device
2020-10-15 17:41:50 +02:00
Francisco Paisana 9b10acff06 implemented logical channel prioritization in DL scheduler 2020-10-14 22:55:12 +01:00
Xavier Arteaga ca6566ad46 Fix PUCCH format1b false detection 2020-10-14 16:42:33 +02: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
Jan Remeš 8c7b7cc55a libsrslte_rf: add library version
This patch adds version string to the 'libsrslte_rf' library.
This results in the library being built as
    libsrslte_rf.so.20.04.2
with the following symbolic links
    libsrslte_rf.so.0 -> libsrslte_rf.so.20.04.2
    libsrslte_rf.so -> libsrslte_rf.so.0

The SRSLTE_SOVERSION variable should be increased with each backwards
incompatible change of the library.

Signed-off-by: Jan Remes <jan.remes@invasys.com>
2020-10-07 15:38:57 +02: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
yagoda 615af5cc4d setting seed to constant in prach test 2020-10-05 22:04:07 +01:00
Andre Puschmann b08a586fd4 pdu: refactor error logging
just some refactoring of error messages when a PDU packing error occurs
2020-10-05 22:41:12 +02:00
faluco 693d2f10b7 - Fix hex dumps newlines. 2020-10-05 13:22:53 +02:00
Pedro Alvarez 2f0125ef4e Fix issue recovering key state, when the first HO fails (specifically, is_first_ncc was not recovered). Minor improvements in key logging. 2020-10-01 18:48:07 +01: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
Andre Puschmann f73fa47a7b pdu: fix printing of buffer state of long BSR
extracted wrong number of bits for 2nd LCID in long BSR
2020-09-30 17:17:21 +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
Ismael Gomez 4e88daae21
Set DCI unpacking errors to info (#1781) 2020-09-30 10:04:08 +02:00
faluco 85544bb8d3 - Remove unnecessary newline character and optimize the code to use fputs instead of fprintf since no formatting is required. 2020-09-29 17:38:13 +02:00
faluco dfeed52514 - Rename out_stream function to console. 2020-09-29 17:38:13 +02:00