org.iitb.untwine
Class Layer2

java.lang.Object
  |
  +--org.iitb.untwine.Layer2
All Implemented Interfaces:
java.io.Serializable

public class Layer2
extends java.lang.Object
implements java.io.Serializable

This class is designed to discover data link layer (Layer-2) topology.

It uses spanning tree parameters and available forwarding database from link layer devices to discover the interconnection between them. It also discovers the presence of non-SNMP device at Layer-2.

It discovers the active spanning tree and does not discover the links which are not active.

See Also:
Serialized Form

Constructor Summary
Layer2()
          Default class constructor
 
Method Summary
 boolean intersectionNull(java.util.Vector fdb1, java.util.Vector fdb2)
          Checks the intersection of two FDBs.
 void L2Interconnection(java.util.Vector subnetList, java.util.Vector deviceList)
          It discovers the interconnection between the layer-2 devices.
 void L2LinkMapper(Device device1, Device device2, int index1, int index2, java.util.Vector deviceList)
          It discovers the connection, if it exists, between two devices specified as parameter.
 void L2Mapper(java.lang.String communityName)
          Discovers link layer topology.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Layer2

public Layer2()
Default class constructor
Method Detail

intersectionNull

public boolean intersectionNull(java.util.Vector fdb1,
                                java.util.Vector fdb2)
Checks the intersection of two FDBs. It checks whether the intersection of two forwarding databases specified as parameter is null.
Parameters:
fdb1 - Vector of String containing first forwarding database
fdb2 - Vector of String containing second forwarding database
Returns:
boolean true: if intersection is null set.

L2Mapper

public void L2Mapper(java.lang.String communityName)
Discovers link layer topology. Discovers the Host/Switch/Router connected to Layer-2 devices. Uses L2Interconnections for discovering the topology. After discovering topology, information is stored in file "Layer2", in the form of portList, deviceList and subnetList (in order).
Parameters:
communityName - Community name String to access MIBs.

L2Interconnection

public void L2Interconnection(java.util.Vector subnetList,
                              java.util.Vector deviceList)
It discovers the interconnection between the layer-2 devices. deviceList specified in the parameter contains the details of the port as discovered by L2Mapper. It uses L2LinkMapper to determine the interconnection between two devices.
Parameters:
subnetList - Vector containing objects of class Subnet. Each entry contains the information about the subnets discovered in network layer discovery.
deviceList - Vector containing objects of class Device.

L2LinkMapper

public void L2LinkMapper(Device device1,
                         Device device2,
                         int index1,
                         int index2,
                         java.util.Vector deviceList)
It discovers the connection, if it exists, between two devices specified as parameter. If connection exists then it try to discover whether the two devices are directly connected or connected through a non-SNMP device.
Parameters:
device1 - Object of class Device containing information about the first device.
device2 - Object of class Device containing information about the second device.
index1 - Index of device1 in deviceList.
index2 - Index of device2 in deviceList.
deviceList - Vector containing objects of class Device.