Learning by gossip: a principled information exchange model in social networks