Network topology

130 views
Skip to first unread message

Daniele Cerasuolo

unread,
Mar 27, 2023, 4:59:29 AM3/27/23
to OpenWISP
hi, I am trying to configure the network topology on my installation with an openwrt test device installed in a virtual machine. From directives i can't install an openvpn server, what is the easiest method to implement the topology? i tried with the script

   #!/bin/sh
    BASE_URL="https://network-topology-visualizer.mynetwork.org"
    UUID="4e38397a-4254-4521-89a6-045db25b8de6"
    KEY="S9wCfjeFN8irasZNiV7dGcyK68BTES0m"

    COLLECTOR_URL="$BASE_URL/api/receive/$UUID/?key=$KEY"
    DATA=$(echo "/netjsoninfo filter graph ipv4_0" | nc 127.0.0.1 2009)
    curl -s -X POST -d "$DATA" --header "Content-Type: text/plain" $COLLECTOR_URL

but entering my data seems not to work

Federico Capoano

unread,
Mar 27, 2023, 10:04:24 AM3/27/23
to open...@googlegroups.com
Hi,

The topology module needs to be fed topology data which is parsed and sent to the collector.
Usually some networking software like OpenVPN or a dynamic routing protocol have the topology information which can be parsed and collected.
From what software do you want to collect the network topology from?

Federico

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/b48c900d-29f8-4b8c-a984-68cdd41b93a1n%40googlegroups.com.

Daniele Cerasuolo

unread,
Mar 28, 2023, 5:20:41 PM3/28/23
to open...@googlegroups.com
Hi Federico, 
first of all thank you for your quick response and your great job. Actually the question is if there is something integrated to retrieve this data. In case it does not exist, what kind of software do you recommend besides openvpn? 

Federico Capoano

unread,
Mar 29, 2023, 8:00:55 AM3/29/23
to open...@googlegroups.com
The softwares currently supported are:

VPNs:

- OpenVPN
- Wireguard

Format:

- NetJSON NetworkGraph

Dynamic routing demons:

- OLSRd
- Batman-advanced
- other less known routing deamons and formats

It is also possible to write a parser to supply the data to the collector in NetJSON NetworkGraph format.

The main question is: what kind of networking technology are you using and how does your topology look?
Is it a LAN network, an OSPF network, etc. 

The topology module was built mainly to show topologies of wireless networks, these networks are usually deployed using routing protocol software which are able to collect the topology information.
But the same concept can be adapted to other situations.

Best regards
Federico Capoano


Michele Salerno

unread,
Apr 4, 2023, 1:32:27 PM4/4/23
to open...@googlegroups.com

I use openvpn but don't works.

On my openvpn server i have this option "management localhost 7505"
My templates on openwisp is:

#!/bin/sh
COLLECTOR_URL="https://controller.nnxx.ninux.org/api/v1/network-topology/topology/81461fe7-479b-4a6d-96cc-7b873bcd4efe/receive/?key=qGfhxlhfepEllYDiheZIBrNQVRgqcsM0"
DATA=$(cat /var/log/openvpn.stats)
curl -s -X POST -d "$DATA" --header "Content-Type: text/plain" $COLLECTOR_URL

i run this: /usr/sbin/send_topology

{"detail":"Supplied data not recognized as OpenVPN, got exception of type \"ConversionException\" with message \"OpenVPN parsing error: expected 'OpenVPN CLIENT LIST' but got 'OpenVPN STATISTICS'\""}

# more /var/log/openvpn.stats

OpenVPN STATISTICS
Updated,2023-04-02 23:04:29
TUN/TAP read bytes,5005389
TUN/TAP write bytes,19304454
TCP/UDP read bytes,22829623
TCP/UDP write bytes,5995265
Auth read bytes,19304560
pre-compress bytes,0
post-compress bytes,0
pre-decompress bytes,0
post-decompress bytes,0
END

I never understood how to make it work.

Thanks.


Il 29/03/23 14:00, Federico Capoano ha scritto:
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/CAAGgX6JzP_DwGV7O2he%2BKCdB6HvGkPOYN_RctUHZXPUTiz8Y8w%40mail.gmail.com.
-- 
Informativa Privacy - Ai sensi del D. Lgs n. 196/2003 (Codice Privacy) si precisa che le informazioni contenute in questo messaggio sono riservate e ad uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.

Privacy Information - This message, for the D. Lgs n. 196/2003 (Privacy Code), may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.

Federico Capoano

unread,
Apr 4, 2023, 1:35:52 PM4/4/23
to open...@googlegroups.com
Michele, that's most probably due to the OpenVPN status format version.
We use this library under the hood to parse that format: https://github.com/tonyseek/openvpn-status
It supports only one version, OpenVPN supports two different formats, the format you shared doesn't look like the one supported by the library, that's why it is not working.

I hope this helps.
Federico

Message has been deleted

Federico Capoano

unread,
Apr 10, 2023, 11:54:17 AM4/10/23
to open...@googlegroups.com
I would write a script which takes the output of the arp table and LLDP tools you use and converts it to NetJSON NetworkGraph.
Once you have the NetJSON NetworkGraph object you can feed it to the Network Topology collector, example from the script previously mentioned in this thread:
curl -s -X POST -d "$DATA" --header "Content-Type: text/plain" $COLLECTOR_URL
$DATA being the variable holding the NetJSON NetworkGraph object (it's JSON formatted plain text).
If the tools you're using are common enough, the logic of these scripts could be integrated in OpenWISP in some way or shared with the community.

Federico 

On Mon, 10 Apr 2023 at 09:31, Daniele Cerasuolo <d.cer...@gematica.com> wrote:
Our network is basically a LAN (wired), and consists of a layer 2 transport backbone and central and peripheral routers.
The devices are either openwrt or proprietary OS (e.g. CISCO).
The protocols to be used for the network topology are arp tables (MAC addresses), LLDP and static routes. What might be the best solution in this case?
Reply all
Reply to author
Forward
0 new messages