Method and apparatus for fast reply of network switch chip packet

CN120455407BActive Publication Date: 2026-10-27KUNGAO XINXIN MICROELECTRONICS (JIANGSU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510553032.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2026-10-27
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

功能比较局限,用户自定义受限

Benefits of technology

[0034]本发明的技术方案的有益技术效果:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455407B_ABST
    Figure CN120455407B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for quickly answering network switching chip messages, and the method comprises the following steps: S1, enabling the answering function on the port needing to enable the answering function, and editing the answering message by using the hardware table item configuration; S2, receiving a request message, and judging whether the exit of the request message is the port enabling the answering function and whether the request message hits the preset message rule; if yes, going to step S3, otherwise, following the normal processing flow; S3, executing the answering function, obtaining the index of the corresponding message rule hitting, and replying to the corresponding answering message through the index. The application supports the user to flexibly configure and edit various answering messages by using a small amount of hardware table items and cache resources, is not limited to the type of answering message, can reach the full bandwidth rate of the port due to the hardware answering, significantly saves the downlink bandwidth of the answering port due to the answering, and improves the resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of switch chip technology, and in particular to a method and apparatus for fast message reply in network switch chips. Background Technology

[0002] Currently, on-chip acknowledgment functionality is almost nonexistent in industry switch chips. Switches that do possess this feature mostly rely on software protocol stacks, providing acknowledgment for a limited number of protocol packets or specific types of packets. This functionality is relatively limited, restricting user customization. Furthermore, because it's software-based, the acknowledgment capability depends on CPU processing power. Summary of the Invention

[0003] To address the aforementioned technical problems, this invention innovatively proposes a method and apparatus for message proxying in network switching chips. By supporting the use of a small number of hardware entries and cache resources, it allows users to flexibly configure and edit various proxy messages without being limited by the type of proxy message. Furthermore, due to hardware proxying, the processing capacity can reach the full bandwidth rate of the port, and the proxying significantly saves downlink bandwidth on the proxying port, thereby improving resource utilization.

[0004] To achieve the above objectives, the technical solution of the present invention provides a method for quick message reply in a network switching chip, comprising the following steps: S1: Enable the message reply function on the port where message reply needs to be enabled, and edit the message reply by configuring hardware entries; S2: Receive a request message, and determine whether the exit of the request message is a port with the message reply function enabled, and whether the request message hits a pre-set message rule. If so, proceed to step S3; otherwise, follow the normal processing flow; S3: Execute the message reply function, obtain the index of the corresponding message rule that has been hit, and reply to the corresponding message reply by indexing the corresponding message reply.

[0005] Furthermore, in step S1, the request message hit rules are set according to actual needs through the access control list, and the header and payload information of the proxy reply message are edited and configured.

[0006] Furthermore, in step S2, message rules are matched using an access control list, and when a rule in the access control list is matched, the access control list provides the index of the matched rule.

[0007] Furthermore, in step S1, the capture function is enabled to support capturing and caching the response messages of the answering port into the chip as response messages for subsequent request messages. Dynamic updates are also supported. When update=1 is configured, the response message that matches the rule of the answering port is captured each time and used as the latest response message. When update=0 is configured, the response message captured the first time is used as the response message and placed in the corresponding entry in the cache. Even if the answering port produces a response message that matches the rule in the future, it will not be updated in the chip.

[0008] Furthermore, in step S3, if the capture function is enabled, the captured response message in the cache is directly indexed using the index and used as a substitute response message for reply; if the capture function is not enabled, the substitute response message is composed of the configured message header information and payload information for reply.

[0009] Furthermore, in step S1, a hash table is created to set the request message matching rules according to actual needs, and the header and payload information of the response message are edited and configured. In step S2, a hash lookup is performed to match the message rules, and a corresponding index is given when the hash is matched.

[0010] Furthermore, in step S2, packet rule matching is performed based on MAC address, IP address, protocol type, or port number.

[0011] Furthermore, in step S1, the number of rule entries is planned based on customer needs, and the number of cached reply messages corresponds one-to-one with the number of rule entries.

[0012] The technical solution of the present invention also provides a device for quick message reply in a network switching chip, which includes the following modules: a message reply function enabling module: used to enable the message reply function on the port where message reply needs to be enabled, and to configure and edit the message reply by using hardware table entries; a message rule matching module: used to receive request messages and determine whether the exit of the request message is a port where the message reply function is enabled, and whether the request message hits a pre-set message rule; a message reply function execution module: used to execute the message reply function when the exit of the request message is a port where the message reply function is enabled, and the request message hits a pre-set message rule, to obtain the index of the corresponding message rule that is hit, and to reply to the corresponding message reply by indexing the corresponding message reply. Attached Figure Description

[0013] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is an example diagram illustrating the principle of the substitution method of the present invention;

[0015] Figure 2 This is an example diagram illustrating the principle of the proxy message configuration of the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] This invention innovatively supports the use of a small number of hardware entries and cache resources, allowing users to flexibly configure and edit various proxy response messages. It is not limited by the type of proxy response message, and due to hardware proxy response, the processing capacity can reach the full bandwidth rate of the port. Furthermore, proxy response significantly saves downlink bandwidth on the proxy response port, improving resource utilization.

