Nodes can exchange the list of known neighbors with a particular protocol and create a network of nodes.
Also, nodes can send requested files to the other nodes.
About
simple p2p file transfer protocol - project of computer network course - spring 2020