Embodiment
The embodiment of the invention proposes a kind of peer-to-peer method of attachment of peer-to-peer network of dialogue-based initiation protocol, comprising:
The first peer-to-peer receives the connection message that carries the purpose sign that the second peer-to-peer sends, and the purpose sign of described connection message is used to indicate the type that described connection message allows the first peer-to-peer of connection;
Described the first peer-to-peer is after determining that the indicated type of its type and the purpose sign in the described connection message is identical, and foundation is connected with the second peer-to-peer.
Further, the sign of the purpose in the described connection message is indicated the type of the peer-to-peer that allows connection by flag bit.
And the type of described peer-to-peer comprises self peer-to-peer and resource peer-to-peer.
Particularly, described connection message also carries the resource identification that equates with the peer identification of the first peer-to-peer, when if purpose sign indication type is self peer-to-peer, described the first peer-to-peer, connects between peer-to-peer with after described resource identification equates in definite its peer identification; If purpose sign indication type is the resource peer-to-peer, described the first peer-to-peer connects between peer-to-peer after definite its has the resource corresponding with described resource identification.
Simultaneously, the embodiment of the invention proposes again a kind of peer-to-peer, comprising:
Receiving element, for receiving connection message, described connection message carries the purpose sign, and described purpose sign is used to indicate the type that described connection message allows the peer-to-peer of connection;
Connect processing unit, be used for determining that the type of type that described connection message allows the peer-to-peer that connects and this peer-to-peer is identical after, set up being connected between the peer-to-peer with the described connection message of transmission.
Further, the sign of the purpose in the described connection message indicates described connection message to allow the type of the peer-to-peer of connection by flag bit.
And the type of described peer-to-peer comprises self peer-to-peer and resource peer-to-peer.
Particularly, described connection processing unit also comprises judgment sub-unit and connexon unit, described connection message also carries the resource identification that equates with the peer identification of described peer-to-peer, when purpose sign indication type is self peer-to-peer, after described judgment sub-unit was judged described resource identification and the peer identification of this peer-to-peer is equated, being connected between peer-to-peer with the described connection message of transmission set up in described connexon unit; When purpose sign indication type was the resource peer-to-peer, after described judgment sub-unit judged that this peer-to-peer has the resource corresponding with described resource identification, being connected between peer-to-peer with the described connection message of transmission set up in described connexon unit.
Can know from technique scheme, allow the type of the peer-to-peer of connection by the purpose sign indication of connection message, so that the peer-to-peer that receives connection message determines according to the purpose sign whether self type and purpose in the connection message identify indicated type identical, if identical, then connect processing according to connection message, if not identical then finish, thus avoid setting up wrong network communication and the unnecessary ICE that brings thus mutual.
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described.
As shown in Figure 3-Figure 5, take peer-to-peer A, the peer-to-peer B of the peer-to-peer network of dialogue-based initiation protocol, peer-to-peer C, peer-to-peer D as example, illustrate how to set up correct connection between peer-to-peer.
Peer-to-peer B notifies its routing table information to peer-to-peer A by the Update message cycle, peer-to-peer A transmits the routing table information of coming according to peer-to-peer B, judge that peer-to-peer C should join in the routing table of peer-to-peer A as new neighbor, peer-to-peer A structure connection message also sends connection message.
The resource identification of the connection message that peer-to-peer A sends is set to the peer identification of peer-to-peer C, and described connection message also carries the purpose sign that is used to indicate the peer type that allows connection.The peer type of purpose sign indication comprises self peer-to-peer and resource peer-to-peer: self peer-to-peer refers to the peer-to-peer that the peer identification of peer-to-peer self equates with the resource identification of connection message; The resource peer-to-peer refers to that peer-to-peer has the peer-to-peer with the corresponding resource of resource identification of connection message.
Embodiment one
Referring to shown in Figure 3, the type that the purpose sign indication that the below carries take connection message allows the peer-to-peer that connects as self peer-to-peer as example, the method for attachment between the peer-to-peer of peer-to-peer network of dialogue-based initiation protocol is described, comprising:
1, the first peer-to-peer receives the step of the connection message of the second peer-to-peer transmission:
Referring among Fig. 4 shown in the step 31, peer-to-peer B notifies its routing table information to peer-to-peer A by the Update message cycle, peer-to-peer A transmits the routing table information structure connection message that comes and sends connection message according to peer-to-peer B, and the resource identification of the connection message that peer-to-peer A sends is set to the peer identification of peer-to-peer C.
Referring to Fig. 4, peer-to-peer C is on network, and shown in step 32 among Fig. 4, connection message sends to peer-to-peer C according to the resource identification route that it carries, i.e. the connection message of peer-to-peer A transmission is by waiting body C to receive;
Referring to Fig. 5, peer-to-peer C is not on network the time, if peer-to-peer D is responsible for taking over the resource on the peer-to-peer C, shown in step 32 among Fig. 5, connection message sends to peer-to-peer D according to the resource identification route that it carries, i.e. the connection message of peer-to-peer A transmission is received by peer-to-peer D.
2, the first peer-to-peer is determined whether identical step of the indicated type of its type and purpose sign:
Referring to Fig. 4, peer-to-peer C has received connection message, purpose sign in the connection message indicates the type of the peer-to-peer that connects processing to be self peer-to-peer by flag bit, the resource identification that peer-to-peer C further confirms connection message is with after the peer identification of peer-to-peer C equates, the type of expression peer-to-peer C is identical with the type that the purpose sign in the connection message is indicated, also be that connection message has been connected to correct peer-to-peer C, then enter the step that connects processing;
When peer-to-peer C is not on network, peer-to-peer D has received connection message, purpose sign in the connection message indicates the type of the peer-to-peer that connects processing to be self peer-to-peer by flag bit, after peer-to-peer D confirms that further the peer identification of the resource identification of connection message and peer-to-peer D is unequal, the type of expression peer-to-peer D is not identical with the type that the purpose sign in the connection message is indicated, also be that peer-to-peer that connection message expectation connects does not exist or deviated from network, peer-to-peer D points out faults in replying and the end process, and the follow-up negotiations processes such as ICE just do not need to start.
The purpose that increases in connection message sign can confirm first before peer-to-peer connects processing that its type is whether identical with the indicated peer type of purpose sign in the connection message, to avoid wrong network connection and unnecessary ICE mutual, realize the exact connect ion between peer-to-peer in the network.
3, the step that is connected with the second peer-to-peer of the first peer-to-peer:
Referring to Fig. 4, the resource identification that peer-to-peer C confirms connection message is with after the peer identification of peer-to-peer C equates, the expression connection message has been connected to correct peer-to-peer C, and peer-to-peer C makes correctly replying and finishes address information mutual (shown in step 33 among Fig. 4).
Can enter follow-up ICE negotiations process after the address above mentioned information interaction is finished, and then peer-to-peer A and peer-to-peer C connect.
Can find out from above-described embodiment, allow the type of the peer-to-peer of connection by the purpose sign indication of connection message, so that the peer-to-peer that receives connection message determines according to the purpose sign whether self type and purpose in the connection message identify indicated type identical, if identical, then connect processing according to connection message, if not identical then finish, thus avoid setting up wrong network communication and the unnecessary ICE that brings thus mutual.
Embodiment two
Referring to shown in Figure 3, still take peer-to-peer A, the peer-to-peer B of the peer-to-peer network of dialogue-based initiation protocol, peer-to-peer C, peer-to-peer D as example, the type that the purpose sign indication that the below carries take connection message allows the peer-to-peer that connects as the resource peer-to-peer as example, method of attachment between the peer-to-peer of peer-to-peer network of dialogue-based initiation protocol is described, comprises:
1, the first peer-to-peer receives the step of the connection message of the second peer-to-peer transmission:
Referring among Fig. 4 shown in the step 31, peer-to-peer B notifies its routing table information to peer-to-peer A by the Update message cycle, peer-to-peer A transmits the routing table information structure connection message that comes and sends connection message according to peer-to-peer B, and the resource identification of the connection message that peer-to-peer A sends is set to the peer identification of peer-to-peer C.
Referring to Fig. 4, peer-to-peer C is on network, and shown in step 32 among Fig. 4, connection message sends to peer-to-peer C according to the resource identification route that it carries, i.e. the connection message of peer-to-peer A transmission is by waiting body C to receive;
Referring to Fig. 5, peer-to-peer C is not on network the time, if peer-to-peer D is responsible for taking over the resource on the peer-to-peer C, shown in step 32 among Fig. 5, connection message sends to peer-to-peer D according to the resource identification route that it carries, i.e. the connection message of peer-to-peer A transmission is received by peer-to-peer D.
2, the first peer-to-peer is determined whether identical step of the indicated type of its type and purpose sign:
Referring to Fig. 4, peer-to-peer C receives connection message, it is the resource peer-to-peer that purpose sign in the connection message is indicated the type of the peer-to-peer that connects processing by flag bit, peer-to-peer C confirms that further it has the resource corresponding with the resource identification of connection message, the type of expression peer-to-peer C is identical with the type that the purpose sign in the connection message is indicated, and then enters the step that connects processing;
Referring to Fig. 5, peer-to-peer C is not on network the time, peer-to-peer D receives connection message, it is the resource peer-to-peer that purpose sign in the connection message is indicated the type of the peer-to-peer that connects processing by flag bit, after peer-to-peer D confirms that further it has the resource corresponding with the resource identification of connection message, the type of expression peer-to-peer D is identical with the type that the purpose sign in the connection message is indicated, and then enters the step that connects processing.
3, the step that is connected with the second peer-to-peer of the first peer-to-peer:
Referring to Fig. 4, peer-to-peer C confirms that the resource identification of connection message is corresponding with the peer identification of peer-to-peer C, the expression connection message has been connected to correct peer-to-peer C, and peer-to-peer C makes correctly replying and finishes address information mutual (shown in step 33 among Fig. 4);
Referring to Fig. 5, peer-to-peer C is not on network the time, peer-to-peer D confirms that it has the resource corresponding with the resource identification of connection message, and the expression connection message has been connected to correct peer-to-peer, and peer-to-peer D makes correctly replying and finishes address information mutual (shown in step 34 among Fig. 5).
Can enter follow-up ICE negotiations process after above-mentioned peer-to-peer C or peer-to-peer D and peer-to-peer A address information are finished alternately, and then be connected by peer-to-peer C and peer-to-peer A, perhaps be connected by peer-to-peer D and peer-to-peer A.
In the present embodiment, peer-to-peer C or peer-to-peer D (when peer-to-peer C is not on network) store the resource corresponding with the resource identification of connection message, so, when the purpose of connection message is designated the connection resource peer-to-peer, it is identical with the type of purpose sign indication that peer-to-peer C or peer-to-peer D can judge self type, connects processing.In fact this be equivalent to connection message, and route sends to peer-to-peer C or peer-to-peer D (when peer-to-peer C is not on network) by the resource identification that carries.
By the above embodiments one and embodiment two as can be known, the second peer-to-peer sends the connection message that carries resource identification and purpose sign, according to this resource identification, connection message is routed transmission, the type that can receive the first peer-to-peer of this connection message has two kinds, a kind of is that the type of the first peer-to-peer is self peer-to-peer, and another kind is that the type of the first peer-to-peer is the resource peer-to-peer.Connection message further indicates again the particular type of the peer-to-peer that allows connection by the purpose sign, like this, the first peer-to-peer with the resource identification of connection message with itself peer identification or the resource of its storage whether carry out corresponding judgement identical to confirm the indicated type of himself type and purpose sign, confirm namely whether connection message attaches to the correct peer-to-peer that allow to connect, wrong peer-to-peer connects and the unnecessary ICE that brings thus is mutual thereby avoid setting up.
Embodiment three
As shown in Figure 6, the present embodiment proposes a kind of peer-to-peer, comprising:
Receiving element 41 is used for receiving connection message, and described connection message carries the purpose sign, and described purpose sign is used to indicate the peer type that described connection message permission connects;
Connect processing unit 42, be used for determining that described connection message allows the type of the peer type that connects and this peer-to-peer identical after, set up being connected between the peer-to-peer with the described connection message of transmission.
Further, the sign of the purpose in the described connection message indicates described connection message to allow the type of the peer-to-peer of connection by flag bit.The type of described peer-to-peer comprises self peer-to-peer and resource peer-to-peer.
Particularly, connect processing unit 42 and also comprise judgment sub-unit 421 and connexon unit 422, described connection message also carries resource identification:
When the type that allows to connect when purpose sign indication be self peer-to-peer, judgment sub-unit 421 described resource identifications of judgement and after the peer identification of described peer-to-peer equated, the connection between peer-to-peer was set up in connexon unit 422;
When the indication of purpose sign allowed the type of connection to be the resource peer-to-peer, after judgment sub-unit 421 judged that described peer-to-peer has the resource corresponding with described resource identification, the connection between peer-to-peer was set up in connexon unit 422.
Below, still take peer-to-peer A, the peer-to-peer B of the peer-to-peer network of dialogue-based initiation protocol, peer-to-peer C, peer-to-peer D as example, describe the detailed process that peer-to-peer connects in the peer-to-peer network in detail.
Referring to Fig. 4, the resource identification of the connection message that peer-to-peer A sends is set to the peer identification of peer-to-peer C, and the purpose sign of connection message indicates the type of the peer-to-peer that allows connection to be self peer-to-peer by flag bit.Peer-to-peer C is on network, shown in step 32 among Fig. 4, the receiving element 41 of peer-to-peer C receives connection message, the resource identification that judgment sub-unit 421 is determined connection message equates with the peer identification of peer-to-peer C, the expression connection message has been connected to correct peer-to-peer C, and connexon unit 422 carries out connecting between peer-to-peer the address information mutual (shown in step 33 among Fig. 4) of finishing dealing with.Afterwards, start ICE between peer-to-peer and consult, set up directly connection between peer-to-peer.
Referring to Fig. 5, the resource identification of the connection message that peer-to-peer A sends is set to the peer identification of peer-to-peer C, and the purpose sign of connection message indicates the type of the peer-to-peer that allows connection to be self peer-to-peer by flag bit.Peer-to-peer C is not on network, shown in step 32 among Fig. 5, the receiving element 41 of peer-to-peer D receives the connection message that peer-to-peer A sends, it is unequal that judgment sub-unit 421 is determined the peer identification of the resource identification of connection message and peer-to-peer D, the peer-to-peer that expression connection message expectation connects does not exist or deviated from network, peer-to-peer D points out faults in replying, and the follow-up negotiations processes such as ICE just do not need to start.
As from the foregoing, allow the type of the peer-to-peer of connection by the purpose sign indication of connection message, so that whether the peer-to-peer that receives connection message identifies identical according to purpose sign inspect-type with purpose in the connection message, if identical, then connect processing according to connection message, if not identical then finish, thus avoid setting up wrong network communication and the unnecessary ICE that brings thus mutual.
Referring to Fig. 4, the resource identification of the connection message that peer-to-peer A sends is set to the peer identification of peer-to-peer C again, and at this moment, it is the resource peer-to-peer that the purpose of connection message sign is indicated the type of the peer-to-peer that allows connection by flag bit.Peer-to-peer C is on network, shown in step 32 among Fig. 4, the receiving element 41 of peer-to-peer C receives the connection message that peer-to-peer A sends, judgment sub-unit 421 judges that peer-to-peer C has the resource corresponding with the resource identification of connection message, and connexon unit 422 carries out connecting between peer-to-peer the address information mutual (shown in step 33 among Fig. 4) of finishing dealing with.Afterwards, start the ICE negotiations process between peer-to-peer, set up directly connection between peer-to-peer.
Referring to Fig. 4, the resource identification of the connection message that peer-to-peer A sends is set to the peer identification of peer-to-peer C again, and at this moment, it is the resource peer-to-peer that the purpose of connection message sign is indicated the type of the peer-to-peer that allows connection by flag bit.Peer-to-peer C is not on network, and shown in step 32 among Fig. 5, the receiving element 41 of peer-to-peer D receives the connection message that peer-to-peer A sends.Judgment sub-unit 421 judges that peer-to-peer D has the resource corresponding with the resource identification of connection message, the expression connection message has been connected to correct peer-to-peer D, and connexon unit 422 carries out connecting between peer-to-peer the address information mutual (shown in step 34 among Fig. 5) of finishing dealing with.Afterwards, start the ICE negotiations process between peer-to-peer, set up directly connection between peer-to-peer.
As from the foregoing, peer-to-peer C or peer-to-peer D (when peer-to-peer C is not on network) store the resource corresponding with the resource identification of connection message, so, when the purpose of connection message is designated the connection resource peer-to-peer, it is identical with the type of purpose sign indication that peer-to-peer C or peer-to-peer D can judge self type, connects processing.In fact this be equivalent to connection message, and route sends to peer-to-peer C or peer-to-peer D (when peer-to-peer C is not on network) by the resource identification that carries.
The above; only for the better embodiment of the present invention, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.