Randomized network coding in distributed storage systems with layered overlay