Communication between two components on separate i.MX8 boards

Hi everyone,

I’ve successfully booted Genode on an i.MX8 development board and am now able to run a custom program as a Genode component. So far, everything works well on a single board.

Now, I’m looking to take the next step: I want to run a program (component) on each of two separate i.MX8 boards and enable communication between them — for example, to transmit data from one component to the other over the network.

Is there any documentation, tutorial, or example that explains how to implement inter-device communication between Genode components?

Any advice or pointers would be greatly appreciated!

Hi, that depends a bit on the amount, frequency and required reliability of your data transmissions. There are a few options that come to my mind:

  • using the libc socket API in your components to enable direct network communication
  • using libcurl in combination with lighttpd for file transmission (e.g. via webdav)
  • using the ssh_server from genode-world in combination with an sftp client or ssh client (e.g. using libcurl)
  • using the ROM proxy components from genode-world to transparently translate a ROM session into UDP

There might be more options. Could you elaborate your particular usage scenario (i.e. the type and requirements of your inter-component communication)? Is it file-oriented, character-based/binary, stream of data, bi-directional/uni-directional, …?

1 Like

Thanks for the suggestions!

To elaborate a bit more on my use case: I need to transmit some tensor data from one development board to another, not in the form of files but as raw data. The communication is one-way, meaning that the sender sends the data, but the receiver does not need to send anything back.

I think direct network communication would be helpful, but which document can I follow?

I believe that the ROM proxy approach could fit your use case. It transmits the content of a ROM dataspace via UDP using go-back-N ARQ. You can find a brief documentation in the corresponding README. Note, however, that the components are not regularly tested nor used and are therefore quite neglected. They probably need to be adapted to the current API.

Alternatively, e.g. if you feel more confident with the socket API you may look for any tutorial online. Note that Genode’s C-runtime is based on FreeBSD’s libc, thus there might be subtle differences. The netty test applications provides an idea how to use the sockets in Genode.

A more scalable solution for your use case would be to e.g. use a protocol like MQTT. This will require porting an MQTT broker to Genode or running it on another platform. You can do basic (unencrypted) MQTT publish/subscribe operations with libcurl.