Packet forwarding method, device, apparatus and storage medium

By dynamically determining the priority of message flows and mapping them to different egress channels, the packet loss and latency uncertainty issues of high-priority traffic during network congestion are resolved, and deterministic forwarding of high-priority traffic is achieved, meeting the real-time requirements of industrial automation and autonomous driving.

CN115883484BActive Publication Date: 2025-10-21SUZHOU CENTEC COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111120953.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-24
Publication Date
2025-10-21
Estimated Expiration
2041-09-24

AI Technical Summary

Technical Problem

In existing technologies, high-priority traffic suffers packet loss and uncertain latency during network congestion, which cannot meet the deterministic requirements of fields such as industrial automation and autonomous driving.

Method used

By dynamically determining the first-class priority of the message flow, mapping it to different egress channels, and preferentially forwarding the message flow of the high-priority channel in the event of congestion, packet loss caused by absolute priority scheduling can be avoided.

Benefits of technology

It achieves deterministic forwarding of high-priority traffic in the case of network congestion, reduces packet loss, and ensures real-time data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115883484B_ABST
    Figure CN115883484B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a packet forwarding method, device, equipment and storage medium. The packet forwarding method is applied to a network chip. The method comprises the following steps: dynamically determining a first type priority of a received packet flow; when the first type priority of the packet flow is a first priority, mapping the packet flow to a first egress channel; when the first type priority of the packet flow is a second priority, mapping the packet flow to a second egress channel; when the first egress channel is mapped with the packet flow, preferentially forwarding the packet flow mapped with the first egress channel from an egress end compared with the packet flow mapped with the second egress channel. The embodiment of the present disclosure can provide a deterministic forwarding delay for high-priority packets, and can guarantee that high-priority data flows are not affected even in a congestion scenario, thereby providing support for an Ethernet environment with high real-time requirements for data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of network communication technology, and in particular to a message forwarding method, apparatus, device, and storage medium. Background Art

[0002] Although Ethernet is inherently non-deterministic, certain fields, such as industrial automation and autonomous driving, place high demands on determinism. This means that even if network traffic is congested, the latency of high-priority traffic must be guaranteed to be deterministic.

[0003] When network traffic is congested, the bandwidth received by the device's egress exceeds the maximum bandwidth that the port can withstand, resulting in packet loss, which in turn causes high-priority traffic to be lost and uncertain latency.

[0004] In related technologies, devices supporting QoS (Quality of Service) can be divided into multiple queues at the egress end. These queues are scheduled based on absolute priority, with packets entering different queues based on their priority fields, ensuring that high-priority packets enter the egress end first. However, this priority strategy relies on a rough classification based on the priority fields of packets, which can easily lead to unreasonable absolute priority scheduling for high-priority packets and packet loss. This makes it difficult to guarantee a consistent latency for high-priority traffic in practical applications, making it unsuitable for Ethernet environments with high real-time data transmission requirements. Summary of the Invention

[0005] Embodiments of the present disclosure provide a message forwarding method, apparatus, device, and storage medium.

[0006] The technical solution of the present disclosure is achieved as follows:

[0007] In a first aspect, a message forwarding method is provided, which is applied to a network chip. The method includes:

[0008] Dynamically determine the first-class priority of received message flows;

[0009] When the first priority level of the message flow is the first priority level, mapping the message flow to the first egress channel;

[0010] When the first priority of the message flow is the second priority, mapping the message flow to the second egress channel;

[0011] When a message flow is mapped to the first egress channel, the message flow mapped to the first egress channel is preferentially forwarded from the egress end over the message flow mapped to the second egress channel.

[0012] In the above technical solution, the dynamically determining the first priority of the received message flow includes:

[0013] According to the preset configuration information, obtaining the preset information corresponding to the message flow;

[0014] The preset information is mapped in a priority mapping table to obtain the first priority of the message flow.

[0015] In the above technical solution, obtaining the preset information corresponding to the message flow according to the preset configuration information includes:

[0016] Extracting message features of the message flow;

[0017] Match the preset information corresponding to the message feature from the pre-configured message matching rule list.

[0018] In the above technical solution, the message characteristics include: at least one of: source IP address, source port, destination IP address, destination port and transport layer protocol.

