TCP and ICMP basic functionality, plus some cleanup