This article presents an architecture for research and development of peer-to-peer (P2P) systems. A complete P2P application has to cope with problems such as NAT-traversal, bootstrapping, connection management, routing, storage, and security. Therefore, our approach separates the system into layers and components. A developer can easily build a complete P2P stack by plugging layers and components together, which allows for easy code reuse and interchangeability. Furthermore, our architecture allows us to run a discrete event simulation by using a special programming model. This way we can use the same code base for productive applications as well as for measurements & tests on a compute cluster. Our evaluation shows that using our architecture has a negligible effect on performance and a very small memory footprint, which allows us to simulate thousands of peer instances running the real application code on a single machine.