Everything that has to be adapted in the code has a # Fill in
in the same line
- Berkeley
- Chord System
- Crypto System
- Diffie Hellman
- Greedy Server Placement
- Lamport's Logical Clocks
- Read Write Quorums
- Vector Clock
The Berkeley algorithm is a method of clock synchronisation in distributed computing which assumes no machine has an accurate time source.
Every time has to be typed in the following format: 3:30pm = 1530 | 11:20am 1120
- Start the Berkeley.py program
- First type in how many servers exist
- Secondly type in the time for each server using the right time format explained above
- Thirdly type in which server should be the time daemon
(Source: ResearchGate)
In computing, Chord is a protocol and algorithm for a peer-to-peer distributed hash table. A distributed hash table stores key-value pairs by assigning keys to different computers (known as "nodes"); a node will store the values for all the keys for which it is responsible. Chord specifies how keys are assigned to nodes, and how a node can discover the value for a given key by first locating the node responsible for that key.
- Start the ChordSystem.py program
- First you have to type in the amount of nodes which is saved in "nodes_length" (In the given Example it would be 32)
- Secondly you have to add the "bid_id" which is the bit identifier (In the given example it is represented by the length of each finger table which is 5)
- The first two steps are to create a working Chord System, however if you want to find a path from one node to another with a key the next two steps have to be typed in as well (If you don't want to create a path just let the "start_node" and "key" free by just pressing enter)
- If you want to create a path just type in the "start_node" and the "key" (In the given example one case would be k=12 and start_node=28
(Source: Reddit)
This Crypto System is just to send and receive messages from A(Sender) to B(Receiver), which consists of 3 factors:
- Confidentiality
- Authenticity
- Integrity
- Start the DiffieHellman.py program
- Type in the Public Key of A = ka_pu
- Type in the Private Key of A = ka_pr
- Type in the Modules of A = na
- Type in the Public Key of B = kb_pu
- Type in the Private Key of B = kb_pr
- Type in the Modules of B = nb
- Type in the Message = m
- Type in the Hash function value = h
(Source: eduCBA)
Diffie–Hellman key exchange is a mathematical method of securely exchanging cryptographic keys over a public channel and was one of the first public-key protocols as conceived.
- Start the DiffieHellman.py program
- Type in the modulo value n (in the example n is P)
- Type in the base value g
- Type in the a value
- Type in the b value
(Source: Research Gate)
- Fill in each column in the options array (would look like this related to given example: [[1, 10, 10], [10, 5, 3], [10, 6, 5]])
- Start the GreedyServerPlacement.py program
The Lamport timestamp algorithm is a simple logical clock algorithm used to determine the order of events in a distributed computer system. As different nodes or processes will typically not be perfectly synchronized, this algorithm is used to provide a partial ordering of events with minimal overhead, and conceptually provide a starting point for the more advanced vector clock method.
- The first step is to fill in all messages by adapting the "messages" array in the LamportsLogicalClocks.py file (In the given example it would look like this messages = [[1,2,2],[2,3,3],[2,1,6],[3,2,7]])
- case: [1,2,2]
- The first number represents from which processor we are sending the message, the range is 1-processors, which in this case is P1(1)
- The second number represents to which processor we are sending the message, the range is 1-processors, which in this case is P2(2)
- The third number represents the row we are sending the number from the first given process, which in this case is 2
- Start the LamportsLogicalClocks.py program
- First you have to type in the amount of processors existing, which in this case would be 3
- Secondly you have to type in the amount of rows existing, which in this case would be 9
- Lastly just type in the number sequences for each processor, which in this case would be 5,8,10
(Source: Thomas Wiki)
Read-write quorums define two configurable parameters, R and W. R is the minimum number of nodes that must participate in a read operation, and W the minimum number of nodes that must participate in a write operation. There are 2 main rules included in the system:
- It is a read quorum (read is important)
- The read part is 1 and the write part is n
- Otherwise
- The write part is calculated as following: random number between n/2 && n
- The read part is calculated as following: random number between n - writeQuorum + 1 && n
- Start the ReadWriteQuorums.py program
- First enter the amount of numbers existing which is represented in the variable n, which in the example would be 12
- Secondly type in "1" if reading is important, if not just type in any other value
(Source: Lass)
A vector clock is a data structure used for determining the partial ordering of events in a distributed system and detecting causality violations. Just as in Lamport timestamps, inter-process messages contain the state of the sending process's logical clock.
- Change the start values ("vectors" array), if they differ from yours or add more array entries to the list if you have more than 3 vector clocks
- Fill in the "task_list" array
- Example for the given provided resource below: task_list = [["13", "2"], ["32"], ["21", "3"], ["31"]]
- Each entry in the array is one time step and each time step has a list of execution commands, which are either an increment(one number) or a message(two numbers)
- If you want to add a message in the time step then the first number is from which clock to which clock, both from and to are in the range of 1-(amount of vectorClocks)
- If you want to add an e step which is an increment you just have to add the specific vector clock which starts from 1 upwards
- Start the VectorClock.py program