[0019] In the above technical solution, before the step of dynamically determining the first priority of the received message flow, the method further includes:

[0020] The preset configuration information is generated according to configuration operation information of the preset information corresponding to the message flow.

[0021] In the above technical solution, the preset information includes: transmission priority and / or discarding priority.

[0022] In the above technical solution, the method further includes:

[0023] Determining a priority field carried by the message flow;

[0024] The dynamically determining the first priority of the received message flow includes:

[0025] The combination of the priority field and the preset information is mapped in the priority mapping table to obtain the first priority of the message flow.

[0026] In a second aspect, a message forwarding device is provided, which is applied to a network chip, and the device includes:

[0027] A determination module, configured to dynamically determine a first priority level of a received message flow;

[0028] a mapping module, configured to map the message flow to a first egress channel when the first priority level of the message flow is a first priority level;

[0029] The mapping module is further configured to map the message flow to the second egress channel when the first priority level of the message flow is the second priority level;

[0030] The forwarding module is configured to, when a message flow is mapped to the first egress channel, preferentially forward the message flow mapped to the first egress channel from an egress end over the message flow mapped to the second egress channel.

[0031] In the above technical solution, the determination module includes:

[0032] An acquiring unit, configured to acquire preset information corresponding to the message flow according to preset configuration information;

[0033] A mapping unit is used to map the preset information in a priority mapping table to obtain the first priority of the message flow.

[0034] In the above technical solution, the acquisition unit is specifically used to:

[0035] Extracting message features of the message flow;

[0036] Match the preset information corresponding to the message feature from the pre-configured message matching rule list.

[0037] In the above technical solution, the message characteristics include: at least one of: source IP address, source port, destination IP address, destination port and transport layer protocol.

[0038] In the above technical solution, the device further includes a configuration module, which is used to:

[0039] The preset configuration information is generated according to configuration operation information of the preset information corresponding to the message flow.

[0040] In the above technical solution, the preset information includes: transmission priority and / or discarding priority.

[0041] In the above technical solution, the determination module further includes a determination unit;

[0042] The determining unit is configured to determine the priority field carried by the message flow;

[0043] The mapping unit is further configured to map a combination of the priority field and the preset information in the priority mapping table to obtain the first priority of the message flow.

[0044] In a third aspect, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the message forwarding method described in any one of the first aspects.

[0045] In a fourth aspect, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, wherein the computer program is configured to execute the message forwarding method described in any one of the first aspects when running.

[0046] The message forwarding method, apparatus, device and storage medium provided by the embodiments of the present disclosure dynamically determine the first priority of the received message flow. When the first priority of the message flow is the first priority, the message flow is mapped to the first export channel; when the first priority of the message flow is the second priority, the message flow is mapped to the second export channel; when the first export channel is mapped with a message flow, the message flow mapped with the first export channel is preferentially forwarded from the export end compared to the message flow mapped with the second export channel. Since the first priority of the message flow is dynamically determined, the priority scheduling of the message flow between the export channels is not absolute priority scheduling, but dynamic scheduling, which can achieve the rationality of the priority scheduling of the message flow and reduce the occurrence of packet loss caused by unreasonable scheduling priority to a certain extent. In this way, a deterministic forwarding delay can be provided for high-priority messages on the network chip forwarding pipeline (Pipeline), and high-priority data flows can be guaranteed to be unaffected even in congested scenarios, thereby providing support for Ethernet environments with high real-time requirements for data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A schematic diagram of a scenario provided for an embodiment of the present disclosure;

[0048] Figure 2 A schematic diagram of a flow chart of a message forwarding method provided in an embodiment of the present disclosure;

[0049] Figure 3 Another flowchart of the message forwarding method provided by the embodiment of the present disclosure;

[0050] Figure 4 Another flowchart of the message forwarding method provided in an embodiment of the present disclosure;

[0051] Figure 5 A further flow chart of the message forwarding method provided in an embodiment of the present disclosure;

[0052] Figure 6 A schematic structural diagram of a message forwarding device provided in an embodiment of the present disclosure;

[0053] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure. In the absence of conflict, the embodiments in the present disclosure and the features in the embodiments can be arbitrarily combined with each other. The steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. In addition, although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.

