Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Network Mapping Among Racked Suns

by cmv (Chaplain)
on Apr 14, 2009 at 18:00 UTC ( [id://757447]=perlquestion: print w/replies, xml ) Need Help??

cmv has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks-

I have a perl application that speaks to racks of Sun servers via ssh. Each server has multiple Ethernet interfaces on different logical networks. We recommend to our customers how to setup these networks, but in the end, the customers can (and do) configure the networks any way they want.

My poor little script needs to map out how the user has actually setup the network connections on these servers, so it can choose the best way to route some fire-hose data from an application it may be asked to start to a pre-defined data collection point.

Does anything exist to help me do this?

Googling on "network mapping" gets me to a quagmire of network monitoring tools that seem to be way overkill for what I want here. I'm looking for something that I could use like this:

use strict; use warnings; use netMapper; my $mapper=netMapper->new(qw(host1 host2 host3 ...)); if($mapper->badHosts) { warn "Can't contact hosts:" . $mapper->badHosts . "\n"; } foreach my $host ($mapper->Hosts) { print "$host INFO:\n", Dumper($mapper->HostInfo($host)), "\n"; } foreach my $network ($mapper->Networks) { print "$network INFO:\n", Dumper($mapper->NetInfo($network)), "\n" +; }
The data structures for host could contain "ifconfig" and "route" information like hostType, networkInterface, ipAddress, netMask, macAddr, interfaceSpeed, ..., defaultRoute, staticRoutes, ...

The data structures for network could contain things like hostList, routerList, ...

Any thoughts or suggestions are appreciated!



Replies are listed 'Best First'.
Re: Network Mapping Among Racked Suns
by samtregar (Abbot) on Apr 14, 2009 at 18:37 UTC
    I don't know of anything like this, but I don't think that's how I'd solve the problem. Is there an easier solution? Perhaps you could pick an interface by pinging the destination host (possibly using Net::Ping) and/or looking at the number of hops found by traceroute.



      Thanks for the suggestion, but that solution won't help me as much as I need. In this case, the most efficient route between servers may not be the best choice since different interfaces can be running at different speeds.

      To extend your solution a bit, I'm looking to find the largest-bandwidth pipe between endpoints balanced against the most efficient route between servers.

      Even better would be to find the largest-bandwidth pipe whose recent history shows little usage, against the most efficient route between servers.

      The reality of what I'm trying to do is to find a place to shovel some data, where it has least impact. This seems to be a difficult thing to do.



Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://757447]
Approved by zwon
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-19 13:01 GMT
Find Nodes?
    Voting Booth?

    No recent polls found