Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(networking): lower dhigh to limit amplification factor #2168

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

alrevuelta
Copy link
Contributor

@alrevuelta alrevuelta commented Oct 30, 2023

This PR lowers gossipsub's Dhigh value so that nodes have a more predictable amplification factor (in terms of bandwidth). Before 4 to 12 now 4 to 8.

Used this tool to run simulations using 1000 nodes and propagation time should not be affected, since average D in the network stays the same.

before: mean of D among 1000 randomly connected nodes 6.129. Message latency average 509 ms (8991 samples).

Statistics. mean=6.129 max=12 min=4
Statistics. mean=509.4595706817929 max=695 min=263

after this PR: mean of D among 1000 randomly connected nodes 6.124. Message latency average 506 ms (8991 samples). But with the main difference that max D is 8 instead of 12.

Statistics. mean=6.124 max=8 min=4
Statistics. mean=506.74274274274273 max=677 min=263

In other words, it shouldn't affect the network performance, but it will decrease bandwidth consumption in some nodes by around 30% (12 -> 8)

note: In the future we may want to lower both Dlow/Dhigh even more, to limit bandwidth consumption, or at least to some "profiles". But this indeed has an impact in propagation delay. More waku-org/research#44

@github-actions
Copy link

github-actions bot commented Oct 30, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2168

Built from d16a976

@SionoiS
Copy link
Contributor

SionoiS commented Oct 30, 2023

I'm a bit uneasy about this change. I feel like the intent of d is more than just amplification, it protect mesh connectivity from degrading too much (also protect from eclipse attack).

What is the relation between; churn rate, propagation time and message loss rate?

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@alrevuelta
Copy link
Contributor Author

I'm a bit uneasy about this change. I feel like the intent of d is more than just amplification, it protect mesh connectivity from degrading too much (also protect from eclipse attack). What is the relation between; churn rate, propagation time and message loss rate?

Note that Dlow and D have not changed, and in the simulations reported above, I can verify that the average D in the network stays the same. So I would say there is no impact, or at least not significant. The main difference is that before there were on average 12-6=6 "mesh slots" per node and now 8-6=2. Guess this affects new joiners, but as long as it is > 0, we should be okay.

I would feel uneasy about going as low as in waku-org/research#44, but the change of this PR is quite convervative.

@alrevuelta alrevuelta merged commit f0f69b3 into master Oct 30, 2023
3 checks passed
@alrevuelta alrevuelta deleted the lower-d-high branch October 30, 2023 15:17
@SionoiS
Copy link
Contributor

SionoiS commented Oct 30, 2023

Note that Dlow and D have not changed, and in the simulations reported above, I can verify that the average D in the network stays the same. So I would say there is no impact, or at least not significant. The main difference is that before there were on average 12-6=6 "mesh slots" per node and now 8-6=2. Guess this affects new joiners, but as long as it is > 0, we should be okay.

I would feel uneasy about going as low as in waku-org/research#44, but the change of this PR is quite convervative.

Perfect! Thanks.

@alrevuelta
Copy link
Contributor Author

Interesting to see the effect of this live at: simulator.waku.org. Seems that D changes a bit more in some nodes. It stays within the expected values but is worth noting.
image

@jm-clius
Copy link
Contributor

jm-clius commented Nov 2, 2023

Seems that D changes a bit more in some nodes

This seems strange and I have no immediate hypothesis about why this might happen. The worry would be that more churn = more bandwidth (due to control messages) which may diminish the gains we get from a lower D.

@alrevuelta
Copy link
Contributor Author

alrevuelta commented Nov 6, 2023

Seems that D changes a bit more in some nodes

image

It looks like it was temporal, unsure why though. Right now the behavior seems like it should. Will monitor just in case. Note that simulations with a fixed amount of nodes and no churn are ofc biased.

@jm-clius
Copy link
Contributor

jm-clius commented Nov 6, 2023

Ah, much better 😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants