The setup is this:
We have a group of computers that have public ip addresses assigned to them so that they can access the internet. these computers are connected together forming a pure (trackerless) peer-to-peer network.
My understanding of the public ip address system is that those addresses are not unique to each router meaning that a router can have an ip address today and have a totally different one tomorrow or in the next hour or maybe a week from now.
The problem is what happens if nodes in the network have had their public ip address changed to a new one while they were not connected to the network. how are these nodes supposed to rejoin the network?? should each node maintain a list of all the public ip addresses of the all the nodes in the network and try to open a connection to each one of theme?? if yes what if the network has a million nodes, what about timeouts if the ip address is still the same but the connection failed for some reason??
Another problem arises when all the nodes have had their ip addresses changed simultaneously. how are they supposed to reassemble the network without any working ip addresses??
it would be appreciated if you could recommend books, articles or videos that explain how peer-to-peer apps like trackerless file sharing apps function on a more technical level (Nat traversal, and initial bootstrapping to the distributed hash table).