The network of Libp2p Gossip nodes is simulated to find out how different gossip (and non-gossip) parameters affect message dessimination and network traffic
N
threads require xN
memory but gains xN
speedup. Determinism preservedM
threads and shares them across all nodes. Has the same memory footprint, gains speedup depending on protocol performance (gossip gains just up to x2.5
). Not deterministic.N
randomly generated networks (normaly 10) and M
messages sent from random nodes (normally 3-5) for each parameter setwarmUp
time (5 sec) is rewinded allowing Gossip to exchange initial messages and build more or less stable meshes0-*
: 'immediate' effect after publishing a message when no heartbeats executed yet. This is when 'gossiping' (IHAVE/IWANT
messages with message IDs) is not involved.N-*
: when a significant number of heartbeats is executed after publishing a message and the 'gossiping' is expected to be done across the whole networktraffic / [ideal traffic]
, where ideal traffic
if the simulated message payload size (32Kb for block propagation case)Simulates network with different fractions of 'bad' nodes. 'Bad' node - the node which doesn't propagate incoming messages
With default gossip settings and 20 peer connections the upper bound of bad nodes is 80% (or ~x5 of normal nodes)
It shows that 'gossiping' part of the protocol start working in extreme environment only. In that case message delivery timing becomes pretty high.
This is just to check that simulation results don't bounce drammatically when the network size changes.
Checking how number of connected peers affects BFT. Simulating the network where bad/honest nodes ratio is 10/1. The results are not surprising: more peer connections - better BFT. Traffic increase is the cost of BFT growth.
D
- less traffic overheadThe 'ideal' traffic to disseminate a message is the x1 of a message payload (32Kb in our simulations). Current Eth2.0 gossip settings result in ~x5-6 of traffic overhead. Reducing the D
param may decrease the overall traffic, while preserving BFT and delivery rate due to 'gossiping'
For more consistent results DLow
and DHigh
params are set closer to D
. This would increase gossip mesh rebuilding frequesncy (GRAFT
messages traffic) but would keep the real mesh size closer to simulated param.
DLazy
has no much traffic overhead'Gossiping' improves BFT at little traffic cost. Increasing DLazy
doesn't result in a significant traffic overhead in a healthy network.
While 'gossiping' saves traffic and improves BFT its delivery delay could be an issue for time critical applications. Message IDs are 'gossiped' on hearbeats (which period is defaulted to 1 sec in Eth2.0 spec) and the cummulative delivery time becomes order of seconds.
This simulation increases heartbeat frequency in agressive environment (90% of bad nodes). Due to this delivery time singnificantly improves with no large traffic cost. However period < 100ms
causes significant traffic increase (probably due to the network latency interference).
As a follow up of the previous simulation, this one modifies Gossip implementation to immediately broadcast the message gossip to the peers outside of the mesh. (the similar way Eth1.0 propagates a block: minor peers subset receives full block, others receive only hash)
The results are similar to heartbeats with small period: 'gossiping' delivery time significantly improves while traffic overhead increases in a healthy network
DLazy
with relatively small costIHAVE
) and 'mesh' (GRAFT
) heartbeat periods. To enable fast 'gossiping' without too frequent mesh rebuilding.IHAVE
messages to peers (on each gossip_advertise
cycle gossip picks DLazy
random peers with no respect to already sent IHAVE
messages). While it may save some bytes of traffic it may over-complicate the gossip protocol.