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 said P2P resource is carried out prioritization and is packaged into new response message ACK according to ranking results
2, with said response message ACK
2Be sent to said user so that said 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 sketch map of a kind of peer-to-peer network that the embodiment of the invention one provides mainly comprises:
Step S101 receives network message and extracts 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, through 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 and can reduce the workload that takies and reduce system to system resource.
Step S102 judges whether said 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) need obtain P2P resource (for example, file in download etc.), it at first sends a request of obtaining the P2P resource; This request can be directly to be sent to P2P server (can think a special joint in the P2P network); Also can be that message mechanism through P2P diffuses to a certain relevant P2P node (for example, the super node in the P2P network) in the P2P network, receive that the node of request can feed back a response message ACK
1Whether therefore, need further analyze the P2P protocol massages that from message, extracts, that is, be the response message ACK of user's acquisition request P2P resource of P2P network through the bed-by-bed analysis of protocol stack being judged the P2P protocol massages
1
Step S 103, if said P2P protocol massages is the response message ACK of user's acquisition request P2P resource
1, then said P2P node listing is optimized so that have the local P2P node of said P2P resource and come before the non-local P2P node that has said 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 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 the P2P resource and have 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 frequency that the P2P resource is visited 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 through 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, and 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; Generations such as dynamic routing that External Gateway Protocol) 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; P2P node by 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 through following dual mode simultaneously through 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 said 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 said 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 said P2P resource in the said P2P node listing and the non-local P2P node that has said P2P resource according to said communications cost, so that said local P2P node comes before the said 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 through 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 in the P2P node listing the non-local P2P node that has identical P2P resource with local P2P node with local P2P node.
Likewise; 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 substituted in the P2P node listing the non-local P2P node that has identical P2P resource 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 said 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 said user's communications cost respectively; Will with the low local P2P node of said user's communications cost come with the high local P2P node of said user's communications cost before; Ordering connects at preceding local P2P node 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 said through the P2P node listing of optimizing
2After be sent to said user so that the P2P node listing of said user after according to said optimization connects with corresponding P2P node.
In the present embodiment; Can response message ACK2 integral body 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 can response message ACK2 be split as a plurality of response messages and be sent to the user that described request is obtained the P2P resource; Wherein, the response message that comprises said local P2P node listing sends prior to the response message that comprises said 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, can other P2P Resource Properties information banks in P2P Resource Properties information bank and the same local network be carried out synchronously; Specifically can be: connect through between routing device, setting up reliable TCP; The operation proprietary protocol afterwards, carries out P2P Resource Properties information through proprietary protocol alternately between routing device.
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 said 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.
Can know that from the invention described above embodiment the present invention need not dispose high performance Cache servers, therefore seldom take the resource of local device.Through 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 said 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 sketch map that the embodiment of the invention two provides.For the ease 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 extracts 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; Deep Packet Inspect) message that receives is carried out degree of depth identification; Through 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 and can reduce the workload that takies and reduce system to system resource.
Judge module 22 is used to judge whether the P2P protocol massages that said 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 said 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 said P2P node listing so that have the local P2P node of said P2P resource and come before the non-local P2P node that has said 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 said P2P resource, and wherein, the user that said local P2P node and described request are obtained the P2P resource is in same local network;
Usually, any 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 the P2P resource and have 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 frequency that the P2P resource is visited 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 through 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, and 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; Generations such as dynamic routing that External Gateway Protocol) 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; P2P node by 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 said P2P resource that obtains according to said acquiring unit 231, and the P2P node listing is carried out prioritization, specifically can be through a kind of in the dual mode or simultaneously through 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 said 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 said P2P resource in the said P2P node listing and the non-local P2P node that has said P2P resource according to said communications cost, so that said local P2P node comes before the said 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 through 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 in the P2P node listing the non-local P2P node that has identical P2P resource with local P2P node with local P2P node.
Likewise; 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 substituted in the P2P node listing the non-local P2P node that has identical P2P resource 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 said 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 said user's communications cost respectively; Will with the low local P2P node of said user's communications cost come with the high local P2P node of said user's communications cost before; Ordering connects at preceding local P2P node 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 said through the P2P node listing of optimizing
2After be sent to said user so that said user connects with corresponding P2P node.Particularly, can be with said response message ACK
2Integral body is sent to said 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, and in the present embodiment, package module 24 also can use its split cells that comprises with said response message ACK
2Be split as a plurality of response messages and be sent to said user, wherein, the response message that comprises said local P2P node listing sends prior to the response message that comprises said 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, the 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; The dynamic routing that also can provide according to dynamic routing protocol and with 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 said 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, said P2P Resource Properties can comprise the P2P resource and have 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 frequency that the P2P resource is visited 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 said 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 said P2P Resource Properties information bank 209 and the same local network other P2P Resource Properties information banks in said P2P Resource Properties information bank and the same local network is carried out timing synchronously.Specifically can be: connect through between routing device, setting up reliable TCP, the operation proprietary protocol afterwards, carries out P2P Resource Properties information through 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 said P2P Resource Properties information bank 209 are deleted according to the monitoring result to said P2P Resource Properties information bank 209 in aging unit 263 in the embodiment of the invention.
Can know that from the invention described above embodiment the present invention need not dispose high performance Cache servers, therefore seldom take the resource of local device.Through 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 said 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 sketch map that the embodiment of the invention three provides.For the ease 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 said server sends and extracts P2P protocol massages wherein and judge whether said P2P protocol massages is the response message ACK of user's acquisition request P2P resource
1, if said P2P protocol massages is the response message ACK of user's acquisition request P2P resource
1, then to said response message ACK
1In the P2P node listing be optimized, be packaged into new response message ACK with said through the P2P node listing of optimizing
2After be sent to said user so that said user connects with corresponding P2P node, in the P2P node listing after said being optimized, the local P2P node that has said P2P resource comes before the non-local P2P node that has said P2P resource;
Server 302 is used to receive the user and obtains the request of P2P resource and send response message to the said routing device 301 of described request.
Said routing device 301 comprises:
P2P protocol massages extraction module 3011 is used to receive network message and extracts P2P protocol massages wherein;
Judge module 3012 is used to judge whether the P2P protocol massages that said 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 said 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 said P2P resource and come before the non-local P2P node that has said P2P resource said P2P node listing;
Package module 3014 is used for being packaged into new response message ACK with said through the P2P node listing of optimizing
2After be sent to said user so that said user connects with corresponding P2P node.Particularly, can be with said response message ACK
2Integral body is sent to said user, and perhaps, the split cells that package module 3014 is comprised is with said response message ACK
2The response message that is split as a plurality of P2P of comprising node listings is sent to said user, and wherein, the response message that comprises the P2P node listing of said local P2P node sends prior to the response message of the P2P node listing that comprises said 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 accomplish through 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 embodiment 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.