In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Network is an important part of computer communication network. It constitutes a large-scale information processing system through interconnection and cooperation. Network management refers to the supervision, organization, control of network communication services and information processing activities, to ensure the continuous normal operation of computer networks, and timely response and troubleshooting when abnormal operation occurs. How to manage the network effectively is an important guarantee that the computer network can provide services effectively, reliably, safely and economically.
Understanding SNMP Protocol
SNMP protocol can define a unified interface and protocol for different manufacturers, different types and different models of equipment, so that administrators can use common rules to manage devices located in different physical spaces through the network, thus greatly improving the efficiency of network management and simplifying the work of network administrators.
SNMP is an application layer protocol in the OSI seven-layer model. It was developed in 1988 and adopted by the Internet Architecture Board (IAB) as a short-term network management solution; SNMP flourished in the Internet era due to its simplicity, and SNMPv2 was released in 1992 to enhance SNMPv1 security and functionality. There is now a SNMPv3 version. At present, most network devices such as switches, routers and so on support SNMP protocol specification, SNMP protocol has become the industry standard in the field of network management.
A complete SNMP network equipment monitoring system mainly includes management information base (MIB), management information structure (SMI) and SNMP message protocol, management workstation uses SNMP to remotely monitor and manage all devices supporting this protocol on the network (such as computer workstations, terminals, routers, hubs, network printers, etc.), mainly responsible for monitoring equipment status, modifying equipment configuration, receiving event warnings, etc.
SNMP message
In the OSI model, data units at the transport layer are also called packets. SNMP uses UDP(User Datagram Protocol) as its transport layer protocol and provides network services for SNMP. The data units of UDP protocol are called datagrams. Because UDP is an unreliable datagram service, there is no guarantee that UDP datagrams will achieve their goals, but the packet drop problem does not have a big impact on network management. SNMP messages consist of two parts: an SNMP header and a Protocol Data Unit PDU(Protocol Data Unit), where the SNMP header includes the SNMP version number and the community name. There are three versions of SNMP: Version1, Version2, and Version3. The community ID can be used as a password for SNMP messages, and the default value is "public." View SNMP version contacts and differences (http://blog.csdn.net/zyboy2000/article/details/7221687)
Get_Request: The Manager sends a request for reading information to the Agent.
Get_ Next_Request: The Manager sends Get-Request to the Agent to query column elements in a specific table object.
Get_Response: Agent response to Manager request; passive response
Set_Request: The Manager sends device setting information to the Agent, and the Agent can change the device status according to the setting information (including device name, device attributes, deleting a device or making a certain device attribute valid/invalid, etc.);
Trap: When certain events occur on the Agent side, the Agent side actively sends trap information to the Manager side, such as shutdown events.
Introduction to SNMP4J
SNMP4J is an enterprise-class free open source SNMP API for Java library. Based on JAVASE 1.4 and above. The official website is available at http://www.snmp4j.org/and provides related JavaDocs and wikis.
Java Demo (to get the host name for a network host)
Console for SNMPTest.getRequest:
OID: 1.3.6.1.2.1.1.5.0
Value: com-router
SNMP4J Important Classes and Interfaces
Snmp: The core class in the package that provides methods for sending and receiving SNMP PDUs. Both synchronous and asynchronous. Snmp is independent of the transport protocol. Support for adding specific TransportMapping instances Create a Snmp instance with the corresponding transport mapping by calling addTransportMapping(TransportMapping TransportMapping) method or using a non-default constructor. Transport maps are used for incoming and outgoing messages.
TransportMapping: This interface represents the transport layer protocol used by SNMP4J. This is also a feature of SNMP4J. According to RFC, SNMP uses UDP only as a transport layer protocol. SNMP4J supports UDP or TCP for both management and agent. This interface has two subinterfaces.
PDU: The PDU class represents an SNMP protocol data unit. PDU (for Snmpv2c), PDUv1 (for Snmpv1), ScopedPDU (for Snmpv3), but the three classes are basically the same except for some parameters that are special to each other. PDU as a base class is often sufficient to provide most of the features.
Target*: A Target interface defines an abstract representation of a remote SNMP entity. With an address object and protocol parameters such as retry times and timeout times. For SNMPv1 and SNMPv2c, the implementation of CommunityTarget applies. SNMPv3, for UserTarget.
SNMP4J API call flow
Create an agreement. DefaultUdpTransportMapping instance can generally be used as the transport layer protocol.
Create SNMP objects. Fill TransportMapping as a construction parameter.
Start listening.
Construct the target. Set parameters such as Address, version number, retry times, timeout, etc.
Create a message (PDU). Set the request method and OID to query.
Send messages. Synchronous mode: call snmp.send method; asynchronous mode: need to set listener.
Get ResponseEvent. Synchronous mode blocks return, asynchronous mode is obtained in callback functions in listening threads. ResponseEvent.getResponse(), get the reply message.
Release resources. Snmp.close()。
SNMP Network Management System
An SNMP-managed network consists of three main parts: managed devices, agents, and network management systems (NMS). Managed devices are multiple devices in the managed network, responsible for collecting and storing management information; agents are software programs installed in the managed devices (for example, most switches have SNMP agents, which only need to be opened); network management systems are software systems used to monitor the execution status of managed devices. SNMP network management, generally using Manager/Agent structure centralized management information, management workstation for the Manager side, the network equipment for the Agent side.
SMI Management Message Structure
SMI is the fundamental part of SNMP, defining the composition, structure, and representation of information used by the SNMP framework, laying the foundation for describing how MIB objects and protocols exchange information.
MIB Management Message Base
In a complex network environment, there are various types of network devices, so the information of the devices varies according to the types of devices. In order to manage these information through the network management system, a set of standards must be adopted to describe the information of these devices. Therefore, SNMP defines MIB(Management Information Base). The MIB is divided into standard MIB and private MIB. The standard MIB is applicable to all network equipment, while the private MIB is defined by the equipment manufacturer after application to the relevant organization. MIB adopts tree structure, each node is assigned a character string and a small integer as label, namely OID(Object Identifier).
The name of any object in the MIB tree is a sequence of labels separated by dots along the path from the root to the node of the object. For example, the IP address information of each network interface in the managed device is expressed as: iso.org.dod.internet.mgmt.mid.ip, and its numerical expression is: 1.3.6.1.2.1.4.
The base OID of a standard MIB is prefixed with 1.3.6.1.2.1, while the base OID of a private MIB is prefixed with 1.3.6.1.4.1. If there are multiple pieces of information under a node, they exist in a list form, for example, IP address information includes subnet mask, gateway address, etc.
Network environment topology graph
system design diagram
System cases and effects
The implementation of SNMP network management system perfectly solves the monitoring and management of network devices across devices and physical locations. Real-time monitoring of current equipment status, network inflow and outflow rates, cpu/memory usage and other necessary information.
For example, real-time monitoring of traffic on the day:
Network administrators can monitor and manage devices centrally, and intuitively obtain real-time traffic data from the interface, analyze the current status of current network devices, and handle and maintain them accordingly.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.