complete implementation of ESP routing based on configuration.