This course introduces methodologies and techniques for developing peer to peer systems. Both technolgies and formal tools for the development of these systems will be presented. Some existing systems like Bittorrent, Spotify, E-mule will be introduced. Some lessons will be devoted to the use of P2P systems in cloud environments with special reference to highly scalable data storages (e.g. Dynamo, Cassandra). In the final part of the course a set of scalable simulators for p2p systems will be presented.