A method for processing a packet in a network, wherein the network comprises a resource manager, a forwarding device, and multiple controllers, the forwarding device is separately connected to the resource manager and the multiple controllers, and the method comprises: receiving by the forwarding device, a virtual device creation message from the resource manager, wherein the virtual device creation message carries a controller identifier and resource information about an allocated resource; and creating, by the forwarding device, on the forwarding device according to the resource information, a virtual device for a controller identified in the virtual device creation message; creating, by the forwarding device, a flow table in the corresponding virtual device according to a flow table creation message from the controller; and storing a correspondence between a first identifier of a to-be-created flow table that is carried in the flow table creation message and a second identifier of the flow table that is created on the forwarding device according to the flow table creation message, wherein the second identifier is used to uniquely identify the created flow table on the forwarding device; receiving, by the forwarding device, a flow entry creation message from the controller, wherein the flow entry creation message carries a to-be-created flow entry and the first identifier of the flow table that is to store the flow entry; and obtaining, according to the correspondence, the second identifier corresponding to the first identifier, and storing the flow entry in the flow table corresponding to the obtained second identifier; and receiving, by the forwarding device, a data packet, performing matching for the data packet by using a preset packet identification rule, to obtain the first identifier of the flow table for processing the data packet, obtaining, from the correspondence, the second identifier corresponding to the first identifier, and processing the data packet according to the flow entry in the flow table corresponding to the second identifier. receiving by the forwarding device, a virtual device creation message from the resource manager, wherein the virtual device creation message carries a controller identifier and resource information about an allocated resource; and creating, by the forwarding device, on the forwarding device according to the resource information, a virtual device for a controller identified in the virtual device creation message; creating, by the forwarding device, a flow table in the corresponding virtual device according to a flow table creation message from the controller; and storing a correspondence between a first identifier of a to-be-created flow table that is carried in the flow table creation message and a second identifier of the flow table that is created on the forwarding device according to the flow table creation message, wherein the second identifier is used to uniquely identify the created flow table on the forwarding device; receiving, by the forwarding device, a flow entry creation message from the controller, wherein the flow entry creation message carries a to-be-created flow entry and the first identifier of the flow table that is to store the flow entry; and obtaining, according to the correspondence, the second identifier corresponding to the first identifier, and storing the flow entry in the flow table corresponding to the obtained second identifier; and receiving, by the forwarding device, a data packet, performing matching for the data packet by using a preset packet identification rule, to obtain the first identifier of the flow table for processing the data packet, obtaining, from the correspondence, the second identifier corresponding to the first identifier, and processing the data packet according to the flow entry in the flow table corresponding to the second identifier.