Active Network Topology-Aware Approach for Ethereum

Through the improved node discovery and message forwarding protocol, combined with the transaction strategy of the Ethereum memory pool, the problem of low topology accuracy and timeliness in Ethereum network topology perception is solved, achieving efficient and accurate active network topology perception, reducing Redundant traffic and improved controllability.

CN115442291BActive Publication Date: 2024-09-03NANJING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210999573.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2024-09-03
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

The existing Ethereum network topology sensing method relies on static routing tables, resulting in low topology accuracy and low timeliness, and the sensing process generates redundant traffic, resulting in poor controllability and low efficiency.

Method used

Using an improved node discovery protocol and message forwarding protocol, by generating specific target values ​​mapped to different buckets of the target node, polling requests the set of potential active connection nodes, and uses the transaction replacement strategy of the Ethereum memory pool for isolation verification, speculation and Verify active connections to target nodes and draw active network topology.

Benefits of technology

It significantly reduces redundant traffic in the network, improves the real-time and accuracy of topology sensing, realizes efficient and controllable active network topology sensing, and provides a more accurate and efficient Ethereum network topology sensing solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115442291B
    Figure CN115442291B
Patent Text Reader

Abstract

The present invention discloses an active network topology perception method for Ethereum, which mainly comprises the following steps: by deploying perception nodes in the Ethereum network, realizing the routing table perception of the target node by using the node discovery protocol in the improved Ethereum network specification protocol; realizing the estimation of the number of active connections of the target node by using the message forwarding protocol in the Ethereum network specification protocol; finally, according to the processing strategy of the Ethereum memory pool for future transactions, verifying whether there is an active connection between the target node and its peer node in the routing table by transaction isolation verification. The present invention has the advantages of simple implementation and high efficiency, and can provide a more efficient and accurate active network topology perception solution for Ethereum.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cyberspace security, and specifically is an active network topology perception method for Ethereum. Background Art

[0002] As the basis of peer-to-peer communication, the Ethereum network layer has attracted widespread attention due to its key role in the communication between relevant participants. Unstructured peer-to-peer networks have a topology mismatch problem in topology structure. The mismatch between logical links and physical links leads to low data transmission efficiency in the network. Ethereum developers achieve the purpose of maintaining the security of Ethereum by implicitly hiding the network topology structure. Any node connected to Ethereum can obtain information about other nodes from the network, but the connection between nodes is hidden. Although hiding the network topology of Ethereum increases the difficulty of attack, inferring network connections through side channel attacks and other techniques can overcome this limitation. It can be seen that topology obfuscation is not an effective defense strategy. Given the need to maintain the security of the Ethereum network, it is extremely important to realize the perception of the Ethereum network topology. The existing Ethereum network topology perception method mainly perceives the static routing table of the node and draws the Ethereum network topology through the static routing table. However, the connection between Ethereum nodes is hysteresis, and the disconnected nodes are not immediately cleared from the routing table of the neighboring nodes, resulting in low accuracy and timeliness of the perceived topology structure. In addition, the traditional Ethereum network topology perception method will generate redundant traffic during the perception process, resulting in poor controllability and low efficiency of the topology perception process. Summary of the invention

[0003] The purpose of the present invention is to propose an active network topology perception method for Ethereum, so as to overcome the problems of node routing table perception and active connection verification between nodes in the prior art, and realize a more efficient and accurate active network topology perception scheme for Ethereum.

[0004] The technical solution to achieve the purpose of the present invention is: an active network topology perception method for Ethereum, comprising the following steps:

[0005] Step 1: Node routing table perception: The perception node generates 16 specific target values ​​based on the target node's globally unique identifier to map to different buckets of the target node, and executes the improved Ethereum node discovery protocol to request the bucket in the form of polling to obtain the target node's potential active connection node set;

[0006] Step 2: Estimation of the number of active connections: The sensing node passively collects the message forwarding records of the target node in the network, divides the messages forwarded by the target node into two categories: entity messages and hash messages, and counts the number of the two message categories within a specified time;

