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.
Unfortunately, the existing networking API (common/network_utils.h)
lacks the UNIX domain socket support, and it turned to be easier
to implement a simple, single client server using Boost.Asio.
The server runs in its own thread with a blocking Tx queue, and
calls a user definted callback on receipt of any data from client.
Multiple client connections are not supported and will be rejected.
This commit introduces a skeleton class (child of 'nas_base') for
the upcoming implementation of an external NAS interface, as well
as the implementation-specific configuration container.