Revised Spring 2 Revised Spring 2 006 006 Rudimentary NMS Softwar Rudimentary NMS Softwar e Components e Components 1 Rudimentary NMS Software Rudimentary NMS Software Components Components (Chapter 7) (Chapter 7) Network Management, MIBs, Network Management, MIBs, and MPLS and MPLS Stephen B. Morris Stephen B. Morris
35
Embed
Revised Spring 2006 Rudimentary NMS Software Components 1 Rudimentary NMS Software Components (Chapter 7) Network Management, MIBs, and MPLS Stephen B.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
Network Management, MIBs, Network Management, MIBs, and MPLSand MPLS
Stephen B. MorrisStephen B. Morris
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
22
OverviewOverview
How to build and use Simple Network How to build and use Simple Network Management Protocol (SNMP) code Management Protocol (SNMP) code componentscomponents
Two commercial Application Two commercial Application Programming Interfaces (APIs)Programming Interfaces (APIs) Microsoft Visual C++ version 6.0Microsoft Visual C++ version 6.0 Sun Microsystems Java Development Sun Microsystems Java Development
Management Kit (JDMK) version 4.2Management Kit (JDMK) version 4.2
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
33
Building a Rudimentary Building a Rudimentary Management SystemManagement System
Minimum Required ComponentsMinimum Required Components SNMP managerSNMP manager Management Information Bases (MIBs)Management Information Bases (MIBs) DatabaseDatabase SNMP agentsSNMP agents
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
Windows NTWindows NT If the SNMP Service is already installed:If the SNMP Service is already installed:
Click Click Start-Settings-Control PanelStart-Settings-Control Panel Select Select ServicesServices and scroll down to the and scroll down to the SNMP SNMP ServiceService
If the SNMP Service is not installed:If the SNMP Service is not installed: Double click the Double click the Control PanelControl Panel icon and icon and
select the select the ServicesServices tab tab Click the Click the AddAdd button and the scroll down to button and the scroll down to
the the SNMP ServiceSNMP Service and then click and then click OKOK
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
55
Configuring SNMP onConfiguring SNMP onWindows NT/2000/XP Windows NT/2000/XP
(continued)(continued) Windows 2000/XPWindows 2000/XP
If the SNMP Service is already installed:If the SNMP Service is already installed: Double click the Double click the Control Panel Administrative Tools Control Panel Administrative Tools
icon and select the icon and select the ServicesServices tab tab Right click on the Right click on the SNMP ServiceSNMP Service and select the and select the PropertiesProperties
optionoption If the SNMP Service is not installed:If the SNMP Service is not installed:
Double click the Double click the Control PanelControl Panel icon and select the icon and select the Add Add Remove ProgramsRemove Programs tab tab
Click the Click the AddAdd /Remove Windows Components/Remove Windows Components button and the button and the scroll down to the scroll down to the Management and Monitoring ToolsManagement and Monitoring Tools and and then click then click DetailsDetails
Check the box next to Check the box next to Simple Network Management Simple Network Management Protocol Protocol and clickand click OK OK
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
66
Setup Required for theSetup Required for theVisual C++ ProgramVisual C++ Program
Supplied software was tested in the Supplied software was tested in the following environments following environments Windows NT Workstation Version 4.00 Windows NT Workstation Version 4.00
Build 1381 Service Pack 6aBuild 1381 Service Pack 6a Windows 2000 Version 5.0.2195 Service Windows 2000 Version 5.0.2195 Service
Pack 2 Build 2195Pack 2 Build 2195
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
77
Building the SampleBuilding the SampleVisual C++ SNMP ManagerVisual C++ SNMP Manager
Get.batGet.bat – Executes single SNMP – Executes single SNMP GETGET
Set.batSet.bat – Executes single SNMP – Executes single SNMP SETSET
Walk.batWalk.bat – Walks a specified – Walks a specified agent MIB tableagent MIB table
Gettraps.bat Gettraps.bat – Prepares – Prepares program for receiving trapsprogram for receiving traps
Getnext.batGetnext.bat – Executes single – Executes single SNMP SNMP getNextgetNext
snmpdefs.hsnmpdefs.h – Header file – Header file snmpmgr.csnmpmgr.c – C code – C code snmpmgr.exesnmpmgr.exe – Executable – Executable
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
88
Building the SampleBuilding the SampleVisual C++ SNMP ManagerVisual C++ SNMP Manager
The Source Code ComponentsThe Source Code Components snmpdefs.hsnmpdefs.h and and snmpmgr.csnmpmgr.c provide provide
the codebasethe codebase snmpdefs.hsnmpdefs.h is comprised of three is comprised of three
main sectionsmain sections Symbolic constants for SNMP operationsSymbolic constants for SNMP operations Global variablesGlobal variables Available function callsAvailable function calls
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
99
Building the SampleBuilding the SampleVisual C++ SNMP ManagerVisual C++ SNMP ManagerStructure of the Sample ProgramStructure of the Sample Program
Supports the following operationsSupports the following operations GETGET GETNEXTGETNEXT SETSET WALKWALK TRAPTRAP
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1010
Using theUsing theRudimentary Management Rudimentary Management
SystemSystemBasic ArchitectureBasic Architecture
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1111
Using theUsing theRudimentary Management Rudimentary Management
SystemSystemAn SNMP An SNMP GETGET
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1212
Using theUsing theRudimentary Management Rudimentary Management
SystemSystemAn SNMP An SNMP GETNEXTGETNEXT
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1313
Using theUsing theRudimentary Management Rudimentary Management
SystemSystemAn SNMP An SNMP SETSET
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1414
Using theUsing theRudimentary Management Rudimentary Management
SystemSystem An SNMP An SNMP TRAPTRAP
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1515
Using theUsing theRudimentary Management Rudimentary Management
SystemSystem Combining the Batch FilesCombining the Batch Files These batch files can be chained These batch files can be chained
togethertogether For example, a For example, a SETSET followed by a followed by a GETGET
A real NMS uses this type of logic to A real NMS uses this type of logic to create rich sets of functionscreate rich sets of functions
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1616
Using theUsing theRudimentary Management Rudimentary Management
SystemSystem A Security ViolationA Security Violation Security is increasingly important in Security is increasingly important in
network managementnetwork management Two actions a remote agent should Two actions a remote agent should
take upon receiving an incorrect take upon receiving an incorrect community stringcommunity string Discard the message so that no reply Discard the message so that no reply
occursoccurs Emit an Emit an authenticationFailure(4)authenticationFailure(4) trap trap
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1717
Using theUsing theRudimentary Management Rudimentary Management
SystemSystem Security Failure and Associated Security Failure and Associated
ActionsActions
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1818
Using theUsing theRudimentary Management Rudimentary Management
SystemSystem Security Violations and RetriesSecurity Violations and Retries
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
1919
A Note On SecurityA Note On Security
Types of network attacksTypes of network attacks HackingHacking Denial of ServiceDenial of Service Message interceptionMessage interception Message modificationMessage modification Message replayMessage replay
Protection must be provided at all Protection must be provided at all levelslevels
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2020
The Sample JDMKThe Sample JDMKJava SNMP ManagerJava SNMP Manager
Evaluation copies of JDMK toolkit can Evaluation copies of JDMK toolkit can be downloaded from Sun be downloaded from Sun MicrosystemsMicrosystems
The code used for this example The code used for this example implements the following SNMP implements the following SNMP requestsrequests GetRequestGetRequest GetNextGetNext
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2121
The Sample JDMKThe Sample JDMKJava SNMP ManagerJava SNMP Manager
Installing JDMKInstalling JDMK Install the Java Development Kit Install the Java Development Kit
(JDK). (JDK). Text example used Java 2 SDK Standard Text example used Java 2 SDK Standard Edition v1.3.1_02Edition v1.3.1_02
Install JDMK. Install JDMK. Text example used JDMK 4.2 for Text example used JDMK 4.2 for JDK 1.1.8 and for Java 2 PlatformJDK 1.1.8 and for Java 2 Platform Run Run Setup.batSetup.bat
Extracts JDMK class filesExtracts JDMK class files jdmk42_nt-12.classjdmk42_nt-12.class jdmk42_nt_11.classjdmk42_nt_11.class
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2222
The Sample JDMKThe Sample JDMKJava SNMP ManagerJava SNMP Manager
Installing JDMK (continued)Installing JDMK (continued) Set environment variables. Set environment variables. Text examples Text examples
Ensure SNMP agent has two configured Ensure SNMP agent has two configured community stringscommunity strings publicpublic (read-only) (read-only) privateprivate (read-write) (read-write)
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2323
Building the SampleBuilding the SampleJava ManagerJava Manager
mib_II.txtmib_II.txt – Contains – Contains the definition of the the definition of the MIB II standard objectsMIB II standard objects
SynchronousManager.SynchronousManager.javajava – Contains the – Contains the Java class that sends Java class that sends either and SNMP GET either and SNMP GET or getNext messageor getNext message
Get.batGet.bat – Executes – Executes single SNMP single SNMP GETGET
GetNext.batGetNext.bat – – Executes single SNMP Executes single SNMP getNextgetNext
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2424
Building the SampleBuilding the SampleJava ManagerJava Manager
To Build the Java ProgramTo Build the Java Program Two commands are requiredTwo commands are required
mibgen –mo –d . mib_II.txtmibgen –mo –d . mib_II.txt This builds a file called This builds a file called
Creates the bytecode file Creates the bytecode file SynchronousManager.classSynchronousManager.class
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2525
Building the SampleBuilding the SampleJava ManagerJava Manager An SNMP An SNMP GETGET
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2626
Building the SampleBuilding the SampleJava ManagerJava Manager
An SNMP An SNMP GETNEXTGETNEXT
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2727
Building the SampleBuilding the SampleJava ManagerJava Manager
The Structure of the Synchronous The Structure of the Synchronous ManagerManager
Simple. All of the code is contained in Simple. All of the code is contained in one file that also contains a Java classone file that also contains a Java class
OperationOperation Command line options are validatedCommand line options are validated Required operation is recordedRequired operation is recorded API is prepared for making SNMP callsAPI is prepared for making SNMP calls SNMP request is executedSNMP request is executed Exceptions are caught in a Exceptions are caught in a try/catchtry/catch block block
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2828
Building the SampleBuilding the SampleJava ManagerJava Manager
The Synchronous ManagerThe Synchronous Manager JDMK API provide synchronous and JDMK API provide synchronous and
asynchronous operationasynchronous operation Production standard NMS needs to be Production standard NMS needs to be
asynchronous. It could be asynchronous. It could be synchronous if it used multiple synchronous if it used multiple threadsthreads
Book examples are synchronous for Book examples are synchronous for simplicitysimplicity
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
2929
Building the SampleBuilding the SampleJava ManagerJava Manager
Comparing the Visual C++ and JDMK 4.2 Comparing the Visual C++ and JDMK 4.2 APIsAPIs
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
3030
Ways to Improve the Two Ways to Improve the Two SampleSample
ProgramsPrograms Make operations asynchronousMake operations asynchronous Move parameters off the command Move parameters off the command
line or encrypt themline or encrypt them Make the programs independent of Make the programs independent of
MIB object specificationsMIB object specifications Provide a facility for adding support Provide a facility for adding support
for new MIBSfor new MIBS
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
3131
Ways to Improve the Two Ways to Improve the Two SampleSample
Programs (continued)Programs (continued) Allow multiple OIDs in one PDUAllow multiple OIDs in one PDU Move all SNMP API code into a Move all SNMP API code into a
separate module or a separate separate module or a separate serverserver
Remove global variablesRemove global variables Provide a non-debug version of the Provide a non-debug version of the
C++ programC++ program
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
3232
Ways to Improve the Two Ways to Improve the Two SampleSample
Programs (continued)Programs (continued) Allow table-based operationsAllow table-based operations Provide an external data sourse Provide an external data sourse
other than the command lineother than the command line Support SNMPv3Support SNMPv3
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
3333
Extending the SampleExtending the SampleSNMP ProgramsSNMP Programs
Utilize distinct or Utilize distinct or possibly distributed possibly distributed componentscomponents FFault serverault server CConfiguration serveronfiguration server AAccounting serverccounting server PPerformance servererformance server SSecurity serverecurity server
Straight-forward to Straight-forward to build a complex build a complex system once basic system once basic agent and agent and management entities management entities are in placeare in place
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
3434
Selected BibliographySelected Bibliography
Microsoft Visual C++Microsoft Visual C++ Link to Microsoft Visual C++ (Link to Microsoft Visual C++ (http://http://
msdn.microsoft.com/visualcmsdn.microsoft.com/visualc/)/) Link to SNMP Builder for C++ (Link to SNMP Builder for C++ (http://http://
www.hallogram.com/snmpcwww.hallogram.com/snmpc++/++/)) Sun Microsystems JDMKSun Microsystems JDMK
Link to Sun Microsystems JDMK (Link to Sun Microsystems JDMK (http://www.sun.com/software/jdmk/http://www.sun.com/software/jdmk/))
Revised Spring 2006Revised Spring 2006 Rudimentary NMS Software ComRudimentary NMS Software Componentsponents
3535
SummarySummary
Two simple programs that interact with Two simple programs that interact with Windows NT/2000/XP SNMP agentsWindows NT/2000/XP SNMP agents Visual C++Visual C++ JavaJava
SNMP’s process of handling security SNMP’s process of handling security violations was demonstratedviolations was demonstrated
These programs can be used individually These programs can be used individually or together as building blocks for more or together as building blocks for more complex systems or a NMScomplex systems or a NMS