[0055] It is understandable that the description of each embodiment in this disclosure focuses on the differences between the embodiments, and the same or similar aspects thereof can be referenced with each other. For the sake of brevity, they will not be described one by one.

[0056] For an example of a scenario where burst traffic causes congestion, see Figure 1 As shown in the figure, assume that Port A and Port B of a network device are the ingress ports, and Port C is the egress port. All three ports have a 10G bandwidth, and the traffic on Port B is high-priority. During a certain period of time, Ports A and B simultaneously send data packets to Port C at 10G. Port C experiences packet loss because the bandwidth it receives exceeds its maximum capacity. In this scenario, how can we ensure that traffic on Port B is not lost and that latency is deterministic?

[0057] QoS divides the device's egress port into multiple queues, with absolute priority scheduling between them. Packets are assigned to different queues based on their priority fields, ensuring that high-priority packets enter the egress port first. However, this priority strategy, which relies on the packet's priority field, can easily lead to irrational absolute priority scheduling for high-priority packets, resulting in packet loss. This makes it difficult to guarantee consistent latency for high-priority traffic in practical applications, making it unsuitable for Ethernet environments with high real-time data transmission requirements.

[0058] To this end, an embodiment of the present disclosure provides a message forwarding method, which can be applied to a network chip. The network chip can be an application-specific integrated circuit (ASIC) chip or other chip, and can be specifically adjusted according to actual conditions.

[0059] See Figure 2As shown, the message forwarding method provided by the embodiment of the present disclosure may include:

[0060] 201. Dynamically determine the first priority of the received message flow.

[0061] The message flow is composed of at least one message with the same message characteristics.

[0062] The message feature can be determined based on at least one field in the message header. For example, multiple messages with the same source IP address constitute a message flow.

[0063] The message characteristics may also be determined according to an ingress port of the network chip for receiving the message. For example, a plurality of messages received by the same ingress port constitute a message flow.

[0064] The message flow may be an Ethernet frame flow, or a message flow composed of other messages, such as an IP message.

[0065] Here, the first priority of the message flow is used to represent the priority order of the network chip forwarding the message flow.

[0066] It is understandable that different message flows may have different priorities. For example, a message flow with a higher degree of importance has a higher corresponding priority. If the message flow has a lower degree of importance, the message flow has a lower corresponding priority.

[0067] Specifically, the first priority of the received message flow can be dynamically determined. Here, the first priority of the message flow is temporarily determined by the network chip after receiving the message flow, rather than being predetermined before the message flow is sent to the network chip.

[0068] The first priority of the dynamically determined message flow may be different from the second priority indicated by the priority field carried by the message flow itself.

[0069] 202. When the first priority of the message flow is the first priority, map the message flow to the first egress channel.

[0070] Here, the first priority of the message flow can be divided into a first priority and a second priority, and the first priority is higher than the second priority.

[0071] Accordingly, the egress port of the network chip may be divided into a first egress channel and a second egress channel.

[0072] The first egress channel corresponds to the first priority and is used to transmit the message flow of the first priority.

[0073] The second egress channel corresponds to the second priority and is used to transmit the message flow of the second priority.

[0074] In practical applications, the first priority message flow may be marked as an EMAC (Express Media Access Control) message flow, and the second priority message flow may be marked as a PMAC (Preemptable Media Access Control) message flow.

[0075] Specifically, when the first priority level of the message flow is the first priority level, the identifier of the first egress channel is associated with the message flow, and the message flow is transmitted to the first egress channel.

[0076] 203 : When the first priority of the message flow is the second priority, map the message flow to the second egress channel.

[0077] Specifically, when the first priority of the message flow is the second priority, the identifier of the second egress channel is associated with the message flow, and the message flow is transmitted to the second egress channel.

[0078] 204 , when the first egress channel is mapped with a message flow, the message flow mapped with the first egress channel is preferentially forwarded from the egress end over the message flow mapped with the second egress channel.

[0079] Specifically, when a message flow is mapped to the first egress channel, the message flow mapped to the first egress channel is transmitted to the first egress channel and is preferentially forwarded outward from the egress end compared to the message flow mapped to the second egress channel.

