This chapter covers
- Introduction to peer-to-peer networks
- Understanding the core architecture of libp2p networking
- Exchanging ping commands between peer nodes
- Discovering peers in a p2p network
In the previous chapter we covered the basics of async programming in general, and how to write async code with Rust. In this chapter we’ll build a few simple examples of p2p applications using a low-level P2P networking library and asynchronous programming using Rust.
But why learn about P2P?
P2P is a networking technology that enables sharing of various computing resources such as CPU, network bandwidth and storage across different computers. P2P is today a very commonly used method for sharing files (such as music, images and other digital media) between users online. Bittorrent and Gnutella are examples of popular file sharing p2p apps. They do not rely on a central server or an intermediary to connect multiple clients. And most importantly, they make use of users' computers as both clients and servers, thus offloading computations away from a central server. How do p2p networks operate and how are they different?
Let’s delve into the foundational concepts behind peer-to-peer networks.