A unified approach for fault-tolerance in communication protocols