Method for transmitting point-to-point network message, routing device and computer storage medium

By introducing P2P routing devices into the P2P network, establishing adjacency relationships and optimizing message paths, the problems of low message transmission efficiency and high network traffic in P2P networks are solved, achieving efficient message transmission.

CN115914074BActive Publication Date: 2026-01-23DIGITAL WORLD (SHENZHEN) TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111165924.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2026-01-23
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

Existing P2P networks suffer from low message transmission efficiency and high network traffic.

Method used

Introducing P2P routing devices into P2P networks allows them to learn the topology by establishing adjacency relationships with P2P nodes, and to process and forward packets using protocol endpoints, thereby building adjacency tables, mapping tables, and routing tables to optimize packet delivery paths.

Benefits of technology

It improves the transmission efficiency of P2P network messages, reduces network traffic, and is suitable for various P2P network scenarios without changing the original protocol.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914074B_ABST
    Figure CN115914074B_ABST
Patent Text Reader

Abstract

A kind of point-to-point network message transmission method, routing device and computer storage medium;Wherein, P2P routing device is provided in P2P network, and the transmission method includes: the P2P routing device is established adjacent relationship with corresponding P2P node according to the forwarding relationship and topological structure of P2P node learned, and / or waits for other P2P node and the adjacent relationship of P2P routing device establishment;When the P2P routing device receives P2P network message, the P2P network message is transmitted to corresponding P2P node.This application embodiment can accelerate P2P message transmission by P2P routing device without changing P2P network protocol, applicable but not limited to the scene that P2P network needs information propagation and synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of communication, and in particular to a method for delivering P2P network messages, a routing device and a computer storage medium. BACKGROUND

[0002] P2P (Peer to Peer) networks have developed into various types of P2P protocols over the years. Generally, the common feature of P2P networks is that there are P2P peers, i.e. P2P nodes, as the basic units participating in the P2P network. The nodes in the P2P network deliver messages through P2P protocol messages. From the perspective of propagation logic, the information delivered by the messages can be divided into messages intended for widespread dissemination to each node or multiple nodes, and messages intended for transmission to a specific node. For convenience, the former is referred to as a P2P broadcast message or a broadcast message, and the latter is referred to as a P2P unicast message or a unicast message. Current P2P networks are widely used and can be used in distributed file storage, CDN applications, P2P multicast, Internet of Things, blockchain, etc. SUMMARY

[0003] The present application provides a method for delivering P2P network messages, a routing device and a computer storage medium, which can improve the delivery efficiency of P2P network messages and reduce the network traffic of P2P nodes.

[0004] The present application provides a method for delivering P2P network messages, P2P routing devices are provided in a P2P network, and the method comprises the following steps:

[0005] The P2P routing device establishes an adjacency relationship with the corresponding P2P node according to the learned forwarding relationship and topology structure of the P2P node, and / or waits for other P2P nodes and the P2P routing device to establish an adjacency relationship;

[0006] When the P2P routing device receives a P2P network message, the P2P routing device delivers the P2P network message to the corresponding P2P node.

[0007] The present application also provides a routing device, comprising a memory and a processor.

[0008] The memory is used to save a program for delivering P2P network messages.

[0009] The processor is used to read and execute the program for delivering P2P network messages, so as to realize the method for delivering P2P network messages.

[0010] The present application also provides a computer storage medium storing computer executable instructions, which are used to realize the method for delivering P2P network messages when executed.

[0011] The application also provides a routing device for implementing the P2P network message transmission method, comprising: an upper layer processing module, a routing processing module, a device link information module, a forwarding module, and one or more protocol endpoints.

[0012] The protocol endpoints are used for processing P2P protocol messages on a data forwarding path; the P2P protocol processing software / module used by the protocol endpoints matches the P2P node to which the protocol endpoints are to be forwarded;

[0013] The protocol endpoints, the protocol endpoints and the device link information module, and the routing devices are interconnected through the forwarding module;

[0014] The device link information module is used for processing link information, forming and maintaining an adjacency table, and through the forwarding module, the protocol endpoints are connected to collect and provide adjacency information, and the routing processing module is connected to provide adjacency information;

[0015] The routing processing module is used for generating and synchronously updating routing information;

[0016] The upper layer processing module is used for configuration management of the routing device.

[0017] Compared with the related art, the embodiments of the application set a P2P routing device in a P2P network, the P2P routing device establishes an adjacency relationship with P2P nodes in the P2P network; when the P2P routing device receives a P2P network message, the P2P routing device transmits the P2P network message to a corresponding P2P node, which can accelerate P2P message transmission through the P2P routing device without changing the P2P network protocol, and is applicable to but not limited to a scenario in which the P2P network needs information transmission and synchronization.

[0018] Other features and advantages of the application will be described in the following description, and some will become apparent from the description, or will be learned through practice of the application. Other advantages of the application can be achieved and obtained through the solutions described in the specification, claims, and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0019] The accompanying drawings are used to provide an understanding of the technical solutions of the application, and constitute a part of the specification, and are used to explain the technical solutions of the application together with the embodiments of the application, and do not constitute a limitation on the technical solutions of the application.

[0020] Figure 1 is a schematic diagram of a single-domain deployment mode of the P2P routing device of the embodiments of the application;

[0021] Figure 2Figure 1 is a schematic diagram of a multi-domain deployment of P2P routing devices according to an embodiment of the present application;

[0022] Figure 3 Figure 2 is a schematic diagram of the internal logic of a P2P routing device according to an embodiment of the present application;

[0023] Figure 4 Figure 3 is a flowchart of a method of delivering P2P network packets according to an embodiment of the present application;

[0024] Figure 5 Figure 4 is a schematic diagram of an example of a single-domain deployment of a P2P routing device delivering P2P broadcast packets;

[0025] Figure 6 Figure 5 is a schematic diagram of an example of a multi-domain deployment of a P2P routing device delivering P2P broadcast packets;

[0026] Figure 7 Figure 6 is a schematic diagram of an example of a single-domain deployment of a P2P routing device delivering P2P unicast packets;

[0027] Figure 8 Figure 7 is a schematic diagram of an example of a multi-domain deployment of a P2P routing device delivering P2P unicast packets;

[0028] Figure 9 Figure 8 is a schematic diagram of protocol endpoint registration in an example;

[0029] Figure 10 Figure 9 is a schematic diagram of adjacency information query in an example;

[0030] Figure 11 Figure 10 is a schematic diagram of adjacency table query in an example;

[0031] Figure 12 Figure 11 is a schematic diagram of adjacency information change reporting in an example;

[0032] Figure 13 Figure 12 is a schematic diagram of an implementation example of a P2P routing device according to an embodiment of the present application;

[0033] Figure 14 Figure 13 is a schematic diagram of an example of P2P broadcast packet forwarding in a P2P routing device;

[0034] Figure 15 Figure 14 is a schematic diagram of an example of P2P unicast packet forwarding in a P2P routing device. DETAILED DESCRIPTION

[0035] The present application describes a plurality of embodiments, but the description is exemplary rather than limiting, and it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible within the scope of the embodiments described in the present application. Although a number of possible combinations of features have been set forth in the drawings and discussed above, many other combinations are possible. Unless specifically intended otherwise, any feature or element of any embodiment can be used in combination with any other feature or element of any other embodiment, or in replacement of any other feature or element in any other embodiment.

[0036] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application can also be combined with any conventional features or elements to form a unique application defined by the claims. Any feature or element of any embodiment can also be combined with features or elements from other application to form another unique application defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present application can be implemented alone or in any appropriate combination. Accordingly, the embodiments are not to be restricted, except as by the appended claims and their equivalents. Furthermore, various modifications and changes can be made within the scope of the claims.

[0037] Furthermore, in describing representative embodiments, the specification can have presented the method and / or process as a particular sequence of steps. However, to the extent that the method or process depends on more than one step, the method or process should not be limited to the particular sequence of steps described. Other sequences of steps can be possible, and are within the scope of the embodiments. Therefore, the particular order in which the steps are presented in the specification is not an limitation on the claims. Furthermore, the claims should not be limited to the steps of the method and / or process in the order in which they are written, as other sequences of steps can be possible and are within the scope of the embodiments.

[0038] In the embodiments of the present application, P2P routing devices are arranged in a P2P network, and suitable protocol processing end points are selected to detect, establish links, process contents, and forward messages for P2P protocols, which can be applied to various specific P2P networks, and the P2P routing devices can accelerate the overall message forwarding speed without damaging the original P2P protocol.

[0039] The P2P routing devices can be arranged in a plurality of ways according to the distribution characteristics of the accessed P2P nodes and the access capabilities of the processing devices, including single-domain arrangement and multi-domain arrangement. Figure 1 andFigure 2 As shown, in a single-domain deployment, the P2P routing device is a single-domain processing device, connected to the P2P node it serves (such as...). Figure 1 In the context of A, B, C, and D, the actual IP address, P2P address, and physical line interface of a P2P routing device can be multiple and distributed across different physical locations. For example, a single P2P routing device can be deployed across multiple data centers. Multi-domain deployment involves using a distributed network of multiple P2P routing devices to serve P2P nodes (such as...). Figure 2 In the diagram (A, B, C, D, E, F, G, H), P2P routing devices are multi-domain forwarding devices, and P2P routing devices can be interconnected using high-speed data channels. This further improves the scalability of the network. As the network expands, network performance and capacity can be increased or decreased by adding P2P routing devices without affecting the original network devices and nodes.

[0040] A P2P link is a direct connection between two P2P nodes that establish a P2P adjacency relationship. P2P links include open and encrypted P2P links. An encrypted P2P link is one where data is transmitted between adjacent P2P nodes using an encrypted channel; an unencrypted P2P link is called an open link. In real-world networks, before establishing an encrypted link, nodes often send unencrypted probe messages to the target node to negotiate the subsequent establishment of an adjacency relationship with an encrypted channel, and then transmit messages on this link. This is also classified as an encrypted P2P network type.

[0041] like Figure 3 As shown, the internal logic of a P2P routing device can be divided into a P2P link layer, a P2P routing layer, and an application processing layer. Figure 3 A, B, C, and D in the diagram are P2P nodes.

[0042] The P2P link layer is used to learn and discover P2P nodes directly adjacent to the P2P routing device in the sense of P2P protocol (not in the sense of IP connection), which are called adjacent points of the P2P routing device, simply adjacent points, and devices or modules in the P2P routing device used to connect adjacent points are called protocol endpoints. The protocol endpoints are used to process different P2P protocol features and encryption and decryption of encrypted links. Generally, the P2P protocol requires that when forwarding or sending a message, the underlying IP message carrying the P2P protocol message content needs to be adapted according to the communication information of the local P2P adjacent point, that is, the source IP address and port device in the IP message carrying the P2P message are the IP and port of the node, and the target IP address and port are set as the IP and port of the adjacent point. If an encrypted link P2P protocol is encountered, the received message needs to be decrypted according to the encryption and decryption link key of the received adjacent point, and the sent message needs to be encrypted according to the encryption and decryption link key of the sent adjacent point before being sent to it. The protocol endpoint needs to perform the forwarding or sending of the protocol message as required by the protocol, and hereinafter for the convenience of writing, the description of the protocol endpoint forwarding or sending a message refers to the processing of the forwarding or sending according to the requirements.

