Network partitioning for scalable routing