PeerSim: A Peer-to-Peer Simulator

[Introduction] [People] [Download] [Documentation] [Publications] [Peersim Extras] [Additional Code]

Introduction top

Peer-to-peer systems can be of a very large scale such as millions of nodes, which typically join and leave continously. These properties are very challenging to deal with. Evaluating a new protocol in a real environment, especially in its early stages of development, is not feasible.

PeerSim has been developed with extreme scalability and support for dynamicity in mind. We use it in our everyday research and chose to release it to the public under the GPL open source license. It is written in Java and it is composed of two simulation engines, a simplified (cycle-based) one and and event driven one. The engines are supported by many simple, extendable, and pluggable components, with a flexible configuration mechanism.

The cycle-based engine, to allow for scalability, uses some simplifying assumptions, such as ignoring the details of the transport layer in the communication protocol stack. The event-based engine is less efficient but more realistic. Among other things, it supports transport layer simulation as well. In addition, cycle-based protocols can be run by the event-based engine too.

PeerSim started under EU projects BISON and DELIS DELIS. The PeerSim development in Trento (Alberto Montresor, Gian Paolo Jesi) is now partially supported by the Napa-Wine project.

People top

The main developers of PeerSim are:

Márk Jelasity, Alberto Montresor,

Gian Paolo Jesi, Spyros Voulgaris

Other contributors and testers (in alphabetical order):

Download top

The project is hosted at The source, the compiled version and other material can be downloaded from the PeerSim project page.

If you want to be kept informed about new release of PeerSim, join the mailing list. The list is moderated and extremely low-traffic.

Documentation top

Available documentation:

Publications top

Several publications have been written with the help of Peersim. At this point, the large majority of them have not been written by us. You can find an uncomplete list here. If you want to add your paper to this list, or suggest a correction, please send a mail to Alberto Montresor.

If you write a paper using peersim, please use the following citation:

