1. A method for processing a packet in a software-defined network (SDN), wherein the method is performed by a forwarder, and the method comprises: receiving an input packet; determining a flow to which the input packet belongs according to the input packet; determining a context identifier set corresponding to the flow to which the input packet belongs according to a first correspondence between flows and context identifier sets, wherein a context identifier set corresponding to each flow in the first correspondence comprises at least one context identifier; determining a context corresponding to the context identifier set according to a second correspondence between context identifiers and contexts; and processing the input packet according to the context corresponding to the context identifier set.