[0043] The link layer information in this paper includes the association relationship of the P2P port information of the protocol endpoint and the adjacent point, which is called the adjacent link relationship. The P2P port information will be described in detail below.

[0044] The P2P link layer establishes, maintains, and updates the adjacent relationship through the protocol endpoint and provides the information for internal query of the P2P routing device.

[0045] The P2P routing layer in this paper is used to learn and maintain the correspondence between the P2P address or address segment and the specific P2P routing device, and to provide the query of these information between the P2P routing device itself and the interconnected P2P routing devices.

[0046] When the P2P network uses the P2P routing device to provide services, the P2P routing device generates a set of protocol endpoints corresponding to the P2P network protocol, and each of these endpoints has its own P2P address, which is used to form an adjacent relationship with the P2P nodes in the P2P network and communicate with the P2P nodes in the P2P network.

[0047] The method for generating protocol endpoints by the P2P routing device can adopt a protocol detection or pre-configuration mode. In the protocol detection mode, the P2P routing device sets a certain range of P2P protocol set, and analyzes the P2P messages in the network, for example, by using the DPI (Deep Packet Inspection) technology to analyze the messages in the network, to obtain the detailed information of the P2P node protocol in the network, and then generates the protocol endpoints suitable for the P2P network protocol according to the information. In the pre-configuration mode, the corresponding protocol endpoints are generated according to the configuration of the P2P routing device.

[0048] In order to establish and maintain the adjacency relationship between the P2P nodes and the protocol endpoints in the P2P network, three methods can be used in combination: 1) the protocol endpoint is used as a seed node of the P2P network, or the protocol endpoint information is added to the initial connection node list of the seed node provided by the P2P network, as the initial adjacency point for the other P2P nodes to access the P2P network, so that the newly added P2P node actively attempts to establish the P2P link with the protocol endpoint according to the P2P protocol; 2) the protocol endpoint obtains the information of the P2P node which has not established the adjacency relationship by learning and detection, and then actively sends the adjacency establishment protocol message of the corresponding P2P network protocol to the target P2P node to establish the adjacency relationship, and periodically uses the keep-alive message of the corresponding P2P network protocol to maintain the adjacency relationship, and the P2P network protocol without the special keep-alive message can use the method of sending the query message of the communication address corresponding to the P2P address of the self to the other party to replace the keep-alive message; 3) when receiving the P2P node initiated P2P adjacency point list query, only the protocol endpoints with a specific address distribution of the P2P routing device are answered as the adjacency point list, and the distribution mode should be designed according to the addressing algorithm of the specific P2P network.

[0049] In the embodiments of the present application, the following three tables can be established and maintained in the P2P routing device:

[0050] The adjacency table records the communication information (including the information of the corresponding protocol endpoint, the information of the corresponding P2P node including the IP address and the port, and the P2P protocol information) corresponding to the P2P address of the adjacency point of different P2P routing devices.

[0051] The mapping table records the information of the target P2P address, the direct adjacency point capable of forwarding to the target P2P address, and the corresponding protocol endpoint.

[0052] The routing table records the P2P routing device and the P2P address capable of forwarding by the P2P routing device, which is the relationship table between the P2P routing device and the P2P protocol node capable of forwarding by the P2P routing device, and includes the P2P address of the direct adjacency point of the P2P routing device and the P2P address capable of forwarding through the direct adjacency point.

[0053] The routing table, the mapping table and the adjacency table will be described in detail below.

[0054] As shown in Figure 4 The method for transmitting P2P network messages according to the embodiments of the present application comprises the following steps:

[0055] In step 101, the P2P routing device establishes adjacency relationship with the corresponding P2P node according to the learned forwarding relationship and topology structure of the P2P node, and / or waits for other P2P nodes to establish adjacency relationship with the P2P routing device.

[0056] In the embodiments of the present application, the forwarding relationship can include the adjacency table, the mapping table and the routing table, and the forwarding relationship is recorded through the three tables.

[0057] In the embodiments of the present application, the establishment of the adjacency relationship with the P2P node can be regarded as a dynamic and continuous process. The P2P routing device does not establish adjacency relationship with any P2P node when it is just added to the P2P network, and then it can continuously establish adjacency relationship through active and / or passive mode. When the P2P routing device actively establishes adjacency relationship with a P2P node, it needs to detect or learn the P2P address and communication information (such as IP address) of the P2P node first, and then establish adjacency relationship with the P2P node. The P2P routing device can also set the P2P address and communication information of its protocol endpoint as the seed node, the initial connection point, the node in the initial adjacency table, or pass them to other P2P nodes through the protocol endpoint of the network which has been added, to promote other P2P nodes to actively establish adjacency relationship with the P2P routing device. If there is a limit on the number of directly connected adjacency points, the P2P routing device can suspend the establishment of new adjacency relationship after establishing a certain number of adjacency relationships, and then start to establish adjacency relationship when the number of adjacency points is insufficient. After establishing the adjacency relationship, the P2P routing device also needs to maintain the adjacency relationship to maintain a certain number of adjacency points.

[0058] In an exemplary embodiment, the P2P routing device is configured as a seed node or initial connection point of the P2P node. One or a group of protocol endpoints can be set as seed nodes in the P2P network, and a group of protocol endpoint information can be set in the initial adjacency table provided by the seed nodes; or a group of protocol endpoints can be added as preferred connection points at the seed nodes in the existing P2P network, which are generally added in the preferred position of the adjacency table of the seed nodes. In this way, the newly added P2P nodes will actively probe or attempt to connect these protocol endpoints according to the P2P protocol. Through the above behavior, the protocol endpoint can obtain the P2P node information of the P2P nodes that are probed or attempted to connect and establish an adjacency relationship. In addition, the protocol endpoint can also actively probe the P2P network nodes, for example, using network traffic analysis technology to probe IP addresses / P2P addresses of the same P2P protocol, and then initiating a probe packet to the address to establish an adjacency relationship; discovering P2P node information that has not established an adjacency relationship according to the topology information of the adjacency table / adjacency point in the message of the forwarded P2P query packet; obtaining a specific batch of P2P address information according to the P2P protocol rule to initiate a probe packet or query packet to a specific P2P address; for the P2P nodes that have obtained P2P node information but have not established an adjacency relationship with the P2P routing device, a P2P protocol adjacency establishment packet can be sent to the target P2P node to establish an adjacency relationship.

[0059] In an exemplary embodiment, the device initialization process includes the following procedures:

[0060] In a multi-domain deployment scenario, the P2P routing device establishes a forwarding relationship with other P2P routing devices in the P2P network;

[0061] A specific protocol endpoint is generated by network traffic probing or pre-configuration to process the protocol packet of the P2P network; when the P2P protocol corresponding to the protocol endpoint uses an encrypted link, the protocol endpoint can perform encryption and decryption processing of the adjacency link.

[0062] In an exemplary embodiment, the protocol endpoint in the P2P routing device is set as a seed node of the P2P network, or the information of the protocol endpoint is saved in the initial connection node list of the seed node provided by the P2P network; through this setting, other newly added P2P nodes will actively connect to the P2P routing device and attempt to establish an adjacency relationship;

[0063] If the P2P routing device has no opportunity to be set as a seed node or a node in the initial connection point list, the seed node, the initial connection point list, etc. of the P2P network are set according to the information given by the specific P2P network, and the P2P routing device is prepared to actively establish an adjacency relationship with other P2P nodes.

[0064] In an exemplary embodiment, the P2P routing device learns the forwarding relationship and topology of the P2P nodes in the P2P network by one or more of the following ways:

[0065] In the first way, the protocol endpoint learns the P2P addresses and communication information of the P2P nodes with which it has established adjacency relationship and those with which it has not established adjacency relationship by analyzing one or more of the following information carried in the P2P packets flowing through the protocol endpoint (including the P2P packets sent to the protocol endpoint or forwarded by the protocol endpoint): P2P source address information, destination address information, adjacency information (the packet can or can not have adjacency information), topology and forwarding relationship of the corresponding directly connected adjacency point. When learning the topology, the topology can be updated according to the topology that has been learned and the adjacency information in the newly learned packet.

[0066] In the second way, the protocol endpoint initiates a query packet for the P2P address of the P2P node with which it has not established adjacency relationship to actively probe the communication information of the target P2P node.

[0067] In the third way, the protocol endpoint sends an adjacency table acquisition packet of the P2P protocol to the i-th layer node that has been learned to obtain the P2P node information of the i+1-th layer to expand the topology information.

[0068] In an exemplary embodiment, the P2P routing device establishes adjacency relationship with the P2P nodes in the P2P network can include:

[0069] The protocol endpoint is set as a seed node or an initial connection point, and when a newly joined P2P node or a node that has joined the network reestablishes adjacency relationship, the protocol endpoint initiates an adjacency establishment protocol packet to establish adjacency relationship.

[0070] The protocol endpoint actively sends an adjacency establishment protocol packet of the corresponding P2P network protocol to the target P2P node that has not joined the P2P routing device among the P2P network node information that has been learned to establish adjacency relationship.

[0071] In an exemplary embodiment, the delivery method further includes:

[0072] The P2P routing device maintains a proper number of direct-connection neighboring points, such as maintaining the number within a preset range, if the number of neighboring points is too large (such as greater than the upper limit of the preset range), the keep-alive operation for part of the neighboring points is stopped; if the number of neighboring points is too small (such as less than the lower limit of the preset range), the P2P routing device actively establishes a neighboring relationship with a P2P node which has not established a neighboring relationship according to the learned forwarding relationship and topology structure of the P2P node, and / or increases the priority connection probability of the protocol endpoint in the P2P network by one or more of the following ways: actively publishing an adjacency table message containing only the protocol endpoint, the best reachable address in the reply message, the adjacency table information containing only the protocol endpoint, and waiting for other P2P nodes and the P2P routing device to establish a neighboring relationship.

[0073] The keep-alive operation is used to maintain the neighboring relationship, including:

[0074] Periodically using a special keep-alive message in the corresponding P2P protocol; if there is no special keep-alive message in the P2P protocol corresponding to the P2P routing device, a query message for a specific target P2P address is sent to the neighboring point that needs to be kept alive to maintain the neighboring relationship, and the target P2P address of the query message is set as the P2P address of the protocol endpoint itself.

[0075] In an exemplary embodiment, the delivery method further includes:

[0076] The protocol endpoint propagates the protocol endpoint communication information to other nodes in the network by actively publishing an adjacency table message containing only the protocol endpoint.

[0077] When the protocol endpoint receives a query message for a target P2P address, the protocol endpoint initiates a query for the target address, and if the target address information is not obtained, the protocol endpoint returns the information of the protocol endpoint closest to the query target address as the response to the query, and these protocol endpoints are added to the candidate connection points of the node of the original query message, which can be used to increase the number of directly connected P2P nodes.

