GithubHelp home page GithubHelp logo

isabella232 / student_19_tlc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dedis/student_19_tlc

0.0 0.0 0.0 117 KB

Spring 2019 - Threshold Logical Clocks (TLC) prototype

License: GNU Affero General Public License v3.0

Go 100.00%

student_19_tlc's Introduction

TLC Protocol

Current implementations:

  • "simple" version: no CoSi, acks are broadcast, blocking, O(N^3) messages
  • "CoSi version": each node aggregates own acks, blocking, O(N^2) messages

Important Considerations: these implementations currently rely on eventual message delivery from the underlying communication links for their asynchronicity guarantees (e.g. tcp timeouts might pose a problem)

Usage

Each node/service that uses the protocol is responsible for broadcasting one message per round, including empty messages:

msg := []byte(fmt.Sprintf("This round's message for this node"))
pi.Message <- msg	// var pi *TLC

And can collect that round's set of messages:

set := <- pi.ThresholdSet // var set map[onet.TreeNodeID]*MessageDelivered

for node, msg := range set {
	if msg.TDelivered {
		println("The round %v message: %v, sent by node %v,
		was delivered by a threshold of nodes!", msg.Round, msg.Message, node)
	}
}

All of the messages returned in the round are of that round. Buffering of messages from future rounds (nodes further ahead) is done automatically.

Whenever a round finishes (i.e. when <- pi.ThresholdSet returns), the protocol waits for the validation function to be updated before it starts processing the next round's messages. You can signal that the function has been updated by either providing the next round's message (pi.Message <- msg) or through the tlc.ReadyForNextRound() method (useful in case you want to start processing other nodes' messages before your message is ready)

To terminate the local protocol instance "cleanly" (currently for testing purposes only).

pi.Terminate() // Should be done for each instance. Can be used to simulate crashes. 

For quick reference:

type MessageDelivered struct {
	Round   uint64
	Message []byte
	TDelivered bool // true if the message was delivered by TMsgs nodes ("certified")
}

Simulation(s)

You can define the behaviour of remote nodes a priori by modifying the Dispatch method of TLCWrapper.

The root node's behaviour is defined in the Run method.

Run a simulation with:

cd simulation/
go build
./simulation protocol.toml

Contact me (mvidigueira) if you have any problems.

student_19_tlc's People

Contributors

mvidigueira avatar ceyhunalp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.