150 likes | 314 Views
Peer-to-peer project . Distributed Scorched Earth . System architecture . Focus has been on creating a distributed and safe scorched earth game. Build on structured network FreePastry Uses Scribe to handle games (topics) Messages are send by multicast or unicast. . Goals.
E N D
Peer-to-peer project Distributed Scorched Earth
System architecture • Focus has been on creating a distributed and safe scorched earth game. • Build on structured network • FreePastry • Uses Scribe to handle games (topics) • Messages are send by multicast or unicast.
Goals • Possible to join and leave a game. • Agree on a random generated number. • Agree on the order of the list of Peers in the game and thereby also the player in turn. • Cheating should not be possible. • Accuse peers that are cheating • Replay attacks, changing messages,
Achieved goals • Possible to join and leave a game. • But you have to know the name of the game in order to join it. • You leave either by cheating or closing the window. • Agree on a random generated number.
Dist. Random Number Generator • 1. The root generates a random number, hashes it and sends the hash: p1 p2 h(x0) h(x0) p0 p3 h(x0)
Dist. Random Number Generator • 2. All other peers generate a number and sends the hash to the root: p1 p2 h(x1) h(x2) p0 p3 h(x3)
Dist. Random Number Generator • 3. When the root receives all hashes it sends out all the hashes to all the other peers p1 p2 h(x1),…,h(xn) h(x1),…,h(xn) p0 p3 h(x1),…,h(xn)
Dist. Random Number Generator • 4. When a peer has recieved all the hashes, it sends back the random number that it generated p1 p2 x1 x2 p0 p3 x3
Dist. Random Number Generator • 5. The root verifies all the numbers and sends out the numbers to all the peers. It also calculates the seed using a XOR on all the numbers. p1 p2 x0,…,xn x0,…,xn p0 p3 x0,…,xn
Dist. Random Number Generator • 6. When a peer receives the numbers from the root it verifies them and calculates the seed using XOR. The seed is send back to the root. p1 p2 s1 s2 p0 p3 s3
Dist. Random Number Generator • 7. The root checks that all the seeds match and sends out it own seed to the other peers. When the peers receive the last seed they check that it matches their own seed. p1 p2 s0 s0 p0 p3 s0
Achieved goals • Agree on the order of the list of Peers in the game and thereby also the player in turn. • Sorts the list by using the random generated number as a seed. • Shoots are multicasted to everyone in the game. • Thereby all peer have the same game state and know the new player in turn.
Achieved goals • Cheating should not be possible. • We protect against: • Message changing by using a Public key infrastructure (PKI) • All messages are signed using a private key. • Peers that send a shoot message when not in turn, will get accused. • Not protected against: • No guarantee that a message is received. (could be solved by using secure acknowledgement of multicast messages) • Replay attacks
Future work • Make it easier to find a game. • e.g. by creating a game topic. This will require the use of PAST to keep a game state, and store a list of available games. • Keeping record of scores • e.g. by using PAST. • Handle all security issues. • Replay attacks • Guarantee that a message is received.