This project provide a service to establish an epidemic-style broadcast infrastructure. The service is supported by Google Protocol Buffers & gRPC.
Each rumor
- A: Unknown, whose counter is 0
- B: Pushing, whose counter is in range $[1, \text{ctr}{push}]$, where $\text{ctr}{push} = \mathcal{O}(\ln\ln n)$
- C: Pulling, whose counter is in range $[\text{ctr}{push}, \text{ctr}{push} + \text{ctr}{pull}]$, where $\text{ctr}{pull} = \mathcal{O}(\ln\ln n)$
- D: Died, whose counter is beyond
$\text{ctr}_{max}$
With a configurable interval, the time is split into multiple rounds. A node works as following:
- Calculate the rumor counters in last round
- Send rumors & update related counters (only send rumors in B state)
- Receive & reply pull requests & update related counters (only reply rumors in C state)
The rumor counter is calculated in following rules: (The median-counter algorithm in [1])
Say node
- State A.
- If
$v$ in state A receives$r$ only from nodes in state B, then it switches to state B-1. - If
$v$ in state A receives$r$ from nodes in state C, then it switches to state C.
- If
- State B.
- If during a round
$v$ in state B-$m$ receives$r$ from more players in state B-$m'$ with$m' \ge m$ than from nodes in state A and B-$m''$ with$m'' \lt m$ , then it switches to state B-$(m + 1)$. - If
$v$ receives$r$ from nodes in state C, then it switches to state C.
- If during a round
- State C. Increase counter every round.
- State D. Terminate state.
With this algorithm, we can broadcast a rumor to
- interval: The round interval.
-
$\text{fan}_{out}$ : The maximum number of nodes the push request sending to -
$\text{fan}_{in}$ : The maximum number of nodes the pull request sending to -
$n$ : The estimated number of nodes in whole cluster - $\text{factor}{push}$: $\text{ctr}{push} = \text{factor}_{push} \ln\ln n$
- $\text{factor}{pull}$: $\text{ctr}{pull} = \text{factor}_{pull} \ln\ln n$
Give a tool like Serf Convergence Simulator to give a visible chart about the broadcast time & message load.
With extra parameters:
- Packet loss
- Node failure rate
- R. Karp, C. Schindelhauer, S. Shenker, and B. Vocking, “Randomized rumor spreading,” Proc. 41st Annu. Symp. Found. Comput. Sci., pp. 565–574, 2000.
- B. Doerr and A. Kostrygin, “Randomized rumor spreading revisited,” in Leibniz International Proceedings in Informatics, LIPIcs, 2017, vol. 80.
- H. Mercier, L. Hayez, and M. Matos, “Brief Announcement: Optimal Address-Oblivious Epidemic Dissemination,” in Proceedings of the ACM Symposium on Principles of Distributed Computing - PODC ’17, 2017, pp. 151–153.