CN105207803A - Method for simulating trap messages of multiple network elements and system - Google Patents

Method for simulating trap messages of multiple network elements and system Download PDF

Info

Publication number
CN105207803A
CN105207803A CN201510504588.9A CN201510504588A CN105207803A CN 105207803 A CN105207803 A CN 105207803A CN 201510504588 A CN201510504588 A CN 201510504588A CN 105207803 A CN105207803 A CN 105207803A
Authority
CN
China
Prior art keywords
network element
address
management system
message
under test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510504588.9A
Other languages
Chinese (zh)
Other versions
CN105207803B (en
Inventor
蔡磊磊
李�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huaxun Ark Photoelectric Technology Co ltd
Original Assignee
Shenzhen Huaxun Fangzhou Software Information Science & Technology Co Ltd
Shenzhen Huaxun Ark Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Huaxun Fangzhou Software Information Science & Technology Co Ltd, Shenzhen Huaxun Ark Technology Co Ltd filed Critical Shenzhen Huaxun Fangzhou Software Information Science & Technology Co Ltd
Priority to CN201510504588.9A priority Critical patent/CN105207803B/en
Publication of CN105207803A publication Critical patent/CN105207803A/en
Application granted granted Critical
Publication of CN105207803B publication Critical patent/CN105207803B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0213Standardised network management protocols, e.g. simple network management protocol [SNMP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method simulating trap messages of multiple network elements and a system and relates to the communication technology field. The method comprises steps that, configuration files of a to-be-measured network management system are read to acquire and store configuration parameters of the to-be-measured network management system; command parameters inputted by a user through a simulation terminal are received and stored, an MAC address and an IP address of the simulation terminal are simultaneously read, an MAC address and an IP address of a simulation network element are generated based on the command parameters, the MAC address and the IP address of the simulation terminal according to predetermined rules; an Snmp trap message of the simulation element is assembled based on the configuration parameters and the MAC address and the IP address of the simulation network element and by employing the raw socket programming technology; the Snmp trap message is sent to the to-be-measured network management system through a raw socket sending function, and performance test on the to-be-measured network management system is carried out according to the Snmp trap message. Through the method, multiple network elements are simulated to send Snmp trap messages to the to-be-measured network management system, networking test on the to-be-measured network management system can be rapidly and conveniently carried out, and reliability and stability of the to-be-measured network management system can be effectively tested.

Description

A kind of method and system simulating the trap message of multiple network element
Technical field
The invention belongs to communication technical field, particularly relate to a kind of method and system simulating the trap message of multiple network element.
Background technology
SNMP (SimpleNetworkManagementProtocol, Simple Network Management Protocol) is one of NMP proposed the earliest, and due to its simplicity, it is widely used once releasing and supports.At present, SNMP has become the working stamndard in field of network management, and most of network management system and platform all realize based on snmp protocol.
Along with the extensive use of snmp protocol, so NSM (NetworkManagementSystem, network management system) network element that manages is thousands of, even hundreds thousand of, so in existing network applied environment, these network elements are at any time with producing warning information with carving, and send to NMS by Trap message, at this moment NMS must possess the ability of the Trap message simultaneously processing hundreds thousand of reported by network elements, therefore, in order to ensure carrying out smoothly of network management, when NMS comes into operation again, must test its performance.Agent (agency) on NMS and managed element carries out the uniting and adjustment stage, is often difficult to deployment large-scale test environment, except the problem such as fund, place also exists the problems such as the annexation of real network is intricate.Therefore, develop a set of analog simulation testing tool in the uniting and adjustment stage in the market and realize the performance test to network management system to replace various network element in actual environment.
But because snmp protocol belongs to application layer protocol, and according to TCP/IP (TransmissionControlProtocol/InternetProtocol, transmission control protocol/Internet Protocol) procotol stack mechanism, transport layer and following mechanism thereof are provided by kernel, application layer is provided by consumer process, and this analog simulation instrument operates in a PC (PersonalComputer, personal computer) on machine, therefore the IP head of network layer is assembled by the TCP/IP network protocol stack of kernel, Snmptrap (the trap message that managed devices reports sent, namely proactive notification when managed devices breaks down or changes) IP address in message is all identical, although so this analog simulation instrument can send Snmptrap message by analogue network element, but also can only simulate a network element and send Snmptrap message, and multiple network element can not be simulated to network management system transmission Snmptrap message simultaneously.Therefore, current analog simulation instrument has significant limitation, cannot test environment that is virtually reality like reality.For this problem, traditional solution utilizes the Variable-Bindings pair in Snmptrap message format, define privately owned definition message format, as specified, second Variable-Bindings in Snmptrap message is to the IP address representing network element, after NMS collects this message, resolve second Variable-Bindings pair, obtain the IP address of network element, then according to handling process process.The method also has certain limitation, essence or the Snmptrap message of a network element, really intactly cannot simulate the flow process of multiple network element transmitting-receiving snmp message.
To sum up, still there is the defect really cannot simulated multiple network element and network management system is tested in prior art.
Summary of the invention
The object of the embodiment of the present invention is to provide a kind of method and system simulating the trap message of multiple network element, be intended to solve in prior art exist really cannot simulate the problem that multiple network element tests network management system.
The embodiment of the present invention is achieved in that a kind of method simulating the trap message of multiple network element, comprising:
Read the configuration file of network under test management system, to obtain the configuration parameter of described network under test management system;
Receive and preserve the command parameter that user inputted by pseudo-terminal, read MAC Address and the IP address of described pseudo-terminal simultaneously, and generate MAC Address and the IP address of analogue network element according to the MAC Address of described command parameter and described pseudo-terminal and IP address according to pre-defined rule;
Rawsocket programming technique is adopted to assemble the Snmptrap message of described analogue network element according to the configuration parameter of described network under test management system and the MAC Address of described analogue network element and IP address;
Send function by rawsocket and described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message.
In the method for the trap message of the multiple network element of the simulation described in the embodiment of the present invention, the configuration file of described reading network under test management system, to obtain and the configuration parameter preserving described network under test management system specifically comprises:
Read the configuration file of described network under test management system, to obtain and to preserve the version number of the snmp protocol that the MAC Address of described network under test management system, IP address and described network under test management system adopt, community and Snmptrap Variable-Bindings pair.
In the method for the trap message of the multiple network element of the simulation described in the embodiment of the present invention, the MAC Address of the described pseudo-terminal of described reading and IP address, and generate the MAC Address of analogue network element according to the MAC Address of described command parameter and described pseudo-terminal and IP address according to pre-defined rule and IP address specifically comprises:
Needed for the input prompt information input user of described pseudo-terminal, the number of analogue network element and the cycle of analogue network element transmission Snmptrap message, read MAC Address and the IP address of described pseudo-terminal simultaneously;
With the number of analogue network element needed for user in described command parameter for the upper limit, with the MAC Address of described pseudo-terminal for plot, the cumulative MAC Address obtaining analogue network element, and the MAC Address of described analogue network element is saved in analogue network element information list;
With the number of analogue network element needed for user in described command parameter for the upper limit, with the IP address of described pseudo-terminal for plot, the cumulative IP address obtaining analogue network element, and the IP address of described analogue network element is saved in described analogue network element information list.
In the method for the trap message of the multiple network element of the simulation described in the embodiment of the present invention, the Snmptrap message that described employing rawsocket programming technique assembles described analogue network element according to the configuration parameter of described network under test management system and the MAC Address of described analogue network element and IP address specifically comprises:
Create rawsocket, and the option of socket in rawsocket is set, the IP packet header of the data that will send to make rawsocket manual handle;
The ETH head of the Snmptrap message of described analogue network element, IP head, UDP head and SNMP message body is assembled according to the MAC Address of analogue network element in the MAC Address of described network under test management system and IP address and described analogue network element information list and IP address.
In the method for the trap message of the multiple network element of the simulation described in the embodiment of the present invention, described by rawsocket send function described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message and specifically comprise:
The cycle of Snmptrap message is sent according to the described analogue network element of user's input, use described socketid that described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message.
Another object of the embodiment of the present invention is to provide a kind of system simulating the trap message of multiple network element, comprising:
Initialization module, for reading the configuration file of network under test management system, to obtain the configuration parameter of described network under test management system;
Act on behalf of generation module, for receiving and preserving the command parameter that user inputted by pseudo-terminal, read MAC Address and the IP address of described pseudo-terminal simultaneously, and generate MAC Address and the IP address of analogue network element according to the MAC Address of described command parameter and described pseudo-terminal and IP address according to pre-defined rule;
Depacketize module, assembles the Snmptrap message of described analogue network element for adopting rawsocket programming technique according to the configuration parameter of described network under test management system and the MAC Address of described analogue network element and IP address;
Message sending module, being sent to described network under test management system for sending function by rawsocket by described Snmptrap message, carrying out performance test to make described network under test management system according to described Snmptrap message.
In the system of the trap message of the multiple network element of the simulation described in the embodiment of the present invention, described initialization module specifically for:
Read the configuration file of described network under test management system, to obtain and to preserve the version number of the snmp protocol that the MAC Address of described network under test management system, IP address and described network under test management system adopt, community and Snmptrap Variable-Bindings pair.
In the system of the trap message of the multiple network element of the simulation described in the embodiment of the present invention, described generation module of acting on behalf of specifically comprises:
User input unit, for the number of analogue network element needed for the input prompt information input user of described pseudo-terminal and the cycle of analogue network element transmission Snmptrap message, reads MAC Address and the IP address of described pseudo-terminal simultaneously;
Analogue network element MAC Address generation unit, for with the number of analogue network element needed for user in described command parameter for the upper limit, with the MAC Address of described pseudo-terminal for plot, the cumulative MAC Address obtaining analogue network element, and the MAC Address of described analogue network element is saved in analogue network element information list;
Analogue network element IP scalar/vector, for with the number of analogue network element needed for user in described command parameter for the upper limit, with the IP address of described pseudo-terminal for plot, the cumulative IP address obtaining analogue network element, and the IP address of described analogue network element is saved in described analogue network element information list.
In the system of the trap message of the multiple network element of the simulation described in the embodiment of the present invention, described depacketize module specifically comprises:
Rawsocket unit, for creating rawsocket, and arranges the option of socket in rawsocket, the IP packet header of the data that will send to make rawsocket manual handle;
Module units, for assembling the ETH head of the Snmptrap message that described analogue network element sends, IP head, UDP head and SNMP message body according to the MAC Address of analogue network element in the MAC Address of described network under test management system and IP address and described analogue network element information list and IP address.
In the system of the trap message of the multiple network element of the simulation described in the embodiment of the present invention, described message sending module specifically comprises:
Socketid acquiring unit, for obtaining the socketid sending rawsocket;
Transmitting element, described analogue network element for inputting according to user sends the cycle of Snmptrap message, use described socketid that described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message.
The method and system implementing the trap message of the multiple network element of simulation that the embodiment of the present invention provides have following beneficial effect:
The embodiment of the present invention is owing to adopting rawsocket programming technique according to the configuration parameter of network under test management system and the Snmptrap message oneself assembling described analogue network element in advance according to the MAC Address of the analogue network element of pre-defined rule generation and IP address, thus user can be made to revise MAC Address in Snmptrap message and IP address, therefore, can realize really simulating multiple network element and send Snmptrap message to network under test management system, can be quick, networking test is carried out easily with network under test management system, the reliability and stability of effective inspection network under test management system.
Accompanying drawing explanation
Fig. 1 is the specific implementation flow chart of the method for the trap message of the multiple network element of simulation that the embodiment of the present invention provides;
Fig. 2 is the specific implementation flow chart of S102 in the method for the trap message of the multiple network element of simulation that the embodiment of the present invention provides;
Fig. 3 is the specific implementation flow chart of S103 in the method for the trap message of the multiple network element of simulation that the embodiment of the present invention provides;
Fig. 4 is the structured flowchart of the system of the trap message of the multiple network element of simulation that the embodiment of the present invention provides.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Fig. 1 shows the specific implementation flow process of the method for the trap message of the multiple network element of simulation that the embodiment of the present invention provides.Shown in Figure 1, the method for the trap message of the multiple network element of the simulation that the embodiment of the present invention provides, comprising:
In S101, read the configuration file of network under test management system, to obtain the configuration parameter of described network under test management system.
In embodiments of the present invention, first the configuration parameter of described network under test management system is known by user, described configuration parameter comprises MAC (MediaAccessControl, media interviews control) version number of the snmp protocol that adopts of address, IP address and described network under test management system, community and Snmptrap Variable-Bindings pair, then described configuration parameter to be written in the configuration file of described network under test management system and to preserve; The last configuration file being read described network under test management system by pseudo-terminal, to obtain and to preserve the version number of the snmp protocol that the MAC Address of described network under test management system, IP address and described network under test management system adopt, community and Snmptrap Variable-Bindings pair.
In S102, receive and preserve the command parameter that user inputted by pseudo-terminal, read MAC Address and the IP address of described pseudo-terminal simultaneously, and generate MAC Address and the IP address of analogue network element according to the MAC Address of described command parameter and described pseudo-terminal and IP address according to pre-defined rule.
Fig. 2 shows the specific implementation flow process of S102, and shown in Figure 2, S102 specifically comprises:
In S201, needed for the input prompt information input user of described pseudo-terminal, the number of analogue network element and the cycle of analogue network element transmission Snmptrap message, read MAC Address and the IP address of described pseudo-terminal simultaneously;
In S202, with the number of analogue network element needed for user in described command parameter for the upper limit, with the MAC Address of described pseudo-terminal for plot, the cumulative MAC Address obtaining analogue network element, and the MAC Address of described analogue network element is saved in analogue network element information list;
In S203, with the number of analogue network element needed for user in described command parameter for the upper limit, with the IP address of described pseudo-terminal for plot, the cumulative IP address obtaining analogue network element, and the IP address of described analogue network element is saved in described analogue network element information list.
In embodiments of the present invention, pseudo-terminal can be PC terminal, user can according to the number of the input prompt information of PC terminal by the KIS network element of PC terminal and the cycle of analogue network element transmission Snmptrap message, if the cycle that the analogue network element of user's input sends Snmptrap message is 0, then represent that this analogue network element uninterrupted circulation can send Snmptrap message to network under test management system.
In S103, rawsocket programming technique is adopted to assemble the Snmptrap message of described analogue network element according to the MAC Address of analogue network element described in the configuration parameter of described network under test management system and described analogue network element information list and IP address.
Fig. 3 shows the specific implementation flow process of S103, and shown in Figure 3, S103 specifically comprises:
In S301, create rawsocket, and the option of socket in rawsocket is set, the IP packet header of the data that will send to make rawsocket manual handle.
In embodiments of the present invention, directly use socket function creation rawsocket, then use setsockopt that the option of socket is set, the IP_HDRINCL in socket option is set to very, the IP packet header of the data that will send to make rawsocket manual handle.
In S302, assemble the ETH head of the Snmptrap message of described analogue network element, IP head, UDP head and SNMP message body according to the MAC Address of described network under test management system and the MAC Address of IP address and described analogue network element and IP address.
In embodiments of the present invention, the ETH head assembling the Snmptrap message of analogue network element specifically comprises: with the MAC Address of analogue network element in described analogue network element information list for source address, assemble the source MAC in described ETH head; Address for the purpose of the MAC Address of described network under test management system, assembles the target MAC (Media Access Control) address in described ETH head; Assemble the type field in described ETH head, be fixed as 0X0880, wherein 0X0880 represents that network layer protocol is IP agreement.
In embodiments of the present invention, the IP head assembling the Snmptrap message of analogue network element specifically comprises: with the IP address of analogue network element in described analogue network element information list for source address, assemble the source IP address in described IP head; Address for the purpose of the IP address of described network under test management system, assembles the object IP address in described IP head; Assembling the type field in described IP head, being fixed as being 17, wherein 17 represent that transport layer protocol is udp protocol; Assemble the protocol version in described IP head and other fields; Calculate the School Affairs in described IP head, and assemble this field.
In embodiments of the present invention, the UDP head of the Snmptrap message of assembling analogue network element specifically comprises: the port assembling described UDP head, and be fixed as X, wherein X is greater than 1024; Assemble the destination interface of described UDP head, being fixed is 162, and wherein 162 represent Snmptrap port; Length field in assembling UDP head; Calculate the School Affairs in described UDP head, and assemble this field.
The Snmptrap message body assembling analogue network element in embodiments of the present invention specifically comprises: according to version number and the community assembling SNMP heading of the snmp protocol got; The Trap head of assembling SNMP message; According to the Snmptrap Variable-Bindings pair of the Snmptrap Variable-Bindings obtained to assembling Snmptrap message body.
In S104, send function by rawsocket and described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message.
In embodiments of the present invention, the socketid sending rawsocket will first be obtained; Then the cycle of Snmptrap message is sent according to the described analogue network element of user's input, use described socketid that described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message.
The method of the trap message of the multiple network element of the simulation that the embodiment of the present invention provides is owing to adopting rawsocket programming technique according to the configuration parameter of network under test management system and the Snmptrap message oneself assembling described analogue network element in advance according to the MAC Address of the analogue network element of pre-defined rule generation and IP address, thus user can be made to revise MAC Address in Snmptrap message and IP address, therefore, can realize really simulating multiple network element and send Snmptrap message to network under test management system, can be quick, networking test is carried out easily with network under test management system, the reliability and stability of effective inspection network under test management system.
Fig. 4 shows the structured flowchart of the system of the trap message of the multiple network element of simulation that the embodiment of the present invention provides, and this system is for running the method for the trap message of above-mentioned Fig. 1 ~ multiple network element of the simulation provided embodiment illustrated in fig. 3.Illustrate only the part relevant to the embodiment of the present invention for convenience of explanation.
Shown in Figure 4, the system of the trap message of the multiple network element of the simulation that the embodiment of the present invention provides, comprising:
Initialization module 1, for reading the configuration file of network under test management system, to obtain the configuration parameter of described network under test management system;
Act on behalf of generation module 2, for receiving and preserving the command parameter that user inputted by pseudo-terminal, read MAC Address and the IP address of described pseudo-terminal simultaneously, and generate MAC Address and the IP address of analogue network element according to the MAC Address of described command parameter and described pseudo-terminal and IP address according to pre-defined rule;
Depacketize module 3, assembles the Snmptrap message of described analogue network element for adopting rawsocket programming technique according to the configuration parameter of described network under test management system and the MAC Address of described analogue network element and IP address;
Message sending module 4, being sent to described network under test management system for sending function by rawsocket by described Snmptrap message, carrying out performance test to make described network under test management system according to described Snmptrap message.
Optionally, described initialization module 1 specifically for:
Read the configuration file of described network under test management system, to obtain and to preserve the version number of the snmp protocol that the MAC Address of described network under test management system, IP address and described network under test management system adopt, community and Snmptrap Variable-Bindings pair.
Optionally, described generation module 2 of acting on behalf of specifically comprises:
User input unit 21, for the number of analogue network element needed for the input prompt information input user of described pseudo-terminal and the cycle of analogue network element transmission Snmptrap message, reads MAC Address and the IP address of described pseudo-terminal simultaneously;
Analogue network element MAC Address generation unit 22, for with the number of analogue network element needed for user in described command parameter for the upper limit, with the MAC Address of described pseudo-terminal for plot, the cumulative MAC Address obtaining analogue network element, and the MAC Address of described analogue network element is saved in analogue network element information list;
Analogue network element IP scalar/vector 23, for with the number of analogue network element needed for user in described command parameter for the upper limit, with the IP address of described pseudo-terminal for plot, the cumulative IP address obtaining analogue network element, and the IP address of described analogue network element is saved in described analogue network element information list.
Optionally, described depacketize module 3 specifically comprises:
Rawsocket unit 31, for creating rawsocket, and arranges the option of socket in rawsocket, the IP packet header of the data that will send to make rawsocket manual handle;
Module units 32, for assembling the ETH head of the Snmptrap message of described analogue network element, IP head, UDP head and SNMP message body according to the MAC Address of analogue network element in the MAC Address of described network under test management system and IP address and described analogue network element information list and IP address.
Optionally, described message sending module 4 specifically comprises:
Socketid acquiring unit 41, for obtaining the socketid sending rawsocket;
Transmitting element 42, described analogue network element for inputting according to user sends the cycle of Snmptrap message, use described socketid that described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message.
It should be noted that, modules in said system, due to the inventive method embodiment based on same design, its technique effect brought is identical with the inventive method embodiment, particular content can see in the inventive method embodiment describe, repeat no more herein.
The system of the trap message of the multiple network element of the simulation that the embodiment of the present invention provides, equally owing to adopting rawsocket programming technique according to the configuration parameter of network under test management system and the Snmptrap message oneself assembling described analogue network element in advance according to the MAC Address of the analogue network element of pre-defined rule generation and IP address, thus user can be made to revise MAC Address in Snmptrap message and IP address, therefore, can realize really simulating multiple network element and send Snmptrap message to network under test management system, can be quick, networking test is carried out easily with network under test management system, the reliability and stability of effective inspection network under test management system.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. simulate a method for the trap message of multiple network element, it is characterized in that, comprising:
Read the configuration file of network under test management system, to obtain and to preserve the configuration parameter of described network under test management system;
Receive and preserve the command parameter that user inputted by pseudo-terminal, read MAC Address and the IP address of described pseudo-terminal simultaneously, and generate MAC Address and the IP address of analogue network element according to the MAC Address of described command parameter and described pseudo-terminal and IP address according to pre-defined rule;
Rawsocket programming technique is adopted to assemble the Snmptrap message of described analogue network element according to the configuration parameter of described network under test management system and the MAC Address of described analogue network element and IP address;
Send function by rawsocket and described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message.
2. the method for the trap message of the multiple network element of simulation as claimed in claim 1, is characterized in that, the configuration file of described reading network under test management system, to obtain and the configuration parameter preserving described network under test management system specifically comprises:
Read the configuration file of described network under test management system, to obtain and to preserve the version number of the snmp protocol that the MAC Address of described network under test management system, IP address and described network under test management system adopt, community and Snmptrap Variable-Bindings pair.
3. the method for the trap message of the multiple network element of simulation as claimed in claim 2, it is characterized in that, the MAC Address of the described pseudo-terminal of described reading and IP address, and generate the MAC Address of analogue network element according to the MAC Address of described command parameter and described pseudo-terminal and IP address according to pre-defined rule and IP address specifically comprises:
Needed for the input prompt information input user of described pseudo-terminal, the number of analogue network element and the cycle of analogue network element transmission Snmptrap message, read MAC Address and the IP address of described pseudo-terminal simultaneously;
With the number of analogue network element needed for user in described command parameter for the upper limit, with the MAC Address of described pseudo-terminal for plot, the cumulative MAC Address obtaining analogue network element, and the MAC Address of described analogue network element is saved in analogue network element information list;
With the number of analogue network element needed for user in described command parameter for the upper limit, with the IP address of described pseudo-terminal for plot, the cumulative IP address obtaining analogue network element, and the IP address of described analogue network element is saved in described analogue network element information list.
4. the method for the trap message of the multiple network element of simulation as claimed in claim 3, it is characterized in that, the Snmptrap message that described employing rawsocket programming technique assembles described analogue network element according to the configuration parameter of described network under test management system and the MAC Address of described analogue network element and IP address specifically comprises:
Create rawsocket, and the option of socket in rawsocket is set, the IP packet header of the data that will send to make rawsocket manual handle;
The ETH head of the Snmptrap message of described analogue network element, IP head, UDP head and SNMP message body is assembled according to the MAC Address of analogue network element in the MAC Address of described network under test management system and IP address and described analogue network element information list and IP address.
5. the method for the trap message of the multiple network element of simulation as claimed in claim 4, it is characterized in that, described by rawsocket send function described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message and specifically comprise:
Obtain the socketid sending rawsocket;
The cycle of Snmptrap message is sent according to the described analogue network element of user's input, use described socketid that described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message.
6. simulate a system for the trap message of multiple network element, it is characterized in that, comprising:
Initialization module, for reading the configuration file of network under test management system, to obtain the configuration parameter of described network under test management system;
Act on behalf of generation module, for receiving and preserving the command parameter that user inputted by pseudo-terminal, read MAC Address and the IP address of described pseudo-terminal simultaneously, and generate MAC Address and the IP address of analogue network element according to the MAC Address of described command parameter and described pseudo-terminal and IP address according to pre-defined rule;
Depacketize module, assembles the Snmptrap message of described analogue network element for adopting rawsocket programming technique according to the configuration parameter of described network under test management system and the MAC Address of described analogue network element and IP address;
Message sending module, being sent to described network under test management system for sending function by rawsocket by described Snmptrap message, carrying out performance test to make described network under test management system according to described Snmptrap message.
7. the system of the trap message of the multiple network element of simulation as claimed in claim 6, is characterized in that, described initialization module specifically for:
Read the configuration file of described network under test management system, to obtain and to preserve the version number of the snmp protocol that the MAC Address of described network under test management system, IP address and described network under test management system adopt, community and Snmptrap Variable-Bindings pair.
8. the system of the trap message of the multiple network element of simulation as claimed in claim 7, it is characterized in that, described generation module of acting on behalf of specifically comprises:
User input unit, for the number of analogue network element needed for the input prompt information input user of described pseudo-terminal and the cycle of analogue network element transmission Snmptrap message, reads MAC Address and the IP address of described pseudo-terminal simultaneously;
Analogue network element MAC Address generation unit, for with the number of analogue network element needed for user in described command parameter for the upper limit, with the MAC Address of described pseudo-terminal for plot, the cumulative MAC Address obtaining analogue network element, and the MAC Address of described analogue network element is saved in analogue network element information list;
Analogue network element IP scalar/vector, for with the number of analogue network element needed for user in described command parameter for the upper limit, with the IP address of described pseudo-terminal for plot, the cumulative IP address obtaining analogue network element, and the IP address of described analogue network element is saved in described analogue network element information list.
9. the system of the trap message of the multiple network element of simulation as claimed in claim 8, it is characterized in that, described depacketize module specifically comprises:
Rawsocket unit, for creating rawsocket, and arranges the option of socket in rawsocket, the IP packet header of the data that will send to make rawsocket manual handle;
Module units, for assembling the ETH head of the Snmptrap message of described analogue network element, IP head, UDP head and SNMP message body according to the MAC Address of analogue network element in the MAC Address of described network under test management system and IP address and described analogue network element information list and IP address.
10. the system of the trap message of the multiple network element of simulation as claimed in claim 9, it is characterized in that, described message sending module specifically comprises:
Socketid acquiring unit, for obtaining the socketid sending rawsocket;
Transmitting element, described analogue network element for inputting according to user sends the cycle of Snmptrap message, use described socketid that described Snmptrap message is sent to described network under test management system, carry out performance test to make described network under test management system according to described Snmptrap message.
CN201510504588.9A 2015-08-17 2015-08-17 A kind of method and system of the trap message of the multiple network elements of simulation Expired - Fee Related CN105207803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510504588.9A CN105207803B (en) 2015-08-17 2015-08-17 A kind of method and system of the trap message of the multiple network elements of simulation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510504588.9A CN105207803B (en) 2015-08-17 2015-08-17 A kind of method and system of the trap message of the multiple network elements of simulation

Publications (2)

Publication Number Publication Date
CN105207803A true CN105207803A (en) 2015-12-30
CN105207803B CN105207803B (en) 2018-09-21

Family

ID=54955256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510504588.9A Expired - Fee Related CN105207803B (en) 2015-08-17 2015-08-17 A kind of method and system of the trap message of the multiple network elements of simulation

Country Status (1)

Country Link
CN (1) CN105207803B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106357457A (en) * 2016-10-31 2017-01-25 瑞斯康达科技发展股份有限公司 Warning test method, warning test apparatus and warning test system
CN111447302A (en) * 2020-03-30 2020-07-24 山东华辰连科通信网络有限公司 Method and system for simulating multi-client to test DHCP (dynamic host configuration protocol) by using raw socket
CN111815146A (en) * 2020-07-02 2020-10-23 上海微亿智造科技有限公司 Quality inspection machine simulation test data method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1773941A (en) * 2004-11-11 2006-05-17 中兴通讯股份有限公司 Performance test method and apparatus for identification service
CN1992635A (en) * 2005-12-27 2007-07-04 中兴通讯股份有限公司 Method of simulating SNMP network element and performing network management system test with the network element
CN102740342A (en) * 2012-06-08 2012-10-17 大唐移动通信设备有限公司 Network management equipment performance simulation test method and system
US20130145482A1 (en) * 2011-11-16 2013-06-06 Flextronics Ap, Llc Vehicle middleware

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1773941A (en) * 2004-11-11 2006-05-17 中兴通讯股份有限公司 Performance test method and apparatus for identification service
CN1992635A (en) * 2005-12-27 2007-07-04 中兴通讯股份有限公司 Method of simulating SNMP network element and performing network management system test with the network element
US20130145482A1 (en) * 2011-11-16 2013-06-06 Flextronics Ap, Llc Vehicle middleware
CN102740342A (en) * 2012-06-08 2012-10-17 大唐移动通信设备有限公司 Network management equipment performance simulation test method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106357457A (en) * 2016-10-31 2017-01-25 瑞斯康达科技发展股份有限公司 Warning test method, warning test apparatus and warning test system
CN106357457B (en) * 2016-10-31 2019-10-25 瑞斯康达科技发展股份有限公司 A kind of alarm test method, apparatus and system
CN111447302A (en) * 2020-03-30 2020-07-24 山东华辰连科通信网络有限公司 Method and system for simulating multi-client to test DHCP (dynamic host configuration protocol) by using raw socket
CN111447302B (en) * 2020-03-30 2022-12-27 山东华辰连科通信网络有限公司 Method and system for simulating multi-client to test DHCP (dynamic host configuration protocol) by using raw socket
CN111815146A (en) * 2020-07-02 2020-10-23 上海微亿智造科技有限公司 Quality inspection machine simulation test data method and system

Also Published As

Publication number Publication date
CN105207803B (en) 2018-09-21

Similar Documents

Publication Publication Date Title
Kirichek et al. Internet of things laboratory test bed
CN105335293B (en) A kind of automatization test system and method based on interface concurrent
JP5462905B2 (en) Protocol emulator
JP4991124B2 (en) Distributed data model
WO2015113450A1 (en) Method and apparatus for visualized operation and maintenance of network
CN105577463B (en) A kind of test method and its device based on communication protocol
CN109726128A (en) A kind of method for generating test case, device and server
US11150896B2 (en) Automated generation of service definitions for message queue application clients
CN104484267B (en) One kind test system and method
US9591510B2 (en) Systems and methods to create message traffic
CN114553752B (en) Network performance test method and device based on simulation software and computer equipment
US20160173349A1 (en) Simulator for testing a gateway device
CN106921578A (en) The generation method and device of a kind of forwarding-table item
CN105207803A (en) Method for simulating trap messages of multiple network elements and system
US20180115492A1 (en) Analysis device for the analysis and manipulation of a communication sequence
CN111698110B (en) Network equipment performance analysis method, system, equipment and computer medium
CN104852955A (en) Data processing method and system
US9329960B2 (en) Methods, systems, and computer readable media for utilizing abstracted user-defined data to conduct network protocol testing
CN105991353A (en) Fault location method and device
US9819741B1 (en) Device for sensor simulation using constrained application protocol
CN110825538A (en) MQ-based method for dynamically interacting data by self-defining data types
US9172607B2 (en) Transmitting of configuration items within a network
Verma A comparison of web framework efficiency: performance and network analysis of modern web frameworks
Catal et al. Visualization of traffic flows in a simulated network environment to investigate abnormal network behavior in complex network infrastructures
CN112527453B (en) Virtualization information simulation system, method and computer-readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518000 Guangdong city of Shenzhen province Baoan District Xixiang Bao Tian Yi Lu Chen Tian Industrial District 37 Building 1 floor

Applicant after: CHINA COMMUNICATION TECHNOLOGY Co.,Ltd.

Applicant after: CHINA COMMUNICATION SOFTWARE INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 518000 Guangdong city of Shenzhen province Baoan District Xixiang Bao Tian Yi Lu Chen Tian Industrial District 37 Building 1 floor

Applicant before: CHINA COMMUNICATION TECHNOLOGY Co.,Ltd.

Applicant before: CHINA COMMUNICATION SOFTWARE INFORMATION TECHNOLOGY Co.,Ltd.

COR Change of bibliographic data
C41 Transfer of patent application or patent right or utility model
CB02 Change of applicant information

Address after: 518000 Guangdong city of Shenzhen province Baoan District Xixiang Bao Tian Yi Lu Chen Tian Industrial District 37 Building 1 floor

Applicant after: CHINA COMMUNICATION TECHNOLOGY Co.,Ltd.

Applicant after: HUAXUN ARK INTELLIGENCE INFORMATION TECHNOLOGY (SHENZHEN) CO.,LTD.

Address before: 518000 Guangdong city of Shenzhen province Baoan District Xixiang Bao Tian Yi Lu Chen Tian Industrial District 37 Building 1 floor

Applicant before: CHINA COMMUNICATION TECHNOLOGY Co.,Ltd.

Applicant before: CHINA COMMUNICATION SOFTWARE INFORMATION TECHNOLOGY Co.,Ltd.

COR Change of bibliographic data
TA01 Transfer of patent application right

Effective date of registration: 20161230

Address after: 518000 Guangdong city of Shenzhen province Baoan District Xixiang Bao Tian Yi Lu Chen Tian Industrial District 37 Building 1 floor

Applicant after: CHINA COMMUNICATION TECHNOLOGY Co.,Ltd.

Address before: 518000 Guangdong city of Shenzhen province Baoan District Xixiang Bao Tian Yi Lu Chen Tian Industrial District 37 Building 1 floor

Applicant before: CHINA COMMUNICATION TECHNOLOGY Co.,Ltd.

Applicant before: HUAXUN ARK INTELLIGENCE INFORMATION TECHNOLOGY (SHENZHEN) CO.,LTD.

GR01 Patent grant
GR01 Patent grant
PP01 Preservation of patent right

Effective date of registration: 20210630

Granted publication date: 20180921

PP01 Preservation of patent right
PD01 Discharge of preservation of patent

Date of cancellation: 20230421

Granted publication date: 20180921

PD01 Discharge of preservation of patent
TR01 Transfer of patent right

Effective date of registration: 20230721

Address after: 518000 404, building 37, chentian Industrial Zone, chentian community, Xixiang street, Bao'an District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Huaxun ark Photoelectric Technology Co.,Ltd.

Address before: 518000 1st floor, building 37, chentian Industrial Zone, Baoan District, Shenzhen City, Guangdong Province

Patentee before: CHINA COMMUNICATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180921

CF01 Termination of patent right due to non-payment of annual fee