This is literally what IPFS (InterPlanetary File System) http://ipfs.io/ was created to solve.
Apart from that IPFS is built and layered in a way that makes the application layer independent of transport semantics - the network in terms of connections and hosts is abstracted away.