You are here

olsr-topology-view.pl - Improved Usability

25 posts / 0 new
Last post
AB4YY
olsr-topology-view.pl - Improved Usability

The default parameters for olsr-topology-view.pl work but produce a very difficult to follow auto-generated network diagram of the mesh network.  I finally spent some time recently to tweak the command-line parameters and came up with parameters that result in a really pleasing, nice to follow and actually (finally!) useful diagram.

I start the script on a Raspberry Pi with this command and parameters:

perl /var/www/html/topo-test.pl --size 60,60 --style 1 --fontsize 7 --bgcolor SteelBlue  --fontname Verdana

We currently have about 31 AREDN nodes so viewing on a computer where zooming in and out can be done is quite effective.  If printed on a letter-sized sheet it would still be too small but would be okay for something larger like a poster or maybe small poster size.  But the background color I chose work for a computer screen but would probably print a bit too dark on paper which means one would have to play with different 'bgcolors' until a better one is found.  Although the colors also have to work with the line colors, etc. so it gets a bit tricky.  I just printing once, maybe just use the SteelBlue I used.

I would be interested in seeing if others find this useful.

73 - Mike ab4yy

kj6dzb
kj6dzb's picture
Working this weekend... So

Working this weekend... So give me a week or so and i will run the. Ode.... In the mean time post a photo!

AB4YY
Attached is an example graphic

Attached is an example graphic of a run I just made.  The .PNG file size was 850 KB but when uploading I see it was resized ("The image was resized to fit within the maximum allowed dimensions of 600x600 pixels").  I don't know if the file will show up or not.

I uploaded a similar one as .PDF.  It also have a timestamp in the lower right corner that got added with a script I use.

- Mike ab4yy

VE7TFM
VE7TFM's picture
olsr-topology-view.pl - Improved Usability

This is interesting but the current output from the olsrd is somewhat limited.  for me node Id's whould make the picture more informative.  Is there a way to configure the olsrd output?

AB4YY
I don't know what you mean by

I don't know what you mean by "node Id's" as it does show the node names.

Anyway unfortunately, I know little about making changes to the script other than changing the supplied parameters and the descriptions for those are listed in the olsr-topology-view.pl code.  We need someone else with real programming experience and understanding to chime in...

I kike the current output but would like to NOT have the diamond boxes (and HNA lines) as that information is not of interest to me.  I haven't figured out how to get rid of them.

73 - Mike ab4yy

VE7TFM
VE7TFM's picture
olsr-topology-view.pl - Improved Usability

Node Id's,  Node Names I think are the same thing.
Is there a way to modify the olsrd output?
The current output from the olsrd with the "telnet localnode 2004"  only contains ip addresses.  
ted@X61-1 - $ telnet localnode 2004

Trying 10.67.137.145...
Connected to localnode.local.mesh.
Escape character is '^]'.
digraph topology
{
"10.132.56.153" -> "10.110.122.128"[label="3.996", style=solid];
"10.132.56.153"[shape=box];
"10.132.56.153" -> "10.88.148.222"[label="0.000", style=dashed];
"10.132.56.153" -> "10.160.74.214"[label="1.000", style=solid];
"10.132.56.153"[shape=box];
"10.132.56.153" -> "10.26.153.87"[label="0.100", style=solid];
"10.0.81.244" -> "10.160.74.82"[label="0.100"];
"10.26.73.76" -> "10.110.122.128"[label="0.100"];
"10.26.73.76" -> "10.132.56.151"[label="1.138"];
"10.26.73.76" -> "10.162.121.131"[label="0.100"];
"10.26.153.87" -> "10.132.56.153"[label="0.100"];
"10.42.58.225" -> "10.92.74.245"[label="1.000"];
"10.42.58.225" -> "10.132.56.151"[label="0.100"];
"10.42.58.225" -> "10.160.74.214"[label="0.100"];
"10.88.148.222" -> "10.142.15.160"[label="1.000"];
"10.88.148.222" -> "10.160.76.135"[label="0.100"];
"10.88.148.222" -> "10.200.15.43"[label="0.100"];
"10.92.74.245" -> "10.42.58.225"[label="1.000"];
"10.110.122.128" -> "10.26.73.76"[label="0.100"];
"10.110.122.128" -> "10.132.56.153"[label="4.181"];
-
-
-
"10.200.15.43" -> "10.128.242.176/28"[label="HNA"];
"10.128.242.176/28"[shape=diamond];
"10.132.56.153" -> "0.0.0.0/0"[label="HNA"];
"0.0.0.0/0"[shape=diamond];
"10.132.56.153" -> "10.67.137.144/28"[label="HNA"];
"10.67.137.144/28"[shape=diamond];
}
a clip from the perl script is attached.   It contains only IP addresses. 
Image Attachments: 
AB4YY
My runs show the node names. 

