Architetture Distribuite per il Cloud (ADC) @ Università degli Studi di Salerno

Table of contents


Online labs organization


Design your solution

Projects must be developed using Java languages (also, using Apache Maven as software project management) and TomP2P framework/library. TomP2P is a DHT with additional features, such as storing multiple values for a key. Each peer has a table (either disk-based or memory-based) to keep its values. A single value can be queried/updated with a secondary key. The underlying communication framework uses Java NIO to handle many concurrent connections.


Evaluation criteria

Homework are evaluated on a range of 30 total points. The final score is diveded in four level:


Homework list

Each homework is presented with a Java interface API that must be implemented by a solution (the API is available in the folder challenges).

Five projects to be developed on a P2P Network:

  1. Anonymous Chat
  2. Git Protocol
  3. Auction Mechanism
  4. Sudoku Game
  5. Semantics Harmony Social Network

Each project must also be deployed on a Docker container that allows the users to execute the application peer quickly. The application parameters can be easily managed using the Docker environment variables. The project must provide a command-line interface that exploits all functionalities developed and tested.

$ docker run -i -e MASTERIP="" -e ID=0 homework-docker --name MASTER-PEER
$ docker run -i -e MASTERIP="" -e ID=1 homework-docker --name GENERIC-PEER

Homework Descriptions

1 Anonymous Chat


Design and develop an anonymous chat API based on P2P Network. Each peer can send messages on a public chat room in an anonymous way. The system allows the users to create a new room, join in a room, leave a room, and send messages. As described in the AnonymousChat Java API.








2 Git Protocol


Design and develop the Git protocol, distributed versioning control on a P2P network. Each peer can manage its projects (a set of files) using the Git protocol (a minimal version). The system allows the users to create a new repository in a specific folder, add new files to be tracked by the system, apply the changing on the local repository (commit function), push the network’s changes, and pull the changing from the network. The git protocol has lot-specific behavior to manage the conflicts; in this version, it is only required that if there are some conflicts, the systems can download the remote copy, and the merge is manually done. As described in the GitProtocol Java API.





3 Auction Mechanism


Design and develop an auction mechanism based on P2P Network. Each peer can sell and buy goods using second-price Auctions (eBay). Second-price auction is a non-truthful auction mechanism for multiple items. Each bidder places a bid. The highest bidder gets the first slot, the second-highest, the second slot, and so on, but the highest bidder pays the price bid by the second-highest bidder, the second-highest pays the price bid by the third-highest, and so on. The systems allow the users to create new auction (with an ending time, a reserved selling price, and a description), check the status of an auction, and eventually place a new bid for an auction. As described in the AuctionMechanism Java API.




4 Sudoku Game


Design and develop a Sudoku challenge game on a P2P network. Each user can place a number of the sudoku game; if it is not already placed takes 1 point, if it is already placed and it is rights take 0 points, in other case receive -1 point. The games are based on a 9 x 9 matrix. All users that play to a game are automatically informed when a user increment its score and when the game is finished. The system allows the users to generate (automatically) a new Sudoku challenge identified by a name, join in a challenge using a nickname, get the integer matrix describing the Sudoku challenge, and place a solution number. As described in the SudokuGame Java API.




5 Semantic Harmony Social Network


Design and develop a social network based on the user’s interests that exploits a P2P Network. The system collects the profiles of the users and automatically creates friendships according to a matching strategy. The users can see their friends over time and are automatically informed when a user enters the social network and becomes a new potential friend. The system defines a set of questions, for instance, if the user like or not like a set of photos, a set of a hashtag, or more accurate as Big Five Personality Test. At this point, the system can compute the user scoring according to the answers. This scoring is elaborated by a matching strategy that automatically finds out the friends. Consider, for instance, a binary answers vector; a matching process should be the difference in 0 and 1, or the Hamming distance, and so on. The system allows the users to see the social network questions, create a profile score according to the answer, join in the network using a nickname, and eventually see all user friends. As described in the SemanticHarmonySocialNetwork Java API.




Develop your solution (Java dependencies)

Using Maven, you can add the dependencies to TomP2P in the pom.xml file. For more details, please look at the example project.


Give me Homework now!

Compute the MD5 of your carminespagnuolo,namesurname md5(namesurname-D), where namesurname is your Name and Surname concatenation, and D is birthday day (only the first number 01/01/2020).

Character Value
a-g-m-s-y-f-4 1
b-h-n-t-z-l-5 2
c-i-o-u-r-0-6 3
d-j-p-v-x-1-7 4
e-k-q-w-3-2-8-9 5

Example Team Wonderland, team member Alice your assignment is wonderlandalice31, md5(wonderlandalice-31)=cce384455fc37671fb467c3f5d43e560, that is solve the Auction Mechanism.

⚠️ Homework Submission

Homework TIPS 🎳

Solutions must be a Java Maven project that implements the problem API and includes, at minimum, one test case written using JUnit (unit test case for Java). Each project must consist of a README file, written in Markdown, in the project’s root. The README describes the faced project, briefly the project solution, and eventually test cases.

The test case must instantiate the network (with a minimum of four peers) and simulates all operations described in the problem description. Solutions that fail the test cases or do not test all features are considered NOT CORRECT and are evaluated, considering that they cannot have the maximum score.

↑ Back to Index ↑