[0078] When the protocol endpoint receives an adjacency point information acquisition message, the protocol endpoint can reply to the information of the protocol endpoint containing a set of suitable P2P address distribution as the adjacency point information, which is beneficial to the protocol endpoint set to remain in the priority connection list of the P2P node, and this operation can be used to increase the number of directly connected P2P nodes.

[0079] In this embodiment, the neighboring relationship can be increased by actively initiating an adjacency message to a node which has not established a neighboring relationship, and the probability of the neighboring point being used as a neighboring point by other P2P nodes can be increased by a special message reply.

[0080] In the embodiments of the present application, the P2P routing device learns the network topology structure, forwarding relationship and P2P address information in the protocol message by analyzing the protocol message, and the message is received through the protocol endpoint. The message can be divided into passively received message and actively created condition received message. The passively received message refers to analyzing the message flowing through the protocol endpoint, wherein the P2P message contains the source P2P address and the target P2P address, but due to the P2P forwarding, the message does not necessarily contain the corresponding communication information such as the IP address. In the case of receiving the P2P message sent by the original node, for example, receiving the message of the original node querying a specific P2P address, it can be learned that the source P2P address can be forwarded through which protocol endpoint, and the protocol endpoint receiving the message and the corresponding direct adjacent node when receiving the message can also be found. In the case of receiving the message of other nodes, the source P2P address (for example, corresponding to the target P2P address of the original message) in the message can be learned to be forwarded through which protocol endpoint, and the protocol endpoint receiving the message and the corresponding direct adjacent node when receiving the message can also be found. If the message also contains the adjacent relationship table or separate adjacent node information, the adjacent relationship of the associated nodes of these nodes can also be analyzed. The system sets the K-layer topology relationship diffused outward by the direct adjacent node, and the direct adjacent node and the K-layer network topology relationship diffused outward by it are learned. It should be noted that this learning process will also generate entries in the mapping table, which will be described in the mapping table section later. The actively created condition received message refers to the method of triggering the return of the message containing the adjacent table information by actively initiating the protocol process operation through the protocol endpoint, for example, sending the adjacent table application message, querying the communication information message, querying the message and the like to the node whose topology structure is not learned in the learned mapping table, and even guessing the P2P node address existing in the network and initiating the query message to the known P2P address to trigger the return of the adjacent table information. When receiving the recursive return message of the adjacent node or the node diffused outward by multiple layers, the topology information and the mapping table are learned according to the above description.

[0081] Another method of actively creating a condition to receive a message is described as follows:

[0082] When the P2P routing device receives the query message for obtaining the communication information corresponding to the target P2P address, the P2P routing device uses the target P2P address to search the adjacent table. If the entry containing the target P2P address can be found, the P2P routing device answers the query message according to the P2P protocol and returns the queried communication information. If the entry containing the target P2P address cannot be found, the protocol endpoint in the P2P routing device sends the recursive query message to the target P2P address, answers the query message after obtaining the query result, returns the queried communication information, and returns the protocol endpoint information closest to the target P2P address as the best reachable address if no result is queried.

[0083] Wherein, the protocol end point through which the recursive query message flows learns the network topology structure and the P2P node information which has not established adjacency relationship from the recursive query message. For these messages, the topology learning and the entry generation in the mapping table are still performed according to the foregoing method.

[0084] Wherein, the adjacency table is learned from the adjacency protocol operation, and the adjacency is established, whether passive or active connection with other nodes, which are directly participated by the protocol end point and are easy to learn.

[0085] Here, the learning and the adjacency establishment before learning are performed simultaneously, but the most important information before the adjacency establishment is not necessarily available here, which is the communication information of the target P2P address. The communication information is required for the adjacency establishment, so a step before the adjacency establishment is required, which is to query the communication information of the P2P node to be established.

[0086] In step 102, the P2P routing device delivers the P2P network message to the corresponding P2P node when receiving the P2P network message.

[0087] In the embodiment of the present application, when the P2P network message is a broadcast type P2P network message, step 102 can include:

[0088] When the P2P routing device is a single domain processing device, if the P2P routing device determines that the P2P network message has not been broadcast forwarded, the P2P routing device sends the P2P network message to other directly connected adjacency points in the domain except the directly connected adjacency point receiving the P2P network message (i.e. for this broadcast message, the P2P routing device receives the broadcast message through the directly connected adjacency point);

[0089] When the P2P routing device is a multi-domain forwarding device, if the P2P routing device determines that the P2P network message has not been broadcast forwarded, the P2P routing device sends the P2P network message to other directly connected adjacency points in the domain except the directly connected adjacency point receiving the P2P network message, and other P2P routing devices connected thereto, and the other P2P routing devices continue to forward the message to other P2P routing devices adjacent thereto and directly connected adjacency points in the domain.

[0090] Wherein, the P2P network message has not been broadcast forwarded can mean that the P2P network message has not been received within a set time period.

[0091] Wherein, for the broadcast type P2P network message with limited fan-out number, the fan-out number in the P2P network message is reserved to be forwarded to the directly connected adjacency point;

[0092] For broadcast messages with limited forwarding depth, P2P routing devices do not calculate the forwarding depth; that is, they do not decrement the forwarding depth by one when forwarding.

[0093] In this embodiment of the application, when the P2P network packet is a unicast P2P network packet, step 102 may include:

[0094] When the P2P routing device is a single-domain processing device, after receiving a message, the protocol endpoint of the P2P routing device first searches the adjacency table based on the target P2P address in the message. If an entry with the target P2P address is found, the following processing is performed based on the communication information of the protocol endpoint and the adjacent node recorded in the found entry: if the found protocol endpoint is the same as the current protocol endpoint, the P2P network message is transmitted to the corresponding P2P node based on the communication information of the found adjacent node. The communication information of the target node may include the target node's IP address information, port information, P2P address, P2P protocol, and other information. If the recorded endpoint is not the one for this protocol, the message is sent to the recorded endpoint (the received endpoint will be transmitted as described above). If no entry with the target P2P address is found, the P2P routing device's mapping table is searched based on the target P2P address. If an entry with the target P2P address is found, and the mapping table contains forwarding depth information and matches multiple entries with different forwarding depths (a destination address may have multiple entries with different forwarding depths, corresponding to different neighboring points and protocol endpoints), the entry with the lower forwarding depth is selected first. The protocol endpoint and neighboring point information are extracted. If the found endpoint is the one for this protocol, the message is sent to the corresponding neighboring point according to the communication information of the neighboring point recorded in the found entry. If it is not the endpoint for this protocol, the message is sent to the protocol endpoint recorded in the found entry for processing.

[0095] When the P2P routing device is deployed across multiple domains, the protocol endpoint receives a P2P network packet and processes it according to the target P2P address in the packet in the following order:

[0096] The system searches for entries marked as directly connected routes in the routing table of this P2P routing device. If found, it searches the adjacency table of this P2P routing device and sends the packet to the corresponding protocol endpoint for processing based on the found adjacency table entry, or directly sends the packet to the adjacent point (the protocol endpoint recorded in the found entry is this protocol endpoint).

[0097] If no directly connected route entry is found in the routing table, the entry marked as a forwarding route is searched. If found, the mapping table of this P2P routing device is searched, the protocol endpoint and neighbor information recorded in the found entry are extracted, and the message is sent to the corresponding protocol endpoint for processing. Alternatively, if the found protocol endpoint is the same as this protocol endpoint, the neighbor table is searched based on the target P2P address, and the message is sent to the neighbor recorded in the found entry.

[0098] If no entry marked as a forwarding route is found, the routing table of other P2P routing devices is searched, including entries marked as directly connected routes and forwarding routes. If found, the P2P packet is forwarded to the corresponding other P2P routing device.

[0099] In an optional embodiment, the search order can be that the local device directly searches the first two tables; if the result is not found, it then searches the routing tables of other routing devices, as detailed below:

[0100] First, process it in the same way as a single-domain processing device, that is, first search the adjacency table of this device, and if it is not found, then search the mapping table of this device.

[0101] If it is not found yet, then the routing table of other P2P routing devices is searched. If it is found, then the P2P packet is forwarded to the corresponding other P2P routing device.

[0102] The following section will categorize P2P network messages into broadcast P2P network messages and unicast P2P network messages, and explain the specific steps for each.

[0103] 1. P2P network messages are broadcast P2P network messages.

[0104] Broadcast-type P2P network messages can also be called broadcast messages or P2P broadcast messages.

[0105] The general rule for P2P broadcast message transmission is that if a P2P routing device receives a P2P broadcast message from its P2P neighbor or adjacent P2P routing device, and if the P2P broadcast message has not been received within a set time period, it forwards the P2P broadcast message to other neighboring points and other adjacent P2P routing devices. Selecting a reasonable time period can reduce the accumulation of historical data for message comparison, thereby reducing the demand on system resources. Generally, the length of the set time period can be selected as 8 times the TCP MSL (Maximum Segment Lifetime).

[0106] When the P2P routing device is a single-domain processing device (i.e., a P2P routing device deployed in a single domain), the scheme for transmitting P2P broadcast messages is as follows:

[0107] If a P2P routing device receives a P2P broadcast message from its P2P neighbor and has not received such a message within a set time period, then the P2P routing device will forward the P2P broadcast message to other neighbors within the same P2P network, excluding the P2P neighbor that received the message. If the P2P broadcast message has already been received, it will be discarded.

[0108] An example of a single-domain P2P routing device transmitting P2P broadcast messages is as follows: Figure 5 As shown, when a P2P node sends a broadcast P2P network message, it sends a P2P broadcast message to its neighboring nodes. One of the P2P broadcast messages reaches the P2P routing device. After receiving the P2P broadcast message, the P2P routing device forwards it internally to other neighboring nodes belonging to the same P2P network. Figure 5 In the P2P network, 1 indicates the direction in which P2P broadcast messages are sent to P2P routing devices (i.e., the direction from P2P node A to P2P routing devices), and 2 indicates the direction in which P2P routing devices send P2P broadcast messages to neighboring nodes (i.e., the direction in which P2P routing devices send P2P broadcast messages to P2P nodes B, C, and D).

[0109] When the P2P routing device is a multi-domain processing device (i.e., a P2P routing device deployed across multiple domains), the scheme for transmitting P2P broadcast messages is as follows:

[0110] 1) If the P2P routing device receives a P2P broadcast message from its P2P neighbor and the P2P broadcast message has not been received within a set time period, then the P2P routing device will send the P2P broadcast message to the neighboring neighbor and adjacent P2P routing devices other than the neighboring neighbor that received the broadcast message.

[0111] 2) If a P2P routing device receives a P2P broadcast message from a neighboring P2P routing device and has not received such a message within a set time period, it forwards it to its P2P neighboring points within the same domain and to other adjacent P2P routing devices excluding the one that sent the message. In cases 1) and 2) above, if the message has already been received within the set time period, it is discarded.