[0007] Step 3: Isolate verification: Based on the Ethereum memory pool’s support for transaction replacement strategies and future transaction processing strategies, the sensing node verifies the active connections between target nodes by propagating future transactions of specified prices to the network in sequence; under the constraints of the target node’s potential active connection set and the number of active connections, the target node’s active connection node set is obtained through continuous iteration of the isolation verification method;

[0008] Step 4: Draw the active topology: Draw the network topology based on the active connection node set of the target node obtained by isolation verification.

[0009] Compared with the prior art, the present invention has the following significant advantages: (1) Based on the improved node discovery protocol, the routing table perception of the target node can be realized within a controllable number of requests, which greatly reduces the injection of redundant traffic in the network and has the advantages of high efficiency, controllability, and easy adjustment; (2) The estimation of the number of active connections of the node based on the message forwarding protocol accelerates the isolation verification process, so that the set of active connection nodes of the target node can converge quickly; (3) Based on the transaction strategy supported by the Ethereum memory pool, the isolation verification method realizes the verifiability of active connections between nodes, which greatly improves the real-time and accuracy of Ethereum network topology drawing; (4) The present invention has the advantages of simple implementation and high efficiency, and can provide a more efficient and accurate Ethereum active network topology perception solution for each user accessing Ethereum. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is the overall architecture diagram of the present invention.

[0011] Figure 2 It is a routing table perception workflow diagram of the present invention.

[0012] Figure 3 It is a schematic diagram of the isolation verification of the present invention.

[0013] Figure 4 It is the perception trend of the Ethereum network topology by the sensing nodes within several iterations. DETAILED DESCRIPTION

[0014] The present invention provides an active network topology perception method for Ethereum, comprising the following steps:

[0015] Step 1: Node routing table perception: The perception node initiates a peer node information request to the target node according to the improved node discovery protocol to perceive its routing table data. As part of the node discovery protocol, Ethereum's neighbor node storage mechanism reserves 17 buckets for each node to store its peer nodes through Kademlia DHT, and each bucket stores 16 nodes; for the perception node to request a routing table from the target node, different target values ​​must be generated to map to buckets.

[0016] Step 2: Estimate the number of active connections. The sensing node receives the message forwarding record from the target node, counts the number of message bodies and message hashes forwarded by the target node, and calculates based on the statistical data to estimate the number of active connections of the target node. For the message forwarding mechanism of Ethereum, whether the node chooses the message body or the message hash, the selection of the peer node is always random, even for the same group of neighbor nodes; for the message forwarding of the target node, first record the number of message bodies and message hashes forwarded by the node within a period of time. According to the randomness of message forwarding, then use the statistical principle to know that the number of message bodies and message hashes received by the sensing node in a short period of time maintains a certain proportional relationship; in ETH / 66, the node forwards the message body to the square root of connected nodes during the message forwarding process, and forwards the message hash to the remaining nodes.

[0017] Assume that the node has M active connections, where msg full is the number of message bodies, msg hash is the number of message hashes, that is:

[0018]

[0019] Then find the number of active connections M of the node:

[0020]

[0021] Step 3: Isolation verification. Ethereum's memory pool supports two strategies: transaction replacement and transaction eviction. Transactions already in the memory pool can be replaced or expelled by subsequent high-priced transactions. According to the characteristics of future transactions in Ethereum and the transaction replacement strategy, an isolation verification method for future transactions is designed to check whether there is an active connection between nodes. First, the perception node M sends a high-priced future transaction TX with a nonce value of h to the target node A. a , and then sends a low-price future transaction TX with a nonce value of h to the potential peer node B in the target node routing table b , and finally send the mid-price future transaction TX with nonce value h to other nodes C in the network cAfter the state is activated by broadcasting the previous transaction through the sensing node M, according to the transaction replacement strategy, the high-priced transaction TX of node A a The path from node C to node B is represented by the medium-price transaction TX c If node A’s high-price transaction TX a Propagate to node B and replace the low-price transaction TX b , it proves that there is an active connection between node A and node B. Under the constraints of the potential active connection node set of the target node obtained in step 2 and the estimated number of active connections of the target node in step 3, the iterative isolation verification method converges at an extremely fast speed to obtain the active node set of the target node.

