Git Product home page Git Product logo

token_ring_algorithm_python3.6's Introduction

Implementation of Token Ring Algorithm including Leader Election:

This repository contains code that implements token ring algorithm. This code also contains the logic for electing a new leader if the orignal cordinator goes down.

Content of this repository:

This repository contains node4.py, node1.py, node2.py, node3.py. These python files simulate individual nodes in token ring

How to run this code:

Secnario:

  1. Single election:

run node4.py, node1.py, node2.py, node3.py in this order. Look at the output's of node 4. You will see token been passed at high speed. Than close the node 4 program. You will see leader election take place. You will see node 3 become the leader. Than again start node 4, you will see node 4 start election and leader election take place.

  1. Multiple election:

Please go to node 2 and comment the timeout from 21. Uncomment command for timeout for 15. Without this multiple election won't work. Run node4.py, node1.py, node2.py, node3.py in this order. Look at the output's of node 4. You will see token been passed at high speed. Than close the node 4 program. You will see leader election take place by both node 1 and node 2. You will see node 3 become the leader. Than again start node 4, you will see node 4 start election and leader election take place.

token_ring_algorithm_python3.6's People

Contributors

gauravkolekar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.