IP Library Granted Patent US 9,882,815
Granted Patent B2
US 9,882,815 · App. 14/579,722 · Granted Jan 30, 2018

Adaptive load balancing in packet processing

Inventors: Ashwani Kumar Mehra (Bangalore, IN); Prashant Anand (Bangalore, IN)
Assignee: TELEFONAKTIEBOLAGET LM ERICSSON (PUBL)
H04L47/125H04L45/74H04L45/7453
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,882,815
App. No.
14/579,722
Granted
Jan 30, 2018
Kind
B2
Abstract

A method for forwarding packets in a network device is disclosed. The method comprises receiving a packet; mapping the packet to a bucket, where the bucket is associated with a packet processing thread from a plurality of packet processing threads; and determining whether the packet processing thread is oversubscribed. The method continues with, in response to determining that the packet processing thread is not oversubscribed, mapping the packet to the packet processing thread; and in response to determining that the packet processing thread is oversubscribed, the method comprises distributing the packet to one of the plurality of packet processing threads based on a predefined load balancing scheme, processing the packet in the one of the plurality of packet processing threads, and forwarding the packet according to a predetermined order, where the predetermined order is based on a position of the packet relative to other packets at their receipt.

Claims (63)

1. A method for forwarding packets in a network device, the method comprising:

receiving a packet;

mapping the packet of a flow to a bucket, wherein the bucket is associated with a packet processing thread from a plurality of packet processing threads;

determining whether the packet processing thread is oversubscribed;

responsive to determining that the packet processing thread is not oversubscribed,

performing the following:

setting a load balancing flag of the packet of the flow to a first value indicating that the packet is directly mapped to the packet processing thread instead of being load balanced over one of the plurality of packet processing threads, and

mapping the packet of the flow to the packet processing thread;

responsive to determining that the packet processing thread is oversubscribed, performing the following:

setting the load balancing flag of the packet of the flow to a second value indicating that the packet is load balanced over one of the plurality of packet processing threads instead of being directly mapped to the packet processing thread,

distributing the packet to one of the plurality of packet processing threads based on a predefined load balancing scheme, and

processing the packet of the flow in the one of the plurality of packet processing threads; and

forwarding the packet according to a predetermined order, wherein the predetermined order is based on a position of the packet relative to other packets of the flow at their receipt in the network device, wherein the packet of the flow is received after a preceding packet of the flow at the network device, and forwarding the packet of the flow further includes:

responsive to determining that the packet of the flow has a load balancing flag set to the first value, outputting the packet of the flow, and

responsive to determining that the packet of the flow has a load balancing flag set to the second value, performing the following:

determining whether the preceding packet of the flow is still to be processed by one of the plurality of packet processing threads,

responsive to determining that the preceding packet of the flow is still to be processed, storing the packet in a buffer, and

outputting the packet of the flow following the processing and output of the preceding packet of the flow.

2. The method of claim 1 , wherein responsive to determining that the packet processing thread is oversubscribed, further evaluating a state of the bucket, wherein the state of the bucket is indicative of a packet rate.

3. The method of claim 2 , wherein distributing the packet is further based on the evaluated state of the bucket.

4. The method of claim 2 , wherein the state of the bucket includes one or a combination of:

a counter value for the bucket, wherein the counter value is indicative of the number of packets in the bucket; and

an exponential weighted moving average (EWMA) value of the packet rate for the bucket.

5. The method of claim 1 , further comprising:

assigning a sequence number to the packet prior to distributing the packet to one of the plurality of packet processing threads, and

wherein forwarding the packet is performed according to the assigned sequence number.

6. The method of claim 1 , wherein determining whether the packet processing thread is oversubscribed includes:

evaluating a length of a queue of the packet processing thread; and

determining whether the length of the queue is above a predefined threshold.

7. The method of claim 6 , wherein the length of the queue is an exponential weighted moving average (EWMA) queue length.

8. The method of claim 1 , wherein mapping the packet to the bucket is performed according to a hashing function.

9. 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;

mapping the packet of a flow to a bucket, wherein the bucket is associated with a packet processing thread from a plurality of packet processing threads;

determining whether the packet processing thread is oversubscribed;

responsive to determining that the packet processing thread is not oversubscribed,

performing the following:

setting a load balancing flag of the packet of the flow to a first value indicating that the packet is directly mapped to the packet processing thread instead of being load balanced over one of the plurality of packet processing threads, and

mapping the packet of the flow to the packet processing thread;

responsive to determining that the packet processing thread is oversubscribed,

performing the following:

setting the load balancing flag of the packet of the flow to a second value indicating that the packet is load balanced over one of the plurality of packet processing threads instead of being directly mapped to the packet processing thread,

distributing the packet to one of the plurality of packet processing threads based on a predefined load balancing scheme, and

processing the packet of the flow in the one of the plurality of packet processing threads; and

forwarding the packet according to a predetermined order, wherein the predetermined order is based on a position of the packet relative to other packets of the flow at their receipt in the network device, wherein the packet of the flow is received after a preceding packet of the flow at the network device, and forwarding the packet of the flow further includes:

responsive to determining that the packet of the flow has a load balancing flag set to the first value, outputting the packet of the flow, and

responsive to determining that the packet of the flow has a load balancing flag set to the second value, performing the following:

determining whether the preceding packet of the flow is still to be processed by one of the plurality of packet processing threads,

responsive to determining that the preceding packet of the flow is still to be processed, storing the packet in a buffer, and

outputting the packet of the flow following the processing and output of the preceding packet of the flow.

10. The non-transitory machine-readable storage medium of claim 9 , wherein responsive to determining that the packet processing thread is oversubscribed, further evaluating a state of the bucket, wherein the state of the bucket is indicative of a packet rate.

11. The non-transitory machine-readable storage medium of claim 10 , wherein distributing the packet is further based on the evaluated state of the bucket.

12. The non-transitory machine-readable storage medium of claim 10 , wherein the state of the bucket includes one or a combination of:

a counter value for the bucket, wherein the counter value is indicative of the number of packets in the bucket; and

an exponential weighted moving average (EWMA) value of the packet rate for the bucket.

13. The non-transitory machine-readable storage medium of claim 9 , wherein the operations further comprise:

assigning a sequence number to the packet prior to distributing the packet to one of the plurality of packet processing threads, and

wherein forwarding the packet is performed according to the assigned sequence number.

14. The non-transitory machine-readable storage medium of claim 9 , wherein determining whether the packet processing thread is oversubscribed includes:

evaluating a length of a queue of the packet processing thread; and

determining whether the length of the queue is above a predefined threshold.

15. The non-transitory machine-readable storage medium of claim 14 , wherein the length of the queue is an exponential weighted moving average (EWMA) queue length.

16. The non-transitory machine-readable storage medium of claim 9 , wherein mapping the packet to the bucket is performed according to a hashing function.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 14, 2015
From: MEHRA, ASHWANI KUMAR; ANAND, PRASHANT
To: TELEFONAKTIEBOLAGET L M ERICSSON (PUBL)
Reel/Frame 034716/0426 →
Continuity (1)
Related Publication 20160182379A1 · Jun 23, 2016