network-management-client icon indicating copy to clipboard operation
network-management-client copied to clipboard

[Feature Request]: "Simulator Mode" using multiple Portduino instances

Open GUVWAF opened this issue 2 years ago • 2 comments

This is a feature request to incorporate the functionality of the interactive simulator into this client, which is able to simulate n nodes using the Linux native application. They talk as if they did via LoRa, but using local TCP connections. The client should do the forwarding of these messages.

How I would envision this from a user perspective and what is needed in the back-end is as follows:

  1. User: Instead of using a serial/TCP connection, select “Simulator Mode”.
  2. User: Place nodes on the map, then click on “Start simulation”.
  3. Back-end: Start a Docker container and execute the Linux native application n times, each with a different TCP port starting from 4403. The client then starts a local TCP connection with each of the instances.
  4. User: Select which node you want to control (as if you were connected via serial or TCP with a physical device). Then you can send messages, view the map etc. as normal. To keep it simple, you could also just have a fixed node that you control.
  5. Back-end: When any of the nodes sends a packet (e.g. NodeInfo, DeviceTelemetry, or a TextMessage is sent via the client by the node currently under control), it will send a packet with SIMULATOR_APP as portnum to the client. The client should then decide based on the nodes’ locations which nodes can receive this message and forward the message to these specific nodes (based on the TCP port you know which node sent it and who to address). When a device receives a packet on the SIMULATOR_APP port, it handles it as if it received it via its LoRa radio, so it will also inform the client that it received it.

I think this will be a nice additional feature to do network management before deployment, or to investigate if placing an additional node somewhere is worth it.

GUVWAF avatar Jun 28 '23 18:06 GUVWAF

Thanks for the issue, I appreciate the detail! A couple of things I would love your thoughts on:

  1. I'm envisioning this simulation using a completely different UI to the current client. I'm picturing a UI that contains a map as well as a node list, which would then allow for the sending and editing as you discussed. I'm imagining the reason this would be included in this client is because of the backend infrastructure and not because of the current UI.
  2. Would you ever want a user to be able to drop a simulated node within a live network? This would make the feature significantly more complicated, but happy to consider if this would be something you're interested in.
  3. What role would you envision Meshtasticator playing assuming this issue gets implemented?

ajmcquilkin avatar Jun 29 '23 00:06 ajmcquilkin

  1. I'm envisioning this simulation using a completely different UI to the current client. I'm picturing a UI that contains a map as well as a node list, which would then allow for the sending and editing as you discussed. I'm imagining the reason this would be included in this client is because of the backend infrastructure and not because of the current UI.

Oh, I actually thought a completely different UI wouldn’t be necessary. I think especially the graph visualizations are nice for a “simulator mode”. At the beginning when the user has to place the nodes on the map, the other functionalities could just be grayed out or removed until you start the simulation. Then you need a way to select which node to control (maybe you can just select this in the current "Manage Nodes" window). A “nice to have” would be an additional map pane (like Waypoints and Network Analytics) where you could visualize how messages are propagated over the mesh.

  1. Would you ever want a user to be able to drop a simulated node within a live network? This would make the feature significantly more complicated, but happy to consider if this would be something you're interested in.

No, not per se. This is currently also not possible in the interactive simulator. You’d just have to start a new simulation without this node to see the difference.

  1. What role would you envision Meshtasticator playing assuming this issue gets implemented?

Depends on the supported functionality. Currently using the interactive simulator you can send a message from any node and you can also plot how this packet and its ACK gets propagated over the mesh, as well as a graph of the channel utilization of each node. If this is all possible within this client, it could replace the “interactive” part of Meshtasticator. The discrete-event simulator is something different; it’s more focused on large-scale and repeated simulations to analyze the overall performance of the protocol.

GUVWAF avatar Jun 29 '23 17:06 GUVWAF