Flow-level state transition as a new switch primitive for SDN