Question

I Have a small business network with a couple of switches, end devices but only one router. I want to display the network topology like a graph would like (with the router on top).

I'm only have access to network layer addresses, so I managed to obtain for every device on the network it's ip address and ip network i.e 192.168.2.9 and 192.168.2.0 (mask 255.255.255.0) for every interface that device has.

My guess is that I could analyze the data and build up the network's logical connections. So, What I want to ask is if I'm on the right path to know the network topology (at least for it's logical connections).

This is all done programmatically (c, and objective-c) and is for a school project.

PLUS: Does anyone know any library that would draw (given this information) the topology?

Was it helpful?

Solution

So you have every device's IP address already, a useful start. From there, a 'manual algorithm' might be:

for each ip in devices
  traceroute ip
    for each hop in traceroute
      add hop to graph (if it's not there already)

What you're doing is adding each network hop between yourself and the device to a graph structure. If a node (hop) is already found, then you add a new edge. If not, you add an edge and a vertex. The end result will be a graph of every node on the network and the paths taken to reach them - your topology.

So all you've got to do is implement traceroute yourself, build the graph structure to store the results of your traceroute runs and then make something to plot it all nicely! Each of these could generate many questions of their own.

As you've tagged this Objective-C I'll make a leap and assume you're doing this on a Mac. If that is the case, your graphics needs are met nicely with Cocoa's drawing API.

OTHER TIPS

For graphing the easiest approach might be to output a file in dot and then graph it with graphviz.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top