[0022] Step 4: Active network topology drawing. The new peer nodes obtained from the target node are included in the set of nodes to be sensed. By continuously iterating new nodes, the active network topology of Ethereum is obtained. For the active network topology perception of Ethereum, firstly, the node routing table of a single node is sensed, and under the limit of the number of active connections, the peer nodes in the routing table are continuously iterated and isolated and verified, and finally the active connection of a single node is obtained; by iteratively sensing the nodes found in Ethereum that have not been requested, the active network topology of the Ethereum network can be drawn.

[0023] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0024] like Figure 1 As shown, an active network topology perception method for Ethereum in an embodiment of the present invention comprises the following specific steps:

[0025] Step 1, the sensing node, reconstructs the node discovery protocol and message forwarding protocol in the Ethereum source code. First, in the node discovery protocol, 16 target values ​​are calculated and mapped to different buckets of the target node based on the global unique identifier of the target node; secondly, in the message forwarding protocol, the message body and message hash forwarded by the neighboring node are counted, and their number is recorded in the database. Recompile the Ethereum source code, generate the Ethereum account, private key and Keystore, access the Ethereum network according to the DNS seed list provided in the Ethereum source code, and include the peer nodes of the sensing node in the set of nodes to be sensed.

[0026] Step 2: Node routing table perception. As part of the node discovery protocol, Ethereum's neighbor node storage mechanism reserves 17 buckets for each node through Kademlia DHT to store its peer nodes, with 16 nodes stored in each bucket. When the perception node requests a routing table from a target node, it must generate different target values ​​based on the target node's globally unique identifier and map them to buckets. Figure 2 As shown in the figure, the specific process of node routing table perception is as follows:

[0027] (1) For the sensing node, the activity of the target node is detected through the handshake protocol, and a Ping packet is sent to it for verification. If the target node is active, it responds with a Pong packet;

[0028] (2) The sensing node generates a specified target value and sends a FindNode packet to request nodes in the bucket close to the target value. The target node responds with a Neighbor packet.

[0029] (3) Calculate and generate 16 different target values, and poll the target node for nodes in the bucket that have not been marked;

[0030] (4) All the peer nodes obtained by the request are aggregated, screened, and deduplicated, and the obtained set of peer nodes is the potential active connection of the target node.

[0031] Step 3: Speculation of the number of active connections. For the message forwarding mechanism of Ethereum, no matter whether the node selects the message body or the message hash, the selection of the peer node is always random, even for the same group of neighbor nodes. For the message forwarding of the target node, first record the number of message bodies and message hashes forwarded by the node within a period of time. According to the randomness of message forwarding, then use statistical principles to know that the number of message bodies and message hashes received by the perception node in a short period of time maintains a certain proportional relationship. In the ETH / 66 protocol, during the message forwarding process, the node forwards the message body to the square root of the connected nodes and forwards the message hash to the remaining nodes. According to the characteristics and relationships in the message forwarding protocol, the number of active connections of the target node is calculated.

[0032] Step 4, isolated verification, the memory pool of the Ethereum node has two strategies: transaction replacement and transaction eviction. Transactions in the memory pool of the Ethereum node can be replaced or expelled by subsequent high-priced transactions. When a node receives a new transaction that is propagated from other nodes, the node will verify the transaction and decide whether to accept the transaction into the memory pool. Once the node chooses to accept the transaction into the memory pool, it may trigger transaction replacement or transaction expulsion. Transaction replacement means that a transaction can be replaced by a high-priced transaction from the same sender account and with the same nonce value. Transaction expulsion means that transactions that already exist in the memory pool can be expelled from the memory pool by other transactions from different senders or different nonce values. This usually occurs when the memory pool overflows, and a low-priced transaction will be expelled by another transaction from a different sender or with a different nonce value;

