Adaptive load balancing in packet processing
First Claim
1. A method of forwarding packets in a network device, the method comprising:
- receiving a packet at the network device, wherein the network device includes a plurality of packet processing threads;
assigning the packet to a first packet processing thread from the plurality of packet processing threads prior to adding the packet to a queue of the first packet processing thread, wherein each one of the plurality packet processing threads belongs to one of at least a normal pool of packet processing threads and a backlogged pool of packet processing threads;
determining a state of the first packet processing thread, wherein the state was set based on a monitoring of a length of the queue of the first packet processing thread, and wherein the state is determined to be one of a plurality of states including a backlogged state and a normal state and the state indicates which pool of packet processing threads the first packet processing thread belongs to;
responsive to determining that the state of the first packet processing thread is a normal state, performing the following;
adding, at the network device, the packet to the queue of the first packet processing thread, processing the packet in the first packet processing thread, andforwarding the packet; and
responsive to determining that the state of the first packet processing thread is a backlogged state, performing the following;
adding, at the network device, the packet to a queue of a second packet processing thread that is part of the backlogged pool of packet processing threads based on a load balancing scheme, wherein the backlogged pool of packet processing threads includes the first packet processing thread and a subset of packet processing threads from the plurality of packet processing threads, and the state of each one of the packet processing threads from the backlogged pool is the backlogged state,processing the packet in the second packet processing thread, andforwarding the packet according to a predetermined order, wherein the predetermined order is based on a position of the packet relative to positions of other packets at receipt of the packet and the other packets in the network device.
2 Assignments
0 Petitions
Accused Products
Abstract
A method of forwarding packets in a network device is disclosed. The method comprises assigning a packet to a first packet processing thread; and determining a state of the first packet processing thread. Responsive to determining that the state of the first packet processing thread is a backlogged state, mapping the packet to a second packet processing thread from a pool of packet processing threads based on a load balancing scheme, wherein the pool of packet processing threads includes a subset of threads from the plurality of packet processing threads, and the state of each one of the packet processing threads from the pool is the backlogged state, processing the packet in the second packet processing thread, and forwarding the packet according to a predetermined order that is based on a position of the packet relative to positions of other packets at their receipt in the network device.
18 Citations
19 Claims
-
1. A method of forwarding packets in a network device, the method comprising:
-
receiving a packet at the network device, wherein the network device includes a plurality of packet processing threads; assigning the packet to a first packet processing thread from the plurality of packet processing threads prior to adding the packet to a queue of the first packet processing thread, wherein each one of the plurality packet processing threads belongs to one of at least a normal pool of packet processing threads and a backlogged pool of packet processing threads; determining a state of the first packet processing thread, wherein the state was set based on a monitoring of a length of the queue of the first packet processing thread, and wherein the state is determined to be one of a plurality of states including a backlogged state and a normal state and the state indicates which pool of packet processing threads the first packet processing thread belongs to; responsive to determining that the state of the first packet processing thread is a normal state, performing the following; adding, at the network device, the packet to the queue of the first packet processing thread, processing the packet in the first packet processing thread, and forwarding the packet; and responsive to determining that the state of the first packet processing thread is a backlogged state, performing the following; adding, at the network device, the packet to a queue of a second packet processing thread that is part of the backlogged pool of packet processing threads based on a load balancing scheme, wherein the backlogged pool of packet processing threads includes the first packet processing thread and a subset of packet processing threads from the plurality of packet processing threads, and the state of each one of the packet processing threads from the backlogged pool is the backlogged state, processing the packet in the second packet processing thread, and forwarding the packet according to a predetermined order, wherein the predetermined order is based on a position of the packet relative to positions of other packets at receipt of the packet and the other packets in the network device. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A non-transitory machine-readable storage medium that provides instructions, which when executed by a processor of a network device, cause said processor to perform operations comprising:
-
receiving a packet at the network device, wherein the network device includes a plurality of packet processing threads; assigning the packet to a first packet processing thread from the plurality of packet processing threads prior to adding the packet to a queue of the first packet processing thread, wherein each one of the plurality packet processing threads belongs to one of at least a normal pool of packet processing threads and a backlogged pool of packet processing threads; determining a state of the first packet processing thread, wherein the state was set based on a monitoring of a length of the queue of the first packet processing thread, and wherein the state is determined to be one of a plurality of states including a backlogged state and a normal state and the state indicates which pool of packet processing threads the first packet processing thread belongs to; responsive to determining that the state of the first packet processing thread is a normal state, performing the following; adding, at the network device, the packet to the queue of the first packet processing thread, processing the packet in the first packet processing thread, and causing the packet to be forwarded; and responsive to determining that the state of the first packet processing thread is a backlogged state, performing the following; adding, at the network device, the packet to a queue of a second packet processing thread that is part of the backlogged pool of packet processing threads based on a load balancing scheme, wherein the backlogged pool of packet processing threads includes the first packet processing thread and a subset of packet processing threads from the plurality of packet processing threads, and the state of each one of the packet processing threads from the backlogged pool is the backlogged state, processing the packet in the second packet processing thread, and causing the packet to be forwarded according to a predetermined order, wherein the predetermined order is based on a position of the packet relative to positions of other packets at receipt of the packet and the other packets in the network device. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A network device comprising:
-
a processor; and a non-transitory machine readable storage media with code stored therein which when executed by the processor performs the following operations; receiving a packet at the network device, wherein the network device includes a plurality of packet processing threads, assigning the packet to a first packet processing thread from the plurality of packet processing threads prior to adding the packet to a queue of the first packet processing thread, wherein each one of the plurality packet processing threads belongs to one of at least a normal pool of packet processing threads and a backlogged pool of packet processing threads, determining a state of the first packet processing thread, wherein the state was set based on a monitoring of a length of the queue of the first packet processing thread, and wherein the state is determined to be one of a plurality of states including a backlogged state and a normal state and the state indicates which pool of packet processing threads the first packet processing thread belongs to, responsive to determining that the state of the first packet processing thread is a normal state, performing the following; adding, at the network device, the packet to the queue of the first packet processing thread, processing the packet in the first packet processing thread, and causing the packet to be forwarded, and responsive to determining that the state of the first packet processing thread is a backlogged state, performing the following; adding, at the network device, the packet to a queue of a second packet processing thread that is part of the backlogged pool of packet processing threads based on a load balancing scheme, wherein the backlogged pool of packet processing threads includes the first packet processing thread and a subset of packet processing threads from the plurality of packet processing threads, and the state of each one of the packet processing threads from the backlogged pool is the backlogged state, processing the packet in the second packet processing thread, and causing the packet to be forwarded according to a predetermined order, wherein the predetermined order is based on a position of the packet relative to positions of other packets at receipt of the packet and the other packets in the network device. - View Dependent Claims (16, 17, 18, 19)
-
Specification