golang implement gossip algorithm

Related tags

Utilities gossip_mp1
Overview

gossip_mp1

=====

Implementation of Gossip Protocol as described in http://publicatio.bibl.u-szeged.hu/1529/1/gossip11.pdf

Sebastian Fernandez, Gabby Munger, Justin Gomez

Description

This program creates a network of independent nodes which spread a message via the gossip protocol, with the intention of using this program to gather data on runtime between the three different protocols (Push, Pull, and Push-Pull) and on systems of varying size.

How To Run

1. Clone Git Repository

2. Run using:

go run main.go

3. Input the message you would like to send

The type of message(i.e. int, float, boolean, string) does not matter, as the program will read it as a string. There is strange behavior exhibited if the string includes a space, however the program still gives the desired output, as shown below.

Screen Shot 2021-10-12 at 10 21 17 PM

4. Input the specific gossip protocol to use.

There are three protocols to choose from: push, pull, and push-pull. As described by Jelasity:

In push gossip, susceptible nodes are passive and infective nodes actively infect the population. In pull and push-pull gossip each node is active.

The program will create a system of nodes that executes the desired gossip protocol to send a message between all of the nodes. The number of nodes in the system can be changed according to the instructions in the block comment at the top of main.go.

5. Example of expected output:

This example shows an input of systems as the message, and a to indicate the Push protocol in a system of 100 nodes. The output displays the time taken to complete the gossip protocol.

Screen Shot 2021-10-12 at 10 17 57 PM

This example shows an input of message as the message, and b to indicate the Pull protocol in a system of 100 nodes. The output displays the time taken to complete the gossip protocol.

Screen Shot 2021-10-12 at 10 18 16 PM

This example shows an input of hello as the message, and c to indicate the Push-Pull protocol in a system of 20 nodes. The output displays the time taken to complete the gossip protocol.

Screen Shot 2021-10-12 at 10 23 01 PM

Occasionally an error occurs when running the Push-Pull algorithm, resulting in a deadlock. This can be resolved by running the program again.

Workflow Diagram

Gossip Protocol Workflow Diagram

You might also like...
Goridge is high performance PHP-to-Golang codec library which works over native PHP sockets and Golang net/rpc package.
Goridge is high performance PHP-to-Golang codec library which works over native PHP sockets and Golang net/rpc package.

Goridge is high performance PHP-to-Golang codec library which works over native PHP sockets and Golang net/rpc package. The library allows you to call Go service methods from PHP with a minimal footprint, structures and []byte support.

memresolver is an in-memory golang resolver that allows to override current golang Lookup func literals

mem-resolver memresolver is an in-memory golang resolver that allows to override current golang Lookup func literals How to use it Create your custom

Govalid is a data validation library that can validate most data types supported by golang

Govalid is a data validation library that can validate most data types supported by golang. Custom validators can be used where the supplied ones are not enough.

Code Generation for Functional Programming, Concurrency and Generics in Golang

goderive goderive derives mundane golang functions that you do not want to maintain and keeps them up to date. It does this by parsing your go code fo

Golang source code parsing, usage like reflect package

gotype Golang source code parsing, usage like reflect package English 简体中文 Usage API Documentation Examples License Pouch is licensed under the MIT Li

Golang library to act on structure fields at runtime. Similar to Python getattr(), setattr(), hasattr() APIs.

go-attr Golang library to act on structure fields at runtime. Similar to Python getattr(), setattr(), hasattr() APIs. This package provides user frien

Composable HTML components in Golang
Composable HTML components in Golang

daz Composable HTML components in Golang Daz is a "functional" alternative to using templates, and allows for nested components/lists Also enables tem

Meteoric golang nitro sniper, 0.1/0.5s claim time.
Meteoric golang nitro sniper, 0.1/0.5s claim time.

Meteoric golang nitro sniper, 0.1/0.5s claim time.

Golang bindings for GDAL

Golang bindings for GDAL Goals Godal aims at providing an idiomatic go wrapper around the GDAL library: Function calls return a result and an error.

Owner
Gabriella Munger
Gabriella Munger
Golang code-generators used to implement Kubernetes-style API types.

code-generator Golang code-generators used to implement Kubernetes-style API types. Purpose These code-generators can be used in the context of Custom

Kubernetes 1.3k Nov 18, 2022
Experimenting with golang generics to implement functional favorites like filter, map, && reduce.

funcy Experimenting with golang generics to implement functional favorites like filter, map, && reduce. 2021-12 To run the tests, you need to install

null 0 Dec 29, 2021
A concurrent rate limiter library for Golang based on Sliding-Window rate limiter algorithm.

ratelimiter A generic concurrent rate limiter library for Golang based on Sliding-window rate limitng algorithm. The implementation of rate-limiter al

Narasimha Prasanna HN 220 Nov 10, 2022
Scalable golang ratelimiter using the sliding window algorithm. Currently supports only Redis.

go-ratelimiter Scalable golang ratelimiter using the sliding window algorithm. Currently supports only Redis. Example usage client := redis.NewClient

null 0 Oct 19, 2021
cuckoo-filter go implement. config by you 布谷鸟过滤器的Go实现,可以定制化过滤器参数

Cuckoo filter is a Bloom filter replacement for approximated set-membership queries. While Bloom filters are well-known space-efficient data structures to serve queries like "if item x is in a set?", they do not support deletion. Their variances to enable deletion (like counting Bloom filters) usually require much more space.

Linvon 240 Nov 22, 2022
Go implement D*Lite with SDL2

dstarlite-gosdl Go implement D*Lite with SDL2 使用Go SDL2库实现的D*Lite算法 注意,尽可能使用 go mod ,自动下载依赖库(确保已经安装了SDL2库) 推荐使用Linux或者macOS运行 git clone https://github

joxrays 2 Apr 2, 2022
An implement of CNI depending on neutron API

An implement of CNI depending on neutron API

null 2 Dec 27, 2021
A simple thread-safe, fixed size LRU written in Go. Based on dominictarr's Hashlru Algorithm. 🔃

go-hashlru A simple thread-safe, fixed size LRU written in Go. Based on dominictarr's Hashlru Algorithm. ?? Uses map[interface{}]interface{} to allow

Saurabh Pujari 72 Sep 18, 2022
A faster RWLock primitive in Go, 2-3 times faster than RWMutex. A Go implementation of concurrency control algorithm in paper

Go Left Right Concurrency A Go implementation of the left-right concurrency control algorithm in paper <Left-Right - A Concurrency Control Technique w

wangyi 42 Aug 28, 2022
EVM-compatible chain secured by the Lachesis consensus algorithm.

ICICB-Galaxy EVM-compatible chain secured by the Lachesis consensus algorithm. Building the source Building galaxy requires both a Go (version 1.14 or

null 2 Oct 7, 2021