Energy Efficient Distributed Processing for IoT