[0080] In actual applications, when a message flow is mapped to the first egress channel, the second egress channel can be closed or disabled to stop the transmission of the message flow mapped to the second egress channel, and the message flow mapped to the first egress channel is preferentially forwarded from the egress end through the first egress channel.

[0081] After the first egress channel completes transmission of the message flow, transmission of the message flow mapped to the second egress channel is started.

[0082] In the above-mentioned message forwarding method, by dynamically determining the first priority of the received message flow, when the first priority of the message flow is the first priority, the message flow is mapped to the first exit channel; when the first priority of the message flow is the second priority, the message flow is mapped to the second exit channel; when the first exit channel is mapped with a message flow, the message flow mapped to the first exit channel is forwarded from the exit end in priority to the message flow mapped to the second exit channel.

[0083] Since the first-class priority of the message flow is dynamically determined, the priority scheduling of the message flow between the egress channels is not absolute priority scheduling, but dynamic scheduling. This can achieve the rationality of the priority scheduling of the message flow and reduce the occurrence of packet loss due to unreasonable scheduling priority to a certain extent.

[0084] In this way, deterministic forwarding delay can be provided for high-priority messages on the network chip forwarding pipeline, ensuring that high-priority data flows are not affected even in congested scenarios, thereby providing support for Ethernet environments with high requirements for real-time data transmission.

[0085] In one embodiment, Figure 3 As shown, in the above step 201, dynamically determining the first priority of the received message flow may include:

[0086] 301. Obtain preset information corresponding to the message flow according to preset configuration information.

[0087] The preset configuration information is stored inside the network chip, and the preset configuration information includes different preset information set for different message flows.

[0088] Here, different message flows can be distinguished based on message characteristics. The message characteristics can be determined based on other fields other than the priority field carried by the message flow.

[0089] For example, the message feature may be one or more of a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.

[0090] 302 : Map the preset information in the priority mapping table to obtain the first priority of the message flow.

[0091] Specifically, after the preset information corresponding to the message flow is acquired, the priority mapping table may be searched according to the preset information, and the first priority of the message flow may be determined according to the priority mapping result.

[0092] The priority mapping table pre-sets a mapping relationship between the preset information and the first priority. The mapping relationship between the preset information and the first priority can be a many-to-one relationship.

[0093] In the disclosed embodiments, preset information corresponding to a message flow is obtained through preset configuration information, and priority mapping is performed on the preset information to obtain the first-class priority of the message flow. This allows the user to specify which message has a higher priority based on the preset configuration information, ensuring that the priority scheduling of message flows between egress channels is not absolute priority scheduling, but rather dynamic scheduling. This ensures the rationality of the priority scheduling of message flows, reduces the occurrence of packet loss due to unreasonable scheduling priorities, and ensures the determinism of the delay of high-priority messages.

[0094] In one embodiment, Figure 4 As shown, in the above step 301, obtaining the preset information corresponding to the message flow according to the preset configuration information may include:

[0095] 401. Extract message features from the message flow.

[0096] Specifically, the headers of the messages in the message flow are parsed to obtain at least one field in the header, and the message characteristics of the message flow are determined according to the at least one field in the header.

[0097] Here, the at least one field used to determine the message feature of the message flow can be set according to actual application needs and is not specifically limited here.

[0098] In one example, in order to ensure that deterministic low-latency traffic forwarding is not limited by the content of the priority field in the message, at least one field used to determine the message characteristics of the message flow can be different from the priority field in the message flow.

[0099] In one example, the message features include: at least one of a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.

[0100] 402. Match preset information corresponding to the message feature from a pre-configured message matching rule list.

[0101] The message matching rule list includes multiple pre-configured entries, and different entries are used to match different message features to obtain corresponding preset information.

[0102] The message matching rule list may specifically be an access control list (ACL). The ACL includes multiple ACL entries, each of which stores a message feature value and preset information corresponding to the message feature value.

[0103] Specifically, after extracting the message feature from the message flow, the value of the message feature can be used as a search keyword to search for a table entry that matches the value of the message feature in the pre-configured message matching rule list, and the preset information corresponding to the value of the message feature can be matched from the table entry.