[0112] An example of a multi-domain deployed P2P routing device transmitting P2P broadcast messages is as follows: Figure 6 As shown, when the P2P routing device receives a P2P broadcast message from a P2P node, it forwards the P2P broadcast message to the cross-domain processing device. Figure 6In this diagram, the first P2P routing device forwards the received P2P broadcast message to the second P2P routing device. Other P2P routing devices, upon receiving a P2P network message, forward it to their adjacent P2P nodes and other P2P routing devices besides the one that received the message. In the diagram, A, B, C, D, E, F, G, and H all represent P2P nodes. Figure 6 In the diagram, 1 indicates the direction in which a P2P broadcast message is sent to a P2P routing device in a P2P network (i.e., the direction from P2P node A to the first P2P routing device), and 2 indicates the direction in which a P2P routing device sends a P2P broadcast message to its neighboring nodes (i.e., the direction from which the first P2P routing device sends a P2P broadcast message to P2P nodes B, C, and D, and the direction from which the second P2P routing device sends a P2P broadcast message to P2P nodes E, F, G, and H).

[0113] In the same P2P network, if a P2P broadcast message generated by a neighboring point of a non-P2P routing device is forwarded to a P2P routing device via the neighboring point, it shall be handled in the same way as described above.

[0114] For broadcast P2P network packets with limited fan-out counts (fan-out count refers to the maximum number of adjacent nodes to which a broadcast packet can be sent; typical examples of this type of limited broadcast type include P2P protocols like Gosspy, which often limit the fan-out count when broadcasting packets), this embodiment of the application processes P2P broadcast packets according to the above-described P2P broadcast packet processing when forwarding them using P2P routing devices. Protocol endpoints can be configured to send broadcast packets without fan-out count limitations, while retaining the fan-out count in the P2P broadcast packet for forwarding to directly connected adjacent nodes.

[0115] For broadcast P2P network packets with limited forwarding depth: Limiting forwarding depth refers to specifying the maximum forwarding depth in the packet, i.e., the maximum number of hops for forwarding. For example, if the forwarding depth is limited to 3, meaning a maximum of 3 hops, and the packet specifies 3 as the forwarding depth, when the packet is forwarded from node A to node B (hop 1), the forwarding depth decreases by 1. Node B then forwards it to node C (hop 2), the forwarding depth decreases by 1. Node C then forwards it to node D (hop 3), the forwarding depth decreases by 1, and at this point, the forwarding depth is 0. Node D will not forward it further after receiving it. P2P routing devices do not perform this decrementing process when handling such broadcast packets.

[0116] 2. P2P network packets are unicast P2P network packets.

[0117] In addition to broadcast P2P network messages, messages with a destination P2P address are called unicast P2P network messages, or P2P unicast messages.

[0118] When transmitting P2P unicast messages, adjacency tables, mapping tables, and routing tables are used. For single-domain transmission, adjacency tables and mapping tables are mainly used, while for multi-domain transmission, routing tables, mapping tables, and finally adjacency tables are used. The specific implementation details are as follows.

[0119] When the P2P routing device is a single-domain processing device, the scheme for transmitting P2P unicast messages is as follows:

[0120] After receiving a P2P unicast message, the protocol endpoint of the P2P routing device first searches its adjacency table based on the target P2P address in the message. It matches the peer P2P address and the target P2P address in the table to determine the communication information of the target node (including local and peer communication information; local communication information includes the P2P node address, IP address, port, and protocol of the protocol endpoint; peer communication information includes the P2P node address, IP address, port, and protocol). If found, the following processing is performed based on the protocol endpoint and adjacent nodes recorded in the found communication information: If the protocol endpoint recorded in the found communication information is the same as the current protocol endpoint, the P2P unicast message is transmitted to the corresponding P2P node based on the communication information of the target node. The communication information of the target node includes the target node's IP address, port, P2P address, and P2P protocol information. If the protocol endpoint recorded in the found communication information is not the endpoint of this protocol, the message is sent to the recorded protocol endpoint and processed as described above. If the communication information of the target node is not found in the adjacency table, the mapping table of this routing device is searched according to the target P2P address. If found, the protocol endpoint and adjacency point information are extracted. If the found protocol endpoint is the endpoint of this protocol, the message is sent to the adjacency point according to the found adjacency point information. If the found protocol endpoint is not the endpoint of this protocol, the message is sent to the found protocol endpoint for processing.

[0121] An example of a single-domain P2P routing device transmitting P2P unicast packets is as follows: Figure 7 As shown, the P2P routing device receives a P2P unicast message from P2P node A. Based on the IP address and port of the target P2P node recorded in the found communication information, and the P2P protocol information, the P2P routing device sends the message to the target node. Figure 7 The P2P node D in the middle. Figure 7 In the P2P network, 1 indicates the direction in which a P2P unicast message is sent to a P2P routing device (i.e., the direction from P2P node A to the P2P routing device), and 2 indicates the direction in which the P2P routing device sends a P2P unicast message to the target node (i.e., the direction from the P2P routing device to P2P node D).

[0122] When the P2P routing device is deployed across multiple domains, when a protocol endpoint receives a P2P unicast message, it searches according to the target P2P address in the message in the following order: 1) It searches the routing table of this routing device for P2P nodes marked as directly connected routes. If found (i.e., the target P2P address is a P2P node marked as a directly connected route), it searches the adjacency table of this routing device and sends the message to the corresponding protocol endpoint for processing based on the communication information found in the adjacency table. If the protocol endpoint recorded in the found communication information is this protocol endpoint, it directly sends the message to the corresponding adjacent point. If no P2P node marked as a directly connected route is found, then; 2) It searches the routing table of this routing device for P2P nodes marked as forwarding routes. If found, it searches the mapping table of this routing device, extracts the protocol endpoint and adjacent point information, and sends the message to the corresponding protocol endpoint for processing. If the found protocol endpoint is this protocol endpoint, it sends the message to the found adjacent point based on the detailed information in the adjacency table. If the packet is not found in the entry marked as a forwarding route, then 3) search the routing tables of other P2P routing devices, including P2P nodes marked as directly connected routes and forwarding routes. If found, forward the packet to other P2P routing devices that can find the target P2P address.

[0123] An example of a multi-domain deployed P2P routing device transmitting P2P unicast packets is as follows: Figure 8 As shown, the first P2P routing device receives a P2P unicast message from P2P node A. The first P2P routing device finds the target P2P address in the routing table of the second P2P routing device based on the target P2P address, and then sends the unicast message to the second P2P routing device. The second P2P routing device finds the target P2P address in its routing table based on the target P2P address, and then further looks up the specific IP address, port, protocol (TCP / IP), and specific P2P protocol information through the mapping table / adjacency table, and then sends the unicast message to the target P2P node. Figure 8 The P2P node H in the middle. Figure 8 In the P2P network, 1 indicates the direction in which a P2P unicast message is sent to a P2P routing device (i.e., the direction from P2P node A to the first P2P routing device), and 2 indicates the direction in which the P2P routing device sends a P2P unicast message to the target node (i.e., the direction from the second P2P routing device to P2P node H).

[0124] The following describes the three tables involved in P2P routing devices transmitting packets:

[0125] (1) Adjacency list

[0126] The adjacency relationship established between a P2P node adjacent to a P2P routing device and the P2P routing device itself is called a P2P link. After a P2P network packet is sent to a P2P routing device and forwarded by the P2P routing device, the first problem encountered is how to send the packet to the target node corresponding to the target P2P address. Therefore, a table relating protocol endpoints, target P2P addresses, and communication information (IP communication addresses) is needed. This table is called an adjacency table.

[0127] The adjacency information in the adjacency list includes the following:

[0128] P2Pprotocol is used to indicate information about the specific P2P protocol, such as: the identifier of the P2P protocol used, the protocol version, the protocol port, the protocol mirror URL, etc.

[0129] Peer transmission mode is used to indicate whether to transmit encrypted or unencrypted, and the specific encryption protocol used when transmitting encrypted.

[0130] The local P2P address is the P2P address of the local node, that is, the P2P address of the protocol endpoint.

[0131] Local IP + Port + Protocol, or local communication information, refers to the underlying network protocol address and port used by this party for P2P protocol communication.

[0132] The peer P2P address is the P2P address of the communicating peer node, that is, the P2P address of the directly connected neighboring node.

[0133] The peer IP+Port+Protocol, or peer communication information, refers to the underlying network protocol address and port used by the communicating party for P2P protocol communication.

[0134] Among them, P2P protocol, peer transmission method, P2P node address, and IP+Port+Protocol are called P2P port information. The port information containing the local P2P node address and local IP+Port+Protocol is called local P2P port information, and similarly, the port information containing the peer P2P node address and peer IP+Port+Protocol is called peer P2P port information.

[0135] The adjacency table information can be dynamically learned through the links between P2P nodes and the protocol endpoints that handle the P2P protocol within the P2P routing device. The adjacency information will change when a neighboring P2P node goes offline, a new adjacency relationship is established, or the IP or port is changed.

[0136] The P2P routing device, i.e., the protocol endpoints contained in the device, can obtain and update directly connected neighbor information, i.e., adjacency table information, through the adjacency protocol of the P2P network.

[0137] Typically, after a P2P adjacency relationship is established, it is updated and kept alive according to the keep-alive cycle of the specific P2P protocol. This process can be used as an update and aging process for the adjacency table of the corresponding protocol. If a P2P protocol does not have a keep-alive update, the adjacency information can be maintained by sending and receiving P2P messages. It is even possible to design the periodic sending of P2P protocol query information to serve as keep-alive information. This needs to be determined according to the specific P2P protocol. Usually, the keep-alive purpose can be achieved by periodically sending query messages to the adjacent nodes with the target P2P address being the P2P address of this node.

[0138] (2) Mapping table

[0139] For entries marked as forwarding routes in the routing table, a mapping table must be used in conjunction with them. The mapping table records information about three things: the target P2P address, the directly connected neighbor that can be forwarded to the target P2P address, and the protocol endpoint corresponding to the directly connected neighbor. In the mapping table, the corresponding protocol endpoint and directly connected neighbor can be found by looking up the target P2P address. P2P network packets to be sent to the target P2P address are sent to the directly connected neighbor in the record entry via the protocol endpoint in the record entry, and then forwarded by the directly connected neighbor.

[0140] The mapping table contains the following:

[0141] Target P2P address: The destination P2P address to which the message is to be forwarded.

[0142] Protocol endpoint: The P2P address of a protocol endpoint that can forward messages to the target P2P address.

[0143] Directly connected neighbor: A P2P address that is a directly connected neighbor of the target P2P address and can forward packets to it.

[0144] Optionally, the mapping table may also include one or more of the following:

[0145] Forwarding depth: indicates how many hops it takes to reach the P2P address.

[0146] Decay period value: Indicates how much time the entry has left to survive.

[0147] Generating a mapping table by learning during message forwarding can include one or more of the following:

[0148] 1) When a protocol endpoint receives a P2P network packet sent via a directly connected neighbor, if the source P2P address in the packet is not in the adjacency table, it can add the source P2P address to the mapping table of this P2P routing device. The depth is set to unknown, which represents how many forwards are needed to reach the directly connected neighbor. At the same time, the information of the corresponding protocol endpoint and the directly connected neighbor is recorded.