[0033] Assume that the sensing node is M, the target node is A, any node in the potential active connection set is B, and the remaining nodes in the Ethereum network are C, such as Figure 3 As shown, the method is specifically as follows:

[0034] (1) Verify whether there is an active connection between node A and node B by means of isolated verification based on the target node, the peer node information in its routing table, and the inferred number of active connections of the target node;

[0035] (2) Node M sends a high-priced future transaction TX to node A a , future transactions will not be broadcast directly, but will be placed in the waiting queue in the memory pool after legitimacy verification;

[0036] (3) Node M sends a low-price future transaction TX to node B b , future transactions will not be broadcast directly, but will be placed in the waiting queue in the memory pool after legitimacy verification;

[0037] (4) Node M sends two intermediate and consecutive pending transactions TX to node C. p and TX c , where TX a TX b and TX c It is a transaction with the same Nonce value issued by the same node M. According to the preset price of the transaction, the high-priced transaction TX a Unable to replace mid-price transaction TX c , medium price affairs TX c Unable to replace low-price transaction TX b , high-price affairs TX a Can replace low-cost transaction TX b TX p As a pre-transaction to activate the above transactions;

[0038] (6) Node C receives TX p and TX c Then broadcast it, and node A receives the TX broadcast by node C. p and TX c After that, TX p As an activation transaction prompts TX a and TX c A transaction replacement occurs, but the replacement fails because the price threshold required for replacement is not reached. The resident transaction in the memory pool of node A is still TX a .

[0039] (7) Node C receives TX p and TX c Then broadcast it, and node B receives the TX broadcast by node C. pand TX c After that, TX p As an activation transaction prompts TX b and TX c Transaction replacement occurs, but the replacement fails because the price threshold required for replacement is not reached. The resident transaction in the memory pool of Node B is still TX b .

[0040] (8) The current transaction resident in the memory pool of node A is TX a , the resident transaction in the memory pool of node B is TX b , the transaction resident in the memory of node C is TX c ; After the sensing node M makes a simple adjustment, it prompts the transaction TX in node A a External communication, due to TX a TX b and TX c Replacement relationship between transactions, transaction TX in node A memory pool a The paths from node C to node B are all covered by the medium-price transaction TX c Once the low-cost transaction TX in node B is blocked, path isolation is achieved; b TX a If replaced, it indicates that there is an active connection between node A and node B, otherwise there is no active connection between node A and node B.

[0041] (9) The isolation verification method is continuously iterated under the restriction of the number of active connections of the target node, and finally the set of active connection nodes of the target node is obtained.

[0042] Step 5: Draw the active network topology. Add the new peer nodes obtained from the target node to the set of nodes to be sensed. By continuously iterating new nodes, the active network topology of Ethereum is obtained. For the active network topology perception of Ethereum, firstly, the node routing table of a single node is sensed, and under the limit of the number of active connections, the peer nodes in the routing table are continuously iterated and isolated to verify, and finally the active connection of a single node is obtained; by iteratively sensing the nodes found in Ethereum that have not been requested, the active network topology of Ethereum can be drawn. Figure 4 As shown, after several iterations, the method proposed in the present invention can sense more than 95% of the nodes in the network.

[0043] In summary, the present invention deploys sensing nodes in the Ethereum network, realizes the routing table perception of the target node by improving the node discovery protocol in the Ethereum network specification protocol; realizes the estimation of the number of active connections of the target node by utilizing the message forwarding protocol in the Ethereum network specification protocol; finally, according to the processing strategy of the Ethereum memory pool for future transactions, verifies whether there is an active connection between the target node and the peer node in its routing table by transaction isolation verification. The present invention has the advantages of simple implementation and high efficiency, and can provide a more efficient and accurate active network topology perception solution for Ethereum.

