WO2012129794A1 - P2p网络中的通信方法、网络节点及网络超级节点 - Google Patents

P2p网络中的通信方法、网络节点及网络超级节点 Download PDF

Info

Publication number
WO2012129794A1
WO2012129794A1 PCT/CN2011/072305 CN2011072305W WO2012129794A1 WO 2012129794 A1 WO2012129794 A1 WO 2012129794A1 CN 2011072305 W CN2011072305 W CN 2011072305W WO 2012129794 A1 WO2012129794 A1 WO 2012129794A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
destination
source
super
message
Prior art date
Application number
PCT/CN2011/072305
Other languages
English (en)
French (fr)
Inventor
李国怀
姚雪峰
Original Assignee
青岛海信传媒网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 青岛海信传媒网络技术有限公司 filed Critical 青岛海信传媒网络技术有限公司
Priority to PCT/CN2011/072305 priority Critical patent/WO2012129794A1/zh
Priority to CN201180004047XA priority patent/CN102742225A/zh
Publication of WO2012129794A1 publication Critical patent/WO2012129794A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/26Network addressing or numbering for mobility support
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a communication method, a network node, and a network super node in a P2P network. Background technique
  • P2P Peer-to-Peer
  • a P2P network is a distributed network.
  • P2P network nodes share a part of the hardware resources they have, including: the processing power, storage capacity, network connection capability of the participants, etc.; Provides services and content that can be accessed directly by other peers (Pier) without going through intermediate entities.
  • P2P network nodes are both providers of resources (services and content) and acquirers of resources (services and content) (C li ent ). All P2P network nodes dynamically participate in routing, information processing and bandwidth enhancement. In operation, it acts as both a client and a server for other nodes on the network.
  • Embodiments of the present invention provide a communication method, a network node, and a network super node in a P 2 P network, which can reduce network overhead and storage overhead, avoid network congestion, and provide a simple routing algorithm.
  • the technical solution adopted by the embodiment of the present invention is:
  • a communication method in a P2P network comprising: a source node sending a message to an associated source super node, where the message includes a message header and a message body, where the message header includes an overlay network address of the source node and the destination node, The overlay network address includes a domain identifier and a subdomain identifier;
  • the source super node sends the message to the destination super node to which the destination node belongs; the destination super node sends the message to the destination node.
  • a communication method in a P2P network including:
  • the source node sends a request message to the associated source super node to request communication with the destination node, where the request message includes an overlay network address of the source node and the destination node, where the overlay network address includes a domain identifier and a sub-domain identifier;
  • the source super node establishes a connection between the source node and the destination node according to an overlay network address of the destination node;
  • the source node sends a message to the destination node.
  • a network node including:
  • a first sending module configured to: when the network node is a source node, send a message to the source super node to enable the source super node to send the message to the destination super node to which the destination node belongs,
  • the message includes a message header and a message body, where the message header includes an overlay network address of the source node and the destination node, and the overlay network address includes a domain identifier and a sub-domain identifier;
  • the first receiving module is configured to receive, when the network node is a destination node, a message sent by the associated destination super node.
  • a network super node including:
  • a second receiving module configured to: when the network super node is a source super node, receive a message sent by the source node, where the message includes a message header and a message body, where the message header includes the source node and the destination node Superimposing a network address, where the overlay network address includes a domain identifier and a sub-domain identifier;
  • a second sending module configured to send the message to the destination super node to which the destination node belongs, so that the destination super node sends the message to the destination node.
  • a network node including:
  • a third sending module configured to: when the network node is a source node, send a request message to the source super node to request communication with the destination node, where the request message includes an overlay network address of the source node and the destination node,
  • the overlay network address includes a domain identifier and a sub-domain identifier to enable the source
  • the super node establishes a connection between the source node and the destination node according to the overlay network address of the destination node;
  • a fourth sending module configured to send a message to the destination node.
  • a network super node including:
  • a third receiving module configured to: when the network super node is a source super node, receive a request message sent by the source node, where the request message is used to request communication with the destination node, where the request message includes a source node and a destination An overlay network address of the node, where the overlay network address includes a domain identifier and a child i or an identifier;
  • connection establishing module configured to establish a connection between the source node and the destination node according to an overlay network address of the destination node.
  • the source node sends a message including the superimposed network address of the source node and the destination node to the associated source super node, and the source super node sends the message to the destination.
  • the destination super node to which the node belongs the destination super node sends the message to the destination node; or the source node sends a request message including the superimposed network address of the source node and the destination node to the associated source super node, requesting communication with the destination node.
  • the source super node establishes a connection between the source node and the destination node according to the overlay network address of the destination node, and the source node sends a message to the destination node.
  • the embodiment of the present invention implements a simple routing algorithm based on DomainID (Domain ID) and SubDomainlD (Sub-Domain Identification); and controls synchronization of super node information in the domain, and synchronously controls node information. In the sub-domain, this can reduce network overhead and storage overhead, and avoid network congestion. Moreover, a large message routing method can be implemented to reduce network overhead as much as possible.
  • FIG. 1a is a flowchart of a method according to Embodiment 1 of the present invention.
  • FIG. 1b is a network architecture diagram of a 0 ve r 1 ay network according to Embodiment 1 of the present invention
  • FIG. 1C is a flowchart of a method for a SN to join a 0 ve r 1 ay network according to Embodiment 1 of the present invention
  • FIG. 1 is a flowchart of a method for joining Peer to a 0 ve r 1 ay network according to Embodiment 1 of the present invention
  • 2a is a schematic diagram of a network structure provided by Embodiment 2 of the present invention
  • FIG. 2b is a flowchart of a method according to Embodiment 2 of the present invention.
  • FIG. 3 is a schematic structural diagram of a network according to Embodiment 3 of the present invention.
  • FIG. 3b is a flowchart of a method according to Embodiment 3 of the present invention.
  • Embodiment 4 is a flowchart of a method according to Embodiment 4 of the present invention.
  • FIG. 5 is a schematic structural diagram of a network according to Embodiment 5 of the present invention.
  • FIG. 5b is a flowchart of a method according to Embodiment 5 of the present invention.
  • FIG. 6a is a schematic structural diagram of a network according to Embodiment 6 of the present invention.
  • FIG. 6b is a flowchart of a method according to Embodiment 6 of the present invention.
  • FIG. 7a is a schematic structural diagram of a network according to Embodiment 7 of the present invention.
  • FIG. 7b is a flowchart of a method according to Embodiment 7 of the present invention.
  • FIG. 8 is a schematic structural diagram of a network according to Embodiment 8 of the present invention.
  • Embodiment 8b is a flowchart of a method according to Embodiment 8 of the present invention.
  • FIG. 9 is a schematic structural diagram of a network node according to Embodiment 9 of the present invention.
  • 10a, 10b, and 10c are schematic structural diagrams of a network super node according to Embodiment 10 of the present invention.
  • FIG. 11 is a schematic structural diagram of a network node according to Embodiment 11 of the present invention.
  • 12a, 12b, 12c, 12d, and 12e are schematic structural diagrams of a network super node according to Embodiment 12 of the present invention. detailed description
  • the embodiment provides a communication method in a P2P network. As shown in FIG.
  • the source node sends a message to the associated source super node, where the message includes a message header and a message body, the message header includes an overlay network address of the source node and the destination node, and the overlay network address includes an i or an identifier. And child i or logo.
  • the source super node sends the message to a destination super node to which the destination node belongs.
  • the destination super node sends the message to the destination node.
  • the source super node to which it belongs refers to a super node having the same domain identifier and subdomain identifier as the source node; for the destination node, the destination super node to which it belongs refers to the purpose
  • a node has a super node with the same domain ID and subdomain ID.
  • FIG. lb it is the network architecture diagram of the Over lay network (overlay network).
  • the node or network node is represented by Peer, which refers to the terminal in the Overlay network, which may be an application server or an application terminal; the super node or the network super node is represented by SN (Super Node), which refers to a peer server node.
  • the startup super node is represented by BSSN (Boot Star t Super Node). It is an SN in technical implementation. It only takes more functions than SN. It helps other SNs and Peers to join the Overlay network. There is no difference between BSSN and SN, just from deployment. From the perspective, select some SNs as BSSNs; clusters of SN or BSSN form the Over lay network.
  • the method for the super node (SN) to join the Overlay network includes:
  • SN A send a p ing command to BSSN 1.
  • L3, SN A sends a p ing command to BSSN 2.
  • L4, BSSN 2 return their own load information.
  • SN A selects a lightly loaded BSSN from BSSN 1 and BSSN 2. In this embodiment, it is assumed that the load of BSSN 1 is light.
  • the SN A sends a request message to the BSSN 1 to request to join the Overlay network, where the request message includes DomainlD and SubDomainID of the SN A.
  • L7, BSSN According to SNA's DomainlD and SubDomainlD, select the available SN. Specifically, if an SN having the same Domain1D and SubDomainlD as the SN A can be found in the Overlay network, a part of the SNs are randomly selected; if there is no SN having the same SubDomain1D as the SN A in the Over lay network, Then, a part of the SN having the same Domain1D as the SN A is randomly selected; if there is no SN of the same Domain1D as the SN A in the Overlay network, it indicates that the SN A cannot join the Overlay network, and the BSSN 1 returns an error message to the SN A.
  • BSSN 1 returns the available SN to SN A.
  • SN A randomly selects one of the available SNs, where the SNB selects the SNB, and the SNA obtains information about all SNs in the Domain from the SN B, and information about all Peers in the SubDomain.
  • SN A returns all the information of the SN in the Domain to the SN B, and the information of all Peers in the SubDomain.
  • the SN disconnects from the Overlay network due to network reasons, it will automatically try to re-enter the Over 1 ay network.
  • the method for the node (Peer) to join the Overlay network includes:
  • Peer A sends a ping command to BSSN 1, where the ping command includes the IP address of Peer A.
  • BSSN 1 obtains its own load information, and compares the IP address of Peer A with the IP address of the Peer obtained from the Socket. If the two IP addresses are the same, it indicates that Peer A is under NAT, otherwise Peer A is not under NAT.
  • BSSN 1 returns its own load information to Peer A and informs Peer A if it is under NAT. 54. Peer A sends a p ing command to BSSN 2, where the ping command includes the IP address of Peer A.
  • BSSN 2 obtains its own load information, and compares the IP address of Peer A with the IP address of the Peer obtained from the Socket. If the two IP addresses are the same, it indicates that Peer A is under NAT, otherwise Peer A is not under NAT.
  • BSSN 2 returns its own load information to Peer A and informs Peer A if it is under NAT.
  • Peer A selects a lightly loaded BSSN from BSSN 1 and BSSN 2. In this embodiment, it is assumed that the load of BSSN 1 is light.
  • Peer A sends a request message to the BSSN 1 to request to join the Overlay network, where the request message includes Peer A's Doma inID and SubDoma inID.
  • BSSN 1 searches according to Peer A's Doma inID and SubDoma inlD, and selects available.
  • BSSN 1 returns the available SN to Peer A.
  • Peer A randomly selects one of the available SNs, where SN A is selected.
  • Peer A and SN A establish a TCP long connection.
  • SN A is marked in memory Peer A belongs to its own management.
  • Peer only establishes connections with SNs that have the same Doma inID and SubDoma inlD, which makes Peer grouping very easy to implement and facilitates network planning and load balancing.
  • the following methods can be used to synchronize the SN information and the Peer information.
  • the source SN randomly selects some destination SNs, and then the information about the online SNs that it knows itself and the SN, such as the IP address of the SN.
  • the DomainID and the SubDomainID notify the selected destination SNs, and the notification may be a TCP (Transmission Control Protocol) message or a UDP (User Datagram Protocol) message.
  • the destination SN also informs the source SN of the source SN that the source SN does not know. In this way, the information of the SN can be synchronized by pushing and pulling.
  • the following methods may be used: For any source SN, other SN information is recorded in the memory, and the information of the SN includes two parameters: round (number of rotations) and sequence (SN's logical clock).
  • the parameter Round is used to control the excessive flooding of the message.
  • the parameter sequence is used to indicate the freshness of the SN information.
  • the SN sets its own round to a value that controls the number of times this SN information can be propagated each round; also at fixed time intervals, for example Each time a heartbeat message is sent, the SN increments its own sequence by one.
  • the round value of these SNs is decremented by 1.
  • the round value is subtracted by 1 until it is reduced to 0. So far, it is possible to prevent the information of the same SN from being excessively propagated.
  • the destination SN receives the propagated SN information, it compares the sequence of the SN in the message with the sequence of the SN in the memory, and the sequence value of the SN in the message is larger, indicating that the SN information in the message is more fresh, and will be used.
  • the information of the SN in the message covers the information of the SN in the memory; otherwise, the SN information in the memory is more fresh, and no operation is required.
  • the source SN randomly selects some destination SNs, and then information about the peer Peer that it knows itself and itself, such as Peer's IP address, Doma inlD, SubDoma inlD, whether Peer is under NAT, and the current SN notification. These selected purpose SNs.
  • the method of notification can be a TCP message or a UDP message.
  • the destination SN also informs the source SN of the online peer that it knows and the source SN does not know. In this way, Peer's information can be synchronized by pushing and pulling.
  • any SN in the Doma in knows the information of all the SNs in the Doma in; by controlling the synchronization of the Peer information in the SubDoma in, a SubDoma in can be realized. Any SN knows all Peer information in the SubDoma in.
  • the network overhead and storage overhead can be reduced by controlling the synchronization of the Peer information in the SubDoma in.
  • the source node sends a message including the address of the overlay network of the source node and the destination node to the associated source super node, and the source super node sends the message to the destination super node to which the destination node belongs.
  • the destination super node sends the message to the destination node.
  • the embodiment of the present invention implements a simple routing algorithm based on DomainlD (Domain Identity) and SubDomainlD (Subdomain Identity); and controls synchronization of supernode information in the domain to synchronize control of node information. In the sub-domain, this can reduce network overhead and storage overhead and avoid network congestion.
  • This embodiment provides a communication method in a P2P network.
  • SN A and SN B belong to the same Doma in and SubDoma in, Peer A and SN A are connected, and Peer B and SN are connected.
  • B is connected, Peer A is the source Peer, Peer B is the destination Peer, and Peer A sends the message to Peer B.
  • the method includes: 201.
  • Peer A sends a message to Peer B, it first sends a message to SN A.
  • the message includes at least two parts: a message header and a message body, where the message header includes an Over lay address of Peer A and Peer B, and the message body is a message content sent by Peer A to Peer B.
  • the Overlay address is a unique address identifier of the Peer in the Overlay network, and the format is similar to the Email address format: ****@DomainID. SubDomainID, the total length does not exceed 32 bytes.
  • the Overlay address can be used to plan naming rules according to specific application scenarios.
  • the address format of the STB Set Top Box Terminal
  • STB Set Top Box Terminal
  • Example 3 Port: STB with a subscriberid of 123456789, a DomainID of 1, and a SubDomainID of 12 ( ⁇ 6 1& address is 8 D 8123456789@1, 12.
  • Domain is a domain, is a logical concept, Overlay network deployer gives its specific concept, it can correspond to a city or an enterprise LAN; DomainID is the only 32-bit non-negative integer assigned to the Domain, To indicate the Domain; SubDomain is a subdomain in the Domain, SubDomainID is !! Wu Yu SubDomain's unique 32-bit non-integer value to indicate the SubDoma in.
  • SN A analyzes the Overlay address of the destination peer, and finds that Peer B belongs to the same domain and SubDoma in with respect to itself, so the information of Peer B is stored in the cache of SN A, and then SN A queries the Peer information in the cache, where The Peer information includes which SN the Peer belongs to, that is, which SN is connected to the Peer, and the Peer B is connected to the SN B after the query.
  • the SN A sends the message to the SN B.
  • the SN B query finds that it is connected to Peer B.
  • the SN B sends the message to Peer B.
  • the source Peer sends a message including the source Peer and the destination Peer of the overlay network address to the associated source SN, and the source SN will The message is sent to the destination SN to which the destination peer belongs, and the destination SN sends the message to the destination peer.
  • the embodiment of the present invention is based on DomainID (domain identifier oSubDomainID (Subdomain ID) A simple routing algorithm is implemented.
  • This embodiment provides a communication method in a P2P network.
  • SN A, SN B, and SN C belong to the same Doma in, and SN A belongs to SubDoma in 1 , SN B and SN.
  • C belongs to SubDoma in 2, Peer A and SN A are connected, Peer B is connected to SN B, Peer A is the source Peer, Peer B is the destination Peer, and Peer A sends a message to Peer B.
  • the method includes:
  • Peer A When Peer A sends a message to Peer B, it first sends a message to SN A.
  • the message includes at least two parts: a message header and a message body, where the message header includes an Overlay address of the source Peer and the destination Peer, and the message body is the source Peer that sends the message content of the destination Peer.
  • SN A analyzes the Over lay address of Peer B, and finds that Peer B belongs to the same Doma in with respect to itself, but belongs to different SubDoma in, so there is no information for storing Peer B in the cache of SN A, and SN A only needs to The message is sent to the SN with the same Doma in and SubDoma in as Peer B. Since the information of the SN is known to each other within the same Doma in, SN A knows which SN and Peer B have the same Doma in and SubDoma in. In this embodiment, it is assumed that SN A selects SN C.
  • the SN A sends the message to the SN C.
  • SN C analyzes the Overlay address of the destination peer, and finds that Peer B belongs to the same Doma in and SubDoma in relative to itself, so the information of Peer B is stored in the cache of SN C, and then SN C queries the Peer information in the cache.
  • the Peer information includes the SN to which the Peer belongs, that is, which SN is connected to the Peer, and the Peer B is connected to the SN B after the query.
  • the SN C sends the message to the SN B.
  • the SN B query finds that it is connected to Peer B.
  • the SN B sends the message to Peer B.
  • the source peer sends a message including the source peer and the destination peer of the destination peer to the source SN.
  • the source SN sends the message to the destination SN to which the destination peer belongs, and the destination SN sends the message.
  • the embodiment of the present invention implements a simple routing algorithm based on DomainID (Domain Identity) and SubDomainID (Subdomain Identity).
  • the embodiment provides a communication method in a P2P network. As shown in FIG. 4, the method includes:
  • the source node sends a request message to the source super node to request communication with the destination node, where the request message includes an overlay network address of the source node and the destination node, where the overlay network address includes a domain identifier and a sub-domain identifier.
  • the source super node establishes a connection between the source node and the destination node according to an overlay network address of the destination node.
  • the source node sends a message to the destination node.
  • the source node sends a request message including the superimposed network address of the source node and the destination node to the associated source super node, requesting communication with the destination node, and the source super node according to the overlay network of the destination node
  • the address establishes a connection between the source node and the destination node, and the source node sends a message to the destination node.
  • the embodiment of the present invention implements a simple routing algorithm based on DomainID (subdomain identifier) and SubDomainID (subdomain identifier); and implements a routing method for large messages, which can reduce network overhead as much as possible.
  • This embodiment provides a communication method in a P2P network.
  • SN A and SN B belong to the same Doma in and SubDoma in, Peer A and SN A are connected, and Peer A is not in NAT. (Network Addres s Trans la t ion, network address translation)
  • Peer B and SN B are connected and Peer B is not under NAT, Peer A is source Peer, Peer B is destination Peer; Peer A is sending messages to Peer B Large body.
  • the method includes:
  • Peer A sends a request message to SN A, requesting to obtain the IP address of Peer B, where The request message includes the Over lay address of Peer P and Peer B.
  • the SN A obtains the IP address of the Peer B according to the Overlay address of the Peer A and Peer B.
  • SN A analyzes the Over lay address of the destination peer, and finds that Peer B belongs to the same Doma in and SubDoma in relative to itself, so the information of Peer B is stored in the cache of SN A, and then SN A queries the Peer information in the cache.
  • the peer information includes the IP address of the peer, and the IP address of the peer B is obtained after the query.
  • SN A sends the IP address of Peer B to Peer A.
  • Peer A establishes a connection with Peer B according to the IP address of Peer B.
  • Peer A sends a message to Peer B.
  • the source Peer sends a request message including the source Peer and the destination Peer of the overlay network address to the associated source SN, requesting In communication with the destination peer, the source SN returns the IP address of the destination peer to the source peer according to the overlay network address of the destination peer, and the source peer establishes a connection with the destination peer according to the IP address of the destination peer and sends a message to the destination peer.
  • the embodiment of the present invention implements a simple routing algorithm based on the DomainID (subdomain identifier) and the SubDomainID (sub-domain identifier); and implements a routing method for large messages, which can reduce network overhead as much as possible.
  • This embodiment provides a communication method in a P2P network.
  • SN A and SN B belong to the same Doma in and SubDoma in, Peer A and SN A are connected, and Peer A is not in NAT.
  • Peer B and SN B are connected, Peer B is under NAT, Peer A is source Peer, Peer B is destination Peer; Peer A sends a message message to Peer B.
  • the method includes:
  • the Peer A sends a request message to the SN A, requesting to communicate with the Peer B, where the request message includes the IP address of the Peer A and the Over lay address of the Peer B.
  • Peer A Since Peer A is not under the NAT, the connection between SN A and Peer A does not require TCP. Long connection, you can use TCP short connection or UDP message, Peer A only need to inform the SN's own message receiving end.
  • the SN A sends the IP address of the Peer A to the SN B connected to the Peer B according to the Overlay address of the Peer B.
  • SN B sends the IP address of Peer A to Peer B.
  • Peer B establishes a connection with Peer A according to the IP address of Peer A.
  • Peer A sends a message to Peer B.
  • the source Peer sends a request including the IP address of the source Peer and the overlay network address of the destination Peer to the associated source SN.
  • the source SN sends the IP address of the source peer to the destination peer.
  • the destination peer establishes a connection with the source peer according to the IP address of the source peer, and the source peer sends a message to the destination peer.
  • the embodiment of the present invention implements a simple routing algorithm based on the DomainID (subdomain identifier) and the SubDomainID (subdomain identifier); and implements a routing method for large messages, which can reduce network overhead as much as possible.
  • This embodiment provides a communication method in a P2P network.
  • SN A and SN B belong to the same Doma in and SubDoma in, Peer A and SN A are connected, and Peer A is in NAT.
  • Peer B and SN B are connected, Peer B is under NAT, Peer A is source Peer, Peer B is destination Peer; Peer A sends a message message to Peer B.
  • the method includes:
  • the Peer A sends a request message to the SN A, requesting to communicate with the Peer B, where the request message includes an Over lay address of Peer A and Peer B.
  • the SN A sends the IP address of the SN A to the Peer B according to the Overlay address of the Peer B. Connected SN B.
  • the SN B sends the IP address of the SN A to the Peer B.
  • Peer B establishes a connection with SN A according to the IP address of SN A.
  • SN A establishes a connection with Peer A.
  • Peer A sends a message to Peer B through SN A.
  • SN A acts as a transit SN, and relays messages transmitted between Peer A and Peer B.
  • SN B can also be selected as the transit SN, or the load is selected in the Over lay where SN A and SN B are located.
  • Light SN as a transit SN.
  • the source Peer sends a request message including the source Peer and the destination Peer of the overlay network address to the associated source SN, and the request and destination Peer To communicate, the source SN sends the IP address of the source SN to the destination peer through the destination SN, the destination peer establishes a connection with the source SN, the source SN establishes a connection with the source peer, and the source peer sends a message to the destination peer through the source SN.
  • the embodiment of the present invention implements a simple routing algorithm based on the DomainID (subdomain identifier) and the SubDomainID (sub-domain identifier); and implements a routing method for large messages, which can reduce network overhead as much as possible.
  • This embodiment provides a communication method in a P2P network.
  • SN A and SN B belong to the same Doma in, SN A belongs to SubDoma in 1 , and SN B belongs to SubDoma in 2 .
  • Peer A is connected to SN A and Peer A is under NAT.
  • Peer B is connected to SN B and Peer B is not under NAT.
  • Peer A is the source Peer and Peer B is the destination Peer.
  • the message sent by Peer A to Peer B is smaller. Big.
  • the method includes:
  • the Peer A sends a request message to the SN A, requesting to communicate with the Peer B, where the request message includes an Over lay address of Peer A and Peer B.
  • SN A analyzes the Over lay address of Peer B, and finds that Peer B belongs to the same Doma in with respect to itself, but belongs to different SubDoma in, so there is no Peer B stored in the cache of SN A. Information, SN A only needs to send this message to the SN with the same Doma in and SubDoma in as Peer B. Since the information of the SN is known to each other in the same Doma in, SN A knows which SN and Peer B have the same Doma in and SubDoma in, and in this embodiment, it is assumed that SN A selects SN B.
  • the SN A sends a request message to the SN B.
  • SN B obtains the IP address of Peer B according to Peer B's Over lay address.
  • the SN B sends the IP address of the Peer B to the SN A.
  • SN A sends the IP address of Peer B to Peer A.
  • Peer A establishes a connection with Peer B according to the IP address of Peer B.
  • Peer A sends a message to Peer B.
  • the source peer in the same Domain and different SubDoma in, sends a request message including the overlay peer address of the source peer and the destination peer to the associated source SN, and the request is performed with the destination peer.
  • the source SN obtains the IP address of the destination peer by the SN having the same Doma in and SubDoma in as the destination peer, and sends the IP address to the source peer, and the source peer establishes a connection with the destination peer according to the IP address of the destination peer and sends a message to the destination peer.
  • the embodiment of the present invention implements a simple routing algorithm based on the DomainID (subdomain identifier) and the SubDomainID (sub-domain identifier); and implements a routing method for large messages, which can reduce the network overhead as much as possible.
  • the network node includes:
  • the first sending module 901 is configured to: when the network node is a source node, send a message to the source super node to enable the source super node to send the message to the destination super node to which the destination node belongs,
  • the message includes a message header and a message body, where the message header includes an overlay network address of the source node and the destination node, and the overlay network address includes a domain identifier and a sub-domain identifier;
  • the first receiving module 902 is configured to receive, when the network node is a destination node, a message sent by the associated destination super node.
  • the network node of the embodiment of the present invention sends a message to the source super-node when the network node is the source node, so that the source super-node sends the message to the destination super node to which the destination node belongs;
  • the embodiment of the present invention implements a simple routing algorithm based on DomainID (Domain Identity) and SubDomainID (Subdomain Identity).
  • the network super node includes: a second receiving module 1 001, configured to send, when the network super node is a source super node, a message, the message includes a message header and a message body, the message header includes an overlay network address of the source node and the destination node, the overlay network address includes a domain identifier and a sub-domain identifier; and the second sending module 1 002, And sending the message to the destination super node to which the destination node belongs, so that the destination super node sends the message to the destination node.
  • a second receiving module 1 001 configured to send, when the network super node is a source super node, a message, the message includes a message header and a message body, the message header includes an overlay network address of the source node and the destination node, the overlay network address includes a domain identifier and a sub-domain identifier; and the second sending module 1 002, And sending the message to the destination super node to which the destination node belongs, so that the destination super node
  • the second sending module 1 002 may include:
  • the first query unit 10021 is configured to query, according to the overlay network address of the destination node, the destination super node to which the target node belongs;
  • the first sending unit 10022 is configured to send the message to the destination super node to which the destination node belongs.
  • the second sending module 1 002 when the source super node and the destination super node belong to the same domain and different subdomains, the second sending module 1 002 includes:
  • the second query unit 10023 is configured to query, according to the overlay network address of the destination node, an intermediate super node that belongs to the same domain and the subdomain as the destination node;
  • the second sending unit 10024 is configured to send the message to the intermediate super node, so that the intermediate super node forwards the message to the destination super node to which the destination node belongs.
  • the source node sends a message including the superimposed network address of the source node and the destination node to the associated source super node, and the source super node sends the message to the destination node.
  • the associated super node so that the destination super node sends the message to the destination node.
  • the embodiment of the invention is based on DomainlD (Domain Identification) and SubDomainlD
  • the network node includes: a third sending module 1101, configured to send a request message to a source super node when the network node is a source node, requesting And communicating with the destination node, where the request message includes an overlay network address of the source node and the destination node, where the overlay network address includes a domain identifier and a sub-domain identifier, so that the source super node is based on the overlay network address of the destination node.
  • a third sending module 1101 configured to send a request message to a source super node when the network node is a source node, requesting And communicating with the destination node, where the request message includes an overlay network address of the source node and the destination node, where the overlay network address includes a domain identifier and a sub-domain identifier, so that the source super node is based on the overlay network address of the destination node.
  • the fourth sending module 1102 is configured to send a message to the destination node.
  • the network node When the network node is the source node, the network node sends a request message to the source super node to request communication with the destination node, so that the source super node is based on the overlay network address of the destination node. Establishing a connection between the source node and the destination node, and the source node sends a message to the destination node.
  • the embodiment of the present invention implements a simple routing algorithm based on Doma inlD (domain identification) and SubDoma inlD (sub-domain identification); and implements a routing method for large messages, which can reduce the network as much as possible. Overhead.
  • the embodiment provides a network super node.
  • the network super node includes: a third receiving module 1201, configured to receive a request message sent by the source node when the network super node is a source super node.
  • the request message is used to request communication with the destination node, where the request message includes an overlay network address of the source node and the destination node, and the overlay network address includes a domain identifier and a sub-i or an identifier;
  • the connection establishing module 1202 is configured to establish a connection between the source node and the destination node according to an overlay network address of the destination node.
  • the connection establishing module 1202 includes:
  • the first obtaining unit 12021 is configured to obtain an IP address of the target node according to the overlay network address of the destination node.
  • the third sending unit 12022 is configured to send the IP address of the destination node to the source node, so that the source node establishes a connection with the destination node according to an IP address of the destination node.
  • the connection establishing module 1202 includes:
  • the fourth sending unit 12023 is configured to send, according to the overlay network address of the destination node, the IP address of the source node to the destination super node, so that the destination super node sends the IP address of the source node. Giving the destination node, and the destination node establishes a connection with the source node according to the IP address of the source node.
  • the connection establishment module 1202 includes:
  • the fifth sending unit 12024 is configured to send, according to the overlay network address of the destination node, the IP address of the source super node to the destination super node, so that the destination super node sets the IP address of the source super node.
  • the address is sent to the destination node, and the destination node establishes a connection with the source super node according to the IP address of the source super node, and the source super node establishes a connection with the source node.
  • the connection establishment module 1202 includes:
  • the third query unit 12025 is configured to query, according to the overlay network address of the destination node, an intermediate super node that belongs to the same domain and the subdomain as the destination node; a sixth sending unit 12026, configured to send the request message to the intermediate super node, so that the intermediate super node obtains an IP address of the destination node according to an overlay network address of the destination node;
  • the first receiving unit 12027 is configured to receive an IP address of the destination node sent by the intermediate super node.
  • the seventh sending unit 12028 is configured to send an IP address of the destination node to the source node, so that the source node establishes a connection with the destination node according to an IP address of the destination node.
  • the source node sends a request message including the source network and the destination node's overlay network address to the associated source super node, requesting communication with the destination node, and the source super node establishes according to the overlay network address of the destination node.
  • the embodiment of the present invention implements a simple routing algorithm based on Doma inID (Domain ID) and SubDoma inID (Subdomain ID); and implements a routing method for large messages, which can reduce the network as much as possible. Overhead.
  • the network node and the network super node provided in the embodiments of the present invention may implement the foregoing method.
  • the communication method, the network node, and the network super node in the P2P network provided by the embodiment of the present invention can be applied to communication between network nodes in the P2P network, but is not limited thereto.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例公开了一种P2P网络中的通信方法、网络节点及网络超级节点,所述方法包括:源节点向所属的源超级节点发送消息,所述消息中包括消息头和消息体,所述消息头包括所述源节点和目的节点的叠加网地址,所述叠加网地址包括域标识和子域标识;所述源超级节点将所述消息发送给所述目的节点所属的目的超级节点;所述目的超级节点将所述消息发送给所述目的节点。本发明适用于P2P网络中网络节点之间的通信。

Description

P2P网络中的通信方法、 网络节点及网络超级节点 技术领域
本发明涉及通信技术领域, 特别涉及一种 P2P网络中的通信方法、 网络节 点及网络超级节点。 背景技术
目前, Peer-to-Peer (简称 P2P )技术已经成为计算机界关注的热门技术 之一。 P2P网络是一种分布式网络, 作为 P2P网络的参与者, P2P网络节点共享 它们所拥有的一部分硬件资源, 包括: 参与者的处理能力、 存储能力、 网络 连接能力等; 这些共享资源需要由网络提供服务和内容, 能被其它对等节点 ( Peer ) 直接访问而无需经过中间实体。
在 P2P网络中, 没有客户端或服务器的概念, 只有平等的同级节点。 P2P 网络节点既是资源 (服务和内容) 的提供者 ( Server ) , 又是资源 (服务和内 容) 的获取者 (C l i ent ) , 所有 P2P网络节点都动态参与到路由、 信息处理和 带宽增强等工作中, 同时对网络上的其它节点充当客户端和服务器。
在现有的 P2P网络中, P2P网络节点之间在进行通信时, 网络开销和存储 开销较大, 容易造成网络拥塞; 路由算法也比较复杂。 发明内容
本发明的实施例提供一种 P 2 P网络中的通信方法、 网络节点及网络超级节 点, 可以减少网络开销和存储开销, 避免造成网络拥塞, 同时提供一种简便 的路由算法。 本发明实施例釆用的技术方案为:
一种 P2P网络中的通信方法, 包括: 源节点向所属的源超级节点发送消息, 所述消息中包括消息头和消息体, 所述消息头包括所述源节点和目的节点的叠加网地址, 所述叠加网地址包括 域标识和子域标识; 所述源超级节点将所述消息发送给所述目的节点所属的目的超级节点; 所述目的超级节点将所述消息发送给所述目的节点。
一种 P2P网络中的通信方法, 包括:
源节点向所属的源超级节点发送请求消息, 请求与目的节点进行通信, 所述请求消息中包括源节点和目的节点的叠加网地址, 所述叠加网地址包括 域标识和子域标识;
所述源超级节点根据所述目的节点的叠加网地址, 建立所述源节点与所 述目的节点之间的连接;
所述源节点向所述目的节点发送消息。
一种网络节点, 包括:
第一发送模块, 用于当所述网络节点为源节点时, 向所属的源超级节点 发送消息, 以使所述源超级节点将所述消息发送给所述目的节点所属的目的 超级节点, 所述消息中包括消息头和消息体, 所述消息头包括所述源节点和 目的节点的叠加网地址, 所述叠加网地址包括域标识和子域标识;
第一接收模块, 用于当所述网络节点为目的节点时, 接收所属的目的超 级节点发送的消息。
一种网络超级节点, 包括:
第二接收模块, 用于当所述网络超级节点为源超级节点时, 接收源节点 发送的消息, 所述消息中包括消息头和消息体, 所述消息头包括所述源节点 和目的节点的叠加网地址, 所述叠加网地址包括域标识和子域标识;
第二发送模块, 用于将所述消息发送给所述目的节点所属的目的超级节 点, 以使所述目的超级节点将所述消息发送给所述目的节点。
一种网络节点, 包括:
第三发送模块, 用于当所述网络节点为源节点时, 向所属的源超级节点 发送请求消息, 请求与目的节点进行通信, 所述请求消息中包括源节点和目 的节点的叠加网地址, 所述叠加网地址包括域标识和子域标识, 以使所述源 超级节点根据所述目的节点的叠加网地址, 建立所述源节点与所述目的节点 之间的连接;
第四发送模块, 用于向所述目的节点发送消息。
一种网络超级节点, 包括:
第三接收模块, 用于当所述网络超级节点为源超级节点时, 接收源节点 发送的请求消息, 所述请求消息用于请求与目的节点进行通信, 所述请求消 息中包括源节点和目的节点的叠加网地址, 所述叠加网地址包括域标识和子 i或标识;
连接建立模块, 用于根据所述目的节点的叠加网地址, 建立所述源节点 与所述目的节点之间的连接。
本发明实施例 P2P网络中的通信方法、 网络节点及网络超级节点, 源节点 向所属的源超级节点发送包括源节点和目的节点的叠加网地址的消息, 源超 级节点将所述消息发送给目的节点所属的目的超级节点, 目的超级节点将所 述消息发送给目的节点; 或者, 源节点向所属的源超级节点发送包括源节点 和目的节点的叠加网地址的请求消息, 请求与目的节点进行通信, 源超级节 点根据目的节点的叠加网地址, 建立源节点与目的节点之间的连接, 源节点 向目的节点发送消息。 与现有技术相比, 本发明实施例基于 DomainID (域标 识)和 SubDomainlD (子域标识)实现了一种简单的路由算法; 并且将超级节 点信息的同步控制在域内, 将节点信息的同步控制在子域内, 这样可以减少 网络开销和存储开销, 避免造成网络拥塞; 而且实现了大消息的路由方法, 可以尽可能的减少网络开销。 附图说明
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例或现有 技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附 图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创 造性劳动的前提下, 还可以根据这些附图获得其它的附图。 图 la为本发明实施例一提供的方法流程图;
图 1 b为本发明实施例一提供的 0 ve r 1 ay网络的网络架构图;
图 1 c为本发明实施例一提供的 SN加入 0 ve r 1 ay网络的方法流程图; 图 1 d为本发明实施例一提供的 Pee r加入 0 ve r 1 ay网络的方法流程图; 图 2a为本发明实施例二提供的网络结构示意图;
图 2b为本发明实施例二提供的方法流程图;
图 3a为本发明实施例三提供的网络结构示意图;
图 3b为本发明实施例三提供的方法流程图;
图 4为本发明实施例四提供的方法流程图;
图 5a为本发明实施例五提供的网络结构示意图;
图 5b为本发明实施例五提供的方法流程图;
图 6a为本发明实施例六提供的网络结构示意图;
图 6b为本发明实施例六提供的方法流程图;
图 7a为本发明实施例七提供的网络结构示意图;
图 7b为本发明实施例七提供的方法流程图;
图 8a为本发明实施例八提供的网络结构示意图;
图 8b为本发明实施例八提供的方法流程图;
图 9为本发明实施例九提供的网络节点的结构示意图;
图 10a、 图 10b、 图 10c为本发明实施例十提供的网络超级节点的结构示意 图;
图 11为本发明实施例十一提供的网络节点的结构示意图;
图 12a、 图 12b、 图 12c、 图 12d、 图 12e为本发明实施例十二提供的网络超 级节点的结构示意图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其它实施例 , 都属于本发明保护的范围。
为使本发明技术方案的优点更加清楚, 下面结合附图和实施例对本发明 作详细说明。
实施例一
本实施例提供一种 P2P网络中的通信方法, 如图 la所示, 所述方法包括:
101、 源节点向所属的源超级节点发送消息, 所述消息中包括消息头和消 息体, 所述消息头包括所述源节点和目的节点的叠加网地址, 所述叠加网地 址包括 i或标识和子 i或标识。
102、 所述源超级节点将所述消息发送给所述目的节点所属的目的超级节 点。
103、 所述目的超级节点将所述消息发送给所述目的节点。
其中, 对于源节点来说, 其所属的源超级节点指的是与该源节点具有相 同域标识和子域标识的超级节点; 对于目的节点来说, 其所属的目的超级节 点指的是与该目的节点具有相同域标识和子域标识的超级节点。
如图 lb所示, 为 Over lay网络(叠加网) 的网络架构图。 其中, 节点或者 网络节点以 Peer表示, 指的是 Over lay网络中的终端, 可以是应用服务器或者 应用终端; 超级节点或者网络超级节点以 SN ( Super Node )表示, 指的是对 等的服务器节点; 启动超级节点以 BSSN ( BootStar t Super Node )表示, 在 技术实现上就是一个 SN, 仅比 SN多承担一些功能, 帮助其他的 SN以及 Peer加 入 Over lay网络, BSSN和 SN没有区别, 只是从部署的角度, 选择一些 SN作为 BSSN; SN或 BSSN的集群形成了 Over lay网络。
其中, 如图 lc所示, 超级节点 (SN )加入 Over lay网络的方法包括:
Ll、 SN A向 BSSN 1发送 p ing命令。
L2、 BSSN 1返回自身的负载信息。
L3、 SN A向 BSSN 2发送 p ing命令。 L4、 BSSN 2返回自身的负载信息。
L5、 SN A从 BSSN 1和 BSSN 2中选择一个负载较轻的 BSSN, 在本实施例中, 假定 BSSN 1的负载较轻。
L6、 SN A向 BSSN 1发送请求消息, 请求加入该 Over lay网络, 所述请求消 息中包括 SN A的 DomainlD和 SubDomainID。
L7、 BSSN 艮据 SNA的 DomainlD和 SubDomainlD进行查找, 选择可用的 SN。 具体地, 如果在该 Over lay网络中能够查找到和 SN A具有相同 DomainlD和 SubDomainlD的 SN, 则从这些 SN中随机挑选一部分; 如果在该 Over lay网络中 没有和 SN A具有相同 SubDomainlD的 SN, 则从和 SN A具有相同 DomainlD的 SN中 随机挑选一部分;如果在该 Overlay网络中没有和 SN A具有相同 DomainlD的 SN, 则表明 SN A无法加入该 Overlay网络, BSSN 1向 SN A返回错误信息。
L8、 BSSN 1向 SN A返回可用的 SN。
L9、 SN A从所述可用的 SN中随机挑选一个, 这里 4叚定选择了 SNB, 则 SNA 从 SN B获取 Domain内的所有 SN的信息, 以及 SubDomain内所有 Peer的信息。
L10、 SN A向 SN B返回 Domain内的所有 SN的信息, 以及 SubDomain内所有 的 Peer的信息。
Lll、 SN B向 SN A返回所有 SN和 Peer的信息。
进一步的, 如果 SN由于网络原因和 Overlay网络断开连接后, 会自动尝试 重新力口入 Over 1 ay网络。
其中, 如图 Id所示, 节点 (Peer )加入 Overlay网络的方法包括:
51、 Peer A向 BSSN 1发送 ping命令, 所述 ping命令中包括 Peer A的 IP地 址。
52、 BSSN 1获取自身的负载信息, 并比较 Peer A的 IP地址与从 Socket中 获取的 Peer的 IP地址,如果两个 IP地址相同,表明 Peer A在 NAT下面,否则 Peer A不在 NAT下面。
53、 BSSN 1向 Peer A返回自身的负载信息, 并告知 Peer A是否在 NAT下面。 54、 Peer A向 BSSN 2发送 p ing命令, 所述 ping命令中包括 Peer A的 IP地 址。
55、 BSSN 2获取自身的负载信息, 并比较 Peer A的 IP地址与从 Socket中 获取的 Peer的 IP地址,如果两个 IP地址相同,表明 Peer A在 NAT下面,否则 Peer A不在 NAT下面。
56、 BSSN 2向 Peer A返回自身的负载信息, 并告知 Peer A是否在 NAT下面。
57、 Peer A从 BSSN 1和 BSSN 2中选择一个负载较轻的 BSSN, 在本实施例 中, 假定 BSSN 1的负载较轻。
58、 Peer A向 BSSN 1发送请求消息, 请求加入该 Over lay网络, 所述请求 消息中包括 Peer A的 Doma inID和 SubDoma inID。
59、 BSSN 1才艮据 Peer A的 Doma inID和 SubDoma inlD进行查找, 选择可用的
SN。
具体地, 如果在该 Over lay网络中能够查找到和 Peer A具有相同 Doma inID 和 SubDoma inlD的 SN, 则从这些 SN中随机挑选一部分; 如果在该 Over lay网络 中没有和 Peer A具有相同 Doma inID和 SubDoma inlD的 SN, 则表明 Peer A无法加 入该 Over lay网络, BSSN 1向 Peer A返回错误信息。
510、 BSSN 1向 Peer A返回可用的 SN。
511、 Peer A从所述可用的 SN中随机挑选一个, 这里 4叚定选择了 SN A。
512、 Peer A和 SN A建立 TCP长连接,
513、 SN A在内存中标明 Peer A属于自己管理。
进一步的, 如果 Peer由于网络原因和 Over lay网络断开连接后, 会自动尝 试重新力口入 Over lay网络。
需要说明的是, Peer只会和与自己具有相同 Doma inID和 SubDoma inlD的 SN 建立连接, 这样使得 Peer的分组非常容易实现, 也便于进行网络规划和负载 均衡。
为了在叠加网内传播 SN的信息和 Peer的信息, 同时减少网络开销和存储 开销, 可以釆用以下方法进行 SN信息和 Pee r信息的同步。
(1 ) SN信息的同步
SN和 SN之间有 heartbeat消息, 每隔一定的时间间隔, 源 SN ( Source SN ) 随机选择一些目的 SN ( Destination SN ), 然后将自身和自己知道的在线的 SN 的信息例如 SN的 IP地址、 DomainID和 SubDomainID通知这些选择出来的目的 SN, 通知告诉的方法可以是 TCP ( Transmission Control Protocol, 传输控 制协议) 消息或 UDP (User Datagram Protocol, 用户数据包协议) 消息。 目 的 SN也会将自己知道而源 SN不知道的在线 SN通知源 SN。 这样, 通过一推一拉 的方式, 可以将 SN的信息同步开来。
进一步的, 为了防止 SN信息的同步过度泛滥, 可以釆用以下方法: 对于任何一个源 SN, 其内存里记录着其他 SN的信息, SN的信息里面包括 两个参数: round (轮转次数)和 sequence (SN的逻辑时钟)。 参数 Round用来控制 传播消息的过度泛滥, 参数 sequence用来标示 SN信息的新鲜度。 在固定的时 间间隔, 例如每次发送 heartbeat消息时, SN将自身的 round设置为某个值, 这个值控制着每一轮这个 SN的信息可以被传播的次数; 同样在固定的时间间 隔, 例如每次发送 heartbeat消息时, SN将自身的 sequence加 1。 源 SN将自身 和自己知道的在线的 SN的信息告知目的 SN时, 将这些 SN的 round值减去 1, 这 些 SN的信息每次被同步时, 其 round值都减去 1, 直到减到 0为止, 这样就可以 避免同一个 SN的信息被过度的传播出去。 当目的 SN收到被传播的 SN信息的时 会比较消息中 SN的 sequence和内存中该 SN的 sequence , 口果消息中 SN的 sequence值更大, 表明消息中的 SN信息更为新鲜, 将用消息中 SN的信息覆盖 内存中该 SN的信息; 否则表明内存中的 SN信息更为新鲜, 不用做任何操作。
(2) Peer信息的同步
Peer和 SN之间有 hea r t bea t消息, SN收到 Peer hear tbeat消息时, 将内 存中该 Peer的 sequence值力口 1 , 将该 Peer的 round值设置为某个值, 这个值控 制着每一轮这个 Peer的信息可以被传播的次数。 SN和 SN之间可以有专用来同步 pee r的消息, 也可以和用来同步 SN的消息 共用一个消息。 每隔一定的时间间隔, 源 SN随机选择一些目的 SN, 然后将自 身和自 己知道的在线的 Peer的信息例如 Peer的 IP地址、 Doma inlD、 SubDoma inlD, Peer是否在 NAT下面以及目前归属的 SN通知这些选择出来的目 的 SN。 通知的方法可以是 TCP消息或 UDP消息。 目的 SN也会将自己知道而源 SN 不知道的在线 Peer通知源 SN。 这样通过一推一拉的方式, 可以将 Peer的信息 同步开来。
进一步的, 为了防止 Peer信息的同步过度泛滥, 可以釆用与防止 SN信息 的同步过度泛滥类似的方法, 在此不再赘述。
通过将 SN信息的同步控制在 Doma in内, 可以实现一个 Doma in内的任何 SN 知道该 Doma in内所有 SN的信息; 通过将 Peer信息的同步控制在 SubDoma in内, 可以实现一个 SubDoma i n内的任何 SN知道该 SubDoma i n内所有 Pe e r的信息。 通 过将 SN信息的同步控制在 Doma in内, 通过将 Peer信息的同步控制在 SubDoma in 内, 可以减少网络开销和存储开销。
本发明实施例 P2P网络中的通信方法, 源节点向所属的源超级节点发送包 括源节点和目的节点的叠加网地址的消息, 源超级节点将所述消息发送给目 的节点所属的目的超级节点, 目的超级节点将所述消息发送给目的节点。 与 现有技术相比, 本发明实施例基于 DomainlD (域标识)和 SubDomainlD (子 域标识) 实现了一种简单的路由算法; 并且将超级节点信息的同步控制在域 内, 将节点信息的同步控制在子域内, 这样可以减少网络开销和存储开销, 避免造成网络拥塞。
实施例二
本实施例提供一种 P2P网络中的通信方法, 如图 2a所示, 在本实施例中, SN A和 SN B属于相同的 Doma in和 SubDoma in, Peer A和 SN A连接, Peer B和 SN B连接, Peer A为源 Peer , Peer B为目的 Peer , Peer A向 Peer B发送消息。
如图 2b所示, 所述方法包括: 201、 Peer A向 Peer B发送消息时, 首先向 SN A发送消息。
其中, 该消息中至少包括两部分: 消息头和消息体, 所述消息头包括 Peer A和 Peer B的 Over lay地址, 所述消息体为 Peer A发送给 Peer B的消息内容。
其中, 所述 Overlay地址为 Peer在 Overlay网络中唯一的地址标识, 格式 与 Email地址格式类似: ****@DomainID. SubDomainID, 总长度不超过 32字节。
Over lay地址可以根据具体的应用场景规划命名规则,例如:在 IPTV领域, STB (机顶盒终端) 的地址格式可以定义为:
STBsubscr iber id@DomainID. SubDomainID
例 ¾口: subscriberid为 123456789、 DomainID为 1、 SubDomainID为 12的 STB 的 (^6 1& 地址为8丁8123456789@1、 12。
其中, Domain为一个域, 是一个逻辑概念, Over lay网络部署者赋予其具 体的概念, 它可以对应着一个城市或一个企业的局域网等; DomainID为赋予 Domain的唯一的 32位的非负整数, 以标示该 Domain; SubDomain为 Domain中的 一个子域, SubDomainID为!!武予 SubDomain的唯一的 32位的非整数值, 以标示 该 SubDoma in。
202、 SN A分析目的 Peer的 Overlay地址, 发现 Peer B相对于自身属于相 同的 Domain和 SubDoma in, 因此 SN A的緩存中存储有 Peer B的信息, 于是 SN A 查询緩存中的 Peer信息, 其中, 所述 Peer信息包括该 Peer属于哪个 SN, 也就 是该 Peer连接着哪个 SN, 查询后发现 Peer B连接着 SN B。
203、 SN A将该消息发送给 SN B。
204、 SN B查询发现自身连接着 Peer B。
205、 SN B将该消息发送给 Peer B。
本发明实施例 P2P网络中的通信方法, 在相同的 Doma i n和 SubDoma i n内, 源 Pee r向所属的源 SN发送包括源 Pee r和目的 Pee r的叠加网地址的消息, 源 SN 将所述消息发送给目的 Peer所属的目的 SN, 目的 SN将所述消息发送给目的 Peer。与现有技术相比,本发明实施例基于 DomainID (域标识 oSubDomainID (子域标识) 实现了一种简单的路由算法。
实施例三
本实施例提供一种 P2P网络中的通信方法, 如图 3a所示, 在本实施例中, SN A、 SN B和 SN C属于相同的 Doma in, SN A属于 SubDoma in 1 , SN B和 SN C属 于 SubDoma in 2 , Peer A和 SN A连接, Peer B和 SN B连接, Peer A为源 Peer , Peer B为目的 Peer , Peer A向 Peer B发送消息。
如图 3b所示, 所述方法包括:
301、 Peer A向 Peer B发送消息时, 首先向 SN A发送消息。
其中, 该消息中至少包括两部分: 消息头和消息体, 所述消息头包括源 Peer和目的 Peer的 Over lay地址, 所述消息体为源 Peer发送该目的 Peer的消息 内容。
302、 SN A分析 Peer B的 Over lay地址, 发现 Peer B相对于自身属于相同 的 Doma in, 但是属于不同的 SubDoma in, 因此 SN A的緩存中没有存储 Peer B的 信息, SN A只需要将该消息发送给与 Peer B具有相同 Doma in和 SubDoma in的 SN 即可。 由于在同一个 Doma in内, SN的信息是彼此知道的, 因此 SN A知道哪些 SN和 Peer B具有相同的 Doma in和 SubDoma in, 在本实施例中, 假设 SN A选择了 SN C。
303、 SN A将所述消息发送给 SN C。
304、 SN C分析目的 Peer的 Over lay地址, 发现 Peer B相对于自身属于相 同的 Doma in和 SubDoma in, 因此 SN C的緩存中存储有 Peer B的信息, 于是 SN C 查询緩存中的 Peer信息, 其中, 所述 Peer信息包括该 Peer属于哪个 SN, 也就 是该 Peer连接着哪个 SN, 查询后发现 Peer B连接着 SN B。
305、 SN C将该消息发送给 SN B。
306、 SN B查询发现自身连接着 Peer B。
307、 SN B将该消息发送给 Peer B。
本发明实施例 P2P网络中的通信方法, 在相同的 Doma in和不同的 SubDoma in内, 源 Peer向所属的源 SN发送包括源 Peer和目的 Peer的叠加网地址 的消息, 源 SN通过中间 SN将所述消息发送给目的 Peer所属的目的 SN, 目的 SN 将所述消息发送给目的 Peer。 与现有技术相比, 本发明实施例基于 DomainID (域标识)和 SubDomainID (子域标识) 实现了一种简单的路由算法。
实施例四
本实施例提供一种 P2P网络中的通信方法, 如图 4所示, 所述方法包括:
401、 源节点向所属的源超级节点发送请求消息, 请求与目的节点进行通 信, 所述请求消息中包括源节点和目的节点的叠加网地址, 所述叠加网地址 包括域标识和子域标识。
402、 所述源超级节点根据所述目的节点的叠加网地址, 建立所述源节点 与所述目的节点之间的连接。
403、 所述源节点向所述目的节点发送消息。
本发明实施例 P2P网络中的通信方法, 源节点向所属的源超级节点发送包 括源节点和目的节点的叠加网地址的请求消息, 请求与目的节点进行通信, 源超级节点根据目的节点的叠加网地址, 建立源节点与目的节点之间的连接, 源节点向目的节点发送消息。 与现有技术相比, 本发明实施例基于 DomainID (域标识)和 SubDomainID (子域标识)实现了一种简单的路由算法; 而且实 现了大消息的路由方法, 可以尽可能的减少网络开销。
实施例五
本实施例提供一种 P2P网络中的通信方法, 如图 5a所示, 在本实施例中, SN A和 SN B属于相同的 Doma in和 SubDoma in, Peer A和 SN A连接且 Peer A不在 NAT ( Network Addres s Trans la t ion , 网络地址转换) 下面, Peer B和 SN B 连接且 Peer B不在 NAT下面, Peer A为源 Peer , Peer B为目的 Peer ; Peer A向 Peer B发送的消息的消息体较大。
如图 5b所示, 所述方法包括:
501、 Peer A向 SN A发送请求消息, 请求获取 Peer B的 IP地址, 其中, 所 述请求消息中包括 Peer Λ和 Peer B的 Over lay地址。
502、 SN A才艮据所述 Peer A和 Peer B的 Over lay地址, 获取 Peer B的 IP地 址。
具体地, SN A分析目的 Peer的 Over lay地址, 发现 Peer B相对于自身属于 相同的 Doma in和 SubDoma in, 因此 SN A的緩存中存储有 Peer B的信息, 于是 SN A查询緩存中的 Peer信息, 其中, 所述 Peer信息包括 Peer的 IP地址, 查询后获 取 Peer B的 IP地址。
503、 SN A将 Peer B的 IP地址发送给 Peer A。
504、 Peer A才艮据 Peer B的 IP地址与 Peer B建立连接。
505、 Peer A向 Peer B发送消息。
本发明实施例 P 2 P网络中的通信方法, 在相同的 Doma i n和 S ubDoma i n内, 源 Pee r向所属的源 SN发送包括源 Pee r和目的 Pee r的叠加网地址的请求消息, 请求与目的 Peer进行通信, 源 SN根据目的 Peer的叠加网地址, 向源 Peer返回 目的 Peer的 IP地址, 源 Peer根据目的 Peer的 IP地址与目的 Peer建立连接并向 目的 Peer发送消息。 与现有技术相比, 本发明实施例基于 DomainID (域标识) 和 SubDomainID (子域标识)实现了一种简单的路由算法; 而且实现了大消息 的路由方法, 可以尽可能的减少网络开销。
实施例六
本实施例提供一种 P2P网络中的通信方法, 如图 6a所示, 在本实施例中, SN A和 SN B属于相同的 Doma in和 SubDoma in, Peer A和 SN A连接且 Peer A不在 NAT下面, Peer B和 SN B连接且 Peer B在 NAT下面, Peer A为源 Peer , Peer B 为目的 Peer; Peer A向 Peer B发送的消息的消息体较大。
如图 6b所示, 所述方法包括:
601、 Peer A向 SN A发送请求消息, 请求与 Peer B进行通信, 其中, 所述 请求消息中包括 Peer A的 IP地址以及 Peer B的 Over lay地址。
由于 Peer A不在 NAT下面, 因此, SN A和 Peer A之间的连接不需要釆用 TCP 长连接, 可以釆用 TCP短连接或者 UDP消息, Peer A只需要告知 SN自己的消息 接收端即可。
602、 SN A才艮据所述 Peer B的 Over lay地址, 将 Peer A的 IP地址发送给 Peer B连接的 SN B。
603、 SN B将 Peer A的 IP地址发送给 Peer B。
由于 Peer B在 NAT下面, 因此, SN B和 Peer B之间的连接需要釆用 TCP长 连接, 以使当 SN B有消息发送给 NAT下面的 Peer B时, 可以通过该 TCP长连接 发送。
604、 Peer B才艮据 Peer A的 IP地址与 Peer A建立连接。
605、 Peer A向 Peer B发送消息。
本发明实施例 P 2 P网络中的通信方法, 在相同的 Doma i n和 S ubDoma i n内, 源 Pee r向所属的源 SN发送包括源 Pee r的 I P地址和目的 Pee r的叠加网地址的请 求消息, 请求与目的 Peer进行通信, 源 SN将源 Peer的 IP地址发送给目的 Peer , 目的 Peer根据源 Peer的 IP地址与源 Peer建立连接, 源 Peer向目的 Peer发送消 息。 与现有技术相比, 本发明实施例基于 DomainID (域标识)和 SubDomainID (子域标识) 实现了一种简单的路由算法; 而且实现了大消息的路由方法, 可以尽可能的减少网络开销。
实施例七
本实施例提供一种 P2P网络中的通信方法, 如图 7a所示, 在本实施例中, SN A和 SN B属于相同的 Doma in和 SubDoma in, Peer A和 SN A连接且 Peer A在 NAT 下面, Peer B和 SN B连接且 Peer B在 NAT下面, Peer A为源 Peer , Peer B为目 的 Peer; Peer A向 Peer B发送的消息的消息体较大。
如图 7b所示, 所述方法包括:
701、 Peer A向 SN A发送请求消息, 请求与 Peer B进行通信, 其中, 所述 请求消息中包括 Peer A和 Peer B的 Over lay地址。
702、 SN A根据所述 Peer B的 Over lay地址, 将 SN A的 IP地址发送给 Peer B 连接的 SN B。
703、 SN B将 SN A的 IP地址发送给 Peer B。
704、 Peer B才艮据 SN A的 IP地址与 SN A建立连接。
705、 SN A与 Peer A建立连接。
706、 Peer A通过 SN A向 Peer B发送消息。
在本实施例中, SN A作为中转 SN, 中转 Peer A和 Peer B之间传递的消息; 当然, 也可以选取 SN B作为中转 SN, 或者在 SN A和 SN B所在的 Over lay中选取 负载最轻的 SN作为中转 SN。
本发明实施例 P2P网络中的通信方法, 在相同的 Doma i n和 SubDoma i n内, 源 Pee r向所属的源 SN发送包括源 Pee r和目的 Pee r的叠加网地址的请求消息, 请求与目的 Peer进行通信, 源 SN通过目的 SN向目的 Peer发送源 SN的 IP地址, 目的 Peer建立与源 SN的连接, 源 SN建立与源 Peer的连接, 源 Peer通过源 SN向 目的 Peer发送消息。 与现有技术相比, 本发明实施例基于 DomainID (域标识) 和 SubDomainID (子域标识)实现了一种简单的路由算法; 而且实现了大消息 的路由方法, 可以尽可能的减少网络开销。
实施例八
本实施例提供一种 P2P网络中的通信方法, 如图 8a所示, 在本实施例中, SN A和 SN B属于相同的 Doma in, SN A属于 SubDoma in 1 , SN B属于 SubDoma in 2 , Peer A和 SN A连接且 Peer A在 NAT下面, Peer B和 SN B连接且 Peer B不在 NAT 下面, Peer A为源 Peer , Peer B为目的 Peer ; Peer A向 Peer B发送的消息的 消息体较大。
如图 8b所示, 所述方法包括:
801、 Peer A向 SN A发送请求消息, 请求与 Peer B进行通信, 其中, 所述 请求消息中包括 Peer A和 Peer B的 Over lay地址。
802、 SN A分析 Peer B的 Over lay地址, 发现 Peer B相对于自身属于相同 的 Doma in, 但是属于不同的 SubDoma in, 因此 SN A的緩存中没有存储 Peer B的 信息, SN A只需要将该消息发送给与 Peer B具有相同 Doma in和 SubDoma in的 SN 即可。 由于在同一个 Doma in内, SN的信息是彼此知道的, 因此 SN A知道哪些 SN和 Peer B具有相同的 Doma in和 SubDoma in, 在本实施例中, 假设 SN A选择了 SN B。
803、 SN A将请求消息发送给 SN B。
804、 SN B才艮据 Peer B的 Over lay地址获取 Peer B的 IP地址。
805、 SN B将 Peer B的 IP地址发送给 SN A。
806、 SN A将 Peer B的 IP地址发送给 Peer A。
807、 Peer A才艮据 Peer B的 IP地址与 Peer B建立连接。
808、 Peer A向 Peer B发送消息。
本发明实施例 P2P网络中的通信方法, 在相同的 Doma in和不同的 SubDoma in内, 源 Peer向所属的源 SN发送包括源 Peer和目的 Peer的叠加网地址 的请求消息,请求与目的 Peer进行通信, 源 SN通过与目的 Peer具有相同 Doma in 和 SubDoma in的 SN获取目的 Peer的 IP地址并发送给源 Peer , 源 Peer根据目的 Peer的 IP地址与目的 Peer建立连接并向目的 Peer发送消息。 与现有技术相比, 本发明实施例基于 DomainID (域标识) 和 SubDomainID (子域标识) 实现了 一种简单的路由算法; 而且实现了大消息的路由方法, 可以尽可能的减少网 络开销。
实施例九
本实施例提供一种网络节点, 如图 9所示, 所述网络节点包括:
第一发送模块 901 , 用于当所述网络节点为源节点时, 向所属的源超级节 点发送消息, 以使所述源超级节点将所述消息发送给所述目的节点所属的目 的超级节点, 所述消息中包括消息头和消息体, 所述消息头包括所述源节点 和目的节点的叠加网地址, 所述叠加网地址包括域标识和子域标识;
第一接收模块 902 , 用于当所述网络节点为目的节点时, 接收所属的目的 超级节点发送的消息。 本发明实施例网络节点, 当所述网络节点为源节点时, 向所属的源超级 节点发送消息, 以使所述源超级节点将所述消息发送给所述目的节点所属的 目的超级节点; 当所述网络节点为目的节点时, 接收所属的目的超级节点发 送的消息。 与现有技术相比, 本发明实施例基于 DomainID (域标识 ) 和 SubDomainID (子域标识) 实现了一种简单的路由算法。
实施例十
本实施例提供一种网络超级节点,如图 1 0a所示,所述网络超级节点包括: 第二接收模块 1 001 , 用于当所述网络超级节点为源超级节点时, 接收源 节点发送的消息, 所述消息中包括消息头和消息体, 所述消息头包括所述源 节点和目的节点的叠加网地址, 所述叠加网地址包括域标识和子域标识; 第二发送模块 1 002 , 用于将所述消息发送给所述目的节点所属的目的超 级节点, 以使所述目的超级节点将所述消息发送给所述目的节点。
进一步的, 如图 10b所示, 当所述源超级节点与所述目的超级节点属于相 同的域和子域时, 所述第二发送模块 1 002可以包括:
第一查询单元 10021 , 用于根据所述目的节点的叠加网地址, 查询所述目 的节点所属的目的超级节点;
第一发送单元 10022 , 用于将所述消息发送给所述目的节点所属的目的超 级节点。
进一步的, 如图 10c所示, 当所述源超级节点与所述目的超级节点属于相 同的域和不同的子域时, 所述第二发送模块 1 002包括:
第二查询单元 10023 , 用于根据所述目的节点的叠加网地址, 查询与所述 目的节点属于相同域和子域的中间超级节点;
第二发送单元 10024 , 用于将所述消息发送给所述中间超级节点, 以使所 述中间超级节点将所述消息转发给所述目的节点所属的目的超级节点。
本发明实施例网络超级节点, 源节点向所属的源超级节点发送包括源节 点和目的节点的叠加网地址的消息, 源超级节点将所述消息发送给目的节点 所属的目的超级节点, 以使所述目的超级节点将所述消息发送给所述目的节 点。 与现有技术相比, 本发明实施例基于 DomainlD (域标识 )和 SubDomainlD
(子域标识) 实现了一种简单的路由算法。
实施例十一
本实施例提供一种网络节点, 如图 11所示, 所述网络节点包括: 第三发送模块 1101 , 用于当所述网络节点为源节点时, 向所属的源超级 节点发送请求消息, 请求与目的节点进行通信, 所述请求消息中包括源节点 和目的节点的叠加网地址, 所述叠加网地址包括域标识和子域标识, 以使所 述源超级节点根据所述目的节点的叠加网地址, 建立所述源节点与所述目的 节点之间的连接;
第四发送模块 1102 , 用于向所述目的节点发送消息。
本发明实施例网络节点, 当所述网络节点为源节点时, 向所属的源超级 节点发送请求消息, 请求与目的节点进行通信, 以使所述源超级节点根据所 述目的节点的叠加网地址, 建立所述源节点与所述目的节点之间的连接, 源 节点向所述目的节点发送消息。与现有技术相比,本发明实施例基于 Doma inlD (域标识)和 SubDoma inlD (子域标识) 实现了一种简单的路由算法; 而且实 现了大消息的路由方法, 可以尽可能的减少网络开销。
实施例十二
本实施例提供一种网络超级节点,如图 12a所示,所述网络超级节点包括: 第三接收模块 1201 , 用于当所述网络超级节点为源超级节点时, 接收源 节点发送的请求消息, 所述请求消息用于请求与目的节点进行通信, 所述请 求消息中包括源节点和目的节点的叠加网地址, 所述叠加网地址包括域标识 和子 i或标识;
连接建立模块 1202 , 用于根据所述目的节点的叠加网地址, 建立所述源 节点与所述目的节点之间的连接。
进一步的, 如图 12b所示, 当所述源超级节点与所述目的节点所属的目的 超级节点属于相同的域和子域、 且所述源节点和目的节点不在 NAT下面时, 所 述连接建立模块 1202包括:
第一获取单元 12021 , 用于根据所述目的节点的叠加网地址, 获取所述目 的节点的 IP地址;
第三发送单元 12022 , 用于将所述目的节点的 IP地址发送给所述源节点, 以使所述源节点根据所述目的节点的 IP地址与所述目的节点建立连接。
进一步的, 如图 12c所示, 当所述源超级节点与所述目的节点所属的目的 超级节点属于相同的域和子域、 且所述源节点不在 NAT下面而所述目的节点在 NAT下面时, 所述连接建立模块 1202包括:
第四发送单元 12023, 用于根据所述目的节点的叠加网地址, 将所述源节 点的 IP地址发送给所述目的超级节点, 以使所述目的超级节点将所述源节点 的 IP地址发送给所述目的节点、 且所述目的节点根据所述源节点的 IP地址与 所述源节点建立连接。
进一步的, 如图 12d所示, 当所述源超级节点与所述目的节点所属的目的 超级节点属于相同的域和子域、 且所述源节点和目的节点在 NAT下面时, 所述 连接建立模块 1202包括:
第五发送单元 12024 , 用于根据所述目的节点的叠加网地址, 将所述源超 级节点的 IP地址发送给所述目的超级节点, 以使所述目的超级节点将所述源 超级节点的 IP地址发送给所述目的节点、 且所述目的节点根据所述源超级节 点的 IP地址与所述源超级节点建立连接、 所述源超级节点与所述源节点建立 连接。
进一步的, 如图 12e所示, 当所述源超级节点与所述目的节点所属的目的 超级节点属于相同的域和不同的子域、 且所述源节点和目的节点不在 NAT下面 时, 所述连接建立模块 1202包括:
第三查询单元 12025 , 用于根据所述目的节点的叠加网地址, 查询与所述 目的节点属于相同域和子域的中间超级节点; 第六发送单元 12026 , 用于将所述请求消息发送给所述中间超级节点, 以 使所述中间超级节点根据所述目的节点的叠加网地址获取所述目的节点的 IP 地址;
第一接收单元 12027 , 用于接收所述中间超级节点发送的所述目的节点的 IP地址;
第七发送单元 12028 , 用于将所述目的节点的 IP地址发送给所述源节点, 以使所述源节点根据所述目的节点的 IP地址与与所述目的节点建立连接。
本发明实施例网络超级节点, 源节点向所属的源超级节点发送包括源节 点和目的节点的叠加网地址的请求消息, 请求与目的节点进行通信, 源超级 节点根据目的节点的叠加网地址, 建立源节点与目的节点之间的连接, 以使 源节点向目的节点发送消息。 与现有技术相比, 本发明实施例基于 Doma inID (域标识)和 SubDoma inID (子域标识) 实现了一种简单的路由算法; 而且实 现了大消息的路由方法, 可以尽可能的减少网络开销。
本发明实施例提供的网络节点和网络超级节点可以实现上述提供的方法 实施例, 具体功能实现请参见方法实施例中的说明, 在此不再赘述。 本发明 实施例提供的 P2P网络中的通信方法、 网络节点及网络超级节点可以适用于 P2P网络中网络节点之间的通信, 但不仅限于此。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流 程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于 一计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施 例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory, ROM )或随机存 己忆体 ( Random Access Memory, RAM )等。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到的变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保 护范围应该以权利要求的保护范围为准。

Claims

权 利 要求 书
1、 一种 P2P网络中的通信方法, 其特征在于, 包括:
源节点 (Peer ) 向所属的源超级节点 ( SN )发送消息, 所述消息中包括消 息头和消息体, 所述消息头包括所述源节点和目的节点的叠加网地址, 所述叠 加网地址包括域标识和子域标识;
所述源超级节点将所述消息发送给所述目的节点所属的目的超级节点; 所述目的超级节点将所述消息发送给所述目的节点。
2、 根据权利要求 1所述的方法, 其特征在于, 当所述源超级节点与所述目 的超级节点属于相同的域和子域时, 所述源超级节点将所述消息发送给所述目 的节点所属的目的超级节点包括:
所述源超级节点根据所述目的节点的叠加网地址, 查询所述目的节点所属 的目的超级节点;
所述源超级节点将所述消息发送给所述目的节点所属的目的超级节点。
3、 根据权利要求 1所述的方法, 其特征在于, 当所述源超级节点与所述目 的超级节点属于相同的域和不同的子域时, 所述源超级节点将所述消息发送给 所述目的节点所属的目的超级节点包括:
所述源超级节点根据所述目的节点的叠加网地址, 查询与所述目的节点属 于相同域和子域的中间超级节点;
所述源超级节点将所述消息发送给所述中间超级节点;
所述中间超级节点将所述消息转发给所述目的节点所属的目的超级节点。
4、 一种 P2P网络中的通信方法, 其特征在于, 包括:
源节点 (Peer ) 向所属的源超级节点 ( SN )发送请求消息, 请求与目的节 点进行通信, 所述请求消息中包括源节点和目的节点的叠加网地址, 所述叠加 网地址包括域标识和子域标识;
所述源超级节点根据所述目的节点的叠加网地址, 建立所述源节点与所述 目的节点之间的连接; 所述源节点向所述目的节点发送消息。
5、 根据权利要求 4所述的方法, 其特征在于, 当所述源超级节点与所述目 的节点所属的目的超级节点属于相同的域和子域、 且所述源节点和目的节点不 在网络地址转换 NAT下面时, 所述源超级节点根据所述目的节点的叠加网地址, 建立所述源节点与所述目的节点之间的连接包括:
所述源超级节点根据所述目的节点的叠加网地址, 获取所述目的节点的 IP 地址;
所述源超级节点将所述目的节点的 I P地址发送给所述源节点;
所述源节点根据所述目的节点的 IP地址与所述目的节点建立连接。
6、 根据权利要求 4所述的方法, 其特征在于, 当所述源超级节点与所述目 的节点所属的目的超级节点属于相同的域和子域、 且所述源节点不在 NAT下面而 所述目的节点在 NAT下面时, 所述请求消息中还包括所述源节点的 IP地址;
所述源超级节点根据所述目的节点的叠加网地址, 建立所述源节点与所述 目的节点之间的连接包括:
所述源超级节点根据所述目的节点的叠加网地址, 将所述源节点的 IP地址 发送给所述目的超级节点;
所述目的超级节点将所述源节点的 IP地址发送给所述目的节点;
所述目的节点 居所述源节点的 IP地址与所述源节点建立连接。
7、 根据权利要求 4所述的方法, 其特征在于, 当所述源超级节点与所述目 的节点所属的目的超级节点属于相同的域和子域、 且所述源节点和目的节点在 NAT下面时, 所述源超级节点 4艮据所述目的节点的叠加网地址, 建立所述源节点 与所述目的节点之间的连接包括:
所述源超级节点根据所述目的节点的叠加网地址, 将所述源超级节点的 IP 地址发送给所述目的超级节点;
所述目的超级节点将所述源超级节点的 IP地址发送给所述目的节点; 所述目的节点根据所述源超级节点的 IP地址与所述源超级节点建立连接; 所述源超级节点与所述源节点建立连接;
则所述源节点向所述目的节点发送消息具体为:
所述源节点通过所述源超级节点向所述目的节点发送消息。
8、 根据权利要求 4所述的方法, 其特征在于, 当所述源超级节点与所述目 的节点所属的目的超级节点属于相同的域和不同的子域、 且所述源节点和目的 节点不在 NAT下面时, 所述源超级节点根据所述目的节点的叠加网地址, 建立所 述源节点与所述目的节点之间的连接包括:
所述源超级节点根据所述目的节点的叠加网地址, 查询与所述目的节点属 于相同域和子域的中间超级节点;
所述源超级节点将所述请求消息发送给所述中间超级节点;
所述中间超级节点根据所述目的节点的叠加网地址获取所述目的节点的 IP 地址;
所述中间超级节点将所述目的节点的 IP地址发送给所述源超级节点; 所述源超级节点将所述目的节点的 I P地址发送给所述源节点;
所述源节点才艮据所述目的节点的 IP地址与与所述目的节点建立连接。
9、 一种网络节点, 其特征在于, 包括:
第一发送模块, 用于当所述网络节点为源节点时, 向所属的源超级节点发 送消息, 以使所述源超级节点将所述消息发送给所述目的节点所属的目的超级 节点, 所述消息中包括消息头和消息体, 所述消息头包括所述源节点和目的节 点的叠加网地址, 所述叠加网地址包括域标识和子域标识;
第一接收模块, 用于当所述网络节点为目的节点时, 接收所属的目的超级 节点发送的消息。
10、 一种网络超级节点, 其特征在于, 包括:
第二接收模块, 用于当所述网络超级节点为源超级节点时, 接收源节点发 送的消息, 所述消息中包括消息头和消息体, 所述消息头包括所述源节点和目 的节点的叠加网地址, 所述叠加网地址包括域标识和子域标识; 第二发送模块, 用于将所述消息发送给所述目的节点所属的目的超级节点, 以使所述目的超级节点将所述消息发送给所述目的节点。
11、 根据权利要求 10所述的网络超级节点, 其特征在于, 当所述源超级节 点与所述目的超级节点属于相同的域和子域时, 所述第二发送模块包括:
第一查询单元, 用于根据所述目的节点的叠加网地址, 查询所述目的节点 所属的目的超级节点;
第一发送单元, 用于将所述消息发送给所述目的节点所属的目的超级节点。
12、 根据权利要求 10所述的网络超级节点, 其特征在于, 当所述源超级节 点与所述目的超级节点属于相同的域和不同的子域时, 所述第二发送模块包括: 第二查询单元, 用于根据所述目的节点的叠加网地址, 查询与所述目的节 点属于相同域和子域的中间超级节点;
第二发送单元, 用于将所述消息发送给所述中间超级节点, 以使所述中间 超级节点将所述消息转发给所述目的节点所属的目的超级节点。
13、 一种网络节点, 其特征在于, 包括:
第三发送模块, 用于当所述网络节点为源节点时, 向所属的源超级节点发 送请求消息, 请求与目的节点进行通信, 所述请求消息中包括源节点和目的节 点的叠加网地址, 所述叠加网地址包括域标识和子域标识, 以使所述源超级节 点 居所述目的节点的叠加网地址, 建立所述源节点与所述目的节点之间的连 接;
第四发送模块, 用于向所述目的节点发送消息。
14、 一种网络超级节点, 其特征在于, 包括:
第三接收模块, 用于当所述网络超级节点为源超级节点时, 接收源节点发 送的请求消息, 所述请求消息用于请求与目的节点进行通信, 所述请求消息中 包括源节点和目的节点的叠加网地址, 所述叠加网地址包括域标识和子域标识; 连接建立模块, 用于根据所述目的节点的叠加网地址, 建立所述源节点与 所述目的节点之间的连接。
15、 根据权利要求 14所述的网络超级节点, 其特征在于, 当所述源超级节 点与所述目的节点所属的目的超级节点属于相同的域和子域、 且所述源节点和 目的节点不在 NAT下面时, 所述连接建立模块包括:
第一获取单元, 用于根据所述目的节点的叠加网地址, 获取所述目的节点 的 IP地址;
第三发送单元, 用于将所述目的节点的 IP地址发送给所述源节点, 以使所 述源节点才艮据所述目的节点的 IP地址与所述目的节点建立连接。
16、 根据权利要求 14所述的网络超级节点, 其特征在于, 当所述源超级节 点与所述目的节点所属的目的超级节点属于相同的域和子域、 且所述源节点不 在 NAT下面而所述目的节点在 NAT下面时, 所述连接建立模块包括:
第四发送单元, 用于根据所述目的节点的叠加网地址, 将所述源节点的 IP 地址发送给所述目的超级节点, 以使所述目的超级节点将所述源节点的 IP地址 发送给所述目的节点、 且所述目的节点根据所述源节点的 IP地址与所述源节点 建立连接。
17、 根据权利要求 14所述的网络超级节点, 其特征在于, 当所述源超级节 点与所述目的节点所属的目的超级节点属于相同的域和子域、 且所述源节点和 目的节点在 NAT下面时, 所述连接建立模块包括:
第五发送单元, 用于根据所述目的节点的叠加网地址, 将所述源超级节点 的 IP地址发送给所述目的超级节点, 以使所述目的超级节点将所述源超级节点 的 IP地址发送给所述目的节点、 且所述目的节点根据所述源超级节点的 IP地址 与所述源超级节点建立连接、 所述源超级节点与所述源节点建立连接。
18、 根据权利要求 14所述的网络超级节点, 其特征在于, 当所述源超级节 点与所述目的节点所属的目的超级节点属于相同的域和不同的子域、 且所述源 节点和目的节点不在 NAT下面时, 所述连接建立模块包括:
第三查询单元, 用于根据所述目的节点的叠加网地址, 查询与所述目的节 点属于相同域和子域的中间超级节点; 第六发送单元, 用于将所述请求消息发送给所述中间超级节点, 以使所述 中间超级节点根据所述目的节点的叠加网地址获取所述目的节点的 IP地址; 第一接收单元, 用于接收所述中间超级节点发送的所述目的节点的 IP地址; 第七发送单元, 用于将所述目的节点的 IP地址发送给所述源节点, 以使所 述源节点根据所述目的节点的 IP地址与与所述目的节点建立连接。
PCT/CN2011/072305 2011-03-30 2011-03-30 P2p网络中的通信方法、网络节点及网络超级节点 WO2012129794A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2011/072305 WO2012129794A1 (zh) 2011-03-30 2011-03-30 P2p网络中的通信方法、网络节点及网络超级节点
CN201180004047XA CN102742225A (zh) 2011-03-30 2011-03-30 P2p网络中的通信方法、网络节点及网络超级节点

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/072305 WO2012129794A1 (zh) 2011-03-30 2011-03-30 P2p网络中的通信方法、网络节点及网络超级节点

Publications (1)

Publication Number Publication Date
WO2012129794A1 true WO2012129794A1 (zh) 2012-10-04

Family

ID=46929338

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/072305 WO2012129794A1 (zh) 2011-03-30 2011-03-30 P2p网络中的通信方法、网络节点及网络超级节点

Country Status (2)

Country Link
CN (1) CN102742225A (zh)
WO (1) WO2012129794A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800516A (zh) * 2020-08-09 2020-10-20 物鼎安全科技(武汉)有限公司 一种基于p2p的物联网设备管理方法及装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108337170B (zh) * 2018-01-30 2021-08-17 浙江省公众信息产业有限公司 分布式资源查找方法和系统
CN110636005B (zh) * 2019-08-21 2021-03-02 北京邮电大学 知识中心网络的知识路由方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1878118A (zh) * 2005-06-06 2006-12-13 腾讯科技(深圳)有限公司 一种实现数据通讯的系统及其方法
CN101018408A (zh) * 2007-02-01 2007-08-15 华为技术有限公司 业务实现的方法、网络设备以及网络
WO2008012488A2 (en) * 2006-07-24 2008-01-31 Nds Limited Peer-to-peer set-top box system
CN101127758A (zh) * 2006-08-16 2008-02-20 华为技术有限公司 移动节点的ip地址获取方法与获取系统
CN101399743A (zh) * 2007-09-28 2009-04-01 华为技术有限公司 在基于分布式哈希表的对等网络中查找数据的方法和系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1878118A (zh) * 2005-06-06 2006-12-13 腾讯科技(深圳)有限公司 一种实现数据通讯的系统及其方法
WO2008012488A2 (en) * 2006-07-24 2008-01-31 Nds Limited Peer-to-peer set-top box system
CN101127758A (zh) * 2006-08-16 2008-02-20 华为技术有限公司 移动节点的ip地址获取方法与获取系统
CN101018408A (zh) * 2007-02-01 2007-08-15 华为技术有限公司 业务实现的方法、网络设备以及网络
CN101399743A (zh) * 2007-09-28 2009-04-01 华为技术有限公司 在基于分布式哈希表的对等网络中查找数据的方法和系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800516A (zh) * 2020-08-09 2020-10-20 物鼎安全科技(武汉)有限公司 一种基于p2p的物联网设备管理方法及装置
CN111800516B (zh) * 2020-08-09 2021-01-08 物鼎安全科技(武汉)有限公司 一种基于p2p的物联网设备管理方法及装置

Also Published As

Publication number Publication date
CN102742225A (zh) 2012-10-17

Similar Documents

Publication Publication Date Title
EP2705645B1 (en) Name-based neighbor discovery and multi-hop service discovery in information-centric networks
US10476793B2 (en) Multicast flow overlay using registration over a reliable transport
US8897311B2 (en) Dynamic discovery mechanisms via inter-domain routing protocol
US8782178B2 (en) Distributed bootstrapping mechanism for peer-to-peer networks
US8626879B2 (en) Systems and methods for establishing network connections using local mediation services
KR101399914B1 (ko) 피어-투-피어 통신 시스템 및 방법
TWI491229B (zh) 基於網路位址轉譯類型之順暢的主機遷移
US8560607B2 (en) Method based on the combination of the UPnP and STUN for NAT traversal
WO2017114153A1 (zh) 基于业务功能链sfc的通信方法和装置
US9288067B2 (en) Adjacency server for virtual private networks
EP2127224A1 (en) Private virtual lan spanning a public network for connection of arbitrary hosts
JP2008182670A (ja) P2p・sip対応ネットワーク通信システム、アクセス装置、ネットワーク通信システムにおけるユーザ端末登録方法及びセッション確立方法
CN104852972A (zh) 基于所发现的nat类型选择主机的方法
CN104967677B (zh) 一种基于ndn缓存优化的文件传输方法以及装置
CN111598564B (zh) 区块链节点连接建立方法、装置及设备
US20180337886A1 (en) Upgrading to direct connection for servers behind a network address translation device
JP2011527128A (ja) ピアツーピア・オーバーレイ・ネットワークへのデバイスの最適参加のための方法および装置
CN110572808B (zh) 蓝牙Mesh网络系统、建立方法、配网器、设备及介质
WO2013040970A1 (zh) 中继节点选择方法及装置
WO2013152718A1 (zh) 一种路径计算单元通信协议会话建立方法及装置
WO2012129794A1 (zh) P2p网络中的通信方法、网络节点及网络超级节点
Vashishth et al. Addressing challenges in browser based P2P content sharing framework using WebRTC
CN102624759A (zh) 一种实现会话中数据迁移的方法和节点
WO2022068330A1 (zh) 一种检测路由环路的方法、设备及系统
WO2010069219A1 (zh) 一种p2p系统及种子查询方法

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180004047.X

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11862444

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11862444

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 11862444

Country of ref document: EP

Kind code of ref document: A1