Protocol-level attacks and defenses to advance IoT security