Code Monkey home page Code Monkey logo

simulation-of-berkley-s-algorithm-and-lamport-clocks's Introduction

Simulation-of-Berkley-s-Algorithm-and-Lamport-Clocks

To create a distributed simulation using the principles of clock consistency, drifts and inter-process communication based on the concept of Lamport clocks and Berkeley Algorithm. The interprocess communication will take place using the java RMI.

Content:

simulation.java
master.java
process.java
message.java
RMIInterface.java
policy
Makefile
Report
readme

  1. Clone or download the folder

  2. Open an instance of putty on all the machines listed below and run the commands
    • in-csci-rrpc01.cs.iupui.edu - 10.234.136.55
    • in-csci-rrpc02.cs.iupui.edu - 10.234.136.56
    • in-csci-rrpc03.cs.iupui.edu - 10.234.136.57
    • in-csci-rrpc04.cs.iupui.edu - 10.234.136.58
    • in-csci-rrpc05.cs.iupui.edu - 10.234.136.59

  3. On any one machine, Run make file command: make

  4. Running the RMI Registry and running the processes and master.
    a. Run the RMI Registry in the background - this will run at the set port(4444): (Do this on all the machines) command: rmiregistry 4444&

    b. Start processes and master
    Process 1 -- machine 1 (in-csci-rrpc01.cs.iupui.edu - 10.234.136.55)
    command: java -Djava.security.policy=policy Simulation 1 1

    Process 2 -- machine 2 (in-csci-rrpc02.cs.iupui.edu - 10.234.136.56)
    command: java -Djava.security.policy=policy Simulation 1 2

    Process 3 -- machine 3 (in-csci-rrpc03.cs.iupui.edu - 10.234.136.57)
    command: java -Djava.security.policy=policy Simulation 1 3

    Process 4 -- machine 4 (in-csci-rrpc04.cs.iupui.edu - 10.234.136.58)
    command: java -Djava.security.policy=policy Simulation 1 4

    Master -- machine 5 (in-csci-rrpc05.cs.iupui.edu - 10.234.136.59)
    command: java -Djava.security.policy=policy Simulation 0 5

    Note: Here arg[0] '0' -- master '1' -- process and the int values arg[1] are unique id's associated to the object types. Please make sure you enter correct commands to avoid unnecessary exceptions
    Do step c after completing step b for all the machines

    c. It will ask you "Do you wish to connect to all the processes and master?
    1. yes
    2. no"
    (Do this on all the machines)
    Enter : 1

  5. To clean up i.e. clear the port number by killing the rmiregistry command: fg

Note: There will be multiple output statements. It will show you the message being send and received and the process id's associated with it. You can comment the output statements.

In case, the port number 4444 is blocked or under use by somebody else. Please change the port number.

The process might look like it's slow, this is because I have added sleep(500) at intervals

simulation-of-berkley-s-algorithm-and-lamport-clocks's People

Contributors

anushkaaaa 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.