P4 edge node enabling stateful traffic engineering and cyber security