A kind of broadcasting method of mobile ad hoc network
Technical field
The present invention relates to a kind of broadcasting implementation method, the broadcasting method of especially a kind of MANET (Mobile Ad HocNetwork, mobile ad hoc network).
Background technology
MANET is a kind of acentric mobile radio system, is widely used in fields such as military affairs, physical culture, and the modal communication mode of its network internal is broadcasting.In the Routing Protocol of MANET broadcasting, having a kind of is that each network node is safeguarded following data structure in the agreement to the maintenance of two step neighbor table of node:
The repetition message table: information such as the source node address of the broadcast that the record node is received, the sequence number of message and timestamp, node utilizes these information to judge whether the message that receives is repetition message;
Two step neighbor table: the information of neighbor nodes of record node, and the adjacent node of neighbor node (with the distance of this node be 2 node) information.
This agreement comprises 2 main processes, information of neighbor nodes exchange process and broadcasting process:
In the information of neighbor nodes exchange process, node exchanges the information of neighbor node periodically with adjacent node.The message interval time that every process is default, node comprises the key messages such as IP address table of type of message, message-length and neighbor node just to an adjacent node broadcasting HELLO message (spot broadcasting) in the message; When a node received the HELLO message of adjacent node, it upgraded its two steps neighbor table in view of the above.If through default maximum wait time, node does not receive the HELLO message of a certain adjacent node yet, thinks that then this node is not adjacent with it, this node and adjacent node tabulation thereof can be deleted from its two steps neighbor table.
In broadcasting process, node selects some nodes as broadcast gateway from adjacent node, has only broadcast gateway just to carry out the forwarding of broadcast.By broadcast gateway, message is finally propagated gives all destination nodes.Broadcasting process is finished in the mode that distributes, and each node is independently selected broadcast gateway, independently carries out the forwarding of broadcast.Wherein,
The operation of source node S is as follows:
S carries out the broadcast gateway selection algorithm according to its two steps adjacency list, selects node as broadcast gateway from its adjacent node, and structure broadcast M; M comprises the broadcast gateway information of S selection and the routing information of message, and initial path only comprises the address of S; Afterwards, by spot broadcasting, S propagates M to all adjacent nodes;
The operation of non-source node V is as follows:
When one, V receives M, judge according to the record in the repetition message table whether M is repetition message, if V abandons M, processing finishes; Otherwise V charges to the repetition message table for information about with M's, sends M to upper-layer protocol, and the step below continuing;
Two, V judges whether it is broadcast gateway, if not processing finishes; Otherwise, the step below continuing;
Three, V is according to path in the M message header and broadcast gateway information, with and two the step adjacency lists, carry out the broadcast gateway selection algorithm, from its adjacent node, select node as broadcast gateway, and renewal M, promptly remove original broadcast gateway information among the M, be added into the selected broadcast gateway information of V, and in routing information, add the address of V; Afterwards, by spot broadcasting, V propagates M to all adjacent nodes.
In the above-mentioned broadcasting process, each broadcast gateway all need be carried out the broadcast gateway selection algorithm to every bag data, and therefore the network load and the propagation delay time of above-mentioned broadcasting process are bigger.
Below the broadcast gateway selection algorithm in the above-mentioned broadcasting process is described.If present node is A, the path of message process is P, and the selected broadcast gateway set of A is D, and then the broadcast gateway selection algorithm is as follows:
1, make D=Φ (empty set), A obtains local network topology figure according to its two steps adjacency list, be designated as GN=(AN, EN), wherein AN only comprises A and is not more than 2 node from the distance of A, EN represents internodal topological relation among the AN;
2, simplify figure GN by following rule: 1., then delete the adjacent node of x and x, and delete corresponding limit if node x belongs to P; 2. if opposite side<x, y 〉, node x and y are the adjacent node of A, then delete this limit; 3. delete the number of degrees and be 0 node; Note as a result among the figure set of node adjacent with A be N1, be that 2 set of node is N2 from the distance of A;
3, judge whether N2 equals Φ, if, finish algorithm, otherwise, the step below continuing;
4, judge that whether having the number of degrees among the N2 is 1 node, if exist, then is designated as w with coupled node; Otherwise, the node of number of degrees maximum among the N1 is designated as w;
5, make D=D ∪ w}, and from GN the adjacent node of deletion w and w, delete corresponding limit, get back to step 3 afterwards.
Empirical tests, above-mentioned broadcast gateway selection algorithm can cover all two step neighbor nodes, are complete.But this algorithm is too complicated, has increased maintenance cost.
Summary of the invention
The technical problem to be solved in the present invention provides the broadcasting method of a kind of MANET, has reduced network load and propagation delay time in the MANET broadcasting process.
The technical solution adopted for the present invention to solve the technical problems is:
The broadcasting method of a kind of MANET is realized in the mode that distributes by each node among the MANET, may further comprise the steps:
A, node judge whether local two step neighbor table are upgraded, if, enter step b, otherwise, step c directly entered;
B, described node adopt broadcast gateway system of selection replacement spot broadcasting gateway table;
C, described node are constructed broadcast according to its address and spot broadcasting gateway table, and by spot broadcasting, described broadcast are propagated to all adjacent nodes.
In the such scheme, spot broadcasting gateway table is that described node adopts described broadcast gateway system of selection initialization to set up.
In the such scheme, described broadcast gateway system of selection may further comprise the steps:
B1, described node are put sky with spot broadcasting gateway table;
B2, described node according to local two step neighbor table determine with its distance be 1 node set S1 and with its distance be 2 node set S2;
B3, described node make S1 and S2 not occur simultaneously the deletion of the respective nodes among the S1;
B4, described node adopt undirectional approach to select among the S1 node as broadcast gateway, and the node of selecting is added into spot broadcasting gateway table.
In the such scheme, described step B4 further realizes by following steps:
B41, described node select among the S1 with S2 in the number of degrees be the node that links to each other of 1 node as broadcast gateway, selected node is added into spot broadcasting gateway table, and respectively from S1 and S2 with the knot removal of described selected node and connection thereof;
B42, described node judge whether S2 is empty, if empty, finish described broadcast gateway and selects flow process, otherwise, enter step B43;
B43, described node select the node of number of degrees maximum among the S1 as broadcast gateway, and it is added into spot broadcasting gateway table, and respectively from S1 and S2 with the knot removal of described selected node and connection thereof, get back to described step B42 afterwards.
In the such scheme, among the described step a, described node judges according to the state indicated value of local two step neighbor table whether local two step neighbor table are upgraded.
In the such scheme, after the initialization of spot broadcasting gateway table was set up, described node was initialized as 0 with described state indicated value; After local two step neighbor table were upgraded, described node was changed to 1 with described state indicated value, and behind replacement spot broadcasting gateway table, described state indicated value is reset to 0.
In the such scheme, during the non-source node of described node, further comprising the steps of before the described step a:
(1), described node receives broadcast, judges according to local repetition message table whether the broadcast that receives is repetition message, if not, it is added into the repetition message table, send upper-layer protocol simultaneously to;
(2), described node judges according to the broadcast that receives whether it is broadcast gateway, if enter described step a.
Beneficial effect of the present invention mainly shows: the broadcasting method of MANET provided by the invention is according to the state indicated value of local two step neighbor table, it is local when two steps, neighbor table was not upgraded, directly utilize spot broadcasting gateway table structure broadcast, otherwise, behind the replacement spot broadcasting gateway table again according to its structure broadcast, thereby low network load and propagation delay time in the MANET broadcasting process; Simultaneously, system of selection is improved to broadcast gateway, thereby has reduced computation complexity and maintenance cost.
Description of drawings
Fig. 1 is the non-source node broadcasting flow chart of MANET of the present invention;
Fig. 2 selects flow chart for broadcast gateway of the present invention.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.
With reference to Fig. 1, the broadcasting method of a kind of MANET is realized in the mode that distributes by each node among the MANET.The state indicated value Chg_NB and the spot broadcasting gateway table four class data structure of the local repetition message table of each node maintenance, local two step neighbor table, local two step neighbor table.Wherein, the initialization of spot broadcasting gateway table is set up and is reset and all adopt the broadcast gateway system of selection to realize; After the initialization of spot broadcasting gateway table was set up, node was initialized as 0 with Chg_NB; After local two step neighbor table were upgraded, node was changed to 1 with Chg_NB; After spot broadcasting gateway table was reset, node reset to 0 with Chg_NB.
Non-source node among the MANET is realized described broadcasting by following steps:
S101: node receives broadcast, judges according to local repetition message table whether the broadcast that receives is repetition message, if not, enter S102, otherwise, process ends;
S102: node is added into the repetition message table with the broadcast that receives, and sends upper-layer protocol simultaneously to;
S103: node judges according to the broadcast that receives whether it is broadcast gateway, if, enter S104, otherwise, process ends;
S104: node judges whether local two step neighbor table are upgraded, judge promptly whether the value of Chg_NB is 1, if, enter S105, otherwise, S106 directly entered;
S105: node adopts broadcast gateway system of selection replacement spot broadcasting gateway table; After spot broadcasting gateway table was reset, node reset to 0 with Chg_NB;
S106: node is constructed broadcast according to its address and spot broadcasting gateway table, and by spot broadcasting, broadcast is propagated to all adjacent nodes.
Source node among the MANET then need not the S101 to S103 in the above-mentioned flow process, when broadcasting, directly carries out S104 to S106 and gets final product, and repeats no more.
As can be seen from the above description, the present invention has been by having avoided local routing when two steps, neighbor table was not upgraded at the dynamic spot broadcasting gateway of node maintenance table, thereby reduced network load and propagation delay time in the MANET broadcasting process.
Below with reference to Fig. 2 described broadcast gateway system of selection is described, it may further comprise the steps:
S201: node is put sky with spot broadcasting gateway table;
S202: node according to local two step neighbor table determine with its distance be 1 node set S1 and with its distance be 2 node set S2;
S203: node makes S1 and S2 not occur simultaneously the deletion of the respective nodes among the S1;
S204: node select among the S1 with S2 in the number of degrees be the node that links to each other of 1 node as broadcast gateway, selected node is added into spot broadcasting gateway table, and respectively from S1 and S2 with the knot removal of selected node and connection thereof;
S205: node judges whether S2 is empty, if empty, finish described broadcast gateway and selects flow process, otherwise, enter S206;
S206: node selects the node of number of degrees maximum among the S1 as broadcast gateway, and it is added into spot broadcasting gateway table, and respectively from S1 and S2 with the knot removal of described selected node and connection thereof, get back to S205 afterwards.
Above-mentioned algorithm can overlay network in all nodes, be complete, reduced computation complexity and maintenance cost simultaneously, simple.
The above is embodiments of the invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within the claim scope of the present invention.