[0018] In a specific embodiment, this invention innovatively utilizes the existing functional access control list module of the switching chip to perform rule matching on messages requiring acknowledgment. This matching can be based on MAC address, IP address, protocol type, etc., specifically defined by the user, offering flexibility and freedom. The flexible configuration of the acknowledgment messages is also provided by the control list module, allowing for acknowledgment of protocol messages, application messages, user-defined messages, etc. No additional dedicated module is required, saving resources.

[0019] First, enable the proxy answering function on the port where it needs to be enabled. Then, set the request packet hit rules according to actual needs, and edit the header and payload information of the proxy answering packet. The proxy answering packet also supports capturing the reply packet from the proxy answering port and caching it in the chip as a proxy answering packet for subsequent request packets; simply enable capture. This saves manual configuration. When capture is enabled, since the proxy answering port will accept various normal packets, it is still necessary to configure rules through access control lists to filter the proxy answering packets that match the rules and place them in the chip cache. Dynamic updates are supported. Configuring update=1 means that the reply packet that matches the rules from the proxy answering port will be captured each time as the latest proxy answering packet. Configuring update=0 means that the first captured reply packet will be used as the proxy answering packet and placed in the corresponding cached entry; even if the proxy answering port receives a reply packet that matches the rules later, it will not be updated in the chip and will be used as a proxy answering packet to reply to the requester.

[0020] If the exit point of the request message is a port with the proxy response function enabled, and the access control list rule is matched, then the proxy response function is executed. The access control list outputs the matched index, which is then used to index the proxy response message. If the capture function is enabled, this index is directly used to index the cached captured response message, which is then used as the proxy response message. If the capture function is not enabled, the index is used to index the access control list's internal editing module, and the proxy response message is composed of the user-configured message header and payload information.

[0021] The quick message reply function is based on the chip's existing module access control list, saving development costs. Furthermore, the number of reply message caches only needs to correspond one-to-one with the access control list rule entries, requiring minimal resource reservation. In actual chip design, the specific number of entries can be planned based on customer needs.

