[go: up one dir, main page]

CN103618801B - Method, equipment and the system of a kind of P2P resource-sharing - Google Patents

Method, equipment and the system of a kind of P2P resource-sharing Download PDF

Info

Publication number
CN103618801B
CN103618801B CN201310664771.6A CN201310664771A CN103618801B CN 103618801 B CN103618801 B CN 103618801B CN 201310664771 A CN201310664771 A CN 201310664771A CN 103618801 B CN103618801 B CN 103618801B
Authority
CN
China
Prior art keywords
address
node
resource
super node
edge
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201310664771.6A
Other languages
Chinese (zh)
Other versions
CN103618801A (en
Inventor
任梦璇
郭爱鹏
周光涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201310664771.6A priority Critical patent/CN103618801B/en
Publication of CN103618801A publication Critical patent/CN103618801A/en
Application granted granted Critical
Publication of CN103618801B publication Critical patent/CN103618801B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开一种P2P资源共享的方法、设备及系统。涉及通信领域,通过引入边缘超级节点,实现P2P文件共享。本发明实施例提供的方法包括:第一边缘超级节点确定本地信息中不包含第一资源ID,第一边缘超级节点接收第二边缘超级节点发送的查询响应报文,该查询响应报文中包含目的地址,源地址,以及Payload,源地址为存储第一资源的第二节点的地址,且源地址经过IPV4/IPV6互通网关翻译后,与第一边缘超级节点网络域类型相同,Payload中包含第二节点ID,第一资源的文件key,以及第一资源的实际IP地址;对第一查询响应报文进行解析,将Payload中的实际IP地址替换成源地址并转发至请求查询的第一节点。

The invention discloses a P2P resource sharing method, equipment and system. Involved in the field of communication, P2P file sharing is realized by introducing edge super nodes. The method provided by the embodiment of the present invention includes: the first edge super node determines that the local information does not contain the first resource ID, the first edge super node receives the query response message sent by the second edge super node, and the query response message contains Destination address, source address, and Payload. The source address is the address of the second node that stores the first resource, and the source address is translated by the IPV4/IPV6 interworking gateway. It is the same as the network domain type of the first edge super node. The Payload contains the first Two node IDs, the file key of the first resource, and the actual IP address of the first resource; parse the first query response message, replace the actual IP address in the Payload with the source address and forward it to the first node requesting the query .

Description

一种P2P资源共享的方法、设备及系统A method, device and system for P2P resource sharing

技术领域technical field

本发明涉及通信领域,尤其涉及一种P2P资源共享方法、设备及系统。The present invention relates to the communication field, in particular to a P2P resource sharing method, device and system.

背景技术Background technique

点对点(peer-to-peer,简称P2P)技术又称对等互联网络技术,P2P网络中,任何一台计算机既可以作为服务器端,又可以作为客户端,节点与节点之间的关系是平等的。每个用户可以直接连接到其他用户的计算机,并进行文件的交换,而不需要连接到服务器上再进行浏览与下载。在整个过程中,消息通过节点的转发,沿着P2P网络中的路径进行传播。因为消除了中间环节,P2P技术使得网络上的沟通变得更容易、更直接。P2P改变了Internet以大网站为中心的现状,使其重返非中心化,并把权力交还给用户。而且在性能上,因为负载分担在各个节点,所以网络效率更高;功能上,各个节点重要性相同,单个节点失效对整个系统的损坏程度是相同的,很少出现重要节点故障时服务瘫痪的情况。Peer-to-peer (P2P for short) technology is also called peer-to-peer Internet technology. In a P2P network, any computer can be used as both a server and a client, and the relationship between nodes is equal. . Each user can directly connect to other users' computers and exchange files without connecting to the server for browsing and downloading. In the whole process, the message is transmitted along the path in the P2P network through the forwarding of nodes. Because of the elimination of intermediate links, P2P technology makes communication on the network easier and more direct. P2P has changed the status quo that the Internet is centered on large websites, making it return to decentralization and returning power to users. Moreover, in terms of performance, because the load is shared by each node, the network efficiency is higher; in terms of function, each node has the same importance, and the damage of a single node to the entire system is the same, and the service is rarely paralyzed when an important node fails. Condition.

IPv6(Internet Protocol Version 6)为IPv4的下一代IP协议,IPv6技术将IPv4中32位地址扩展为128位,可以充分满足未来各种业务对IP地址的需求,并且简化了包头,增强了安全性能。然而,IPv6技术的部署实施不是一蹴而就的,IPv6与IPv4共存的场景将要持续很长时间,所以两网间的互通技术对于实现IPv4向IPv6的平滑过渡十分重要。IPv6 (Internet Protocol Version 6) is the next-generation IP protocol of IPv4. IPv6 technology expands the 32-bit address in IPv4 to 128-bit, which can fully meet the needs of various services for IP addresses in the future, and simplifies the header and enhances security performance. . However, the deployment and implementation of IPv6 technology cannot be accomplished overnight, and the coexistence of IPv6 and IPv4 will last for a long time, so the intercommunication technology between the two networks is very important to realize the smooth transition from IPv4 to IPv6.

在P2P网络中,路由表包含静态IP地址,路由表将全局节点号与IP地址紧密耦合,路由查询、对象定位以及消息转发需要节点之间建立底层的传输控制协议(Transmission Control Protocol,简称TCP)连接,这要求远端节点拥有永久的IP地址,以保证P2P路由、定位的顺利进行。如果远端IP地址有变化,将无法和远端节点建立正常的连接和通信,导致目的端不可到达,从而影响P2P路由和对象资源定位的有效性和准确性。In a P2P network, the routing table contains static IP addresses, and the routing table tightly couples the global node number with the IP address. Routing query, object location, and message forwarding require the establishment of the underlying Transmission Control Protocol (TCP) between nodes. Connection, which requires the remote node to have a permanent IP address to ensure the smooth progress of P2P routing and positioning. If the remote IP address changes, it will not be able to establish a normal connection and communication with the remote node, resulting in the destination being unreachable, thus affecting the effectiveness and accuracy of P2P routing and object resource location.

而在IPv4与IPv6网络互通协议的场景下,当使用地址翻译时,IPv6与IPv4的地址翻译存在非一一映射,或者动态映射的情况,导致不同时间内相同的IPv6地址可能会被翻译成不同的IPv4地址,这样对端的IP地址可能发生变化而导致路由不可达。In the scenario of IPv4 and IPv6 network interworking protocol, when address translation is used, IPv6 and IPv4 address translation has non-one-to-one mapping or dynamic mapping, resulting in the same IPv6 address at different times may be translated into different The IPv4 address of the remote end may change, and the route may become unreachable.

发明内容Contents of the invention

本发明实施例提供一种P2P资源共享的方法、设备及系统,实现IPv6与IPv4混合组网下的P2P资源分享。Embodiments of the present invention provide a P2P resource sharing method, device and system to realize P2P resource sharing under the mixed networking of IPv6 and IPv4.

为了实现上述目的,本发明实施例采用的技术方案是,In order to achieve the above purpose, the technical solution adopted in the embodiment of the present invention is:

第一方面,提供了一种P2P资源共享方法,包括:In the first aspect, a P2P resource sharing method is provided, including:

第一边缘超级节点接收第一超级节点转发的第一查询请求,其中,所述第一查询请求包含第一节点请求查询的第一资源ID;The first edge super node receives a first query request forwarded by the first super node, wherein the first query request includes a first resource ID that the first node requests to query;

所述第一边缘超级节点根据所述第一资源ID查询所述第一边缘超级节点的本地信息,其中,所述第一边缘超级节点的本地信息包含所述第一边缘超级节点能够获取的资源ID,以及每个资源ID对应的节点ID和IP地址;The first edge super node queries the local information of the first edge super node according to the first resource ID, wherein the local information of the first edge super node includes resources that the first edge super node can obtain ID, and the node ID and IP address corresponding to each resource ID;

若所述第一边缘超级节点确定所述第一边缘超级节点的本地信息中不包含所述第一资源ID,则将所述第一查询请求转发至第二边缘超级节点,以使得所述第二边缘超级节点在所述第二边缘超级节点所在的网络域中查找所述第一资源,其中,所述第一边缘超级节点和所述第二边缘超级节点通过IPV4/IPV6互通网关连接,所述第一边缘超级节点处于IPV4网络域,所述第二边缘超级节点处于IPV6网络域;或者,所述第一边缘超级节点处于IPV6网络域,所述第二边缘超级节点处于IPV4网络域;If the first edge super node determines that the local information of the first edge super node does not contain the first resource ID, then forward the first query request to the second edge super node, so that the first edge super node Two edge super nodes search for the first resource in the network domain where the second edge super node is located, wherein the first edge super node and the second edge super node are connected through an IPV4/IPV6 interworking gateway, so The first edge super node is in the IPV4 network domain, and the second edge super node is in the IPV6 network domain; or, the first edge super node is in the IPV6 network domain, and the second edge super node is in the IPV4 network domain;

所述第一边缘超级节点接收所述第二边缘超级节点发送的第一查询响应报文,其中,所述第一查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为存储所述第一资源的第二节点的地址,且所述源地址经过所述IPV4/IPV6互通网关翻译后,与所述第一边缘超级节点所处网络域类型相同,所述Payload中包含所述第二节点ID,所述第一资源的文件key,以及所述第一资源的实际IP地址;The first edge super node receives the first query response message sent by the second edge super node, wherein the first query response message includes a destination address, a source address, and a Payload, and the destination address is The address of the first node, the source address is the address of the second node storing the first resource, and after the source address is translated by the IPV4/IPV6 interworking gateway, it is the same as the first edge super node The network domain types are the same, and the Payload includes the second node ID, the file key of the first resource, and the actual IP address of the first resource;

所述第一边缘超级节点对所述第一查询响应报文进行解析,若确定所述Payload中所述实际IP地址的类型与所述第一边缘超级节点所处的网络域的IP地址类型不同,则将所述Payload中的所述实际IP地址替换成所述第一查询响应报文中的源地址;The first edge supernode parses the first query response message, and if it is determined that the type of the actual IP address in the Payload is different from the IP address type of the network domain where the first edge supernode is located , then replace the actual IP address in the Payload with the source address in the first query response message;

所述第一边缘超级节点将所述第一查询响应报文转发至所述第一节点,以使得所述第一节点根据所述第一查询响应报文与所述第二节点建立P2P连接,并进行所述第一资源的共享。The first edge super node forwards the first query response message to the first node, so that the first node establishes a P2P connection with the second node according to the first query response message, And share the first resource.

第二方面,提供了第一边缘超级节点,包括:In the second aspect, the first edge super nodes are provided, including:

第一接收模块,用于接收第一超级节点转发的第一查询请求,其中,所述第一查询请求包含第一节点请求查询的第一资源ID;The first receiving module is configured to receive a first query request forwarded by the first supernode, wherein the first query request includes a first resource ID that the first node requests to query;

查询模块,用于根据所述第一资源ID查询所述第一边缘超级节点的本地信息,其中,所述第一边缘超级节点的本地信息包含所述第一边缘超级节点能够获取的资源ID,以及每个资源ID对应的节点ID和IP地址;A query module, configured to query the local information of the first edge super node according to the first resource ID, wherein the local information of the first edge super node includes resource IDs that can be obtained by the first edge super node, And the node ID and IP address corresponding to each resource ID;

第一发送模块,用于若所述查询模块确定所述第一边缘超级节点的本地信息中不包含所述第一资源ID,则将所述第一查询请求转发至第二边缘超级节点,以使得所述第二边缘超级节点在所述第二边缘超级节点所在的网络域中查找所述第一资源,其中,所述第一边缘超级节点和所述第二边缘超级节点通过IPV4/IPV6互通网关连接,所述第一边缘超级节点处于IPV4网络域,所述第二边缘超级节点处于IPV6网络域;或者,所述第一边缘超级节点处于IPV6网络域,所述第二边缘超级节点处于IPV4网络域;A first sending module, configured to forward the first query request to a second edge super node if the query module determines that the local information of the first edge super node does not contain the first resource ID, to causing the second edge supernode to search for the first resource in the network domain where the second edge supernode is located, wherein the first edge supernode and the second edge supernode communicate through IPV4/IPV6 Gateway connection, the first edge super node is in the IPV4 network domain, and the second edge super node is in the IPV6 network domain; or, the first edge super node is in the IPV6 network domain, and the second edge super node is in the IPV4 network domain network domain;

第二接收模块,用于接收所述第二边缘超级节点发送的第一查询响应报文,其中,所述第一查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为存储所述第一资源的第二节点的地址,且所述源地址经过所述IPV4/IPV6互通网关翻译后,与所述第一边缘超级节点所处网络域类型相同,所述Payload中包含所述第二节点ID,所述第一资源的文件key,以及所述第一资源的实际IP地址;The second receiving module is configured to receive the first query response message sent by the second edge super node, wherein the first query response message includes a destination address, a source address, and a Payload, and the destination address is The address of the first node, the source address is the address of the second node storing the first resource, and after the source address is translated by the IPV4/IPV6 interworking gateway, it is the same as the first edge super node The network domain types are the same, and the Payload includes the second node ID, the file key of the first resource, and the actual IP address of the first resource;

解析模块,用于对所述第一查询响应报文进行解析,若确定所述Payload中所述实际IP地址的类型与所述第一边缘超级节点所处的网络域的IP地址类型不同,则将所述Payload中的所述实际IP地址替换成所述第一查询响应报文中的源地址;A parsing module, configured to parse the first query response message, if it is determined that the type of the actual IP address in the Payload is different from the IP address type of the network domain where the first edge super node is located, then replacing the actual IP address in the Payload with the source address in the first query response message;

第二发送模块,用于将所述第一查询响应报文转发至所述第一节点,以使得所述第一节点根据所述第一查询响应报文与所述第二节点建立P2P连接,并进行所述第一资源的共享。a second sending module, configured to forward the first query response message to the first node, so that the first node establishes a P2P connection with the second node according to the first query response message, And share the first resource.

第三方面,提供一种系统,包括:第一边缘超级节点,第二边缘超级节点,所述第一边缘超级节点和所述第二边缘超级节点通过IPV4/IPV6互通网关连接,所述第一边缘超级节点处于IPV4网络域,所述第二边缘超级节点处于IPV6网络域;或者,所述第一边缘超级节点处于IPV6网络域,所述第二边缘超级节点处于IPV4网络域;In a third aspect, a system is provided, including: a first edge super node, a second edge super node, the first edge super node and the second edge super node are connected through an IPV4/IPV6 interworking gateway, and the first The edge super node is in the IPV4 network domain, and the second edge super node is in the IPV6 network domain; or, the first edge super node is in the IPV6 network domain, and the second edge super node is in the IPV4 network domain;

其中,所述第一边缘超级节点用于,Wherein, the first edge super node is used for,

接收第一超级节点转发的第一查询请求,其中,所述第一查询请求包含第一节点请求查询的第一资源ID;receiving a first query request forwarded by the first supernode, wherein the first query request includes a first resource ID that the first node requests to query;

根据所述第一资源ID查询所述第一边缘超级节点的本地信息,其中,所述第一边缘超级节点的本地信息包含所述第一边缘超级节点能够获取的资源ID,以及每个资源ID对应的节点ID和IP地址;Query the local information of the first edge super node according to the first resource ID, wherein the local information of the first edge super node includes the resource ID that the first edge super node can obtain, and each resource ID Corresponding node ID and IP address;

若确定所述第一边缘超级节点的本地信息中不包含所述第一资源ID,则将所述第一查询请求转发至第二边缘超级节点,以使得所述第二边缘超级节点在所述第二边缘超级节点所在的网络域中查找所述第一资源;If it is determined that the local information of the first edge super node does not contain the first resource ID, the first query request is forwarded to the second edge super node, so that the second edge super node is in the Searching for the first resource in the network domain where the second edge super node is located;

接收所述第二边缘超级节点发送的第一查询响应报文,其中,所述第一查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为存储所述第一资源的第二节点的地址,且所述源地址经过所述IPV4/IPV6互通网关翻译后,与所述第一边缘超级节点所处网络域类型相同,所述Payload中包含所述第二节点ID,所述第一资源的文件key,以及所述第一资源的实际IP地址;receiving a first query response message sent by the second edge super node, wherein the first query response message includes a destination address, a source address, and a Payload, and the destination address is the address of the first node , the source address is the address of the second node storing the first resource, and after the source address is translated by the IPV4/IPV6 interworking gateway, it is the same type of network domain as the first edge super node, The Payload includes the second node ID, the file key of the first resource, and the actual IP address of the first resource;

对所述第一查询响应报文进行解析,若确定所述Payload中所述实际IP地址的类型与所述第一边缘超级节点所处的网络域的IP地址类型不同,则将所述Payload中的所述实际IP地址替换成所述第一查询响应报文中的源地址;Analyzing the first query response message, if it is determined that the type of the actual IP address in the Payload is different from the IP address type of the network domain where the first edge super node is located, then the Replace the actual IP address of the source address in the first query response message;

将所述第一查询响应报文转发至所述第一节点,以使得所述第一节点根据所述第一查询响应报文与所述第二节点建立P2P连接,并进行所述第一资源的共享。Forwarding the first query response message to the first node, so that the first node establishes a P2P connection with the second node according to the first query response message, and performs the first resource of sharing.

由上可见,本发明实施例提供一种P2P资源共享方法、设备及系统,第一边缘超级节点接收第一超级节点转发的第一查询请求,其中,所述第一查询请求包含第一节点请求查询的第一资源ID;所述第一边缘超级节点根据所述第一资源ID查询所述第一边缘超级节点的本地信息,其中,所述第一边缘超级节点的本地信息包含所述第一边缘超级节点能够获取的资源ID,以及每个资源ID对应的节点ID和IP地址;若所述第一边缘超级节点确定所述第一边缘超级节点的本地信息中不包含所述第一资源ID,则将所述第一查询请求转发至第二边缘超级节点,以使得所述第二边缘超级节点在所述第二边缘超级节点所在的网络域中查找所述第一资源,其中,所述第一边缘超级节点和所述第二边缘超级节点通过IPV4/IPV6互通网关连接,所述第一边缘超级节点处于IPV4网络域,所述第二边缘超级节点处于IPV6网络域;或者,所述第一边缘超级节点处于IPV6网络域,所述第二边缘超级节点处于IPV4网络域;所述第一边缘超级节点接收所述第二边缘超级节点发送的第一查询响应报文,其中,所述第一查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为存储所述第一资源的第二节点的地址,且所述源地址经过所述IPV4/IPV6互通网关翻译后,与所述第一边缘超级节点所处网络域类型相同,所述Payload中包含所述第二节点ID,所述第一资源的文件key,以及所述第一资源的实际IP地址;所述第一边缘超级节点对所述第一查询响应报文进行解析,若确定所述Payload中所述实际IP地址的类型与所述第一边缘超级节点所处的网络域的IP地址类型不同,则将所述Payload中的所述实际IP地址替换成所述第一查询响应报文中的源地址;所述第一边缘超级节点将所述第一查询响应报文转发至所述第一节点,以使得所述第一节点根据所述第一查询响应报文与所述第二节点建立P2P连接,并进行所述第一资源的共享。如此,通过引入边缘超级节点,实现IPv6与IPv4混合组网下的P2P资源分享。克服了现有技术中IPv6与IPv4混合组网下,容易造成IPv6与IPv4的地址翻译非一一映射时或者动态映射时导致的P2P资源分享失败的缺陷。It can be seen from the above that the embodiments of the present invention provide a P2P resource sharing method, device and system, the first edge super node receives the first query request forwarded by the first super node, wherein the first query request includes the first node request The first resource ID of the query; the first edge supernode queries the local information of the first edge supernode according to the first resource ID, wherein the local information of the first edge supernode includes the first The resource IDs that can be obtained by the edge super node, and the node ID and IP address corresponding to each resource ID; if the first edge super node determines that the local information of the first edge super node does not contain the first resource ID , then forward the first query request to the second edge super node, so that the second edge super node searches for the first resource in the network domain where the second edge super node is located, wherein the The first edge super node and the second edge super node are connected through an IPV4/IPV6 interworking gateway, the first edge super node is in the IPV4 network domain, and the second edge super node is in the IPV6 network domain; or, the second edge super node is in the IPV6 network domain; An edge super node is in the IPV6 network domain, and the second edge super node is in the IPV4 network domain; the first edge super node receives the first query response message sent by the second edge super node, wherein the first A query response message includes a destination address, a source address, and a Payload, the destination address is the address of the first node, the source address is the address of the second node storing the first resource, and the After the source address is translated by the IPV4/IPV6 interworking gateway, it is the same as the network domain type of the first edge super node, and the Payload includes the second node ID, the file key of the first resource, and The actual IP address of the first resource; the first edge supernode parses the first query response message, and if it is determined that the type of the actual IP address in the Payload is the same as that of the first edge supernode The IP address types of the network domains where they are located are different, then replace the actual IP address in the Payload with the source address in the first query response message; The query response message is forwarded to the first node, so that the first node establishes a P2P connection with the second node according to the first query response message, and shares the first resource. In this way, through the introduction of edge super nodes, P2P resource sharing under the mixed network of IPv6 and IPv4 is realized. The invention overcomes the defect of P2P resource sharing failure caused by the non-one-to-one mapping of IPv6 and IPv4 address translation or dynamic mapping under the mixed networking of IPv6 and IPv4 in the prior art.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明实施例提供一种IPv6和IPv4混合组网的系统图;Fig. 1 provides a kind of system diagram of IPv6 and IPv4 hybrid networking for the embodiment of the present invention;

图2为本发明实施例提供的一种P2P资源共享方法的流程图;FIG. 2 is a flowchart of a P2P resource sharing method provided by an embodiment of the present invention;

图3为本发明实施例提供的一种第一边缘超级节点的装置结构示意图;FIG. 3 is a schematic structural diagram of a device for a first edge super node provided by an embodiment of the present invention;

图4为本发明实施例提供的另一种第一边缘超级节点的装置结构示意图。Fig. 4 is a schematic structural diagram of another first edge super node device provided by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

为了方便理解本发明实施例,首先在此介绍本发明实施例描述中会引入的几个术语;In order to facilitate the understanding of the embodiments of the present invention, several terms that will be introduced in the description of the embodiments of the present invention are first introduced here;

资源(Piece):为文件资源,以分块Piece形式储存在各普通节点中。Resource (Piece): It is a file resource, which is stored in each common node in the form of a piece of Piece.

资源ID:为资源的标识符。Resource ID: It is the identifier of the resource.

节点ID:为节点标识符,每个节点拥有的全局唯一的标示符。Node ID: It is a node identifier, a globally unique identifier owned by each node.

普通节点:普通P2P节点,可以用来存储资源以及发出资源查询请求,可以保存资源块和相邻节点(包括相邻节点所包含的资源块标示符)等信息,每个网络域有多个普通节点。Ordinary node: ordinary P2P node, which can be used to store resources and issue resource query requests, and can save information such as resource blocks and adjacent nodes (including resource block identifiers contained in adjacent nodes). Each network domain has multiple ordinary nodes. node.

超级节点:维护下游普通节点信息,用于资源检索,不做文件存储,每个网络域可以有多个超级节点。Super node: maintain downstream ordinary node information for resource retrieval, no file storage, each network domain can have multiple super nodes.

边缘超级节点:为本发明实施例在现有IPv4与IPv6网络架构下引入的新型节点,每个网络域可以包含一个边缘超级节点,也可以包含多个边缘超级节点,具体可以根据网络域的实际情况进行部署,边缘超级节点只在网络域的边缘部署,不做文件资源存储,边缘超级节点可以同时运行多种类型协议,例如,可以同时运行IPv6和IPv4协议。边缘超级节点与至少一个超级节点直连,该超级节点将该边缘超级节点的地址信息扩展给其他超级节点。Edge super node: a new type of node introduced under the existing IPv4 and IPv6 network architecture in the embodiment of the present invention. Each network domain can contain one edge super node or multiple edge super nodes. Specifically, it can be based on the actual situation of the network domain The edge super nodes are only deployed on the edge of the network domain, and do not store file resources. The edge super nodes can run multiple types of protocols at the same time, for example, they can run IPv6 and IPv4 protocols at the same time. The edge super node is directly connected to at least one super node, and the super node extends the address information of the edge super node to other super nodes.

IPv4/IPv6互通网关,用于连接IPv4网络域与IPv6网络域中的边缘超级节点,维护IPv4网络域与IPv6网络域地址的对应关系,能够将IPv4网络域与IPv6网络域之间的IP地址进行翻译。The IPv4/IPv6 intercommunication gateway is used to connect the edge super nodes in the IPv4 network domain and the IPv6 network domain, maintain the corresponding relationship between the IPv4 network domain and the IPv6 network domain address, and can transfer the IP addresses between the IPv4 network domain and the IPv6 network domain translate.

边缘超级节点控制器:与一个广域内所有边缘超级节点逻辑直连,能够对边缘超级节点进行注册和管理,增强网络可管理性,当网络规模较大时、网络出口较多、边缘超级节点故障并启用新边缘超级的节点时,边缘超级节点控制器提供边缘超级节点间的寻址和新边缘超级节点注册并下发通知等功能,不做文件资源存储。Edge super node controller: logically connected to all edge super nodes in a wide area, able to register and manage edge super nodes, and enhance network manageability. When the network scale is large, there are many network outlets, and edge super nodes fail And when a new edge super node is enabled, the edge super node controller provides functions such as addressing between edge super nodes and new edge super node registration and notification, and does not store file resources.

应理解,本发明实施例可以应用于各种混合组网中的P2P资源共享,本发明实施例对此不进行限制。It should be understood that the embodiments of the present invention may be applied to P2P resource sharing in various hybrid networks, and the embodiments of the present invention are not limited thereto.

仅是示例性的,本发明实施例的方法以应用于IPv6和IPv4混合组网场景下的P2P资源共享进行说明,但这并不对本发明实施例构成任何限定。参见图1,为本发明实施例设定的一种IPv6和IPv4混合组网的系统图,该系统包含IPV4网络域和IPV6网络域,其中,IPV4网络域中包含节点20,超级节点40、50,边缘超级节点30,IPV4网络域中包含节点80,超级节点70,边缘超级节点60,边缘超级节点30和边缘超级节点60通过IPv4/IPv6互通网关90连接。It is only exemplary, and the method in the embodiment of the present invention is described as being applied to P2P resource sharing in a mixed networking scenario of IPv6 and IPv4, but this does not constitute any limitation to the embodiment of the present invention. Referring to FIG. 1 , it is a system diagram of a hybrid network of IPv6 and IPv4 set in the embodiment of the present invention, the system includes an IPV4 network domain and an IPV6 network domain, wherein the IPV4 network domain includes nodes 20, supernodes 40, 50 , the edge super node 30, the IPV4 network domain includes the node 80, the super node 70, the edge super node 60, the edge super node 30 and the edge super node 60 are connected through the IPv4/IPv6 interworking gateway 90.

一方面,本发明实施例提供一种P2P资源共享方法,需要说明的是,参见图1,本发明实施例假设节点20为第一节点,超级节点40为第一超级节点,边缘超级节点30为第一边缘超级节点,节点80为第二节点,超级节点70为第二超级节点,边缘超级节点60为第二边缘超级节点。On the one hand, the embodiment of the present invention provides a P2P resource sharing method. It should be noted that, referring to FIG. The first edge super node, the node 80 is the second node, the super node 70 is the second super node, and the edge super node 60 is the second edge super node.

参见图2,可以包括以下步骤:Referring to Figure 2, the following steps may be included:

201:第一边缘超级节点接收第一超级节点转发的第一查询请求,其中,所述第一查询请求包含第一节点请求查询的第一资源ID;201: The first edge super node receives a first query request forwarded by the first super node, wherein the first query request includes a first resource ID that the first node requests to query;

其中,第一节点在首次注册登录P2P网络时,生成全域唯一的第一节点的ID并注册。第一节点作为新节点时,至少知道P2P网络中的一个节点,第一节点可以从P2P应用中得到节点的具体位置信息。第一节点加入网络后可通知与第一节点相关联的其他节点(例如图1中的节点50),来更新其他节点的查询表。Wherein, when the first node registers and logs into the P2P network for the first time, it generates and registers a unique ID of the first node in the entire domain. When the first node is a new node, at least one node in the P2P network is known, and the first node can obtain the specific location information of the node from the P2P application. After the first node joins the network, it may notify other nodes associated with the first node (for example, node 50 in FIG. 1 ) to update the lookup tables of other nodes.

其中,第一边缘超级节点初始时可以人工配置,并将其连通IPv4和IPv6域以进行分布式哈希表(Distributed Hash Table,简称DHT散列表计算。Wherein, the first edge super node can be manually configured initially, and connected to IPv4 and IPv6 domains to perform Distributed Hash Table (DHT hash table calculation for short).

假设第一节点需要从其他节点共享第一资源,则第一节点发送第一查询请求到与第一节点相邻的节点,该查询请求包含第一资源ID;Assuming that the first node needs to share the first resource from other nodes, the first node sends a first query request to a node adjacent to the first node, and the query request includes the first resource ID;

第一节点的相邻节点查询该相邻节点的本地信息,该相邻节点的本地信息可以包含该相邻节点存储的资源的资源ID信息,以及该相邻节点可以获取的资源的资源ID及对应的地址信息,如果相邻节点确定本地信息包含第一资源的定位信息缓存,例如节点(Node Identifier,简称NID),第一资源的IP地址,那么就返回第一资源的定位信息的数据源;如果相邻节点的本地信息没有第一资源的定位信息,那么该相邻节点可以将该查询请求转发到第一超级节点。The adjacent nodes of the first node query the local information of the adjacent node, and the local information of the adjacent node may include the resource ID information of the resource stored by the adjacent node, and the resource ID and the resource ID of the resource that the adjacent node can obtain. For the corresponding address information, if the adjacent node determines that the local information contains the location information cache of the first resource, such as the node (Node Identifier, NID for short), the IP address of the first resource, then the data source of the location information of the first resource is returned ; If the local information of the neighboring node does not have the location information of the first resource, then the neighboring node may forward the query request to the first super node.

当第一超级节点接到该第一查询请求时,可以优先查看第一超级节点的本地信息,第一超级节点的本地信息可以包含第一超级节点记录的资源ID,以及每个资源ID对应的节点ID和IP地址;例如,第一超级节点的本地信息可以以路由表的形式存在,若第一超级节点的本地信息中包含第一资源ID以及第一资源对应的地址信息(包含该第一资源对应的节点ID和IP地址),则第一超级节点可以向第一节点返回该第一资源的地址信息,若第一超级节点的本地信息中不包含第一资源ID以及第一资源对应的地址信息,则第一超级节点可以将第一查询请求转发给其他超级节点进行查询,若所有超级节点都无法查找到第一资源的位置信息时,将第一查询请求转发给第一边缘超级节点。When the first super node receives the first query request, it can first view the local information of the first super node. The local information of the first super node can include the resource ID recorded by the first super node, and the corresponding Node ID and IP address; for example, the local information of the first super node can exist in the form of a routing table, if the local information of the first super node contains the first resource ID and the address information corresponding to the first resource (including the first The node ID and IP address corresponding to the resource), the first super node can return the address information of the first resource to the first node, if the local information of the first super node does not include the first resource ID and the corresponding IP address of the first resource Address information, the first super node can forward the first query request to other super nodes for query, if all super nodes cannot find the location information of the first resource, forward the first query request to the first edge super node .

202:所述第一边缘超级节点根据所述第一资源ID查询所述第一边缘超级节点的本地信息,其中,所述第一边缘超级节点的本地信息包含所述第一边缘超级节点能够获取的资源ID,以及每个资源ID对应的节点ID和IP地址;202: The first edge supernode queries the local information of the first edge supernode according to the first resource ID, wherein the local information of the first edge supernode includes resource ID, and the node ID and IP address corresponding to each resource ID;

当第一边缘超级节点接到该第一查询请求时,可以优先查看第一边缘超级节点的本地信息,第一边缘超级节点的本地信息可以包含第一边缘超级节点记录的资源ID,以及每个资源ID对应的节点ID和IP地址;例如,第一边缘超级节点的本地信息可以以路由表的形式存在,若第一边缘超级节点的本地信息中包含第一资源ID以及第一资源对应的地址信息(包含该第一资源对应的节点ID和IP地址),则第一边缘超级节点可以向第一资源的地址信息逐级传送给第一节点。When the first edge super node receives the first query request, it can preferentially check the local information of the first edge super node. The local information of the first edge super node can include the resource ID recorded by the first edge super node, and each The node ID and IP address corresponding to the resource ID; for example, the local information of the first edge super node can exist in the form of a routing table, if the local information of the first edge super node contains the first resource ID and the address corresponding to the first resource information (including the node ID and IP address corresponding to the first resource), the first edge supernode can transmit the address information of the first resource to the first node step by step.

203:若所述第一边缘超级节点确定所述第一边缘超级节点的本地信息中不包含所述第一资源ID,则将所述第一查询请求转发至第二边缘超级节点,以使得所述第二边缘超级节点在所述第二边缘超级节点所在的网络域中查找所述第一资源,其中,所述第一边缘超级节点和所述第二边缘超级节点通过IPV4/IPV6互通网关连接,所述第一边缘超级节点处于IPV4网络域,所述第二边缘超级节点处于IPV6网络域;或者,所述第一边缘超级节点处于IPV6网络域,所述第二边缘超级节点处于IPV4网络域;203: If the first edge super node determines that the local information of the first edge super node does not contain the first resource ID, forward the first query request to a second edge super node, so that all The second edge super node searches for the first resource in the network domain where the second edge super node is located, wherein the first edge super node and the second edge super node are connected through an IPV4/IPV6 interworking gateway , the first edge super node is in the IPV4 network domain, and the second edge super node is in the IPV6 network domain; or, the first edge super node is in the IPV6 network domain, and the second edge super node is in the IPV4 network domain ;

若第一边缘超级节点的本地信息中不包含第一资源ID以及第一资源对应的地址信息,若当前网络域中存在其他边缘超级节点,则第一边缘超级节点可以将第一查询请求转发给其他边缘超级节点进行查询,若所有边缘超级节点都无法查找到第一资源的位置信息时,第一边缘超级节点将第一查询请求转发给其他网络域中的第二边缘超级节点。If the local information of the first edge super node does not contain the first resource ID and the address information corresponding to the first resource, and if there are other edge super nodes in the current network domain, the first edge super node can forward the first query request to When other edge super nodes perform queries, if none of the edge super nodes can find the location information of the first resource, the first edge super node forwards the first query request to the second edge super nodes in other network domains.

当IPV6网络域中第二边缘超级节点接收到IPV6网络域的第一边缘超级节点发送的第一查询请求时,可以在自身存储和域内超级节点进行查找直至找到或完成全网查找为止。若找到,第二边缘超级节点将第一查询响应报文发送给第一边缘超级节点。若没有找到,如果存在的话其他边缘超级节点,则将第一查询请求转发给其他边缘超级节。若直到查询完整个网络为止,都没有找到第一资源的位置信息,则返回第一资源不存在。When the second edge super node in the IPV6 network domain receives the first query request sent by the first edge super node in the IPV6 network domain, it can search in its own storage and the super nodes in the domain until it finds or completes the entire network search. If found, the second edge super node sends the first query response message to the first edge super node. If not found, if there are other edge supernodes, the first query request is forwarded to other edge supernodes. If the location information of the first resource is not found until the entire network is queried, it will return that the first resource does not exist.

204、所述第一边缘超级节点接收所述第二边缘超级节点发送的第一查询响应报文,其中,所述第一查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为存储所述第一资源的第二节点的地址,且所述源地址经过所述IPV4/IPV6互通网关翻译后,与所述第一边缘超级节点所处网络域类型相同,所述Payload中包含所述第二节点ID,所述第一资源的文件key,以及所述第一资源的实际IP地址;204. The first edge super node receives a first query response message sent by the second edge super node, wherein the first query response message includes a destination address, a source address, and a Payload, and the destination The address is the address of the first node, the source address is the address of the second node storing the first resource, and the source address is translated by the IPV4/IPV6 interworking gateway, and the first edge The network domain type where the super node is located is the same, and the Payload includes the second node ID, the file key of the first resource, and the actual IP address of the first resource;

其中,IPV4/IPV6互通网关可以维护IPV4和IPV6之间的对应关系,第一查询响应报文在经过IPV4/IPV6互通网关时,IPV4/IPV6互通网关可以对其中的源地址进行翻译,使得翻译后的源地址与所述第一边缘超级节点所处网络域类型相同。例如,在本实施例中,存储第一资源的第二节点的IP地址为IPV6地址,第二边缘超级节点将IPV6形式的第二节点的IP地址作为源地址加入第一查询响应报文,IPV4/IPV6互通网关将IPV6形式的第二节点的IP地址翻译IPV4形式的第二节点的IP地址,并将翻译后的IPV4形式的第二节点的IP地址作为源地址加入第一查询响应报文。Among them, the IPV4/IPV6 interworking gateway can maintain the corresponding relationship between IPV4 and IPV6. When the first query response message passes through the IPV4/IPV6 interworking gateway, the IPV4/IPV6 interworking gateway can translate the source address therein, so that after translation The source address of is the same as the network domain type where the first edge super node is located. For example, in this embodiment, the IP address of the second node storing the first resource is an IPV6 address, and the second edge super node adds the IP address of the second node in the form of IPV6 as the source address to the first query response message, and the IPV4 The /IPV6 interworking gateway translates the IP address of the second node in the form of IPV6 into the IP address of the second node in the form of IPV4, and adds the translated IP address of the second node in the form of IPV4 as a source address to the first query response message.

205、所述第一边缘超级节点对所述第一查询响应报文进行解析,若确定所述Payload中所述实际IP地址的类型与所述第一边缘超级节点所处的网络域的IP地址类型不同,则将所述Payload中的所述实际IP地址替换成所述第一查询响应报文中的源地址;205. The first edge supernode parses the first query response message, and if it is determined that the type of the actual IP address in the Payload is the same as the IP address of the network domain where the first edge supernode is located different types, then replace the actual IP address in the Payload with the source address in the first query response message;

例如,第一边缘超级节点对所述第一查询响应报文进行解析后,获得所述第一查询响应报文中的目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为经过IPV4/IPV6互通网关翻译后第二节点地址,经过解析后,第一边缘超级节点获取Payload中包含的第二节点ID,第一资源的文件key,以及第一资源的实际IP地址;为了使得第一节点能够识别第一资源的IP地址,所以,第一边缘超级节点解析得到第一资源的实际IP地址,判断该实际IP地址与当前网络域的IP地址类型是否相同,如过不同,说明第一节点不能识别该实际IP地址,因为源地址为经过IPV4/IPV6互通网关翻译后的第二节点地址,能够被第一节点识别,所以,第一边缘超级节点将源地址替换该实际IP地址。For example, after the first edge super node parses the first query response message, it obtains the destination address, source address, and Payload in the first query response message, and the destination address is the The source address is the address of the second node after being translated by the IPV4/IPV6 interworking gateway. After parsing, the first edge super node obtains the second node ID contained in the Payload, the file key of the first resource, and the first The actual IP address of the resource; in order to enable the first node to identify the IP address of the first resource, the first edge super node resolves to obtain the actual IP address of the first resource, and judges the actual IP address and the IP address type of the current network domain Whether it is the same, if it is different, it means that the first node cannot recognize the actual IP address, because the source address is the second node address translated by the IPV4/IPV6 interworking gateway, which can be recognized by the first node, so the first edge super node Replace the source address with the actual IP address.

206、所述第一边缘超级节点将所述第一查询响应报文转发至所述第一节点,以使得所述第一节点根据所述第一查询响应报文与所述第二节点建立P2P连接,并进行所述第一资源的共享。206. The first edge super node forwards the first query response message to the first node, so that the first node establishes a P2P with the second node according to the first query response message connect, and share the first resource.

第一节点获取第一查询响应报文后,根据所述第一查询响应报文中Payload中的第二节点ID,第一资源的文件key,以及第一资源的IP地址(翻译后的)可以与第二节点建立P2P连接,并在建立P2P连接后共享第二节点的第一资源,所以,经过IPV4/IPV6互通网关对IP地址的翻译,以及第一边缘超级节点对解析后的Payload中的IP地址的判断和替换,使得第一节点收到的IP地址可识别,确保P2P建立成功。After the first node obtains the first query response message, according to the second node ID in the Payload in the first query response message, the file key of the first resource, and the IP address (translated) of the first resource can be Establish a P2P connection with the second node, and share the first resource of the second node after the P2P connection is established, so, after the translation of the IP address by the IPV4/IPV6 interworking gateway, and the first edge super node’s analysis of the Payload The judgment and replacement of the IP address makes the IP address received by the first node recognizable and ensures the successful establishment of P2P.

进一步的,为了提高查询的效率以及确保地址翻译的有效性,所述方法还包括:Further, in order to improve query efficiency and ensure the effectiveness of address translation, the method further includes:

所述第一边缘超级节点将所述第一资源ID与所述第一资源的实际IP地址存储至文件地址信息,其中,所述文件地址信息包含所述第一边缘超级节点每次查询所得的资源ID以及与所述资源ID对应的实际IP地址。The first edge supernode stores the first resource ID and the actual IP address of the first resource in file address information, wherein the file address information includes the information obtained by the first edge supernode each query Resource ID and the actual IP address corresponding to the resource ID.

第一边缘超级节点通过存储每次查询的文件地址信息,当某一资源之前被查询过后,当再次查询该资源时,可以快速获取该资源的真实IP地址,因为IPV4/IPV6互通网关维护的IPV4和IPV6之间的地址映射对可能是动态的对应关系,所以,该资源的真实IP地址在不同时刻可以对应不同的翻译的IP地址,所以,第一边缘超级节点不能直接向请求节点返回之间查询的翻译IP地址,但是,该资源对应的真实IP地址不变,所以,第一边缘超级节点可以根据该资源的真实IP地址请求IPV4/IPV6互通网关当前时刻的翻译IP地址,具体可以通过下述过程体现。By storing the file address information of each query, the first edge super node can quickly obtain the real IP address of the resource when a resource is queried before, because the IPV4/IPV6 interworking gateway maintains the IPV4 The address mapping between IPV6 and IPV6 may be a dynamic correspondence. Therefore, the real IP address of the resource may correspond to different translated IP addresses at different times. Therefore, the first edge super node cannot directly return to the requesting node. The translation IP address of the query, but the real IP address corresponding to the resource remains unchanged, so the first edge super node can request the translation IP address of the IPV4/IPV6 interworking gateway at the current moment according to the real IP address of the resource, specifically through the following The above process is reflected.

第一边缘超级节点接收所述第一超级节点转发的第二查询请求,其中,所述第二查询请求包含第三节点请求查询的第二资源ID,所述第三节点为所述第一边缘超级节点所在网络域中任意一个节点。The first edge super node receives the second query request forwarded by the first super node, wherein the second query request includes the second resource ID requested by the third node, and the third node is the first edge Any node in the network domain where the super node is located.

第一边缘超级节点根据所述第二资源ID查询所述文件地址信息,若确定所述文件地址信息中包含所述第二资源ID,则向所述IPV4/IPV6互通网关发送所述第二资源ID对应的实际IP地址,以使得所述IPV4/IPV6互通网关为所述第二资源ID的实际IP地址提供翻译地址。The first edge supernode queries the file address information according to the second resource ID, and if it is determined that the file address information contains the second resource ID, then sends the second resource to the IPV4/IPV6 interworking gateway The actual IP address corresponding to the ID, so that the IPV4/IPV6 interworking gateway provides a translation address for the actual IP address of the second resource ID.

其中,若IPV4/IPV6互通网关当前时刻存在第二资源ID对应的实际IP地址的翻译IP地址,则可以直接向第一边缘超级节点返回该翻译IP地址,若当前时刻IPV4/IPV6互通网关不存在第二资源ID对应的实际IP地址的翻译IP地址,则IPV4/IPV6互通网关可立即为该第二资源ID对应的实际IP地址分配翻译IP地址。Wherein, if the IPV4/IPV6 interworking gateway currently has a translated IP address corresponding to the actual IP address of the second resource ID, the translated IP address can be directly returned to the first edge super node; if the current IPV4/IPV6 interworking gateway does not exist The translation IP address of the actual IP address corresponding to the second resource ID, the IPV4/IPV6 interworking gateway can immediately assign the translation IP address to the actual IP address corresponding to the second resource ID.

第一边缘超级节点接收所述IPV4/IPV6互通网关发送的所述第二资源的实际IP地址的翻译地址;The first edge super node receives the translation address of the actual IP address of the second resource sent by the IPV4/IPV6 interworking gateway;

第一边缘超级节点将第二查询响应报文转发至所述第三节点,以使得所述第三节点根据所述第二查询响应报文与所述第二资源ID所在的节点建立P2P连接,并进行所述第二资源的共享,其中,所述第二查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第三节点的地址,所述源地址为所述第二资源的实际IP地址的翻译地址,所述Payload中包含所述第二资源所在的节点ID,所述第二资源的文件key,以及所述第二资源的实际IP地址的翻译地址。The first edge super node forwards the second query response message to the third node, so that the third node establishes a P2P connection with the node where the second resource ID is located according to the second query response message, and sharing the second resource, wherein the second query response message includes a destination address, a source address, and a Payload, the destination address is the address of the third node, and the source address is the The translation address of the actual IP address of the second resource, the Payload includes the node ID where the second resource is located, the file key of the second resource, and the translation address of the actual IP address of the second resource.

由上可见,本发明实施例提供一种P2P资源共享方法,第一边缘超级节点接收第一超级节点转发的第一查询请求,其中,所述第一查询请求包含第一节点请求查询的第一资源ID;所述第一边缘超级节点根据所述第一资源ID查询所述第一边缘超级节点的本地信息,其中,所述第一边缘超级节点的本地信息包含所述第一边缘超级节点能够获取的资源ID,以及每个资源ID对应的节点ID和IP地址;若所述第一边缘超级节点确定所述第一边缘超级节点的本地信息中不包含所述第一资源ID,则将所述第一查询请求转发至第二边缘超级节点,以使得所述第二边缘超级节点在所述第二边缘超级节点所在的网络域中查找所述第一资源,其中,所述第一边缘超级节点和所述第二边缘超级节点通过IPV4/IPV6互通网关连接,所述第一边缘超级节点处于IPV4网络域,所述第二边缘超级节点处于IPV6网络域;或者,所述第一边缘超级节点处于IPV6网络域,所述第二边缘超级节点处于IPV4网络域;所述第一边缘超级节点接收所述第二边缘超级节点发送的第一查询响应报文,其中,所述第一查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为存储所述第一资源的第二节点的地址,且所述源地址经过所述IPV4/IPV6互通网关翻译后,与所述第一边缘超级节点所处网络域类型相同,所述Payload中包含所述第二节点ID,所述第一资源的文件key,以及所述第一资源的实际IP地址;所述第一边缘超级节点对所述第一查询响应报文进行解析,若确定所述Payload中所述实际IP地址的类型与所述第一边缘超级节点所处的网络域的IP地址类型不同,则将所述Payload中的所述实际IP地址替换成所述第一查询响应报文中的源地址;所述第一边缘超级节点将所述第一查询响应报文转发至所述第一节点,以使得所述第一节点根据所述第一查询响应报文与所述第二节点建立P2P连接,并进行所述第一资源的共享。如此,通过引入边缘超级节点,实现IPv6与IPv4混合组网下的P2P资源分享。克服了现有技术中IPv6与IPv4混合组网下,容易造成IPv6与IPv4的地址翻译非一一映射关系或者动态映射导致的P2P资源分享失败的缺陷。It can be seen from the above that the embodiment of the present invention provides a P2P resource sharing method. The first edge super node receives the first query request forwarded by the first super node, wherein the first query request includes the first query requested by the first node. Resource ID; the first edge supernode queries the local information of the first edge supernode according to the first resource ID, wherein the local information of the first edge supernode includes the ability of the first edge supernode The obtained resource ID, and the node ID and IP address corresponding to each resource ID; if the first edge super node determines that the local information of the first edge super node does not contain the first resource ID, then the The first query request is forwarded to the second edge super node, so that the second edge super node searches for the first resource in the network domain where the second edge super node is located, wherein the first edge super node The node and the second edge super node are connected through an IPV4/IPV6 interworking gateway, the first edge super node is in the IPV4 network domain, and the second edge super node is in the IPV6 network domain; or, the first edge super node In the IPV6 network domain, the second edge super node is in the IPV4 network domain; the first edge super node receives the first query response message sent by the second edge super node, wherein the first query response message The text includes destination address, source address, and Payload, the destination address is the address of the first node, the source address is the address of the second node storing the first resource, and the source address passes through the After the IPV4/IPV6 interworking gateway is translated, it is of the same network domain type as the first edge super node, and the Payload includes the second node ID, the file key of the first resource, and the first The actual IP address of the resource; the first edge supernode parses the first query response message, and if it is determined that the type of the actual IP address in the Payload is the same as the network where the first edge supernode is located If the IP address types of the domains are different, replace the actual IP address in the Payload with the source address in the first query response message; the first edge super node will replace the first query response message Forwarding to the first node, so that the first node establishes a P2P connection with the second node according to the first query response message, and performs sharing of the first resource. In this way, through the introduction of edge super nodes, P2P resource sharing under the mixed network of IPv6 and IPv4 is realized. It overcomes the defect that the IPv6 and IPv4 mixed networking in the prior art may easily cause the non-one-to-one mapping relationship between IPv6 and IPv4 address translation or the failure of P2P resource sharing caused by dynamic mapping.

一方面,本发明实施例提供一种第一边缘超级节点30,参见图3,包括:On the one hand, the embodiment of the present invention provides a first edge super node 30, see FIG. 3, including:

第一接收模块301,用于接收第一超级节点转发的第一查询请求,其中,所述第一查询请求包含第一节点请求查询的第一资源ID;The first receiving module 301 is configured to receive a first query request forwarded by the first supernode, wherein the first query request includes a first resource ID that the first node requests to query;

查询模块302,用于根据所述第一资源ID查询所述第一边缘超级节点的本地信息,其中,所述第一边缘超级节点的本地信息包含所述第一边缘超级节点能够获取的资源ID,以及每个资源ID对应的节点ID和IP地址;A query module 302, configured to query the local information of the first edge super node according to the first resource ID, wherein the local information of the first edge super node includes resource IDs that can be obtained by the first edge super node , and the node ID and IP address corresponding to each resource ID;

第一发送模块303,用于若所述查询模块确定所述第一边缘超级节点的本地信息中不包含所述第一资源ID,则将所述第一查询请求转发至第二边缘超级节点,以使得所述第二边缘超级节点在所述第二边缘超级节点所在的网络域中查找所述第一资源,其中,所述第一边缘超级节点和所述第二边缘超级节点通过IPV4/IPV6互通网关连接,所述第一边缘超级节点处于IPV4网络域,所述第二边缘超级节点处于IPV6网络域;或者,所述第一边缘超级节点处于IPV6网络域,所述第二边缘超级节点处于IPV4网络域;The first sending module 303 is configured to forward the first query request to a second edge super node if the query module determines that the local information of the first edge super node does not contain the first resource ID, so that the second edge super node searches for the first resource in the network domain where the second edge super node is located, wherein the first edge super node and the second edge super node pass IPV4/IPV6 Interworking gateway connection, the first edge super node is in the IPV4 network domain, and the second edge super node is in the IPV6 network domain; or, the first edge super node is in the IPV6 network domain, and the second edge super node is in the IPV4 network domain;

第二接收模块304,用于接收所述第二边缘超级节点发送的第一查询响应报文,其中,所述第一查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为存储所述第一资源的第二节点的地址,且所述源地址经过所述IPV4/IPV6互通网关翻译后,与所述第一边缘超级节点所处网络域类型相同,所述Payload中包含所述第二节点ID,所述第一资源的文件key,以及所述第一资源的实际IP地址;The second receiving module 304 is configured to receive the first query response message sent by the second edge super node, wherein the first query response message includes a destination address, a source address, and a Payload, and the destination address is the address of the first node, the source address is the address of the second node storing the first resource, and the source address is translated by the IPV4/IPV6 interworking gateway and is identical to the first edge super The network domain types where the nodes are located are the same, and the Payload includes the second node ID, the file key of the first resource, and the actual IP address of the first resource;

解析模块305,用于对所述第一查询响应报文进行解析,若确定所述Payload中所述实际IP地址的类型与所述第一边缘超级节点所处的网络域的IP地址类型不同,则将所述Payload中的所述实际IP地址替换成所述第一查询响应报文中的源地址;The parsing module 305 is configured to parse the first query response message, if it is determined that the type of the actual IP address in the Payload is different from the IP address type of the network domain where the first edge super node is located, Then replace the actual IP address in the Payload with the source address in the first query response message;

第二发送模块306,用于将所述第一查询响应报文转发至所述第一节点,以使得所述第一节点根据所述第一查询响应报文与所述第二节点建立P2P连接,并进行所述第一资源的共享。A second sending module 306, configured to forward the first query response message to the first node, so that the first node establishes a P2P connection with the second node according to the first query response message , and share the first resource.

进一步的,参见图4,第一边缘超级节点30还包括:Further, referring to FIG. 4, the first edge super node 30 also includes:

存储模块307,用于将所述第一资源ID与所述第一资源的实际IP地址存储至文件地址信息,其中,所述文件地址信息包含所述第一边缘超级节点每次查询所得的资源ID以及与所述资源ID对应的实际IP地址。A storage module 307, configured to store the first resource ID and the actual IP address of the first resource in file address information, wherein the file address information includes the resources obtained by the first edge super node each query ID and the actual IP address corresponding to the resource ID.

进一步的,further,

第一接收模块301还用于,接收所述第一超级节点转发的第二查询请求,其中,所述第二查询请求包含第三节点请求查询的第二资源ID,所述第三节点为所述第一边缘超级节点所在网络域中任意一个节点;The first receiving module 301 is further configured to receive a second query request forwarded by the first super node, wherein the second query request includes a second resource ID that a third node requests to query, and the third node is the Any node in the network domain where the first edge super node is located;

所述查询模块302还用于,根据所述第二资源ID查询所述文件地址信息;The query module 302 is further configured to query the file address information according to the second resource ID;

所述第一发送模块303还用于,若所述查询模块确定所述文件地址信息中包含所述第二资源ID,则向所述IPV4/IPV6互通网关发送所述第二资源ID对应的实际IP地址,以使得所述IPV4/IPV6互通网关为所述第二资源ID的实际IP地址提供翻译地址;The first sending module 303 is further configured to, if the query module determines that the file address information includes the second resource ID, send the actual resource ID corresponding to the second resource ID to the IPV4/IPV6 interworking gateway. IP address, so that the IPV4/IPV6 interworking gateway provides a translation address for the actual IP address of the second resource ID;

所述第二接收模块304还用于,接收所述IPV4/IPV6互通网关发送的所述第二资源的实际IP地址的翻译地址;The second receiving module 304 is further configured to receive the translation address of the actual IP address of the second resource sent by the IPV4/IPV6 interworking gateway;

所述第二发送模块306还用于,将第二查询响应报文转发至所述第三节点,以使得所述第三节点根据所述第二查询响应报文与所述第二资源ID所在的节点建立P2P连接,并进行所述第二资源的共享,其中,所述第二查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第三节点的地址,所述源地址为所述第二资源的实际IP地址的翻译地址,所述Payload中包含所述第二资源所在的节点ID,所述第二资源的文件key,以及所述第二资源的实际IP地址的翻译地址。The second sending module 306 is further configured to forward the second query response message to the third node, so that the third node according to the second query response message and the second resource ID The node establishes a P2P connection, and performs the sharing of the second resource, wherein, the second query response message includes a destination address, a source address, and a Payload, and the destination address is the address of the third node, The source address is the translation address of the actual IP address of the second resource, and the Payload includes the node ID where the second resource is located, the file key of the second resource, and the actual IP address of the second resource. The translated address of the IP address.

由上可见,本发明实施例提供一种第一边缘超级节点,接收第一超级节点转发的第一查询请求,其中,所述第一查询请求包含第一节点请求查询的第一资源ID;所述第一边缘超级节点根据所述第一资源ID查询所述第一边缘超级节点的本地信息,其中,所述第一边缘超级节点的本地信息包含所述第一边缘超级节点能够获取的资源ID,以及每个资源ID对应的节点ID和IP地址;若所述第一边缘超级节点确定所述第一边缘超级节点的本地信息中不包含所述第一资源ID,则将所述第一查询请求转发至第二边缘超级节点,以使得所述第二边缘超级节点在所述第二边缘超级节点所在的网络域中查找所述第一资源,其中,所述第一边缘超级节点和所述第二边缘超级节点通过IPV4/IPV6互通网关连接,所述第一边缘超级节点处于IPV4网络域,所述第二边缘超级节点处于IPV6网络域;或者,所述第一边缘超级节点处于IPV6网络域,所述第二边缘超级节点处于IPV4网络域;所述第一边缘超级节点接收所述第二边缘超级节点发送的第一查询响应报文,其中,所述第一查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为存储所述第一资源的第二节点的地址,且所述源地址经过所述IPV4/IPV6互通网关翻译后,与所述第一边缘超级节点所处网络域类型相同,所述Payload中包含所述第二节点ID,所述第一资源的文件key,以及所述第一资源的实际IP地址;所述第一边缘超级节点对所述第一查询响应报文进行解析,若确定所述Payload中所述实际IP地址的类型与所述第一边缘超级节点所处的网络域的IP地址类型不同,则将所述Payload中的所述实际IP地址替换成所述第一查询响应报文中的源地址;所述第一边缘超级节点将所述第一查询响应报文转发至所述第一节点,以使得所述第一节点根据所述第一查询响应报文与所述第二节点建立P2P连接,并进行所述第一资源的共享。如此,通过引入边缘超级节点,实现IPv6与IPv4混合组网下的P2P资源分享。克服了现有技术中IPv6与IPv4混合组网下,容易造成IPv6与IPv4的地址翻译非一一映射关系或者动态映射导致的P2P资源分享失败的缺陷。It can be seen from the above that the embodiment of the present invention provides a first edge super node, which receives the first query request forwarded by the first super node, wherein the first query request includes the first resource ID requested by the first node; The first edge super node queries the local information of the first edge super node according to the first resource ID, wherein the local information of the first edge super node includes resource IDs that can be obtained by the first edge super node , and the node ID and IP address corresponding to each resource ID; if the first edge supernode determines that the local information of the first edge supernode does not contain the first resource ID, then the first query forwarding the request to a second edge super node, so that the second edge super node searches for the first resource in the network domain where the second edge super node is located, wherein the first edge super node and the The second edge super node is connected through the IPV4/IPV6 interworking gateway, the first edge super node is in the IPV4 network domain, and the second edge super node is in the IPV6 network domain; or, the first edge super node is in the IPV6 network domain , the second edge super node is in the IPV4 network domain; the first edge super node receives the first query response message sent by the second edge super node, wherein the first query response message contains the purpose Address, source address, and Payload, the destination address is the address of the first node, the source address is the address of the second node storing the first resource, and the source address passes through the IPV4/IPV6 After translation by the interworking gateway, it is the same as the network domain type of the first edge super node, and the Payload includes the second node ID, the file key of the first resource, and the actual IP of the first resource address: the first edge super node parses the first query response message, if it is determined that the type of the actual IP address in the Payload is the IP address of the network domain where the first edge super node is located different types, replace the actual IP address in the Payload with the source address in the first query response message; the first edge super node forwards the first query response message to the The first node, so that the first node establishes a P2P connection with the second node according to the first query response message, and performs sharing of the first resource. In this way, by introducing edge super nodes, P2P resource sharing under IPv6 and IPv4 hybrid networking is realized. It overcomes the defect that the IPv6 and IPv4 mixed networking in the prior art may easily cause the non-one-to-one mapping relationship between IPv6 and IPv4 address translation or the failure of P2P resource sharing caused by dynamic mapping.

一方面,本发明实施例提供一种系统,参见图1,该系统包括:第一边缘超级节点30,第二边缘超级节点60,所述第一边缘超级节点30和所述第二边缘超级节点60通过IPV4/IPV6互通网关90连接,On the one hand, an embodiment of the present invention provides a system, referring to FIG. 1 , the system includes: a first edge super node 30, a second edge super node 60, the first edge super node 30 and the second edge super node 60 is connected through the IPV4/IPV6 interworking gateway 90,

需要说明的,所述第一边缘超级节点30处于IPV4网络域,所述第二边缘超级节点60处于IPV6网络域;或者,所述第一边缘超级节点30处于IPV6网络域,所述第二边缘超级节点60处于IPV4网络域;本发明实施例对此不进行限定,图1仅是以一种情况进行的示例性说明。It should be noted that the first edge super node 30 is in the IPV4 network domain, and the second edge super node 60 is in the IPV6 network domain; or, the first edge super node 30 is in the IPV6 network domain, and the second edge super node 60 is in the IPV6 network domain. The super node 60 is in the IPV4 network domain; this is not limited in the embodiment of the present invention, and FIG. 1 is only an exemplary illustration of a situation.

其中,所述第一边缘超级节点30用于,Wherein, the first edge super node 30 is used for,

接收第一超级节点40转发的第一查询请求,其中,所述第一查询请求包含第一节点20请求查询的第一资源ID;receiving a first query request forwarded by the first super node 40, wherein the first query request includes a first resource ID that the first node 20 requests to query;

根据所述第一资源ID查询所述第一边缘超级节点的本地信息,其中,所述第一边缘超级节点30的本地信息包含所述第一边缘超级节点能够获取的资源ID,以及每个资源ID对应的节点ID和IP地址;Query the local information of the first edge supernode 30 according to the first resource ID, wherein the local information of the first edge supernode 30 includes the resource ID that the first edge supernode can obtain, and each resource The node ID and IP address corresponding to the ID;

若确定所述第一边缘超级节点30的本地信息中不包含所述第一资源ID,则将所述第一查询请求转发至第二边缘超级节点60,以使得所述第二边缘超级节点60在所述第二边缘超级节点60所在的网络域中查找所述第一资源;If it is determined that the local information of the first edge super node 30 does not contain the first resource ID, the first query request is forwarded to the second edge super node 60, so that the second edge super node 60 searching for the first resource in the network domain where the second edge super node 60 is located;

接收所述第二边缘超级节点60发送的第一查询响应报文,其中,所述第一查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第一节点的地址,所述源地址为存储所述第一资源的第二节点80的地址,且所述源地址经过所述IPV4/IPV6互通网关翻译后,与所述第一边缘超级节点30所处网络域类型相同,所述Payload中包含所述第二节点ID,所述第一资源的文件key,以及所述第一资源的实际IP地址;Receiving a first query response message sent by the second edge super node 60, wherein the first query response message includes a destination address, a source address, and a Payload, and the destination address is the address of the first node. address, the source address is the address of the second node 80 storing the first resource, and the source address is translated from the network domain where the first edge super node 30 is located after being translated by the IPV4/IPV6 interworking gateway The types are the same, and the Payload includes the second node ID, the file key of the first resource, and the actual IP address of the first resource;

对所述第一查询响应报文进行解析,若确定所述Payload中所述实际IP地址的类型与所述第一边缘超级节点30所处的网络域的IP地址类型不同,则将所述Payload中的所述实际IP地址替换成所述第一查询响应报文中的源地址;Analyzing the first query response message, if it is determined that the type of the actual IP address in the Payload is different from the IP address type of the network domain where the first edge super node 30 is located, then the Payload The actual IP address in is replaced with the source address in the first query response message;

将所述第一查询响应报文转发至所述第一节点20,以使得所述第一节点20根据所述第一查询响应报文与所述第二节点80建立P2P连接,并进行所述第一资源的共享。forwarding the first query response message to the first node 20, so that the first node 20 establishes a P2P connection with the second node 80 according to the first query response message, and performs the Sharing of the first resource.

进一步的,所述第一边缘超级节点30还用于:将所述第一资源ID与所述第一资源的实际IP地址存储至文件地址信息,其中,所述文件地址信息包含所述第一边缘超级节点每次查询所得的资源ID以及与所述资源ID对应的实际IP地址。Further, the first edge super node 30 is further configured to: store the first resource ID and the actual IP address of the first resource in file address information, wherein the file address information includes the first The resource ID and the actual IP address corresponding to the resource ID obtained by the edge super node each query.

进一步的,所述第一边缘超级节点30还用于:Further, the first edge super node 30 is also used for:

接收所述第一超级节点40转发的第二查询请求,其中,所述第二查询请求包含第三节点请求查询的第二资源ID,所述第三节点为所述第一边缘超级节点所在网络域中任意一个节点;Receive the second query request forwarded by the first super node 40, wherein the second query request includes a second resource ID requested by a third node, and the third node is the network where the first edge super node is located any node in the domain;

根据所述第二资源ID查询所述文件地址信息;Querying the file address information according to the second resource ID;

若确定所述文件地址信息中包含所述第二资源ID,则向所述IPV4/IPV6互通网关发送所述第二资源ID对应的实际IP地址,以使得所述IPV4/IPV6互通网关为所述第二资源ID的实际IP地址提供翻译地址;If it is determined that the file address information includes the second resource ID, send the actual IP address corresponding to the second resource ID to the IPV4/IPV6 interworking gateway, so that the IPV4/IPV6 interworking gateway is the The actual IP address of the second resource ID provides the translated address;

接收所述IPV4/IPV6互通网关发送的所述第二资源的实际IP地址的翻译地址;receiving the translation address of the actual IP address of the second resource sent by the IPV4/IPV6 interworking gateway;

将第二查询响应报文转发至所述第三节点,以使得所述第三节点根据所述第二查询响应报文与所述第二资源ID所在的节点建立P2P连接,并进行所述第二资源的共享,其中,所述第二查询响应报文中包含目的地址,源地址,以及Payload,所述目的地址为所述第三节点的地址,所述源地址为所述第二资源的实际IP地址的翻译地址,所述Payload中包含所述第二资源所在的节点ID,所述第二资源的文件key,以及所述第二资源的实际IP地址的翻译地址。Forwarding the second query response message to the third node, so that the third node establishes a P2P connection with the node where the second resource ID is located according to the second query response message, and performs the second query response message. Sharing of two resources, wherein, the second query response message includes a destination address, a source address, and a Payload, the destination address is the address of the third node, and the source address is the address of the second resource The translation address of the actual IP address, the Payload includes the node ID where the second resource is located, the file key of the second resource, and the translation address of the actual IP address of the second resource.

进一步的,所述系统还包括:边缘超级节点控制器,所述边缘超级节点控制器与所述系统中的边缘超级节点逻辑连接,用于对新的边缘超级节点进行注册及管理,提供所述边缘超级节点控制器所管理的边缘超级节点之间的寻址及通知的下发。Further, the system further includes: an edge super node controller, which is logically connected to the edge super nodes in the system, and is used to register and manage new edge super nodes, and provides the Addressing between edge super nodes managed by the edge super node controller and delivery of notifications.

由上可见,本发明实施例提供的系统,通过引入边缘超级节点,实现IPv6与IPv4混合组网下的P2P资源分享。克服了现有技术中IPv6与IPv4混合组网下,容易造成IPv6与IPv4的地址翻译非一一映射关系或者动态映射导致的P2P资源分享失败的缺陷。It can be seen from the above that the system provided by the embodiment of the present invention implements P2P resource sharing under the mixed networking of IPv6 and IPv4 by introducing edge super nodes. It overcomes the defect that the IPv6 and IPv4 mixed networking in the prior art may easily cause the non-one-to-one mapping relationship between IPv6 and IPv4 address translation or the failure of P2P resource sharing caused by dynamic mapping.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (10)

1. the method for a P2P resource-sharing, it is characterised in that the method includes:
First edge super node receive first super node forward the first inquiry request, wherein, Described first inquiry request comprises the first resource ID of primary nodal point requesting query;
Described first edge super node is inquired about described first edge according to described first resource ID and is surpassed The local information of level node, wherein, the local information of described first edge super node comprises institute State the resource ID that the first edge super node can obtain, and the node that each resource ID is corresponding ID and IP address;
If described first edge super node determines the local information of described first edge super node In do not comprise described first resource ID, then described first inquiry request is forwarded to the second edge and surpasses Level node, so that described second edge super node is at described second super node place, edge Network domains in search described first resource, wherein, described first edge super node and described Second edge super node is connected by IPV4/IPV6 Interworking gateway, and described first edge is super Node is in IPV4 network domains, and described second edge super node is in IPV6 network domains;Or Person, described first edge super node is in IPV6 network domains, described second edge super node It is in IPV4 network domains;
The first of the described second edge super node transmission of described first edge super node reception is looked into Ask response message, wherein, described first inquiry response message comprises destination address, source address, And Payload, described destination address is the address of described primary nodal point, and described source address is for depositing Store up the address of the secondary nodal point of described first resource, and described source address is through described IPV4/IPV6 Interworking gateway translation after, with described first edge super node residing for network domains type identical, institute State and Payload comprises described secondary nodal point ID, the file key, Yi Jisuo of described first resource State the real ip address of first resource;
Described first inquiry response message is resolved, if really by described first edge super node The type of real ip address described in fixed described Payload and described first edge super node institute The IP address class type of the network domains at place is different, then by the described practical IP ground in described Payload Location replaces to the source address in described first inquiry response message;
Described first inquiry response message is forwarded to described first by described first edge super node Node, so that described primary nodal point is according to described first inquiry response message and described second section Point is set up P2P and is connected, and carries out sharing of described first resource.
Method the most according to claim 1, it is characterised in that described method also includes:
Described first edge super node is by the reality of described first resource ID Yu described first resource IP address stores to file address information, and wherein, described file address information comprises described first Edge super node inquires about the resource ID of gained and the reality corresponding with described resource ID every time IP address.
Method the most according to claim 2, it is characterised in that described method also includes:
Described first edge super node receives the second inquiry of described first super node forwarding please Asking, wherein, described second inquiry request comprises the Secondary resource ID of the 3rd node requesting query, Described 3rd node is any one node in described first super node place, edge network domains;
Described first edge super node inquires about described file address letter according to described Secondary resource ID Breath, however, it is determined that comprise described Secondary resource ID in the information of described file address, then to described IPV4/IPV6 Interworking gateway sends described real ip address corresponding for Secondary resource ID, so that The real ip address that described IPV4/IPV6 Interworking gateway is described Secondary resource ID provides translation ground Location;
Described first edge super node receives the described of described IPV4/IPV6 Interworking gateway transmission The translating address of the real ip address of Secondary resource;
Second inquiry response message is forwarded to described Section three by described first edge super node Point, so that described 3rd node is according to described second inquiry response message and described Secondary resource The node at ID place is set up P2P and is connected, and carries out sharing of described Secondary resource, wherein, institute State and the second inquiry response message comprises destination address, source address, and Payload, described mesh Address be described 3rd address of node, described source address is the practical IP of described Secondary resource The translating address of address, comprises the node ID at described Secondary resource place in described Payload, The file key of described Secondary resource, and the translation ground of the real ip address of described Secondary resource Location.
4. an edge super node, it is characterised in that including:
First receiver module, for receiving the first inquiry request that the first super node forwards, its In, described first inquiry request comprises the first resource ID of primary nodal point requesting query;
Enquiry module, for inquiring about described first edge super node according to described first resource ID Local information, wherein, the local information of described first edge super node comprises described first The resource ID that edge super node can obtain, and node ID corresponding to each resource ID and IP address;
First sending module, if determining described first edge super node for described enquiry module Local information in do not comprise described first resource ID, then described first inquiry request is forwarded to Second edge super node, so that described second edge super node is super at described second edge Searching described first resource in the network domains at level node place, wherein, described first edge is super Node and described second edge super node are connected by IPV4/IPV6 Interworking gateway, and described One edge super node is in IPV4 network domains, and described second edge super node is in IPV6 Network domains;Or, described first edge super node is in IPV6 network domains, described second limit Edge super node is in IPV4 network domains;
Second receiver module, for receiving the first inquiry that described second edge super node sends Response message, wherein, comprises destination address in described first inquiry response message, source address, And Payload, described destination address is the address of described primary nodal point, and described source address is for depositing Store up the address of the secondary nodal point of described first resource, and described source address is through described IPV4/IPV6 Interworking gateway translation after, with described first edge super node residing for network domains type identical, institute State and Payload comprises described secondary nodal point ID, the file key, Yi Jisuo of described first resource State the real ip address of first resource;
Parsing module, for resolving described first inquiry response message, however, it is determined that described The type of real ip address described in Payload and the net residing for described first edge super node The IP address class type in network territory is different, then replaced by the described real ip address in described Payload Become the source address in described first inquiry response message;
Second sending module, for being forwarded to described first segment by described first inquiry response message Point, so that described primary nodal point is according to described first inquiry response message and described secondary nodal point Set up P2P to connect, and carry out sharing of described first resource.
First edge super node the most according to claim 4, it is characterised in that described First edge super node also includes: memory module, is used for described first resource ID with described The real ip address of first resource stores to file address information, and wherein, described file address is believed Breath comprise described first edge super node inquire about every time gained resource ID and with described resource The real ip address that ID is corresponding.
First edge super node the most according to claim 5, it is characterised in that
First receiver module is additionally operable to, and the second inquiry receiving described first super node forwarding please Asking, wherein, described second inquiry request comprises the Secondary resource ID of the 3rd node requesting query, Described 3rd node is any one node in described first super node place, edge network domains;
Described enquiry module is additionally operable to, and inquires about described file address letter according to described Secondary resource ID Breath;
Described first sending module is additionally operable to, if described enquiry module determines that described file address is believed Breath comprises described Secondary resource ID, then sends described the to described IPV4/IPV6 Interworking gateway The real ip address that two resource IDs are corresponding, so that described IPV4/IPV6 Interworking gateway is described The real ip address of Secondary resource ID provides translating address;
Described second receiver module is additionally operable to, and receives what described IPV4/IPV6 Interworking gateway sent The translating address of the real ip address of described Secondary resource;
Described second sending module is additionally operable to, and the second inquiry response message is forwarded to the described 3rd Node, so that described 3rd node is according to described second inquiry response message and described second money The node at ID place, source is set up P2P and is connected, and carries out sharing of described Secondary resource, wherein, Described second inquiry response message comprises destination address, source address, and Payload, described Destination address is described 3rd address of node, and described source address is the reality of described Secondary resource The translating address of IP address, comprises the node ID at described Secondary resource place in described Payload, The file key of described Secondary resource, and the translation ground of the real ip address of described Secondary resource Location.
7. the system of an IPv6 and IPv4 mixed networking, it is characterised in that including: first Edge super node, the second edge super node, described first edge super node and described Two edge super nodes are connected by IPV4/IPV6 Interworking gateway, the described first super joint in edge Point is in IPV4 network domains, and described second edge super node is in IPV6 network domains;Or, Described first edge super node is in IPV6 network domains, and described second edge super node is in IPV4 network domains;
Wherein, described first edge super node is used for,
Receiving the first inquiry request that the first super node forwards, wherein, described first inquiry please Seek the first resource ID comprising primary nodal point requesting query;
The local information of described first edge super node is inquired about according to described first resource ID, its In, the local information of described first edge super node comprises described first edge super node energy Enough resource IDs obtained, and node ID corresponding to each resource ID and IP address;
If it is determined that the local information of described first edge super node does not comprise described first resource ID, then be forwarded to the second edge super node by described first inquiry request, so that described Two edge super nodes search described in the network domains at described second super node place, edge One resource;
Receive the first inquiry response message that described second edge super node sends, wherein, institute State and the first inquiry response message comprises destination address, source address, and Payload, described mesh The address that address is described primary nodal point, described source address is store described first resource the Two addresss of node, and described source address is after described IPV4/IPV6 Interworking gateway is translated, With described first edge super node residing for network domains type identical, described Payload comprises institute State secondary nodal point ID, the file key of described first resource, and the reality of described first resource IP address;
Described first inquiry response message is resolved, however, it is determined that real described in described Payload The type of IP address, border and the IP address class type of the network domains residing for described first edge super node Difference, then replace to the described real ip address in described Payload described first inquiry and ring Answer the source address in message;
Described first inquiry response message is forwarded to described primary nodal point, so that described first Node is set up P2P according to described first inquiry response message with described secondary nodal point and is connected, and goes forward side by side Sharing of the described first resource of row.
The system of IPv6 and IPv4 mixed networking the most according to claim 7, its feature Being, described first edge super node is additionally operable to: by described first resource ID and described first The real ip address of resource stores to file address information, wherein, and described file address information bag Containing described first edge super node inquire about every time gained resource ID and with described resource ID Corresponding real ip address.
The system of IPv6 and IPv4 mixed networking the most according to claim 8, its feature Being, described first edge super node is additionally operable to:
Receiving the second inquiry request that described first super node forwards, wherein, described second looks into The request of inquiry comprises the Secondary resource ID of the 3rd node requesting query, and described 3rd node is described the Any one node in one super node place, edge network domains;
Described file address information is inquired about according to described Secondary resource ID;
If it is determined that described file address information comprises described Secondary resource ID, then to described IPV4/IPV6 Interworking gateway sends described real ip address corresponding for Secondary resource ID, so that The real ip address that described IPV4/IPV6 Interworking gateway is described Secondary resource ID provides translation ground Location;
Receive the real ip address of the described Secondary resource that described IPV4/IPV6 Interworking gateway sends Translating address;
Second inquiry response message is forwarded to described 3rd node, so that described 3rd node Node according to described second inquiry response message Yu described Secondary resource ID place sets up P2P even Connect, and carry out sharing of described Secondary resource, wherein, described second inquiry response message wraps Containing destination address, source address, and Payload, described destination address is described 3rd node Address, described source address is the translating address of the real ip address of described Secondary resource, described Payload comprises the node ID at described Secondary resource place, the file key of described Secondary resource, And the translating address of the real ip address of described Secondary resource.
10. according to the system of IPv6 and the IPv4 mixed networking described in any one of claim 7-9, It is characterized in that, described system also includes: edge super node controller, described edge is super Node Controller is connected with the edge super node logic in described system, for new edge Super node is registered and is managed, it is provided that the limit that described edge super node controller is managed Issuing of addressing between edge super node and notice.
CN201310664771.6A 2013-12-09 2013-12-09 Method, equipment and the system of a kind of P2P resource-sharing Active CN103618801B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310664771.6A CN103618801B (en) 2013-12-09 2013-12-09 Method, equipment and the system of a kind of P2P resource-sharing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310664771.6A CN103618801B (en) 2013-12-09 2013-12-09 Method, equipment and the system of a kind of P2P resource-sharing

Publications (2)

Publication Number Publication Date
CN103618801A CN103618801A (en) 2014-03-05
CN103618801B true CN103618801B (en) 2017-01-04

Family

ID=50169505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310664771.6A Active CN103618801B (en) 2013-12-09 2013-12-09 Method, equipment and the system of a kind of P2P resource-sharing

Country Status (1)

Country Link
CN (1) CN103618801B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103987098B (en) * 2014-04-28 2017-12-01 广州杰赛科技股份有限公司 IPV4 networks and the internetwork switching methods of IPV6 and system
CN105591982B (en) * 2015-07-24 2018-12-25 新华三技术有限公司 A kind of method and apparatus of message transmissions
CN106899640A (en) * 2015-12-21 2017-06-27 北京奇虎科技有限公司 The acquisition methods and communication system of data resource
CN106899639A (en) * 2015-12-21 2017-06-27 北京奇虎科技有限公司 The acquisition methods of data resource, index server and communication system
CN106231739B (en) * 2016-10-10 2018-06-29 北京北极风科技有限公司 The illumination control method and device of a kind of complex scene
CN111327651A (en) * 2018-12-14 2020-06-23 华为技术有限公司 Resource downloading method, device, edge node and storage medium
CN110768887A (en) * 2019-09-20 2020-02-07 杭州海兴电力科技股份有限公司 IPv 6-based power gateway system and power data uploading/issuing method
EP4075691B1 (en) * 2021-02-20 2024-05-01 Wangsu Science & Technology Co., Ltd. Resource requesting method and terminal
CN113886323A (en) * 2021-08-26 2022-01-04 北京鸿合爱学教育科技有限公司 Network sharing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848802A (en) * 2005-11-25 2006-10-18 清华大学 Method for realizing IPv6 high performance interconnection based on P2P on IPv4
CN101610285A (en) * 2009-06-15 2009-12-23 北京邮电大学 P2P communication method in the coexistence network of IPv4 and IPv6
CN102025777A (en) * 2010-11-24 2011-04-20 华中科技大学 Method for sharing peer-to-peer (P2P) resources under condition of internet protocol version 4/version 6 (IPv4/v6) hybrid networking
CN102065112A (en) * 2009-11-18 2011-05-18 中国移动通信集团公司 Peer-to-peer (P2P) network system and method and related device for establishing the same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1848802A (en) * 2005-11-25 2006-10-18 清华大学 Method for realizing IPv6 high performance interconnection based on P2P on IPv4
CN101610285A (en) * 2009-06-15 2009-12-23 北京邮电大学 P2P communication method in the coexistence network of IPv4 and IPv6
CN102065112A (en) * 2009-11-18 2011-05-18 中国移动通信集团公司 Peer-to-peer (P2P) network system and method and related device for establishing the same
CN102025777A (en) * 2010-11-24 2011-04-20 华中科技大学 Method for sharing peer-to-peer (P2P) resources under condition of internet protocol version 4/version 6 (IPv4/v6) hybrid networking

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"IPv4/IPv6混合组网下P2P文件共享系统的设计与实现";赵锐 等;《中国海洋大学学报(自然科学版)》;20081015;第38卷;第13-16页 *
"P2P技术在IPv4/IPv6混合网中应用的关键问题研究";吕晓鹏;《中国博士学位论文全文数据库 信息科技辑》;20111215;I139-5 *

Also Published As

Publication number Publication date
CN103618801A (en) 2014-03-05

Similar Documents

Publication Publication Date Title
CN103618801B (en) Method, equipment and the system of a kind of P2P resource-sharing
JP5551247B2 (en) Method and host node for multi-NAT64 environment
JP6047229B2 (en) Name-based neighbor discovery and multi-hop service discovery in information-centric networks
EP2721787B1 (en) Principal-identity-domain based naming scheme for information centric networks
US20170034055A1 (en) Handling Consumer Mobility in Information-Centric Networks
CN102035900B (en) NAT (network address translation) traversal method, system and relay server by relay mode
JP2014511089A (en) Private address and public address mapping
TWI584194B (en) Finding services in a service-oriented architecture (soa) network
JP2011039725A (en) Gateway system and control method
CN102986170A (en) Methods, systems, and computer readable media for providing dynamic origination-based routing key registration in a DIAMETER network
TW200924462A (en) System and method for connection of hosts behind NATs
CN102075420A (en) Location identifier and host identifier separation-based system and mobility management method thereof
CN105681249B (en) A network access method and network conversion device
US20130117308A1 (en) Apparatus, Method and System for Node Discovering
CN101335681A (en) Methods for obtaining traversal resources, peer-to-peer network nodes, and peer-to-peer networks
Jung et al. IDNet: beyond all‐IP network
WO2013004134A1 (en) A routing method, node and system for p2p network
US20140098819A1 (en) Convergence network based on identifier and communication method using the same
KR20120067948A (en) SPI-based Manager Routing in Content-Oriented Networks
WO2017071591A1 (en) Icn based distributed resource directory for iot resource discovery and routing
EP2719118B1 (en) Routing by resolution
US11196666B2 (en) Receiver directed anonymization of identifier flows in identity enabled networks
EP2591586A1 (en) Apparatus, method and system for node discovering
US9461965B2 (en) Redirecting of network traffic for application of stateful services
KR20220073422A (en) Method and Apparatus for Defining Path of a Packet in Information-Centric Networking for Data Producer Mobility

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant