Search code examples
pythongraphzeromqpyzmqrqt

Visualizing ZeroMQ network as graph in real time


I have a network of nodes in Python where I am using the ZeroMQ library with publish/subscribe messaging pattern to publish messages in a many-to-many fashion among other nodes. I want to be able to visualize the network of nodes as a graph where the edges represent the port connections between the nodes. I do not want to brute-force approach this; I want to run a python script that will automatically be able to achieve this on top of the zeromq nodes that I am already running. I want something that is similar to rqt_graph in ROS where I run rqt_graph and it automatically draws the nodes and connections.

I looked into Network Discovery with zeromq. I also found a page Visualizing ZeroMQ networks as graphs but I am trying to figure out how to do this in my implementation.


Solution

  • Q : "I want to run a python script that will automatically be able to achieve this on top of the zeromq nodes that I am already running."

    While ZeroMQ is quite a powerful framework with many ports, security is its next most important design perspective, right after the ZeroMQ performance.

    Without participating code "behind" the ZeroMQ links, your local-side is almost sure not to be able to "sniff" ZeroMQ links topology, right due to security and many-to-many ports in question.

    In case you inject both sides of the ZeroMQ link with properly designed add-on code, you may easily maintain a map of current live-agents' connections, given the agents cooperate with your distributed ZeroMQ-aware cooperative monitoring add-on code.