Ideally peer-based but I know federation is much more popular and that can work also.
But it's not just the fact that they leverage open software to build their closed systems, it's the large networks and marketplaces they have. The only way to compete with that is through decentralized systems. Which (despite the connotation of the name), are the best approaches for creating large scale, open, holistic networks.
Moving to decentralized protocols also means it is harder to dominate with one piece of software. Ideally the protocols are in some kind of protocol registry so they can evolve freely.
But on some level I believe that some entity like a government needs to mandate this. Although I know there are many people who are philosophically against governments or practically against them due to their track record of being generally awful. But at some level you may have to force people to cooperate in some basic technical way in order to avoid the technopolies.