[0149] 2) When a protocol endpoint receives a message published or responded to by P2P node A containing adjacency table information or adjacency information (e.g., a response message triggered by a P2P address query or P2P adjacency table information query), if A is a directly connected adjacency of the P2P routing device, the adjacency information contained therein can be analyzed. The P2P address of one of A's adjacency points (excluding the protocol endpoint) is used as the target P2P address, A's P2P address as the directly connected adjacency, and the corresponding protocol endpoint P2P address as the protocol endpoint information. This information is added as an entry to the mapping table of this P2P routing device, with a depth of 1. If the entries for the P2P address, A's P2P address, and the protocol endpoint's P2P address are already in the local mapping table and the depth is unknown, the depth is modified to 1. If A may contain multiple adjacency points, multiple entries are recorded using the method described above.

[0150] 3) Adjacency lists or information published by P2P node B, the next hop neighbor of directly connected neighbor A, are added as an entry to the mapping table of this P2P routing device. This entry includes one of B's ​​neighboring nodes (excluding A and the protocol endpoint) as the target P2P address, A's P2P address as the directly connected neighbor, and the P2P address of its corresponding protocol endpoint as the protocol endpoint. The depth is set to 2. If the entry already exists in the mapping table of this P2P routing device and its depth is unknown, the depth is modified to 2. If B may contain multiple neighboring nodes, multiple entries are recorded using the same method. The system can set a topology learning depth K. Information about neighboring nodes exceeding depth K (including nodes with unknown depths) can be stored in the mapping table without updating the accumulated topology. By learning the topology and forwarding relationships based on the size of K, a relatively complete K-layer topology and node forwarding relationships can be learned.

[0151] Optionally, each entry in the mapping table can be configured with a certain decay period. It must be updated before the decay period value decreases to 0; otherwise, it will be removed. After learning a mapping table entry, if the P2P routing device has not yet learned the routing information contained in that entry before the decay period value decreases to half of its maximum value or to another value greater than 0, it can send a P2P protocol message, such as a query message, to the target P2P address to trigger the relearning of that routing entry. The decay period is designed to address the random joining and leaving of P2P protocol nodes in the network, facilitating real-time dynamic learning and updates.

[0152] In one exemplary embodiment, the transmission method further includes: retaining multiple entries with different forwarding depths for the mapping table, each with a different depth and attenuation period value;

[0153] According to the aforementioned method, when adding an entry containing the target P2P address to the mapping table, if the protocol endpoint and adjacency information of the entry for the target P2P address are found to be consistent in the mapping table, the depth is modified to the current depth; otherwise, a corresponding entry is added and the depth is set to the current depth.

[0154] Optionally, the mapping table can retain multiple paths at different depths. For example, when adding an entry containing a target P2P address to the mapping table, if the protocol endpoint and adjacency information of the entry for that target P2P address are found to be consistent, the depth is modified to the current depth; otherwise, a corresponding entry is added with the depth set to the current depth. Therefore, the target P2P address can be forwarded by these forwarding paths at different depths, and the depth often represents the forwarding cost.

[0155] An example of how to extract neighboring P2P address information from messages for mapping table learning is as follows: In the Ethereum P2P network, when a node joins the network and during subsequent maintenance of the neighbor information table, it sends findnode messages to a certain number of neighboring nodes to find a target address. The receiving node returns the information of the nearest neighbor to this address based on its own neighbor table. The originating node then recursively searches to get closer to the target node. Therefore, during this recursive process, a series of nodes send neighbor information. P2P routing devices can collect query messages sent by neighboring nodes and the resulting recursive query messages through protocol endpoints, or messages from nodes that continue querying the next level of connection based on the known topology and the resulting recursive query messages. By learning the neighbor information contained in these messages and combining it with the existing topology, a network node topology can be continuously constructed, allowing the extraction of the routing table.

[0156] (3) Routing table

[0157] A routing table is a table showing the relationship between P2P routing devices and the P2P protocol nodes they can forward to. It includes the directly connected neighbors of each P2P routing device (i.e., P2P nodes marked as directly connected routes) and the P2P nodes that can be forwarded through these directly connected neighbors (i.e., P2P nodes marked as forwarding routes). Each P2P routing device has its own routing table. In multi-domain deployment scenarios, when a local P2P routing device cannot forward a P2P address or determines the optimal forwarding path, it needs to query the routing tables of other routing devices to decide whether to forward the packet to that P2P routing device. Therefore, as a source routing device, it needs to synchronize its routing table with other P2P routing devices.

[0158] The routing table contains the following:

[0159] P2P routing device identifier: Used to uniquely identify different P2P routing devices.

[0160] Version: Monotonically increasing, used to uniquely identify the version information of the routing table and distinguish different versions of the routing table of the same routing device.

[0161] Routing table update cycle: This indicates how long before the next routing table update is expected. The update cycle information includes the time and duration of the routing table publication for that cycle. P2P routing devices publish new routing tables at the time of publication plus the duration. Other P2P routing devices that do not receive the new routing table can actively request it from the source P2P routing device or other adjacent P2P routing devices.

[0162] Target P2P address: A P2P address that can be forwarded.

[0163] Decay period: Optional, used to indicate the lifespan of the entry.

[0164] Directly connected route / forwarded route identifier: Used to indicate whether the entry is a directly connected route or a forwarded route attribute.

[0165] Optionally, to maximize the compression of routing table information, public information of P2P routing devices included in the routing table, such as detailed address information used for communication with other P2P routing devices, may not be transmitted in the routing table and may be negotiated through other communication channels of the P2P routing devices.

[0166] When generating a routing table, the P2P address of directly connected neighboring points is extracted from the adjacency table of the P2P routing device and used as the destination P2P address in the routing table entry, marked as a directly connected route. The decay period of the corresponding entry in the adjacency table is used as the decay period of this entry. The destination P2P address is extracted from the mapping table of the P2P routing device and used as the destination P2P address in the routing table entry, marked as a forwarding route. The decay period of the corresponding entry in the mapping table is used as the decay period of this entry. When multiple entries in the mapping table correspond to the same forwarding route entry (multiple paths reach the same destination address), the entry with the smaller forwarding depth is selected. If they are the same, the entry with the largest decay period is selected.

[0167] Optionally, the transmission method in this application embodiment further includes: compressing routing information using the Bloom filter method.

[0168] Bloom Filter: For P2P addresses with large storage space and low footprint, Bloom filters offer advantages such as low data generation and fast query speeds. Therefore, they can be used for routing information transmission. A Bloom filter is a bitmap data structure that uses hash mapping to store a data set. It uses k hash functions to map n data (set elements) to an m-bit bitmap. Common Bloom filter algorithms include insertion algorithms (inserting an element from the dataset into the filter) and query algorithms (checking if an element is in the filter). Bloom filters are characterized by low storage overhead (m / n) and fast query speed (k storage accesses). This application does not limit the scope of the Bloom filter itself. This application utilizes the unique forwarding information (including adjacency lists, mapping tables, and routing tables) of this application, combined with its characteristics, to compress data size. Especially in multi-domain deployment scenarios, P2P routing devices synchronize their latest generated routing tables with other routing devices; therefore, compressing this interactive information is valuable.

[0169] Information from adjacency lists, mapping tables, and routing tables can all be compressed. Specific instructions are as follows.

[0170] The compression method for adjacency tables is as follows: A P2P routing device records information about all its protocol endpoints. Each protocol endpoint can correspond to a Bloom filter, which records the P2P addresses of all P2P nodes directly connected to that protocol endpoint. The element insertion method of the Bloom filter is to add the P2P addresses of the adjacent nodes connected to that protocol endpoint as set elements to the table according to the insertion method of the selected Bloom filter. If an address is no longer adjacent, the element is deleted from the filter (Bloom filters that cannot support deletion operations can be replaced by regenerating the filter table). In this way, the Bloom filter can be used to determine whether the queried P2P address belongs to the set, that is, whether it is directly connected to the protocol endpoint corresponding to the Bloom filter.

[0171] The compression method for the mapping table is as follows: A matching pair (protocol endpoint and direct neighbor) corresponds to a Bloom filter, which records the P2P protocol addresses that can be forwarded through that protocol endpoint and direct neighbor. The element insertion method for the Bloom filter is to add the corresponding P2P address as a set element to the table according to the insertion method of the selected Bloom filter. If an address is no longer forwarded via that protocol endpoint and direct neighbor, the element needs to be deleted from the filter (Bloom filters that cannot support deletion can be replaced by regenerating the filter table). If the mapping table entry has optional forwarding depth and attenuation period, the Bloom filter description information is expanded, that is, the matching pair (protocol endpoint, direct neighbor, forwarding depth, and attenuation period value) is expanded to correspond to one Bloom filter.

[0172] For each P2P routing device's routing table or its sub-tables: A P2P routing device can generate one Bloom filter or divide into multiple sub-tables according to sub-routes, each corresponding to one or more Bloom filters. Each Bloom filter records the P2P address information that can be forwarded by the corresponding routing table or sub-table. Each sub-table can select different conditions based on the information in the routing table (P2P routing device identifier, version, update cycle, decay cycle, directly connected routes / forwarded routes), and store the P2P addresses that meet the conditions as the information of the corresponding sub-table in that sub-table.

[0173] This section uses a routing table as an example to illustrate how to use Bloom filters to compress routing table data. Specifically, based on the number of P2P nodes in the network and the average number of routing entries / sub-routes (n), a bitmap of appropriate length m is selected. For example, an array can be used to represent the bitmap. This bitmap is used to determine whether a P2P address is included; therefore, it is also called a filter. K suitable hash functions are selected to map the P2P addresses to the bitmap. These Bloom filter parameters are communicated between P2P routing devices or can be appended to the routing table information and transmitted together. When generating a sub-routing table, all P2P addresses contained in this sub-table are inserted into the corresponding filters using the Bloom filter insertion method. Initially, the filters do not contain any elements. This filter represents the address set of the corresponding sub-routing table. Adding the sub-table's description (P2P routing device identifier, version, update cycle, decay cycle, directly connected routes / forwarded routes), etc., forms the sub-routing table. When querying the routing table, the target P2P node address is used to query the corresponding sub-table's filter using the Bloom filter method. If a match is found, it means that the address is included in this routing sub-table.

[0174] In this embodiment of the application, the method of synchronizing the routing table is illustrated by taking the use of Bloom filter to compress routing information as an example. The Bloom filter method is used to compress the information size of the routing table for easy transmission. This does not affect the logic of synchronizing the routing table using any other way of organizing routing information. Therefore, other methods can also adopt similar processing.

[0175] In this embodiment of the application, the process of synchronizing routing information may include steps 201-203:

[0176] 201. When the P2P addresses that a P2P routing device can forward change, i.e., when the routing table changes, for example, when a new direct neighbor is added or an existing direct neighbor leaves; when a new forwarding route entry is learned or an existing forwarding route entry becomes invalid, etc., the P2P routing device whose routing information changes is called the source routing device. The source routing device can send its source routing device ID and the corresponding routing table version information to other connected routing devices in real time or periodically, and even further, carry information about the added / removed P2P neighbor addresses.

