Message forwarding method and device, message forwarding equipment and storage medium
By using acceleration chips on message forwarding devices for message forwarding, the problem of resource waste in the existing technology is solved, and more efficient resource utilization and user experience improvement is achieved.
Patent Information
- Application Number
- CN202510187490.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, a large amount of waste of processor resources and memory resources is caused by the process of forwarding of messages.
The acceleration chip is set up on the message forwarding device. By forwarding information of the first message of the stored non-management stream, the acceleration chip forwards the non-first message of the non-management stream to avoid forwarding through memory.
Reduces the use of memory resources, reduces the delay in message forwarding, improves user experience, and frees up processor and memory resources for more complex device management tasks.
Smart Images

Figure CN119676194A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a message forwarding method, device, message forwarding equipment and storage medium. Background Art
[0002] Message forwarding, as the cornerstone of network communication, is the key process to achieve seamless data transmission from source devices to target devices. Whether it is daily web browsing, email sending, or enterprise-level data center communication and cloud computing services, message forwarding technology is indispensable.
[0003] In the related art, during the message forwarding process, the processor is usually required to implement various verification, analysis, update and encapsulation of the message in the memory, thereby increasing the occupancy of memory resources. Summary of the invention
[0004] The present invention provides a message forwarding method, a device, a message forwarding device and a storage medium, which are used to solve the defects in the prior art that cause a large amount of waste of processor resources and memory resources.
[0005] The present invention provides a message forwarding method, which is applied to a message forwarding device, wherein an acceleration chip is provided on the message forwarding device, and the method comprises: When receiving a target message, determining the type of the target message; When the type of the target message is a non-first message of a non-management flow, sending the target message to the acceleration chip; The target message is forwarded by the acceleration chip based on the stored forwarding information of the first message of the non-management flow.
[0006] According to a message forwarding method provided by the present invention, the method further includes: When the type of the target message is the first message of a non-management flow, sending the target message to an inbound link layer; Forwarding the target message through the inbound link layer; When the target message is forwarded successfully, forwarding information of the target message is sent to the acceleration chip.
[0007] According to a message forwarding method provided by the present invention, the message forwarding device is configured with an intermediate layer; When the target message is forwarded successfully, sending the forwarding information of the target message to the acceleration chip includes: In the case where the target message is forwarded successfully, forwarding information of the target message is sent to the intermediate layer; Performing format conversion on the forwarding information based on the data format of the acceleration chip through the intermediate layer to obtain the forwarding information after format conversion; The forwarding information after the format conversion is sent to the acceleration chip.
[0008] According to a message forwarding method provided by the present invention, the method further includes: Counting the message forwarding situation through the acceleration chip, wherein the message forwarding situation includes at least one of the following: forwarded message information, forwarding abnormal message information, and network protocol information corresponding to the forwarded message; The message forwarding situation is sent to the corresponding protocol layer.
[0009] According to a message forwarding method provided by the present invention, the method further includes: When the type of the target message is a message of a management flow, sending the target message to an inbound link layer; The target message is forwarded through the inbound link layer.
[0010] According to a message forwarding method provided by the present invention, the method further includes: When the type of the target message is a message of a management flow, caching the target message into a management message cache; In the case that the type of the target message is a message of a non-management flow, the target message is cached in a data message cache.
[0011] The present invention also provides a message forwarding device, comprising: A determination unit, configured to determine the type of the target message when a target message is received; A first sending unit, configured to send the target message to the acceleration chip when the type of the target message is a non-management flow and not the first message; The first forwarding unit is used to forward the target message based on the stored forwarding information of the first message of the non-management flow through the acceleration chip.
[0012] The present invention also provides a message forwarding device, comprising a processor and an acceleration chip; The processor is used to determine the type of the target message when receiving the target message; The processor is further configured to send the target message to the acceleration chip when the type of the target message is a non-management flow and non-first message; The acceleration chip is used to forward the target message based on the stored forwarding information of the first message of the non-management flow.
[0013] The present invention also provides a message forwarding device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned message forwarding methods when executing the computer program.
[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the message forwarding method described in any one of the above methods is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned message forwarding methods.
[0016] The message forwarding method, device, message forwarding device and storage medium provided by the present invention are provided with an acceleration chip on the message forwarding device. When receiving a target message, the message forwarding device determines the type of the target message. When the type of the target message is a non-first message of a non-management flow, the target message is sent to the acceleration chip. The acceleration chip forwards the target message based on the forwarding information of the first message of the non-management flow stored. It can be seen that the present invention forwards all non-first messages of the non-management flow through the acceleration chip, without forwarding through the memory, thereby reducing the occupation of memory resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a schematic diagram of message forwarding in the related art.
[0019] Figure 2 This is one of the flow charts of the message forwarding method provided by an embodiment of the present invention.
[0020] Figure 3 This is the second flow chart of the message forwarding method provided by the embodiment of the present invention.
[0021] Figure 4 It is a structural diagram of a message forwarding device provided in an embodiment of the present invention.
[0022] Figure 5 This is one of the schematic diagrams of message forwarding provided by an embodiment of the present invention.
[0023] Figure 6This is the third flow chart of the message forwarding method provided in the embodiment of the present invention.
[0024] Figure 7 This is the second schematic diagram of message forwarding provided by an embodiment of the present invention.
[0025] Figure 8 It is a schematic diagram of message storage provided by an embodiment of the present invention.
[0026] Fig. 9 This is the third schematic diagram of message forwarding provided by an embodiment of the present invention.
[0027] Fig.10 It is a structural diagram of a message forwarding device provided in an embodiment of the present invention.
[0028] Fig.11 It is a structural diagram of a message forwarding device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] The network protocol stack refers to the sum of all the protocols in the network. For a message transmission process, it may involve the upper layer protocol to the lower layer protocol, or it may involve the lower layer protocol to the upper layer protocol, or even both directions. The most widely used is the Transmission Control Protocol / Internet Protocol (TCP / IP) network protocol stack. The protocols from top to bottom are: application layer, transport layer, network layer, link layer and physical layer, referred to as five layers, four layers, three layers, two layers and one layer. Among them, the application layer is such as Hypertext Transfer Protocol (HTTP) or Domain Name System (DNS), the transport layer is such as Transmission Control Protocol (TCP) or Open Systems Interconnection (OSI), the network layer is such as Internet Protocol (IP), and the link layer is such as Ethernet.
[0031] Among them, the physical layer provides the creation, maintenance and removal of physical links required for transmitting messages, that is, the physical layer ensures that messages can be transmitted on various physical media without occupying processor and memory resources.
[0032] Common message forwarding devices, excluding the physical layer, such as switches, mainly involve the second layer of the network protocol stack, and routers mainly involve the second and third layers of the network protocol stack. The second layer learns the source media access control address (MAC) of the message and forwards it according to the destination MAC address of the message, mainly to achieve communication between devices in the same network segment. The third layer forwarding uses the IP address, performs recursive search according to the routing table, and forwards the data packet to the next hop route to achieve communication between devices across network segments.
[0033] Layer 2 forwarding requires the establishment of a MAC address-based forwarding table, Virtual Local Area Network (VLAN) information, and forwarding policy table entries in memory. Layer 3 forwarding requires the establishment of neighbor protocol table entries, routing table entries, session table entries, and Network Address Translation (NAT) table entries in memory. The table entry information of the second and third layers consumes a large amount of memory resources. The message forwarding process requires various legitimacy checks on the message, and it is necessary to establish, query, and update various complex table entries at the second and third layers to finally complete the message forwarding, which consumes a large amount of processor resources. Among them, VLAN is a communication technology that logically divides a physical LAN into multiple broadcast domains. The neighbor protocol is to resolve a Layer 3 protocol (such as an IP address) address into a Layer 2 protocol (such as a MAC address) address. NAT is a technology widely used in computer networks that allows an organization or network to use private addresses internally, and when connected to an external network (such as the Internet), these private addresses will be converted into one or a few globally unique public IP addresses.
[0034] Figure 1 It is a schematic diagram of message forwarding in the related technology, such as Figure 1 As shown, after the Ethernet inlet of the message forwarding device receives the message, the inlet driver completes the reception and integrity check of the message, and hands it over to the higher layer protocol in the network protocol stack through the terminal or polling. The message will be forwarded to the outbound direction at layer 2 or layer 3. The layer 2 and layer 3 processing of the network protocol is usually processed in the memory by the processor of the message forwarding device.
[0035] For message forwarding within a LAN, only Layer 2 forwarding is usually involved. The inbound link layer parses the message and performs bridge forwarding. During the bridge forwarding process, it learns the source MAC address of the message, queries the destination MAC address, and other processes, and hands the message over to the outbound link layer for processing. The outbound link layer re-encapsulates the message, updates the relevant fields of the message, such as the Time To Live (TTL) and checksum, and hands the message over to the egress driver. Finally, the message is forwarded through the Ethernet egress to the target network. Among them, TTL is a term in computer network technology, which refers to the longest distance (number of hops) that a data packet can transmit when passing through a router.
[0036] The message whose destination IP address is not an address in the LAN involves Layer 3 forwarding. When the inbound link layer parses the message and identifies that the destination MAC address is the MAC address of the local device, but the IP address is not the IP address of the local device, the message is handed over to the inbound network layer (Layer 3 protocol) of the network protocol stack for processing. The inbound network layer determines whether to perform IP address conversion based on the NAT table entry, queries the routing cache and routing table to determine whether the destination IP address is reachable, queries the corresponding outbound interface, and updates the relevant fields of the message (such as source IP, destination IP, and checksum, etc.). The inbound network layer hands the modified message over to the outbound link layer through the outbound network layer for processing. The outbound link layer re-encapsulates the message, updates the relevant fields of the message (such as TTL and checksum, etc.), and hands the message over to the egress driver. Finally, the message is forwarded through the Ethernet egress to the target network.
[0037] However, in the related art, during the message forwarding process, the processor is required to implement various verification, analysis, update and encapsulation of the message in the memory, thereby increasing the occupancy of memory resources.
[0038] Based on this, the present invention provides a message forwarding method, in which an acceleration chip is arranged on a message forwarding device, and all non-first messages of non-management flows are forwarded through the acceleration chip without forwarding through memory, thereby reducing the occupation of memory resources.
[0039] Combine the following Figure 2-Figure 9 The message forwarding method of the present invention is described.
[0040] Figure 2 is one of the flow diagrams of the message forwarding method provided in an embodiment of the present invention, which is applied to a message forwarding device, wherein an acceleration chip is provided on the message forwarding device, such as Figure 2 As shown, the message forwarding method includes the following steps: Step 201: When a target message is received, determine the type of the target message.
[0041] For example, an ingress acceleration driver and an egress acceleration driver are configured on the message forwarding device. When the Ethernet ingress of the message forwarding device receives a target message, the ingress acceleration driver identifies the target message, determines the type of the target message, and selects an appropriate forwarding direction based on the type of the target message.
[0042] Step 202: When the type of the target message is a non-management flow and not the first message, send the target message to the acceleration chip.
[0043] For example, when the type of the target message is a non-first message of a non-management flow, that is, when the target message is a non-first message of a data flow, the ingress acceleration driver forwards the target message to the acceleration chip.
[0044] Step 203: forward the target message based on the stored forwarding information of the first message of the non-management flow through the acceleration chip.
[0045] Among them, when it involves layer 2 forwarding, the forwarding information of the first packet of the non-management flow includes information such as the source MAC address, the destination MAC address, the Ethernet inlet identifier, and the Ethernet outlet identifier; when it involves layer 3 forwarding, the forwarding information of the first packet of the non-management flow includes information such as the source IP address, the destination IP address, the transport layer protocol number, NAT, routing, the Ethernet inlet identifier, and the Ethernet outlet identifier.
[0046] For example, since the acceleration chip has obtained the forwarding information of the non-management flow after successfully forwarding the first message of the non-management flow, when the acceleration chip receives a non-first message of the non-management flow, it can use the stored forwarding information of the first message of the non-management flow to re-encapsulate the received target message, update the relevant fields of the target message (such as TTL, checksum, etc.), and forward the target message quickly, efficiently and stably, that is, forward subsequent messages of the non-management flow, and forward the target message to the Ethernet exit through the exit acceleration driver.
[0047] The message forwarding method provided by the present invention is provided with an acceleration chip on the message forwarding device. When the message forwarding device receives the target message, it determines the type of the target message. When the type of the target message is a non-first message of a non-management flow, the target message is sent to the acceleration chip. The acceleration chip forwards the target message based on the forwarding information of the first message of the non-management flow stored. It can be seen that the present invention forwards all non-first messages of the non-management flow through the acceleration chip, without forwarding through the memory, thereby reducing the occupation of memory resources. In addition, because the acceleration chip is hardware, it can process the non-first message of the non-management flow at high speed, so it can reduce the delay of message forwarding, thereby improving the user experience.
[0048] In one embodiment, Figure 3 FIG. 2 is a flow chart of a message forwarding method according to an embodiment of the present invention. Figure 3 As shown, after the above step 201, the message forwarding method further includes the following steps: Step 204: When the type of the target message is the first message of a non-management flow, the target message is sent to an inbound link layer.
[0049] For example, when the type of the target message is the first message of a non-management flow, the ingress acceleration driver forwards the target message to a higher-layer network protocol, that is, forwards the target message to an ingress link layer.
[0050] Step 205: Forward the target message through the inbound link layer.
[0051] For example, when the inbound link layer receives the target message, it parses the target message to obtain the destination MAC address and destination IP address in the target message. When it is determined that the destination MAC address is the MAC address of the message forwarding device and the destination IP address is also the IP address of the message forwarding device, it is determined that the target message is a message within the local area network, and only Layer 2 forwarding is involved. The inbound link layer bridges and forwards the target message to the outbound link layer. The outbound link layer completes the field update and re-encapsulation of the target message, and finally passes the target message to the egress acceleration driver. The egress acceleration driver completes the link layer encapsulation and passes the target message to the Ethernet egress, which completes the forwarding.
[0052] When it is determined that the destination MAC address is the MAC address of the message forwarding device, but the destination IP address is not the IP address of the message forwarding device, it is determined that the target message is a message forwarded to the external network, involving three-layer forwarding, then the inbound link layer forwards the target message to a higher-layer network protocol, that is, the inbound network layer. The inbound network layer forwards the target message to the outbound network layer through the routing protocol. The outbound network layer completes the field update of the target message and then forwards it to the outbound link layer. The outbound link layer completes the field update and re-encapsulation of the target message, and finally passes the target message to the egress acceleration driver. The egress acceleration driver completes the link layer encapsulation and passes the target message to the Ethernet egress, and the Ethernet egress completes the forwarding.
[0053] Step 206: When the target message is forwarded successfully, forwarding information of the target message is sent to the acceleration chip.
[0054] For example, when the target message is forwarded successfully, for layer 2 forwarding, the forwarding information of the target message is collected, and the forwarding information includes information such as the source MAC address, the destination MAC address, the Ethernet inlet identifier, and the Ethernet outlet identifier; for layer 3 forwarding, the forwarding information of the target message is collected, and the forwarding information includes information such as the source IP address, the destination IP address, the transport layer protocol number, NAT, routing, the Ethernet inlet identifier, and the Ethernet outlet identifier, and finally the forwarding information of the target message is sent to the acceleration chip for storage.
[0055] It should be noted that when the first message of the non-management flow fails to be forwarded, the first message of the non-management flow can be re-forwarded through the public network protocol to ensure that the first message of the non-management flow can be forwarded successfully.
[0056] In this embodiment, when the type of the target message is the first message of a non-management flow, the target message is sent to the inbound link layer, and the target message is forwarded through the inbound link layer. Since the number of the first messages of the non-management flow is small, forwarding through the inbound link layer will not take up too many memory resources, so as to achieve a reasonable allocation of memory resources and acceleration chip resources. In addition, when the first message of the non-management flow is forwarded successfully, the forwarding information of the first message of the non-management flow is also sent to the acceleration chip, so that when the acceleration chip receives subsequent messages, it can forward subsequent messages normally based on the forwarding information of the first message of the non-management flow, thereby improving the accuracy of message forwarding.
[0057] In one embodiment, the message forwarding device is configured with an intermediate layer; in the above step 206, when the target message is forwarded successfully, forwarding information of the target message is sent to the acceleration chip, which can be specifically implemented by the following steps: When the target message is forwarded successfully, the forwarding information of the target message is sent to the middle layer; the middle layer performs format conversion on the forwarding information based on the data format of the acceleration chip to obtain the forwarding information after format conversion; and the forwarding information after format conversion is sent to the acceleration chip.
[0058] The middle layer is implemented by software, which realizes the interaction between the acceleration chip and the network protocol. Figure 4 is a schematic diagram of the structure of a message forwarding device provided in an embodiment of the present invention, such as Figure 4 As shown, from a hardware perspective, the acceleration chip is connected to the processor of the message forwarding device through a high-speed bus.
[0059] For example, when the target message is forwarded successfully, the processor sends the forwarding information of the target message to the middle layer. When the middle layer receives the forwarding information of the target message, it converts the forwarding information of the target message according to the data format of the acceleration chip to obtain the forwarding information after format conversion, and sends the forwarding information after format conversion to the acceleration chip through a high-speed bus, so that the acceleration chip can recognize the forwarding information after format conversion and store the forwarding information after format conversion.
[0060] It should be noted that the processor can also convert the message flow, flow control information, and control information of the acceleration chip according to the data format of the acceleration chip, and send it to the acceleration chip through a high-speed bus. The control information of the acceleration chip may include information such as startup, shutdown, reset, and upgrade, and the present invention is not limited to this.
[0061] In this embodiment, the forwarding information is formatted based on the data format of the acceleration chip through the intermediate layer, so that the forwarding information after format conversion can be correctly recognized by the acceleration chip, making the communication between the network protocol and the acceleration chip more efficient, stable and portable, and further improving the accuracy of message forwarding.
[0062] In one embodiment, after the above step 203, the message forwarding method further includes the following steps: The acceleration chip is used to count the message forwarding status, and the message forwarding status includes at least one of the following: forwarded message information, forwarding abnormal message information and network protocol information corresponding to the forwarded message; and the message forwarding status is sent to the corresponding protocol layer.
[0063] For example, after the acceleration chip forwards the target message, it is also necessary to count the message forwarding situation, that is, to count the forwarded message information, the forwarding abnormal message information and the network protocol information corresponding to the forwarded message, etc., wherein the forwarded message information may include the forwarding rate of the forwarded message, the identifier of the forwarded message and the number of forwarded messages, etc., the forwarding abnormal message information may include the identifier of the message with forwarding abnormality and the number of messages with forwarding abnormality, etc., and the network protocol information corresponding to the forwarded message includes the network protocol identifier used by the forwarded message. These message forwarding situations are sent to the corresponding protocol layer through the middle layer. Specifically, for the second-layer forwarding, the message forwarding situation is sent to the link layer through the middle layer, and for the third-layer forwarding, the message forwarding situation is sent to the network layer through the middle layer, so that the link layer and the network layer can perceive that the message is forwarding, but the link layer and the network layer do not need to perform actual forwarding operations. The link layer and the network layer only need to complete the statistics of the message forwarding situation, thereby achieving the purpose of releasing processor resources and memory resources. Moreover, since the link layer and the network layer can sense that the message is being forwarded through the message forwarding status, the link layer and the network layer will not delete the configuration information related to message forwarding, thereby reducing the impact on the network protocol and the applications using the network protocol.
[0064] Figure 5 1 is one of the schematic diagrams of message forwarding provided by an embodiment of the present invention, such as Figure 5 As shown, when the Ethernet inlet receives the target message and the inlet acceleration driver determines that the type of the target message is not the first message of the non-management flow, the target message is directly sent to the acceleration chip. The acceleration chip forwards the target message based on the forwarding information of the first message of the non-management flow stored in the storage, and counts the message forwarding status, and sends the message forwarding status to the corresponding protocol layer through the middle layer.
[0065] In this embodiment, after forwarding the target message, the acceleration chip sends the statistical message forwarding status to the corresponding protocol layer, so that the corresponding protocol layer can perceive the message forwarding, thereby reducing the impact on the network protocol and the application using the network protocol.
[0066] In one embodiment, Figure 6 FIG. 3 is a flow chart of a message forwarding method provided by an embodiment of the present invention. Figure 6 As shown, after the above step 201, the message forwarding method further includes the following steps: Step 207: When the type of the target message is a message of a management flow, the target message is sent to the inbound link layer.
[0067] For example, Figure 7 FIG. 2 is a second schematic diagram of message forwarding provided by an embodiment of the present invention, such as Figure 7As shown, when the type of the target message is a message of a management flow, the ingress acceleration driver forwards the target message to a higher-layer network protocol, that is, forwards the target message to a queue to be processed at the ingress link layer.
[0068] Step 208: Forward the target message through the inbound link layer.
[0069] For example, Figure 7 As shown, when the inbound link layer obtains the target message from the queue to be processed, it parses the target message to obtain the destination MAC address in the target message. By comparing the destination MAC address of the target message, if it is identified as a management message with the destination being the Ethernet interface of the message forwarding device, the target message is handed over to the inbound network layer for processing. The inbound network layer compares the target IP address of the target message. If it is identified as a management message with the destination being the message forwarding device, the inbound network layer parses the transport layer protocol identifier of the target message and hands the target message over to the corresponding transport layer for processing. After the transport layer processes the target message, it parses the application port of the target message and hands the target message over to the application corresponding to the application port in the application layer, i.e., the device management application, thereby completing the forwarding of the management flow message.
[0070] In this embodiment, when the type of the target message is a management flow message, the target message is sent to the inbound link layer, and the target message is forwarded through the inbound link layer, so that the management flow message is still processed by the processor in the memory. In this way, even when the acceleration chip of the message forwarding device is at full load, the normal response of the management flow message can be guaranteed, thereby achieving normal control of the message forwarding device. In particular, when the message forwarding device is attacked, the normal response to the management flow message can prevent the message forwarding device from being out of control, thereby improving the security of the message forwarding device.
[0071] In one embodiment, the message forwarding method further includes the following steps: When the type of the target message is a message of a management flow, the target message is cached in a management message cache; when the type of the target message is a message of a non-management flow, the target message is cached in a data message cache.
[0072] For example, Figure 8 Schematic diagram of message storage provided by an embodiment of the present invention, such as Figure 8As shown, message filtering, management message cache and data message cache are added to the inlet acceleration driver. The inlet acceleration driver identifies the type of the target message through the message filtering function. When the type of the target message is a message of the management flow, the target message is cached in the management message cache; when the type of the target message is a message of the non-management flow, the target message is cached in the data message cache. This ensures that even when the inlet acceleration driver runs the messages of the non-management flow at full capacity, the messages of the management flow can be delivered to the device management program of the application layer in a timely, stable and accurate manner.
[0073] Fig. 9 FIG. 3 is a schematic diagram of message forwarding provided by an embodiment of the present invention, such as Fig. 9 As shown, the message forwarding device is provided with an acceleration chip and an intermediate layer, wherein the intermediate layer is implemented by software and the acceleration chip is hardware. When the Ethernet inlet receives the target message, the inlet acceleration driver determines the type of the target message. When the type of the target message is the first message of the non-management flow, the target message is sent to the inbound link layer. For layer 2 forwarding, the target message is directly forwarded through the inbound link layer. For layer 3 forwarding, the inbound link layer sends the target message to the inbound network layer. The inbound network layer sends the target message to the Ethernet outlet through the outbound network layer, the outbound link layer and the outbound acceleration driver in sequence, and forwards the target message to the target network through the Ethernet outlet. And when the target message is forwarded successfully, the forwarding information of the target message is sent to the acceleration chip through the intermediate layer for storage.
[0074] When the type of the target message is non-first message of a non-management flow, the target message is sent directly to the acceleration chip, and the acceleration chip forwards the target message based on the forwarding information of the first message of the non-management flow stored in the storage, that is, the target message is forwarded to the export acceleration driver, and then sent to the Ethernet export, and the target message is forwarded to the target network through the Ethernet export, and the message forwarding status is counted by the acceleration chip, and the message forwarding status is sent to the corresponding protocol layer through the middle layer.
[0075] When the type of the target message is a management flow message, the target message is sent to the inbound link layer, and the target message is sequentially transmitted to the inbound network layer, the inbound transport layer, and the application layer through the inbound link layer, and finally forwarded to the device management program of the application layer.
[0076] The message forwarding method provided by the embodiment of the present invention can realize that all non-first messages of non-management flows are transferred from the inlet acceleration driver to the acceleration chip for processing, and then handed over to the export acceleration driver, and finally the target message is forwarded through the Ethernet export; only the message of the management flow and the first message of the non-management flow need to be processed by the processor in the memory, so that 100% message processing capacity is provided by using a small amount of processor resources and memory resources. Most of the processor resources and memory resources are released, and more complex and reliable device management tasks can be run. Moreover, the selection of the processor and the memory capacity can be determined by other customized services, so that the released processor resources and memory resources can be used to run customized services, thereby improving the applicable field of message forwarding; in addition, since the acceleration chip is hardware, it can process the non-first message of the non-management flow at high speed, so the delay of message forwarding can be reduced, and for the scenario of centralized message transmission, the user experience can be greatly improved.
[0077] The message forwarding device provided by the present invention is described below. The message forwarding device described below and the message forwarding method described above can be referred to each other.
[0078] Fig.10 is a schematic diagram of the structure of a message forwarding device provided by an embodiment of the present invention, such as Fig.10 As shown, the message forwarding device 1000 includes a determining unit 1001, a first sending unit 1002 and a first forwarding unit 1003; wherein: The determining unit 1001 is configured to determine the type of the target message when receiving the target message; The first sending unit 1002 is used to send the target message to the acceleration chip when the type of the target message is a non-management flow and non-first message; The first forwarding unit 1003 is configured to forward the target message based on the stored forwarding information of the first message of the non-management flow through the acceleration chip.
[0079] The message forwarding device provided by the present invention is provided with an acceleration chip on the message forwarding device. When the message forwarding device receives the target message, it determines the type of the target message. When the type of the target message is a non-first message of a non-management flow, the target message is sent to the acceleration chip. The acceleration chip forwards the target message based on the forwarding information of the first message of the non-management flow stored. It can be seen that the present invention forwards all non-first messages of the non-management flow through the acceleration chip, without forwarding through the memory, thereby reducing the occupation of memory resources.
[0080] Based on any of the above embodiments, the message forwarding device 1000 further includes: A second sending unit, configured to send the target message to an inbound link layer when the type of the target message is the first message of a non-management flow; A second forwarding unit, configured to forward the target message through the inbound link layer; The third sending unit is used to send forwarding information of the target message to the acceleration chip when the target message is forwarded successfully.
[0081] Based on any of the foregoing embodiments, the message forwarding device is configured with an intermediate layer; and the third sending unit is specifically configured to: When the target message is forwarded successfully, forwarding information of the target message is sent to the intermediate layer; Performing format conversion on the forwarding information based on the data format of the acceleration chip through the intermediate layer to obtain the forwarding information after format conversion; The forwarding information after the format conversion is sent to the acceleration chip.
[0082] Based on any of the above embodiments, the message forwarding device 1000 further includes: A statistical unit, used to collect statistics on message forwarding conditions through the acceleration chip, wherein the message forwarding conditions include at least one of the following: forwarded message information, forwarding abnormal message information, and network protocol information corresponding to the forwarded message; The fourth sending unit is used to send the message forwarding status to the corresponding protocol layer.
[0083] Based on any of the above embodiments, the message forwarding device 1000 further includes: a fifth sending unit, configured to send the target message to an inbound link layer when the type of the target message is a message of a management flow; The third forwarding unit is used to forward the target message through the inbound link layer.
[0084] Based on any of the above embodiments, the message forwarding device 1000 further includes: A first cache unit, configured to cache the target message into a management message cache when the type of the target message is a message of a management flow; The second cache unit is used to cache the target message into the data message cache when the type of the target message is a message of a non-management flow.
[0085] The message forwarding device provided in the embodiment of the present invention includes a processor and an acceleration chip; The processor is used to determine the type of the target message when receiving the target message; The processor is further configured to send the target message to the acceleration chip when the type of the target message is a non-management flow and non-first message; The acceleration chip is used to forward the target message based on the stored forwarding information of the first message of the non-management flow.
[0086] Fig.11 is a schematic diagram of the physical structure of a message forwarding device provided in an embodiment of the present invention, such as Fig.11 As shown, the message forwarding device may include: a processor 1110, a communication interface 1120, a memory 1130 and a communication bus 1140, wherein the processor 1110, the communication interface 1120 and the memory 1130 communicate with each other through the communication bus 1140. The processor 1110 may call the logic instructions in the memory 1130 to execute the message forwarding method, which includes: in the case of receiving a target message, determining the type of the target message; When the type of the target message is a non-first message of a non-management flow, sending the target message to the acceleration chip; The target message is forwarded by the acceleration chip based on the stored forwarding information of the first message of the non-management flow.
[0087] In addition, the logic instructions in the above-mentioned memory 1130 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0088] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the message forwarding method provided by the above methods, the method comprising: in the case of receiving a target message, determining the type of the target message; When the type of the target message is a non-first message of a non-management flow, sending the target message to the acceleration chip; The target message is forwarded by the acceleration chip based on the stored forwarding information of the first message of the non-management flow.
[0089] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the message forwarding method provided by the above methods, the method comprising: upon receiving a target message, determining the type of the target message; When the type of the target message is a non-first message of a non-management flow, sending the target message to the acceleration chip; The target message is forwarded by the acceleration chip based on the stored forwarding information of the first message of the non-management flow.
[0090] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0091] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A message forwarding method, characterized in that: Applied to a message forwarding device, the message forwarding device is provided with an acceleration chip, and the method comprises: When receiving a target message, determining the type of the target message; When the type of the target message is a non-first message of a non-management flow, sending the target message to the acceleration chip; The target message is forwarded by the acceleration chip based on the stored forwarding information of the first message of the non-management flow.
2. The message forwarding method according to claim 1, characterized in that: The method further comprises: When the type of the target message is the first message of a non-management flow, sending the target message to an inbound link layer; Forwarding the target message through the inbound link layer; When the target message is forwarded successfully, forwarding information of the target message is sent to the acceleration chip.
3. The message forwarding method according to claim 2, characterized in that: The message forwarding device is configured with an intermediate layer; When the target message is forwarded successfully, sending the forwarding information of the target message to the acceleration chip includes: In the case where the target message is forwarded successfully, forwarding information of the target message is sent to the intermediate layer; Performing format conversion on the forwarding information based on the data format of the acceleration chip through the intermediate layer to obtain the forwarding information after format conversion; The forwarding information after the format conversion is sent to the acceleration chip.
4. The message forwarding method according to claim 1, characterized in that: The method further comprises: Counting the message forwarding situation through the acceleration chip, wherein the message forwarding situation includes at least one of the following: forwarded message information, forwarding abnormal message information, and network protocol information corresponding to the forwarded message; The message forwarding situation is sent to the corresponding protocol layer.
5. The message forwarding method according to claim 1, characterized in that: The method further comprises: When the type of the target message is a message of a management flow, sending the target message to an inbound link layer; The target message is forwarded through the inbound link layer.
6. The message forwarding method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the type of the target message is a message of a management flow, caching the target message into a management message cache; In the case that the type of the target message is a message of a non-management flow, the target message is cached in a data message cache.
7. A message forwarding device, characterized in that: include: A determination unit, configured to determine the type of the target message when a target message is received; A first sending unit, configured to send the target message to the acceleration chip when the type of the target message is a non-management flow and not the first message; The first forwarding unit is used to forward the target message based on the stored forwarding information of the first message of the non-management flow through the acceleration chip.
8. A message forwarding device, characterized in that: Including processor and acceleration chip; The processor is used to determine the type of the target message when receiving the target message; The processor is further configured to send the target message to the acceleration chip when the type of the target message is a non-management flow and non-first message; The acceleration chip is used to forward the target message based on the stored forwarding information of the first message of the non-management flow.
9. A message forwarding device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the message forwarding method according to any one of claims 1 to 6 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the message forwarding method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Message transmission method and device
CN115242711A
Message forwarding method and device, computing equipment and unloading card
CN115567446A
Message processing method and device, electronic equipment and medium product
CN119167115A
Data packet express forwarding method and apparatus
WO2015074324A1