[0104] For example, taking the source IP address as a message feature, a search can be performed in the message matching rule list based on the value of the source IP address. When the value of the source IP address belongs to the source IP address range specified by a certain table entry, the preset information corresponding to the source IP address range in the table entry can be determined as the preset information corresponding to the value of the source IP address.

[0105] It is understandable that corresponding preset information may be matched from the message matching rule list in combination with multiple message features, and the embodiments of the present disclosure do not specifically limit this.

[0106] In one embodiment, before step 201 is performed, the method may further include:

[0107] Generate preset configuration information according to configuration operation information of preset information corresponding to the message flow.

[0108] Specifically, a configuration interface is provided to the user to receive configuration operation information, wherein the configuration interface includes message characteristics of the message flow and preset information options, and the configuration operation information includes a correspondence established on the configuration interface between the message characteristics of the message flow and the preset information options.

[0109] In the embodiment of the present disclosure, by setting corresponding preset information for different message flows according to message characteristics, the preset information corresponding to the message flow can be determined subsequently based on the source IP address, source port, destination IP address, destination port or transport layer protocol of the message flow, thereby determining the first-class priority of the message flow.

[0110] In addition, through the settings of the configuration interface, the user can configure the preset information corresponding to different message flows through the configuration interface, so that the user's configuration requirements for the preset information corresponding to different message flows can be met.

[0111] In one embodiment, the preset information includes: transmission priority and / or discarding priority.

[0112] The preset information corresponding to the message flow may be a transmission priority.

[0113] In actual applications, the higher the transmission priority corresponding to a message flow, the easier it is for the message flow to be transmitted.

[0114] The preset information can be marked with marking information. The marking information can be a text mark. For example, a transmission priority of "level 1" indicates a higher transmission priority, and a transmission priority of "level 2" indicates a lower transmission priority. In addition, the marking information can also be a numerical mark or an alphabetic mark, etc.

[0115] The preset information corresponding to the packet flow may be a discard priority, which is used to indicate the order in which packets are discarded when network congestion occurs.

[0116] In practice, packet color can be used to indicate the discard priority. Packet color has three possible values: Green, Yellow, and Red.

[0117] In one example, when the preset information includes a transmission priority and a discarding priority, in step 302, the preset information is mapped in the priority mapping table to obtain the first priority of the packet flow, which may include:

[0118] The combination of the transmission priority and the discard priority is mapped in the priority mapping table to obtain the first priority of the packet flow.

[0119] In the embodiment of the present disclosure, the determination of the first-class priority of the message flow does not rely on a single preset information, but is mapped and determined in the priority mapping table based on the combination of transmission priority and discard priority. In this way, by determining the first-class priority of the message flow through two kinds of preset information, it is possible to achieve a fine division of the priority of the message flow, thereby effectively coping with complex application scenarios.

[0120] In one embodiment, the method may further include:

[0121] Determine the priority field carried by the message flow; wherein the priority field indicates the second priority.

[0122] Here, the first priority may be higher than the second priority.

[0123] In step 201 above, dynamically determining the first priority of the received message flow may include:

[0124] The combination of the priority field and the preset information is mapped in the priority mapping table to obtain the first priority of the message flow.

[0125] Here, the priority field may include a cos (code of service) field or a dscp (Differentiated Services Code Point) field.

[0126] In the embodiment of the present disclosure, by combining the priority field in the message flow and the preset information corresponding to the message flow obtained according to the preset configuration information, the dynamic priority of the message flow is dynamically determined by combining multiple information, which can further ensure the rationality of the priority scheduling of the message flow.

[0127] Next, combine Figure 5 Taking an ASIC chip as an example, the message forwarding method provided by the embodiment of the present disclosure is illustrated. A single port of the ASIC chip can simultaneously output PMAC and EMAC messages. The ASIC chip prioritizes scheduling for message flows redirected to the channel corresponding to the EMAC.

[0128] like Figure 5 As shown in FIG, the specific process of the message forwarding method is as follows:

[0129] 1. The message flow is matched against the pre-configured access control list (ACL) in the ASIC chip's IPE (Ingress Process Engine) and receives the corresponding preset priority and color.

[0130] 2. Map the priority and color matched by the ACL in the priority mapping table to determine whether the message flow is high-priority traffic.

