From Security to Localization: Advanced Services for Large-Scale IoT Networks