• With realizes - en.51rd.net based on monolithic integrated circuit’s embedded SNMP agent design

    0 introductions
     
        SNMP (simple network management protocol) applies widely, the function is formidable, so long as the management software presence has MIB (management database), and has the suitable jurisdiction, the supervisor may visit the SNMP agent. SNMP used in the computer network and the telecommunication network generally, this article proposed carried on the control with SNMP. Because its transmission medium is Internet, therefore the transmitting range does not receive limits, this is opposite in other industrial control main line has the incomparable superiority, the SNMP biggest merit is the agreement is succinct, suits the embedded application. SNMP system extendibility, so long as new MIB will load on the management software may realize visit to the new terminal control and, this article introduced one kind realizes the embedded agent’s plan based on the inexpensive micro controller, realizes by the microprocessor core is related the hardware and the software.

    1 SNMP architecture

        The SNMP architecture (see Figure 1) take the simple inquiry/reply model as the foundation, the transmission inquiry user is the superintendent, the SNMP server (agent) replies the inquiry.

        SNMP belongs to the application layer agreement in the TCP/IP system. In order to realize the SNMP system, must realize from the application layer the agreement which must use to the physical level, the supervisor on PC machine, the agent is in monitors the scene, the agent presence in by management system management system’s MIB, we realize the embedded agent take the monolithic integrated circuit as the core, the embedded agent must the data which gathers to the scene carry on the analysis, if has the unusual circumstance occurrence, through transmits the Trap text to give the supervisor, informs the network management to have the unusual circumstance occurrence, also has the unusual circumstance related information in the text, the network management may act according to this information to carry on corresponding processing, in some situations, agent data storage, prepares the supervisor the inquiry.

    2 embedded agent’s hardware realize

        We design see Figure based on the SNMP control system principle 2.

        Controls the scene signal gathering to transform the module input monolithic integrated circuit by A/D. The monolithic integrated circuit carries on processing to the signal, and carries out the SNMP agent’s task, the hardware part mainly includes modules and so on A/D, serial port, ethernet, small logic, monolithic integrated circuit, supervisory signal gathering, power source and monitoring, this article introduces and the embedded SNMP agent close related part emphatically.

    2.1 serial port modules

        What the monolithic integrated circuit uses is the TTL level, but the RS-23 agreement uses the level is different, therefore needs to carry on the level switch, realizes the level switch through MAX232.

    2.2 A/D modules

        A/D module primary cognizance gathers the exterior supervisory signal, uses AD0809 to be possible to gather 8 channel’s data, the signal change dynamirange is not big, uses this characteristic, establishes the reference voltage reasonably, may raise the resolution, thus realizes the very good performance with the inexpensive component, the ADC0809 two reference voltage may through the potentiometer adjustment, for guarantee system’s precision, the reference voltage probably stabilize, for this reason uses MAXIM MAX875 to take the reference potential source. Moreover what needs to pay attention: Inputs to a/D switch’s reference voltage after potentiometer’s differential pressure, to cause the reference voltage to be stable, must select the high accuracy, the high stable potentiometer.

    2.3 ethernet modules

        The ethernet module realizes with ethernet’s correspondence, uses RealTek the RTL8019 chip to realize.

        RTL8919A (see Figure 3) to have 3 workings: Jumps the line way, network card’s I/O and the interrupt by jumps the line decision; Namely inserts namely uses the way, carries on by the software disposes plug and play automatically; Passes the line way, network card’s I/O and the interrupt by in the external connection 93C46 content decision.

        The RTL8019AS pin 65 (JP) had decided network card’s working, the pin 65 feet (JP) inputs the pin, when pin 65 for low level, 8019 work in namely insert namely or pass the line way with the way, makes concrete the content decided by 93C46, in embedded application, if may not use 93C46, then may reduce the cost, simultaneously reduces the segment, we 65 meet the pin the high level (VCC), the use jumps the line way. Then, network card’s I/O and the interrupt are not decided by the 93C46 content that this does not need to use 93C46.

        The pin 64 (AUI) decided that uses AUI or the BNC connection. The BNC connection way supports 8 twisted pair lines or the coaxial cable. When high level uses the AUI connection; Hanging is the low level, uses the BNC connection. We use BNC generally, is hanging this pin.
    The network interface type by the pin 74 (PL0), the pin 77 (PL1) decided. PL0, PL1 are hanging, the choice automatic detection pattern, the chip automatic detection interface type is with the coaxial cable or the twisted pair line, then carries on the work.

        RTL89 IOCS16 is 16 I/O choice pins. When on network card electricity replacement, this pin for network card’s input, if this pin is the high level, the network card will choose 16 patterns, if this pin is the low level, the network card will choose 8 patterns, 51 monolithic integrated circuits are 8 bit data, therefore pulls with resistance R10, therefore in replacement time this pin is the low level, the network card chooses 8 patterns.

        AD0-AD7 is network card’s 8 bit data main line, meets monolithic integrated circuit’s P0 mouth, RESDRV (the pin 33 (RESET)) meets monolithic integrated circuit’s T0 (P3.4), the monolithic integrated circuit repositions the network card with P3.4. IRQ9 meets monolithic integrated circuit’s INT0 (P3.2), IRQ9 is network card’s interrupt 9, receives monolithic integrated circuit’s interrupt on 0, IOR, IOW receives monolithic integrated circuit’s P3.6, P3.7 (/WR,/R).

    2.4 small logic modules

        The small logic module mainly realizes some logical function, a/D clock by monolithic integrated circuit’s ALE signal 8 frequency divisions, each exterior component selects patches or strips of land as worth saving for seed the function to realize by the small logic module, although the function is not complex, if realizes with the small logical component, needs many components, the component use factor is low, occupies the big space on the circuit wafer, with request volume small embedded application contradictory. Uses the programmable logical component to be possible to solve these problems.

    2.5 monolithic integrated circuit modules

        The monolithic integrated circuit module by the monolithic integrated circuit as well as the replacement and the watch-dog electric circuit, exterior expands peripheral circuit constitutions and so on RAM, clock circuit, the watch-dog electric circuit may enhance the scene extreme condition the disturbance, when the system receives the procedure which the external interference causes monolithic to record to run flies, the watch-dog has not fed the dog signal, the watch-dog electric circuit the monolithic integrated circuit and the RTL8019 replacement, makes a fresh start to move.

    3 software designs with realize

        Because SNMP arranges the decoding to need to take many CPU time, and must realize a/D data acquisition on the monolithic integrated circuit to transform, functions and so on ethernet correspondence, serial port correspondence, this causes to be coordinated each function to be difficult, therefore, we select Micro-C/OS51 to take monolithic integrated circuit’s operating system, Micro-C/OS51 is embedded real-time operating system Micro-C/OS on 51 monolithic integrated circuit’s transplant codes, the real time system can enhance CPU well the efficiency, and is the multi-duty system, can coordinate many duties, we monolithic confidential will realize the function divides into the man-machine interaction duty, a/D processing duty and the SNMP processing duty.
     
    3.1 man-machine interaction duty

        The man-machine interaction duty is realizes through monolithic integrated circuit’s serial port with user’s interaction, the user through the serial port cable PC machine and monolithic integrated circuit’s serial port connection, may use the command line through the PC machine super terminal the way to agent’s related parameter (gateway address, host address and so on) to carry on the disposition, but may also observe the related movement information, the main command line includes:

    Host disposition this aircraft IP address

    Gateway disposition gateway address

    Mask disposition subnet mask

    Snmphost disposes SNMP the supervisor IP address

    Macadr disposition this aircraft physical address

    ping may use this order to examine the network link

    clear elimination telephone display monitor’s content

        The man-machine interaction duty realizes the main mentality is the monolithic integrated circuit receive user keyboard entry character stores the command buffer, and returns obviously arrives at the screen, when the user presses down the carriage return key, triggers the software state machine condition vicissitude, from the input condition shift to the order explanation condition, then transfers the related subroutine execution related operation according to the user command, after the execution finished, returns the input condition.

        The man-machine interaction procedure by the vocabulary, takes the word subroutine, the state machine frame procedure (to input obviously with order explanation execution) orders the related subroutine to be composed, the vocabulary is the command statement set, takes the word subroutine to obey orders issues an order in the sentence to withdraw word coexisting to enter the vocabulary, simultaneously carries on the match inspection and the lexical analysis, inputs the explicit program cycle check user keyboard entry, the command interpreter transfer takes the word subroutine analysis user command line input, according to the vocabulary 1st word, in disperses transfers in the table the position to transfer carries out the subroutine processing order correspondingly, the command interpreter spreads to the vocabulary indicator to the corresponding order related subroutine, the concrete execution decided voluntarily by the user, is related by the orderAfter capital procedure returns, returns the command input condition, completes an input to carry out the entire process, this process again and again looping execution.

    3.2 A/D processing duty

        A/D transformation requires certain time, reads the result which A/D transforms to have 3 ways:

        a) uses the interrupt mode, reads the data to be prompt, simultaneously the frequent interrupt processing increased the CPU burden.

        b) inquires the way, creates the CPU time the waste, cut the CPU efficiency greatly;

        c) waits for the way, looks like does not have the merit, but in the UC/OS51 operating system, to a task scheduling’s very important thought is a time delay, after high priority task execution period of time, again time delay period of time, so that the low priority’s task execution, like this will wait for the time puts to a/D processing duty time delay time, may play the role which answers multiple purpose, we select this method.

    3.3 SNMP processing duty

        After receiving the UDP data packet, processes the UDP masthead, by function udp_recv () processes the SNMP data packet. Its basic philosophy is: Decodes the SNMP news, if decodes correctly, judges this Community (community) whether to have carries on the solicit operation jurisdiction, if does not have the jurisdiction, then abandons this text, and transmits the Trap text for the supervisor. If the jurisdiction is correct, searches the object which from the agent on MIB table requested. After finding, the execution corresponding operation, simultaneously produced the response text. Then carries on the SNMP code, if codes unmistakably, gives on a protocol processing this SNMP text, the SNMP processing flow see Figure 4.

        In the SNMP treating processes, the SNMP code and the decoding are essential, take decodes as regularly explained that decodes the SNMP text to use SNMP the edition number, the community number which the text uses, the edition number, had indicated the text uses SNMP the edition, if the supervisor and the agent use agreement’s edition is different, will not be able to correspond normally, the community is equal to the key, only then had key’s supervisor only then to be able to visit the agent, otherwise, the agent did not give the response, PDU decodes the object which the tube must visit, the SNMP decoding flow chart see Figure 5.

        In flow chart snmpDec () the function decodes the SNMP function text, the useful information extraction, MibRequest () the function function will be is resident OID which searches in embedded SNMP agent MIB decodes (object identifier), after searching OID, simultaneously obtained this object information, the code simultaneously started to carry on, MibCmpObjId () the function function was uses the comparison the way search table item. SnmpEnc () the function will obtain the response text codes the SNMP text according to the SNMP coding rule. make_udp () function SNMP text seal in the UDP text. Again after IP agreement seal, after ethernet agreement seal, may through the ethernet transmission.

    4 concluding remark

        We use in this system the light wireless communication the network management and the supervisory system. After process use, discovered: This system can the real-time monitoring light wireless communication system’s movement, because uses the Internet transmission data, therefore the transmitting range does not receive limits, SNMP is applies the most widespread network management agreement and realizes the embedded SNMP agent, may cause the light wireless communication system’s management to join very conveniently to the existing network management system, because uses the inexpensive monolithic integrated circuit to realize the embedded SNMP agent, the main protocol processing realizes by the software, the cost is very low.

    Share/Save/Bookmark

No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
TOP
Copyright © 2008 51 Research and Design, Electronic Engineers website - Embedded Systems, MCU, DSP, EDA, Test and Measurement, Components, Communications, Power, Microelectronics, Semiconductors
Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3