Share this

Design and Implementation of SNMP Agent Software for a Layer 3 Ethernet Switch

2026-04-06 07:36:49 · · #1
Abstract: This paper introduces the Simple Network Management Protocol (SNMP) model and focuses on analyzing the embedded SNMP Agent software structure. The development process of the SNMP Agent for Layer 3 Ethernet switches discussed in this paper is also valuable for developing SNMP Agents for other network products such as routers. Keywords : Network Management, SNMP, MIB, embedded Agent 1 SNMP-Based Network Management The increasing complexity and heterogeneity of network devices make network management indispensable. Currently, there are several standard network management protocols, including Common Management Information Service/Common Management Information Protocol (CMIS/CMIP), Local Area Network Personal Management Protocol (LMMP), and Simple Network Management Protocol (SNMP). The Simple Network Management Protocol (SNMP), due to its simplicity and practicality, has become the de facto management standard for TCP/IP networks. The SNMP discussed today refers not only to a management protocol but also to a network management architecture. SNMP follows a standard Client/Server structure, and its management model includes four main elements: Manager, Agent, Management Information Base (MIB), and the SNMP protocol. The SNMP network management model is shown in Figure 1. [align=center]Figure 1 SNMP Network Management Model[/align] The Manager is the processing entity that implements network management. It periodically queries relevant information collected by the Agent to monitor various resources in the network and issues various instructions for network management operations to complete various network management functions. It acts as the Client in the model. The Agent periodically collects and maintains local management information and responds to the Manager's commands or operation requests. Additionally, the Agent can proactively notify the Manager of events occurring in its own system. Therefore, the Agent acts as the Server in the model. The MIB is an abstract collection of managed objects. It specifies the data items and data types that managed devices must store, as well as the allowed operations for each data item. The Manager can operate the MIB through the SNMP protocol to monitor and control the managed devices. The SNMP protocol provides a method for exchanging management information between the Manager and the Agent. Information is exchanged in the form of SNMP messages. Each SNMP message includes a version number representing the SNMP version, a community name for message authentication, and one of five Protocol Data Units (PDUs). These five PDUs correspond to the following five SNMP protocol message operations: * GetRequest: Used by the Manager to retrieve the value of a relevant variable from the Agent; * GetNextRequest: Used by the Manager to retrieve the value of the next variable from the Agent; * SetRequest: Used by the Manager to set the value of a relevant variable on the Agent; * GetResponse: The Agent's response to the Manager; * Trap: The Agent reports an abnormal event to the Manager when certain trigger conditions are met. The Manager is typically implemented on a workstation or high-performance PC, providing a human-machine interface. The Agent is generally embedded within the managed device, providing a standard SNMP interface. With the rapid development of microprocessor technology, memory technology, and embedded operating systems, embedding Agents on switches has become convenient and feasible. In the three-layer hardened Ethernet switch (hereinafter referred to as Ethernet switch) network management system developed by the author for the General Staff Communications Department (Project XV), an embedded Agent was implemented. The design and implementation of the embedded agent are explained below using this system as an example. 2. Embedded Agent System Structure Model The ruggedized Ethernet switch provides 80 10/100M Ethernet interfaces, 10 Gigabit fiber optic interfaces, and 2 SDSL RJ11 interfaces. The switching structure of this switch system adopts a crossbar switch type. Therefore, the switch hardware mainly consists of four parts: the crossbar switch, the switching chip, the CPU module, and the SDSL module, as shown in Figure 2. The crossbar switch uses Marvell's GT48304; the Layer 3 10/100M Ethernet switching chip and the Layer 3 Gigabit switching chip use Marvell's GT48510 and GT48520 respectively; the CPU uses Motorola's MPC8260 with 512MB of RAM; and the SDSL module chipset uses GlobeSpan's Orion™ chipset. The ruggedized Ethernet switch uses WindRiver's VxWorks real-time operating system, and the SNMP agent development uses WindNet, a development tool highly integrated with VxWorks. The SNMP Agent resides on the system's CPU module, enabling unified management of the switching module and SDSL module, and connects to the external network management workstation (Manager) via the system's Ethernet interface. [align=center] Figure 2: Switch Hardware System Structure and Agent System Structure Model [/align] 3. Defining and Expanding the MIB The IETF, in RFC 1155, specifies the data types that the SNMP MIB can use and how to describe and name the management object classes in the MIB. The SNMP MIB is organized around management objects; each object is essentially a variable representing a certain characteristic of the managed device. RFC 1155 specifies that the SNMP MIB uses ASN.1 to name all management objects. ASN.1 defines a tree-like namespace, where the name of each object reflects its position in the tree, corresponding to a leaf object. The IETF defines the standard MIB-II in RFC 1213. Using MIB-II, network management devices can easily obtain the inbound and outbound traffic of managed devices, but it is not easy to obtain the traffic of the entire local area network, nor can it perform historical analysis of daily communication volume. The emergence of RMON MIB solved this problem, and the IETF defined RMON MIB in RFC 1271. RMON MIB consists of a set of statistical data, analytical data, and diagnostic data. Without changing the SNMP protocol, it expands the Management Information Base MIB-II and enhances the functions of network management. Based on the actual monitoring of hardened switches, we selectively implemented the following groups in RMON MIB: (1) Statistics group: Maintains basic usage and error statistics for each subnet monitored by the Agent. (2) History group: Records periodic statistical samples of information available from the statistics group. (3) Alarm group: Allows network management workstation personnel to set sampling intervals and alarm thresholds for any counts or integers recorded by the RMON Agent. (4) Host group: Contains counts of various traffic to hosts connected to the subnet. (5) Event group: A table of all events generated by the RMON Agent. In addition to supporting standard MIB-II and RMON MIBs as much as possible, a private MIB library was also created based on the network management capabilities provided by the switch's hardware and software. The private MIB library consists of the following groups: (1) System Information Group (SysInfo): The System Information Group mainly describes the global read-only register information of the switch. (2) System Configuration Group (Config): The System Configuration Group mainly describes the global readable and writable register information of the switch. (3) Module Group (Module): Describes the relevant register information of each switching module. (4) Port Group (Port): Describes the relevant register information of each switching port. (5) Virtual Local Area Network Group (VLAN): The Virtual Local Area Network Group describes the configuration information of the Virtual Local Area Network. The following uses the System Information Group (SysInfo) to illustrate the construction of the MIB library. The System Information Group (SysInfo) mainly includes the following objects: 1) InfoBoardRevision: The main backplane revision version of the switch. 2) InfoPeakBufferUsed: Size of the buffer in the switch. 3) InfoAddrCapacity: Maximum supported MAC address. 4) InfoSelfTestFailed: System self-test information. 5) InfoLedNumber: Number of LED indicators on the switch. 6) InfoVisualIndicatorMode: LED indicator display mode. The determined management objects are described and organized using ASN.1 to form a MIB. Since the MIB file is an ASCII text file written in ASN.1, it needs to be "translated" into a C/C++ data structure before it can be implemented by the program. This paper uses the MIB Compiler tool provided by WindNet SNMP to compile the MIB file described in ASN.1 into C language source code. 4 Design and implementation of embedded agent software 4.1 Software structure of embedded agent Embedded agent software generally includes the following 5 modules, as shown in Figure 3. [align=center] Figure 3 Embedded agent software structure[/align] (1) Initialization module The initialization module is mainly responsible for the initialization of the transmission interface, configuration data access, and MIB initialization. After the VxWorks operating system starts successfully, the Agent software starts running and starts the initialization module. The initialization module first initializes the MIB virtual tree for querying during processing; secondly, it initializes the UDP interface to open the interface between the application layer and the transport layer; finally, it reads the data in the configuration file and sets the initialization variables of the agent process and the MIB according to the data. (2) Socket communication module Communication function is one of the important functions of Agent. It realizes two-way communication between SNMP Agent and SNMP Manager. SNMP Manager and SNMP Agent communicate through SNMP Simple Network Management Protocol, i.e. SNMP over TCP/IP. In order to ensure the simplicity of SNMP protocol, UDP is generally selected as its transport layer protocol, and each SNMP message must be able to be transmitted in a single UDP datagram. The network management station communicates by exchanging SNMP messages through the protocol. Except for Trap-PDU which uses port 162, other SNMP messages use port 161 for communication. (3) Trap processing module When Agent detects a specific event, it calls the Trap processing module to construct a Trap message. The Trap processing module encodes the internal format Trap message information in ASN.1 format. The SNMP Trap message is handed over to the Socket communication processing module through the socket interface and then sent to the network management station. Generally, after the switch starts up, it will send a system startup Trap message to the management station to notify the network management station that the agent has started. (4) PDU processing module initialization After the module initializes the MIB library, it starts the PDU processing module to receive SNMP messages and construct SNMP response messages. The PDU processing module processes SNMP messages in the following order. 1) Syntax analysis and conversion into internal format Because the ASN.1 format allows the use of variable-length fields, the fields of the SNMP message cannot be directly mapped to the fixed internal data structure of the agent process code. The SNMP message is parsed and converted into a usable internal data structure, which the agent process code can process. 2) Authentication and authorization Authentication is performed on the community field of the SNMP message. If the authentication fails, the message is discarded. If the authentication is successful, it is handed over to the MIB management routine module for processing. 3) Constructing a response message After the command is executed, a response message is constructed according to the execution status of the command and converted into ASN.1 format, which is then handed over to the Socket communication module for transmission to the network management station. (5) MIB management routine module This module uses certain search algorithms to find each MIB object and implement Get and Set operations on each group of MIB objects. In the process of designing the Ethernet switch Agent software, we divide the objects in the MIB library into two types according to the actual situation of each MIB variable: real-time objects and non-real-time objects. For real-time objects, each time the object is queried, the relevant information on the switch hardware is read or set by calling the character device driver; for non-real-time objects, a static variable value is kept in memory, and the static value is initialized when the agent process is initialized. If only the value of the object is read, it is not necessary to read the hardware information, and it is enough to return the static variable value. If the object is set, that is, a write operation is performed on it, the relevant information on the hardware must be set by calling the character device driver, and the static variable value is changed accordingly for future reading. 4.2 SNMP Agent Software Development and Testing Process The development and testing of the switch SNMP Agent under the VxWorks real-time system using the Tornado integrated development tool and the WindNet network management development tool can be carried out in the following steps: (1) Write management operation routines for the predefined MIB objects; (2) Compile and generate the Agent target code and start the target machine; (3) Configure the host environment according to the specific chip (MPC8260) of the target machine; (4) Configure the target server and use the CrossWind graphical debugging tool to debug the application; (5) After successful debugging, use HP's SNMP++ Browser network management software to test the switch SNMP Agent, and use it to query, traverse, and set MIB variables. 5 Conclusion Due to its simplicity and practicality, SNMP has become the de facto management standard for TCP/IP networks. Currently, more and more network products directly provide SNMP interfaces. Based on the three-layer hardened Ethernet switch network management system, the author implemented a complete SNMP Agent using the WindNet SNMP software package on the VxWorks embedded operating system platform. It supports MIB-II, proprietary MIB, and RMON MIB, providing network management stations with rich raw management data from within the switch. This switch has been submitted to the General Staff Communications Department for military trials. The development and testing methods for this ruggedized Ethernet switch's embedded agent are also valuable for developing SNMP agents for other network products such as routers and DSL modems. References: 1. IETF RFC 1157, Simple Network Management Protocol (SNMP), 1990.1 2. IETF RFC 1905, Protocol Operations for Version 2 of the Simple Network Management Protocol, 1996.1 3. Vxworks_net_programmers_guide, WindRiver System, 1999.5 4. GT-48310 Datasheet. Galileo Technology, 1998 5. Qin Xiandao, An Changqing. Network Management Protocols and Application Development. Tsinghua University Press, 1998.7 6. Lu Xiaocun, Xu Hong, Wang Taidong, et al. (trans.). Embedded System TCP/IP Application Layer Protocol, 2003.4
Read next

CATDOLL 148CM Hanako Silicone Doll

Height: 148 Silicone Weight: 33kg Shoulder Width: 34cm Bust/Waist/Hip: 70/58/82cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22