--- bibtex ---

	Author = {Alberto Montresor and M\'{a}rk Jelasity},
	Title = {{PeerSim}: A Scalable {P2P} Simulator},
	Booktitle = {Proc. of the 9th Int. Conference on Peer-to-Peer (P2P'09)},
	Year = {2009},
	Month = sep,
	Pages = {99-100},
	Address = {Seattle, WA},

--- plain latex ---

Alberto Montresor and M\'{a}rk Jelasity.
\newblock PeerSim: A scalable P2P simulator.
\newblock In {\em Proc. of the 9th Int. Conference on Peer-to-Peer (P2P'09)},
  pages 99--100. Seattle, WA, September 2009.

--- resulting text ----

Alberto Montresor and Mark Jelasity. PeerSim: A scalable P2P simulator. In Proc. of the 9th Int. Conference on Peer-to-Peer (P2P’09), pages 99–100. Seattle, WA, September 2009.

Peersim Extras top

Peersim cannot grow forever. Still, each of us has developed a lot of additional code that could be useful to somebody else. To avoid to "bloat" Peersim, we have decided to create the Peersim Extras repository for code that (i) has not reached the maturity required to be included in Peersim, or (ii) is too specific for the mainstream Peersim.

Peersim Extras' CVS repository can be checked out through anonymous (pserver) CVS with the following instruction set. The module is extras. When prompted for a password for anonymous, simply press the Enter key.

cvs login

cvs -z3 co -P extras
User code top

The following table page contains additional packages developed by Peersim users for their research. We provide them "as it is": please refer to the maintainers names and addresses listed below for further information and support.

If you are interested in advertise your Peersim code, please write to Gian Paolo Jesi ( providing a short description, a link to your code and your name and address. If your code has been used to write a scientific publication, please provide also a link to it and make sure that the result of your publications can be reproduced with the configuration files contained in your code.

Description Code Maintainer
Bandwidth management protocol
The bandwidth aware protocol provides a simple implementation of the priority sharing bandwidth allocation which serves transmissions using FIFO policies, reserving as much resources as possibile for each connection. This module was developed by Alessandro Russo (DISI - University of Trento) under the European project Napa-Wine.
bandwidth-module.tar.gz Alessandro Russo (
A fault-tolerant FSM
An implementation of a fault-tolerant finite state machine based on basic Paxos consensus protocol. Lab assignment for the Computer Networks course at the University of Bologna.
abcast.tar.gz Leonardo D'Alonzo (
An implementation of the Symphony protocol for Peersim. Lab assignment for the Peer-to-Peer Systems course at the University of Pisa. Andrea Esposito (
An implementation of the Pastry protocol for Peersim. Lab assignment for the Distributed Systems course at the University of Trento.
pastry.tar.gz Manuel Cortella (
An implementation of the Chord protocol for Peersim. Lab assignment for the Distributed Systems course at the University of Trento.
chord.tar.gz Andrea Presa (
An implementation of the Kademlia protocol for Peersim. Lab assignment for the Distributed Systems course at the University of Trento. Daniele Furlan ( Maurizio Bonani (
An implementation of the Skipnet protocol for Peersim. Lab assignment for the Distributed Systems course at the University of Trento.
skipnet.tar.gz Rodolfo Cartas Ayala (
An implementation of the BitTorrent protocol for Peersim. Lab assignment for the Distributed Systems course at the University of Trento.
bittorrent.tar.gz Fabrizio Frioli, Michele Pedrolli
Aggregation is a collective term for a set of functions aimed at providing statistical information over distributed systems, such as the average load of the nodes or the size of the network. We have developed extremely scalable, robust and decentralized aggregation protocols, described in:

Márk Jelasity, Alberto Montresor, and Ozalp Babaoglu. Gossip-based aggregation in large dynamic networks. ACM Trans. Comput. Syst., 23(1):219-252, August 2005. [PDF], [Bibtex].

Alberto Montresor and Ali Ghodsi. Towards robust peer counting.  In Proceedings of the 9th P2P Conference, Seattle, WA, September 2009.
Alberto Montresor (
A protocol for self-organizing and maintaining a superpeer-based topology.

Alberto Montresor. A Robust Protocol for Building Superpeer Overlay Topologies. In Proceedings of the 4th International Conference on Peer-to-Peer Computing, Zurich, Switzerland, August 2004. IEEE. [PDF], [Bibtex]. Alberto Montresor (
Peer sampling service
We introduced the peer sampling service, that can be used as a source of random peers by participating peers. We performed extensive experiments on several gossip based implementations of the service.

Márk Jelasity, Rachid Guerraoui, Anne-Marie Kermarrec, and Maarten van Steen. The peer sampling service: Experimental evaluation of unstructured gossip-based implementations. In Hans-Arno Jacobsen, editor, Middleware 2004, volume 3231 of Lecture Notes in Computer Science, pages 79-98. Springer-Verlag, 2004. [PDF]

middleware04-exp.tar.gz Márk Jelasity (
The T-Man protocol can be used to build a wide range of different topologies using only a ranking function that defines the preference of each node for neighbors. The most recent results have been published here:

Márk Jelasity, Alberto Montresor, and Ozalp Babaoglu. T-Man: Gossip-based fast overlay topology construction. Computer Networks, 53 (13):2321–2339, 2009. [PDF] Alberto Montresor (
The PdProtocol plays the Prisoner Dilemma between nodes in a network to achieve cooperation. It is based on a socially inspired mechanism (based on "tags") applied to P2P networks.

Andrea Marcozzi, David Hales, Gian Paolo Jesi, Stefano Arteconi, Ozalp Babaoglu. Tag-Based Cooperation in Peer-to-Peer Networks with Newscast. Technical Report UBLCS-2005-15, University of Bologna, Department of Computer Science, Bologna, Italy, June 2005. [PDF]

pdprotocol.tgz Stefano Arteconi (
This protocol generates a cooperative artificial social network (ASN) in a P2P overlay. Its related papers are the following:
  • David Hales and Stefano Arteconi. SLACER: A Self-Organizing Protocol for Coordination in Peer-to-Peer Networks. IEEE Intelligent Systems, vol. 21, no. 2, pp. 29-35, Mar./Apr. 2006.
  • David Hales and Stefano Arteconi. Friends for Free: Self-Organizing Artificial Social Networks for Trust and Cooperation. Technical Report UBLCS-2005-20, University of Bologna, Department of Computer Science, Bologna, Italy, 2005. [PDF]
slacer.tgz Stefano Arteconi (
Artificial Social Network (ASN) algorithms
Additional algorithms regarding ASN inspired algorithms (PD + Greedy Cheating Liars, Weakest link, and Broadcast) are analyzed and discussed in the following technical reports:
  • Stefano Arteconi and David Hales. Greedy Cheating Liars and the Fools Who Believe Them. Technical Report UBLCS-2005-21, University of Bologna, Department of Computer Science, Bologna, Italy, December 2005. [PDF]
  • Giovanni Rossi, Stefano Arteconi and David Hales. Evolving Networks for Social Optima in the "Weakest Link Game". Technical Report UBLCS-2006-21, University of Bologna, Department of Computer Science, Bologna, Italy, July 2006. [PDF]
  • Stefano Arteconi and David Hales. Broadcasting at the Critical Threshold. Technical Report UBLCS-2006-22, University of Bologna, Department of Computer Science, Bologna, Italy, October 2006. [PDF]
GCL-weakestLink-bcast.tgz Stefano Arteconi (
ResourceWorld, SkillWorld
Protocols claiming to produce emergent social rationality in peer-to-peer networks.

Andrea Marcozzi and David Hales. Emergent Social Rationality in a Peer-to-Peer System. Technical Report UBLCS-2006-23, University of Bologna, Department of Computer Science, Bologna, Italy, October 2006. [PDF]

RwSw.tgz Andrea Marcozzi (
The FirmNet protocol promotes the allocation of tasks in a knowledge-based economy model.

Edoardo Mollona and Andrea Marcozzi. FirmNet: The Scope of Firms and the Allocation of Task in a Knowledge-Based Economy. Technical Report UBLCS-2006-22, University of Bologna, Department of Computer Science, Bologna, Italy, November 2006. [PDF]

Fn.tgz Andrea Marcozzi (
Cloudcast is message diffusion protocol that extends a cloud computing environment with a peer-to-peer network.

Alberto Montresor and Luca Abeni Cloudy Weather for P2P, with a Chance of Gossip. In Proceedings of the 11th IEEE Conference on P2P Computing, P2P'11, Kyoto, Japan, August 2011. [PDF] Alberto Montresor (
Adam2 is a gossip protocol that accurately and efficiently approximates distributions (CDFs) of generic node attributes in large-scale decentralised systems.

Jan Sacha, Jeff Napper, Corina Stratan, and Guillaume Pierre. Adam2: Reliable Distribution Estimation in Decentralised Environments In proceedings of the 30th IEEE International Conference on Distributed Computing Systems (ICDCS'10), pages 697-707, 2010. [PDF]

Adam2.tar.gz Jan Sacha (
Some experimentations in the field of P2P, distributed function optimization.

Marco Biazzini, Alberto Montresor and Mauro Brunato. Towards a decentralized architecture for optimization. In Proc. of the 22nd IEEE Int. Parallel and Distributed Processing Symposium (IPDPS'08). Miami, FL, USA, April 2008. [PDF] Alberto Montresor (
AREN Bandwidth Manager provides a lightweight and accurate fair-sharing of bandwidth and rate control enforcement. We assume a simple approach that does not reproduce in-depth transport protocol behavior. Instead, our design focuses in reducing the inherent impact on the overall simulation scalability as bandwidth scheduling accuracy is improved. We have studied the scalability and bandwidth scheduling accuracy of four scheduling approaches, namely the simplest, lock-based, packet or slot-based, and connection-oriented bandwidth scheduler. We have verified that a connection-oriented approach allows us to (i) improve considerably the accuracy of fair bandwidth sharing, and (ii) implement a rate control mechanism properly.
  • Guthemberg Silvestre, Sébastien Monnet, David Buffoni,and Pierre Sens. Predicting Popularity and Adapting Replication of Internet Videos for High-Quality Delivery. In Proc. of the IEEE 19th International Conference on Parallel and Distributed Systems (ICPADS 2013) - Seoul, South Korea - December 2013. [PDF]
  • Guthemberg Silvestre, Sébastien Monnet, Ruby Krishnaswamy,and Pierre Sens. AREN: a popularity-aware replication scheme for cloud storage. In Proc. of the IEEE 18th International Conference on Parallel and Distributed Systems (ICPADS 2012) - Singapore - December 2012. [PDF]
  • Guthemberg Silvestre and Sébastien Monnet. Performing accurate simulations for deadline-aware applications. In Proc. of the 4th International Workshop on Modeling and Simulation of Peer-to-Peer and Autonomic Systems (MOSPAS), as part of The International Conference on High Performance Computing & Simulation (HPCS 2013) - Helsinki, Finland - July 2013. [PDF]
  • Guthemberg Silvestre, Sébastien Monnet, Ruby Krishnaswamy,and Pierre Sens. Caju: a content distribution system for edge networks. In Proc. of BDMC/Euro-Par 2012: Parallel Processing Workshops - Rhodes Island, Greece - August 2012. [PDF]
AREN [Git repository] Guthemberg Silvestre (
GAP and LiMoSense
For the paper cited below we implemented existing protocols including GAP (a self-healing tree overlay) and LiMoSense (a robust gossip protocol). The experimental results in the paper used these implementations.
  • Lehel Nyers and Márk Jelasity. Spanning tree or gossip for aggregation: A comparative study. In Fernando Silva, Inês Dutra, and Vítor Santos Costa, editors, Euro-Par 2014, number 8632 in Lecture Notes in Computer Science. Springer-Verlag, 2014. [PDF]
lehurament.tar.gz Lehel Nyers (
An implementation of the GOSSIPICO algorithm for Peersim as described in:
  • Ruud van de Bovenkamp, Fernando Kuipers and Piet Van Mieghem. Gossip-Based Counting in Dynamic Networks. In Proceedings of the 11th International IFIP TC 6 Conference on Networking - Volume Part II, Prague, Czech Republic, 2012.
Lab assignment for the P2P course of the university of Pisa.
GOSSIPICO [Git repository] Nicola Corti (
The features of intra-organizational networks of collaboration are emergent properties of employees’ individual choices of collaboration but firms may shape the networks by calibrating the features of interaction among co-workers. COPNET protocol describes employees’ individual micro-processes of effort reciprocation and co-workers’ matching. Role of organization is calibrate the continuity of association among colleagues and their freedom to rewire, that is, the freedom that employees have in unilaterally terminating specific dyadic relationships.
COPNET Stefano Ferriani ( Edoardo Mollona (
A Wi-Fi Direct simulator on top of PeerSim. The model of the simulator, its general architecture and evaluation results are described in:
  • Luciano Baresi, Naser Derakhshan and Sam Guinea. WiDiSi: A Wi-Fi direct simulator study. In Proc. of the 14th IEEE Wireless Communications and Networking Conference (WCNC 2016) - Doha, Qatar - April, 2016 [LINK]
WiDiSi Naser Derakhshan (
A novel Chord protocol implementation for Peersim. Two distinct brances are available:
  • local: calls are done locally by directly calling the method on the target object. This is similar to the Chord version already available for Peersim, but it is much easier to follow and similar to the pseudo-code from the original Chord paper.
  • master: calls are done through the simulator 'transport.send()' calls and the asynchronous nature of the protocol is more realistic.
ChordSim Genc Tato (

Valid XHTML 1.0 Strict Valid CSS! Get peersim at Fast, secure and Free Open Source software downloads Page maintenance: Gian Paolo Jesi (
Last update: Sun Nov 27 11:40:21 CET 2016