[0022] Take a user's request to access a remote web server as an example. When a remote web server needs upgrading or maintenance, it will typically return a message to the requesting user, such as a browser displaying "System maintenance or upgrade in progress." These response messages are usually small and lack the rich content of a normal webpage. In this case, the packet quick reply function of the switch port connected to the server can be enabled. Enable the port and enable capture. Configure two hit rules in the access control list module, corresponding to the request message and the reply message respectively. For example, if the protocol is TCP, layer4destport is 80 as the hit rule for request messages, and layer4sourceport is 80 as the capture rule for reply messages. When a web request accesses the server, the destination port is the switch port connected to the server, and the reply function is enabled. If the request message hits this rule, the switch will internally cache the reply message that hits the capture rule as a reply. Subsequent messages that satisfy the request rule will be directly retrieved from the internal cached reply message and sent to the user. From the user's perspective, it's seamless, and the server's web service can even be maintained offline, without needing to process request packets, thus saving computing resources. Simultaneously, servers typically run multiple service programs; the proxy answering function conserves bandwidth for web access traffic, as request packets for the web service no longer enter the server. This allows other service programs on the server to obtain more bandwidth, achieving multiple benefits. Once the web service is maintained, the proxy answering function on the port can be directly disabled, and users can then access the server content normally.

[0023] It can also be a protocol-based response, such as an ARP response. An ARP request packet is a broadcast packet. By enabling the response function on the port in the corresponding broadcast domain and configuring ARP hit rules, the chip can use the user-configured ARP response packets or captured ARP response packets to provide a response. This eliminates the need to forward packets to downstream devices, saving bandwidth and accelerating response efficiency.

[0024] Understandably, as an alternative implementation, it is not always necessary to use the access control list module when using message rule matching. For example, a hash table can be created to perform a hash lookup on the message information to be matched, such as MAC address, IP address, protocol type, port number, etc. If the hash matches, the rule is satisfied, and the index is used to access the message editing behavior table entry for further processing.

[0025] In an embodiment of the present invention, a method for quick message reply in a network switching chip is provided, comprising the following steps: S1: Enable the message reply function on the port where message reply is required, and configure and edit the message reply using hardware table entries; S2: Receive a request message, and determine whether the exit of the request message is a port where the message reply function is enabled, and whether the request message hits a pre-set message rule. If so, proceed to step S3; otherwise, follow the normal processing flow; S3: Execute the message reply function, obtain the index of the corresponding message rule that has been hit, and reply to the corresponding message reply using the index.

[0026] Furthermore, in step S1, the request message hit rules are set according to actual needs through the access control list, and the header and payload information of the proxy reply message are edited and configured.

[0027] Furthermore, in step S2, message rules are matched using an access control list, and when a rule in the access control list is matched, the access control list provides the index of the matched rule.

[0028] Furthermore, in step S1, the capture function is enabled to support capturing and caching the response messages of the answering port into the chip as response messages for subsequent request messages. Dynamic updates are also supported. When update=1 is configured, the response message that matches the rule of the answering port is captured each time and used as the latest response message. When update=0 is configured, the response message captured the first time is used as the response message and placed in the corresponding entry in the cache. Even if the answering port produces a response message that matches the rule in the future, it will not be updated in the chip.

[0029] Furthermore, in step S3, if the capture function is enabled, the captured response message in the cache is directly indexed using the index and used as a substitute response message for reply; if the capture function is not enabled, the substitute response message is composed of the configured message header information and payload information for reply.

[0030] Furthermore, in step S1, a hash table is created to set the request message matching rules according to actual needs, and the header and payload information of the response message are edited and configured. In step S2, a hash lookup is performed to match the message rules, and a corresponding index is given when the hash is matched.

[0031] Furthermore, in step S2, packet rule matching is performed based on MAC address, IP address, protocol type, or port number.

[0032] Furthermore, in step S1, the number of rule entries is planned based on customer needs, and the number of cached reply messages corresponds one-to-one with the number of rule entries.

[0033] In another embodiment of the present invention, a device for quick response to network switching chip messages is also provided, comprising the following modules: a response function enabling module: used to enable the response function on the port where response is required, and to configure and edit the response message by using hardware table entries; a message rule matching module: used to receive request messages and determine whether the exit of the request message is a port where the response function is enabled, and whether the request message hits a pre-set message rule; and a response function execution module: used to execute the response function when the exit of the request message is a port where the response function is enabled, and the request message hits a pre-set message rule, obtain the index of the corresponding hit message rule, and use the index to index the corresponding response message for reply.

