p4 state diagram