[0131] The priority mapping table is pre-configured with first-class priorities mapped with different combinations of preset priorities and colors.

[0132] 3. When the message flow is determined to be high-priority traffic, the message flow is redirected to the channel corresponding to EMAC.

[0133] 4. When it is determined that the message flow is not high-priority traffic, the message flow is redirected to the channel corresponding to PMAC.

[0134] 5. The ASIC chip prioritizes scheduling the message flow redirected to the channel corresponding to the EMAC.

[0135] The message forwarding method provided by the embodiment of the present disclosure is assisted by an ASIC chip, and a single port can output two MACs (PMAC and EMAC) at the same time, and the two MACs have corresponding egress channels.

[0136] The ASIC chip can match the priority and color of the message flow based on the user's configured ACL, and can specify one or more priority and color combinations according to the priority mapping table to go to the high-priority channel (that is, the channel corresponding to EMAC).

[0137] In this way, based on specific traffic, it is possible to specify which packets go through high-priority channels and which packets go through low-priority channels, providing deterministic forwarding latency for high-priority packets in the chip forwarding pipeline. This ensures that high-priority EMAC data flows are not affected even in congested scenarios, thus providing support for Ethernet environments with high real-time data transmission requirements.

[0138] See Figure 6 As shown, an embodiment of the present disclosure provides a message forwarding device, which is applied to a network chip, and the device includes:

[0139] Determination module 601, used to dynamically determine the first priority of the received message flow;

[0140] A mapping module 602 is configured to map the message flow to the first egress channel when the first priority of the message flow is the first priority;

[0141] The mapping module 602 is further configured to map the message flow to the second egress channel when the first priority of the message flow is the second priority;

[0142] The forwarding module 603 is configured to, when a message flow is mapped to the first egress channel, preferentially forward the message flow mapped to the first egress channel from the egress end over the message flow mapped to the second egress channel.

[0143] In one embodiment, the determination module 601 includes:

[0144] An acquiring unit, configured to acquire preset information corresponding to a message flow according to preset configuration information;

[0145] The mapping unit is used to map the preset information in the priority mapping table to obtain the first priority of the message flow.

[0146] In one embodiment, the acquiring unit is specifically configured to:

[0147] Extracting packet features from packet flows;

[0148] Matches the preset information corresponding to the message features from the pre-configured message matching rule list.

[0149] In one embodiment, the message characteristics include: at least one of a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.

[0150] In one embodiment, the apparatus further comprises a configuration module, the configuration module being configured to:

[0151] Generate preset configuration information according to configuration operation information of preset information corresponding to the message flow.

[0152] In one embodiment, the preset information includes: transmission priority and / or discarding priority.

[0153] In one embodiment, the determination module further includes a determination unit;

[0154] A determination unit, configured to determine a priority field carried by the message flow; wherein the priority field indicates a second priority;

[0155] The mapping unit is further configured to map the combination of the priority field and the preset information in the priority mapping table to obtain the first priority of the message flow.

[0156] It should be noted that the message forwarding device provided in the above embodiment, when executing the message forwarding method, is merely illustrated by the division of the aforementioned program modules. In actual applications, the aforementioned processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the aforementioned processing. Furthermore, the message forwarding device provided in the above embodiment and the message forwarding method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0157] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure; Figure 7 As shown, the computer device 700 includes: a memory 701 and a processor 702. The memory 701 stores a computer program, and the processor 702 is configured to run the computer program to perform the following operations:

[0158] Dynamically determine the first-class priority of received message flows;

[0159] When the first priority of the message flow is the first priority, mapping the message flow to the first egress channel;

[0160] When the first priority of the message flow is the second priority, mapping the message flow to the second egress channel;

[0161] When a message flow is mapped to the first egress channel, the message flow mapped to the first egress channel is preferentially forwarded from the egress end of the network chip over the message flow mapped to the second egress channel.

[0162] In actual application, the computer device 700 may further include: at least one network interface 703. The various components in the computer device 700 are coupled together via a bus system 704. It is understood that the bus system 704 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7In the figure, various buses are labeled as bus system 704. There can be at least one processor 701. The network interface 703 is used for wired or wireless communication between the computer device 700 and other devices.

[0163] The memory 702 in the embodiment of the present disclosure is used to store various types of data to support the operation of the computer device 700 .

