Comments on: Ping Snoop https://blog.michaelfmcnamara.com/2007/12/ping-snoop/ technology, networking, virtualization and IP telephony Sat, 30 Oct 2021 14:21:57 +0000 hourly 1 https://wordpress.org/?v=6.7.2 By: Michael McNamara https://blog.michaelfmcnamara.com/2007/12/ping-snoop/comment-page-1/#comment-60 Thu, 10 Jan 2008 16:04:00 +0000 http://maddog.mlhs.org/blog/2007/12/ping-snoop/#comment-60 It seems you dug up a really old post I made to Usenet (comp.protocols.snmp) back in 2002. I have some code that I can share with you to help you out.

I don’t think it has much bearing on Ping Snoop though so let me create a new post documenting the code.

Thanks,

]]>
By: rjansen https://blog.michaelfmcnamara.com/2007/12/ping-snoop/comment-page-1/#comment-59 Thu, 10 Jan 2008 14:15:00 +0000 http://maddog.mlhs.org/blog/2007/12/ping-snoop/#comment-59 Interesting article indeed.

kind of offtopic but maybe someone has some insight in the following related matter:

I’m developing a webapp which uses SNMP to collect data from a Passport 8006 device:

Some of the functionality does some ARP table ripping via the following formula : http://groups.google.be/groups?hl=nl&lr=&threadm=1034948890.130613%40salvator.ibr.cs.tu-bs.de&rnum=2&prev=/groups%3Fq%3DipNetToMediaIfIndex%2520port%26hl%3Dnl%26lr%3D%26sa%3DN%26tab%3Dwg

As a freebee,… here’s a snippit of PHP code based on the above:
….snip…

$perl = new Perl();
$perl->eval(‘use SNMP::Info’);
$perl->eval(‘$networkdevice = new SNMP::Info(AutoSpecify => 1,Debug => 1,DestHost => \”.$host.’\’,Community => \”.$readcommunity.’\’,Version => 2 )or die “Cant connect to DestHost.\n”;’);
$perl->eval(‘$netaddr = $networkdevice->at_netaddr();’);
$perl->eval(‘$paddr = $networkdevice->at_paddr();’);
$perl->eval(‘$at_index = $networkdevice->at_index();’);
$netaddr=$perl->eval(‘$netaddr’);
$paddr=$perl->eval(‘$paddr’);
$at_index=$perl->eval(‘$at_index’);

foreach (array_keys($netaddr) as $key => $value) {
#for Passport routers, this gets a little tricky when using VLANs
#Without VLANs the solution is simple: interface-id = cardvalue * 64 + portvalue -1
#In case of VLANs, the following information was found on
#http://groups.google.be/groups?hl=nl&lr=&threadm=1034948890.130613%40salvator.ibr.cs.tu-bs.de&rnum=2&prev=/groups%3Fq%3DipNetToMediaIfIndex%2520port%26hl%3Dnl%26lr%3D%26sa%3DN%26tab%3Dwg

#First we read the Interface IID and store this in several places for calculation
if (!array_key_exists($value, $at_index) || !array_key_exists($value, $paddr)) continue;
$othervalue=$at_index[$value];
$interfacevalue = $othervalue;
#If the result of a binary bitwise AND is different from zero, we have a VLAN
if ($othervalue & 62914560) {
#Using the found formula
$unit = ($othervalue & 62914560)/4194304;
$port = (($othervalue & 4128768)/65536) + 1;
#We calculate the interface index back..
$interfacevalue = $unit * 64 + $port – 1;
}
#If we didn’t trigger the VLAN test, check if the interfacevalue is smaller than 2000
#interface-values bigger than 2000 are VLANs that we are not interested in…

elseif ($othervalue < 2000) { $unit = intval($othervalue / 64) + 1; $port = $othervalue % 64 + 1; } …. snip…. This works fine for normal situations, but when MLT’s are used things get difficult. SO, the question is,… does anyone have an insight/hint how to extend the algorithm so that it also shows ARP table entry’s for the MLT’s.
Kind of the ping snoop problem where one would like to pinpoint where a specific MAC address is found on a specific port (which is part of a MLT link)

TIA

]]>