Class-based traffic recovery with load balancing in software-defined networks