[0177] 202. After receiving the routing update information, the P2P routing device forwards the information to other P2P routing devices connected to it, and determines whether the routing table version is the same as the routing table version of the source routing device stored locally. If they are different, it requests the specified version or the latest version of the routing details from the source routing device to update the corresponding routing information.

[0178] 203. After receiving the request information, the source routing device compares the differences between the two versions based on the requested version information, and decides whether to send a complete new routing table or only the routing information based on the differences between the versions based on the comparison results.

[0179] When the routing information between versions differs too much, new complete routing information is sent; when the routing information between versions is not significantly different, routing information containing only the difference can be sent. In this way, the P2P routing device that receives the difference information can rebuild the routing table information based on this information.

[0180] When the P2P routing device acts as the source routing device, routing information synchronization may include the following steps 301-303:

[0181] 301. The P2P routing device periodically sends routing table version information to neighboring P2P routing devices;

[0182] 302. The P2P routing device receives a request from the neighboring P2P routing device to synchronize routing information, the request carrying the routing table version information of the neighboring P2P routing device;

[0183] 303. The P2P routing device sends complete routing information of the corresponding version of the routing table to the adjacent P2P routing device according to the version difference, or sends only the difference address set information, or sends the Bloom filter information of the routing table.

[0184] When the P2P routing device acts as a routing device receiving routing information, the routing information synchronization may include the following steps 401-403:

[0185] 401. The P2P routing device receives routing table version information sent by neighboring P2P routing devices;

[0186] 402. The P2P routing device forwards the message to other adjacent P2P routing devices. If it is determined that the received routing table version information is inconsistent with the routing table version information stored locally, it sends a request to the source routing device to synchronize routing information. The request carries the local routing table version information.

[0187] 403. The P2P routing device updates the routing table corresponding to the source routing device stored locally based on the routing information (such as Bloom filter information or differential address set information) received from the neighboring P2P routing devices.

[0188] In this application embodiment, a specific implementation example of the P2P routing device is as follows: Figure 13 As shown, it may include an upper-layer processing module, a routing processing module, a device link information module, a forwarding module, and protocol endpoints.

[0189] A P2P routing device can include multiple protocol endpoints for handling P2P protocol packets on the data forwarding path. These endpoints can install various P2P protocol processing software / modules. For example, Docker (container) technology can be used to dynamically load and remove the corresponding P2P software image, or other technologies can be used to install the corresponding P2P protocol processing software / modules. The specific P2P protocol processing software / module of the endpoint must match the P2P node to which the endpoint is to forward the data; for example... Figure 13 In this process, the four protocol endpoints must be matched with the P2P protocols of P2P nodes A, B, C, and D, respectively.

[0190] Protocol endpoints can interconnect with each other, between protocol endpoints and device link information modules, and between P2P routing devices through forwarding modules;

[0191] The device link information module is responsible for processing the link information described above;

[0192] The routing processing module is responsible for generating and synchronously updating the routing information described above;

[0193] The upper-layer processing module can be used to configure and manage P2P routing devices.

[0194] The forwarding module serves as the data channel within and between P2P routing devices, providing high-speed bandwidth. For P2P broadcast messages, multicast forwarding can be used between protocol endpoints, between protocol endpoints and device link information modules, and between P2P routing devices; each P2P protocol can use one multicast address.

[0195] Further optimization is possible by deploying private network connections for the forwarding module to facilitate routing and switching system design and reduce the complexity of WAN multicast forwarding. The IP address of the forwarding module can be set to a private network address. In addition to the IP address of the P2P protocol, the connected modules and entities are also assigned private network IP addresses according to the needs of the forwarding module. In this way, when using the forwarding module for communication, they can interact using internal private network IP addresses.

[0196] In one example, the adjacency information (information contained in the adjacency list) synchronization protocol can be as follows:

[0197] The module or entity within a P2P routing device that processes P2P link information is called the device link information module. It establishes communication channels with each protocol endpoint of the routing device; this document does not restrict the form or establishment process of these channels. The main function of the device link information module is to form and maintain an adjacency table, connecting downwards to protocol endpoints through the forwarding module to collect and provide adjacency information, and connecting upwards to the routing processing module to provide adjacency information. The following are several synchronization processes between the protocol endpoints and the device link information module regarding adjacency information:

[0198] (1) Protocol endpoint registration: such as Figure 9 As shown, the protocol endpoint registers with the device link information module, determining the operation channel used for adjacency table updates. This registration may include key information such as detailed P2P protocol information of the protocol endpoint, the duration of the operation channel's validity, the update cycle, and notification conditions. The device link information module returns a registration confirmation message to the protocol endpoint. After registration, if the device link information module and the protocol endpoint encounter adjacency table changes that meet the registration notification conditions, they will notify the corresponding protocol endpoint as an adjacency table update event.

[0199] (2) The device link information module actively requests the latest adjacency information from the protocol endpoint; or the protocol endpoint queries the link information processing module for the corresponding communication information in the current adjacency table; such as Figure 10 As shown, the protocol endpoint sends an adjacency information query message to the device link information module, and the device link information module returns a query response; or as... Figure 11 As shown, the protocol endpoint sends an adjacency list query message to the device link information module, and the device link information module returns an adjacency list query response.

[0200] (3) Adjacency Information Change Reporting: When adjacency information changes, the protocol endpoint reports the latest adjacency information to the device link information module. This includes situations such as the addition or disconnection of adjacencies between the protocol endpoint and a P2P node, or changes in the IP address or port of a P2P node. Figure 12 As shown, the protocol endpoint sends an adjacency information reporting message to the device link information module, and the device link information module returns a reporting confirmation.

[0201] Example of P2P broadcast message processing:

[0202] Protocol endpoint processing: When a P2P broadcast message is received from an adjacent P2P node, it is determined whether the P2P broadcast message has been received within a set time period. If not, the P2P broadcast message is forwarded to other P2P nodes adjacent to the protocol endpoint, excluding the adjacent P2P node that received the message. Furthermore, this message is packaged (or multicast encapsulated) into an IP multicast message, with the multicast target being the multicast address specified by the forwarding module of the corresponding P2P network. Different P2P networks use different multicast addresses. When the protocol endpoint receives a P2P broadcast message encapsulated in multicast format from the forwarding module, it is determined whether the P2P broadcast message has been received within a set time period. If not, the P2P broadcast message is forwarded to adjacent P2P nodes according to the adjacent forwarding requirements of the P2P protocol.

[0203] The forwarding module processes the following: Upon receiving the aforementioned IP multicast message (i.e., a P2P broadcast message encapsulated in multicast), it forwards the message to all members of the multicast group based on the multicast address. If a multi-domain P2P routing device network exists, it also forwards the message to modules and protocol endpoints of other P2P routing devices belonging to the multicast group. The forwarding module is not limited to using a single piece of hardware; it can be a forwarding system composed of multiple devices or even WAN devices.

[0204] An example of P2P broadcast message forwarding under a P2P routing device is as follows: Figure 14 As shown, the process includes the following:

[0205] The first P2P node sends a P2P broadcast message Pb to the first protocol endpoint;

[0206] The first protocol endpoint sends a P2P broadcast message Pb to its directly connected neighboring nodes, which may be multiple. The second P2P node is represented in the diagram. The message is packaged into an internal multicast message S(Pb) and sent to the forwarding module.

[0207] The forwarding module sends an internal multicast message S(Pb) to the second and third protocol endpoints;

[0208] After receiving the multicast message, the second protocol endpoint recovers the P2P message Pb and sends the P2P broadcast message Pb to its directly connected neighbor. There may be multiple P2P nodes. In the diagram, the third P2P node is represented. The third protocol endpoint processes the process similarly to the second protocol endpoint, sending the P2P broadcast message Pb to its directly connected neighbor. There may be multiple P2P nodes. In the diagram, the fourth P2P node is represented.

[0209] As for the situation where it is forwarded to other P2P routing devices, as can be seen from the previous description, it will not be repeated here.

[0210] An example of unicast packet forwarding in a P2P routing device is as follows: Figure 15 As shown, the process includes the following:

[0211] The first P2P node sends a P2P unicast message Pu to the first protocol endpoint;

[0212] The first protocol endpoint sends an internal unicast message S(Pu) to the forwarding module;

[0213] The forwarding module sends an internal unicast message S(Pu) to the second protocol endpoint;

[0214] The second protocol endpoint sends a P2P unicast message Pu to the third P2P node.

[0215] The protocol endpoint processing is as follows: When a P2P unicast message is received from a P2P node, it is determined whether the target P2P address is an adjacent node of this protocol endpoint. If so, it is forwarded to the P2P node corresponding to the target P2P address according to the P2P protocol requirements. If not, then: 1) the routing table of the P2P routing device where this protocol endpoint is located is queried based on the target P2P address, prioritizing entries marked as directly connected routes. If found, the adjacency table of the P2P routing device where this protocol endpoint is located is queried to find the protocol endpoint corresponding to the target P2P address, and the message is forwarded to that protocol endpoint through the forwarding module. 2) If no entry marked as a directly connected route is found, the entry marked as a forwarding route in the routing table is queried. If a match is found, the mapping table of the P2P routing device where the target P2P endpoint resides is queried based on the target P2P address to find the protocol endpoint and its directly connected neighbor. Then, through the neighbor table of the P2P routing device where the target P2P endpoint resides, the protocol endpoint corresponding to the target P2P address is found. If it is not the target P2P endpoint, the packet is sent to the found protocol endpoint through the forwarding module; if it is the target P2P endpoint, the packet is sent to the corresponding directly connected neighbor according to the mapping table. 3) If no entry is found in the routing table, the routing tables of other P2P routing devices are queried. If a match is found, the packet is sent to the corresponding P2P routing device through the forwarding module. The P2P routing device receiving the packet processes it accordingly according to the above protocol endpoint processing procedure.

[0216] Forwarding module processing: The forwarding module forwards packets based on the destination P2P address of the internal unicast message. The format of the internal address used between the protocol endpoint and the forwarding module is not limited; it can be an IP address, hardware device address, etc.

[0217] The protocol endpoint must be compatible with a specific P2P network protocol, therefore its support is broad. This can be achieved through various techniques for dynamically loading processing modules. For example, but not limited to, Docker technology can be used to load different P2P protocol processing images.

[0218] In one exemplary embodiment, the P2P routing device can process P2P network packets by launching a Docker (container) to install a P2P protocol processing image. Specifically, this may include:

[0219] The P2P routing device starts a container based on configuration management information and installs the P2P protocol through the container; or...

[0220] The P2P routing device starts a container by analyzing the protocol characteristics of P2P nodes in the P2P network, and installs the P2P protocol in the container to generate a P2P protocol processing node to process the P2P network packets, i.e., the protocol endpoint.

[0221] In summary, regardless of whether it is a structured or unstructured P2P network, the P2P routing device of this application embodiment can be used to accelerate P2P message propagation without changing the original P2P protocol. It is also beneficial to reduce the overall network traffic and maximize the utilization of the high bandwidth of the P2P device, etc., and is suitable for, but not limited to, scenarios in which P2P networks need information synchronization.

