SNMP::Info::FDP(3pm)

πŸ’– SNMP::Info::FDP πŸ’–

okay bestie, welcome to the SNMP::Info::FDP page from the 3pm manual β€” it's the SNMP Interface to Foundry Discovery Protocol (FDP) using SNMP, and we're gonna get you fluent in it, fr fr πŸ¦‹

πŸ‘‘ NAME

SNMP::Info::FDP β€” SNMP Interface to Foundry Discovery Protocol (FDP) using SNMP πŸ’…


✍️ AUTHOR

Bruce Rodger, Max Baker

(yeah, two icons. respect. 🫢)


🌈 SYNOPSIS

here's the whole vibe, verbatim, no edits no cap:

 my $fdp = new SNMP::Info (
                             AutoSpecify => 1,
                             Debug       => 1,
                             DestHost    => 'router',
                             Community   => 'public',
                             Version     => 2
                           );

 my $class = $fdp->class();
 print " Using device sub class : $class\n";

 $hasfdp   = $fdp->hasFDP() ? 'yes' : 'no';

 # Print out a map of device ports with FDP neighbors:
 my $interfaces   = $fdp->interfaces();
 my $fdp_if       = $fdp->fdp_if();
 my $fdp_ip       = $fdp->fdp_ip();
 my $fdp_port     = $fdp->fdp_port();

 foreach my $fdp_key (keys %$fdp_ip){
    my $iid           = $fdp_if->{$fdp_key};
    my $port          = $interfaces->{$iid};
    my $neighbor      = $fdp_ip->{$fdp_key};
    my $neighbor_port = $fdp_port->{$fdp_key};
    print "Port : $port connected to $neighbor / $neighbor_port\n";
 }

look at that little loop go. it ate. πŸ”₯


πŸ“– DESCRIPTION

SNMP::Info::FDP is a subclass of SNMP::Info that hands you an object oriented interface to FDP information through SNMP. it's giving ✨inheritance✨.

so what even is FDP? it's a Layer 2 protocol that supplies topology information of devices that also speak FDP β€” mostly switches and routers. it has similar functionality to Cisco's CDP, and the SNMP interface is virtually identical. FDP is implemented in Brocade (Foundry) devices. no cap, that's the whole lore.

create or use a device subclass that inherits this class. Do not use directly. 🚫 like, please. i'm begging.

each device implements a subset of the global and cache entries. so check the return value to see if that data is held by the device β€” don't just assume, bestie, always vibe check your return values πŸ’€

πŸ”— Inherited Classes

None. that's it. empty. a clean slate πŸŽ€

πŸ“š Required MIBs

  • FOUNDRY-SN-SWITCH-GROUP-MIB β€” needs a reasonably recent MIB. works OK with B2R07604A.mib, but doesn't work with B2R07600C. so like. one of these is your bestie and one is your ex. choose wisely πŸ™ˆ

🌍 GLOBALS

these are methods that return scalar values from SNMP. lil single-value girlies, not tables πŸ’…

  • $fdp->hasFDP() β€” is FDP is active in this device? accounts for SNMP version 1 devices which may have FDP but not fdp_run(). (yes, that's how the original words it, and honestly? iconic.)
  • $fdp->fdp_run() β€” is FDP enabled on this device? ("fdpGlobalRun")
  • $fdp->fdp_interval() β€” interval in seconds at which FDP messages are generated. ("fdpGlobalMessageInterval")
  • $fdp->fdp_holdtime() β€” time in seconds that FDP messages are kept. ("fdpGlobalHoldTime")

πŸ¦‹ Overrides

CDP compatibility ✨ (they're twins, basically)

  • $fdp->fdp_interval() β€” interval in seconds at which FDP messages are generated. ("fdpGlobalMessageInterval")
  • $fdp->fdp_holdtime() β€” time in seconds that FDP messages are kept. ("fdpGlobalHoldTime")
  • $fdp->fdp_id() β€” returns FDP device ID. this is the device id broadcast via FDP to other devices, and is what is retrieved from remote devices with $fdp->id(). ("fdpGlobalDeviceId")
  • $fdp->fdp_run() β€” is FDP enabled on this device?

πŸ“Š TABLE METHODS

these are methods that return tables of information in the form of a reference to a hash. the big ones. main character energy πŸ‘‘

πŸ¦‹ Overrides

CDP compatibility ✨

  • $fdp->fdp_capabilities() β€” returns Device Functional Capabilities. results are munged into an ascii binary string, MSB. each digit represents a bit from the table below.

from <http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm#18843>:

(Bit) - Description

  • (0x40) β€” Provides level 1 functionality.
  • (0x20) β€” The bridge or switch does not forward IGMP Report packets on non router ports.
  • (0x10) β€” Sends and receives packets for at least one network layer protocol. If the device is routing the protocol, this bit should not be set.
  • (0x08) β€” Performs level 2 switching. The difference between this bit and bit 0x02 is that a switch does not run the Spanning-Tree Protocol. This device is assumed to be deployed in a physical loop-free topology.
  • (0x04) β€” Performs level 2 source-route bridging. A source-route bridge would set both this bit and bit 0x02.
  • (0x02) β€” Performs level 2 transparent bridging.
  • (0x01) β€” Performs level 3 routing for at least one network layer protocol.

thanks to Martin Lorensen for a pointer to this information. 🫢

("fdpCacheCapabilities")

  • $fdp->fdp_id() β€” returns remote device id string. ("fdpCacheDeviceId")
  • $fdp->fdp_if() β€” returns the mapping to the SNMP Interface Table.

in order to map the fdp table entry back to the interfaces() entry, we truncate the last number off of it :

 my $fdp_ip       = $device->fdp_ip();

 my %fdp_if
 foreach my $key (keys %$fdp_ip){
     $iid = $key;
     ## Truncate off .1 from fdp response
     $iid =~ s/\.\d+$//;
     $fdp_if{$key} = $iid;
 }

 return \%fdp_if;

(that s/\.\d+$// regex is doing the lord's work, slay πŸ’…)

  • $fdp->fdp_ip() β€” returns remote IP address. ("fdpCacheAddress")
  • $fdp->fdp_platform() β€” returns remote platform id. ("fdpCachePlatform")
  • $fdp->fdp_port() β€” returns remote port ID. ("fdpDevicePort")
  • $fdp->fdp_proto() β€” returns remote address type received. Usually IP. ("fdpCacheAddressType")
  • $fdp->fdp_ver() β€” returns remote hardware version. ("fdpCacheVersion")
  • $fdp->fdp_cache_type() β€” returns type of entry received, either FDP or CDP. ("snFdpCacheVendorId")

and that's the whole page, bestie, you absolutely ate it πŸŽ€βœ¨

this was perl v5.40.1, dated 2026-02-28, straight from SNMP::Info::FDP(3pm) β€” go forth and map some topology, you gorgeous nerd πŸ’–πŸ¦‹πŸŒŸ periodt. πŸ’…
πŸ“¦ where this page comes from