Info::FDP(3)

NAME
SNMP::Info::FDP - SNMP Interface to Foundry Discovery Protocol (FDP) using SNMP

AUTHOR
Bruce Rodger, Max Baker

SYNOPSIS
 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";
 }

DESCRIPTION
SNMP::Info::FDP is a subclass of SNMP::Info that provides an object oriented interface to FDP information through SNMP.

FDP is 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.

Create or use a device subclass that inherits this class. Do not use directly.

Each device implements a subset of the global and cache entries. Check the return value to see if that data is held by the device.

  Inherited Classes
None.

  Required MIBs

FOUNDRY-SN-SWITCH-GROUP-MIB
    Needs a reasonably recent MIB. Works OK with B2R07604A.mib, but doesn't work with B2R07600C.

GLOBAL METHODS
These are methods that return scalar values from SNMP

$fdp->hasFDP()
    Is FDP is active in this device?

    Accounts for SNMP version 1 devices which may have FDP but not fdp_run()

$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")

$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")

  Overrides
CDP compatibility

$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.

  Overrides
CDP compatibility

$fdp->fdp_capabilities()
    Returns Device Functional Capabilities. Results are munged into an ascii binary string, 7 digits long, 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 "martin -at- lorensen.dk" for a pointer to this information.

    ("fdpCacheCapabilities")

$fdp->fdp_domain()
    The CDP version of this returns remote VTP Management Domain as defined in "CISCO-VTP-MIB::managementDomainName"

    ("fdpCacheVTPMgmtDomain")

$fdp->fdp_duplex()
    Returns the port duplex status from remote devices.

    ("fdpCacheDuplex")

$fdp->fdp_id()
    Returns remote device id string

    ("fdpCacheDeviceId")

$fdp->fdp_if()
    Returns the mapping to the SNMP Interface Table.

    Note that a lot devices don't implement $fdp->fdp_index(), So if it isn't around, we fake it.

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

      # it exists, yay.
      my $fdp_index     = $device->fdp_index();
      return $fdp_index if defined $fdp_index;

      # if not, let's fake 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;

$fdp->fdp_index()
    Returns the mapping to the SNMP2 Interface table for FDP Cache Entries.

    Most devices don't implement this, so you probably want to use $fdp->fdp_if() instead.

    See fdp_if() entry.

    ("fdpCacheIfIndex")

$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_vlan()
    Returns the remote interface native VLAN.

    ("fdpCacheNativeVLAN")