Summary of the invention
The technical problem to be solved in the present invention is: overcome the common factor attack problem that existing Mesh network exists, simultaneously in order to guarantee to encircle the validity of communication, a kind of method for hierarchichal onion rings routing is provided, it can effectively be resisted to occur simultaneously and attack, improve Network Communicate Security, and effectively alleviate the burden of gateway, reduce the routing table record amount of gateway, more the good utilisation Internet resources reduce delay.
The present invention is divided into three parts to whole communication process in order to carry out safe anonymous communication at the Mesh network: the initialization of ring, interannular communication and sign off.In wireless Mesh netword, node is divided three classes: gateway, trusted node, ordinary node, OP node (Onion Proxy) and gateway G induce node, and they send an induction information carrier (dummy bag) near the OP node it at set intervals.The OP node has played the selection of ground floor route and second layer route in the initialization procedure of ring, in the communication process afterwards, and its effect and ordinary node F
iIdentical.For the ease of understanding, the notion of anonymity collection and layering route is done to introduce:
Anonymous collection: establish R and be the set that all OP nodes and gateway G are formed in the network, then claim to satisfy following condition:
A must comprise element G;
All elements in the b set is that the subclass that forms the R of hamiltonian circuit with topological structure in network is anonymous the collection.These anonymous collection are carried out label.In network, these numbered anonymous collection of gateway G and OP nodes sharing.
The layering route: the present invention is divided into route two-layer.Ground floor route: in the onion ring Routing Protocol, claim that the path of concentrating element to form by anonymity is the ground floor route, just the path of forming by trusted node and gateway.The ground floor route is mainly formed annular by non-conterminous trusted node.Second layer route:, be also referred to as down one deck route being called second layer route by the loop that constitutes after the ordinary node filling between the trusted node.Second layer route is selected at random by OP node and gateway in initialization procedure.It mainly is the filling of carrying out the path.
One, Huan initialization
The present invention is divided into following step to the initialization of ring:
The 1st step: encapsulation process
At first: OP node (promptly anonymous concentrated first element) is selected the ground floor route, and just labelled anonymous collection according to the order encapsulation Onion Loaf of anonymous centralized node, adds a dummy bag thereafter.
Packet format is as follows:
{build},E
kpop1[(RI,k
op1,OP2),E
kpop2[(RI,k
op2,G),E
kpg(RI,t))]],dummy;
Build}: packet header, ring information is built in expression, tells the initialization that node will encircle;
E
Kp: public key encryption is used to encapsulate Onion Loaf; The OP1 node PKI E of oneself
Kpop1Encrypt the outermost layer bag, i.e. ring RI, the session key k of oneself
Op1, next bar address OP2, and the anonymous second layer Onion Loaf of concentrating second node encapsulation.When the OP2 node is received this Onion Loaf, just can determine where next jumping mails to.By that analogy.
RI: ring number, in network, may there be a lot of rings to communicate simultaneously, in order to guarantee the not repeated of the number of ring, RI is by anonymity collection number and build the ring time and form.
k
i: session key, the session key of node i and gateway G; Be the session key of each node when this ring communication, session key is to set up according to the foundation of ring, and when the ring sign off, this time the mission of session key has just been finished, and next communication will rebulid session key.
T: express time stabs, and is used for the real-time of detect-message;
Dummy: induction information, can form by any non-important information.
Then: the OP node is chosen the second layer route that anonymity focuses on second element again, in strict accordance with the order of second layer route encapsulation Onion Loaf, and distributes in this communication process the disposable session key (random number k of up link in the ring
Op1, k
1, k
2..., k
Op2).
These disposable session keys of distributing will be told gateway G, and gateway has just been known the concrete path of up link like this, and the one time key of down link is distributed by gateway.
As follows from the packet format that concentrated first node of anonymity sends to second node:
{build},E
kp1[(RI,k
1,F
2),E
kp2[(RI,k
2,F
3),…,E
kpop2((RI,k
2,G),
E
kpg(RI,k
op1,k
1,k
2,…,k
op2,t))]],dummy
F
i: the ordinary node in the network.
k
i: disposable session key
When ring information was built in the transmission of OP1 node, with regard to packaged Onion Loaf, Onion Loaf was from level to level.Dummy represents induction information, uses node F
1Public key encryption ground floor bag, comprise ring RI in the bag, session key k
1With next-hop node F
2The IP address.By that analogy.The innermost layer bag is encapsulated the session key k of the node of all up links by the PKI of gateway
Op1, k
1, k
2..., k
Op2, timestamp t and ring RI form.
Simplify above-mentioned packet format as follows:
{ build}, E
Kpop1(E
Kp1(E
Kp2..., (E
Kpop2(E
Kpg(m
1)), dummy, wherein m
1={ RI, t, k
Op1, k
1, k
2..., k
Op2;
All OP nodes in the ring are not always the case and encapsulate Onion Loaf, for example OP2 and gateway G.
When second the node OP2 that concentrates when anonymity receives initialization information, it in like manner first element carry out Path selection and encapsulation Onion Loaf, wrap but directly transmit dummy.As follows:
{ build}, E
Kpn(... (E
Kpop3(E
Kpg(m
2), E
Kpg(m
1)))), E
Kpop2 -1(... E
Kp1 -1(dummy)), m wherein
2={ k
Op2, k
n, k
N+1, t}
E
Kp -1: the PKI deciphering.
The 2nd step: information repeating process
In the information repeating process, the common F that does not have data to send in the ring
iNode only is decrypted this Onion Loaf and dummy bag, then the message after the deciphering is issued next node; As follows:
{build},E
kp2(…(E
kpop2(E
kpg(m
1))),E
kp1 -1(dummy);
The 3rd step: session inserts request process
As ordinary node F
iWhen wanting to communicate, substitute the dummy bag of deciphering layer by layer with the access solicited message;
{build},E
kp(i+1)(E
kp(i+2)(…E
kpg(m))),E
kpi -1(request);
The 4th step: gateway processes process
When gateway G receives the bag that sends from the OP1 node, just determined session initiator.If gateway is agreed this request, it determines second half endless path according to ring number and anonymous collection.Onion Loaf of the strict encapsulation of gateway G sends to session initiator.This Onion Loaf has comprised from session initiator to all session keys apart from the up link of its nearest OP node or gateway.Agreement information so just can arrive session initiator from gateway and communicate.Packet format is as follows:
{build},E
kpm(…E
kpop(…(E
kpg(k
i,…,k
op,grant))));
Follow erase mechanism in session access request, if there are two nodes to think to carry out simultaneously session in ring, the solicited message of a so back node will be wiped the solicited message of previous node.And previous node can not obtain agreement information in this ring, in the time of can only waiting for the carrier arrival of next ring, resends request.
Two, interannular communication
After the ring initialization, gateway G has just determined session initiator, and the session key in part path has been sent to it.Receive the bag that gateway G is sended over if at this moment session initiator is correct, still communicate by letter with gateway G with the layering conversational mode.In the interannular communication process, OP node or gateway G session key Onion Loaf can significantly reduce amount of calculation like this, and encryption/decryption speed are fast.Each foundation when encircling all will be redistributed session key, so also can reduce the chance that the opponent distorts Onion Loaf.Because if the opponent has known the path of full annular, it just can encapsulate Onion Loaf with PKI and pretend to be node in the ring.Node F
iArrive apart from its nearest OP node or gateway G Onion Loaf with one of session key encapsulation, carry out session with it.When receiving bag, in like manner select second layer route to concentrate next element to communicate with anonymous apart from its nearest OP node.Except gateway G and session initiator, each node in the ring is all only transmitted the Onion Loaf after the deciphering.
Session initiator is as follows to the communication process of gateway G:
F
i→F
i+1:{RI},E
k(i+1)(E
k(i+2)(…(E
kop(E
kg(E
si(data,ack)))));
F
i+1→F
i+2:{RI},E
k(i+2)(…(E
kop(E
kg(E
si(data,ack)))));
……:……
F
OP-1→OP:{RI},E
kop(E
kg(E
si(data,ack)))));
OP→F
OP+1:{RI},E
k(op+1)(E
k(op2)(…(E
kg(E
si(data,ack)))));
……:……
F
G-1→G:{RI},E
kg(E
si(data,ack));
RI} is packet header, and it just represented the ring set up, begin to communicate.E
sThe expression encrypted private key.E
SiExpression node F
iEncrypted private key.Data sends the information content.Ack represents correctly to receive the message authentication code that the bag back sends, and is used for proving that communicating pair received bag really.
After gateway G received this carrier bag, it used oneself private key and node F
iPKI decipher this bag, determine this bag be issue oneself with this bag be node F
iSend over.G receives message when gateway, and its calculates ack value, if the value of both sides ack is the same, proves their correct bags of receiving, carries out later communication then; If different is exactly correctly not receive bag so.
Gateway G according to one of ring number and anonymous collection encapsulation to node F
iBag, packet format is as follows:
{RI},E
kg(E
kop1(E
ki(E
sg(data))))。
Gateway G is to node F
iCommunication process is as follows:
G?→F
m:{RI},E
km(E
k(m+1)(…(E
op1(E
ki(E
sg(data))))));
F
m→F
m+1:{RI},E
k(m+1)(…(E
ki(E
sg(data))));
……:……
OP1→F
1:{RI},E
k1(…(E
ki(E
sg(data))));
……:……
F
i-1→F
i:{RI},E
ki(E
sg(data));
Three, sign off
After communication a period of time, if when both sides do not have data to send, gateway G just encapsulates an Onion Loaf to the empty content of OP node so, has proved sign off.
But also having a kind of situation is exactly that gateway G does not have data to give session initiator, and session initiator also has data will send to gateway.The present invention has guaranteed that the information that gateway G sends in communication process necessarily arrives session initiator.So session initiator can send data to gateway by ring always.Because session starts from the OP node, end in the OP node.So when session initiator does not have information to send, at this moment session initiator just send an empty content bag to gateway G, at this moment gateway is just known that information sends and is over, and at this moment encapsulates an Onion Loaf to the empty content of OP node again, proves sign off.After that is to say initialization, when the OP node is received one during to own bag, or when netting G and receiving the bag of empty content, just prove sign off.
But also a kind of situation may take place, in a ring two session initiator be arranged exactly.If run into this situation, a back session initiator always can be encrypted the dummy information of having been encrypted by previous start node, comes to carry out session with gateway G.And the session initiator in front can only wait for that next ring converses.Though this can cause time delay, have other rings in the network simultaneously and communicate.
The present invention has following beneficial effect compared with prior art:
1. the present invention is by use layering onion ring communication protocol, and the OP node of anonymous collection and gateway fellowship can effectively be obscured the path and stop the attack of occuring simultaneously in routing procedure.
2. OP node or gateway session key Onion Loaf can significantly reduce amount of calculation like this, and encryption/decryption speed is fast.Each foundation when encircling all will be redistributed session key, so also can reduce the chance that the opponent distorts Onion Loaf.
3. adopt layering onion routing algorithm to realize the route pooling function, greatly reduce the record amount of gateway, effectively alleviate the burden of gateway, and can add run-up ring process, utilize Internet resources better, reduce delay routing table.
4. fail safe aspect reduce from onion number of routes directly perceived, but security intensity is based upon on the public key safety basis, with how much haveing nothing to do of node number.So security intensity does not reduce, hide the better effects if of route on the contrary.
Embodiment
Layering onion ring of the present invention as shown in Figure 1.When network built up, gateway G had just write down the trusted node in the network (the OP node in the network).Shown in Fig. 1 dotted line, gateway G and OP have just formed annular path.
As shown in Figure 1, the OP1 node is a start node, and it selects anonymous collection, and { G} is called the ground floor route for OP1, OP2.When Onion Loaf began to transmit, because the next node pointed out is the OP2 node in the bag, and OP2 node and OP1 node be not adjacent node, and then the OP1 node is just set up new connection, be assumed to be OP1, F1 ... OP2} claims that this route is a second layer route, promptly is equivalent to one deck route down.When Onion Loaf passed to the OP2 node, second layer route stopped, and turns back to the last layer route, promptly reenters the ground floor route.
Below in conjunction with the preferred embodiment of accompanying drawing 2 a complete layering onion ring communication process will be described.
As shown in Figure 2, suppose that the ground floor route that the OP3 node is selected is ring RI:{OP3, OP2, G}, second layer path be OP3, F4, F5, OP2}, the OP3 node just is packaged into Onion Loaf in strict accordance with the order of second layer route so.
The 1st step: encapsulation process
The OP3 node is selected the ground floor route earlier, and just labelled anonymous collection according to the packaged Onion Loaf of the order of anonymous centralized node, adds a dummy bag thereafter. and packet format is as follows:
{build},E
kpop3[(RI,k
op2),E
kpop2[(RI,kg),E
kpg(RI,t))]],dummy;
Then, the OP3 node is chosen anonymous second layer route { OP3, the F that concentrates second node
4, F
5, OP2} in strict accordance with the order of second layer route encapsulation Onion Loaf, and is distributed in this communication process the disposable session key (k of up link in the ring
Op1, k
4, k
5, k
Op2).
As follows from the packet format that concentrated first element of anonymity sends to second element:
{build},E
kpop3[(RI,k
op2),E
kp4[(RI,k
4,F
5),E
kp5[(RI,k
5,F
op2),…,;
E
kpop2((RI,k
g),E
kpg(RI,t,k
op1,k
4,k
5,k
op2))]]],dummy
It is as follows to simplify packet format:
{ build}, E
Kpop3(E
Kp4(E
Kp5(E
Kop2(E
Kg(m)))), dummy, wherein m
1={ RI, t, k
Op1, k
4, k
5, k
Op2.
The 2nd step: information repeating process
In transmission course, the node that does not have data to send in the ring only is decrypted this Onion Loaf and dummy bag, then the message after the deciphering is issued next node; As follows:
F
op3→F
4:{build},E
kp4(E
kp5(E
kop2(E
kg(m
1)))),dummy;
F
4→F
5:{build},E
kp5(E
kop2(E
kg(m
1))),E
kp4(dummy)。
The 3rd step: session inserts request process
As node F
5When wanting to communicate, with inserting the dummy bag that solicited message request substitutes deciphering layer by layer;
F
5→F
op2:{build},E
kop2(E
kg(m
1)),E
kp5(request);
F
op2→F
6:{build},E
k6(E
k7(E
kg(m
1))),E
kpop2(E
kp5(request));
F
6→F
7:{build},E
k7(E
kg(m
1)),E
k6(E
kpop2(E
kp5(request)));
F
7→F
G:{build},E
kg(m
1),E
kp7(E
kp6(E
kpop2(E
kp5(request))。
The 4th step: gateway processes process
When gateway G receives the bag that is sended over by the OP2 node, and know node F
5Want to converse.If agreed this request, it also in like manner is determined to second half endless path of OP3 node according to ring number and anonymous collection, suppose that selected path is { G, F
3, OP3}.Gateway is node F
5Session key (k to gateway node that up link is passed through
Op2, k
6, k
7) send to node F
5It gives node F with Onion Loaf of strictness encapsulation
5At this moment agree that information just can be from gateway by node F
3, OP3, F
4Arrive node F
5Communicate.The simplification form of gateway wrapper is as follows:
{ build}, E
Kg(E
Kop3(E
Kg4(E
Kp5(E
Sg(m
2))))), m wherein
2={ k
Op2, k
6, k
7, grant}.
F
G→F
3:{build},E
kp3(E
kop3(E
kp4(E
kp5(E
sg(m
2)))));
F
3→F
op3:{build},E
kop3(E
kp4(E
kp5(E
sg(m
2))));
F
op3→F
4:{build},E
kp4(E
kp5(E
sg(m
2)));
F
4→F
5:{build},E
kp5(E
sg(m
2))。
After the ring initialization, gateway has just determined that session initiator is node F
5, and the session key in part path has been sent to it.If F at this moment
5Correct receive the bag that gateway sends over, still carry out session and gateway communicates with layer mode.Node F
5With Onion Loaf of session key encapsulation, carry out session with it to the OP2 node.When the OP2 node is received from node F
5The bag that sends, it concentrates next node gateway G to communicate according to ring number affirmation second layer route and with anonymity.
Onion ring communication process following (using disposable session key):
F
5→F
op2:{RI},E
kop2(E
kg(E
s4(data,ack)));
F
op2→F
6:{RI},E
k6(E
k7(E
kg(E
s4(data,ack))));
F
6→F
7:{RI},E
k7(E
kg(E
s4(data,ack)));
F
7→F
G:{RI},E
kg(E
s4(data,ack));
After gateway was received this carrier bag, it used oneself private key and node F
5PKI decipher this bag, determine this bag be issue oneself with this bag be node F
5Send over.Receive when bag when gateway, its calculates ack value, if the value of both sides ack is the same, proves their correct bags of receiving, carries out later communication then; If different is exactly correctly not receive bag.
Node F is arrived in one of gateway encapsulation
5Bag, form is as follows: { RI}, E
Kp3(E
Kop3(E
Kp4(E
Kp5(E
Sg(data))))).
F
G→F
3:{RI},E
kp3(E
kop3(E
kp4(E
kp5(E
sg(data)))));
F
3→F
op3:{RI},E
kop3(E
kp4(E
kp5(E
sg(data))));
F
op3→F
4:{RI},E
kp4(E
kp5(E
sg(data)));
F
4→F
5:{RI},E
kp5(E
sg(data))。