sort udp and tcp rules