[0222] At least one embodiment of this application has the following beneficial effects: 1) It accelerates the speed of P2P message propagation. When the number of directly connected P2P nodes is sufficient, the P2P network information synchronization speed approaches a constant value. 2) It reduces network traffic between P2P nodes, especially broadcast message traffic. 3) The usual listen-forward mode cannot solve the message forwarding problem in encrypted connection and transmission P2P networks, but the embodiments of this application can solve this problem. 4) For most P2P network protocols, the P2P routing device of the embodiments of this application can be applied with only initial configuration of P2P nodes, and the benefits brought by the embodiments of this application can be obtained with almost no cost to modify the original P2P network. 5) The embodiments of this application can achieve good results in scenarios where high P2P network information synchronization is required, such as in blockchain when candidate block information, leader election information, voting information, etc. need to be synchronized.

[0223] This application embodiment also provides a routing device for a P2P network, which can implement the transmission method of any of the above embodiments, including: a memory and a processor; the memory is used to store a program for transmitting P2P network packets, and the processor is used to read and execute the program for transmitting P2P network packets to implement the P2P network packet transmission method in the above embodiments.

[0224] This application also provides a computer storage medium storing computer-executable instructions, which, when executed, implement the P2P network message transmission method described in the above embodiments.

[0225] In this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0226] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

Claims

1. A method for transmitting messages in a peer-to-peer (P2P) network, characterized in that, The P2P network includes P2P routing devices, which provide services. Each P2P routing device contains multiple protocol endpoints, each with its own P2P address. The method includes: The P2P routing device establishes adjacency relationships with corresponding P2P nodes in the P2P network based on the forwarding relationships and topology of the learned P2P nodes, and / or waits for other P2P nodes in the P2P network to establish adjacency relationships with this P2P routing device. The forwarding relationship includes a mapping table that records the target P2P address, its directly connected neighbor (DNL) that can be forwarded to the DNL, ​​and the corresponding protocol endpoint of the DNL. In the mapping table, the corresponding protocol endpoint and DNL can be found through the target P2P address. P2P network packets destined for the target P2P address are sent to the recorded DNL via the recorded protocol endpoint and then forwarded downwards by the DNL. The P2P routing device generates the mapping table by learning during packet forwarding. The protocol endpoint is a device or module within the P2P routing device used to connect neighboring nodes, and the neighboring node is a P2P node directly adjacent to the P2P routing device in the P2P protocol sense. When the P2P routing device receives a P2P network packet, it forwards the P2P network packet to the corresponding P2P node.

2. The transmission method according to claim 1, characterized in that, Also includes: Perform initialization; The initialization includes: In a multi-domain deployment scenario, the P2P routing device establishes a forwarding proxy relationship with other P2P routing devices in the P2P network; Protocol endpoints are generated through network traffic probing or pre-configuration to process protocol messages of the P2P network; wherein, when the P2P protocol corresponding to the protocol endpoint adopts an encrypted link, the protocol endpoint can perform encryption and decryption processing of adjacent lines.

3. The transmission method according to claim 1, characterized in that, The P2P routing device learns the forwarding relationships and topology of P2P nodes in the P2P network through one or more of the following methods: Method 1: After the protocol endpoint in the P2P routing device joins the P2P network, it analyzes one or more of the following information carried in the P2P packets flowing through the protocol endpoint: P2P source address information, destination address information, and adjacency information. It then learns the topology and forwarding relationships of corresponding directly connected adjacent points to obtain the P2P addresses and communication information of P2P nodes with and without established adjacency relationships. The P2P packets flowing through the protocol endpoint include P2P packets sent to the protocol endpoint or P2P packets forwarded through the protocol endpoint. Method 2: The protocol endpoint actively probes the communication information of the target P2P node by initiating query messages to P2P addresses that have not established adjacency relationships; Method 3: The protocol endpoint sends a P2P protocol adjacency list retrieval message or a message that can trigger the node to send adjacency information to the already obtained layer i node, in order to obtain the P2P node information of layer i+1 to expand the topology information.

4. The transmission method according to claim 1, characterized in that, Also includes: The P2P routing device maintains the number of directly connected neighbor points within a preset range. If the number of directly connected neighbor points exceeds the upper limit of the preset range, the keep-alive operation for some of the directly connected neighbor points is stopped. If the number of directly connected neighboring nodes is less than the lower limit of the preset range, the P2P routing device will actively establish neighboring relationships with P2P nodes that have not yet established neighboring relationships based on the forwarding relationships and topology of the learned P2P nodes, and / or increase the probability of priority connection of the protocol endpoint in the P2P network through one or more of the following methods: actively publishing adjacency table messages containing only the protocol endpoint, the best reachable address in the response message, adjacency table information containing only the protocol endpoint, and waiting for other P2P nodes to establish neighboring relationships with this P2P routing device; The keep-alive operation is used to maintain adjacency relationships, including: Periodically use dedicated keep-alive messages in the corresponding P2P protocol; if the P2P routing device does not have dedicated keep-alive messages in its corresponding P2P protocol, then maintain the adjacency relationship by sending query messages targeting the target P2P address to the adjacent points that need to be kept alive. The target P2P address of the query message is set to the P2P address of the protocol endpoint that sent the query message itself.

5. The transmission method according to claim 1, characterized in that, Also includes: The protocol endpoints in the P2P routing device actively publish adjacency list messages containing only the protocol endpoints to propagate protocol endpoint communication information to other nodes in the network. When the protocol endpoint receives a query message for the target P2P address, it initiates a query for the target address. If the target address information is not obtained, the protocol endpoint returns the information of the protocol endpoint closest to the queried target address as the response to the query. When a protocol endpoint receives a neighbor information retrieval message, its response contains only information about a set of protocol endpoints with suitable P2P address distributions as neighbor information.

6. The transmission method according to claim 1, characterized in that, When a P2P network message is a broadcast P2P network message, the P2P routing device, upon receiving the P2P network message, forwards the P2P network message to the corresponding P2P node, including: When the P2P routing device is a single-domain processing device, if the P2P routing device determines that the P2P network packet has not been broadcast forwarded, it will send the P2P network packet to other directly connected adjacent points in the same domain, excluding the directly connected adjacent point that received the P2P network packet. When the P2P routing device is a multi-domain forwarding device, if the P2P routing device determines that the P2P network packet has not been broadcast forwarded, it will send the P2P network packet to other directly connected adjacent points in the same domain, except for the directly connected adjacent point that received the P2P network packet, as well as other connected P2P routing devices. The other P2P routing devices will continue to forward this packet to their adjacent other P2P routing devices and directly connected adjacent points in the same domain. Specifically, for broadcast P2P network packets with limited fan-out counts, the fan-out count in the P2P network packet is retained and forwarded to directly connected neighboring points. For broadcast messages with limited forwarding depth, P2P routing devices do not reduce the forwarding depth by one when forwarding them.

7. The transmission method according to claim 1, characterized in that, When a P2P network packet is a unicast P2P network packet, the P2P routing device, upon receiving the P2P network packet, forwards the P2P network packet to the corresponding P2P node, including: When the P2P routing device is a single-domain processing device, after the protocol endpoint of the P2P routing device receives a P2P network packet, it first looks up the adjacency table based on the target P2P address in the P2P network packet. If an entry containing the target P2P address is found, the following processing is performed based on the communication information of the protocol endpoint and adjacent nodes recorded in the found entry: if the protocol endpoint recorded in the found entry is the endpoint of this protocol, the P2P network message is transmitted to the corresponding P2P node based on the communication information of the found adjacent nodes; if it is not the endpoint of this protocol, the P2P network message is sent to the found protocol endpoint. If no entry containing the target P2P address is found, the mapping table of the P2P routing device is searched based on the target P2P address. If an entry with the target P2P address is found, and the mapping table contains forwarding depth information and matches multiple entries with different forwarding depths, the entry with the smaller forwarding depth is searched first. If an entry containing the target P2P address is found, the following processing is performed: if the protocol endpoint recorded in the found entry is the local protocol endpoint, the P2P network packet is sent to the corresponding neighbor according to the information of the found neighbor; if it is not the local protocol endpoint, the P2P network packet is sent to the protocol endpoint recorded in the found entry.

8. The transmission method according to claim 1, characterized in that, When a P2P network packet is a unicast P2P network packet, the P2P routing device, upon receiving the P2P network packet, forwards the P2P network packet to the corresponding P2P node, including: When the P2P routing device is a multi-domain forwarding device, the protocol endpoint of the P2P routing device performs the following processing after receiving the P2P network packet: The P2P network packet is used to search for entries marked as directly connected routes in the routing table of this P2P routing device based on the target P2P address. If found, the adjacency table of this P2P routing device is searched based on the target P2P address, and the following processing is performed based on the found adjacency table entries: if the protocol endpoint recorded in the found entry is not the current protocol endpoint, the packet is sent to the corresponding protocol endpoint; if the protocol endpoint recorded in the found entry is the current protocol endpoint, the P2P network packet is directly sent to the adjacent point recorded in the found entry. If no entry marked as a directly connected route is found, the entry marked as a forwarding route in the routing table of this P2P routing device is searched. If found, the mapping table of this P2P routing device is searched according to the target P2P address, and the corresponding processing is performed according to the entry in the mapping table: if the protocol endpoint recorded in the found entry is not the endpoint of this protocol, the packet is sent to the corresponding protocol endpoint for processing; if the protocol endpoint recorded in the found entry is the endpoint of this protocol, the adjacency table of this P2P routing device is searched according to the target P2P address, and the P2P network packet is sent to the adjacent point recorded in the found entry. If the route is not found in the entry marked as a forwarding route, the routing table of other P2P routing devices is searched based on the target P2P address, including entries marked as directly connected routes and forwarding routes. If found, the P2P network packet is forwarded to the corresponding other P2P routing device.

9. The transmission method according to claim 1, characterized in that, Also includes: When the P2P routing device receives a query message for obtaining communication information corresponding to a target P2P address, it uses the target P2P address to look up the adjacency table. If an entry containing the target P2P address is found, the device responds to the query message according to the P2P protocol and returns the queried communication information. If no entry containing the target P2P address is found, the protocol endpoint in the P2P routing device sends a recursive query message to the target P2P address. After obtaining the query result, it responds to the query message and returns the queried communication information. If no result is found, it returns the protocol endpoint information that is closest to the target P2P address in the P2P protocol sense as the best reachable address.

10. The transmission method according to any one of claims 6-9, characterized in that: The forwarding relationship also includes an adjacency list; The adjacency table is a table showing the relationship between protocol endpoints, target P2P addresses, and IP communication addresses; the adjacency information in the adjacency table includes at least the following: P2P Protocol, used to indicate information about the P2P protocol; Peer transmission mode is used to indicate whether to transmit encrypted or unencrypted, and the encryption protocol used when transmitting encrypted; The local P2P address is the P2P address of the protocol endpoint of this P2P routing device; Local IP + Port + Protocol is the communication information of this party, which is the underlying network protocol address and port used by this party for P2P protocol communication; The peer P2P address is the P2P address of the communicating peer node, that is, the P2P address of the directly connected neighbor node; The peer's IP, Port, and Protocol information is the underlying network protocol address and port used by the other party for P2P protocol communication. The adjacency table information is dynamically learned through the links between P2P nodes and the protocol endpoints that handle the P2P protocol within the P2P routing device. The adjacency information will change when a neighboring P2P node goes offline, a new adjacency relationship is established, or the IP address or port is changed. The protocol endpoints included in the P2P routing device obtain and update adjacency table information through the P2P network adjacency protocol.