[0164] The methods disclosed in the above embodiments of the present disclosure can be applied to or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor 701 or by software instructions. The above processor 701 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 701 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of the present disclosure can be directly implemented as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium located in the memory 702. The processor 701 reads the information in the memory 702 and completes the steps of the above method in conjunction with its hardware.

[0165] In an exemplary embodiment, the computer device 700 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to execute the aforementioned methods.

[0166] The present disclosure also provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to perform the following operations when executed:

[0167] Dynamically determine the first-class priority of received message flows;

[0168] When the first priority of the message flow is the first priority, mapping the message flow to the first egress channel;

[0169] When the first priority of the message flow is the second priority, mapping the message flow to the second egress channel;

[0170] When a message flow is mapped to the first egress channel, the message flow mapped to the first egress channel is preferentially forwarded from the egress end of the network chip over the message flow mapped to the second egress channel.

[0171] In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0172] The units described above 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 distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0173] In addition, all functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0174] Those skilled in the art will appreciate that all or part of the steps of the above-mentioned method embodiments may be implemented by hardware associated with program instructions, and the aforementioned program may be stored in a computer-readable storage medium. When the program is executed, the program executes the steps of the above-mentioned method embodiments. The aforementioned storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0175] Alternatively, if the above-mentioned integrated unit of the present disclosure is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present disclosure 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 is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods of each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0176] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0177] In addition, the technical solutions described in the embodiments of the present disclosure can be arbitrarily combined without conflict.

[0178] The above are only specific embodiments of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. A message forwarding method, characterized in that: Applied to a network chip, the method includes: Dynamically determine a first priority of a received message flow; wherein the first priority is obtained by mapping preset information of the message flow in a priority mapping table; the priority mapping table pre-sets a mapping relationship between the preset information and the first priority, and the mapping relationship between the preset information and the first priority is a many-to-one mapping; the preset information includes a transmission priority and a discard priority; When the first priority level of the message flow is the first priority level, mapping the message flow to the first egress channel; When the first priority of the message flow is the second priority, mapping the message flow to the second egress channel; When a message flow is mapped to the first egress channel, the message flow mapped to the first egress channel is preferentially forwarded from the egress end over the message flow mapped to the second egress channel; wherein the first egress channel and the second egress channel are two egress channels divided from the same egress end.

2. The method according to claim 1, characterized in that The dynamically determining the first priority of the received message flow includes: According to the preset configuration information, obtaining the preset information corresponding to the message flow; The preset information is mapped in a priority mapping table to obtain the first priority of the message flow.

3. The method according to claim 2, characterized in that The acquiring, according to the preset configuration information, preset information corresponding to the message flow includes: Extracting message features of the message flow; Match the preset information corresponding to the message feature from the pre-configured message matching rule list.

4. The method according to claim 3, characterized in that The message features include: at least one of a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.

5. The method according to claim 2, characterized in that Before the step of dynamically determining the first priority of the received message flow, the method further includes: The preset configuration information is generated according to configuration operation information of the preset information corresponding to the message flow.

6. The method according to claim 2, characterized in that The method further comprises: Determining a priority field carried by the message flow; wherein the priority field indicates a second priority; The dynamically determining the first priority of the received message flow includes: The combination of the priority field and the preset information is mapped in the priority mapping table to obtain the first priority of the message flow.

7. A message forwarding device, used to implement the message forwarding method according to any one of claims 1 to 6, characterized in that: Applied to a network chip, the device includes: A determination module, configured to dynamically determine a first priority level of a received message flow; a mapping module, configured to map the message flow to a first egress channel when the first priority level of the message flow is a first priority level; The mapping module is further configured to map the message flow to the second egress channel when the first priority level of the message flow is the second priority level; The forwarding module is configured to, when a message flow is mapped to the first egress channel, preferentially forward the message flow mapped to the first egress channel from an egress end over the message flow mapped to the second egress channel.

8. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the message forwarding method described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the message forwarding method according to any one of claims 1 to 6 when running.

Citation Information

Patent Citations

  • Network chip memory management method

    CN105743814A

  • Method and device for improving delay sensitive flow forwarding performance

    CN110035019A