Claims

1. A method for sensing active network topology for Ethereum, characterized in that: The following steps are involved: Step 1: Node routing table perception: The perception node generates 16 specific target values ​​based on the global unique identifier of the target node to map to different buckets of the target node, and executes the improved Ethereum node discovery protocol to request the bucket in the form of polling to obtain the set of potential active connection nodes of the target node; The steps of node routing table perception include: (1) the perception node detects the activity of the target node through the handshake protocol, sends a Ping data packet to it for verification, and responds with a Pong data packet if the target node is in an active state; (2) the perception node generates a specified target value, sends a FindNode data packet to request nodes in a bucket close to the specified target value, and the target node responds with a Neighbor data packet; (3) 16 specific target values ​​are calculated and generated, and the target node is polled to request nodes in the bucket that have not been marked; (4) all requested peer nodes are aggregated, screened, and deduplicated, and the resulting peer node set is the target node's potential active connection node set; Step 2, inferring the number of active connections; the sensing node passively collects the message forwarding records of the target node in the network, receives the message forwarding records of the target node from the target node, divides the messages forwarded by the target node into two categories: message body and message hash, and counts the number of message bodies and message hashes forwarded by the target node within a specified time, and calculates based on the statistical data to infer the number of active connections of the target node; for the messages forwarded by the target node, based on the number of message bodies and message hashes forwarded by the target node within the specified time, the fixed proportional relationship between the number of message bodies and message hashes received by the sensing node is used to calculate the number of active connections of the target node according to the proportional relationship; Assume that the target node has M active connections, where is the number of message bodies, is the number of message hashes, and the proportional relationship is: ; Find the number of active connections M of the target node: ; Step 3, isolated verification; the memory pool of the Ethereum node has two strategies: transaction replacement and transaction eviction. Transaction replacement means that a transaction can be replaced by a high-priced transaction from the same sender account and with the same nonce value; transaction eviction means that transactions already existing in the memory pool can be expelled from the memory pool by other transactions from different senders or different nonce values; The sensing node verifies the active connection between the target nodes by propagating the future transactions of the specified price to the network in sequence; first, the sensing node M sends a high-price future transaction with a nonce value of h to the target node A. , the future transaction will not be broadcast directly, but will be put into the waiting queue in the memory pool after the legitimacy verification; then the sensing node M sends a low-cost future transaction with a nonce value of h to any node B in the potential active connection set , the future transaction will not be broadcast directly, but will be put into the waiting queue in the memory pool after the legitimacy verification; finally, the sensing node M sends two medium-priced future transactions with nonce value h to other nodes C in the Ethereum network and ,in , and It is a future transaction with the same Nonce value issued by the same sensing node M. According to the preset price of future transactions, the high-priced transaction Unable to replace mid-price transaction , mid-price affairs Cannot replace low-price transactions , high-priced affairs Can replace low-price transactions ; To activate the previous transaction of the above transaction, the previous transaction is broadcasted by the sensing node M to activate the state. According to the transaction replacement strategy, the high-priced transaction of node A The path from node C to node B is the middle price transaction If the high-priced transaction of node A Propagate to Node B and replace the low-price transaction , it proves that there is an active connection between node A and node B; under the constraints of the target node's potential active connection node set and the number of active connections, the target node is iterated and isolated for verification to obtain the target node's active connection node set; Step 4: Draw the active topology: Draw the network topology based on the active connection node set of the target node obtained by isolation verification.

2. The active network topology perception method for Ethereum according to claim 1, characterized in that: The network topology drawing method described in step 4 is: after implementing steps 1, 2 and 3 on the target node, the active node set of the target node is obtained; through an iterative manner, the active node set of each target node in the network is obtained in turn, and the network topology is drawn based on the active connection node sets of all target nodes.