Securing Iot Networks Using Formal Behavioral Modeling And Dynamic Flow Management