My runs show the node names.  See attached image.  I don't know why we are seeing a difference.  I am running my script on a Raspberry Pi on the 10.x.x.x mesh network.  - Mike


 

VE7TFM
VE7TFM's picture
What version of AREDN are you

What version of AREDN are you running?
 

VE7TFM
VE7TFM's picture
Figured it out.  In the

Figured it out.  In the command line you must have --resolve yes  it is no by default.

What does your perl command line look like?

AB4YY
I call the program by running

I call the program by running a 1-line script or just manually using the same command string as follows:

perl topo-test.pl --size 60,60 --style 1 --fontsize 7 --bgcolor SteelBlue  --fontname Verdana

A long time ago I made slight modifications of the .pl file which is why I hd renamed ot to topo-test.pl.  The main change was to have this: on or around line 12:   $TOPPATH = "./";

I think there may be another minor change but it shouldn't affect printing the node names as I tried the original "olsr-topology-view.pl" and it did the outut with the node names.  (It did however give an error ("​sh: 1: display: not found") that I don't get with the 'topo-test.pl' version.

I've uploaded the 'topo-test.pl' version but as you can see, I had to change the name to upload to this forum.

- Mike ab4yy

File Attachment: 
VE7TFM
VE7TFM's picture
You have the "resolv"

You have the "resolv" variable turned on by default.  so no need for it in the command line.  it is off by default in the distribution script.
$TOPPATH is a good one to get away from the /tmp directory.

Making headway.  Thanks for your help.

AB4YY
Resolved!

A friend of mine (Thanks Doug!)  re-hacked the script I was using and now it works only showing the ovals with the node name and none of the IPs in diamonds.  This is exactly what I was looking for.  I changed the name of the modified script to: olsr-topology-view-AREDN.pl but for uploading to this post the name got changed again.

I still run the script like this:
perl olsr-topology-view-AREDN.pl --size 60,60 --style 1 --fontsize 7 --bgcolor SteelBlue  --fontname Verdana

For me, this closes out my original posting.

73 - Mike

nc8q
nc8q's picture
mv: cannot stat './/topology.new': No such file or directory

gelmce@nc8q-mesh-server:/var/www/html/mesh $ perl olsr-topology-view-AREDN.pl --size 60,60 --style 1 --fontsize 7 --bgcolor SteelBlue  --fontname Verdana
mv: cannot stat './/topology.new': No such file or directory
mv: cannot stat './/topology.new': No such file or directory
mv: cannot stat './/topology.new': No such file or directory
connection closed
gelmce@nc8q-mesh-server:/var/www/html/mesh $
 

AB4YY
Chuck,

Chuck,

I think the problem you see may comes from line 159:
`mv $TOPPATH/$NAME.new $TOPPATH/$NAME.$EXT`;

Maybe it is a write permission problem with your "/var/www/html/mesh"?

I just downloaded the exact file I put in the post above, removed the _.txt, put it in a totally new directory under ~/Documents then ran the script exactly as you did and it worked fine.  So try the script in a directory under your home.

- Mike

 

nc8q
nc8q's picture
Hi, Mike:Thanks.

Hi, Mike:Thanks.

This is my 'main' 'AREDN' workstation.

cd ~/Downloads
mkdir topo

