Failsafe Distributed Algorithms for Routing in Communication Networks