Summary of the invention
Main purpose of the present invention is: the deficiency that overcomes prior art; Provide and realize internal mac address and IP address dynamic assignment in a kind of local area network (LAN); Guarantee some networking modules not with the same LAN environment of Internet connection in normally operation, realize method and apparatus simultaneously to inquiry in real time of some networking modules and dynamic monitoring.
Technical problem of the present invention solves through following technical scheme: a kind of local area network building method; Specifically may further comprise the steps: the backstage obtains the individual information of each networking module Mn; And be that according to individual information each networking module Mn distributes internal mac address and IP address; And structure broadcast data packet, wherein n >=1; Each networking module Mn receives and resolves said broadcast data packet, and carries out network configuration according to internal mac address and IP address that correspondence is distributed, accomplishes between configuration back and the backstage connecting.
This broadcast data packet is special MAC packet, and in order to receive any MAC packet, promiscuous mode is supported and selected to each networking module Mn.This individual information is bar code or identification code in this example, and individual information deposits said backstage in through scanner or keyboard.
Under the situation of a plurality of networking modules, said broadcast data packet is broadcast to each networking module Mn through switching network, and networking module Mn is resolved the address, backstage and set up communication according to broadcast data packet and connects.
On the networking foundation of local area network (LAN); The invention still further relates to a kind of local area network (LAN) dynamic monitoring and controlling method; Specifically may further comprise the steps: the backstage obtains the individual information of each networking module Mn; And be that according to individual information each networking module Mn distributes internal mac address and IP address, and structure broadcast data packet, wherein n >=1; Said networking module Mn receives and resolves said broadcast data packet, and carries out network configuration according to internal mac address and IP address that correspondence is distributed, accomplishes between configuration back and the backstage connecting; This backstage is inquired about and dynamic monitoring networking module Mn in real time.
After networking module Mn is accomplished network configuration, the inquiry that the backstage is configured according to networking module Mn IP address allocated structure Query Information.
Said networking module Mn is resolved the IP address on backstage, and to the backstage reporting information.
The invention still further relates to a kind of local area network (LAN) dynamic monitoring device; Comprise monitor portion, switching part and the networking module Mn that is connected with monitor portion through switching part; N >=1 wherein; Said monitor portion is used for obtaining the individual information of each networking module Mn, and is each networking module Mn configuration internal mac address and IP address according to individual information, and the structure broadcast data packet; Said switching part is used for said broadcast data packet is broadcast to each networking module Mn; Each networking module Mn is used for resolving the communication that broadcast data packet is accomplished network configuration and foundation and monitor portion, and said monitor portion also is used for some networking module Mn are inquired about and monitored.
The present invention's beneficial effect compared with prior art is: 1) local area network building method of the present invention; In order to ensure the uniqueness of MAC Address in network environment; The local area network (LAN) of being organized not with Internet connection; Backstage in the local area network (LAN) is distributed internal mac address and IP address according to individual information for each networking module Mn, and the structure broadcast data packet, and networking module Mn receives, resolves said broadcast data packet; And carry out network configuration according to internal mac address and IP address that correspondence is distributed; Accomplish between configuration back and the backstage and set up communication, thereby realize the internal mac address dynamic assignment of networking module Mn in batches, guarantee the some normal operations of networking module Mn in the consolidated network environment of not disposing global MAC Address simultaneously; 2) local area network (LAN) dynamic monitoring and controlling method of the present invention distributes on the backstage under the prerequisite of internal mac address and the networking of IP address, and this backstage is inquired about and dynamic monitoring networking module Mn simultaneously in real time; 3) local area network (LAN) dynamic monitoring device of the present invention; Setting up communication between this monitor portion (that is backstage) and the some networking module Mn connects; Networking module Mn when receiving the broadcast packet also to the monitor portion reporting message, such as internal mac address, bar code or identification code.
Embodiment
Below through concrete execution mode and combine accompanying drawing that the present invention is explained further details.
The present invention be specifically related to a kind of not with the local area network building method of Internet connection, realize dynamic assignment internal mac address and IP address, guarantee that some networking module Mn with in the same LAN environment of Internet connection are not normally moving.
Also relate to a kind of method and apparatus of on the basis of this local area network (LAN), realizing inquiry in real time of some networking module Mn and dynamic monitoring in this example.
Please refer to Fig. 1 to Fig. 3, the local area network building method in this example, between the network element in the local area network (LAN) through connecting A and being connected B and having set up physical connection.On improvement is to be flexible coupling.
This local area network building method may further comprise the steps:
Backstage (in the device alleged monitor portion L) is that each networking module Mn is distributed internal mac address and IP address according to individual information, and structure broadcast data packet, wherein n >=1;
Said broadcast data packet is broadcast to each networking module Mn through switching network;
Each networking module Mn receives and resolves said broadcast data packet, and carries out network configuration according to internal mac address and IP address that correspondence is distributed, accomplishes between configuration back and the backstage connecting.
At first, deposit in the backstage through scanner or the manual mode of importing bar code or the identification code of several networking modules M1--Mn (n is greater than 1).Here consider no longer how bar code is kept at the production process in the networking module Mn.
Secondly carry out the connection of hardware device according to step shown in Figure 2, in this execution mode, backstage (monitor portion L) produces corresponding internal mac address MAC1-MACn and IP address ip 1-IPn according to the bar code of the M1-Mn of the module of input.Construct special MAC packet then, carry out the transmission of MAC packet through switching network.
The source MAC of MAC packet is the MAC Address of the PC of running background, and target MAC (Media Access Control) address then designs (putting aside VLAN) according to whether launching the Virtual Local Area Network function.The target MAC (Media Access Control) address here is set to 0xFF-0xFF-0xFF-0xFF-0xFF-0xFF, i.e. broadcast address.And following for the filling content format of MAC bag payload part: 4 bytes (broadcast data packet ID)+4 byte (source IP address)+2 byte (preserving module number n)+12 bytes (M1 bar code)+6 bytes (MAC1)+4 byte (IP1)+12 byte (M2 bar code)+6 bytes (MAC2)+4 byte (IP2)+...+12 bytes (Mn bar code)+6 bytes (MACn)+4 byte (IPn); If a mac frame length (payload length is 1500 bytes) can't have been filled; Then can consider to use multiframe, not consider the multiframe situation here.Wherein, M1-Mn represents several networking modules.
In this execution mode, set up communication between the network configuration of networking module Mn and the backstage and be connected and realize that the implementation detail and the step of inquiry in real time and dynamic monitoring are following:
The broadcast data packet of configuration; And the MAC packet is after arriving switching network; Can transmit to all ports; The networking module M1-Mn that each is connected with switching network all can receive broadcast data packet, sends the time interval (t) and the lasting transmitting time (T) of broadcast data packet and confirms according to actual conditions.
Each networking module M1-Mn is after powering on or restarting, and its workflow is seen Fig. 3 mistake! Do not find Reference source.Shown in.At first networking module is obtained earlier the individual information of itself, and like bar code or identification code, the mode of operation that Ethernet is set simultaneously is a promiscuous mode, promptly can receive any MAC packet.
Is that example is described at this with networking module Mx.Networking module Mx (the x span is 1-n) is after receiving the broadcast data packet of sending on the backstage; Carry out the parsing of broadcast data packet ID; Judge according to individual information, then abandon this bag if not the broadcast data packet that belongs to this networking module Mx, if distribute to the broadcast data packet of this networking module Mx; Then carry out the information analysis of this broadcast data packet; Mating the bar code of the bar code of each module in the broadcast data packet with (Mx) own one by one,, after finding the bar code that matches, networking module Mx can get access to internal mac address MACx and IP address ip x; The Mx of networking module then can carry out reconfiguring of network according to the internal mac address and the IP address of configuration, accomplishes to this address layoutprocedure.
After accomplishing layoutprocedure, backstage (monitor portion L) can be according to giving the networking module Mn IP address allocated, and the inquiry that the structure Query Information is configured is to add up the configuration information of each networking module Mn.For successfully obtaining address and the networking module Mn of accomplishing configuration, connect between backstage (monitor portion L) and the networking module Mn.Obtain the networking module Mn of address and configuration for failing, backstage (monitor portion L) will continue to construct broadcast data packet (not comprising networking module's address information and the bar code of having accomplished configuration in the broadcast data packet) and carry out the configuration of address.
All accomplished the configuration of address information as all networking module M1-Mn; Also set up simultaneously and being connected of backstage (monitor portion L); So just can reach inquiry, can independently control each networking module Mn simultaneously the real time information of each networking module M1-Mn.
In this example; For the obtain manner of the address of networking module Mn, also can adopt networking module Mn to carry out certain algorithm and obtain according to the bar code of self preserving or identification code, and the broadcast data packet of sending for monitor portion L; The IP address that its effect also is to broadcast monitor portion L; Networking module Mn just can be the information of networking module Mn (internal mac address for example, IP address after having got access to the IP address of monitor portion L; Bar code etc.) report monitor portion L, be connected with communication between each networking module Mn thereby can set up monitor portion L.
Please refer to Fig. 1 and Fig. 2, also relate to the local area network (LAN) dynamic monitoring device in this example.It specifically comprises monitor portion L, switching part S (in the method alleged switching network) and the networking module Mn that is connected with monitor portion through switching part, wherein n >=1.
It is each networking module Mn configuration internal mac address and IP address that this monitor portion L perhaps adds certain algorithm by individual information according to individual information, and the structure broadcast data packet.This switching part is used for said broadcast data packet is broadcast to each networking module Mn.Each networking module Mn is resolved the communication that broadcast data packet is accomplished network configuration and foundation and monitor portion.
During monitor portion L inquiry, after networking module Mn is accomplished network configuration, the inquiry that the backstage is configured according to networking module Mn IP address allocated structure Query Information.
Give the correct time on the networking module Mn, said networking module Mn is resolved the IP address of monitor portion L, and to monitor portion L reporting information.
Through preceding method, this monitor portion L inquires about and dynamic monitoring some networking module Mn in real time.
The concrete introduction as follows:
Monitor portion L generally is the daemon software that operates on the PC, mainly accomplishes the generation and the distribution of internal mac address, inquires about dynamically and controls for the running status of batch networking module Mn simultaneously.
Wherein the monitor portion L individual information (for example bar code or identification code) that can provide according to networking module Mn carries out the generation of internal mac address, can the internal mac address that generate be distributed with the MAC packet format and the content that require simultaneously.Monitor portion L can construct and send the MAC packet of various content, to meet design requirement.
Switching part S, (in the method alleged switching network), the distribution that mainly gives information and the passage of broadcasting, the message of promptly sending monitor portion L sends in each module that is connected with switching part S.
Wherein being connected between monitor portion L and the switching part S can be that the Ethernet of standard connects, and also can be the connection of other form.
Wherein the quantity of networking module Mn is 1 o'clock, can directly remove switching part S, and monitor portion L directly is connected through the Ethernet of standard with networking module Mn.
Wherein the mode of operation for switching part S also can be provided with through monitor portion L; For example switching part S can be provided with functionality of vlan; Monitor portion L also can consider to adopt vlan technology to reach harsh more designing requirement when carrying out the transmission of packet so.
Networking module Mn is the object of internal mac address and IP address assignment, simultaneously also as the object of being monitored, behind the MAC and IP address date bag that receive monitor portion L transmission, can parse the MAC and the IP address packet of configuration.Carry out Ethernet reconfigure come into force after, set up the communication with monitor portion L, real-time and dynamic is carried out reporting of operating state, monitor portion L also can regularly control networking module Mn simultaneously.
Wherein networking module Mn will possess two conditions: at first the ethernet hardware of networking module Mn must be supported promiscuous mode.Secondly networking module Mn is wanted to preserve the individual information that can represent networking module Mn.Promiscuous mode for the Ethernet support of networking module Mn does not describe in detail here, and it is the function point that ethernet hardware is realized.And, then take the bar code or the identification code of the production of this module for the individual information that networking module Mn is preserved.
Wherein should be designed with the not device of drop-out of power down on the networking module Mn, and the bar code or the identification code that identify this module just are kept in this device.This device also can be preserved other important information, date of manufacture for example, module type, information such as hardware version.
Above content is to combine concrete preferred implementation to the further explain that the present invention did, and can not assert that practical implementation of the present invention is confined to these explanations.For the those of ordinary skill of technical field under the present invention, under the prerequisite that does not break away from the present invention's design, can also make some simple deduction or replace, all should be regarded as belonging to protection scope of the present invention.