[0034] The beneficial technical effects of the technical solution of the present invention are as follows:

[0035] This invention utilizes a small number of hardware entries (e.g., access control lists or hash tables) and caching resources to quickly answer packets that meet certain rules. The answering packet types are diverse and unrestricted, and the hardware answering rate is high with large bandwidth, while not consuming internal CPU resources of the switch and requiring no dedicated software development. Significant savings are achieved in bandwidth of the answering port and computational resources of related downstream devices. Furthermore, it is based on an access control list functional module, requiring minimal additional development costs.

[0036] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for quick message reply in a network switching chip, characterized in that, Includes the following steps: S1: Enable the proxy function on the port where proxy answering is required by editing the proxy answering message through hardware table entry configuration; It also enables the capture function to capture and cache the response messages of the answering port in the chip, which can then be used as response messages for subsequent request messages. Furthermore, it supports dynamic updates. When update=1 is configured, the response message that hits the rule on the response port will be captured each time and used as the latest response message; when update=0 is configured, the first captured response message will be used as the response message and placed in the corresponding entry in the cache. Even if the response port hits the rule and a response message appears later, it will not be updated in the chip. S2: Receive the request message and determine whether the output of the request message is a port with the proxy function enabled and whether the request message hits the pre-set message rules. If so, proceed to step S3; otherwise, follow the normal processing flow. S3: Execute the proxy reply function, obtain the index of the corresponding message rule that was hit, and use the index to find the corresponding proxy reply message to reply; If the capture function is enabled, the captured response message will be directly indexed into the cache using the index and used as the reply message. If the capture function is not enabled, a reply message will be composed of the configured message header information and payload information.

2. The method according to claim 1, characterized in that, In step S1, the request message hit rules are set according to actual needs through the access control list, and the header and payload information of the proxy reply message are edited and configured.

3. The method according to claim 2, characterized in that, In step S2, message rules are matched using an access control list, and when a rule in the access control list is matched, the access control list provides the index of the matched rule.

4. The method according to claim 1, characterized in that, In step S1, a hash table is created to set the request message hit rules according to actual needs, and the header and payload information of the proxy reply message are edited and configured. Furthermore, in step S2, message rules are matched by performing a hash lookup, and the corresponding index is given when the hash is matched.

5. The method according to claim 1, characterized in that, In step S2, packet rule matching is performed based on MAC address, IP address, protocol type, or port number.

6. The method according to claim 2, characterized in that, In step S1, the number of rule entries is planned based on customer needs, and the number of reply message caches corresponds one-to-one with the number of rule entries.

7. A device for fast message relay in a network switching chip, characterized in that, Includes the following modules: Proxy answering function enable module: Used to enable proxy answering function on ports that require proxy answering, by configuring and editing proxy answering messages through hardware table entries; It also enables the capture function to capture and cache the response messages of the answering port in the chip, which can then be used as response messages for subsequent request messages. Furthermore, it supports dynamic updates. When update=1 is configured, the response message that hits the rule on the response port will be captured each time and used as the latest response message; when update=0 is configured, the first captured response message will be used as the response message and placed in the corresponding entry in the cache. Even if the response port hits the rule and a response message appears later, it will not be updated in the chip. Message rule matching module: used to receive request messages and determine whether the exit of the request message is a port with the proxy function enabled, and whether the request message matches the pre-set message rules. The proxy answering function execution module is used to execute the proxy answering function when the exit of the request message is a port with the proxy answering function enabled and the request message hits the pre-set message rule. It obtains the index of the corresponding message rule that is hit and uses the index to find the corresponding proxy answering message to reply. If the capture function is enabled, the captured response message will be directly indexed into the cache using the index and used as the reply message. If the capture function is not enabled, a reply message will be composed of the configured message header information and payload information.

Citation Information

Patent Citations

  • Direct replying actions in SDN switches

    CN107615710A

  • Message capturing method and device based on network application

    CN114553546A