WO2013127336A1 - Packet dispersion method and network device thereof - Google Patents

Packet dispersion method and network device thereof Download PDF

Info

Publication number
WO2013127336A1
WO2013127336A1 PCT/CN2013/071931 CN2013071931W WO2013127336A1 WO 2013127336 A1 WO2013127336 A1 WO 2013127336A1 CN 2013071931 W CN2013071931 W CN 2013071931W WO 2013127336 A1 WO2013127336 A1 WO 2013127336A1
Authority
WO
WIPO (PCT)
Prior art keywords
bit
partitions
bit partitions
add operation
queue
Prior art date
Application number
PCT/CN2013/071931
Other languages
French (fr)
Inventor
Shien DENG
Original Assignee
Hangzhou H3C Technologies Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co., Ltd. filed Critical Hangzhou H3C Technologies Co., Ltd.
Publication of WO2013127336A1 publication Critical patent/WO2013127336A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements

Definitions

  • CPUO is used as a control core for running the operating system and other CPUs are used as data cores for receiving and forwarding data.
  • System performance and CPU resource utilization are typically enhanced with more even traffic distribution among the data cores.
  • packet dispersion among the data cores is generally performed according to a packet quintuple that includes a source IP address, a destination IP address, a protocol number, a source port number, and a destination port number.
  • packets of the same stream are processed by the same CPU and packets of multiple streams are distributed to different CPUs to be processed.
  • Figure 1 is a flowchart illustrating a packet dispersion method according to a first example of the present disclosure.
  • Figure 2 is a flowchart illustrating a packet dispersion method according to a second example of the present disclosure.
  • Figure 3 is a flowchart illustrating a packet dispersion implemented with three adders according to an example of the present disclosure.
  • Figure 4 is a flowchart illustrating a packet dispersion implemented with four adders according to an example of the present disclosure.
  • Figure 5 is a schematic diagram illustrating a network device according to an example of the present disclosure.
  • Figure 6 is a schematic diagram illustrating another network device according to an example of the present disclosure.
  • a first example of the present disclosure may include a packet dispersion method, in which queues are pre-configured with queue numbers from 0 to 2 K -1 , which may be denoted as ⁇ 3 ⁇ 4, ⁇ 3 ⁇ 4, ⁇ , ⁇ 3 ⁇ 4 * 1 .
  • the packet dispersion method may also include pre-configured numerical values M ⁇ , M 2 , Mn, in a descending order, in which, M ⁇ may be determined according to the range of the ratioi/ 2TM of traffic of a queue with queue number 0 to total traffic.
  • FIG. 1 there is shown a flowchart illustrating a packet dispersion method according to a first example of the present disclosure.
  • the method may include the following processes.
  • a packet may be received, feature information of the packet may be extracted according to the type of the packet, and a balance calculation may be performed according to the feature information.
  • a value obtained from the balance calculation may be divided into multiple K-bit partitions.
  • extracted feature information of the packets may differ for different types of packets. For instance, if a packet is an IP packet, the extracted feature information of the packet includes a source IP address, a destination IP address, a protocol number, a source port number, and a destination port number. If a packet is a Multi-Protocol Label Switching (MPLS) packet, the extracted feature information of the packet includes a label and a protocol number. According to an example, quintuple information of the packet may be extracted according to the type of the packet. The extracted information of types of packets may be similar to those discussed with respect to these examples and are thus not described in greater detail herein.
  • MPLS Multi-Protocol Label Switching
  • a calculation value may be evenly allocated to a certain interval through implementation of the balance calculation at block 101 .
  • the balance calculation may be any suitable algorithm that enables the even allocation of the calculation value, such as a Hash algorithm.
  • An example of a suitable algorithm uses the 32-bit cyclic redundancy check (CRC32) algorithm, which enables a calculation result to be allocated evenly between the interval of 0 to 2 32 -1 .
  • CRC32 cyclic redundancy check
  • the balance calculation algorithm to be implemented may be selected according to practical requirements and the selected balance calculation algorithm may not affect the implementation of the example of the present disclosure.
  • M ⁇ K-bit partitions may be obtained from the multiple K-bit partitions, an add operation may be performed on the M ⁇ K-bit partitions, and the result obtained from the add operation may be divided into M 2 K-bit partitions.
  • the M 2 K-bit partitions may be obtained, an add operation ,may be performed on the M 2 K-bit partitions, and the result obtained from the add operation of the M 2 K-bit partitions may be divided into M 3 K-bit partitions.
  • the M 3 K-bit partitions may be obtained and an add operation may be performed on the M 3 K-bit partitions.
  • the subsequent processing may be performed in the same manner, until dividing the result obtained from the add operation of the M n- i K-bit partitions into M n K-bit partitions , M n K-bit partitions are obtained and an add operation is performed on the M n K-bit partitions, and the result obtained from the add operation of the M n K-bit partitions is divided into M n K-bit partitions, the current Mn K-bit partitions are obtained and an add operation is performed on the current M n K-bit partitions, and a result is obtained from the add operation of the current M n K-bit partitions.
  • the add operation performed on the current M n K-bit partitions may be called the last add operation.
  • the number of partitions obtained during each iteration is the number of partitions that may be obtained by dividing the last calculation result, until the number of obtained partitions is the preset minimum M n .
  • an add operation may be performed on the minimum M n K-bit partitions and the result obtained from the add operation of the M n K-bit partitions may be re-divided into the minimum M n K-bit partitions.
  • an add operation may be performed on the re-divided minimum M n K-bit partitions to ensure the value obtained from the last add operation is one of queues 0 to 2 K - 1 .
  • the received packet may be distributed to a queue with a queue number equaling to the result obtained from the add operation of the current M n K-bit partitions.
  • the packet dispersion method in the first example may be applied to a network device including 2 K - 1 data cores.
  • the queues having queue numbers from 1 to 2 K - 1 respectively correspond to the 2 K - 1 data cores.
  • the queue with queue number 0 corresponds to the data core corresponding to the queue with queue number Q, in which, ⁇ ⁇ Q ⁇ 2 K - ⁇ and Q is a natural number.
  • Each of the 2 - 1 data cores is to process packets in a queue corresponding to the data core.
  • Q may be any natural number in the range of 1 to 2 K - 1 . According to an example, one number in the range of 1 to 2 K - 1 may be designated as Q.
  • the received packet may be distributed to the data core corresponding to the queue with queue number Q.
  • corresponding packets may finally be processed by the same data core, and processing of packets with the same feature information by different data cores ,may be avoided.
  • a second example of the present disclosure may include a packet dispersion method, in which, queues are pre-configured with queue numbers from 1 to 2 K -1 , which may be denoted as Q 1 ,Q 2 ,---,Q 2K 1 ⁇
  • the packet dispersion method may also include pre-configured numerical values Mi , M 2 , M n in a descending order, in which, M ⁇ may be determined according to the range of the ratioi/ 2TM 1 of non-balanced traffic to total traffic.
  • the ratio of non-balanced traffic to total traffic refers to the ratio of traffic corresponding the result 0 obtained from the last add operation to the total traffic.
  • FIG 2 there is shown a flowchart illustrating a packet dispersion method according to a second example of the present disclosure.
  • the method may include the following processes.
  • a packet may be received, feature information of the packet may be extracted according to the type of the packet, and a balance calculation may be performed according to the extracted feature information.
  • the value obtained from the balance calculation may be divided into multiple K-bit partitions.
  • the feature information of the packet may be extracted according to the type of the packet, and the balance calculation may be performed according to the extracted feature information in the same manner as described above with respect to figure 1 .
  • Mi K-bit partitions may be obtained from the multiple K-bit partitions, an add operation may performed on the M ⁇ K-bit partitions, and the result obtained from the add operation may be divided into M 2 K-bit partitions.
  • the M 2 K-bit partitions may be obtained, an add operation may be performed on the M 2 K-bit partitions, and the result obtained from the add operation of the M 2 K-bit partitions may be divided into M 3 K-bit partitions.
  • the M 3 K-bit partitions may be obtained and an add operation may be performed on the M 3 K-bit partitions.
  • the subsequent processing may be performed in the same manner, until dividing the result obtained from the add operation of the M n- i K-bit partitions into M n K-bit partitions, M n K-bit partitions are obtained and an add operation is performed on the M n K-bit partitions, and the result obtained from the add operation of the M n K-bit partitions is divided into M n K-bit partitions, the current M n K-bit partitions are obtained and an add operation is performed on the current M n K-bit partitions.
  • the add operation performed on the current M n K-bit partitions may be called the last add operation.
  • the received packet is distributed to the queue having a queue number equaling the result obtained from the add operation of the current M n K-bit partitions.
  • the received packet may be distributed to a queue having a queue number that is one of 1 to 2 K -1 according to a preset strategy.
  • the preset strategy may be that when the result obtained from the last add operation is 0, the packets corresponding to the result 0 are distributed to a queue having a queue number that is one of 1 to 2 K -1 . It may be necessary to pre-determine a queue to which the packets corresponding to the result 0 is distributed. For instance, it is possible to pre-determine the queue having queue number 1 to which the packets corresponding to the result 0 are distributed.
  • the packet dispersion method in the second example may be applied to a network device including 2 K - 1 data cores.
  • the queues having queue numbers from 1 to 2 K - 1 respectively correspond to the 2 K - 1 data cores.
  • Each of the 2 K - 1 data cores is to process packets in the queue corresponding to the data core.
  • the method for dividing the value obtained from the balance calculation into multiple K-bit partitions may include: dividing the value obtained from the balance calculation into multiple K-bit partitions starting from the low-bit to the high-bit. When there are less than K bits left in the highest bits after obtaining some K-bit partitions, at least one bit of 0 may be filled in to compose a K-bit partition or the highest bits may be disregarded. Or the method for dividing the value obtained from the balance calculation into multiple K-bit partitions may include: dividing the value obtained from the balance calculation into multiple K-bit partitions from the high-bit to the low-bit. When there are less than K bits left in the lowest bits after obtaining some K-bit partitions, at least one bit of 0 may be filled in to compose a K-bit partition or the lowest bits may be disregarded.
  • the method for obtaining Iv ⁇ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation may include: randomly selecting M ⁇ K-bit partitions from the multiple K-bit partitions, selecting M ⁇ K-bit partitions from the multiple K-bit partitions starting from the low-bit to the high-bit, or selecting M ⁇ K-bit partitions from the multiple K-bit partitions starting from the high-bit to the low-bit.
  • the pre-determined M ⁇ may generally be less than the number of K-bit partitions achieved by dividing the value obtained from the balance calculation. Therefore, when there are less than K bits left in the highest bits or in the lowest bits, the process for disregarding the highest bits or the lowest bits may not influence the final distribution result.
  • the packet dispersion method may include the following operations.
  • the value obtained from the balance calculation may be divided into multiple K-bit partitions starting from the low-bit to the high-bit. When there are less than K bits left in the highest bits after obtaining some K-bit partitions, at least one bit of 0 may be filled in to compose a K-bit partition.
  • M ⁇ K-bit partitions may be selected from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit.
  • the packet dispersion method may include the following operations.
  • the value obtained from the balance calculation may be divided into multiple K-bit partitions starting from the low-bit to the high-bit. When there are less than K bits left in the highest bits after obtaining some K-bit partitions, the highest bits may be disregarded.
  • M ⁇ K-bit partitions may be selected from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit or from the high-bit to the low-bit.
  • K is 3.
  • Mi may be 9
  • n may be 2
  • M 2 is determined to be 2 according to M- ⁇ .
  • M ⁇ may be 8
  • n may be 2
  • M 2 is determined to be 2 according to Mi .
  • Mi may be 10
  • n may be 3
  • M 2 may be 3, M 3 is determined to be 2 according to Mi .
  • Mi When the largest value of l/ 2 KMl is less than or equal to 1 /2 24 , Mi may be 8, 9 or 10. To facilitate calculation and to conserve resources, Mi may be the minimum value 8 in a general implementation. This may result in the following when the minimum value is employed.
  • FIG 3 there is shown a flowchart illustrating a packet dispersion implemented with three adders according to an example of the present disclosure.
  • n is 8 if a 32-bit hash value is taken as an example, and the packet dispersion may be implemented with three adders.
  • FIG 4 there is shown a flowchart illustrating a packet dispersion implemented with four adders according to an example of the present disclosure.
  • n is 10 if the 32-bit hash value is also taken as an example, and the packet dispersion may be implemented with four adders.
  • the network device includes seven data cores and the queues are pre-configured with queue numbers from 0 to 7, in which, queues with queue numbers from 1 to 7 respectively correspond to the data cores.
  • the queue with queue number 0 corresponds to the data core corresponding to the queue with queue number 5.
  • M- ⁇ in this example may be 9. Since M- ⁇ may be 9, n may be 2, and M 2 may be 2.
  • an IP packet may be received and quintuple information including a source IP address, a destination IP address, a protocol number, a source port number, and a destination port number of the IP packet may be extracted.
  • quintuple information including a source IP address, a destination IP address, a protocol number, a source port number, and a destination port number of the IP packet may be extracted.
  • a Hash value may be obtained through use of the CRC32 algorithm.
  • the Hash value H obtained through use of the CRC32 algorithm equals 12372576545 (octal)
  • the Hash value H may be divided into 11 3-bit partitions starting from the low-bit to the high-bit. Octal values of the 11 3-bit partitions from the low-bit to the high-bit are 5, 4, 5, 6, 1 , the final value 1 only has two valid bits, then one bit of 0 is filled in to compose a 3-bit partition, and the final value is not changed.
  • M ⁇ 3-bit partitions namely 9 3-bit partitions, may be obtained from the 11 3-bit partitions.
  • the 9 3-bit partitions may be selected starting from the low-bit which are 5, 4, 5, 6, 3.
  • All of the 9 3-bit partitions may be added with a 3-bit adder, and a result 54 (octal) may be obtained, the result 54 (octal) may be divided into M 2 3-bit partitions, namely 2 3-bit partitions.
  • the 2 3-bit partitions may be obtained and added, and a result 11 (octal) may be obtained.
  • a result obtained from an add operation performed on the 2 3-bit partitions is a queue number, and the queue number is 2.
  • the IP packet may be distributed to a queue with queue number 2, and a data core corresponding to the queue with queue number 2 may process packets in the queue with queue number 2.
  • the IP packet may be distributed to a queue with queue number 5, and a data core corresponding to the queue with queue number 5 may process packets in the queue with queue number 5.
  • the ratio of the traffic of the queue with queue number 0 to the total traffic is within the acceptable range, namely, the traffic of the queue with queue number 0 is relatively low, then the average distribution may not be influenced.
  • the network device may implement the above-mentioned packet dispersion.
  • FIG 5 there is shown a schematic diagram illustrating a network device.
  • the network device may include a configuring unit 501 , a receiving unit 502, a calculating unit 503, a processing unit 504, a determining unit 505, and a queue unit 506.
  • the network device may implement the packet dispersion method according to the first example of the present disclosure discussed above, and each unit implements the following operations.
  • the configuring unit 501 is to configure queues with queue numbers from 0 to 2 K -1 in the queue unit 506, and configure numerical values M 1 ; M 2 , Mn in a descending order, in which, Mi may be determined according to the range of the ratio i/ 2TM of traffic of a queue with queue number 0 to total traffic.
  • the receiving unit 502 is to receive a packet.
  • the calculating unit 503 is to extract feature information of the packet according to the type of the packet received by the receiving unit 502, and perform a balance calculation according to the feature information.
  • the processing unit 504 is to divide a balance calculation value obtained by the calculating unit 503 into multiple K-bit partitions, obtain IVh K-bit partitions from the multiple K-bit partitions, and perform an add operation on the Mi K-bit partitions.
  • the processing unit 504 is also to divide a result obtained from the add operation into M 2 K-bit partitions, obtain the M 2 K-bit partitions, and perform an add operation on the M 2 K-bit partitions.
  • the processing unit 504 is further to divide the result obtained from the add operation of the M 2 K-bit partitions into M 3 K-bit partitions, then obtain the M 3 K-bit partitions and perform an add operation on the M 3 K-bit partitions, and perform the subsequent processing in the same manner, until M n K-bit partitions are obtained and an add operation on the M n K-bit partitions is performed.
  • the processing unit 504 if still further to divide the result obtained from the add operation of the M n K-bit partitions into M n K-bit partitions, obtain the current Mn K-bit partitions and perform an add operation on the current M n K-bit partitions, and obtain a result of the add operation of the current M n K-bit partitions.
  • the determining unit 505 is to distribute the packet received by the receiving unit 502 to a queue in the queue unit 506 with a queue number equaling the result of the add operation of the current M n K-bit partitions obtained by the processing unit 504.
  • the network device includes 2 K - 1 data cores 507.
  • the configuring unit 501 is further to configure the queues with queue numbers from 1 to 2 - 1 to respectively correspond to the 2 - 1 data cores, and configure the queue with queue number 0 to correspond to a data core corresponding to the queue with queue number Q , in which, ⁇ ⁇ Q ⁇ 2 K - ⁇ and Q is a natural number.
  • Each data core 507 is to process packets in a queue in the queue unit 506 corresponding to the data core.
  • the processing unit 504 is to divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit.
  • the processing unit 504 is to divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit.
  • at least one bit of 0 may be filled in to compose a K-bit partition.
  • Mi K-bit partitions may also be selected from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit.
  • the processing unit 504 may divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit. When there are less than K bits left in the highest bits after obtaining some K-bit partitions, the highest bits may be disregarded. Mi K-bit partitions may be selected from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit or from the high-bit to the low-bit.
  • the configuring unit 501 may, in the example in which there are seven data cores, configure K to be 3. When the largest value of l/ 2 KMl is less than or equal to 1 /2 24 , the configuring unit 501 is to configure M ⁇ and n to be 8 and 2 respectively. When the largest value of l/ 2 KMl is less than or equal to 1 /2 27 , the configuring unit 501 is to configure M ⁇ and n to be 9 and 2 respectively. When the largest value of l/ 2 KMl is less than or equal to 1 /2 30 , the configuring unit 501 is to configure M ⁇ and n to be 10 and 3 respectively. The configuring unit 501 is also to determine M 2 to be 3 according to Mi .
  • the network device shown in figure 5 may also implement the packet dispersion method according to the second example of the present disclosure discussed above, and each unit implements the following operations.
  • the configuring unit 501 is to configure queues with queue numbers from 1 to 2 K -1 in the queue unit 506, and configure numerical values M 1 ; M 2 , Mn in a descending order, in which, M ⁇ may be determined according to the range of the ratioi/ 2TM of non-balanced traffic to the total traffic.
  • M,, i 2, n, determined according to Mi
  • the receiving unit 502 is to receive a packet.
  • the calculating unit 503 is to extract feature information of the packet according to the type of the packet received by the receiving unit 502, and perform a balance calculation according to the feature information.
  • the processing unit 504 is to divide a balance calculation value obtained by the calculating unit 503 into multiple K-bit partitions, obtain M ⁇ K-bit partitions from the multiple K-bit partitions, and perform an add operation on the M- ⁇ K-bit partitions.
  • the processing unit 504 is also to divide a result obtained from the add operation into M 2 K-bit partitions, obtain the M 2 K-bit partitions, perform an add operation on the M 2 K-bit partitions, and divide the result obtained from the add operation of the M 2 K-bit partitions into M 3 K-bit partitions.
  • the processing unit 504 is further to obtain the M 3 K-bit partitions and perform an add operation on the M 3 K-bit partitions, and perform the subsequent processing in the same manner, until dividing the result obtained from the add operation of the M n- i K-bit partitions into M n K-bit partitions, obtain M n K-bit partitions and perform an add operation on the M n K-bit partitions, and further divide the result obtained from the add operation of the M n K-bit partitions into M n K-bit partitions, obtain the current M n K-bit partitions and perform an add operation on the current M n K-bit partitions, and obtain a result of the add operation of the current M n K-bit partitions.
  • the determining unit 505 is to, when the result obtained from the add operation of the current M n K-bit partitions is not 0, distribute the packet received by the receiving unit 502 to a queue in the queue unit 506 with a queue number equaling the result of the add operation of the current M n K-bit partitions obtained by the processing unit 504.
  • the determining unit 505 may distribute the packet received by the receiving unit 502 to a queue in the queue unit 506 with a queue number that is one of 1 to 2 K -1 according to a preset strategy.
  • the network device includes 2 K - 1 data cores 507.
  • the configuring unit 501 is further to configure the queues with queue numbers from 1 to 2 K - 1 to respectively correspond to the 2 K - 1 data cores.
  • Each data core 507 is to process packets in a queue in the queue unit 606 corresponding to the data core.
  • the processing unit 504 may divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit.
  • the processing unit 504 is to, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, fill in at least one bit of 0 to compose a K-bit partition.
  • the processing unit 504 may further select M ⁇ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit.
  • the processing unit 504 may divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit.
  • the processing unit 504 when there are less than K bits left in the highest bits after obtaining some K-bit partitions, may disregard the highest bits.
  • the processing unit 502 may further select M ⁇ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit or from the high-bit to the low-bit.
  • the configuring unit 501 may, in the example in which there are seven data cores, configure K to be 3.
  • the configuring unit 501 is to configure M ⁇ and n to be 8 and 2 respectively.
  • the configuring unit 501 is to configure M ⁇ and n to be 9 and 2 respectively.
  • the configuring unit 501 is to configure M ⁇ and n to be 10 and 3 respectively.
  • the configuring unit 501 is also to determine M 2 to be 3 according to Mi .
  • the units in the network devices of the examples disclosed herein may be distributed in the network devices of the example according to the descriptions of the examples, and may also be varied to be located in one or more network devices different from those of the examples.
  • the units of the above examples may be integrated into one unit or may be further divided into multiple sub-units.
  • examples of the present disclosure may replace the modular algorithm with an add operation, may perform the add operation on limited partitions of a balance calculation value, and may distribute a received packet to a queue with a queue number equaling a result obtained from the add operation.
  • resource consumption may be reduced, and the efficiency of packet dispersion may be improved.
  • the packet dispersion method disclosed herein may be applied to a network device having multiple cores and may distribute packet traffic to multiple data cores as evenly as possible.
  • the examples may be implemented by machine-readable instructions plus a necessary common hardware platform, and/or they may also be implemented by hardware. Based on such understanding, the examples substantially or in individual parts may be presented in a form of machine-readable instructions that are stored in a non-transitory computer readable storage medium including several instructions to make a computing device (may be a mobile phone, a personal computer, a server, a network device, etc.,) execute the method of the examples.
  • a computing device may be a mobile phone, a personal computer, a server, a network device, etc.
  • Figure 6 is a schematic diagram illustrating another network device that may implement the packet dispersion method according to the first example of the present disclosure discussed above.
  • the network device may include a processor 601 and a memory 602.
  • the network device may implement the packet dispersion method according to the first example of the present disclosure discussed above, and the processor 601 and the memory 602 implements the following operations.
  • the memory 602 is to store machine readable instructions.
  • the processor 601 is to communicate with the memory 602 and to execute machine readable instructions in the memory 602 to:
  • the network device may further include 2 K - 1 data cores.
  • the processor 601 may further execute machine readable instructions in the memory 602 to: configure the queues with queue numbers from 1 to 2 K - 1 to respectively correspond to the 2 K - 1 data cores, and configure the queue with queue number 0 to correspond to a data core corresponding to the queue with queue number Q, in which, ⁇ ⁇ Q ⁇ 2 K - ⁇ and Q is a natural number.
  • Each data core is to process packets in a queue corresponding to the data core.
  • the processor 601 may execute machine readable instructions in the memory 602 to: divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, fill in at least one bit of 0 to compose a K-bit partition; and select M ⁇ K-bit partitions from the multiple K-bit partitions achieved by dividing the balance calculation value starting from the low-bit to the high-bit.
  • the processor 601 may execute machine readable instructions in the memory 602 to: divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, disregard the highest bits; and select M ⁇ K-bit partitions from the multiple K-bit partitions achieved by dividing the balance calculation value starting from the low-bit to high-bit or from the high-bit to the low-bit.
  • the processor 601 may execute machine readable instructions memory 602 to: in the example in which there are seven data cores, and K is 3, when the largest value of l/ 2 KMl is less than or equal to 1 /2 24 , configure M ⁇ and n to be 8 and 2 respectively; when the largest value of 1 / 2TM 1 is less than or equal to 1 /2 27 , configure M ⁇ and n to be 9 and 2 respectively; when the largest value of l/ 2 KMl is less than or equal to 1 /2 30 , configure M ⁇ and n to be 10 and 3 respectively; and determine M 2 to be 3 according to Mi .
  • the network device shown in figure 6 may implement the packet dispersion method according to the second example of the present disclosure discussed above, and the processor 601 and the memory 602 implements the following operations.
  • the memory 602 is to store machine readable instructions.
  • the processor 601 is to communicate with the memory 602, and to execute machine readable instructions in the memory 602 to:
  • pre-configure queues with queue numbers from 1 to 2 K -1 , pre-configure numerical values M 1 ; M 2 , M n in a descending order; in which, Iv ⁇ may be determined according to the range of the ratioi/ 2TM 1 of non-balance traffic to total traffic.
  • the network device may further include 2 K - 1 data cores.
  • the processor 601 may further execute machine readable instructions in the memory 602 to: configure the queues with queue numbers for 1 to 2 K - 1 to respectively correspond to the 2 K - 1 data cores.
  • Each data core is to process packets in a queue corresponding to the data core.
  • the processor 601 may execute machine readable instructions in the memory 602 to: divide the value obtained from the balance calculation into multiple K-bit partitions starting from the low-bit to the high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, fill in at least one bit of 0 to compose a K-bit partition; and select M ⁇ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to high-bit.
  • the processor 601 may execute machine readable instructions in the memory 602 to: divide the value obtained from the balance calculation into multiple K-bit partitions starting from the low-bit to the high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, disregard the highest bits; select M ⁇ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit or from the high-bit to the low-bit.
  • the processor 601 may execute machine readable instructions in the memory 602 to: in the example in which there are seven data cores, configure K to be 3, when the largest value of l/2 KMl is less than or equal to 1 /2 24 , configure M ⁇ and n to be 8 and 2 respectively; when the largest value of 1/ 2TM 1 is less than or equal to 1/2 27 , configure M ⁇ and n to be 9 and 2 respectively; when the largest value of 1/ 2TM 1 is less than or equal to 1/2 30 , configure Mi and n to be 10 and 3 respectively; and determine M 2 to be 3 according to Mi .
  • the above examples can be implemented by hardware, software or firmware or a combination thereof.
  • the various methods, processes and functional modules or units described herein may be implemented by a processor (the term processor is to be interpreted broadly to include a CPU, processing unit, microprocessor, microcontroller, ASIC (Application Specific Integrated Circuit), logic unit, or programmable gate array etc.).
  • the processes, methods and functional modules or units may all be implemented by a single processor or split between several processers; reference in this disclosure or the claims to a 'processor' should thus be interpreted to mean One or more processors'.
  • the processes, methods and functional modules or units may be implemented as machine readable instructions executable by one or more processors, hardware logic circuitry of the one or more processors or a combination thereof.
  • the teachings herein may be implemented in the form of a software product.
  • the computer software product is stored in a non-transitory machine readable storage medium and comprises a plurality of instructions for making a computer device (for example a personal computer, a server, or a network device such as a router, switch, access point etc.) implement the methods recited in the examples of the present disclosure.
  • a computer device for example a personal computer, a server, or a network device such as a router, switch, access point etc.

