Practical network-layer machine learning for IoT security