Resource Optimization in Support of IoT Applications