Summary of the invention
Main purpose of the present invention is: overcome the deficiencies in the 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 is solved by the following technical programs: 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 described broadcast data packet, and carries out network configuration according to internal mac address and IP address that correspondence is distributed, finishes 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 described backstage in by scanner or keyboard.
Under the situation of a plurality of networking modules, described broadcast data packet is broadcast to each networking module Mn by 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; Described networking module Mn receives and resolves described broadcast data packet, and carries out network configuration according to internal mac address and IP address that correspondence is distributed, finishes between configuration back and the backstage connecting; This backstage is inquired about and dynamic monitoring in real time to networking module Mn.
After networking module Mn is finished network configuration, the inquiry that the backstage is configured according to networking module Mn IP address allocated structure Query Information.
Described 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 by switching part, n 〉=1 wherein, described monitor portion is used for obtaining the individual information of each networking module Mn, and be each networking module Mn configuration internal mac address and IP address, and structure broadcast data packet according to individual information; Described switching part is used for described 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 finished network configuration and foundation and monitor portion, and described 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 structure broadcast data packet, networking module Mn receives, resolve described broadcast data packet, and carry out network configuration according to internal mac address and IP address that correspondence is distributed, finish 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 in real time to networking module Mn simultaneously; 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
Also in conjunction with the accompanying drawings the present invention is described in further details below by concrete execution mode.
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 some networking module Mn not with the same LAN environment of Internet connection in normally operation.
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) by 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;
Described broadcast data packet is broadcast to each networking module Mn by switching network;
Each networking module Mn receives and resolves described broadcast data packet, and carries out network configuration according to internal mac address and IP address that correspondence is distributed, finishes between configuration back and the backstage connecting.
At first, deposit in the backstage by 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 the present embodiment, 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 by 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 enabling 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 as follows 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 the present embodiment, 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 as follows:
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, and the time interval (t) and the lasting transmitting time (T) that send broadcast data packet are determined 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 as 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 the broadcast data packet that receives the backstage transmission, 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, the bar code of the bar code of each module in the broadcast data packet with (Mx) own mated 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, finishes to this address layoutprocedure.
After finishing 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 finishing 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 finished configuration in the broadcast data packet) and carry out the configuration of address.
All finished 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, obtain manner for the address of networking module Mn, also can adopt bar code that networking module Mn preserves according to self or identification code to carry out certain algorithm obtains, and the broadcast data packet that sends for monitor portion L, the IP address that its effect also is to broadcast monitor portion L, networking module Mn is after having got access to the IP address of monitor portion L, just can be the information of networking module Mn (internal mac address for example, the IP address, 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 by switching part, wherein n 〉=1.
This monitor portion L is according to individual information or add certain algorithm by individual information and be each networking module Mn configuration internal mac address and IP address, and the structure broadcast data packet.This switching part is used for described broadcast data packet is broadcast to each networking module Mn.Each networking module Mn is resolved the communication that broadcast data packet is finished network configuration and foundation and monitor portion.
During monitor portion L inquiry, after networking module Mn is finished 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, described networking module Mn is resolved the IP address of monitor portion L, and to monitor portion L reporting information.
By preceding method, this monitor portion L inquires about and dynamic monitoring in real time to some networking module Mn.
Specifically be described below:
Monitor portion L generally is the daemon software that operates on the PC, mainly finishes 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, the internal mac address that generates can 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, promptly the message that monitor portion L is sent 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 by the Ethernet of standard with networking module Mn.
Wherein the mode of operation for switching part S also can be provided with by 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 design 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 be in conjunction with concrete preferred implementation to further describing that the present invention did, can not assert that concrete enforcement of the present invention is confined to these explanations.For the general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, can also make some simple deduction or replace, all should be considered as belonging to protection scope of the present invention.