GithubHelp home page GithubHelp logo

reliable-multicast-chat's Introduction

#Reliable Multicast Chat

Usage

./reliable_multicast_chat [process ID] [delay time (in seconds)] [drop rate (0<=P<1)]

Execute reliable_multicast_chat in ./bin folder.

Configurations

Modify config.py in reliable_mulicast_chat directory accordingly. config['hosts'] is a list of (IP address, port). Ordering can be either 'casual' or 'total'.

Algorithms

  • Casual Ordering: When a process receives a multicasted message, it pushes the received message to a buffer queue with a vector timestamp from the sender. And then update_holdback_queue_casual() takes care of updating the buffer and actually delivering the message to the process. It compares the timestamps of the buffered messages with the process's timestamp to determine which messages should be kept in the buffer or be removed and delivered to the process.

  • Total Ordering: Process 0 is always designated as the sequencer. When a process multicasts a message, other processes will hold that message in a buffer until they receive a marker message from the sequencer indicating the order of that message. When the sequencer receives a message, it increments an internal counter and assigns that number as the message's order number which will then be multicasted to all other processes.

  • Reliable Multicast: When a process unicasts a message, it stores it in the unacknowledged messages buffer and keeps it there until an ack message is received. We have a thread called ack_handler which periodically keeps track of received ack messages for each item in the buffer and either re-send the message or remove from the buffer depending on the message is asknowledged by the receiving process or not. The receiving process sends an ack message every time it receives a message, but does not actually process duplicate messages (identified with message IDs).

  • Randomized Losses: e generate a random floating point number, and if that number is smaller than the user-specified loss rate, we don't actually send the message, however, we still keep it in the unacknowledged buffer so that the ack_handler thread can keep re-sending the message until the receiving process acknowledges it. See above Reliable Multicast for details.

  • Randomized Delay: We calculate a send_time for each outgoing message and push a tuple (send_time, message) into a queue. The thread message_queue_handler periodically iterates through the queue and sends out messages with current_time >= send_time.

Requirement

  • Python3

reliable-multicast-chat's People

Contributors

daeyun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

n2o-yy

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.