Optimizing a service provider network