A scalable and self-configuring architecture for service discovery in the internet of things