Network packet mirroring method based on network-on-chip, network-on-chip module and network device
By introducing on-chip networking technology into the chip and increasing the path of the mirrored NOC node, the forwarding of mirrored packets and service packets is decoupled, which solves the chip processing burden problem caused by the mirroring method and reduces the internal processing pressure.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, port mirroring leads to a doubling of the internal processing traffic of the chip, increasing the chip's processing burden.
By introducing Network on Chip (NOC) technology, a mirror NOC node path is added near the data interface, and the mirror NOC node is used to forward mirror packets, thus decoupling the forwarding of mirror packets from service packets.
This decouples the forwarding of mirror messages from service messages, reducing the processing pressure inside the chip.
Smart Images

Figure CN121334091B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the chip technical field, and particularly to a message mirroring method based on a network-on-chip, a network-on-chip module and a network device. BACKGROUND
[0002] Port message mirroring as a basic function of a network device is increasingly common. The corresponding mirroring methods can be: 1, uplink port mirroring (also called ingress port mirroring); 2, downlink port mirroring (also called egress port mirroring). However, the conventional mirroring method generally does not allow modification of the original message, and needs to copy the message, thus causing the traffic to be doubled in the chip processing, thereby increasing the processing burden of the chip. SUMMARY
[0003] The embodiments of the present application provide a message mirroring method based on a network-on-chip, a network-on-chip module and a network device, which are used to solve the problem of chip processing burden caused by coupling of service messages and mirror messages.
[0004] In a first aspect, the embodiments of the present application provide a message mirroring method based on a network-on-chip, comprising:
[0005] When a data source interface obtains a to-be-converted message, a corresponding target mirror NOC source node is determined according to a mirror data bus structure; the mirror data bus structure is used to represent the mirror mapping relationship between the data interface and at least one mirror NOC node; the target mirror NOC source node belongs to the mirror NOC node; any data interface is the data source interface or a data destination interface;
[0006] The data source interface forwards a mirror message from the data source interface to the target mirror NOC source node; the mirror message is obtained by copying the to-be-converted message;
[0007] The target mirror NOC source node sends the mirror message to the next mirror NOC node through a mirror link; the mirror link is used to connect two adjacent mirror NOC nodes;
[0008] The next mirror NOC node determines the forwarding operation of the mirror message according to an action table; the action table is used to indicate the forwarding direction of the next mirror NOC node;
[0009] If the action table indicates that the next mirror NOC node is a target mirror NOC destination node, the next mirror NOC node forwards the mirror message to the data destination interface;
[0010] If the action table indicates that the forwarding direction is the target direction, then the next mirror NOC node will forward the mirror packet to the mirror NOC node corresponding to the target direction.
[0011] Optionally, before the step of determining the corresponding target image NOC source node based on the image data bus structure, the method further includes:
[0012] Configure the image enable flag and image flag of the data source interface; the image enable flag is used to indicate whether image forwarding is performed; the image flag is used to indicate the target image NOC source node corresponding to the data source interface;
[0013] The step of determining the corresponding target image NOC source node based on the image data bus structure by the data source interface includes:
[0014] When the mirroring enable flag is enabled, the data source interface determines that the packet to be forwarded needs to be mirrored and forwarded.
[0015] The data source interface determines the target image NOC source node corresponding to the data source interface based on the image identifier in the image data bus structure.
[0016] Optionally, the step of the next mirror NOC node determining the forwarding operation of the mirrored packet according to the action table includes:
[0017] The next mirror NOC node determines whether to perform a forwarding operation based on the valid bits in the action table;
[0018] If so, the next mirror NOC node determines whether it is the target mirror NOC destination node based on the destination node identifier bit in the action table; the next mirror NOC node confirms the forwarding direction based on the forwarding direction identifier bit in the action table.
[0019] The step of the next mirror NOC node forwarding the mirror packet to the mirror NOC node corresponding to the target direction includes:
[0020] If the forwarding direction flag indicates forwarding to the left, the next mirror NOC node will forward the mirror packet to the corresponding next mirror NOC node to the left.
[0021] If the forwarding direction flag indicates forwarding to the right, then the next mirror NOC node will forward the mirror packet to the right to the corresponding next mirror NOC node.
[0022] Optionally, it also includes:
[0023] If any of the mirrored NOC nodes receives mirrored packets from multiple input directions, the matching forwarding direction is determined in the action table based on the mirrored identifier corresponding to each mirrored packet.
[0024] The mirror NOC node sends the mirror packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction, according to the forwarding direction.
[0025] Optionally, it also includes:
[0026] When the mirror NOC node receives mirror messages from multiple input directions, it caches the mirror messages from the multiple input directions.
[0027] Based on the priority of the mirror identifier corresponding to each mirror packet from high to low, the steps of determining the matching forwarding direction in the action table according to the mirror identifier corresponding to each mirror packet, and the mirror NOC node sending the mirror packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction according to the forwarding direction are executed sequentially.
[0028] Secondly, embodiments of this application provide an on-chip network module comprising at least one mirror NOC node path; adjacent mirror NOC nodes on the mirror NOC node path are connected by a mirror link; each mirror NOC node is matched with a corresponding data interface; any of the data interfaces is a data source interface or a data destination interface;
[0029] When the data interface is the data source interface and a message to be forwarded is obtained, the data interface is used to determine the corresponding target mirror NOC source node according to the mirror data bus structure; forward the mirror message from the data source interface to the target mirror NOC source node; the mirror data bus structure is used to characterize the mirror mapping relationship between the data interface and at least one mirror NOC node; the target mirror NOC source node belongs to the mirror NOC node; the mirror message is obtained by copying the message to be forwarded.
[0030] The target mirror NOC source node is used to send the mirror message to the next mirror NOC node via the mirror link;
[0031] The next mirror NOC node is used to determine the forwarding operation of the mirror packet according to the action table; if the action table indicates that the next mirror NOC node is the destination node of the target mirror NOC, the mirror packet is forwarded to the data destination interface; if the action table indicates that the forwarding direction is the target direction, the mirror packet is forwarded to the mirror NOC node corresponding to the target direction; the action table is used to indicate the forwarding direction of the next mirror NOC node.
[0032] Optionally, the next mirror NOC node is specifically used to determine whether to perform a forwarding operation based on the valid bits in the action table; if so, it determines whether the next mirror NOC node is the destination node of the target mirror NOC based on the destination node identifier bit in the action table; it determines the forwarding direction based on the forwarding direction identifier bit in the action table; if the forwarding direction identifier bit indicates left forwarding, the mirror packet is forwarded left to the corresponding next mirror NOC node; if the forwarding direction identifier bit indicates right forwarding, the mirror packet is forwarded right to the corresponding next mirror NOC node.
[0033] Optionally, the mirror NOC node is configured to, when receiving mirror packets from multiple input directions, determine a matching forwarding direction in the action table based on the mirror identifier corresponding to each mirror packet; and send the mirror packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction according to the forwarding direction.
[0034] Thirdly, embodiments of this application provide a network device, which is equipped with an on-chip network module as described in any of the second aspects to perform the method as described in any of the first aspects.
[0035] Fourthly, embodiments of this application provide a chip that performs the method described in any of the first aspects.
[0036] The technical solutions provided in the embodiments of this specification may include the following beneficial effects:
[0037] By adding an on-chip network module to the existing data interface architecture of the chip, at least one mirror NOC node path is added in the area close to each data interface. Mirror NOC nodes on the mirror NOC node path are used to forward mirrored packets, thereby decoupling the forwarding of mirrored packets from the forwarding of service packets and reducing the processing load inside the chip.
[0038] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description
[0039] Figure 1 This is a diagram illustrating regular mirror forwarding.
[0040] Figure 2 A schematic diagram of a mirror forwarding mechanism based on an on-chip network module provided in an embodiment of the present invention;
[0041] Figure 3 A schematic diagram of another mirroring forwarding mechanism based on an on-chip network module provided in an embodiment of the present invention;
[0042] Figure 4 A schematic diagram of the input and output of a mirrored NOC node provided in an embodiment of the present invention;
[0043] Figure 5 A schematic diagram of a mirrored NOC node provided in an embodiment of the present invention;
[0044] Figure 6 This is a schematic diagram of another mirrored NOC node provided in an embodiment of the present invention;
[0045] Figure 7 This is a schematic diagram of a target mirror NOC destination node processing mechanism provided in an embodiment of the present invention;
[0046] Figure 8 A schematic diagram of another mirroring forwarding mechanism based on an on-chip network module provided in an embodiment of the present invention;
[0047] Figure 9 A flowchart illustrating a packet mirroring method based on on-chip network provided in an embodiment of the present invention;
[0048] Figure 10 A flowchart illustrating another packet mirroring method based on on-chip network provided in an embodiment of the present invention;
[0049] Figure 11 A flowchart illustrating another packet mirroring method based on on-chip network provided in an embodiment of the present invention;
[0050] Figure 12 A flowchart illustrating another packet mirroring method based on on-chip network provided in an embodiment of the present invention;
[0051] Figure 13 This is a structural diagram of a network device provided in an embodiment of the present invention. Detailed Implementation
[0052] The exemplary embodiments will now be described in detail. When the description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification; they are merely exemplary embodiments of apparatuses and methods consistent with some aspects of this specification.
[0053] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” used in this specification are also intended to include the plural forms unless the context clearly indicates otherwise. It should be understood that, in the description of this specification, unless otherwise stated, “a plurality” means two or more; “if” can be interpreted as “when,” “when,” or “in response to a determination.”
[0054] In this specification, directional terms such as "up," "down," "left," "right," "north," "south," "west," and "east" may be defined relative to the orientation of the components shown in the accompanying drawings. It should be understood that these directional terms can be relative concepts, used for relative description and clarification, and may change accordingly depending on the orientation of the components in the accompanying drawings.
[0055] In this specification, unless otherwise expressly specified and limited, the term "connection" shall be interpreted broadly. For example, "connection" may be a fixed connection, a detachable connection, or an integral part; it may be a direct connection or an indirect connection through an intermediate medium.
[0056] In conventional packet mirroring and forwarding implementations, taking uplink inbound port mirroring as an example, there are typically two methods: 1. Mirroring is performed as soon as the packet enters the uplink source interface. The mirrored packet needs to follow the normal forwarding data path, meaning it shares resources with the original service packet. Clearly, as data traffic in network devices increases, this mirroring and forwarding mechanism will significantly impact network device performance. 2. Mirroring is performed after the packet has completed uplink processing at the interface. However, if uplink processing involves modifying the packet, the mirrored packet will also be distorted. While disallowing uplink processing from modifying the packet can avoid distortion, it significantly limits the flexibility of the process design.
[0057] Specifically, Figure 1 This is a diagram illustrating a standard mirror forwarding process. See also... Figure 1 If the message comes from Figure 1 The data enters through the upper data interface and exits through the lower data interface. The upper data interfaces include: Data Interface 0, Data Interface 1, Data Interface 2, and Data Interface 3; the lower data interfaces include: Data Interface 4, Data Interface 5, Data Interface 6, and Data Interface 7. During this process, network devices may perform various operations on the packets, i.e., internal processing, such as parsing, verification, table lookup, decision-making, quality of service (QoS) adjustments, and security processing.
[0058] For example, when a service message is transmitted to "Data Interface 0", its forwarding path is: Internal Processing 00, Internal Processing 01, Internal Processing 11, Internal Processing 12, and the destination interface "Data Interface 5". Taking the mirroring forwarding mechanism of "Uplink Inbound Port Mirroring" mentioned above as an example, after "Data Interface 0" obtains the service message, it copies it. At this time, the copied mirrored message still needs to occupy the relevant resources of the internal processing, such as... Figure 1 The mirror forwarding path shown is: internal processing 00, internal processing 10, internal processing 20, internal processing 21, internal processing 22, and the destination interface "data interface 6".
[0059] Clearly, the aforementioned uplink inbound port mirroring forwarding mechanism imposes additional resource consumption on network devices. Furthermore, the common downlink outbound port mirroring forwarding mechanism typically requires looping back uplink, retracing the data path, resulting in considerable complexity and bandwidth waste.
[0060] Therefore, when analyzing the conventional mirror forwarding mechanism, the inventors found that how to decouple the "mirror message" from the "business message" became a major direction for optimizing the solution.
[0061] To address the aforementioned issues, the inventors introduced Network on Chip (NOC) technology. Combining the characteristics of NOC with a scalable and modular design approach, they achieved decoupling between "mirror messages" and "service messages." Specifically, Figure 2 This is a schematic diagram of a mirroring forwarding mechanism based on an on-chip network module provided in an embodiment of the present invention. See [link / reference]. Figure 2 ,by Figure 1 Based on the given data interfaces 0-7 and the related internal processing architecture, without changing the original business forwarding structure, this application adds at least one mirror NOC node path 100 in the area close to each data interface. Figure 2 Taking a mirrored NOC node path 100 as an example, the software configuration is then used to determine whether mirror forwarding is required for insulation, thereby enabling mirror forwarding through the mirrored NOC node path.
[0062] Each data interface is matched with a corresponding mirror NOC node, for example... Figure 2 The data interface 0 matches the settings of the mirrored NOC node 00.
[0063] Any two adjacent mirrored NOC nodes are connected via a mirror link; for example, mirrored NOC node 00 and mirrored NOC node 04 are connected via mirror link 100a. This mirror link can be understood as the network link in the NOC architecture that connects any two mirrored NOC nodes. And for... Figure 2Each data interface shown can serve as a data source interface or a data destination interface for message forwarding, depending on the input direction of the message. Optionally, taking the message entering data interface 0 as an example, data interface 0 is the data source interface and receives the message to be forwarded. Then, data interface 0 is used to determine the corresponding target mirror NOC source node according to the mirror data bus structure.
[0064] In a real-world mirror forwarding mechanism, the NOC architecture can have multiple mirror NOC node paths. Therefore, each data interface can correspond to multiple mirror NOC nodes. Thus, this mirror data bus structure is used to represent the mirror mapping relationship between a data interface and at least one mirror NOC node.
[0065] Therefore, in a scenario where there is only one mirror NOC node, the target mirror NOC source node corresponding to data interface 0 is mirror NOC node 00.
[0066] It should be noted that if data interface 0 corresponds to multiple mirror NOC nodes, and there are multiple different mirror packets that need to be forwarded, then this mirror NOC node can correspond to multiple mirror NOC source nodes. The target mirror NOC source node described in this application example is the mirror NOC source node corresponding to a specific mirror path forwarding.
[0067] Then, the data interface 0 copies the corresponding mirror message to be forwarded and forwards the mirror message to the target mirror NOC source node, i.e., mirror NOC node 00.
[0068] Mirror NOC node 00 is used to send mirrored packets to the next mirrored NOC node via the mirrored link, such as... Figure 2 As shown, the next mirror NOC node can be mirror NOC node 04.
[0069] Mirror NOC node 04 is used to determine the forwarding operation of mirrored packets based on the action table. If the action table indicates that the next mirrored NOC node is the destination node of the target mirrored NOC, the mirrored packet is forwarded to the data destination interface. If the action table indicates that the forwarding direction is the target direction, the mirrored packet is forwarded to the mirrored NOC node corresponding to the target direction. Each mirrored NOC node maintains an action table, which is used to indicate the forwarding direction of the next mirrored NOC node. This action table can be configured based on mirrored service requirements. Each entry in the table corresponds to a mirrored identifier (ID), that is, a mirrored service requirement. Optionally, when multiple mirrored identifiers exist, it indicates that there are multiple mirrored service requirements.
[0070] And in Figure 2In this example, the mirror NOC node 04 is obviously the destination node of the target mirror NOC. At this time, the mirror NOC node 04 will forward the mirror message to the data destination interface, i.e., data interface 4.
[0071] At this point, the original business message will continue to be forwarded through internal processing, such as... Figure 2 The service message shown passes through data interface 0, internal processing 00, internal processing 01, internal processing 11, and internal processing 11 before reaching data interface 5. This decouples the forwarding of mirrored messages from the forwarding of service messages, reducing the processing load on the chip's internal circuitry.
[0072] Optionally, for each data interface, a mirroring enable flag and a mirroring flag can be configured when configuring the data interface as a data source interface. The mirroring enable flag indicates whether mirroring forwarding is performed. The mirroring flag indicates the target mirror NOC source node corresponding to the data source interface.
[0073] For example, if the mirroring enable flag (enable=1) is set for data interface 0, then the service message will be copied as a mirror message to perform mirror forwarding.
[0074] Optionally, when the on-chip network module has multiple mirrored NOC node paths, each data interface can match multiple mirrored NOC nodes. Specifically, Figure 3 A schematic diagram of another mirroring forwarding mechanism based on an on-chip network module provided in this embodiment of the invention is shown below. Figure 3 The on-chip network module includes three mirrored NOC node paths: mirrored NOC node path 100, mirrored NOC node path 101, and mirrored NOC node path 102.
[0075] For data interface 0, there are 3 mirrored NOC nodes: mirrored NOC node 00, mirrored NOC node 01, and mirrored NOC node 02.
[0076] If, at this time, the mirror identifier corresponding to data interface 0 is 0, based on the mirror enable flag (enable=1), it means that the target mirror NOC source node corresponding to the mirror message is mirror NOC node 00.
[0077] It should be noted that the NOC architecture involved in this application can have various distributed network topologies, such as a two-dimensional matrix structure or a tree structure. Each functional module within the chip is considered a network node, such as the mirrored NOC node mentioned above, connected via mirror links. In the NOC architecture, different nodes can communicate in parallel. For example, in a two-dimensional matrix NOC architecture, the data interface can simultaneously transmit data to multiple mirrored NOC nodes. To identify the mirrored NOC nodes in the two-dimensional matrix structure, X-axis and Y-axis coordinates can be used to identify each mirrored NOC node.
[0078] For example, see Figure 3 The identifier "00" for mirror NOC node 00 can be understood from the two-dimensional matrix structure of NOC technology: the first "0" refers to the mirror NOC node path 100 (y coordinate) on the Y axis, while the second "0" refers to the mirror NOC node corresponding to data interface 0 on the X axis, namely mirror NOC node 00 (x coordinate).
[0079] If the mirror identifier = 1, the first "1" refers to the mirror NOC node path 101 (y coordinate), and the second "0" is the mirror NOC node corresponding to data interface 0 on the X axis, that is, mirror NOC node 10.
[0080] Optionally, this data interface 0, as a data source interface, can maintain message information and the target mirror NOC source node corresponding to the data source interface through the mirror data bus structure.
[0081] Optionally, an example of this mirrored data bus structure is shown in Table 1 below:
[0082]
[0083] In this structure, "valid" is the valid bit, which can be 1 bit, used to indicate whether the information in the mirrored data bus structure is valid. "mirror_id" is the mirror identifier, and its bit width is related to the number of mirrors. "sop" indicates the start of packet data and can be 1 bit. "eop" indicates the end of packet data and can be 1 bit. The "eop_length" bit width indicates the number of valid bytes in packet_data, and the "packet_data" bit width is related to interface performance.
[0084] Each mirror NOC node can maintain an action table to control forwarding operations. An example of an action table "mir_id action" is shown in Table 2 below:
[0085]
[0086] Here, "valid" is the validity bit, which can be 1 bit. If "valid=1", the mirror NOC node determines that it needs to forward mirror packets, for example, by using a bitmap to implement mirror packet forwarding. If "valid=0", the mirror NOC node does not forward mirror packets.
[0087] "Local" is the destination node identifier, which can be 1 bit. If "Local=1", it means that this mirror NOC node is the destination node of the target mirror NOC, or that the data interface corresponding to this mirror NOC node is the "observation port". Figure 3 For example, if the mirror NOC node 04 finds its corresponding action table and confirms "Local=1", it means that the mirror NOC node 04 needs to forward the mirror message to data interface 4.
[0088] "left" is the forwarding direction identifier for "forwarding to the left", and can be 1 bit. "If left=1", it indicates that the forwarding direction of the mirrored message is "forwarding to the left".
[0089] "right" is the forwarding direction identifier bit for "forwarding to the right", and can be 1 bit. "If right = 1", it indicates that the forwarding direction of the mirror message is "forwarding to the right".
[0090] Optional, with Figure 3 For example, if the mirror NOC node 00 checks its corresponding action table and confirms "left=1" and "right=0", then it confirms that its mirror packets are only forwarded to the left, meaning the mirror packets are forwarded to the next mirror NOC node 04. Optionally, the action table value of the mirror NOC node 00 can be set to 4'b1010 (where 4 represents the bit width, 'b indicates binary, and 1010 is the corresponding specific value), indicating that it only forwards to the left.
[0091] Optionally, for the three forwarding direction flags maintained by a mirror NOC node, one or a combination of them can be selected. For example, "(left=1 and right=1)" means that the mirror NOC node forwards mirror packets to both the next mirror NOC node to its left and the next mirror NOC node to its right. For the "target mirror NOC source node," generally "Local=0," meaning the mirror source port will not be the mirror destination port. If "valid=0," it indicates that the mirror identifier (mirror id) is not enabled. Optionally, software configuration can be used to ensure that mirror packets do not pass through the same mirror NOC node twice.
[0092] Therefore, for the next mirror NOC node, the specific actions are as follows: First, based on the valid bits in the action table, determine whether to perform a forwarding operation. If so, then based on the destination node identifier bit in the action table, determine whether the next mirror NOC node is the destination node of the target mirror NOC. Second, based on the forwarding direction identifier bit in the action table, determine the forwarding direction. If the forwarding direction identifier bit indicates left forwarding, then the mirror packet is forwarded left to the corresponding next mirror NOC node. If the forwarding direction identifier bit indicates right forwarding, then the mirror packet is forwarded right to the corresponding next mirror NOC node.
[0093] Optionally, the mirror NOC node involved in the architecture of this application can obtain mirror packets from multiple input directions. Each corresponding mirror NOC node can have multiple output directions to forward mirror packets.
[0094] Optional, Figure 4 This is a schematic diagram illustrating the input and output of a mirrored NOC node, provided as an embodiment of the present invention. See also... Figure 4 For mirrored NOC nodes, the input directions can be: data interface input, left input, and right input. The left input is the mirror message input from the left mirrored NOC node to this mirrored NOC node, and the right input is similar and will not be described in detail.
[0095] Its output direction can be: data interface output, left output, or right output.
[0096] Optional, based on Figure 4 For example, this application provides a possible way to implement a mirrored NOC node, specifically... Figure 5 A schematic diagram of a mirrored NOC node provided in an embodiment of the present invention is shown below. Figure 5 The mirror NOC node contains: selection switches, registers, multiplexers (MUX), and action tables (mir_id action).
[0097] The selection switch is used to determine whether the corresponding mirrored packet needs to undergo further forwarding processing based on the valid bit.
[0098] This register is used to store mirror messages and build the data structure of the action table in order to maintain the relevant information in the action table.
[0099] This multiplexer is used to determine the forwarding direction based on the query results of the action table, and to send the mirrored packet to the next mirrored NOC node or data destination interface corresponding to the forwarding direction.
[0100] In summary, for each mirror NOC node in this application example, when it receives mirror packets from multiple input directions, it determines the matching forwarding direction in the action table based on the mirror identifier corresponding to each mirror packet; and according to the forwarding direction, it sends the mirror packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction.
[0101] Optionally, for mirrored NOC nodes, to cope with the impact of a large number of mirrored packets, caching can be increased to improve resilience. Specifically, Figure 6 For another schematic diagram of a mirrored NOC node provided in an embodiment of the present invention, see [link to diagram]. Figure 6 Mirrored NOC nodes can have corresponding caches set on both the input and output sides.
[0102] For input or output buffers, a first-in-first-out (FIFO) queue can be used. When a mirror NOC node receives mirror messages from multiple input directions, the mirror messages from multiple input directions are buffered. For example, the mirror messages are stored in the input buffer.
[0103] Then, based on the priority of the mirror identifier corresponding to each mirror packet from high to low, the steps of determining the matching forwarding direction in the action table according to the mirror identifier corresponding to each mirror packet, and the mirror NOC node sending the mirror packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction according to the forwarding direction are executed one by one.
[0104] Optionally, this priority-based sequential processing can be executed separately in each output buffer. That is, in each output buffer, the priority order can be determined by the mirror identifier: the mirror packet corresponding to which mirror identifier is selected first is processed in priority order.
[0105] In summary, mirrored NOC nodes can be selected as either cached or uncached nodes as needed. Cached mirrored NOC nodes have stronger anti-collision capabilities, while uncached nodes consume fewer resources but require uninterrupted forwarding of mirrored packets. Optionally, of the three inputs, only one input is valid at any given time. Optionally, there are no restrictions on the outputs; theoretically, all three can be valid simultaneously. However, based on application requirements, it can be configured so that at most two outputs are valid.
[0106] Optionally, for a mirror NOC node that serves as the destination node of a target mirror NOC, it may encounter a situation where multiple mirror packets with different mirror identifiers all target the same mirror NOC node. The following provides an illustrative example of the handling mechanism for this situation. Specifically, Figure 7This is a schematic diagram illustrating a target mirror NOC destination node processing mechanism provided in an embodiment of the present invention. See also... Figure 7 For a mirror NOC node, when it receives mirror packets forwarded by the source node of the mirror NOC on multiple mirror NOC node paths, the mirror NOC node can use the mirror identifier carried by the NOC data bus to query its own action table. If it is confirmed that multiple mirror packets are all "local=1", then it will perform local mirror transmission processing, that is, forward these mirror packets to the corresponding data interface X.
[0107] Because multiple mirror packets may be destined for the same target mirror NOC on this node, when data arrives simultaneously, mirror packets with more than one mirror identifier can be cached locally first, such as... Figure 7 The “output buffer” shown can be a multiple-input, one-output FIFO queue architecture.
[0108] Therefore, the above priority processing method is adopted: the mirror message with the higher priority mirror identifier is forwarded to the data interface X, and then the mirror message with the second highest priority mirror identifier is read.
[0109] Optionally, to simplify processing, priorities can be assigned based on the size of the image identifier, with 0 being the highest priority, 1 being the second highest priority, etc. The specific implementation method is not limited here.
[0110] Figure 7 The multiplexer (MUX) shown can be flexibly customized according to application needs and cooperate with software configuration. For example, the multiplexer supports N input connections, meaning it supports multiple inputs and multiple outputs, and can limit how many mirror identifiers can share a single destination port simultaneously. For example, it can be limited to four simultaneously active mirror identifiers. That is, one of the destination ports of four mirror identifiers can simultaneously select the data interface X corresponding to the mirror NOC node. Optionally, multiple low-speed mirror source data interfaces (such as 10G interfaces) can all have their destination ports selected from a single data interface (such as a 100G interface).
[0111] If the chip deploying the on-chip network module in the example of this application only supports one mirror NOC destination node binding to one mirror NOC source node, then Figure 7 The multiplexer (MUX) only needs to support one output, and the subsequent multi-input, single-output FIFO queue can be omitted.
[0112] Optionally, if divided according to the number of data interfaces used as observation ports, this application can involve two scenarios: Scenario 1 - single observation port scenario; Scenario 2 - multiple observation port scenario.
[0113] For scenario 1, see above. Figure 3Data interface 0 transmits the mirrored message to data interface 4 via mirror NOC source node 00 and mirror NOC destination node 04. Since there is only one observation port "data interface 4", it demonstrates a typical single observation port scenario.
[0114] Therefore, based on this Figure 3 The example illustrates the functions of the data interface, mirror NOC source node, and mirror NOC destination node in a single observation port scenario.
[0115] First, regarding data interface 0:
[0116] Step 1: Configure mirroring enable flag=1 and mirroring flag=0. Service packets will be copied from the normal forwarding path according to mirroring enable flag=1 and used as mirror packets for mirroring forwarding.
[0117] Step 2: Based on the mirror identifier = 0, forward the mirror message to the corresponding mirror NOC source node 00.
[0118] For mirror NOC source node 00:
[0119] Step 1: Store the mirror message in a cache or register.
[0120] Step 2: Use the mirror identifier corresponding to the mirror message to find and obtain the local action table.
[0121] Step 3: Based on the value of the action table, such as "4'b1010", determine that the mirror message will only be forwarded to the left. Therefore, forward the mirror message to the mirror NOC node 04.
[0122] For mirror NOC destination node 04:
[0123] Step 1: Use the mirror identifier carried in the mirror message in the NOC data bus to look up the action table of this node. If "local=1" is confirmed, then the mirror NOC node 04 is the mirror NOC destination node 04.
[0124] Step 2: Forward the image message to the data interface 4 corresponding to the destination node 04 of the image NOC.
[0125] For scenario 2, the following example of mirror packet forwarding will illustrate the concept. Specifically, Figure 8 A schematic diagram of another mirroring forwarding mechanism based on an on-chip network module provided in this embodiment of the invention is shown below. Figure 8 Among them, mirror NOC node path 100, mirror NOC node path 101 and mirror NOC node path 102 are all ring structures.
[0126] Taking data interface 2 as the input port as an example, firstly, regarding data interface 2:
[0127] Step 1: On data interface 2, configure mirroring enable flag=1 and mirroring flag=1. The packet will be copied from the normal forwarding path according to mirroring enable flag=1 and used as a mirror packet to perform mirroring forwarding.
[0128] Step 2: Based on the mirror identifier = 1, forward the mirror packet to the corresponding mirror NOC node 12. Here, the first 1 represents the mirror NOC node path 101, which is the y-axis coordinate; the second 2 refers to the second mirror NOC node in the loop, namely mirror NOC node 12 (the source node of the target mirror NOC), which represents the x-axis coordinate.
[0129] For target image NOC source node 12:
[0130] Step 1: Store the mirror message in a cache or register.
[0131] Step 2: Use the mirror identifier corresponding to the mirror message to find and obtain the local action table.
[0132] Step 3: Based on the value in the action table, such as "4'b1011", determine whether to forward the mirror packet to both the left and right. Therefore, forward the mirror packet to... Figure 8 The left-hand mirror NOC node 11 and the right-hand mirror NOC node 13.
[0133] Furthermore, for scenarios with multiple observation ports, the mirrored NOC destination node corresponding to the mirrored message has two types: one is as follows: Figure 3 The mirrored NOC destination node 04 is the same, so it will not be described again here. Another example is... Figure 8 The mirror NOC destination node 13 shown simultaneously performs local mirror message forwarding from the mirror NOC destination node to the data interface, and also performs mirror message forwarding between mirror NOC nodes.
[0134] For target mirror NOC destination node 13:
[0135] Step 1: Store the mirror message in a cache or register.
[0136] Step 2: Use the mirror identifier corresponding to the mirror message to find and obtain the local action table.
[0137] Step 3: Based on the value in the action table, such as "4'b1101", determine that the mirror NOC node 13 is the target mirror NOC destination node, and forward the mirror packet to the right. Therefore, forward the mirror packet to data interface 13 and forward the mirror packet to mirror NOC node 17.
[0138] It should be noted that for the processing procedure of mirror NOC node 11 and mirror NOC node 17 as target mirror NOC destination nodes, please refer to [link / reference]. Figure 3 The mirror NOC destination node 04 is not described in detail here.
[0139] It should be noted that, for Figure 8 A ring-shaped mirror NOC node path can improve the flexibility and performance of mirror packet forwarding. Whether to use a ring-shaped mirror NOC node path in the example provided in this application depends on the actual scenario and is not limited here.
[0140] Optionally, for the example described above in this application, the data bus width of the on-chip network module can be 512 bits, and the clock frequency can be 1 GHz, thereby meeting the single-port 400Gbps line-speed mirroring capability. If the data bus width of the on-chip network module is 256 bits and the clock frequency is 500MHz, then the single-port 100Gbps line-speed mirroring capability can be met.
[0141] Optionally, the number of supported image identifiers can be increased by simply deploying several levels of image NOC node paths, making expansion easy.
[0142] Based on the on-chip network module and its corresponding functions provided in the above example, the following illustrative description of the executable process steps of the on-chip network module is given. Specifically, Figure 9 A flowchart illustrating a packet mirroring method based on on-chip network provided in an embodiment of the present invention is shown below. Figure 9 The method includes:
[0143] Step 201: When the data source interface receives the message to be forwarded, determine the corresponding target image NOC source node according to the image data bus structure.
[0144] Step 202: The data source interface forwards the image message to the target image NOC source node.
[0145] Step 203: The source node of the target mirror NOC sends the mirror message to the next mirror NOC node via the mirror link.
[0146] Optionally, for step 203, the target mirror NOC source node determines the next mirror NOC node based on its own maintained action table and performs the forwarding operation.
[0147] Step 204: The next mirror NOC node determines the forwarding operation of the mirrored packet based on the action table.
[0148] Step 205: If the action table indicates that the next mirror NOC node is the destination node of the target mirror NOC, then the next mirror NOC node will forward the mirror message to the data destination interface.
[0149] Step 206: If the action table indicates that the forwarding direction is the target direction, then the next mirror NOC node will forward the mirror packet to the mirror NOC node corresponding to the target direction.
[0150] The packet mirroring method based on on-chip network provided in this embodiment decouples the forwarding of mirrored packets from the forwarding of service packets through the architecture of the on-chip network module, thereby decoupling the forwarding paths of service packets and mirrored packets and reducing the internal processing pressure of the chip.
[0151] Optionally, for each data source interface, it can determine whether to forward mirrored packets and to which mirrored NOC source node to forward the mirrored packets using the mirroring enable flag and the mirroring flag. Specifically, in Figure 9 On this basis, Figure 10 A flowchart illustrating another packet mirroring method based on on-chip network provided in this embodiment of the invention is shown below. Figure 10 Before step 201, the method further includes:
[0152] Step 200: Configure the mirror enable flag and mirror flag for the data source interface.
[0153] Then step 201 includes:
[0154] Step 201-1: When the mirroring enable flag is enabled, the data source interface determines that the packets to be forwarded need to be mirrored and forwarded.
[0155] Step 201-2: The data source interface determines the target image NOC source node corresponding to the data source interface based on the image identifier in the image data bus structure.
[0156] Optionally, for the next mirror NOC node, it can determine the specific forwarding operation based on its own maintained action table. Specifically, in Figure 9 On this basis, Figure 11 A flowchart illustrating another packet mirroring method based on on-chip network provided in this embodiment of the invention is shown below. Figure 11 Step 204 includes:
[0157] Step 204-1: The next mirror NOC node determines whether to perform a forwarding operation based on the valid bits in the action table.
[0158] If yes, then steps 204-2 and 204-3 are executed; otherwise, mirror message forwarding is not performed.
[0159] Step 204-2: The next mirror NOC node determines whether it is the target mirror NOC destination node based on the destination node identifier bit in the action table.
[0160] If yes, then proceed to step 205; otherwise, do not forward the mirror message to the corresponding data interface.
[0161] Step 204-3: The next mirror NOC node confirms the forwarding direction based on the forwarding direction flag in the action table.
[0162] Correspondingly, step 206 includes:
[0163] Step 206-1: If the forwarding direction flag indicates leftward forwarding, the next mirror NOC node will forward the mirror packet to the corresponding next mirror NOC node.
[0164] Step 206-2: If the forwarding direction flag indicates forwarding to the right, the next mirror NOC node will forward the mirror packet to the right to the corresponding next mirror NOC node.
[0165] Optionally, for any mirror NOC node involved in the examples of this application, and for cases involving multiple input directions and multiple output directions of mirror packets, the following is a possible implementation method. Specifically, Figure 12 A flowchart illustrating another packet mirroring method based on on-chip network provided in this embodiment of the invention is shown below. Figure 12 The method includes:
[0166] Step 300: If any mirror NOC node receives mirror packets from multiple input directions, determine the matching forwarding direction in the action table based on the mirror identifier corresponding to each mirror packet.
[0167] Step 301: The mirror NOC node sends the mirrored packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction, based on the forwarding direction.
[0168] Optionally, if the mirror NOC node has a cache, there is a possible caching and forwarding mechanism before implementing the forwarding of mirror packets:
[0169] When a mirror NOC node receives mirror messages from multiple input directions, it caches the mirror messages from all input directions.
[0170] Based on the priority of the mirror identifier corresponding to each mirror packet from high to low, the steps of determining the matching forwarding direction in the action table according to the mirror identifier corresponding to each mirror packet, and the mirror NOC node sending the mirror packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction according to the forwarding direction are executed one by one.
[0171] Corresponding to the embodiments of the foregoing methods, this specification also provides embodiments of the apparatus and the terminal to which it is applied.
[0172] The embodiments described above can be applied to network devices. Network device embodiments can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, a logically defined network device is formed by its file processing processor reading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 13 As shown, Figure 13 A structural diagram of a network device provided in an embodiment of the present invention, except for Figure 13 In addition to the processor 410, memory 430, network interface 420, and non-volatile memory 440 shown, the on-chip network module 431 involved in the above embodiments of this application can be deployed on... Figure 13 The processor 410 shown is included. Depending on the actual functions of the network device, other hardware may also be included, which will not be described further.
[0173] The on-chip network module 431 can be implemented based on the above example of the on-chip network module, and it can perform the various steps in the above example to achieve the corresponding technical effects.
[0174] The processor 410 can be a variety of processors / chips, such as multi-core / many-core central processing units, system-on-a-chip, artificial intelligence accelerators, network processors and switching chips, graphics processors, and field-programmable gate arrays.
[0175] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0176] If a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a program product. This program product is stored in a computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0177] The above-mentioned example provided in this application, based on the on-chip network module's mirrored packet forwarding mechanism, has the following effects:
[0178] 1. Achieve traffic separation between normal business message forwarding traffic and mirrored message traffic, simplifying the internal processing mechanism of the chip.
[0179] Second, the mirroring capability is only limited by the mirroring NOC bandwidth of the on-chip network module, and it can easily achieve line-speed port mirroring.
[0180] Third, it supports mirror forwarding to multiple data destination interfaces. For example, it has a broad market application scenario for multi-user AI training and multi-user monitoring of the same data in the data center.
[0181] Fourth, the mirroring capabilities and specifications can be easily tailored or expanded to meet different application scenarios.
[0182] Fifth, regardless of whether mirror forwarding is performed at the data source interface or the data destination interface, the implementation mechanism is very simple and almost identical in this design, reducing implementation costs.
[0183] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative, and the modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0184] The foregoing has described exemplary embodiments of this specification. It should be understood that in some cases, the modules described in this specification may be divided in a manner different from that in the embodiments, and the described actions or steps may be performed in a different order than that in the embodiments, while still achieving the desired result. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0185] Other embodiments of this specification will readily occur to those skilled in the art upon consideration of the specification and practice of the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations that follow the general principles of this specification and include common knowledge or customary techniques in the art not illustrated herein.
[0186] The above are merely preferred embodiments of this specification and are not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification shall be included within the scope of protection of this specification.
Claims
1. A packet mirroring method based on on-chip networking, characterized in that, include: When the data source interface receives a message to be forwarded, it determines the corresponding target image NOC source node based on the image data bus structure. The mirrored data bus structure is used to characterize the mirror mapping relationship between the data interface and at least one mirrored NOC node; the target mirrored NOC source node belongs to the mirrored NOC node; any of the data interfaces is either the data source interface or the data destination interface; The data source interface forwards the mirror message to the target mirror NOC source node; the mirror message is obtained by copying the message to be forwarded. The target mirror NOC source node sends the mirror message to the next mirror NOC node via the mirror link; the mirror link is used to connect two adjacent mirror NOC nodes. The next mirror NOC node determines the forwarding operation of the mirrored packet according to the action table; the action table is used to indicate the forwarding direction of the next mirror NOC node. If the action table indicates that the next mirror NOC node is the destination node of the target mirror NOC, then the next mirror NOC node will forward the mirror message to the data destination interface; If the action table indicates that the forwarding direction is the target direction, then the next mirror NOC node will forward the mirror packet to the mirror NOC node corresponding to the target direction.
2. The method according to claim 1, characterized in that, Before the step of determining the corresponding target image NOC source node based on the image data bus structure, the method further includes: Configure the image enable flag and image flag of the data source interface; the image enable flag is used to indicate whether image forwarding is performed; the image flag is used to indicate the target image NOC source node corresponding to the data source interface; The step of determining the corresponding target image NOC source node based on the image data bus structure by the data source interface includes: When the mirroring enable flag is enabled, the data source interface determines that the packet to be forwarded needs to be mirrored and forwarded. The data source interface determines the target image NOC source node corresponding to the data source interface based on the image identifier in the image data bus structure.
3. The method according to claim 1, characterized in that, The steps for the next mirror NOC node to determine the forwarding operation of the mirrored packet based on the action table include: The next mirror NOC node determines whether to perform a forwarding operation based on the valid bits in the action table; If so, the next mirror NOC node determines whether it is the target mirror NOC destination node based on the destination node identifier bit in the action table; the next mirror NOC node confirms the forwarding direction based on the forwarding direction identifier bit in the action table. The step of the next mirror NOC node forwarding the mirror packet to the mirror NOC node corresponding to the target direction includes: If the forwarding direction flag indicates forwarding to the left, the next mirror NOC node will forward the mirror packet to the corresponding next mirror NOC node to the left. If the forwarding direction flag indicates forwarding to the right, then the next mirror NOC node will forward the mirror packet to the right to the corresponding next mirror NOC node.
4. The method according to claim 1, characterized in that, Also includes: If any of the mirrored NOC nodes receives mirrored packets from multiple input directions, the matching forwarding direction is determined in the action table based on the mirrored identifier corresponding to each mirrored packet. The mirror NOC node sends the mirror packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction, according to the forwarding direction.
5. The method according to claim 4, characterized in that, Also includes: When the mirror NOC node receives mirror messages from multiple input directions, it caches the mirror messages from the multiple input directions. Based on the priority of the mirror identifier corresponding to each mirror packet from high to low, the steps of determining the matching forwarding direction in the action table according to the mirror identifier corresponding to each mirror packet, and the mirror NOC node sending the mirror packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction according to the forwarding direction are executed sequentially.
6. An on-chip network module, characterized in that, It includes at least one mirror NOC node path; two adjacent mirror NOC nodes on the mirror NOC node path are connected by a mirror link; each mirror NOC node is matched with a corresponding data interface; any of the data interfaces is a data source interface or a data destination interface. When the data interface is the data source interface and a message to be forwarded is obtained, the data interface is used to determine the corresponding target mirror NOC source node according to the mirror data bus structure. The image message is forwarded from the data source interface to the target image NOC source node; The mirrored data bus structure is used to characterize the mirrored mapping relationship between the data interface and at least one mirrored NOC node; The target mirror NOC source node belongs to the mirror NOC node; The mirror message is obtained by copying the message to be forwarded; The target mirror NOC source node is used to send the mirror message to the next mirror NOC node via the mirror link; The next mirror NOC node is used to determine the forwarding operation of the mirrored packet according to the action table; If the action table indicates that the next mirror NOC node is the target mirror NOC destination node, the mirror packet is forwarded to the data destination interface; if the action table indicates that the forwarding direction is the target direction, the mirror packet is forwarded to the mirror NOC node corresponding to the target direction; the action table is used to indicate the forwarding direction of the next mirror NOC node.
7. The on-chip network module according to claim 6, characterized in that, The next mirror NOC node is specifically used to determine whether to perform a forwarding operation based on the valid bit in the action table; if so, it is determined whether the next mirror NOC node is the target mirror NOC destination node based on the destination node identifier bit in the action table. The forwarding direction is confirmed according to the forwarding direction flag in the action table; if the forwarding direction flag indicates forwarding to the left, the mirror packet is forwarded to the left to the corresponding next mirror NOC node; if the forwarding direction flag indicates forwarding to the right, the mirror packet is forwarded to the right to the corresponding next mirror NOC node.
8. The on-chip network module according to claim 6, characterized in that, When the mirror NOC node receives mirror packets from multiple input directions, it determines the matching forwarding direction in the action table based on the mirror identifier corresponding to each mirror packet; and sends the mirror packet to the next mirror NOC node or data destination interface corresponding to the forwarding direction according to the forwarding direction.
9. A network device, characterized in that, The network device is equipped with an on-chip network module as described in any one of claims 6 to 8 to perform the method as described in any one of claims 1 to 5.
10. A chip, characterized in that, The chip performs the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Message mirroring method and network device for supporting the remote message mirror
CN101035033A
Mirror image generation method and device, electronic equipment and storage medium
CN118427010A