11. The transmission method according to claim 10, characterized in that, Also includes: The P2P routing device obtains adjacency table information through P2P network interaction messages or the adjacency update protocol of the P2P protocol.

12. The transmission method according to claim 10, characterized in that, The mapping table also contains the following: Target P2P address: The destination P2P address to which the message is to be forwarded; Protocol endpoint: The P2P address of a protocol endpoint that can forward packets to the target P2P address; Directly connected neighbor: A P2P address that is a directly connected neighbor of the target P2P address and can forward packets to the target P2P address; The mapping table is generated by learning during message forwarding, including one or more of the following cases: 1) When a protocol endpoint receives a P2P network packet sent via a directly connected neighbor, if the source P2P address in the packet is not in the adjacency table, it adds the source P2P address to the mapping table of this P2P routing device, with the depth set to unknown; where depth represents how many forwards are needed to reach the directly connected neighbor; at the same time, it records the corresponding protocol endpoint and the P2P address information of the directly connected neighbor. 2) When the protocol endpoint receives a message published or responded to by the first P2P node carrying adjacency table information or adjacency information, if the first P2P node is a directly connected adjacency of the P2P routing device, the adjacency information contained therein is analyzed. The P2P address of one of the first P2P node's adjacencies (excluding the protocol endpoint) is taken as the target P2P address, the P2P address of the first P2P node is taken as the directly connected adjacency, and the P2P address of the corresponding protocol endpoint is taken as the protocol endpoint. The target P2P address, the P2P address of the first P2P node, and the P2P address of the corresponding protocol endpoint are added as an entry to the mapping table of this P2P routing device, with a depth of 1. If the entry for the target P2P address, the P2P address of the first P2P node, and the P2P address of the protocol endpoint is already in the local mapping table and the depth is unknown, the depth is modified to 1. If the first P2P node contains multiple adjacencies, multiple entries are recorded. 3) If the first P2P node is a directly connected neighbor, then the adjacency table or adjacency information published by the second P2P node, which is the next hop of the first P2P node, is used to add the P2P address of one of the second P2P node's neighbors (excluding the first P2P node and the protocol endpoint) as the target P2P address, the P2P address of the first P2P node as the directly connected neighbor, and the P2P address of its corresponding protocol endpoint as the protocol endpoint. The target P2P address, the P2P address of the first P2P node, and the P2P address of the corresponding protocol endpoint are added as an entry to the mapping table of this P2P routing device, with a depth of 2. If the entry is already in the mapping table of this P2P routing device and the depth is unknown, then the depth is modified to 2. If the second P2P node contains multiple neighbors, then multiple entries are recorded. This process continues, learning is performed according to the pre-set topology learning depth K. Information on neighbor nodes exceeding depth K and nodes with unknown depths are stored in the mapping table and are not updated in the cumulatively learned topology structure.

13. The transmission method according to claim 12, characterized in that, Also includes: Each entry in the mapping table is assigned a decay period value. It needs to be updated before the decay period value decreases to 0; otherwise, it will be removed. After learning an entry in the mapping table, if a P2P routing device has not yet learned the routing information contained in the entry before the decay period value of that entry is reduced to half of the maximum value or other values ​​greater than 0, it will send a P2P protocol message to the target P2P address to trigger the relearning of the entry.

14. The transmission method according to claim 12, characterized in that, Also includes: The mapping table retains multiple entries with different forwarding depths, each with a different depth and decay period value; When adding an entry containing a target P2P address to the mapping table, if the protocol endpoint and adjacency information of the entry for that target P2P address are found to be consistent in the mapping table, the depth is modified to the current depth; otherwise, a corresponding entry is added and the depth is set to the current depth.

15. The transmission method according to claim 13, characterized in that: The forwarding relationship also includes a routing table; the routing table is a relationship table between P2P routing devices and the P2P protocol nodes that they can forward to, which includes the direct adjacent points of the P2P routing devices and the P2P nodes that can be forwarded to through the direct adjacent points. When generating a routing table, the P2P addresses of directly connected neighboring points are extracted from the adjacency table of the P2P routing device and used as the target P2P addresses in the routing table entries, and marked as directly connected routes. The decay period of the corresponding entry in the adjacency table is used as the decay period of this entry. The target P2P addresses are extracted from the mapping table of the P2P routing device and used as the target P2P addresses in the routing table entries, and marked as forwarding routes. The decay period of the corresponding entry in the mapping table is used as the decay period of this entry. When multiple entries in the mapping table correspond to the same forwarding route entry, the entry with the smaller forwarding depth is selected. If the depths are the same, the entry with the largest decay period is selected.

16. The transmission method according to claim 15, characterized in that, Also includes: The P2P routing device periodically sends routing table version information to neighboring P2P routing devices; The P2P routing device receives a request from the neighboring P2P routing device to synchronize routing information. The request carries the routing table version information of the neighboring P2P routing device. The P2P routing device sends Bloom filter information or gap address set information of the routing table to the neighboring P2P routing device according to the difference between the versions. The P2P routing device receives routing table version information sent by neighboring P2P routing devices; if the P2P routing device determines that the received routing table version information is inconsistent with the routing table version information stored locally, it sends a request to the neighboring P2P routing device to synchronize the routing information, the request carrying the local routing table version information. The P2P routing device updates its local routing table based on the Bloom filter information or gap address set information received from the routing tables of the neighboring P2P routing devices.

17. The method according to claim 1, characterized in that: The P2P routing device processes P2P network packets by starting a container and installing a P2P protocol processing image.

18. The method according to claim 17, characterized in that, The P2P routing device processes P2P network packets by launching a container to install a P2P protocol processing image, including: The P2P routing device starts a container based on configuration management information and installs the P2P protocol through the container; or, The P2P routing device analyzes the protocol characteristics of P2P nodes within the P2P network, starts a container, installs the P2P protocol in the container to generate a P2P protocol processing node to process P2P network packets.

19. The method according to claim 1, characterized in that, Also includes: The Bloom filter method is used to compress the information in the adjacency list, mapping table, and routing table. For the adjacency table: Each protocol endpoint corresponds to a Bloom filter, which records the P2P addresses of all P2P nodes directly connected to that protocol endpoint. The Bloom filter is used to determine whether the queried P2P address belongs to the set, that is, whether it is directly connected to the protocol endpoint corresponding to the Bloom filter. For the mapping table: each pair of protocol endpoints and directly connected neighbors corresponds to a Bloom filter, which records the P2P protocol addresses that can be forwarded through the protocol endpoint and directly connected neighbor; For each P2P routing device's routing table or its sub-tables: A P2P routing device generates a Bloom filter or divides into multiple sub-tables according to sub-routes, each corresponding to one or more Bloom filters; each Bloom filter records the P2P address information that the corresponding routing table or sub-table can forward; each sub-table selects different conditions based on the information in the routing table and combines them, and stores the P2P addresses that meet the conditions as the information of the corresponding sub-table in the sub-table.

20. A routing device, comprising: Memory, processor; characterized in that: The memory is used to store the program for transmitting point-to-point network messages; The processor is used to read and execute the program for transmitting peer-to-peer network packets, thereby implementing the P2P network packet transmission method as described in any one of claims 1-19.

21. A computer storage medium storing computer-executable instructions, said computer-executable instructions being executed to implement the method for transmitting P2P network messages as described in any one of claims 1-19.

22. A routing device, characterized in that, A method for transmitting P2P network packets as described in any one of claims 1-19, comprising: an upper-layer processing module, a routing processing module, a device link information module, a forwarding module, and one or more protocol endpoints; The protocol endpoint is used to process P2P protocol messages on the data forwarding path; the P2P protocol processing software / module used by the protocol endpoint is matched with the P2P node to which the protocol endpoint is to forward the data. The protocol endpoints, the protocol endpoints and the device link information module, and the routing devices are interconnected through the forwarding module; The device link information module is used to process link information and form and maintain an adjacency table; it also connects to the protocol endpoint through the forwarding module to collect and provide adjacency information; and it connects to the routing processing module to provide adjacency information. The routing processing module is used to generate and synchronously update routing information; The upper-layer processing module is used to configure and manage routing devices.

23. The routing device according to claim 22, characterized in that: The forwarding module forwards P2P broadcast messages via multicast between protocol endpoints, between protocol endpoints and device link information modules, and between routing devices; each P2P protocol uses a multicast address.

24. The routing device according to claim 23, characterized in that: The forwarding module uses a private network address. In addition to the IP address of the P2P protocol, connected modules and entities are allocated private network IP addresses according to the needs of the forwarding module. When communicating using the forwarding module, internal private network IP addresses are used for interaction.

25. The routing device according to claim 22, characterized in that: The protocol endpoint is also used to register on the device link information module, determine the operation channel for updating the adjacency table, and the following information: the P2P protocol information of the protocol endpoint, the duration of the operation channel's validity period, the update cycle, and the notification conditions; it is also used to send an adjacency information query message to the device link information module to query the corresponding communication information in the current adjacency table; and it is also used to send an adjacency information reporting message to the device link information module when the adjacency information changes, to report the latest adjacency information after the change. The device link information module is also used to return a registration confirmation message to the protocol endpoint; and to actively request the latest adjacency information from the protocol endpoint. It is also used to return an adjacency list query response when the adjacency information query message is received; It is also used to return a reporting confirmation when the adjacency information reporting message is received; After registration, the device link information module and the protocol endpoint will notify the corresponding protocol endpoint of the adjacency list update event if the adjacency list changes that meet the registration notification conditions.

26. The routing device according to claim 22, characterized in that: The protocol endpoint is also used to determine whether a P2P broadcast message has been received within a set time period when it is received from an adjacent P2P node. If not, the P2P broadcast message is forwarded to other P2P nodes adjacent to the protocol endpoint, excluding the adjacent P2P node that received the P2P broadcast message. The P2P broadcast message is also packaged into an IP multicast message, with the multicast target being the multicast address specified by the forwarding module corresponding to the P2P network. Different P2P networks use different multicast addresses. When a P2P broadcast message encapsulated in a multicast message is received from the forwarding module, it is determined whether the P2P broadcast message has been received within a set time period. If not, the P2P broadcast message is forwarded to the adjacent P2P node according to the adjacent forwarding requirements of the P2P protocol.

27. The routing device according to claim 26, characterized in that: The forwarding module is used to forward the IP multicast message to all members of the multicast group according to the multicast address when it receives the IP multicast message; if there is a multi-domain P2P routing device network, it also forwards the IP multicast message to the modules and protocol endpoints of other P2P routing devices in the P2P network that belong to the members of the multicast group.

Citation Information

Patent Citations

  • Method, system and apparatus for routing implementation in peer-to-peer network

    CN101394339A