A packet processing method, comprising: obtaining, by a first network device, identification information; processing, by the first network device, a packet when receiving the packet, wherein a processed packet comprises the identification information, and packets corresponding to different preset policy information comprise different identification information; and sending, by the first network device, the processed packet to a second network device, so that the second network device matches a corresponding policy for the processed packet based on the identification information, wherein the obtaining, by a first network device, the identification information comprises: sending, by the first network device, a request message to a controller; and receiving, by the first network device, the identification information sent by the controller, wherein the identification information is determined by the controller based on packet description information in the preset policy information after receiving the request message, the identification information corresponds to the packet description information in the preset policy information, and different packet description information corresponds to different identification information; and the processing, by the first network device, a packet when receiving the packet comprises: processing the packet if the packet conforms to the packet description information, wherein the processing the packet if the packet conforms to the packet description information comprises: processing the packet based on the identification information if the packet conforms to the packet description information and the packet is a packet that does not carry the identification information, wherein the processing the packet based on the identification information comprises: inserting, by the first network device, the identification information into a preset field of the packet. obtaining, by a first network device, identification information; processing, by the first network device, a packet when receiving the packet, wherein a processed packet comprises the identification information, and packets corresponding to different preset policy information comprise different identification information; and sending, by the first network device, the processed packet to a second network device, so that the second network device matches a corresponding policy for the processed packet based on the identification information, wherein the obtaining, by a first network device, the identification information comprises: sending, by the first network device, a request message to a controller; and receiving, by the first network device, the identification information sent by the controller, wherein the identification information is determined by the controller based on packet description information in the preset policy information after receiving the request message, the identification information corresponds to the packet description information in the preset policy information, and different packet description information corresponds to different identification information; and the processing, by the first network device, a packet when receiving the packet comprises: processing the packet if the packet conforms to the packet description information, sending, by the first network device, a request message to a controller; and receiving, by the first network device, the identification information sent by the controller, wherein the identification information is determined by the controller based on packet description information in the preset policy information after receiving the request message, the identification information corresponds to the packet description information in the preset policy information, and different packet description information corresponds to different identification information; and the processing, by the first network device, a packet when receiving the packet comprises: processing the packet if the packet conforms to the packet description information, wherein the processing the packet if the packet conforms to the packet description information comprises: processing the packet based on the identification information if the packet conforms to the packet description information and the packet is a packet that does not carry the identification information, wherein the processing the packet based on the identification information comprises: inserting, by the first network device, the identification information into a preset field of the packet.