Beruflich Dokumente
Kultur Dokumente
Table Of Contents
LAYER 2 DISCOVERY AND MAPPING TUTORIAL................................................. 2
1.1 Foreword ....................................................................................................................................... 3 1.2 Introduction.................................................................................................................................... 4 1.3 Layer2 Discovery and Mapping Tutorial Tour ............................................................................... 6 1.4 Application Overview ..................................................................................................................... 8
5. FAST TRACT IMPLEMENTATION..................................................................... 34 6. CONTROL FLOW DIAGRAM .............................................................................. 35 7 DEPLOYMENT AND TESTING ............................................................................ 36
7.1 Installation Notes ......................................................................................................................... 36 7.2 Application Testing ...................................................................................................................... 38
8. KNOWN ISSUES ................................................................................................. 39 9. TROUBLE SHOOTING TIPS ............................................................................... 40 10. GLOSSARY ....................................................................................................... 41 11 APPENDIX.......................................................................................................... 43
11.1 Fundamental Concepts ............................................................................................................. 43 11.2 Layer2 Application Classes ....................................................................................................... 45
AdventNet Inc.
This tutorial guides you in designing an application to discover the layer2 devices. It is supported by a working, illustrative example.
Copyright 1996-2002 AdventNet, Inc. 5645 Gibraltar Drive Pleasanton, CA 95014 http://www.adventnet.com info@adventnet.com
AdventNet Inc.
1.1 Foreword
AdventNet Web NMS provides real world network management solutions to telecommunications and enterprise markets with a range of advanced network management features. The two important needs of the market, easy customization and faster deployment are met with the help of AdventNet Web NMS Studio. Different types of applications can be built with AdventNet Web NMS. This tutorial will serve as a simple guide to build a Layer2 Discovery and Mapping application.
AdventNet Web NMS uses the database mode. It uses MySql as the default RDBMS which stores the objects in the topology database in the form of relational tables.
AdventNet Inc.
1.2 Introduction
Here is a real time situation where you would like to build a solution for Layer2 Discovery and Mapping. Let us say you want a switch to be shown as a container with the switch in the middle and all the nodes that are connected to it. The port numbers to which the nodes are connected are to be displayed on the Links between the switch and the node.
Intended User
Do you want to build an application for Layer2 Discovery and Mapping? Then you are in the right place! This tutorial will help you build one. As stated earlier, you may extend the given application too if it can meet your specific needs.
Prerequisites
You must have Knowledge of Network Management System Knowledge of Java Programming Fair knowledge of SQL and relational database concepts (not a must !)
Related Sources
This tutorial makes constant references to AdventNet Web NMS and AdventNet Web NMS Studio. Minimal information is provided in this tutorial. If you want to know more about the product and the tools, refer to the Web sites given below: For AdventNet Web NMS Studio Documentation, visit <Web NMS Home>/StudioTools/Studio/help/index.html For AdventNet Web NMS Documentation, visit http://www.adventnet.com/products/webnms/help.html
AdventNet Inc.
Printed Version
To print this tutorial Ensure that Adobe Acrobat Reader is installed in your system Download the PDF version of this document from the following URL http://www.adventnet.com/products/webnms/layer2_tutorial.pdf
Tutorial Conventions
The typographic conventions followed in this tutorial are
Font Style
Arial Bold Arial Italic Arial Bold Italic Courier New Courier New Bold Italic
Uses
Filename Directory Methods / Interfaces / Classes Code snippet Highlighting important code snippets
AdventNet <Web NMS Home> refers to the directory where Web NMS is installed.
AdventNet Inc.
Stage 1
A ready built Application is provided in this stage. You can deploy this application in AdventNet Web NMS and see what it is all about. It gives you an experience of traversing through the application that you will eventually build. Try It Yourself - The steps given in this topic helps you deploy and experience the Application. Application Design - This topic gives you an overview on the Application Design. It explains the purpose of the Application and the different stages involved in building it.
Stage 2
This stage guides you in building the Application yourself using AdventNet Web NMS Studio. The topics in the Detailed Implementation section helps you understand and build the Application. Creating a Project - This topic describes the steps to create a Project using the Studio. A project work-space is created. You can proceed to the next stages of building the Application once the project is created. Discovering Devices - This topic guides you in creating a Discovery Filter to discover Switches with the SNMP Devices connected to it. Mapping Devices - This section helps you in creating a Map Filter and represent the discovered Switches on a Map. Status Polling - This topic helps you create a Status Poller. The important methods in the corresponding class file are explained in depth. Packaging - This is the final stage. Once
AdventNet Inc.
Stage 3
In this tier, you are guided to work with the bundled project If you are unable to proceed with building the Application yourself. The topic Fast Track Implementation, helps you do this. Have an AdventNet Experience! Following flow line diagram has image mapping to the respective topics :
AdventNet Inc.
Application Specification Description of System Used in the Application Description of the Application Functioning of the Application Implementation in a Nutshell Modules Covered
Application Specification
Name of the Application Version of Web NMS Compatibility with other Versions Tools used and their Versions Platform-specific requirements : : : : : Layer2 Discovery and Mapping Application Web NMS Release 4.7.0 Not compatible with previous versions of Web NMS AdventNet Web NMS Studio No special requirements
The application displays a Switches Map that appears as soon as a switch is discovered by the discovery module. A separate switches map appears for each of the network discovered. This separate switches map is required to avoid the clustering of the switches of various networks and to improve visual representation. The Switches Maps are named as <network IP>.switches for each discovered network. A Switch is shown as a container (A square with a cloud image inside) with the switch in the middle and all the directly connected nodes around it. The port numbers to which the node is connected is displayed on the link between them. The Spanning Tree Protocol Link between the switches is also mapped.
AdventNet Inc.
Note: This Tutorial Application is only an example and not a full-fledged scalable feature. However, this example can be extended for your specific needs.
Implementation in a Nutshell
The tutorial application is designed using AdventNet Web NMS Studio Tool that is bundled with AdventNet Web NMS. The Project created using Studio is compiled and packaged into a NAR file (with a .nar extension). This NAR is installed in AdventNet Web NMS using the Deployment Wizard. Optimum use of the Studio Tool is made in this application. It also contains some custom code, tailored to suit some specific needs of the application. Files specific to the tutorial application are added as other files in the Studio (Look into the corresponding Studio documentation for more details). The Project is also bundled with the tutorial. If you wish to try using the Project, make the required changes, compile, and package it. Uninstall the existing NAR and install the new NAR created. Warning: Uninstalling the original NAR is mandatory as only one Studio NAR is permitted to be deployed in AdventNet Web NMS. This application implements the Spanning Tree Protocol.
Modules Covered
Discovery Module : Uses the switch discovery filter class after the discovery process to identify the switches. Topology Module : Uses TopoAPI and MapAPI to add objects into the database. Protocol Module Map Module : Uses SNMP Calls to the devices for Device-specific information. : Uses the SwitchMapFilter, SwitchContainerLayout to layout the components into the map.
AdventNet Inc.
2. Try It Yourself
You would surely like to deploy the tutorial application and run it. Try the following simple steps and see it yourself!
AdventNet Inc.
10
Click on a switch map node to see the enlarged switch with the nodes connected to it and their corresponding link and port numbers. See the reference snapshot.
AdventNet Inc.
11
AdventNet Inc.
12
The status of the discovered container is clear at startup (green color). The status of the switch gets updated during the subsequent status pollings. The Nodes in the switch container displays labels when zoomed. The labels disappear when the size is restored. Right-click the switch and select 'Status' option to see the Switch status. Reference snapshot is provided below. The port-wise details of each switch can also be seen. Each port status can be identified by the color of the port and these ports are connected based on their ifSpeed. Click on each port to see the port details displayed on the status panel on the top. Switch and Port Status
AdventNet Inc.
13
Note: This is only an example and not a full-fledged scalable feature. However, this application can be extended for your specific needs.
AdventNet Inc.
14
3. Application Design
Aim
Depict the switches as Containers. The SNMP Nodes connected to the switch are to be shown inside the Container along with the port numbers on their links. The status of the discovered switches and the nodes connected to it must be updated. The Switches and the nodes must be represented on a Map. The Map must also show the switch-to-switch spanning tree protocol link. The application limits itself to the switches and the SNMP Nodes discovered. Other objects in the network are not managed by this application. The discovered switches and nodes are updated periodically by status polling.
Requirements
Create Discovery Filter to discover Switches in a network along with the nodes Create and Configure Map Filter Create Custom Map to show Switches Update Switch and Port Status by status polling
Requirement
Create Discovery Filter
Details
Enables you to discover Switches in a Network along with the SNMP Nodes that are connected to the Switches directly. Enables you to specify the filter criteria. Some custom code has gone into map filter to change the symbol automatically generated for each trunk to a link on the map. Custom Maps are created to show custom maps other than the default maps
Tasks
Create a Simple Discovery Filter Specify the filtering criteria for the Filter Create the Map filter named SwitchMapFilte r. Customize the Map filter. Configure the Map filter by editing mapIcon.data file. Create Custom Map by extending MapApplet. Configure the created Custom Map by editingNmsPa nel.conf file. Create the Switch Map Link Renderer class to
Role of Studio
Discovery Wizard is used
AdventNet Inc.
15
Requirement
Details
Tasks
support the Custom Map. Create the switchLink.prop erties file to configure the properties of Switch Map Link Renderer class. Create the Status Poller named SwitchStatusP oller. Customize the Status Poller. Create other classes used in the Status Poller class for making various SNMP calls to the switch's Bridge MIB.
Role of Studio
Enables you to update the status of the Switches and the Ports by status polling. Some custom code is involved to suit the Application requirements.
AdventNet Inc.
16
4. Detailed Implementation
The Studio Implementation of the Layer 2 Discovery and Mapping application is explained in this section. Unlike most other tutorial applications, this application places emphasis mainly on the Map Module, and Discovery Module of AdventNet Web NMS. The application uses the existing Managed Object model for the devices and does not dwell into details of modeling an object, re-branding the application etc. The application implementation is explained in a few stages. The implementation stages are:
Creating a Layer2 Project Creating and Configuring Discovery Filter Creating and Configuring Custom Maps Creating and Configuring Map Filter Status Polling for Layer2 Devices
AdventNet Inc.
17
Step 3: Select Device Details. Provide the following device details. Protocol Device Type Device OID Poll Interval SNMP Switch .1 300 seconds
Provide MIB details by adding the required MIB (BRIDGE-MIB) using browse button.
Step 4: Select Web NMS Service Details. Select only required services for the Application (all services are selected by default). Discovery Map Security Rebranding Server_Configuration
Step 5 : Select Databases Select only the required databases for the Application (all databases are selected by default). MySQL Oracle Click Next to proceed.
AdventNet Inc.
18
Step 6 : Provide User Details Select Single User to give 'Admin' permission to a user for all Services and click Next.
Step 7 : Complete the Project. Verify if all the details furnished in the above steps are correctly displayed in the 'Project Summary' screen that follows: Click Finish.
The Project Workspace is created once you click Finish. The Resource Factory Wizard starts next. This application does not require the help of this wizard. So, click Cancel. The next topic will help you create and configure a discovery filter.
AdventNet Inc.
19
4.2 Discovery
4.2.1 Creating Discovery Filter Aim
Creating a Discovery Filter to discover Layer2 devices. The Discovery Filter wizard of the Studio takes care of package structure, variable declaration, filtering criteria, list of managed objects, their instances, property form, and return value of the discovery filter class. The discovery filter will eliminate objects that are not managed and the objects that are non-SNMP. Refer AdventNet Web NMS Studio documentation to know more about creating a Discovery Filter.
Step 2: Enter the following Filter Details and click Next to proceed. class name of the Discovery Filter - SwitchDiscFilter
Step 3 : In the Variable Declaration screen, click Next to proceed. Step 4 : Enter the following criteria in Criteria Table using the Add button. The specified criteria will eliminate objects that are not managed, or if the managed object is not a TopoObject or a non-SNMP object. Note: To add Criteria2, Criteria3 etc., select and right-click on the Criteria node in the tree. From the popup menu, choose, Add Node option.
Step 5: Click Next till you get to the Source Preview screen. Click Finish. This file will be available as a sub-node under DISCOVERY FILTER in the Studio tree. When you select this file, it opens in JMACS editor. You can make any required changes to the file and compile it.
AdventNet Inc.
20
SwitchDiscFilter Class
The SwitchDiscFilter class implements FoundFilter() method (com.adventnet.nms.topodb.FoundFilter). This Discovery Filter identifies a switch element from other elements and sets in UserTest class name. It queries the object's SNMP Agent for its number of ports. If the managed object has a hardware port and implements the Spanning Tree Protocol, set the UserTest class to this ManagedObject. synchronized(target) //Since SnmpTarget is not thread safe. { //Query object for the number of ports. target.setTargetHost(((TopoObject)managedObject).getName()); target.setSnmpOID(new SnmpOID("17.1.2.0")); String numPorts = target.snmpGet(); if (numPorts != null) //Object has a hardware port. { { managedObject.setTester("usertest"); managedObject.setType("Switch"); managedObject.setUClass("com.adventnet.nms.tutorials. layer2.DummyStatusPoller"); managedObject.setStatusPollEnabled(true); managedObject.setPollInterval(300); target.setObjectID(".1.3.6.1.2.1.17.1.1.0"); String nodeMac = target.snmpGet(); String nodeIp = ((SnmpNode)managedObject).getIpAddress(); System.out.println(" nodeMac -- >"+nodeMac + " node Ip -->"+nodeIp); managedObject.setUserProperty("macAdd",nodeMac); // WARNING: This property should not be updated externally. managedObject.setUserProperty("isFDBTablePopulated", "false"); MacVsIPdisc.macVsIp.put(nodeMac,nodeIp); } } }
AdventNet Inc.
21
4.3 Mapping
4.3.1 Creating Map Filter Aim
Create and configure a Map Filter for Layer2 devices in a network. Refer AdventNet Web NMS Studio documentation to know more about creating a Map Filter.
Step 3: Skip the Variable Declaration details. Click Next in this screen Step 4: Enter the following criteria in the Criteria Table using Add button Criteria1 Criteria2 (managedObject.getUClass() != null & managedObject.getUClass().equals("com.adventnet.nms.tutorials.layer2.DummyStatusPoller")) (mapSymbols != null)
Step 5: Click Next till you get to Source Preview screen. Click Finish. You can see this file as a subnode under MAP FILTER in the Studio tree. When you click this file, it opens in the right panel in JMACS editor. The required changes can be made here.
SwitchMapFilter Class
The SwitchMapFilter class implements com.adventnet.nms.mapdb.MapFilter. In this class, the UserTest class is checked and the test() method of the DummyStatusPoller class is invoked which in turn uses a static instance of the SwitchStatusPoller class to add the corresponding map containers and map symbols to the Map.
AdventNet Inc.
22
//Create the switch map with the switches, all their //connected nodes, and links; and the link to root switch //for the first time. try { TopoAPI tapi = (TopoAPI) NmsUtil.getAPI("TopoAPI"); DummyStatusPoller dummyStatusPoller = new DummyStatusPoller(); int not_used = dummyStatusPoller.test(managedObject, tapi); } catch (Exception e) { NmsLogMgr.MISCUSER.log("SwitchMapFilter :" + managedObject.getName() + ":",Log.SUMMARY); NmsLogMgr.MISCERR.log("Error running \"DummyStatusPoller\"" + " from the map filter : \"SwitchMapFilter\"" + " : " + e.getMessage(),Log.SUMMARY); NmsLogMgr.MISCERR.fail("Trace " ,e); }
AdventNet Inc.
23
Customize Custom Maps Configure the Custom Map Render Map Symbols Create other relevant classes Configure Map Link Properties
AdventNet Inc.
24
Step 3: Extend the MapApplet class and add Custom Components to the Map Panel by o o Writing a class extending MapApplet class from the com.adventnet.nms.mapui package. Overriding the constructUI(EditableMap emap) method in the extended class.
The example code for the constructUI() method below illustrates this. public void constructUI(EditableMap emap) { splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); if (currentMapViewed.endsWith("Switch.netmap")) { setLayout (new BorderLayout()); splitPane.setOneTouchExpandable(true); splitPane.setTopComponent(emap); tabPane.add("Properties",buildPropertiesPanel (getProperties(),mapPropsToShow)); altPanel = new AlertPanel(); tabPane.add("Alarms",altPanel); splitPane.setBottomComponent(tabPane); add("Center",splitPane); } else { super.constructUI(emap); } } The currentMapViewed.endsWith("switches.netmap") check is made to make this feature available only to maps ending with switches.netmap i.e., to Network switches map. The EditableMap emap is the Map added to the map panel. Custom components can be added to the map panel containing the EditableMap, before the panel gets added..
AdventNet Inc.
25
<MAP_ICON_DATA> <OBJTYPES background="0" node="1" network="2" gateway="3" sub-symbol="4" site="5" switch_container="10"/> ..... </MAP_ICON_DATA>
Class Name
SwitchContainerLayout SwitchMapSymbolRendererImpl SwitchMapLinkRendererImpl
Purpose
Laying out the switches on the map Rendering map symbols on the map Rendering links on the map (extends com.adventnet.nms.mapui.MapLinkRendererImpl class)
You can take a look at the above classes located in the following path: <Web NMS Home>/StudioTools/Studio/projects/Layer2_Tutorial/otherfiles directory The paintLabelString() and paintMapLink() methods are overridden to draw the map link. Following is the code snippet: public void paintMapLink(Graphics g, MapLinkComponent mapLink, Point sourcePoint, Point destPoint, Color bg, boolean selected) { String color = null; int rd=0; int gr=0; int bl=0; color=mapLink.getUserProperty("linkColor"); if(color != null) { StringTokenizer stok = new StringTokenizer(color,","); rd=Integer.parseInt(stok.nextToken()); gr=Integer.parseInt(stok.nextToken()); bl=Integer.parseInt(stok.nextToken());
AdventNet Inc.
26
Link colors are specified in RGB format against the Link speed.
The code given above illustrates how the map link properties are set using the entries in the switchLink.properties file.
AdventNet Inc.
27
See the attached snapshots to see Properties Panel and Alarm Panel invoked: Properties Panel
AdventNet Inc.
28
Alarm Panel
AdventNet Inc.
29
Overview
The Status Poller created in this application is SwitchStatusPoller. It is a user-test class used by the Status Poller for Web NMS Switches. This class is invoked using DummyStatusPoller class by SwitchMapFilter class. Only one instance of this class is used for all the Switches. Addition of Switch Map Containers and Switch symbols to the Containers are done in this class.
Click OK. Now, SwitchStatusPoller.java is appended to the list of Other Files in the Studio tree. The file is open in the right panel in a JMACS editor. You can edit the file straightaway, save the changes, and compile it.
SwitchStatusPoller Class
The following table shows the main Vectors and the details that are stored here:
Vector
switchVect macAddVect mapsVector mapThisStart
Details
Unique name / key of all the discovered switches Machine addresses of all the SNMP Nodes Maps added to the database Differentiates cold-start from warm-start
The test() method is invoked for every switch discovered during the status polling. public int test(ManagedObject obj, TopoAPI tapi) { //Construct the map name and the map label String objName = ((Node)obj).getName(); //Get the unique name/key*/ String switchMapName = objName; String switchMapKey = objName + ".netmap"; //Get the handle of MapAPI MapAPI mapi = (MapAPI) NmsUtil.getAPI("MapAPI"); //Create & add the map into the system if it isn't already
AdventNet Inc.
30
done(*.switches.netmap) try { if(!mapi.doesTheMapExist(parentSwitchMap+".netmap")) { addParentSwitchMap(mapi); } if(!mapi.doesTheMapExist(switchMapKey)) { addSwitchMap(mapi, switchMapName, parentSwitchMap);//adds map for each switch. } } catch(Exception e) { e.printStackTrace(); } //Check and add switch map container(dummy and ori switch) and map symbol. addSwitchToMap(obj, parentSwitchMap, mapi) ; addSwitchToMap(obj, switchMapName, mapi); nodeProcess(obj, parentSwitchMap, tapi, mapi, switchMapName); return obj.getStatus(); } The test() method performs the following Creates a Parent Switch Map in which all discovered switches are displayed. Creates the Individual Switch map for each switch discovered with the switch name as the map name. Creates a switch symbol for a switch in both the Parent Switch map and the individual switch map. Maps the switches and the Snmp Nodes that are directly connected to it. Maps the Spanning Tree Link between the switches.
You can access the source file from the location: <Web NMS Home>/tutorials/layer2_tutorial/otherfiles directory.
Server Java Classes for Making Various SNMP Calls to the Switch's Bridge MIB Class Name
ConnectedNodes
Details
Used to fetch machine addresses of the nodes the corresponding switch ports the machine address of uplinked switches and nodes using the OIDs dot1dTpFdbAddress(1.3.6.1.2.1.17.4.3.1.1) and dot1dTpFdbPort(1.3.6.1.2.1.17.4.3.1.2) implemented by the Bridge MIB.
BaseBridgeAddress Used to fetch the Base Bridge Address for a given switch using the OID 1 3 6 1 2 1 17 1 1 0
AdventNet Inc.
31
Class Name
Details
and assigns it to an instance variable baseBridgeAddres.
SptRootBridge
Used to fetch the following from the Bridge MIB for the given switch element: dot1dStpDesignatedRoot dot1dStpRootPort dot1dStpPortDesignatedBridge (from the dot1dStpPortTable)
Refer to the SwitchStatusPoller Class file available in <Project-Home>/otherfiles directory. For more details on working with Other Files , refer AdventNet Web NMS Studio documentation. Studio > Working with Studio > Working with Files
AdventNet Inc.
32
AdventNet Inc.
33
AdventNet Inc.
34
AdventNet Inc.
35
AdventNet Inc.
36
Click the Uninstall button in the screen. The NmsPwsNarUninstaller screen will pop-up. Here, click the Uninstall button. This will uninstall and show the status in the progress bar. See that the progress is 100%. Click the Close button. You will see Uninstalled Successfully pop-up message with an OK button. Click the OK button. Now the uninstallation is complete. Click the Exit button to quit the Deployment Wizard. Note: To install the NAR for the Application that you have created, you must select Layer2_User1.0.nar.
AdventNet Inc.
37
Caution: Uninstalling the original NAR is mandatory as only one Studio NAR is permitted to be deployed in AdventNet Web NMS. For complete details of Working with AdventNet Web NMS Studio, refer the AdventNet Web NMS Studio documentation. The conf files that change when this application is installed are : clientparameters.conf discovery.filters map.filters mapIcon.data NmsPanels.conf NmsProcessesBE.conf
AdventNet Inc.
38
8. Known Issues
The Switch Container maps only the SNMP Nodes connected to the Switch directly. All the Non-SNMP Nodes are not mapped. Only the Spanning Tree Link between the Switches are shown in the map. The switches may be connected through other links as well. Thus only a part of the switch to switch link topology is mapped. Every node is mapped to only one switch. But occasionally there can be a node having two or more interfaces connected to different switches. In such a case the node is mapped to any one of the switches. But in such a case an error indicating the connection to the other switch(es) is logged in the stderr.txt file. When this application is installed, it replaces the discovery and map filters with the new conf files. Therefore, any user defined filters installed does not take effect. When the application is un-installed, the conf files are restored. Caution: You need to configure the Spanning Tree data on the Switch's SNMP Agent.
AdventNet Inc.
39
Solution
Check if the network has network switches or if the network has some devices that has more than 1 hardware port and is capable of forwarding. It must implement the Spanning Tree Protocol.
There are no nodes mapped inside Check if the network in which the application is running the switch container. has SNMP Nodes. The switch container does not display the cloud image inside. ClassNotFoundException is raised in the client log window Check for the cloud.png image in <Web NMS Home>/images directory. Check if the SwitchContainerLayout.class file is present in the Layer2_Tutorial.jar file under the <Web NMS Home>/NetMonitor/Build directory. Check if the SwitchMapLinkRendererImpl and SwitchMapSymbolRendererImpl classes are present in the Layer2_Tutorial.jar file under the <Web NMS Home>/NetMonitor/Build directory. Check whether the ENABLE_SP_FOR_IFC_PARENTS parameter is set to 'true' in the NmsProcessesBE.conf file under the ../projects/<Web NMS Home>/conf directory. If this parameter is set to 'false' (by default) then the status polling for the nodes does not take place.
The switches are not laid out properly. After the initial display of the map, the number of nodes that get mapped to the switch container does not increase in the subsequent status polling.
AdventNet Inc.
40
10. Glossary
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Bridge Designated Switch MAC Address OSI Root Switch SNMP Switch Map Brouter Designated Port MAC Layer Root Port SNMP Node STP Router Switch
Bridge A bridge is a device that connects one local area network (LAN) to another local area network that uses the same protocol (for example, Ethernet or token ring). A bridge usually offers only one path to a given interconnected LAN. A router connects a network to one or more other networks that are usually part of a wide area network (WAN) and may offer a number of paths to destinations on those networks. Brouter A brouter (pronounced as BRAU-tuhr or sometimes BEE-rau-tuhr) is a network bridge and a router combined in a single product. Designated Switch A designated switch is elected by the smallest Root Path Cost in each network segment. Designated Port The ports that connect to switches further away from the Root Switch than the switch. The Root Switch only has Designated Ports. MAC Address Media Access Control address, a hardware address that uniquely identifies each node of a network. MAC Layer The Media Access Control Layer is one of two sub-layers that make up the Data Link Layer of the OSI model. Root Switch A root switch is elected by the smallest Switch ID in the entire switched network. Only one root switch can exist among the entire switched network. Root Port The port that is closest to the root switch. The root port is selected from each switch within the network. Only one port on each switch is assigned as the Root Port.
AdventNet Inc.
41
Router A Router is a device connected to at least two networks and decides which way to send each information packet based on its current understanding of the state of the networks it is connected to. A router is located at any gateway (where one network meets another), including each Internet point-ofpresence. A router is often included as part of a network switch. SNMP SNMP is abbreviation of Simple Network Management Protocol, a set of protocols for managing complex networks. The first versions of SNMP were developed in the early 80s. SNMP works by sending messages, called protocol data units (PDUs), to different parts of a network. SNMP-compliant devices, called agents, store data about themselves in Management Information Bases (MIBs) and return this data to the SNMP requesters. SNMP Node A Device that runs the SNMPAgent. Switch In networks, a Switch is a device that filters and forwards packets between LAN segments. Switches operate at the data link layer (Layer 2) of the OSI Reference Model and therefore support any packet protocol. LANs that use switches to join segments are called switched LANs or in the case of Ethernet networks, switched Ethernet LANs. Switches Map The map that displays all the switches for a particular network with the Spanning Tree Links between them. This map is created separately for each new network discovered and is placed below the tree node for that network. STP It is a bridge-based mechanism for providing fault tolerance on networks. It is used by bridges (or switches) to remove redundant links from networks. The switch sends configuration BDPUs to communicate and compute the Spanning Tree Topology.
AdventNet Inc.
42
11 Appendix
11.1 Fundamental Concepts
This section explains the following concepts that help you understand this tutorial better.
Familiarity with the above concepts will provide clear visibility into the nature of application being built.
Following is one of the several mnemonics devised to help remember this model (top to bottom approach):
MAC Layer
o o o Controls how a computer on the network gains access to the data and permission to transmit it Responsible to move data packets from a Network Interface Card to another or vice versa across a shared channel. Uses MAC protocols to ensure that signals sent from different stations across the same channel don't collide.
MAC Address: Hardware address that uniquely identifies each node in a network
LLC Layer
o Controls frame synchronization, flow control and error checking
AdventNet Inc.
43
The path cost factor is used to calculate the distance from each port of a switch to the Root Switch. Each switch is identified by a switch ID and each switch port (interface) on a switch is identified by a Port ID. Ports can either be disabled or enabled. Ports that are enabled can be in one of the following states: Listening The switches send BPDU messages to one another to establish the network topology and the optimal paths to the different segments of the network. Other data is not transmitted. The switch enters the Blocking State if a path with higher priority is found to exist during the Listening State. Normal data is not transmitted. The switch enters the Learning State if no path with a higher priority is found during the Listening State. Learned entries are entered in the Unicast Destination Forwarding Table. Normal data is not transmitted.
Blocking Learning
Forwarding The switch enters the Forwarding State after having been in the Learning State for a predefined forward delay time period. Normal data is transmitted.
AdventNet Inc.
44
Package Name:
Class Name
com.adventnet.nms.tutorials.layer2
Details Server Java files
Status polling classes Classes for making various SNMP calls to the switch's Bridge MIB Classes to derive all connections between the switch and the devices. Class to store MAC Address vs IP Address mapping Client Java files
Extended Map Applet class for adding custom components to the Map Panel Map layout class for laying out the switches on the map Classes for rendering the map symbols and map links on the map Classes for rendering the map symbols and map links on the map Class for showing the Alarms and the Alarm Navigation Panel
AdventNet Inc.
45
This tutorial builds an EMS with the information got from an XML enabled device. From the responses received the EMS chassis is built and some other functions are included.
AdventNet Inc.
47