gelmce@nc8q-mesh:~/Downloads$ mv olsr-topology-view-AREDN.pl_.txt topo/olsr-topology-view-AREDN.pl
gelmce@nc8q-mesh:~/Downloads$ cd topo
gelmce@nc8q-mesh:~/Downloads/topo$ perl olsr-topology-view-AREDN.pl --size 60,60 --style 1 --fontsize 7 --bgcolor SteelBlue  --fontname Verdana
mv: cannot stat './/topology.new': No such file or directory
connection closed
gelmce@nc8q-mesh:~/Downloads/topo$ whoami
gelmce
gelmce@nc8q-mesh:~/Downloads/topo$ ls -ltr *
-rw-rw-r-- 1 gelmce gelmce  6937 Feb 23 07:16 olsr-topology-view-AREDN.pl
-rw-rw-r-- 1 gelmce gelmce     0 Feb 23 07:18 topology.png
-rw-rw-r-- 1 gelmce gelmce 21690 Feb 23 07:18 topology.dot
-rw-rw-r-- 1 gelmce gelmce 19131 Feb 23 07:18 input.data
gelmce@nc8q-mesh:~/Downloads/topo$


 

AB4YY
I found the problem.  Do this

I think I found the problem.  Do this install and hopefully it will work.  It resolved the issue on another system that had a similar problem.  And yes, this install is required anyway.

sudo apt-get install graphviz

- Mike

nc8q
nc8q's picture
Do this: sudo apt-get install graphviz

Hi, Mike:
Kewel! :-)
3s, Chuck

 

Image Attachments: 
KF7BWS
KF7BWS's picture
olsr-topology-view.pl - Improved Usability

What are the steps I must do to make this map work on my RasPi on the AREDN Mesh network?

Wes Larson - KF7BWS

nc8q
nc8q's picture
What are the steps I must do to make this map work on my RasPi o

"What are the steps I must do to make this map work on my RasPi on the AREDN Mesh network?"

Hi, Wes:

 Try installing perl and graphviz.
Then run the command referenced in '#10'.
My #17 is a result from my Raspberrry Pi on the local AREDN network.

Chuck
 

KF7BWS
KF7BWS's picture
olsr-topology-view.pl - Improved Usability

Chuck TNX

Ok Perl and graphviz is installed. I don't know what you mean by '#10' and '#17'.

NEVER MIND I see it now.

Where do I get olsr-topology-view-AREDN.pl the perl script?

 

nc8q
nc8q's picture
Where do I get olsr-topology-view-AREDN.pl the perl script?

File attachment in #12.

KF7BWS
KF7BWS's picture
TNX Chuck

TNX Chuck

AB4YY
For others wanting to try this:
 
These instructions should work on a Raspberry Pi or other Linux system:
 
# Install these packages if not already installed:
sudo apt-get update
sudo apt-get install perl
sudo apt-get install graphviz
 
# Make and get into a 'mesh-topo' directory (example name only):
mkdir mesh-topo
cd mesh-topo
 
# Get the script I uploaded (do this from within the created directory)
# (If wget is not installed, install it first):
 
# Change the name of the script:
mv olsr-topology-view-AREDN.pl_.txt olsr-topology-view-AREDN.pl
 
# Run it!
perl topo-test.pl --size 60,60 --style 1 --fontsize 7 --bgcolor SteelBlue  --fontname Verdana

It will create a nice 'topology.png' graphical map of your mesh network!
- Mike
nc8q
nc8q's picture
sudo apt-get install perl

sudo apt-get install perl
;-)

AB4YY
diagram without .local.mesh

My friend made a version of olsr-topology-view-AREDN.pl that creates maps without the .local.mesh in the node names and thus the result is a bit more compact and pleasant looking.  I am attaching it here.

  • Rename as:

mv olsr-topology-view-AREDN(less .local_.mesh).pl_.txt olsr-topology-view-AREDN.pl

  • Run the same way as the other version:

perl olsr-topology-view-AREDN.pl --size 60,60 --style 1 --fontsize 7 --bgcolor SteelBlue  --fontname Verdana

- Mike

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer