Method and device for MAC port message statistics RAM multiplexing

By employing a multiplexing scheme of multiple ports and RAM in the MAC port packet statistics device, the problem of frequent RAM read/write in high-speed mode is solved, achieving efficient RAM utilization and cost reduction.

CN115798543BActive Publication Date: 2026-06-05SUZHOU CENTEC COMM CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU CENTEC COMM CO LTD
Filing Date
2021-09-09
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing MAC port message statistics RAM multiplexing devices require frequent RAM read and write operations in high-speed mode, resulting in increased clock frequency, high chip manufacturing costs, and serious resource waste.

Method used

By employing a multiplexing scheme of multiple ports and multiple random access memories, RAM resources are dynamically allocated according to the port rate, thereby achieving efficient utilization of RAM and reducing the total RAM storage space and chip area.

Benefits of technology

Without affecting performance, the frequency of RAM usage and chip area were reduced, manufacturing costs were decreased, and RAM utilization and control unit processing efficiency were improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115798543B_ABST
    Figure CN115798543B_ABST
Patent Text Reader

Abstract

The application provides a MAC port message statistics RAM multiplexing method and device. The MAC port message statistics RAM multiplexing device comprises a plurality of ports configured to receive or send messages; and a plurality of random access memories configured to be read and written by the plurality of ports to count the messages of the corresponding ports; at least one port in the plurality of ports is configured to be connected with at least two random access memories to read and write the at least two random access memories. The MAC port message statistics RAM multiplexing device provided by the application has a larger total capacity of the ports, and can support a longer time without overflow, thereby reducing the frequency of the control unit reading the random access memories and reducing the burden of the control unit. The multiplexing of the random access memories effectively reduces the area of the chip; under the condition of meeting the same port rate, the manufacturing cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network communication technology, and in particular to a method and device for RAM multiplexing for MAC port message statistics. Background Technology

[0002] In devices that reuse RAM for Ethernet MAC port packet statistics, it is necessary to count the number of transmitted and received packets and the number of bytes per packet, based on port location, packet format, and packet length. Message types include, for example, multicast, unicast, broadcast, error messages, control messages, etc. For instance, when a 65-byte unicast packet is received, the statistics module will perform the following:

[0003] 1. Read the data from the "Messages between 64 and 128 bytes in length" field of the Random Access Memory (RAM). This data includes the total number of messages and the total number of bytes received previously (messages between 64 and 128 bytes in length); 2. Increment the number of messages read by 1 and the number of bytes by 65; 3. Write the calculated total number of messages and the total number of bytes back to the "Messages between 64 and 128 bytes in length" field of the RAM.

[0004] II. 1. Read the data from the "(Unicast type message)" column in RAM. This data includes the total number of previously received "(Unicast type message)" messages and the total number of bytes. 2. Increment the read message count by 1 and the byte count by 65. 3. Write the calculated total number of messages and bytes back to the "(Unicast type message)" column in RAM.

[0005] Therefore, for each received message, the statistics module needs to read and write to the RAM of 1R1W twice; similarly, for each sent message, the statistics module also needs to read and write to the RAM of 1R1W twice.

[0006] Generally, the port modes of devices that use RAM multiplexing for MAC port packet statistics are compatible. When the port operates in high-speed mode, for example, 800G, the packet rate can reach 1.2Gpps. As mentioned above, each received or sent packet requires two reads and two writes to the RAM. This means 4.8G reads and writes to the RAM per second. If a single 1R1W type RAM is used, the clock frequency needs to be 4.8GHz. If two 1R1W type RAMs are used, storing the data in the sending and receiving directions separately, the clock frequency needs to be 2.4GHz.

[0007] As clock frequencies increase, the delay of each gate circuit must be reduced in order to complete the same number of logic operations within one clock cycle. This increases the challenges to chip manufacturing processes and raises the cost of chip production.

[0008] Furthermore, the RAM storage space in ASICs is relatively small, requiring software to periodically read data from RAM. It's crucial to ensure that the software can read and clear the data before the RAM overflows. In high-speed port mode, RAM fills up more quickly, and if the software processing speed is slow or there are many tasks, it may be unable to read data in time before RAM overflows.

[0009] In existing technologies, each port corresponds to a fixed RAM. When a port is not enabled, its corresponding RAM is idle, resulting in a waste of resources.

[0010] Therefore, it is necessary to improve the existing MAC port message statistics RAM multiplexing equipment. Summary of the Invention

[0011] In view of the above-mentioned technical problems existing in the prior art, this application provides a device for multiplexing the random access memory for packet statistics of high-speed ports and other rates of packets. The device effectively reduces the use of statistical random access memory without affecting the performance of high-speed port packet statistics, thereby reducing the total storage space of random access memory, and thus reducing the chip area and manufacturing cost.

[0012] This application provides a device for RAM multiplexing for MAC port message statistics, comprising: multiple ports configured to receive or send messages; and multiple random access memories configured to be read and written by the multiple ports to perform statistics on the messages of the corresponding ports; at least one of the multiple ports is configured to be connected to at least two of the random access memories to perform read and write access on the at least two random access memories.

[0013] Optionally, at least one of the plurality of ports is connected to all of the random access memory (RAM) to enable read and write access to all of the RAM.

[0014] Optionally, each of the ports is connected to at least one of the random access memories for read and write access to the connected random access memories.

[0015] Optionally, it also includes: a message recognition module, which can identify the number of message start characters and message end characters in the current clock cycle based on the content of the message.

[0016] Optionally, the message identification module is configured to: for messages that end within the current clock cycle, generate and output the message type and message length; for messages that do not end within the current clock cycle, calculate and latch the counted message type and message length for output when the message ends.

[0017] Optionally, it also includes: a random access memory selection module, which can calculate all the random access memories currently owned by the port based on the current port rate of the port, and then calculate the random access memory to be read and written based on the current number of packets to be counted and the previous random access memory selection situation, and read / process / write back the packet length and packet type of each packet from the corresponding random access memory.

[0018] Optionally, the storage space of the plurality of random access memories is equal.

[0019] Optionally, it also includes a control unit configured to: in response to a message readout command, read out and accumulate all the data in the random access memory used by the corresponding port and then output it.

[0020] To achieve the above-mentioned objectives, this application also provides a method for MAC port packet statistics RAM multiplexing, which uses the MAC port packet statistics RAM multiplexing device described above to perform packet statistics.

[0021] This invention achieves statistical analysis of high-speed ports without increasing additional random access memory overhead or sacrificing performance by reusing random access memory; effectively reduces chip area; increases the utilization rate of random access memory; increases the storage capacity of high-speed ports; and reduces the processing burden on the control unit. Attached Figure Description

[0022] Figure 1 A schematic diagram of the structure of each port and its corresponding random access memory in a device that uses RAM for MAC port message statistics, provided for embodiments of this application, in the first operating mode;

[0023] Figure 2 A schematic diagram of the structure of each port and its corresponding random access memory in the second operating mode of a device that uses RAM for MAC port message statistics provided in the embodiments of this application;

[0024] Figure 3 A schematic diagram of the structure of each port and its corresponding random access memory in a device that uses RAM multiplexing for MAC port message statistics, provided for embodiments of this application, in a third operating mode;

[0025] Figure 4 This is a schematic diagram illustrating the process of accessing the random access memory during message transmission in an embodiment of this application. Detailed Implementation

[0026] In the following, exemplary embodiments will be described in detail with reference to the accompanying drawings. However, this application is not limited to the embodiments described below, but includes various changes, substitutions, and modifications within the technical scope of this disclosure. The terms "first," "second," etc., can be used to interpret various elements, and the number of elements is not limited by such terms. These terms are only used to distinguish one element from another. Therefore, an element referred to as a first element in one embodiment may be referred to as a second element in another embodiment. Unless the context requires otherwise, the singular form does not exclude the plural form. The following specific embodiments illustrate the implementation of this application, and those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification.

[0027] Example

[0028] This embodiment provides a device for RAM multiplexing in MAC port packet statistics, such as... Figure 1 As shown, taking an example with eight ports 1, namely: first port 11, second port 12, third port 13, fourth port 14, fifth port 15, sixth port 16, seventh port 17 and eighth port 18, each port 1 is configured to receive or send messages; the device with MAC port message statistics RAM multiplexing also includes multiple random access memories 2, configured for read and / or write access by the eight ports 1, to count the message information (e.g., number of messages, message length, number of bytes) of messages received and sent by the ports 1; in this embodiment, the number of random access memories 2 is also set to eight, namely first random access memory 21, second random access memory 22, third random access memory 23, fourth random access memory 24, fifth random access memory 25, sixth random access memory 26, seventh random access memory 27 and eighth random access memory 28.

[0029] Taking the maximum port bandwidth supported by each random access memory 2 as an example, which is 100Gbps.

[0030] The MAC port packet statistics RAM multiplexing device provided in this embodiment can operate in at least three operating modes. The first operating mode is as follows: Figure 1 As shown: the first port 11 is communicatively connected to the first random access memory 21 to the eighth random access memory 28, so that the device with MAC port message statistics RAM multiplexing can operate in a port rate of 800G mode.

[0031] Second operating mode, such as Figure 2 As shown: the first port 11 to the eighth port 18 are respectively connected to the first random access memory 21 to the eighth random access memory 28, so that the device with MAC port message statistics RAM multiplexing can operate in the mode of eight 100G ports.

[0032] The third operating mode, such as Figure 3 As shown: the first port 11 is communicatively connected to the first random access memory 21 to the fourth random access memory 24, the fifth port 15 is communicatively connected to the fifth random access memory 25 and the sixth random access memory 26, the seventh port 17 is communicatively connected to the seventh random access memory 27, and the eighth port 18 is communicatively connected to the eighth random access memory 28, so that the device with MAC port message statistics RAM multiplexing can operate in a mode with one 400G port, one 200G port, and two 100G ports.

[0033] Optionally, in this embodiment, the device that reuses MAC port message statistics RAM can adaptively switch between a first operating mode, a second operating mode, and a third operating mode based on usage requirements, so as to match port statistics for ports of different rates without the need to set up an additional random access memory 2.

[0034] It should be noted that the number of ports 1, the number of random access memories 2, and the combinations of ports 1 and random access memories 2 in the first to third operating modes shown in this embodiment are merely illustrative examples and not intended to limit the scope of this application. Based on this application, those skilled in the art will understand that the number of ports 1 and random access memories 2 in a device that uses MAC port message statistics RAM can be set based on usage requirements, and ports 1 and random access memories 2 can also be freely combined based on usage requirements in each operating mode, as long as at least one of the multiple ports 1 is configured to be connected to at least two random access memories 2 to perform read and write access to at least two random access memories 2.

[0035] Optionally, such as Figure 4 As shown, the MAC port message statistics RAM multiplexing device provided in this embodiment also includes: a message recognition module 3, which can identify the number of message start characters and message end characters in the current clock cycle based on the content of the message, and thereby confirm the number of messages in the current clock cycle.

[0036] Optionally, the message identification module 3 is configured to: generate and output the message type and message length for messages that end within the current clock cycle;

[0037] For messages that have not ended within the current clock cycle, the counted message type and message length are calculated and latched for output when the message ends.

[0038] Optionally, continue to refer to Figure 4 The device for MAC port packet statistics RAM multiplexing also includes: a random access memory selection module 4, which can calculate the current random access memory 2 of port 1 based on the current port rate of port 1, and then calculate the random access memory 2 to be read and written based on the number of packets that need to be counted and the previous selection of read and write random access memory 2. It also reads / processes / writes back the packet length and packet type of each packet from the corresponding random access memory 2, thereby realizing the switching of port 1 between different operating modes.

[0039] Optionally, the random access memory selection module 4 can employ a polling mechanism to ensure that the values ​​in each random access memory 2 increase at a basically the same rate.

[0040] Optionally, the device for multiplexing MAC port message statistics RAM also includes a control unit (not shown), which is configured to: in response to a message read command, read out all the data in the random access memory 2 used by the corresponding port 1, accumulate them, and then output them. This setting can avoid the problem of a mismatch between the number of bytes read and the number of messages due to the delay when reading each random access memory 2.

[0041] The MAC port packet statistics RAM multiplexing device provided in this embodiment, by allocating multiple random access memories 2 to one port 1, has at least the following advantages compared to the scheme of allocating a single random access memory 2 to one port 1:

[0042] ① Port 1 has a larger total capacity, so it can support a longer period of time without overflowing, thereby reducing the frequency at which the control unit reads random access memory 2 and reducing the burden on the control unit.

[0043] ② The reuse of random access memory 2 effectively reduces the chip area; and reduces manufacturing costs while meeting the same port speed requirements.

[0044] Optionally, this embodiment provides a method for MAC port packet statistics RAM multiplexing, using the device described above for MAC port packet statistics RAM multiplexing to perform packet statistics.

[0045] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A device for multiplexing RAM for MAC port message statistics, characterized in that, include: Multiple ports are configured to receive or send messages; as well as Multiple random access memories are configured to be read and written to the multiple ports in order to count the packets of the corresponding ports; At least one of the plurality of ports is configured to be connected to at least two of the random access memories for read and write access to at least two of the random access memories; The device also includes: The random access memory selection module can calculate all the random access memories currently owned by the port based on the current port rate, and then calculate the random access memory to be read or written based on the current number of packets to be counted and the previous random access memory selection. The module also reads, processes, and writes back the packet length and packet type of each packet from the corresponding random access memory.

2. The device for MAC port message statistics RAM multiplexing as described in claim 1, characterized in that, At least one of the plurality of ports is connected to all of the random access memory (RAM) to enable read and write access to all of the RAM.

3. The device for MAC port message statistics RAM multiplexing as described in claim 1, characterized in that, Each of the ports is connected to at least one of the random access memories for read and write access to the connected random access memories.

4. The device for RAM multiplexing MAC port packet statistics as described in any one of claims 1-3, characterized in that, Also includes: The message recognition module is able to identify the number of message start characters and message end characters in the current clock cycle based on the content of the message.

5. The device for MAC port message statistics RAM multiplexing as described in claim 4, characterized in that, The message identification module is configured to: for a message that ends within the current clock cycle, generate and output the message type and message length; For messages that have not ended within the current clock cycle, the counted message type and message length are calculated and latched for output when the message ends.

6. The device for MAC port packet statistics RAM multiplexing as described in any one of claims 1-3 and 5, characterized in that, The storage space of the multiple random access memories is equal.

7. The device for MAC port packet statistics RAM multiplexing as described in any one of claims 1-3 and 5, characterized in that, Also includes: The control unit is configured to, in response to a message readout command, read out all the data in the random access memory used by the corresponding port, accumulate them, and then output them.

8. A method for RAM multiplexing in MAC port packet statistics, characterized in that, The device that uses RAM multiplexing for MAC port packet statistics according to any one of claims 1-7 performs packet statistics.