Embodiment
The embodiment of the invention provides a kind of flow control methods of peer-to-peer network, after judging that the P2P protocol massages is the response message ACK1 of user's acquisition request P2P resource of P2P network, the P2P node with described P2P resource is carried out prioritization and is packaged into new response message ACK according to ranking results
2, with described response message ACK
2Be sent to described user so that described user connects with corresponding P2P node.The embodiment of the invention also provides corresponding routing device and a kind of communication system.Below be elaborated respectively.
Please refer to Fig. 1, the flow control methods basic procedure schematic diagram of a kind of peer-to-peer network that the embodiment of the invention one provides mainly comprises:
Step S101 receives network message and extraction P2P protocol massages wherein.
In embodiments of the present invention, can adopt deep-packet detection (DPI, Deep Packet Inspect) message that receives is carried out degree of depth identification, by resolving seven layers of heading or 7 layers of message content and compare, and then from message, extract the P2P protocol massages according to the tagged word of P2P agreement.This is extracted the P2P protocol massages rather than all messages is transferred to correlation module handle the workload that takies and reduce system that can reduce system resource.
Step S102 judges whether described P2P protocol massages is the response message ACK of user's acquisition request P2P resource
1
Generally speaking, if the user in the P2P network (promptly, the Peer of P2P network) (for example need obtain the P2P resource, file in download etc.), it at first sends a request of obtaining the P2P resource, and this request can be directly to be sent to P2P server (can think a special joint in the P2P network), also can be that the message mechanism by P2P (for example diffuses to a certain relevant P2P node in the P2P network, super node in the P2P network), the node of receiving request can feed back a response message ACK
1Whether therefore, need further analyze the P2P protocol massages that extracts from message, that is, be the response message ACK of user's acquisition request P2P resource of P2P network by the bed-by-bed analysis of protocol stack being judged the P2P protocol massages
1
Step S103 is if described P2P protocol massages is the response message ACK of user's acquisition request P2P resource
1, then described P2P node listing is optimized so that have the local P2P node of described P2P resource and come before the non-local P2P node that has described P2P resource.
As previously mentioned, receive that the node that the user obtains the request of P2P resource finally can feed back a response message ACK
1, response message ACK
1Comprise the P2P node listing, P2P node wherein is the P2P node that has the P2P resource of user's acquisition request, certainly, and response message ACK
1At least also the resource information that comprises these P2P resources, for example, P2P resource identification or P2P resource name etc.Receive this response message ACK
1Can be an intermediate node in the P2P network, for example, routing device.
Usually, any one the P2P node in the P2P network can be issued the relevant information of P2P resource, wherein comprises the resource identification of P2P resource and P2P IP addresses of nodes of this P2P resource of issue or the like.In embodiments of the present invention, can generate P2P Resource Properties information bank, these P2P Resource Properties can comprise frequency that the P2P resource is accessed with having the resource identification of the mapping relations of the P2P node of this P2P resource, the P2P IP addresses of nodes that has the P2P resource, P2P resource and/or P2P resource or the like.So, receive response message ACK
1Intermediate node can be according to response message ACK
1The resource information of middle P2P resource (for example, P2P resource identification or P2P resource name etc.), attribute information by this P2P resource in the inquiry P2P Resource Properties information bank obtains the P2P nodal information that has this P2P resource (the P2P IP addresses of nodes etc. that for example, has this P2P resource).
In embodiments of the present invention, (for example can generate network topological diagram, topological tree) and communication between domains cost bivariate table, comprised in the network topological diagram zone of each P2P node with respect to the communications cost of local zone (the user region of acquisition request P2P resource), each P2P node with respect to the user's communications cost that sends acquisition request P2P resource or each P2P node communications cost with respect to P2P node in the local network (user of acquisition request P2P resource).Wherein, network topological diagram can be according to static information, the for example generations such as mutual exclusion network segment information, IP address, cross-domain information and priority that provide of operator, the network topological diagram that this mode generates can satisfy the specific demand of localization, and, because network topological diagram is to generate according to static information, therefore, can strictness distinguish local P2P node and non-local P2P node according to network topological diagram; Network topological diagram also can be according to dynamic routing protocol, IGRP (IGP for example, Internal Gateway Protocol) or Exterior Gateway Protocol (EGP, External GatewayProtocol) generation such as dynamic routing that provides and communication between domains cost, this mode according to dynamic routing protocol generation network topological diagram can guarantee the real-time change of path priority and the maintenance workload that reduces static configuration, and, by the P2P node in the network topological diagram of IGP generation is local P2P node, is non-local P2P node by the P2P node in the network topological diagram of EGP generation.
Behind the P2P nodal information that obtains the P2P resource that has user's acquisition request, can further be optimized the P2P node listing, in embodiments of the present invention, can or be optimized the P2P node listing by following dual mode simultaneously by a kind of in the following dual mode.
Mode one, topology Network Based is optimized the P2P node listing, comprising:
S1, the area information of each P2P node is with the zone that the obtains described P2P node user's communications cost with respect to acquisition request P2P resource in the requester network topological diagram;
In embodiments of the present invention, the area information of each P2P node is with the zone that obtains described P2P node during with respect to the communications cost of local P2P node in the requester network topological diagram, can pay close attention to network topological diagram and be static that generate, dynamically generate or both combine and generate.
S2 resequences to local P2P node that has described P2P resource in the described P2P node listing and the non-local P2P node that has described P2P resource according to described communications cost, so that described local P2P node comes before the described non-local P2P node.
As previously mentioned, because can be (for example according to the information in the network topological diagram that generates by static information, each P2P IP addresses of nodes etc.) or network topological diagram be to generate or generate by IGP just to distinguish local P2P node and non-local P2P node by EGP, therefore, can be not difficult to distinguish local P2P node and the non-local P2P node that has identical P2P resource in the P2P node listing.
Mode two is optimized the P2P node listing based on the P2P resource information, comprising:
S1 judges whether have the non-local P2P node that has identical P2P resource with local P2P node in the P2P node listing according to the P2P nodal information.As previously mentioned, because the attribute information by this P2P resource in the inquiry P2P Resource Properties information bank can obtain the P2P nodal information that has this P2P resource, therefore, judge whether have the non-local P2P node that has identical P2P resource with local P2P node in the P2P node listing according to the P2P nodal information.
S2 if having, then directly substitutes the non-local P2P node that has identical P2P resource in the P2P node listing with local P2P node with local P2P node.
Similarly, because can be (for example according to the information in the network topological diagram that generates by static information, each P2P IP addresses of nodes etc.) or according to network topological diagram is to be generated or generated by EGP by IGP just to distinguish local P2P node and non-local P2P node, therefore, can be not difficult to distinguish local P2P node and the non-local P2P node that has identical P2P resource in the P2P node listing, directly local P2P node be substituted the non-local P2P node that has identical P2P resource in the P2P node listing with local P2P node.
Because local P2P node is lower than the user's communications cost of non-local P2P node and acquisition request P2P resource with the user's communications cost of acquisition request P2P resource, therefore, the user priority of acquisition request P2P resource connects with the local P2P node that has described P2P resource, obtains the P2P resource from local P2P node.
Optimize replenishing of P2P node listing modes as above-mentioned two kinds, when existing a plurality of local P2P nodes to have the P2P resource of user's acquisition request, then the P2P node listing be optimized also and comprise:
Compare each local P2P node and described user's communications cost respectively, will with the low local P2P node of described user's communications cost come with the high local P2P node of described user's communications cost before, the local the preceding P2P node of ordering connects in the user priority of acquisition request P2P resource and the P2P node listing, therefrom obtains the P2P resource.
Step S104 is packaged into new response message ACK with described through the P2P node listing of optimizing
2After be sent to described user so that the P2P node listing of described user after according to described optimization connects with corresponding P2P node.
In the present embodiment, response message ACK2 integral body can be sent to the user that described request is obtained the P2P resource, perhaps, the P2P node sequence is set up P2P and is connected in the P2P node listing that the user who considers acquisition request P2P resource not necessarily sends over according to integral body sometimes fully, in the present embodiment, also response message ACK2 can be split as a plurality of response messages and be sent to the user that described request is obtained the P2P resource, wherein, comprise the response message of described local P2P node listing prior to comprising the response message transmission of described non-local P2P node listing.Afterwards, the user sets up P2P with corresponding P2P node and is connected, and obtains the P2P resource.
Need to prove, because P2P node (Peer) difference that different routing devices is hung down in the same local network, for the P2P Resource Properties information in the same local network is consistent, in embodiments of the present invention, other P2P Resource Properties information banks in P2P Resource Properties information bank and the same local network can be carried out synchronously, specifically can be: connect by between routing device, setting up reliable TCP, the operation proprietary protocol, afterwards, P2P Resource Properties information is carried out between routing device by proprietary protocol alternately.
In addition, can also be according to monitoring result to P2P Resource Properties information bank, delete visit in the certain hour, renewal or the lower P2P Resource Properties information of usage frequency in the described P2P Resource Properties information bank, can reduce these P2P Resource Properties information like this to the taking of storage resources, improve operating factor of memory space.
From the invention described above embodiment as can be known, the present invention does not need to dispose high performance Cache servers, therefore seldom takies the resource of local device.By only preserving P2P Resource Properties information (rather than P2P resource itself) and making local P2P resource node come to have before the non-local P2P resource node of described P2P resource to being optimized, realized the localization of P2P network traffics, made the P2P network traffics of localization become orderly by confusion.Further, effectively utilize the local network bandwidth, reduce the metropolitan area network outlet bandwidth, make the P2P network traffics reduce, and closing the account between the operator also saved in the minimizing of flow between net the bandwidth demand of backbone network.
See also Fig. 2, a kind of routing device basic logical structure schematic diagram that the embodiment of the invention two provides.For convenience of explanation, only show the part relevant with the embodiment of the invention.The functional module that this routing device comprises can be software module, hardware module or the software and hardware module that combines, and below describes in detail.
P2P protocol massages extraction module 21 is used to receive network message and extraction P2P protocol massages wherein.
Finally can feed back a response message ACK owing to receive the node that the user obtains the request of P2P resource
1, response message ACK
1Comprise the P2P node listing, P2P node wherein is the P2P node that has the P2P resource of user's acquisition request, certainly, and response message ACK
1At least also the resource information that comprises these P2P resources, for example, P2P resource identification or P2P resource name etc.The intermediate node of P2P network, for example, routing device will receive response message ACK
1Adopt deep-packet detection (DPI by P2P protocol massages extraction module 21, DeepPacket Inspect) message that receives is carried out degree of depth identification, by resolving seven layers of heading or 7 layers of message content and compare, and then from message, extract the P2P protocol massages according to the tagged word of P2P agreement.This is extracted the P2P protocol massages rather than all messages is transferred to correlation module handle the workload that takies and reduce system that can reduce system resource.
Judge module 22 is used to judge whether the P2P protocol massages that described P2P protocol massages extraction module 21 extracts is the response message ACK of user's acquisition request P2P resource
1, that is, the P2P protocol massages that 22 pairs of P2P protocol massages of judge module extraction module 21 extracts from message further carries out the bed-by-bed analysis of protocol stack, thereby judges whether the P2P protocol massages is the response message ACK of user's acquisition request P2P resource of P2P network
1
Optimal module 23 is used for described judge module 22 and judges that the P2P protocol massages is the response message ACK of user's acquisition request P2P resource
1In time, be optimized described P2P node listing so that have the local P2P node of described P2P resource and come before the non-local P2P node that has described P2P resource, and it comprises acquiring unit 231 and sequencing unit 232.
Acquiring unit 231 is used to obtain the local P2P nodal information that has described P2P resource, and wherein, the user that described local P2P node and described request are obtained the P2P resource is in same local network;
Usually, any one the P2P node in the P2P network can be issued the relevant information of P2P resource, wherein comprises the resource identification of P2P resource and P2P IP addresses of nodes of this P2P resource of issue or the like.In embodiments of the present invention, can generate P2P Resource Properties information bank 209, these P2P Resource Properties can comprise frequency that the P2P resource is accessed with having the resource identification of the mapping relations of the P2P node of this P2P resource, the P2P IP addresses of nodes that has the P2P resource, P2P resource and/or P2P resource or the like.So, receive response message ACK when routing device
1The time, can be according to response message ACK
1The resource information of middle P2P resource (for example, P2P resource identification or P2P resource name etc.), the attribute information of acquiring unit 231 by this P2P resource in the inquiry P2P Resource Properties information bank 209 obtains the P2P nodal information that has this P2P resource (the P2P IP addresses of nodes etc. that for example, has this P2P resource).
In embodiments of the present invention, (for example can generate network topological diagram, topological tree) and communication between domains cost bivariate table, comprised in the network topological diagram zone of each P2P node with respect to the communications cost of local zone (the user region of acquisition request P2P resource), each P2P node with respect to the user's communications cost that sends acquisition request P2P resource or each P2P node communications cost with respect to P2P node in the local network (user of acquisition request P2P resource).Wherein, network topological diagram can be according to static information, the for example generations such as mutual exclusion network segment information, IP address, cross-domain information and priority that provide of operator, the network topological diagram that this mode generates can satisfy the specific demand of localization, and, because network topological diagram is to generate according to static information, therefore, can strictness distinguish local P2P node and non-local P2P node according to network topological diagram; Network topological diagram also can be according to dynamic routing protocol, IGRP (IGP for example, Internal Gateway Protocol) or Exterior Gateway Protocol (EGP, External GatewayProtocol) generation such as dynamic routing that provides and communication between domains cost, this mode according to dynamic routing protocol generation network topological diagram can guarantee the real-time change of path priority and the maintenance workload that reduces static configuration, and, by the P2P node in the network topological diagram of IGP generation is local P2P node, is non-local P2P node by the P2P node in the network topological diagram of EGP generation.
Sequencing unit 232 is used for the P2P nodal information that has described P2P resource that obtains according to described acquiring unit 231, and the P2P node listing is carried out prioritization, specifically can be by a kind of in the dual mode or simultaneously by following dual mode.
Mode one, topology Network Based is carried out prioritization to the P2P node listing:
S1, the area information of each P2P node is with the zone that the obtains described P2P node user's communications cost with respect to acquisition request P2P resource in the requester network topological diagram 210;
S2 resequences to local P2P node that has described P2P resource in the described P2P node listing and the non-local P2P node that has described P2P resource according to described communications cost, so that described local P2P node comes before the described non-local P2P node.
As previously mentioned, because can be (for example according to the information in the network topological diagram that generates by static information, each P2P IP addresses of nodes etc.) or network topological diagram be to generate or generate by IGP just to distinguish local P2P node and non-local P2P node by EGP, therefore, can be not difficult to distinguish local P2P node and the non-local P2P node that has identical P2P resource in the P2P node listing.
Mode two, based on the P2P resource information P2P node listing is carried out prioritization:
S1 judges whether have the non-local P2P node that has identical P2P resource with local P2P node in the P2P node listing according to the P2P nodal information.As previously mentioned, because the attribute information by this P2P resource in the inquiry P2P Resource Properties information bank can obtain the P2P nodal information that has this P2P resource, therefore, judge whether have the non-local P2P node that has identical P2P resource with local P2P node in the P2P node listing according to the P2P nodal information.
S2 if having, then directly substitutes the non-local P2P node that has identical P2P resource in the P2P node listing with local P2P node with local P2P node.
Similarly, because can be (for example according to the information in the network topological diagram that generates by static information, each P2P IP addresses of nodes etc.) or according to network topological diagram is to be generated or generated by EGP by IGP just to distinguish local P2P node and non-local P2P node, therefore, can be not difficult to distinguish local P2P node and the non-local P2P node that has identical P2P resource in the P2P node listing, directly local P2P node be substituted the non-local P2P node that has identical P2P resource in the P2P node listing with local P2P node.
Because local P2P node is lower than the user's communications cost of non-local P2P node and acquisition request P2P resource with the user's communications cost of acquisition request P2P resource, therefore, the user priority of acquisition request P2P resource connects with the local P2P node that has described P2P resource, obtains the P2P resource from local P2P node.
Optimize replenishing of P2P node listing modes as above-mentioned two kinds, when existing a plurality of local P2P nodes to have the P2P resource of user's acquisition request, then the P2P node listing be optimized also and comprise:
Compare each local P2P node and described user's communications cost respectively, will with the low local P2P node of described user's communications cost come with the high local P2P node of described user's communications cost before, the local the preceding P2P node of ordering connects in the user priority of acquisition request P2P resource and the P2P node listing, therefrom obtains the P2P resource.
Package module 24 is used for being packaged into new response message ACK with described through the P2P node listing of optimizing
2After be sent to described user so that described user connects with corresponding P2P node.Particularly, can be with described response message ACK
2Integral body is sent to described user, perhaps, perhaps, the P2P node sequence is set up P2P and is connected in the P2P node listing that the user who considers acquisition request P2P resource not necessarily sends over according to integral body sometimes fully, in the present embodiment, package module 24 also can use its split cells that comprises with described response message ACK
2Be split as a plurality of response messages and be sent to described user, wherein, the response message that comprises described local P2P node listing sends prior to the response message that comprises described non-local P2P node listing.Afterwards, the user connects with corresponding P2P node, obtains the P2P resource.
Further, routing device also comprises:
Chart generating module 25 is used to generate network topological diagram 210 and communication between domains cost bivariate table.
In embodiments of the present invention, can adopt chart generating module 25 to generate network topological diagram 210 (for example, topological tree) and communication between domains cost bivariate table.Wherein, comprised in the network topological diagram zone of each P2P node with respect to the communications cost of local zone, each P2P node with respect to the user's communications cost that sends acquisition request P2P resource or each P2P node communications cost with respect to P2P node in the local network (sending the user of acquisition request P2P resource).Network topological diagram 210 can be according to static information, for example generations such as mutual exclusion network segment information, IP address, cross-domain information and priority that provide of operator, and the network topological diagram 210 that this mode generates can satisfy the specific demand of localization; Also the dynamic routing that can provide according to dynamic routing protocol and and generation such as communication between domains cost, this mode that generates network topological diagram 210 according to dynamic routing protocol can guarantee the real-time change of path priority and the maintenance workload that reduces static configuration.Certainly, in embodiments of the present invention, the area information of each P2P node is with the zone that obtains described P2P node during with respect to the communications cost of local P2P node in the requester network topological diagram 210, can pay close attention to network topological diagram 210 and be static that generate, dynamically generate or both combine and generate.
P2P Resource Properties message processing module 26 is used to handle P2P Resource Properties information, and it further comprises attribute information storehouse generation unit 261, lock unit 262 and aging unit 263, wherein:
Attribute information storehouse generation unit 261, be used to generate P2P Resource Properties information bank 209, described P2P Resource Properties can comprise frequency that the P2P resource is accessed with having the resource identification of the mapping relations of the P2P node of this P2P resource, the P2P IP addresses of nodes that has the P2P resource, P2P resource and/or P2P resource or the like.
Because P2P node (Peer) difference that different routing devices is hung down in the same local network, for the P2P Resource Properties information in the same local network is consistent, in embodiments of the present invention, other P2P Resource Properties information banks carry out synchronously in the P2P Resource Properties information bank 209 that lock unit 262 generates described attribute information storehouse generation unit 261 and the same local network, that is, the real-time subelement synchronously of lock unit 262 carries out the real-time synchronous subelement of timing synchronous and/or lock unit 262 with other P2P Resource Properties information banks in described P2P Resource Properties information bank 209 and the same local network other P2P Resource Properties information banks in described P2P Resource Properties information bank and the same local network is carried out timing synchronously.Specifically can be: connect by set up reliable TCP between routing device, the operation proprietary protocol afterwards, carries out P2P Resource Properties information by proprietary protocol alternately between routing device.
In order to reduce lower P2P Resource Properties information the taking of visit in a period of time, renewal or usage frequency to storage resources, improve operating factor of memory space, visit in a period of time, renewal or the lower P2P Resource Properties information of usage frequency in the described P2P Resource Properties information bank 209 are deleted according to the monitoring result to described P2P Resource Properties information bank 209 in aging unit 263 in the embodiment of the invention.
From the invention described above embodiment as can be known, the present invention does not need to dispose high performance Cache servers, therefore seldom takies the resource of local device.By only preserving P2P Resource Properties information (rather than P2P resource itself) and making local P2P resource node come to have before the non-local P2P resource node of described P2P resource to being optimized, realized the localization of P2P network traffics, made the P2P network traffics of localization become orderly by confusion.Further, effectively utilize the local network bandwidth, reduce the metropolitan area network outlet bandwidth, make the P2P network traffics reduce, and closing the account between the operator also saved in the minimizing of flow between net the bandwidth demand of backbone network.
See also Fig. 3, a kind of communication system basic logical structure schematic diagram that the embodiment of the invention three provides.For convenience of explanation, only show the part relevant with the embodiment of the invention.The functional module that this communication system comprises can be software module, hardware module or the software and hardware module that combines, and below describes in detail.
Routing device 301 is used to receive the network message that described server sends and extracts P2P protocol massages wherein and judge whether described P2P protocol massages is the response message ACK of user's acquisition request P2P resource
1, if described P2P protocol massages is the response message ACK of user's acquisition request P2P resource
1, then to described response message ACK
1In the P2P node listing be optimized, be packaged into new response message ACK with described through the P2P node listing of optimizing
2After be sent to described user so that described user connects with corresponding P2P node, in the P2P node listing after described being optimized, the local P2P node that has described P2P resource comes before the non-local P2P node that has described P2P resource;
Server 302 is used to receive response message that the user obtains the request of P2P resource and send described request to described routing device 301.
Described routing device 301 comprises:
P2P protocol massages extraction module 3011 is used to receive network message and extraction P2P protocol massages wherein;
Judge module 3012 is used to judge whether the P2P protocol massages that described P2P protocol massages extraction module 3011 extracts is the response message ACK of user's acquisition request P2P resource
1Promptly, the P2P protocol massages that 3012 pairs of P2P protocol massages of judge module extraction module 3011 extracts from message further carries out the bed-by-bed analysis of protocol stack, thereby judges whether the P2P protocol massages is the response message ACK of user's acquisition request P2P resource of P2P network
1
Optimal module 3013 is used for described judge module 3012 and judges that the P2P protocol massages is the response message ACK of user's acquisition request P2P resource
1In time, be optimized so that have the local P2P node of described P2P resource and come before the non-local P2P node that has described P2P resource described P2P node listing;
Package module 3014 is used for being packaged into new response message ACK with described through the P2P node listing of optimizing
2After be sent to described user so that described user connects with corresponding P2P node.Particularly, can be with described response message ACK
2Integral body is sent to described user, and perhaps, the split cells that package module 3014 is comprised is with described response message ACK
2The response message that is split as a plurality of P2P of comprising node listings is sent to described user, and wherein, the response message that comprises the P2P node listing of described local P2P node sends prior to the response message of the P2P node listing that comprises described non-local P2P node.Afterwards, the user connects with corresponding P2P node, obtains the P2P resource.
In addition, routing device 301 can also comprise P2P Resource Properties message processing module 3015, is used for handling the P2P Resource Properties information of P2P Resource Properties information bank 3016.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to finish by program, this program can be stored in the computer-readable recording medium, storage medium can comprise: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc.
More than flow control methods, routing device and the communication system of peer-to-peer network that the embodiment of the invention provides is described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.