Summary of the invention
Main purpose of the present invention is to provide a kind of method of SNMP NE and SNMP NE and proprietary protocol net element communication, cannot be directly and the problem that communicates of proprietary protocol network element at least to solve SNMP NE in prior art.
According to an aspect of the present invention, provide a kind of method of SNMP NE and proprietary protocol net element communication, it comprises: SNMP agency receives the snmp protocol request message that snmp management station sends; Above-mentioned snmp protocol request message is adapted to proprietary protocol request message by above-mentioned SNMP agency; Above-mentioned proprietary protocol request message is sent to proprietary protocol network element by above-mentioned SNMP agency.
Further, after above-mentioned proprietary protocol request message is sent to proprietary protocol network element by above-mentioned SNMP agency, also comprise: above-mentioned proprietary protocol network element sends the proprietary protocol response message in response to above-mentioned proprietary protocol request message to above-mentioned SNMP agency; Above-mentioned SNMP acts on behalf of the mark of the above-mentioned snmp protocol request message carrying according to above-mentioned proprietary protocol response message and finds the local above-mentioned snmp protocol request message of preserving; Above-mentioned proprietary protocol response message is adapted to above-mentioned snmp protocol response message by above-mentioned SNMP agency; Above-mentioned snmp protocol response message is sent to above-mentioned snmp management station by above-mentioned SNMP agency.
Further, after above-mentioned SNMP agency receives the snmp protocol request message of snmp management station transmission, also comprise: above-mentioned SNMP agency obtains the MIB nodal information corresponding with above-mentioned snmp protocol request message; Above-mentioned SNMP agency judges that according to obtained MIB nodal information above-mentioned snmp protocol request message is carried out to synchronous processing still carries out asynchronous process; In the time judging execution asynchronous process, above-mentioned SNMP agency carries out the step that above-mentioned snmp protocol request message is adapted to proprietary protocol request message.
Further, when above-mentioned snmp protocol request message is adapted to proprietary protocol request message by above-mentioned SNMP agency, also comprise: above-mentioned SNMP agency obtains the MIB nodal information corresponding with above-mentioned snmp protocol request message; Above-mentioned SNMP agency registers the command code of above-mentioned proprietary protocol according to obtained MIB nodal information; The asynchronous process interface that above-mentioned SNMP agency of trademark registration is corresponding with the command code of above-mentioned proprietary protocol; Above-mentioned SNMP agency of trademark registration is preserved above-mentioned snmp protocol request message on above-mentioned asynchronous process interface.
Further, the mark that above-mentioned SNMP acts on behalf of the above-mentioned snmp protocol request message carrying according to above-mentioned response message is found the local above-mentioned snmp protocol request message of preserving and is comprised: above-mentioned SNMP agency obtains the asynchronous process interface corresponding to command code of the proprietary protocol carrying with above-mentioned response message; Above-mentioned SNMP agency searches the above-mentioned snmp protocol request message corresponding with the mark of above-mentioned snmp protocol request message on the asynchronous process interface obtaining.
Further, above-mentioned proprietary protocol network element comprises: proprietary protocol agency and/or proprietary protocol sub agent.
According to a further aspect in the invention, provide a kind of SNMP NE, having comprised: the first receiver module, the snmp protocol request message sending for receiving snmp management station; The first adaptation module, for being adapted to proprietary protocol request message by above-mentioned snmp protocol request message; The first sending module, for sending to proprietary protocol network element by above-mentioned proprietary protocol request message.
Further, above-mentioned SNMP NE also comprises: the second receiver module, the proprietary protocol response message in response to above-mentioned proprietary protocol request message sending for above-mentioned proprietary protocol network element; Search module, find the local above-mentioned snmp protocol request message of preserving for the mark of the above-mentioned snmp protocol request message that carries according to above-mentioned proprietary protocol response message; The second adaptation module, for being adapted to above-mentioned snmp protocol response message by above-mentioned proprietary protocol response message; The second sending module, for sending to above-mentioned snmp management station by above-mentioned snmp protocol response message.
Further, above-mentioned SNMP NE also comprises: acquisition module, for after receiving the snmp protocol request message of snmp management station transmission, obtains the MIB nodal information corresponding with above-mentioned snmp protocol request message; Judge module, for judging that according to obtained MIB nodal information above-mentioned snmp protocol request message is carried out to synchronous processing still carries out asynchronous process; Notification module, in the time judging execution asynchronous process, notifies above-mentioned the first adaptation module that above-mentioned snmp protocol request message is adapted to proprietary protocol request message.
Further, above-mentioned proprietary protocol network element comprises: proprietary protocol agency and/or proprietary protocol sub agent.
The present invention has following beneficial effect:
1) act on behalf of snmp protocol message and proprietary protocol message are carried out to adaptation by SNMP, thereby can between SNMP NE and proprietary protocol network element, communicate.
2) by the adaptation between asynchronous process Interface realization snmp protocol message and proprietary protocol message, avoid under synchronous processor system the correctly defect of obtaining communication message, thereby greatly improve the development efficiency of SNMP agent software, shorten development process, save development cost, there is applicability widely.
Embodiment
Hereinafter also describe the present invention in detail with reference to accompanying drawing in conjunction with the embodiments.It should be noted that, in the situation that not conflicting, the feature in embodiment and embodiment in the application can combine mutually.
Fig. 2 is according to the flow chart of the method for the SNMP NE of the embodiment of the present invention and proprietary protocol net element communication.As shown in Figure 2, comprise the steps: according to the method for the SNMP NE of the embodiment of the present invention and proprietary protocol net element communication
S202, SNMP agency receives the snmp protocol request message that snmp management station sends;
S204, above-mentioned snmp protocol request message is adapted to proprietary protocol request message by above-mentioned SNMP agency;
S206, above-mentioned proprietary protocol request message is sent to proprietary protocol network element by above-mentioned SNMP agency.
In existing technology, SNMP NE cannot be directly and proprietary protocol network element communicate.Review the embodiment of the present invention, act on behalf of snmp protocol message and proprietary protocol message are carried out to adaptation by SNMP, thereby can between SNMP NE and proprietary protocol network element, communicate.
Preferably, after described proprietary protocol request message is sent to proprietary protocol network element by described SNMP agency, described proprietary protocol network element sends the proprietary protocol response message of the described proprietary protocol request message of response to described SNMP agency; Described SNMP acts on behalf of the mark of the described snmp protocol request message carrying according to described proprietary protocol response message and finds the local described snmp protocol request message of preserving; Described proprietary protocol response message is adapted to described snmp protocol response message by described SNMP agency; Described snmp protocol response message is sent to described snmp management station by described SNMP agency.
Preferably, after described SNMP agency receives the snmp protocol request message of snmp management station transmission, described SNMP agency obtains the MIB nodal information corresponding with described snmp protocol request message; Described SNMP agency judges that according to obtained MIB nodal information described snmp protocol request message is carried out to synchronous processing still carries out asynchronous process; In the time judging execution asynchronous process, described SNMP agency carries out the step that described snmp protocol request message is adapted to proprietary protocol request message.
By above-mentioned mode, SNMP has acted on behalf of the slitless connection of snmp stack and proprietary protocol stack, like this, can select according to the actual requirements request message synchronously to process or asynchronous process, thereby increase the applicability of the embodiment of the present invention.
When described snmp protocol request message is adapted to proprietary protocol request message by described SNMP agency, described SNMP agency obtains the MIB nodal information corresponding with described snmp protocol request message; Described SNMP agency registers the command code of described proprietary protocol according to obtained MIB nodal information; The asynchronous process interface that described SNMP agency of trademark registration is corresponding with the command code of described proprietary protocol; Described SNMP agency of trademark registration is preserved described snmp protocol request message on described asynchronous process interface.
By the adaptation between asynchronous process Interface realization snmp protocol message and proprietary protocol message, avoid under synchronous processor system the correctly defect of obtaining communication message, thereby greatly improve the development efficiency of SNMP agent software, shorten development process, save development cost, there is applicability widely.
The mark that described SNMP acts on behalf of the described snmp protocol request message carrying according to described response message is found the local described snmp protocol request message of preserving and is comprised: described SNMP agency obtains the asynchronous process interface corresponding to command code of the proprietary protocol carrying with described response message; Described SNMP agency searches the described snmp protocol request message corresponding with the mark of described snmp protocol request message on the asynchronous process interface obtaining.
Preferably, described proprietary protocol network element comprises: proprietary protocol agency and/or proprietary protocol sub agent.Like this, in embodiments of the present invention, not only can realize communicating by letter between SNMP NE and proprietary protocol agency, can also further realize communicating by letter between SNMP NE and proprietary protocol sub agent, thereby expand the scope of application of the present invention.
Fig. 3 is according to the schematic diagram of the interacting message between the snmp management station of the embodiment of the present invention and SNMP agency and proprietary protocol network element.As shown in Figure 3, SNMP agency can with proprietary protocol agent communication, also can further communicate by letter with proprietary protocol sub agent.
Describe in detail according to the preferred flow charts of the method for the SNMP NE of the embodiment of the present invention and proprietary protocol net element communication below in conjunction with accompanying drawing.As shown in Figure 4, comprise the following steps according to the method for the SNMP NE of the embodiment of the present invention and proprietary protocol net element communication:
Step S402:SNMP management station sends request message to SNMP agent side, then performs step S404.Snmp management station receives response message or the TRAP trap message of SNMP agent side to association requests.
Step S404:SNMP reception task is responsible for receiving the request message of network management workstation, and forwards downwards, execution step S406.
Step S406:SNMP consultative management station and agency rely on MIB management information bank to carry out interacting message, and SNMP agency generates inner discernible MIB nodal information according to MIB management holder.SNMP acts on behalf of after the request of receiving management station, searches relevant MIB nodal information, and can judge and need synchronous processing or asynchronous process according to the relevant field in MIB nodal information (information of static registration, fills in identification field).Synchronous or the asynchronous process of MIB node is customized according to different device systems by SNMP agency, execution step S408.
Step S408: distinguish different operating processes according to the identification field in MIB nodal information, if synchronously process, perform step S416; If asynchronous process performs step S410.
Step S410: call the integrated asynchronous process interface of snmp stack, (Main Function of mapping function is message conversion, the adaptation between treatment S NMP agreement and proprietary protocol to generate mapping function according to MIB nodal information-command code.Especially, mapping function is not only the adaptation of data field, also should comprise other information, to reach and originally to use proprietary protocol to process identical follow-up processing flow).Snmp stack only provides corresponding interface, the registration of interface can configuration file dynamic load or in program static registration.The specific implementation of interface, comprises and need to realize the adaptation of message data field separately, execution step S412.
Step S412: the request message issuing according to snmp management station, register the asynchronous node of replying (integrated in snmp stack, the line asynchronous of going forward side by side is replied the management of node chained list), identify each SNMP datagram by the Request id field of the PDU in snmp protocol, execution step S414.
Step S414: complete the adaptation between snmp protocol message and proprietary protocol message, downward message can be consistent with former proprietary protocol system.Following flow process is generally proprietary protocol system operating process, and different equipment may use different proprietary protocols, execution step S420.
Step S416: call the synchronous Processing Interface of snmp stack (normal flow), according to the request at snmp management station, inquire about or arrange related data in the storage mediums such as internal memory or SD card.Execution step S418.
Step S418: preserve equipment operating data in internal memory or database medium.The system of being used for such as inquires about or arranges at the operation.
Step S420: proprietary protocol sub agent system, realizes the management function of the network equipment, as functions such as configuration management, fault management, performance managements.
Step S422: after sub agent is replied, complete the adaptation between proprietary protocol message and snmp protocol message.Preferably, process the conversion of proprietary protocol message and snmp protocol message, adaptation according to MIB nodal information-command code mapping function.Then, execution step S424.
Step S424: search original SNMP request message asynchronous in replying node chained list according to the Request id field of the response message of sub agent.It is asynchronous that what reply node is mainly can correctly find original message in order to realize sub agent after replying, reply with the management station to SNMP, its major function has snmp protocol to reply management, and (encapsulation snmp stack is replied interface, to snmp management station response operation result), overtime management (prevents sub agent unresponsive situation always, prevent redundant data terminate-and-stay-resident, report overtime, abnormal in the mode of TRAP trap), asynchronous insertion of replying node, modification, deletion etc.
Step S426: judge whether to find original SNMP request message according to Request ID, if found, perform step S428; If do not found, perform step S430.
Step S428: according to the source address in original SNMP message, SNMP response message is sent to SNMP and send task queue, execution step S432.
Step S430: structure TRAP trap message, sends to SNMP by SNMP operation overtime information and send task queue.Execution step S432.
Step S432:SNMP sends task, is mainly used in to snmp management station response operation result or reports TRAP trap.Preferably, again perform step S402.
By above step, under the cooperation of snmp management station, SNMP agency and proprietary protocol agency/sub agent, use Asynchronous Invocation between agreement, can improve greatly the development efficiency of SNMP agent software, shorten development process, save development cost, there is applicability widely.
The present invention also provides a kind of embodiment of SNMP NE, and this SNMP NE is applicable to said method embodiment.
Fig. 5 is according to the structural representation of the SNMP NE of the embodiment of the present invention.As shown in Figure 5, comprise according to the SNMP NE of the embodiment of the present invention: the first receiver module 502, the snmp protocol request message sending for receiving snmp management station; The first adaptation module 504, for being adapted to proprietary protocol request message by above-mentioned snmp protocol request message; The first sending module 506, for sending to proprietary protocol network element by above-mentioned proprietary protocol request message.
In embodiments of the present invention, act on behalf of snmp protocol message and proprietary protocol message are carried out to adaptation by SNMP, thereby can between SNMP NE and proprietary protocol network element, communicate.
Preferably, above-mentioned SNMP NE also comprises: the second receiver module 508, the proprietary protocol response message in response to above-mentioned proprietary protocol request message sending for above-mentioned proprietary protocol network element; Search module 510, find the local above-mentioned snmp protocol request message of preserving for the mark of the above-mentioned snmp protocol request message that carries according to above-mentioned proprietary protocol response message; The second adaptation module 512, for being adapted to above-mentioned snmp protocol response message by above-mentioned proprietary protocol response message; The second sending module 514, for sending to above-mentioned snmp management station by above-mentioned snmp protocol response message.
In embodiments of the present invention, by the adaptation between asynchronous process Interface realization snmp protocol message and proprietary protocol message, avoid under synchronous processor system the correctly defect of obtaining communication message, thereby greatly improve the development efficiency of SNMP agent software, shorten development process, save development cost, there is applicability widely.
Preferably, above-mentioned SNMP NE also comprises: acquisition module 516, for after receiving the snmp protocol request message of snmp management station transmission, obtains the MIB nodal information corresponding with above-mentioned snmp protocol request message; Judge module 518, for judging that according to obtained MIB nodal information above-mentioned snmp protocol request message is carried out to synchronous processing still carries out asynchronous process; Notification module 520, in the time judging execution asynchronous process, notifies above-mentioned the first adaptation module 504 that above-mentioned snmp protocol request message is adapted to proprietary protocol request message.
By above-mentioned mode, can select according to the actual requirements request message synchronously to process or asynchronous process, thereby increase the applicability of the embodiment of the present invention.
Preferably, above-mentioned proprietary protocol network element comprises: proprietary protocol agency and/or proprietary protocol sub agent.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on the network that multiple calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in storage device and be carried out by calculation element, and in some cases, can carry out shown or described step with the order being different from herein, or they are made into respectively to each integrated circuit modules, or the multiple modules in them or step are made into single integrated circuit module to be realized.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.