Abstract

According to an example, in a packet dispersion operation, add operations on limited partitions of a balance calculation value are performed, and a received packet is distributed to a queue with a queue number equaling a result obtained from the add operations. The queue number may also correspond to a respective data core of a network device. In one regard, the packet dispersion operation according to this example may be implemented in methods and network devices to improve the efficiency of packet dispersion and reduce resource consumption.

Description

PACKET DISPERSION METHOD AND NETWORK DEVICE THEREOF BACKGROUND
[0001 ] In a conventional multi-core device, CPUO is used as a control core for running the operating system and other CPUs are used as data cores for receiving and forwarding data. System performance and CPU resource utilization are typically enhanced with more even traffic distribution among the data cores. In conventional traffic distribution, packet dispersion among the data cores is generally performed according to a packet quintuple that includes a source IP address, a destination IP address, a protocol number, a source port number, and a destination port number. In addition, packets of the same stream are processed by the same CPU and packets of multiple streams are distributed to different CPUs to be processed.
BRIEF DESCRIPTION OF THE DRAWINGS
[0002] Features of the present disclosure are illustrated by way of example and not limited in the following figure(s), in which like numerals indicate like elements, in which:
[0003] Figure 1 is a flowchart illustrating a packet dispersion method according to a first example of the present disclosure.
[0004] Figure 2 is a flowchart illustrating a packet dispersion method according to a second example of the present disclosure.
[0005] Figure 3 is a flowchart illustrating a packet dispersion implemented with three adders according to an example of the present disclosure.
[0006] Figure 4 is a flowchart illustrating a packet dispersion implemented with four adders according to an example of the present disclosure.
[0007] Figure 5 is a schematic diagram illustrating a network device according to an example of the present disclosure.
[0008] Figure 6 is a schematic diagram illustrating another network device according to an example of the present disclosure.
DETAILED DESCRIPTION
[0009] For simplicity and illustrative purposes, the present disclosure is described by referring mainly to an example thereof. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. It will be readily apparent however, that the present disclosure may be practiced without limitation to these specific details. In other instances, some methods and structures have not been described in detail so as not to unnecessarily obscure the present disclosure. Throughout the present disclosure, the terms "a" and "an" are intended to denote at least one of a particular element. As used herein, the term "includes" means includes but not limited to, the term "including" means including but not limited to. The term "based on" means based at least in part on.
[0010] Conventional packet dispersion techniques are generally implemented through use of modular algorithms that are relatively complex. In one regard, therefore, conventional packet dispersion techniques consumes relatively large amount of resources and also results in relatively poor performance. As such, when there are insufficient resources, packet dispersion may not be implemented.
[0011 ] In view of above, a first example of the present disclosure may include a packet dispersion method, in which queues are pre-configured with queue numbers from 0 to 2K-1 , which may be denoted as <¾,<¾, ···,<¾* 1 . The packet dispersion method may also include pre-configured numerical values M^ , M2, Mn, in a descending order, in which, M^ may be determined according to the range of the ratioi/ 2™ of traffic of a queue with queue number 0 to total traffic. In addition, M, may be determined according to Mi , in which, i=2, n, and K, n, i , Mi , M2, Mn are natural numbers and Mn-i> Mn=2.
[0012] Referring to figure 1 , there is shown a flowchart illustrating a packet dispersion method according to a first example of the present disclosure. The method may include the following processes.
[0013] In block 101 , a packet may be received, feature information of the packet may be extracted according to the type of the packet, and a balance calculation may be performed according to the feature information. In addition, a value obtained from the balance calculation may be divided into multiple K-bit partitions.
[0014] In block 101 , extracted feature information of the packets may differ for different types of packets. For instance, if a packet is an IP packet, the extracted feature information of the packet includes a source IP address, a destination IP address, a protocol number, a source port number, and a destination port number. If a packet is a Multi-Protocol Label Switching (MPLS) packet, the extracted feature information of the packet includes a label and a protocol number. According to an example, quintuple information of the packet may be extracted according to the type of the packet. The extracted information of types of packets may be similar to those discussed with respect to these examples and are thus not described in greater detail herein.
[0015] A calculation value may be evenly allocated to a certain interval through implementation of the balance calculation at block 101 . The balance calculation may be any suitable algorithm that enables the even allocation of the calculation value, such as a Hash algorithm. An example of a suitable algorithm uses the 32-bit cyclic redundancy check (CRC32) algorithm, which enables a calculation result to be allocated evenly between the interval of 0 to 232-1 . The balance calculation algorithm to be implemented may be selected according to practical requirements and the selected balance calculation algorithm may not affect the implementation of the example of the present disclosure.
[0016] In block 102, M^ K-bit partitions may be obtained from the multiple K-bit partitions, an add operation may be performed on the M^ K-bit partitions, and the result obtained from the add operation may be divided into M2 K-bit partitions. [0017] In block 103, the M2 K-bit partitions may be obtained, an add operation ,may be performed on the M2 K-bit partitions, and the result obtained from the add operation of the M2 K-bit partitions may be divided into M3 K-bit partitions. The M3 K-bit partitions may be obtained and an add operation may be performed on the M3 K-bit partitions. The subsequent processing may be performed in the same manner, until dividing the result obtained from the add operation of the Mn-i K-bit partitions into Mn K-bit partitions , Mn K-bit partitions are obtained and an add operation is performed on the Mn K-bit partitions, and the result obtained from the add operation of the Mn K-bit partitions is divided into Mn K-bit partitions, the current Mn K-bit partitions are obtained and an add operation is performed on the current Mn K-bit partitions, and a result is obtained from the add operation of the current Mn K-bit partitions. To facilitate description, the add operation performed on the current Mn K-bit partitions may be called the last add operation.
[0018] In block 103, the number of partitions obtained during each iteration is the number of partitions that may be obtained by dividing the last calculation result, until the number of obtained partitions is the preset minimum Mn. In addition, an add operation may be performed on the minimum Mn K-bit partitions and the result obtained from the add operation of the Mn K-bit partitions may be re-divided into the minimum Mn K-bit partitions. Moreover, an add operation may be performed on the re-divided minimum Mn K-bit partitions to ensure the value obtained from the last add operation is one of queues 0 to 2K - 1 .
[0019] In block 104, the received packet may be distributed to a queue with a queue number equaling to the result obtained from the add operation of the current Mn K-bit partitions.
[0020] The packet dispersion method in the first example may be applied to a network device including 2K - 1 data cores. The queues having queue numbers from 1 to 2K - 1 respectively correspond to the 2K - 1 data cores. The queue with queue number 0 corresponds to the data core corresponding to the queue with queue number Q, in which, \ < Q < 2K-\ and Q is a natural number. Each of the 2 - 1 data cores is to process packets in a queue corresponding to the data core.
[0021 ] Q may be any natural number in the range of 1 to 2K - 1 . According to an example, one number in the range of 1 to 2K - 1 may be designated as Q. When a result obtained from the last add operation matches with the queue with queue number 0, the received packet may be distributed to the data core corresponding to the queue with queue number Q. Thus, corresponding packets may finally be processed by the same data core, and processing of packets with the same feature information by different data cores ,may be avoided.
[0022] A second example of the present disclosure may include a packet dispersion method, in which, queues are pre-configured with queue numbers from 1 to 2K-1 , which may be denoted as Q1,Q2,---,Q2K 1■ The packet dispersion method may also include pre-configured numerical values Mi , M2, Mn in a descending order, in which, M^ may be determined according to the range of the ratioi/ 2™1 of non-balanced traffic to total traffic. In addition, M, may be determined according to M1 :, in which, i=2 , ... , n, and K, n, i , Mi , M2, Mn are natural numbers, Mn-i> Mn=2. The ratio of non-balanced traffic to total traffic refers to the ratio of traffic corresponding the result 0 obtained from the last add operation to the total traffic.
[0023] Referring to figure 2, there is shown a flowchart illustrating a packet dispersion method according to a second example of the present disclosure. The method may include the following processes.
[0024] In block 201 , a packet may be received, feature information of the packet may be extracted according to the type of the packet, and a balance calculation may be performed according to the extracted feature information. In addition, the value obtained from the balance calculation may be divided into multiple K-bit partitions. [0025] In block 201 , the feature information of the packet may be extracted according to the type of the packet, and the balance calculation may be performed according to the extracted feature information in the same manner as described above with respect to figure 1 .
[0026] In block 202, Mi K-bit partitions may be obtained from the multiple K-bit partitions, an add operation may performed on the M^ K-bit partitions, and the result obtained from the add operation may be divided into M2 K-bit partitions.
[0027] In block 203, the M2 K-bit partitions may be obtained, an add operation may be performed on the M2 K-bit partitions, and the result obtained from the add operation of the M2 K-bit partitions may be divided into M3 K-bit partitions. The M3 K-bit partitions may be obtained and an add operation may be performed on the M3 K-bit partitions. The subsequent processing may be performed in the same manner, until dividing the result obtained from the add operation of the Mn-i K-bit partitions into Mn K-bit partitions, Mn K-bit partitions are obtained and an add operation is performed on the Mn K-bit partitions, and the result obtained from the add operation of the Mn K-bit partitions is divided into Mn K-bit partitions, the current Mn K-bit partitions are obtained and an add operation is performed on the current Mn K-bit partitions. To facilitate description, the add operation performed on the current Mn K-bit partitions may be called the last add operation.
[0028] In block 204, when the result obtained from the add operation of the current Mn K-bit partitions is not 0, the received packet is distributed to the queue having a queue number equaling the result obtained from the add operation of the current Mn K-bit partitions. When the result obtained from the add operation of the current Mn K-bit partitions is 0, the received packet may be distributed to a queue having a queue number that is one of 1 to 2K-1 according to a preset strategy. The preset strategy may be that when the result obtained from the last add operation is 0, the packets corresponding to the result 0 are distributed to a queue having a queue number that is one of 1 to 2K-1 . It may be necessary to pre-determine a queue to which the packets corresponding to the result 0 is distributed. For instance, it is possible to pre-determine the queue having queue number 1 to which the packets corresponding to the result 0 are distributed.
[0029] The packet dispersion method in the second example may be applied to a network device including 2K - 1 data cores. The queues having queue numbers from 1 to 2K - 1 respectively correspond to the 2K - 1 data cores. Each of the 2K - 1 data cores is to process packets in the queue corresponding to the data core.
[0030] In the first example and the second example, the method for dividing the value obtained from the balance calculation into multiple K-bit partitions may include: dividing the value obtained from the balance calculation into multiple K-bit partitions starting from the low-bit to the high-bit. When there are less than K bits left in the highest bits after obtaining some K-bit partitions, at least one bit of 0 may be filled in to compose a K-bit partition or the highest bits may be disregarded. Or the method for dividing the value obtained from the balance calculation into multiple K-bit partitions may include: dividing the value obtained from the balance calculation into multiple K-bit partitions from the high-bit to the low-bit. When there are less than K bits left in the lowest bits after obtaining some K-bit partitions, at least one bit of 0 may be filled in to compose a K-bit partition or the lowest bits may be disregarded.
[0031 ] The method for obtaining Iv^ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation may include: randomly selecting M^ K-bit partitions from the multiple K-bit partitions, selecting M^ K-bit partitions from the multiple K-bit partitions starting from the low-bit to the high-bit, or selecting M^ K-bit partitions from the multiple K-bit partitions starting from the high-bit to the low-bit.
[0032] The pre-determined M^ may generally be less than the number of K-bit partitions achieved by dividing the value obtained from the balance calculation. Therefore, when there are less than K bits left in the highest bits or in the lowest bits, the process for disregarding the highest bits or the lowest bits may not influence the final distribution result. [0033] According to an example, the packet dispersion method may include the following operations. The value obtained from the balance calculation may be divided into multiple K-bit partitions starting from the low-bit to the high-bit. When there are less than K bits left in the highest bits after obtaining some K-bit partitions, at least one bit of 0 may be filled in to compose a K-bit partition. M^ K-bit partitions may be selected from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit.
[0034] According to another example, the packet dispersion method may include the following operations. The value obtained from the balance calculation may be divided into multiple K-bit partitions starting from the low-bit to the high-bit. When there are less than K bits left in the highest bits after obtaining some K-bit partitions, the highest bits may be disregarded. M^ K-bit partitions may be selected from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit or from the high-bit to the low-bit.
[0035] In the above-mentioned examples, the method for determining M,, i=2, n according to Mi may be shown as formula 1 ;
Mf = [log^^ - l)] / * (Formula 1 )
[0036] In formula 1 , ] denotes a rounding up and 1≤i-1≤n. Since Mn-i >
Mn=2, when M, is calculated according to above mentioned formula 1 , and Mn=2 is obtained, the calculation is terminated, and Mn=2 is taken as a final value of these preset numerical values.
[0037] By way of particular example in which a network device includes seven data cores, K is 3. When the largest value of l/ 2KMl is less than or equal to 1 /227, Mi may be 9, n may be 2, and M2 is determined to be 2 according to M-\ . When the largest value of l/ 2KMl is less than or equal to 1 /224, M^ may be 8, n may be 2, and M2 is determined to be 2 according to Mi . When the largest value of l/ 2KMl is less than or equal to 1 /2 , Mi may be 10, n may be 3, and M2 may be 3, M3 is determined to be 2 according to Mi . When the largest value of l/ 2KMl is less than or equal to 1 /224, Mi may be 8, 9 or 10. To facilitate calculation and to conserve resources, Mi may be the minimum value 8 in a general implementation. This may result in the following when the minimum value is employed.
[0038] Firstly, when the number of partitions decreases, the number of add operations decreases.
[0039] Secondly, when the number of partitions decreases, the number of K-bit adders decreases.
[0040] Since M i=2 , n is determined according to Mi , if Mi is configured to be 8, , three adders are
Figure imgf000012_0001
necessary to implement the packet dispersion. Referring to figure 3, there is shown a flowchart illustrating a packet dispersion implemented with three adders according to an example of the present disclosure. In figure 3, n is 8 if a 32-bit hash value is taken as an example, and the packet dispersion may be implemented with three adders.
[0041 ] If Mi is configured to be 10, [0042] M2= log2 M1 (2K - ,
[0043] M3 = [loi 2 M2(2 , then four adders are
Figure imgf000012_0002
necessary to implement the packet dispersion. Referring to figure 4, there is shown a flowchart illustrating a packet dispersion implemented with four adders according to an example of the present disclosure. In figure 4, n is 10 if the 32-bit hash value is also taken as an example, and the packet dispersion may be implemented with four adders.
[0044] By way of particular example in which I P packets are distributed by a network device, an example of a manner in which the packet dispersion may be implemented according to an example of the present disclosure will be described in detail hereinafter with reference to the accompanying drawings and specific examples. In this example, the network device includes seven data cores and the queues are pre-configured with queue numbers from 0 to 7, in which, queues with queue numbers from 1 to 7 respectively correspond to the data cores. In addition, the queue with queue number 0 corresponds to the data core corresponding to the queue with queue number 5. If the Hash algorithm CRC32 is adopted in the network device, and the largest value of the ratioi/ 2™ of traffic of the queue with the queue number 0 to the total traffic is less than or equal to 1/227, it is possible to configure Mi as 9, 10 or 1 1 . According to the example in which the minimum value is employed as mentioned above, when the system requirement is satisfied, namely, when the traffic of the queue with queue number 0 is relatively low, and the average distribution may not be influenced, M-\ in this example may be 9. Since M-\ may be 9, n may be 2, and M2 may be 2.
[0045] After the pre-configuration of the network device is accomplished, an IP packet may be received and quintuple information including a source IP address, a destination IP address, a protocol number, a source port number, and a destination port number of the IP packet may be extracted. In addition, a Hash value may be obtained through use of the CRC32 algorithm.
[0046] If the Hash value H obtained through use of the CRC32 algorithm equals 12372576545 (octal), the Hash value H may be divided into 11 3-bit partitions starting from the low-bit to the high-bit. Octal values of the 11 3-bit partitions from the low-bit to the high-bit are 5, 4, 5, 6, 1 , the final value 1 only has two valid bits, then one bit of 0 is filled in to compose a 3-bit partition, and the final value is not changed.
[0047] M^ 3-bit partitions, namely 9 3-bit partitions, may be obtained from the 11 3-bit partitions. Here, the 9 3-bit partitions may be selected starting from the low-bit which are 5, 4, 5, 6, 3.
[0048] All of the 9 3-bit partitions may be added with a 3-bit adder, and a result 54 (octal) may be obtained, the result 54 (octal) may be divided into M2 3-bit partitions, namely 2 3-bit partitions.
[0049] The 2 3-bit partitions may be obtained and added, and a result 11 (octal) may be obtained.
[0050] Because the 3-bit partitions of pre-configured minimum value M2 have been obtained, when the above result 11 (octal) is further divided into 2 3-bit partitions, a result obtained from an add operation performed on the 2 3-bit partitions is a queue number, and the queue number is 2. The IP packet may be distributed to a queue with queue number 2, and a data core corresponding to the queue with queue number 2 may process packets in the queue with queue number 2.
[0051 ] If the final calculation result is 0, the IP packet may be distributed to a queue with queue number 5, and a data core corresponding to the queue with queue number 5 may process packets in the queue with queue number 5. As has been mentioned above, if the ratio of the traffic of the queue with queue number 0 to the total traffic is within the acceptable range, namely, the traffic of the queue with queue number 0 is relatively low, then the average distribution may not be influenced.
[0052] Also disclosed herein is a network device that may implement the above-mentioned packet dispersion. Referring to figure 5, there is shown a schematic diagram illustrating a network device. The network device may include a configuring unit 501 , a receiving unit 502, a calculating unit 503, a processing unit 504, a determining unit 505, and a queue unit 506.
[0053] The network device may implement the packet dispersion method according to the first example of the present disclosure discussed above, and each unit implements the following operations.
[0054] The configuring unit 501 is to configure queues with queue numbers from 0 to 2K-1 in the queue unit 506, and configure numerical values M1 ; M2, Mn in a descending order, in which, Mi may be determined according to the range of the ratio i/ 2™ of traffic of a queue with queue number 0 to total traffic. In addition, Mi, i=2 , n, determined according to IV , and K, n, i , Mi , M2, Mn are natural numbers, and Mn-i > Mn=2.
[0055] The receiving unit 502 is to receive a packet.
[0056] The calculating unit 503 is to extract feature information of the packet according to the type of the packet received by the receiving unit 502, and perform a balance calculation according to the feature information.
[0057] The processing unit 504 is to divide a balance calculation value obtained by the calculating unit 503 into multiple K-bit partitions, obtain IVh K-bit partitions from the multiple K-bit partitions, and perform an add operation on the Mi K-bit partitions. The processing unit 504 is also to divide a result obtained from the add operation into M2 K-bit partitions, obtain the M2 K-bit partitions, and perform an add operation on the M2 K-bit partitions. The processing unit 504 is further to divide the result obtained from the add operation of the M2 K-bit partitions into M3 K-bit partitions, then obtain the M3 K-bit partitions and perform an add operation on the M3 K-bit partitions, and perform the subsequent processing in the same manner, until Mn K-bit partitions are obtained and an add operation on the Mn K-bit partitions is performed. The processing unit 504 if still further to divide the result obtained from the add operation of the Mn K-bit partitions into Mn K-bit partitions, obtain the current Mn K-bit partitions and perform an add operation on the current Mn K-bit partitions, and obtain a result of the add operation of the current Mn K-bit partitions.
[0058] The determining unit 505 is to distribute the packet received by the receiving unit 502 to a queue in the queue unit 506 with a queue number equaling the result of the add operation of the current Mn K-bit partitions obtained by the processing unit 504.
[0059] Furthermore, the network device includes 2K - 1 data cores 507. [0060] The configuring unit 501 is further to configure the queues with queue numbers from 1 to 2 - 1 to respectively correspond to the 2 - 1 data cores, and configure the queue with queue number 0 to correspond to a data core corresponding to the queue with queue number Q , in which, \ < Q < 2K-\ and Q is a natural number.
[0061 ] Each data core 507 is to process packets in a queue in the queue unit 506 corresponding to the data core.
[0062] According to an example, the processing unit 504 is to divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit. When there are less than K bits left in the highest bits after obtaining some K-bit partitions, at least one bit of 0 may be filled in to compose a K-bit partition. Mi K-bit partitions may also be selected from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit.
[0063] Alternatively, the processing unit 504 may divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit. When there are less than K bits left in the highest bits after obtaining some K-bit partitions, the highest bits may be disregarded. Mi K-bit partitions may be selected from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit or from the high-bit to the low-bit.
[0064] According to an example, the configuring unit 501 may determine M,, i=2, n, according to M^ based on the above-mentioned formula 1 , namely:
[log^C -l)]/* (Formula 1 )
[0065]
Figure imgf000016_0001
denotes a rounding up and 1≤i-1≤n. [0066] According to an example, the configuring unit 501 may, in the example in which there are seven data cores, configure K to be 3. When the largest value of l/ 2KMl is less than or equal to 1 /224, the configuring unit 501 is to configure M^ and n to be 8 and 2 respectively. When the largest value of l/ 2KMl is less than or equal to 1 /227, the configuring unit 501 is to configure M^ and n to be 9 and 2 respectively. When the largest value of l/ 2KMl is less than or equal to 1 /230, the configuring unit 501 is to configure M^ and n to be 10 and 3 respectively. The configuring unit 501 is also to determine M2 to be 3 according to Mi .
[0067] The network device shown in figure 5 may also implement the packet dispersion method according to the second example of the present disclosure discussed above, and each unit implements the following operations.
[0068] The configuring unit 501 is to configure queues with queue numbers from 1 to 2K-1 in the queue unit 506, and configure numerical values M1 ; M2, Mn in a descending order, in which, M^ may be determined according to the range of the ratioi/ 2™ of non-balanced traffic to the total traffic. In addition, M,, i=2, n, determined according to Mi , and K, n , i , Mi , M2, Mn are natural numbers, Mn-i> Mn=2.
[0069] The receiving unit 502 is to receive a packet.
[0070] The calculating unit 503 is to extract feature information of the packet according to the type of the packet received by the receiving unit 502, and perform a balance calculation according to the feature information.
[0071 ] The processing unit 504 is to divide a balance calculation value obtained by the calculating unit 503 into multiple K-bit partitions, obtain M^ K-bit partitions from the multiple K-bit partitions, and perform an add operation on the M-\ K-bit partitions. The processing unit 504 is also to divide a result obtained from the add operation into M2 K-bit partitions, obtain the M2 K-bit partitions, perform an add operation on the M2 K-bit partitions, and divide the result obtained from the add operation of the M2 K-bit partitions into M3 K-bit partitions. The processing unit 504 is further to obtain the M3 K-bit partitions and perform an add operation on the M3 K-bit partitions, and perform the subsequent processing in the same manner, until dividing the result obtained from the add operation of the Mn-i K-bit partitions into Mn K-bit partitions, obtain Mn K-bit partitions and perform an add operation on the Mn K-bit partitions, and further divide the result obtained from the add operation of the Mn K-bit partitions into Mn K-bit partitions, obtain the current Mn K-bit partitions and perform an add operation on the current Mn K-bit partitions, and obtain a result of the add operation of the current Mn K-bit partitions.
[0072] The determining unit 505 is to, when the result obtained from the add operation of the current Mn K-bit partitions is not 0, distribute the packet received by the receiving unit 502 to a queue in the queue unit 506 with a queue number equaling the result of the add operation of the current Mn K-bit partitions obtained by the processing unit 504. When the result obtained from the add operation of the current Mn K-bit partitions is 0, the determining unit 505 may distribute the packet received by the receiving unit 502 to a queue in the queue unit 506 with a queue number that is one of 1 to 2K-1 according to a preset strategy.
[0073] Furthermore, the network device includes 2K - 1 data cores 507.
[0074] The configuring unit 501 is further to configure the queues with queue numbers from 1 to 2K - 1 to respectively correspond to the 2K - 1 data cores.
[0075] Each data core 507 is to process packets in a queue in the queue unit 606 corresponding to the data core.
[0076] According to an example, the processing unit 504 may divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit. The processing unit 504 is to, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, fill in at least one bit of 0 to compose a K-bit partition. The processing unit 504 may further select M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit. [0077] Alternatively, the processing unit 504 may divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit. The processing unit 504, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, may disregard the highest bits. The processing unit 502 may further select M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit or from the high-bit to the low-bit.
[0078] According to an example, the configuring unit 501 may determine M,, i=2, n, accordin to M-\ based on the above-mentioned formula 1 , namely
|~log2 Mi_1(2if / K , in which, ~| denotes a rounding up and 1≤i-1≤n.
Figure imgf000019_0001
[0079] According to an example, the configuring unit 501 may, in the example in which there are seven data cores, configure K to be 3. When the largest value of l/ 2KMl is less than or equal to 1 /224, the configuring unit 501 is to configure M^ and n to be 8 and 2 respectively. When the largest value of l/ 2KMl is less than or equal to 1 /227, the configuring unit 501 is to configure M^ and n to be 9 and 2 respectively. When the largest value of l/ 2KMl is less than or equal to 1 /230, the configuring unit 501 is to configure M^ and n to be 10 and 3 respectively. The configuring unit 501 is also to determine M2 to be 3 according to Mi .
[0080] Those skilled in the art may understand that the units in the network devices of the examples disclosed herein may be distributed in the network devices of the example according to the descriptions of the examples, and may also be varied to be located in one or more network devices different from those of the examples. The units of the above examples may be integrated into one unit or may be further divided into multiple sub-units.
[0081 ] Generally speaking, examples of the present disclosure may replace the modular algorithm with an add operation, may perform the add operation on limited partitions of a balance calculation value, and may distribute a received packet to a queue with a queue number equaling a result obtained from the add operation. Thus, resource consumption may be reduced, and the efficiency of packet dispersion may be improved. The packet dispersion method disclosed herein may be applied to a network device having multiple cores and may distribute packet traffic to multiple data cores as evenly as possible.
[0082] Based on the descriptions of the examples above, those skilled in the art would clearly understand that the examples may be implemented by machine-readable instructions plus a necessary common hardware platform, and/or they may also be implemented by hardware. Based on such understanding, the examples substantially or in individual parts may be presented in a form of machine-readable instructions that are stored in a non-transitory computer readable storage medium including several instructions to make a computing device (may be a mobile phone, a personal computer, a server, a network device, etc.,) execute the method of the examples.
[0083] Figure 6 is a schematic diagram illustrating another network device that may implement the packet dispersion method according to the first example of the present disclosure discussed above. As shown in figure 6, the network device may include a processor 601 and a memory 602.
[0084] The network device may implement the packet dispersion method according to the first example of the present disclosure discussed above, and the processor 601 and the memory 602 implements the following operations.
[0085] The memory 602 is to store machine readable instructions.
[0086] The processor 601 is to communicate with the memory 602 and to execute machine readable instructions in the memory 602 to:
Pre-configure queues with queue numbers from 0 to 2K-1 , pre-configure numerical values Mi , M2, Mn in a descending order, in which, Mi may be determined according to the range of the ratioi/ 2™ of traffic of a queue with queue number 0 to total traffic, in which M, may be determined according to Mi , in which, i=2, n, and K, n, i , Mi , M2> Mn are natural numbers, Mn-i> Mn=2; receive a packet; extract feature information of the packet according to the type of the packet, and perform a balance calculation according to the feature information; divide a balance calculation value into multiple K-bit partitions, obtain M-\ K-bit partitions from the multiple K-bit partitions, and perform an add operation on the M^ K-bit partitions, divide a result obtained from the add operation into M2 K-bit partitions; obtain the M2 K-bit partitions, and perform an add operation on the M2 K-bit partitions, divide the result obtained from the add operation of the M2 K-bit partitions into M3 K-bit partitions, then obtain the M3 K-bit partitions and perform an add operation on the M3 K-bit partitions, and process the rest in the same manner, until dividing the result obtained from the add operation of the Mn-i K-bit partitions into Mn K-bit partitions; obtain the Mn K-bit partitions and perform an add operation on the Mn K-bit partitions, and further divide the result obtained from the add operation of the Mn K-bit partitions into Mn K-bit partitions, obtain the current Mn K-bit partitions and perform an add operation on the current Mn K-bit partitions, and obtain a result of the add operation of the current Mn K-bit partitions; distribute the packet to a queue with a queue number equaling to the result of the add operation of the current Mn K-bit partitions.
[0087] The network device may further include 2K - 1 data cores. Correspondingly, the processor 601 may further execute machine readable instructions in the memory 602 to: configure the queues with queue numbers from 1 to 2K - 1 to respectively correspond to the 2K - 1 data cores, and configure the queue with queue number 0 to correspond to a data core corresponding to the queue with queue number Q, in which, \ < Q < 2K-\ and Q is a natural number.
[0088] Each data core is to process packets in a queue corresponding to the data core. [0089] According to an example, the processor 601 may execute machine readable instructions in the memory 602 to: divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, fill in at least one bit of 0 to compose a K-bit partition; and select M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the balance calculation value starting from the low-bit to the high-bit.
[0090] Alternatively, the processor 601 may execute machine readable instructions in the memory 602 to: divide the balance calculation value into multiple K-bit partitions starting from the low-bit to the high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, disregard the highest bits; and select M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the balance calculation value starting from the low-bit to high-bit or from the high-bit to the low-bit.
[0091 ] The processor 601 may execute machine readable instructions in the memory 602 to: determine M,, i=2 , n according to M^ based on the above-mentioned formula 1 , namely
Figure imgf000022_0001
may denote a rounding up, 1≤i-1≤n.
[0092] The processor 601 may execute machine readable instructions memory 602 to: in the example in which there are seven data cores, and K is 3, when the largest value of l/ 2KMl is less than or equal to 1 /224, configure M^ and n to be 8 and 2 respectively; when the largest value of 1 / 2™1 is less than or equal to 1 /227, configure M^ and n to be 9 and 2 respectively; when the largest value of l/ 2KMl is less than or equal to 1 /230, configure M^ and n to be 10 and 3 respectively; and determine M2 to be 3 according to Mi .
[0093] The network device shown in figure 6 may implement the packet dispersion method according to the second example of the present disclosure discussed above, and the processor 601 and the memory 602 implements the following operations.
[0094] The memory 602 is to store machine readable instructions.
[0095] The processor 601 is to communicate with the memory 602, and to execute machine readable instructions in the memory 602 to:
pre-configure queues with queue numbers from 1 to 2K-1 , pre-configure numerical values M1 ; M2, Mn in a descending order; in which, Iv^ may be determined according to the range of the ratioi/ 2™1 of non-balance traffic to total traffic. Mi may be determined according to Mi , wherein, i=2, n, and K, n, i, Mi , M2, Mn are natural numbers, Mn-i> Mn=2; receive a packet;
extract feature information of the packet according to the type of the packet, and perform a balance calculation according to the feature information; divide a value obtained from the balance calculation into multiple K-bit partitions, obtain M^ K-bit partitions from the multiple K-bit partitions, and perform an add operation on the M^ K-bit partitions, divide a result obtained from the add operation into M2 K-bit partitions; obtain the M2 K-bit partitions, perform an add operation on the M2 K-bit partitions, and divide the result obtained from the add operation of the M2 K-bit partitions into M3 K-bit partitions, then obtain the M3 K-bit partitions and perform an add operation on the M3 K-bit partitions, and process the rest in the same manner, until dividing the result obtained from the add operation of the Mn-i K-bit partitions into Mn K-bit partitions; obtain Mn K-bit partitions and perform an add operation on the Mn K-bit partitions, and further divide the result obtained from the add operation of the Mn K-bit partitions into Mn K-bit partitions, obtain the current Mn K-bit partitions and perform an add operation on the current Mn K-bit partitions, and obtain a result of the add operation of the current Mn K-bit partitions; when the result obtained from the add operation of the current Mn K-bit partitions is not 0, distribute the packet to a queue with a queue number equaling the result of the add operation of the current Mn K-bit partitions; when the result obtained from the add operation of the current Mn K-bit partitions is 0, distribute the packet to a queue with a queue number being one of 1 to 2K-1 according to a preset strategy.
[0096] The network device may further include 2K - 1 data cores. Correspondingly, the processor 601 may further execute machine readable instructions in the memory 602 to: configure the queues with queue numbers for 1 to 2K - 1 to respectively correspond to the 2K - 1 data cores.
[0097] Each data core is to process packets in a queue corresponding to the data core.
[0098] According to an example, the processor 601 may execute machine readable instructions in the memory 602 to: divide the value obtained from the balance calculation into multiple K-bit partitions starting from the low-bit to the high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, fill in at least one bit of 0 to compose a K-bit partition; and select M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to high-bit.
[0099] Alternatively, the processor 601 may execute machine readable instructions in the memory 602 to: divide the value obtained from the balance calculation into multiple K-bit partitions starting from the low-bit to the high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, disregard the highest bits; select M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit or from the high-bit to the low-bit.
[0100] The processor 601 may execute machine readable instructions in the memory 602 to: determine M,, i=2 , n, according to M^ based on the above-mentioned formula 1 , namely |~log2
Figure imgf000025_0001
, in which, may denote a rounding up, 1≤i-1≤n.
[0101 ] The processor 601 may execute machine readable instructions in the memory 602 to: in the example in which there are seven data cores, configure K to be 3, when the largest value of l/2KMl is less than or equal to 1 /224, configure M^ and n to be 8 and 2 respectively; when the largest value of 1/ 2™1 is less than or equal to 1/227, configure M^ and n to be 9 and 2 respectively; when the largest value of 1/ 2™1 is less than or equal to 1/230, configure Mi and n to be 10 and 3 respectively; and determine M2 to be 3 according to Mi .
[0102] The above examples can be implemented by hardware, software or firmware or a combination thereof. For example the various methods, processes and functional modules or units described herein may be implemented by a processor (the term processor is to be interpreted broadly to include a CPU, processing unit, microprocessor, microcontroller, ASIC (Application Specific Integrated Circuit), logic unit, or programmable gate array etc.). The processes, methods and functional modules or units may all be implemented by a single processor or split between several processers; reference in this disclosure or the claims to a 'processor' should thus be interpreted to mean One or more processors'. The processes, methods and functional modules or units may be implemented as machine readable instructions executable by one or more processors, hardware logic circuitry of the one or more processors or a combination thereof. Further, the teachings herein may be implemented in the form of a software product. The computer software product is stored in a non-transitory machine readable storage medium and comprises a plurality of instructions for making a computer device (for example a personal computer, a server, or a network device such as a router, switch, access point etc.) implement the methods recited in the examples of the present disclosure.
[0102] What has been described and illustrated herein is an example along with some of its variations. The terms, descriptions and figures used herein are set forth by way of illustration only and are not meant as limitations. Many variations are possible within the spirit and scope of the subject matter, which is intended to be defined by the following claims ~ and their equivalents ~ in which all terms are meant in their broadest reasonable sense unless otherwise indicated.

Claims

Claims
1 . A packet dispersion method comprising:
pre-configuring queues with queue numbers from 0 to 2K-1 ;
pre-configuring numerical values Mi , M2, Mn in a descending order; wherein, M^ is determined according to the range of the ratio i/ 2™ of traffic of a queue with queue number 0 to total traffic, M, is determined according to Mi , wherein, i=2, n, and K, n, i , Mi , M2, Mn are natural numbers, and Mn-i> Mn=2; receiving a packet, extracting feature information of the packet according to the type of the packet, performing a balance calculation according to the feature information, and dividing a value obtained from the balance calculation into multiple K-bit partitions;
obtaining M^ K-bit partitions from the multiple K-bit partitions, performing an add operation on the M^ K-bit partitions, and dividing a result obtained from the add operation into M2 K-bit partitions;
obtaining the M2 K-bit partitions, performing an add operation on the M2 K-bit partitions, dividing the result obtained from the add operation of the M2 K-bit partitions into M3 K-bit partitions, obtaining the M3 K-bit partitions and performing an add operation on the M3 K-bit partitions, performing the subsequent processing until dividing the result obtained from the add operation of the Mn-i K-bit partitions into Mn K-bit partitions;
obtaining the Mn K-bit partitions and performing an add operation on the Mn K-bit partitions, and further dividing the result obtained from the add operation of the Mn K-bit partitions into Mn K-bit partitions, obtaining the current Mn K-bit partitions and performing an add operation on the current Mn K-bit partitions; and
distributing the packet to a queue with a queue number equaling a result of the add operation of the current Mn K-bit partitions.
2. The method according to claim 1 , wherein the method is applied to a network device comprising 2 - 1 data cores; wherein the queues with queue numbers from 1 to 2K - 1 respectively correspond to the 2K - 1 data cores, and the queue with queue number 0 corresponds to a data core corresponding to a queue with queue number Q, wherein, 1 < Q < 2K-l and Q is a natural number; and
each data core is to process packets in a queue corresponding to the data core.
3. The method according to claim 1 , wherein dividing the value obtained from the balance calculation into multiple K-bit partitions comprises: dividing the value obtained from the balance calculation into multiple K-bit partitions starting from a low-bit to a high-bit, when there are less than K bits left after obtaining some K-bit partitions, filling in at least one bit of 0 to compose a K-bit partition;
wherein obtaining Iv^ K-bit partitions from the multiple K-bit partitions comprises: selecting M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit.
4. The method according to claim 1 , wherein dividing the value obtained from the balance calculation into multiple K-bit partitions comprises: dividing the value obtained from the balance calculation into multiple K-bit partitions starting from a low-bit to a high-bit, when there are less than K bits left after obtaining some K-bit partitions, disregarding the remaining less than K bits;
wherein obtaining Mi K-bit partitions from the multiple K-bit partitions comprises: selecting M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit or from the high-bit to the low-bit.
5. The method according to claim 1 , wherein M, is determined according to the following formula: |"log2 Mi_1(2if -1)] /A , [ denotes rounding up, i=2 , n.
6. A packet dispersion method comprising:
pre-configuring queues with queue numbers from 0 to 2K-1 ;
pre-configuring numerical values Mi , M2, Mn in a descending order; wherein, Mi is determined according to the range of the ratio 1/2™1 of non-balance traffic to total traffic, M, is determined according to Mi , wherein, i=2, n, and K, n, i , Mi , M2, Mn are natural numbers, and Mn-i> Mn=2; receiving a packet, extracting feature information of the packet according to the type of the packet, performing a balance calculation according to the feature information, and dividing a value obtained from the balance calculation into multiple K-bit partitions;
obtaining M^ K-bit partitions from the multiple K-bit partitions, performing an add operation on the
Figure imgf000029_0001
K-bit partitions, and dividing a result obtained from the add operation into M2 K-bit partitions;
obtaining the M2 K-bit partitions, performing an add operation on the M2 K-bit partitions, dividing the result obtained from the add operation of the M2 K-bit partitions into M3 K-bit partitions, obtaining the M3 K-bit partitions and performing an add operation on the M3 K-bit partitions, performing the subsequent processing until dividing the result obtained from the add operation of the Mn-i K-bit partitions into Mn K-bit partitions;
obtaining the Mn K-bit partitions and performing an add operation on the Mn K-bit partitions, and further dividing the result obtained from the add operation of the Mn K-bit partitions into Mn K-bit partitions, obtaining the current Mn K-bit partitions and performing an add operation on the current Mn K-bit partitions;
when the result obtained from the add operation of the current Mn K-bit partitions is not 0, distributing the packet to a queue with a queue number equaling the result of the add operation of the current Mn K-bit partitions; when the result obtained from the add operation of the current Mn K-bit partitions is 0, distributing the packet to a queue with a queue number being one of 1 to 2 -1 according to a preset strategy.
7. The method according to claim 6, wherein the method is applied to a network device comprising 2K - 1 data cores; wherein the queues with queue numbers from
1 to 2K - 1 respectively correspond to the 2K - 1 data cores; and wherein each data core is to process packets in a queue corresponding to the data core.
8. The method according to claim 6, wherein dividing the value obtained from the balance calculation into multiple K-bit partitions comprises: dividing the value obtained from the balance calculation into multiple K-bit partitions starting from a low-bit to a high-bit, when there are less than K bits left after obtaining some K-bit partitions, filling in at least one bit of 0 to compose a K-bit partition;
wherein obtaining Mi K-bit partitions from the multiple K-bit partitions comprises: selecting M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to the high-bit.
9. The method according to claim 6, wherein dividing the value obtained from the balance calculation into multiple K-bit partitions comprises: dividing the value obtained from the balance calculation into multiple K-bit partitions starting from a low-bit to a high-bit, when there are less than K bits left after obtaining some K-bit partitions, disregarding the remaining less than K bits;
wherein obtaining Mi K-bit partitions from the multiple K-bit partitions comprises: selecting M-\ K-bit partitions from the multiple K-bit partitions achieved by dividing the value obtained from the balance calculation starting from the low-bit to high-bit or from the high-bit to the low-bit.
10. The method according to claim 6, wherein M, is determined according to the following formula:
-l)] / * , ] denotes rounding up, i=2 , n.
Figure imgf000031_0001
11 A network device, comprising:
a processor; and
a memory to store machine readable instructions;
wherein the processor is to communicate with the memory and to execute machine readable instructions in the memory to:
pre-configure queues with queue numbers from 0 to 2K-1 ; pre-configure numerical values Mi , M2, Mn in a descend order, in which, Mi is determined according to the range of the ratioi/ 2™ of traffic of a queue with queue number 0 to total traffic, M, is determined according to Mi , in which, i=2 , ... , n, and K, n J , Mi , M2, Mn are natural numbers, and Mn-i > Mn=2;
receive a packet;
extract feature information of the packet according to the type of the packet, and perform a balance calculation according to the feature information;
divide a value obtained from the balance calculation into multiple K-bit partitions, obtain M^ K-bit partitions from the multiple K-bit partitions, and perform an add operation on the M^ K-bit partitions, divide a result obtained from the add operation into M2 K-bit partitions; obtain the M2 K-bit partitions, and perform an add operation on the M2 K-bit partitions, divide the result obtained from the add operation of the M2 K-bit partitions into M3 K-bit partitions, obtain the M3 K-bit partitions and perform an add operation on the M3 K-bit partitions, and perform the subsequent processing until dividing the result obtained from the add operation of the Mn-1 K-bit partitions into Mn K-bit partitions; obtain the Mn K-bit partitions and perform an add operation on the Mn K-bit partitions, and further divide the result obtained from the add operation of the Mn K-bit partitions into Mn K-bit partitions, obtain the current Mn K-bit partitions and perform an add operation on the current Mn K-bit partitions, and obtain a result of the add operation of the current Mn K-bit partitions; and
distribute the packet to a queue with a queue number equaling to the result of the add operation of the current Mn K-bit partitions.
12. The network device according to claim 11 , further comprising 2K - 1 data cores;
wherein the processor is further to execute machine readable instructions in the memory to:
configure the queues with queue numbers from 1 to 2K - 1 to respectively correspond to the 2K - 1 data cores, and configure the queue with queue number 0 to correspond to a data core corresponding to the queue with queue number Q , wherein, \ < Q < 2K-\ and Q is a natural number; and
wherein each data core is to process packets in a queue corresponding to the data core.
13. The network device according to claim 11 , wherein the processor is further to execute machine readable instructions in the memory to: divide the value obtained from the balance calculation into multiple K-bit partitions starting from a low-bit to a high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, fill in at least one bit of 0 to compose a K-bit partition; and select Mi K-bit partitions from the multiple K-bit partitions achieved by dividing the balance calculation value starting from the low-bit to the high-bit.
14. The network device according to claim 11 , wherein the processor is further to execute machine readable instructions in the memory to: divide the value obtained from the balance calculation into multiple K-bit partitions starting from a low-bit to a high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, disregard the remaining less than K bits; select M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the balance calculation value starting from the low-bit to the high-bit or from the high-bit to the low-bit.
15. The network device according to claim 11 , wherein M, is determined according to the following formula:
-l)] / * |~ denotes rounding up, i=2, n.
Figure imgf000033_0001
16. A network device comprising:
a processor; and
a memory to store machine readable instructions;
wherein the processor is to communicate with the memory and to execute machine readable instructions in the memory to:
pre-configure queues with queue numbers from 1 to 2K-1 ; pre-configure numerical values Mi , M2, Mn in a descending order, wherein, M^ is determined according to the range of the ratioi/ 2™ of non-balance traffic to total traffic, M, is determined according to Mi , wherein, i=2, n, and K, n, i , Mi , M2, Mn are natural numbers, and Mn-i> Mn=2;
receive a packet;
extract feature information of the packet according to the type of the packet, and perform a balance calculation according to the feature information;
divide a value obtained from the balance calculation into multiple K-bit partitions, obtain M-\ K-bit partitions from the multiple K-bit partitions, and perform an add operation on the M^ K-bit partitions, divide a result obtained from the add operation into M2 K-bit partitions; obtain the M2 K-bit partitions, perform an add operation on the M2 K-bit partitions, and divide the result obtained from the add operation of the M2 K-bit partitions into M3 K-bit partitions, obtain the M3 K-bit partitions and perform an add operation on the M3 K-bit partitions, and perform the subsequent processing until dividing the result obtained from the add operation of the Mn-i K-bit partitions into Mn K-bit partitions; obtain Mn K-bit partitions and perform an add operation on the Mn K-bit partitions, and further divide the result obtained from the add operation of the Mn K-bit partitions into Mn K-bit partitions, obtain the current Mn K-bit partitions and perform an add operation on the current Mn K-bit partitions, and obtain a result of the add operation of the current Mn K-bit partitions;
when the result obtained from the add operation of the current Mn K-bit partitions is not 0, distribute the packet to a queue with a queue number equaling the result of the add operation of the current Mn K-bit partitions; when the result obtained from the add operation of the current Mn K-bit partitions is 0, distribute the packet to a queue with a queue number being one of 1 to 2K-1 according to a preset strategy.
17. The network device according to claim 16, further comprising 2K - 1 data cores;
wherein the processor is further to execute machine readable instructions in the memory to: configure the queues with queue numbers from 1 to 2K - 1 to respectively correspond to the 2K - 1 data cores; and
wherein each data core is to process packets in a queue corresponding to the data core.
18. The network device according to claim 16, wherein the processor is further to execute machine readable instructions in the memory to: divide the value obtained from the balance calculation into multiple K-bit partitions starting from a low-bit to a high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, fill in at least one bit of 0 to compose a K-bit partition; and select M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the balance calculation value starting from the low-bit to the high-bit.
19. The network device according to claim 16, wherein the processor is further to execute machine readable instructions in the memory to: divide the value obtained from the balance calculation into multiple K-bit partitions starting from a low-bit to a high-bit, when there are less than K bits left in the highest bits after obtaining some K-bit partitions, disregard the remaining less than K bits; select M^ K-bit partitions from the multiple K-bit partitions achieved by dividing the balance calculation value starting from the low-bit to the high-bit or from the high-bit to the low-bit.
20. The network device according to claim 16, wherein M, is determined according to the following formula:
denotes rounding up, i=2, n.
Figure imgf000035_0001
PCT/CN2013/071931 2012-02-29 2013-02-27 Packet dispersion method and network device thereof WO2013127336A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210049250.5A CN102546441B (en) 2012-02-29 2012-02-29 Message diversion method and network equipment
CN201210049250.5 2012-02-29

Publications (1)

Publication Number Publication Date
WO2013127336A1 true WO2013127336A1 (en) 2013-09-06

Family

ID=46352429

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/071931 WO2013127336A1 (en) 2012-02-29 2013-02-27 Packet dispersion method and network device thereof

Country Status (2)

Country Link
CN (1) CN102546441B (en)
WO (1) WO2013127336A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546441B (en) * 2012-02-29 2014-09-17 杭州华三通信技术有限公司 Message diversion method and network equipment
CN105207948B (en) * 2014-06-30 2019-05-31 中兴通讯股份有限公司 The distribution method and device of data message
CN104158764B (en) * 2014-08-12 2018-02-06 新华三技术有限公司 Message processing method and device
CN108667733A (en) * 2018-03-29 2018-10-16 新华三信息安全技术有限公司 A kind of network equipment and message processing method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1642146A (en) * 2005-01-07 2005-07-20 清华大学 Bag-preprocessing circuit assembly of interface card for high-speed network diversion equipment
US20090263129A1 (en) * 2008-04-18 2009-10-22 Mrv Communications, Inc. High-speed packet/ethernet devices, methods, systems and networks incorporating tunable pluggable optics for packet switching and routing functions, and incorporating gmps as the control plane
CN101656677A (en) * 2009-09-18 2010-02-24 杭州迪普科技有限公司 Message diversion processing method and device
CN101984598A (en) * 2010-11-04 2011-03-09 成都市华为赛门铁克科技有限公司 Message forwarding method and deep packet inspection (DPI) device
CN102546441A (en) * 2012-02-29 2012-07-04 杭州华三通信技术有限公司 Message diversion method and network equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100502329C (en) * 2003-03-05 2009-06-17 华为技术有限公司 Ethernet exchanger and its service processing method
CN101286936B (en) * 2008-05-16 2010-10-27 成都市华为赛门铁克科技有限公司 Method and apparatus for data message processing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1642146A (en) * 2005-01-07 2005-07-20 清华大学 Bag-preprocessing circuit assembly of interface card for high-speed network diversion equipment
US20090263129A1 (en) * 2008-04-18 2009-10-22 Mrv Communications, Inc. High-speed packet/ethernet devices, methods, systems and networks incorporating tunable pluggable optics for packet switching and routing functions, and incorporating gmps as the control plane
CN101656677A (en) * 2009-09-18 2010-02-24 杭州迪普科技有限公司 Message diversion processing method and device
CN101984598A (en) * 2010-11-04 2011-03-09 成都市华为赛门铁克科技有限公司 Message forwarding method and deep packet inspection (DPI) device
CN102546441A (en) * 2012-02-29 2012-07-04 杭州华三通信技术有限公司 Message diversion method and network equipment

Also Published As

Publication number Publication date
CN102546441A (en) 2012-07-04
CN102546441B (en) 2014-09-17

Similar Documents

Publication Publication Date Title
US9317336B2 (en) Method and apparatus for assignment of virtual resources within a cloud environment
US8566822B2 (en) Method and system for distributing hypervisor functionality over multiple physical devices in a network and configuring sub-hypervisor to control the virtual machines
US9794185B2 (en) Bandwidth guarantee and work conservation
US9727386B2 (en) Method and apparatus for network resource virtual partitioning
US20140025823A1 (en) Methods for managing contended resource utilization in a multiprocessor architecture and devices thereof
US20160350146A1 (en) Optimized hadoop task scheduler in an optimally placed virtualized hadoop cluster using network cost optimizations
US20160380885A1 (en) Apparatus and method for hardware-accelerated packet processing
Wang et al. PRSFC-IoT: A performance and resource aware orchestration system of service function chaining for Internet of Things
WO2015141337A1 (en) Reception packet distribution method, queue selector, packet processing device, and recording medium
US20190052567A1 (en) Non-random flowlet-based routing
Luo Network I/O virtualization for cloud computing
CN107995123A (en) A kind of SiteServer LBS and method based on interchanger
EP3366014A1 (en) Reduced orthogonal network policy set selection
EP3014444A1 (en) Computing connected components in large graphs
WO2013127336A1 (en) Packet dispersion method and network device thereof
US11394804B2 (en) System and method for stateless distribution of bidirectional flows with network address translation
US11726829B2 (en) Adaptive, performance-oriented, and compression-assisted encryption scheme
US20190042314A1 (en) Resource allocation
CN105159779A (en) Method and system for improving data processing performance of multi-core CPU
CN106598727B (en) A kind of computational resource allocation method and system of communication system
Zhang et al. TCAM space-efficient routing in a software defined network
WO2015032430A1 (en) Scheduling of virtual machines
CN107493574B (en) Wireless controller equipment, parallel authentication processing method, system and networking device
Ke et al. Parallel prioritized flow scheduling for software defined data center network
US10965602B2 (en) Software assisted hashing to improve distribution of a load balancer

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13755703

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13755703

Country of ref document: EP

Kind code of ref document: A1