.. _datactrl:

===========================
Data and Control Interfaces
===========================

This section provides a brief overview of the Satlab SRX-8 data- and control interfaces.

.. image:: img/datainterfaces.drawio.svg
   :scale: 100%

The SRX-8 is controlled via `CubeSat Space Protocol (CSP) <http://www.libcsp.org/>`_ messages over
CAN, UART or gigabit Ethernet. This includes configuration of the system as well as reading of
telemetry and status.

There are two ways to submit downlink data to the SRX-8:

- For ease of use, use the SRX-8 as an IP router, forwarding traffic received on the two Ethernet
  interfaces using :ref:`ipfwd`.
- For maximum throughput and control, build and submit BBFRAMEs to an instance of the :ref:`ethdata`
  data service that is reachable on each of the data endpoints.

The SRX-8 replies to ARP (e.g. ``arping``) on the two data endpoints (default ``192.168.100.101``
and ``192.168.101.101``).

The example below shows how to verify connection to the 1 Gb/s data endpoint. Note that
a valid IP route must be set up on the host PC prior to the test and the ``sys.net.en.enable``
property must be set to ``true`` to enable the 1 Gb/s Ethernet interface. Updating this
property requires a store followed by a system reset. See :ref:`properties` for
more information.

.. code-block:: none

    satlab@satlab:~$ sudo arping 192.168.100.101 -c 3
    ARPING 192.168.100.101 from 192.168.100.170 <1Gb/s_interface>
    Unicast reply from 192.168.100.101 [48:E6:C6:20:01:02]  1.013ms
    Unicast reply from 192.168.100.101 [48:E6:C6:20:01:02]  1.133ms
    Unicast reply from 192.168.100.101 [48:E6:C6:20:01:02]  1.065ms
    Sent 3 probes (1 broadcast(s))
    Received 3 response(s)

The example shown above can also be used to verify the 10 Gb/s Ethernet interface,
except that the default IP range is different and that ``sys.net.xg`` props should be used instead.
