# US 12,224,941 B2 · Method and apparatus for flexible and efficient analytics in a network switch

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,224,941 B2
- Document ID: US12224941B2
- Status: Granted
- Kind: B2
- Application number: 18/116,948
- Filed: 2023-03-03
- Published: 2023-07-06
- Granted: 2025-02-11
- Earliest claimed: 2014-05-28
- Assignees: Marvell Asia Pte Ltd
- Applicants: Marvell Asia Pte., Ltd.
- Inventors: Weihuang Wang; Gerald Schmidt; Tsahi Daniel; Saurabh Shrivastava
- Web page: https://patentgrep.com/patent/US12224941B2

## CPC

- H04L 43/0894: Packet rate
- H04L 12/1407: {Policy-and-charging control [PCC] architecture}
- H04L 12/1435: {volume-based}
- H04L 41/0893: Assignment of logical groups to network elements
- H04L 41/0894: Policy-based network configuration management
- H04L 43/0805: by checking availability
- H04L 43/0888: Throughput
- H04L 47/20: Traffic policing
- H04L 41/142: using statistical or mathematical methods
- H04M 15/58: {based on statistics of usage or network monitoring}
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- H04M: TELEPHONIC COMMUNICATION (circuits for controlling other apparatus via a telephone cable and not involving telephone switching apparatus G08)

## Abstract

Embodiments of the present invention relate to a centralized network analytic device, the centralized network analytic device efficiently uses on-chip memory to flexibly perform counting, traffic rate monitoring and flow sampling. The device includes a pool of memory that is shared by all cores and packet processing stages of each core. The counting, the monitoring and the sampling are all defined through software allowing for greater flexibility and efficient analytics in the device. In some embodiments, the device is a network switch.

## Claims

### Claim 1

A method of a network switch comprising:
partitioning a pool of shared memories into a plurality of homogeneous analytics banks;
programmably configuring each of a plurality of client interfaces as one of four modes:
counter, policing, policing with billing counters or sampling;
programmably mapping each of the plurality of client interfaces to a subset of the plurality of homogeneous analytics banks;
programmably assigning each of the plurality of homogeneous analytics banks as one of three modes: counter, policing or sampling; and
parallel processing multiple requests received at the plurality of client interfaces.

### Claim 2 (depends on 1)

The method of claim 1, wherein the parallel processing multiple requests comprises, for each of the multiple requests:
determining a target analytics bank and a target entry address within the target analytics bank;
when the target analytics bank is in the counter mode, the target analytics bank performing at least one operation, wherein the at least one operation includes sum of square, summation or event count;
when the target analytics bank is in the policing mode, the target analytics bank performing a two-rate three-color rate monitoring function; and
when the target analytics bank is in the sampling mode, the target analytics bank supporting N/M random sampling, wherein N contiguous events are sampled in every M events interval.

### Claim 3 (depends on 2)

The method of claim 2, wherein when the target analytics bank is in the counter mode, the method further includes determining a counter entry within the target analytics bank based on the target entry address and determining a memory row within the target analytics bank to store counter values.

### Claim 4 (depends on 3)

The method of claim 3, further comprising calculating standard deviation of network activities.

### Claim 5 (depends on 2)

The method of claim 2, wherein when the target analytics bank is in the policing mode, the target analytics bank returning a color of a packet to an originating client interface of the packet.

### Claim 6 (depends on 5)

The method of claim 5, further comprising the target analytics bank sending a counter request to an immediately next analytics bank for calculating byte count for the packet in each color.

### Claim 7 (depends on 2)

The method of claim 2, wherein when the target analytics bank is in the sampling mode, the target analytics bank returns a response to an originating client interface of the request.

### Claim 8 (depends on 4)

The method of claim 4, wherein calculating the sum of square includes incrementing the value of an events field by one for each incoming request, calculating the summation includes incrementing the value of a sum field by the value of the incoming request, and calculating the event count includes incrementing the value of a sum OfSquare field by the square of the value of the incoming request.

### Claim 9 (depends on 8)

The method of claim 8, wherein the counter processing unit calculates the standard deviation of network activities by subtracting the square of average of sum from the average of sumOfSquare.

### Claim 10 (depends on 6)

The method of claim 6, wherein the target analytics bank and the immediately next analytics bank are interconnected through the interconnect.

### Claim 11 (depends on 10)

The method of claim 10, wherein the target analytics bank and the immediately next analytics bank are homogenous.

### Claim 12 (depends on 2)

The method of claim 2, further comprising a bank memory, wherein the counter values are stored in the bank memory.

### Claim 13

A method of a network switch comprising:
providing a first analytics bank configured in a policing mode;
providing a second analytics bank configured in a in counting mode, each of the first analytics bank and the second analytics bank comprising a counter processing unit, a policing processing unit and a sampling processing unit, and the second analytics bank being immediately adjacent to the first analytics bank within a common memory pool; and
sending a counter request with the police processing unit to the counter processing unit of the second analytics bank to calculate byte count for a packet in each color.

### Claim 14 (depends on 13)

The method of claim 13, further comprising the counter processing unit of the second analytics bank calculating sum of square, summation and event count for network activity statistical analysis.

### Claim 15 (depends on 14)

The method of claim 14, further comprising the counter processing unit of the second analytics bank calculating a standard deviation of network activities.

### Claim 16 (depends on 14)

The method of claim 14, wherein calculating the sum of square includes incrementing the value of an events field by one for each incoming request, calculating the summation includes incrementing the value of a sum field by the value of the incoming request, and calculating the event count includes incrementing the value of a sum OfSquare field by the square of the value of the incoming request.

### Claim 17 (depends on 15)

The method of claim 15, further comprising the counter processing unit of the second analytics bank calculating the standard deviation of network activities by subtracting the square of average of sum from the average of sumOfSquare.

### Claim 18 (depends on 13)

The method of claim 13, wherein the first analytics bank and the second analytics bank are interconnected through the interconnect.

### Claim 19 (depends on 13)

The method of claim 13, wherein the first analytics bank and the second analytics bank are homogenous.

### Claim 20 (depends on 13)

The method of claim 13, wherein each of the first analytics bank and the second analytics bank further comprise a bank memory, further comprising when no result response goes out of the first analytics bank, the first analytics bank storing counter values in the bank memory of the first analytics bank.

### Claim 21 (depends on 13)

The method of claim 13, further comprising the policing processing unit of the first analytics bank performing a two-rate three color rate monitoring function.

### Claim 22 (depends on 13)

The method of claim 13, wherein every row of the first analytics bank has one policer of the policing processing unit of the first analytics bank, wherein the policer has configuration and internal state.

### Claim 23 (depends on 19)

The method of claim 19, further comprising the policing processing unit of the first analytics bank returning a color of a packet to one of a plurality of client interfaces that originated the packet.

### Claim 24 (depends on 19)

The method of claim 19, further comprising when the first analytics bank is in sampling mode, the sampling processing unit of the first analytics bank performs N/M random sampling, wherein N contiguous events are sampled in every M events interval.

### Claim 25

A method of a network switch comprising:
directing output data of a memory bypass module of an analytics bank to one of a counter processing unit, a policing processing unit or a sampling processing unit of the analytics bank; and
switching the analytics bank from one of counting with the counter processing unit, policing with the policing processing unit and sampling with the sampling processing unit to another of the counting with the counter processing unit, the policing with the policing processing unit and the sampling with the sampling processing unit by switching where the output data of the memory bypass module is directed from the one of the counter processing unit, the policing processing unit or the sampling processing unit to a different one of the counter processing unit, the policing processing unit and the sampling processing unit.
