Dynamic P2P networking is an important evolution for Cardano and a further boost to the network's performance, resilience, and decentralization. By automating the peer selection process, Dynamic P2P enables enhanced communication between distributed nodes and simplifies the process of running a relay or a block-producing node. This eliminates the need for static configurations and manual stake pool operators’ (SPO) input.
Dynamic P2P comes as a built-in functionality with node v.1.35.6 release today. The SPO community is now encouraged to test P2P functionality by updating one of their relays to use the P2P topology mode. Over the next few weeks, IOG and CF teams together with the SPO community will be assessing network connectivity to ensure a smooth rollout of Dynamic P2P functionality.
Here’s more about the evolution of the Cardano network and the features that Dynamic P2P brings.
Cardano's networking protocols combine nodes and their interactions into a unified system using standard communication infrastructure. The network distributes information about transactions and blocks to all active nodes.
There are two ways to configure a Cardano node:
The network’s design aims to minimize communication delays and maximize network resilience against failures, capacity constraints, or malicious behavior.
IOG has always recommended that SPOs deploy at least two relay nodes for each block-producing node to ensure that the system adds blocks and verifies transactions effectively. This strengthens security and deters denial of service (DoS) attacks.
As mentioned in a previous post, Cardano's networking evolved from its initial federated structure to hybrid and the current P2P model. Networking will keep evolving with future additions such as Ouroboros Genesis and peer-sharing:
Currently, block-producing nodes require both incoming and outgoing connections to receive and propagate blocks. However, the selection (in the configuration) of these connections is a manual task done with the topology updater tool. This tool helps SPOs to configure their nodes to connect to other nodes in the network and also receive updates about network changes (eg, stake, performance, or availability).
SPOs need to spend time and effort running the tool manually. When updating their relays, SPOs also need to ensure that their block-producing nodes are connected to the network, otherwise, they may miss a block-producing slot and any rewards.
Dynamic P2P enables automated connection of SPO relays to each other through self discovery and optimization, thus removing the need for static configuration and the manual SPO maintenance required by the hybrid setup. P2P makes the network more performant and resilient to changes such as node or routing failures, and also streamlines the flow of information between the thousands of distributed nodes.
P2P doesn’t just automate the selection of the static configuration, it is more dynamic than that. Currently, SPOs might configure a node to connect to, for example, 50 other SPO nodes. This is a pretty large number, since many nodes can be offline, change their addresses, etc. While 20 connections are enough for efficient communication, SPOs may have to over-provision because of the static configuration.
In a Dynamic P2P setup, SPOs can target to configure 20 connections, which can be picked from thousands of SPO relays, not just 50. And if any are offline, or go offline, the setup will automatically pick new ones, to meet the set target. This means that the configuration is no longer limited to a static pool of 50 peers.
P2P also allows for more sophisticated configurations for direct peering arrangements between SPOs. For example, if two SPOs want to maintain a connection between their relays, and each has two relays, they can configure a group of peers that lists the other SPOs’ two relays but with a target that there should be at least one connection. This means that there is no need for over-provisioning, and SPOs still get automatic failover if one relay goes down. With static configuration, one had to choose between listing only one and thus not getting resilience, or listing both and over-provisioning (using more resources).
Finally, P2P optimizes the selection of peers to minimize the overall diffusion time in the whole network. It does this continuously and automatically. Internal IOG research shows that a policy based purely on local information can achieve a global outcome close to optimal. It measures the frequency with which peers are the first to provide a block header that later ends up in the chain. Peers that are least useful by this metric are periodically ‘churned out’ and replaced by other randomly selected peers. Simulation results show that this simple optimization procedure method reaches a near optimal global outcome within a relatively small number of iterations, on the order of 24 hours.
See this technical specification for more details.