Message forwarding device and method

By designing preprocessing modules and adaptive forwarding modules in the switching chip, the problems of excessive delays in store-forwarding and direct-forwarding and message outage are solved, and more efficient message forwarding and lower delays are achieved.

CN120090993AActive Publication Date: 2025-06-03WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510323640.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-03
Estimated Expiration
2045-03-18

AI Technical Summary

Technical Problem

Store-forwarding and pass-through forwarding have problems with excessive delay and message outage in the switching chip.

Method used

A message forwarding device is designed, including a preprocessing module and an adaptive forwarding module. The preprocessing module determines the packet length and forwarding path based on the message header, and starts timing transmission delay. The adaptive forwarding module adaptively selects a forwarding scheme based on firmware configuration information or message header, and only starts forwarding when a full message is received or the transmission delay exceeds the threshold.

Benefits of technology

It effectively reduces the delay in message forwarding, improves packet forwarding efficiency, ensures high utilization of the switching matrix bandwidth, and handles abnormal messages in direct-through forwarding mode, avoiding bandwidth waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120090993A_ABST
    Figure CN120090993A_ABST
Patent Text Reader

Abstract

The invention provides a message forwarding device and method. The device comprises a preprocessing module and a self-adaptive forwarding module, the preprocessing module is used for determining a message length and a switching matrix according to a message header after the message header of the input message is received, and starting to time transmission delay; the adaptive forwarding module adaptively selects a forwarding scheme according to firmware configuration information or a message header; for the input message selected to use the first forwarding scheme, the self-adaptive forwarding module starts forwarding after receiving the complete input message or the transmission delay is greater than a forwarding threshold value; the forwarding threshold is related to the length of the input message, the rate of the switching matrix and the rate of an entry port of the input message; for the input message selected to use the second forwarding scheme, the self-adaptive forwarding module starts forwarding after receiving the complete input message or the transmission delay is greater than a forwarding threshold value; the forwarding threshold is related to the length of the input packet, the rate of the egress port, and the rate of the ingress port of the input packet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of chip technology, and particularly relates to a packet forwarding device and method. Background Art

[0002] In a switching chip, the forwarding delay of a packet is an important indicator for evaluating the performance of the switching chip, directly affecting the network response time and data throughput. And in protocols such as IB and PCIE, it is required that the physical link continuously completes the transmission of a packet without interruption or flow interruption within the packet. To achieve the above two purposes, the common solutions in the industry currently are store-and-forward and cut-through forwarding. Summary of the Invention

[0003] The purpose of this application is to provide a packet forwarding device and method, aiming to solve problems such as excessive delay and packet flow interruption existing in store-and-forward and cut-through forwarding.

[0004] According to the first aspect of this application, a packet forwarding device is provided, including: a preprocessing module and an adaptive forwarding module;

[0005] The preprocessing module is used to determine the packet length of the input packet and the switching matrix to which the input packet is to be forwarded according to the packet header after receiving the packet header of the input packet, and start timing the transmission delay;

[0006] The adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to the firmware configuration information or the packet header;

[0007] For the input packet selected to use the first forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input packet or the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the magnitude relationship between the rate of the switching matrix and the rate of the ingress port of the input packet;

[0008] For the input packet selected to use the second forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input packet or the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the magnitude relationship between the rate of the egress port of the input packet and the rate of the ingress port of the input packet.

[0009] In an optional implementation manner, if the firmware configuration information configures the forwarding scheme of the input packet, the adaptive forwarding module determines the forwarding scheme of the input packet according to the firmware configuration information.

[0010] In an alternative embodiment, if the firmware configuration information configures the configuration relationship between the message type of the input message and the forwarding scheme, the preprocessing module parses the message type of the input message from the message header of the input message, and the adaptive forwarding module determines the forwarding scheme of the input message according to the message type and the firmware configuration information.

[0011] In an alternative embodiment, if the forwarding scheme of the input message is not configured in the firmware configuration information, the preprocessing module parses the field segment content indicating whether the input message is a high-priority message from the message header; when the adaptive forwarding module determines that the input message is a non-high-priority message according to the field segment content, the adaptive forwarding module selects to use the first forwarding scheme to forward the input message, and when the adaptive forwarding module determines that the input message is a high-priority message according to the field segment content, the adaptive forwarding module selects to use the second forwarding scheme to forward the input message.

[0012] In an alternative embodiment, for the input message that selects to use the first forwarding scheme, when the rate of the entry port of the input message is less than or equal to the rate of the switching matrix, the forwarding threshold is related to the reception time and the output time of the input message; for the input message that selects to use the second forwarding scheme, when the rate of the entry port of the input message is less than or equal to the rate of the exit port, the forwarding threshold is related to the reception time and the output time of the input message; the reception time is determined based on the length of the input message and the rate of the entry port, and the output time is determined based on the length of the input message and the rate of the switching matrix.

[0013] In an alternative embodiment, for the input message that selects to use the first forwarding scheme, when the rate of the entry port of the input message is greater than the rate of the switching matrix, the forwarding threshold is 0; for the input message that selects to use the second forwarding scheme, when the rate of the entry port of the input message is greater than the rate of the exit port, the forwarding threshold is 0.

[0014] In an alternative embodiment, when it is recognized that the input message is an abnormal message, if the message header of the input message has been forwarded to the switching matrix, the adaptive forwarding module supplements an end-of-bad-packet flag at the output end of the entry port and discards the message content of the input message that has not been sent; if the message header of the input message has not been forwarded to the switching matrix, the adaptive forwarding module discards the entire input message.

[0015] According to the first aspect of the present application, there is provided a message forwarding method, including:

[0016] After receiving the header of the input message, the preprocessing module determines the message length of the input message and the switching matrix to which the input message is to be forwarded according to the header, and starts timing the transmission delay;

[0017] The adaptive forwarding module adaptively selects the forwarding scheme of the input message according to the firmware configuration information or the header;

[0018] For the input message selected to use the first forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input message or when the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the relationship between the rate of the switching matrix and the rate of the ingress port of the input message;

[0019] For the input message selected to use the second forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input message or when the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the relationship between the rate of the egress port of the input message and the rate of the ingress port of the input message.

[0020] In an optional implementation manner, the adaptive forwarding module adaptively selects the forwarding scheme of the input message according to the firmware configuration information or the header, including:

[0021] If the firmware configuration information configures the forwarding scheme of the input message, the adaptive forwarding module determines the forwarding scheme of the input message according to the firmware configuration information.

[0022] In an optional implementation manner, if the firmware configuration information configures the configuration relationship between the message type of the input message and the forwarding scheme, the method further includes;

[0023] The preprocessing module parses the message type of the input message from the header of the input message;

[0024] In an optional implementation manner, the adaptive forwarding module adaptively selects the forwarding scheme of the input message according to the firmware configuration information or the header, including:

[0025] The adaptive forwarding module determines the forwarding scheme of the input message according to the message type and the firmware configuration information.

[0026] In an optional implementation manner, if the firmware configuration information does not configure the forwarding scheme of the input message, the method further includes:

[0027] The preprocessing module parses from the header the field content indicating whether the input message is a high-priority message;

[0028] The adaptive forwarding module adaptively selects a forwarding scheme for the input packet according to the firmware configuration information or the packet header, including:

[0029] When the adaptive forwarding module determines that the input packet is a non-high-priority packet according to the field segment content, it selects to forward the input packet using a first forwarding scheme;

[0030] When the adaptive forwarding module determines that the input packet is a high-priority packet according to the field segment content, it selects to forward the input packet using a second forwarding scheme.

[0031] In an alternative embodiment, for the input packet that selects to use the first forwarding scheme, when the rate of the input port of the input packet is less than or equal to the rate of the switching matrix, the forwarding threshold is related to the reception time of the input packet and the output time of the input packet; for the input packet that selects to use the second forwarding scheme, when the rate of the input port of the input packet is less than or equal to the rate of the output port, the forwarding threshold is related to the reception time of the input packet and the output time of the input packet; the reception time is determined based on the length of the input packet and the rate of the input port, and the output time is determined based on the length of the input packet and the rate of the switching matrix.

[0032] In an alternative embodiment, for the input packet that selects to use the first forwarding scheme, when the rate of the input port of the input packet is greater than the rate of the switching matrix, the forwarding threshold is 0; for the input packet that selects to use the second forwarding scheme, when the rate of the input port of the input packet is greater than the rate of the output port, the forwarding threshold is 0.

[0033] In an alternative embodiment, the method further includes:

[0034] When it is recognized that the input packet is an abnormal packet, if the packet header of the input packet has been forwarded to the switching matrix, the adaptive forwarding module supplements a bad packet end flag at the output end of the input port and discards the packet content of the input packet that has not been sent out;

[0035] If the packet header of the input packet has not been forwarded to the switching matrix, the adaptive forwarding module discards the entire input packet.

[0036] Compared with the related art, the technical solution of this application has the following advantages:

[0037] The technical solution of this application can effectively reduce the packet forwarding delay and improve the packet forwarding efficiency. First of all, this solution can flexibly select the forwarding delay scheme according to the packet priority. For packets with higher priority, the delay is further reduced. For other packets, on the premise of ensuring that the bandwidth of the switching matrix is not wasted, the packet forwarding delay is reduced. The adaptive transmission delay can select the optimal transmission delay for packets of different sizes and different port rates, and improve the transmission rate of small packets. The two forwarding schemes can be configured and can be hardware-adaptive. According to the actual test results, the appropriate scheme can be selected, and the appropriate scheme can be selected for different packets. The abnormal packet processing scheme in the cut-through forwarding mode can reduce the bandwidth waste of abnormal packets on the switching chip and the switching network.

[0038] Other features and advantages of this application will be described in the following specification, and will be partially obvious from the specification, or understood by implementing this application. The objectives and other advantages of this application can be achieved and obtained through the structures and processes pointed out in the specification and the drawings. Brief Description of the Drawings

[0039] In order to more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0040] Figure 1 It is a schematic structural diagram of a packet forwarding device according to an exemplary embodiment of this application.

[0041] Figure 2 It is a schematic flowchart of determining the packet forwarding timing according to an exemplary embodiment of this application.

[0042] Figure 3 It is a schematic diagram of the timing comparison between the first forwarding scheme and the second forwarding scheme according to an exemplary embodiment of this application.

[0043] Figure 4 It is a schematic diagram of the abnormal packet processing effect according to an exemplary embodiment of this application.

[0044] Figure 5 It is a schematic flowchart of a packet forwarding method according to an exemplary embodiment of this application. Detailed Embodiments

[0045] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are some, but not all, of the embodiments of this application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the scope of protection of this application.

[0046] Store-and-forward waits for all packets to be received, stores the complete packet in the on-chip cache, then checks the packet, and finally forwards the packet. Cut-through forwarding forwards the packet immediately after receiving it, that is, without waiting for the entire packet to be received, and directly forwards the packet.

[0047] If store-and-forward is used, the switching chip will first receive the complete packet and store it in a cache, and then the switching chip will check the packet. If the check passes, it will be forwarded to the target port. If the check fails, that is, an anomaly is found, the packet will be discarded. Therefore, the forwarding delay in this method is relatively large. Since store-and-forward receives the complete packet before processing the packet, the packets forwarded by the switching chip must be packets that have passed all checks and have no anomalies. Usually, store-and-forward is applicable to scenarios with high requirements for data accuracy.

[0048] If cut-through forwarding is adopted, after receiving some important information such as the packet header, the packet will be forwarded to the target port immediately without waiting for the entire packet to be received, which can reduce the forwarding delay of the packet. However, since the entire packet is not received, the packet check is not sufficient, so there may be incorrect packets being forwarded. This also leads to the possible transmission of incorrect data packets in the switching chip, and a mechanism for handling incorrect packets needs to be set inside the switching chip. Cut-through forwarding is generally applied to application scenarios with high requirements for latency.

[0049] In some related technologies, to improve the network transmission quality of the switching chip, when the requirement for delay is not high, wait for all packets to be received, store them in the cache, and then forward them after completing the packet check. However, each physical port of the switching chip supports multiple rates. Taking an IB switching chip as an example, the link widths are x8, x4, x2, x1, and the link rates are 100G, 50G, 25G, etc. Then, at different rates, the time required to receive the entire packet varies greatly. The time required to receive the entire packet is the longest at the lowest rate. For example, when the link width is x1 and the link rate is 2.5G, the time required to receive a complete maximum packet is approximately 1320 ns, which has a great impact on the packet forwarding delay.

[0050] In some other related technologies, to reduce the network transmission delay of a switching chip, cut-through forwarding is directly adopted. After receiving some important information such as the packet header, the data is directly forwarded to the target port. However, this method has the problem of wasting the bandwidth utilization rate of the switching matrix crossbar, and when outputting abnormal packets, it not only affects the current switching chip, but also may affect the bandwidth utilization rate of the entire network because the abnormal packets are transmitted all the way.

[0051] To solve the problems of excessive delay and packet disconnection existing in store-and-forward and cut-through forwarding, this application combines the two. First, a forwarding delay is set for the packet, and the packet is forwarded after a period of delay. Second, to improve the bandwidth utilization rate of the switching matrix crossbar, the switching matrix is used as the egress port, which not only avoids the problem of multiple rates existing in the egress port, but also ensures the bandwidth utilization rate of the switching matrix crossbar.

[0052] In addition, for high-priority packets, this application also provides a mechanism to further reduce the forwarding delay. To ensure that the egress port is not disconnected, this application sets a forwarding delay. At the hardware level, an optimal forwarding delay cut_level can be calculated based on the rate of the egress port, the rate of the ingress port, the packet length, etc. After the optimal forwarding delay cut_level is satisfied, the packet is started to be forwarded. Among them, whether it is a high-priority packet can be configured by the user through software, and at the hardware level, by parsing the corresponding field in the header field of the data packet, it is judged whether the current data packet is a high-priority packet.

[0053] To reduce the possibility of abnormal packets being transmitted in the switching chip caused by high-efficiency cut-through forwarding, this application also adds an exception handling mechanism, that is, when an exception is found at the receiving port, the abnormal packet is immediately truncated to avoid the abnormal packet being transmitted in the switching network, and the bandwidth utilization rate of the switching network is improved.

[0054] Based on the above analysis, see Figure 1 As shown, this application exemplarily proposes a packet forwarding device, including: a preprocessing module and an adaptive forwarding module;

[0055] The preprocessing module is used to determine the packet length of the input packet and the switching matrix to which the input packet is to be forwarded according to the packet header after receiving the packet header of the input packet, and start timing the transmission delay;

[0056] The adaptive forwarding module adaptively selects a forwarding scheme for the input packet according to the firmware configuration information or the packet header;

[0057] For an input packet that selects to use the first forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input packet or when the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the magnitude relationship between the rate of the switching matrix and the rate of the ingress port of the input packet.

[0058] For an input packet that selects to use the second forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input packet or when the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the magnitude relationship between the rate of the egress port of the input packet and the rate of the ingress port of the input packet.

[0059] Exemplarily, the packet forwarding device can be set at the ingress port of the input packets of the switching chip. The preprocessing module can pre-obtain the rate of each physical port of the switching chip and the rate of the switching matrix, which is convenient for subsequent calculation of the transmission delay. The transmission delay is the time from receiving the packet header of the input packet to starting to forward the packet header to the switching matrix.

[0060] Exemplarily, after the ingress port receives the packet header of the input packet, it can parse the packet header, and the preprocessing module can obtain the length of the input packet and other relevant information from the packet header. The packet header can record the length pktlen of the input packet, the packet type, the packet destination device ID, etc. The preprocessing module can obtain the routing information corresponding to the destination device ID by querying the routing table Routing_info, and then obtain the egress port to which the input packet is to be forwarded. Thus, the rate of the egress port of the input packet can be determined according to the pre-obtained rate (Export: rate) of the physical port of the switching chip. After receiving the packet header, the preprocessing module can also start timing to monitor the transmission delay.

[0061] Exemplarily, the present application selects the cut-through forwarding scheme of the input packet according to the firmware configuration information and hardware adaptation. The forwarding scheme can include two types: the first forwarding scheme and the second forwarding scheme.

[0062] In the first forwarding scheme, it can ensure low occupancy of the switching matrix crossbar and ensure that the actual rate of the switching matrix is equal to the designed rate of the switching matrix. The designed rate is the rate of the switching matrix pre-obtained by the preprocessing module, where the rate of the switching matrix is related to the application scenario. Under the first forwarding scheme, the transmission delay of the switching matrix is small, and the bandwidth occupancy rate is low, which can ensure that the bandwidth of the switching matrix is not wasted.

[0063] In the second forwarding scheme, it can ensure the minimum transmission delay, ensure no disconnection in the packets at the egress port and a smaller transmission delay, but there is packet disconnection in the packet transmission within the switching matrix.

[0064] Based on this, after selecting the first forwarding scheme, when the transmission delay after receiving the header of the input packet is greater than the forwarding threshold, the adaptive forwarding module initiates a packet transmission request to start forwarding the input packet, and the forwarding rate is the rate of the switching matrix. This can ensure that there is no packet stream interruption in the switching matrix and the bandwidth occupancy rate is low. In the first forwarding scheme, the forwarding threshold is determined based on the rate of the switching matrix and the rate of the input port of the input packet. For example, when the rate of the switching matrix is greater than or equal to the rate of the input port, a certain forwarding threshold can be determined, and when the rate of the switching matrix is less than the rate of the input port, another forwarding threshold can be determined. The forwarding threshold in the former case is greater than that in the latter case, which can ensure that there is no packet stream interruption at the exit.

[0065] After selecting the second forwarding scheme, when the transmission delay after receiving the header of the input packet is greater than the forwarding threshold, the adaptive forwarding module initiates a packet transmission request to start forwarding the input packet, and the forwarding rate is the rate of the output port. This can ensure that the forwarding delay of the input packet is minimized, and after the input packet is forwarded from the switching matrix to the output port, there is no packet stream interruption in the output port, and finally the transmission delay of forwarding the input packet from the output port is smaller than that of the first scheme. In the second forwarding scheme, the forwarding threshold is determined based on the rate of the output port of the input packet and the rate of the input port of the input packet. For example, when the rate of the output port is greater than or equal to the rate of the input port, a certain forwarding threshold can be determined, and when the rate of the output port is less than the rate of the input port, another forwarding threshold can be determined. The forwarding threshold in the former case is greater than that in the latter case, which can ensure that there is no packet stream interruption at the exit.

[0066] In some optional implementation manners, the preprocessing module determines the switching matrix to which the input packet is to be forwarded by looking up the routing table based on the destination device identifier parsed from the packet header.

[0067] Exemplarily, the destination device identifier of the input packet can be parsed from the header of the input packet, and the packet forwarding routing table is stored inside the switching chip. By querying the forwarding routing table, the output port corresponding to the destination device with this destination device identifier can be determined, and thus the rate of the output port can be determined.

[0068] In some optional implementation manners, if the firmware configuration information configures the forwarding scheme of the input packet, the adaptive forwarding module determines the forwarding scheme of the input packet according to the firmware configuration information.

[0069] Exemplarily, in the firmware configuration information, it can be pre-configured whether all input messages adopt the first forwarding scheme or the second forwarding scheme. The adaptive forwarding module then determines whether the currently received input message adopts the first forwarding scheme or the second forwarding scheme based on the configuration in the firmware configuration information.

[0070] In some alternative implementation manners, if the firmware configuration information configures the configuration relationship between the message type of the input message and the forwarding scheme, the preprocessing module parses the message type of the input message from the message header of the input message, and the adaptive forwarding module determines the forwarding scheme of the input message according to the message type and the firmware configuration information.

[0071] Exemplarily, the firmware configuration information can also be configured such that different message types adopt different forwarding schemes. For the currently received input message, the message type of the input message can be determined by parsing the message header, and then the parsed message type is matched with the firmware configuration information to obtain the forwarding scheme of the current input message.

[0072] In some alternative implementation manners, if the forwarding scheme of the input message is not configured in the firmware configuration information, the preprocessing module parses the field segment content indicating whether the input message is a high-priority message from the message header; when the adaptive forwarding module determines that the input message is a non-high-priority message according to the field segment content, it selects to use the first forwarding scheme to forward the input message, and when the adaptive forwarding module determines that the input message is a high-priority message according to the field segment content, it selects to use the second forwarding scheme to forward the input message.

[0073] Exemplarily, the forwarding scheme of the input message may not be configured in the firmware configuration information either. In this case, the forwarding scheme of the current input message can be selected through a hardware adaptive manner. That is, the adaptive forwarding module can first determine whether the input message is a high-priority message according to the field segment content corresponding to one or more preset field segments in the message header. If it is a high-priority message, since high-priority messages require lower transmission latency, the second forwarding scheme is used, and if it is a non-high-priority message, the first forwarding scheme is used.

[0074] Exemplarily, high-priority packets include: management packets, response packets, specific sl (service level) / vl (virtual lane), custom packets, specific egress packets, etc. Whether a packet is a high-priority packet can be determined by the corresponding field content in the LRH (Local Route Header) or BTH (Base Transport Header) of the input packet. The corresponding fields that meet the high-priority packet criteria can be formed into configuration information in advance. After receiving the packet header, the corresponding field content in the packet header is matched with the pre-configured fields. If the match is successful, it indicates that the current input packet is a high-priority packet; if the match fails, it indicates that the current input packet is a non-high-priority packet.

[0075] In some alternative implementation manners, for the input packet that selects to use the first forwarding scheme, when the rate of the ingress port of the input packet is less than or equal to the rate of the switching fabric, the forwarding threshold is related to the reception time and the transmission time of the input packet; for the input packet that selects to use the second forwarding scheme, when the rate of the ingress port of the input packet is less than or equal to the rate of the egress port, the forwarding threshold is related to the reception time and the transmission time of the input packet; the reception time is determined based on the length of the input packet and the rate of the ingress port, and the transmission time is determined based on the length of the input packet and the rate of the switching fabric.

[0076] Exemplarily, as Figure 1 shown, when the first forwarding scheme is selected, the forwarding rate is the rate csb_rate of the switching fabric, while when the second forwarding scheme is selected, the forwarding rate is not the rate of the switching fabric but the rate of the egress port, which is usually smaller than the rate of the switching fabric. Whether it is the first forwarding scheme or the second forwarding scheme, when the ingress port is less than or equal to the forwarding rate, the forwarding threshold cut_level is calculated as follows: cut_level = rcv_time - send_time, where cut_level is the forwarding threshold, rcv_time is the reception time of the input packet, and send_time is the transmission time of the input packet, that is, the time when it is forwarded to the switching fabric. When the transmission delay Delay_cnt is greater than the forwarding threshold cut_level, or the received complete packet is greater than or equal to 1, that is, after receiving the packet tail pkt_end(n), a packet transmission request is initiated, that is, the input packet starts to be forwarded.

[0077] Exemplarily, the reception time rcv_time and the transmission time send_time are calculated as follows:

[0078] rcv_time = (pktlen * 32bit + port_width) / inport_rate;

[0079] send_time = (pktlen * 32bit + port_width) / export_rate;

[0080] Wherein, pktlen is the length of the input packet, port_width is the width of the ingress port, inport_rate is the rate of the ingress port; export_rate is the rate of the switching matrix. It should be noted that adding the width of the ingress port in the above formula is to avoid the situation where the calculated receive time or transmission time is less than one time unit and is truncated to 0.

[0081] In some alternative implementation manners, for the input packet that selects to use the first forwarding scheme, when the rate of the ingress port of the input packet is greater than the rate of the switching matrix, the forwarding threshold is 0; for the input packet that selects to use the second forwarding scheme, when the rate of the ingress port of the input packet is greater than the rate of the egress port, the forwarding threshold is 0.

[0082] Exemplarily, if the rate of the ingress port is greater than the forwarding rate, the forwarding threshold is 0. In this case, regardless of whether the first forwarding scheme or the second forwarding scheme is selected, after receiving the header of the input packet, the input packet is directly forwarded without delay. However, as described above, in the first forwarding scheme, the forwarding rate is the rate of the switching matrix, and in the second forwarding scheme, the forwarding rate is the rate of the egress port. The rate of the switching matrix is greater than the rate of the egress port and the rate of the ingress port in most cases. Therefore, in the first forwarding scheme, the forwarding threshold is not 0 in most cases. Thus, in the second forwarding scheme, the situation where the forwarding threshold is 0 is more than that in the first forwarding scheme.

[0083] See Figure 3 As shown, exemplarily, in the first forwarding scheme, the ingress port receives the input packet from time d - f, sdp is the header of the input packet, egp is the tail of the input packet, and dat1 - dat4 are the contents of the input packet. After a - b time, that is, after passing through the forwarding threshold cut_level, starting from receiving the packet header, the ingress port starts to forward the input packet to the switching matrix, and after the transmission time send_time_csb, the forwarding is completed. There is no disconnection during the process of forwarding the input packet to the switching matrix, that is, the switching matrix CSB transmits at full bandwidth. The switching matrix forwards this input packet to the egress port during time g - h, and after the transmission time send_time_out, the forwarding is completed.

[0084] Exemplarily, in the second forwarding scheme, the ingress port receives an input packet during the time period from d - f. sdp is the packet header of the input packet, egp is the packet tail of the input packet, and dat1 - dat4 are the contents of the input packet. If the rate of the ingress port is greater than the forwarding rate, then the forwarding threshold is 0, and thus there is no such situation as in the first forwarding scheme: the time period from a - b after receiving the packet header. Instead, the input packet is directly forwarded from the ingress port to the switching fabric and is forwarded completely after the transmission time send_time_csb. The adaptive module forwards the output packet to the switching fabric during the time period from b - c. The input packet can be forwarded to the egress port with a lower latency. The switching fabric forwards the input packet to the egress port during the time period from g - h and is forwarded completely after the transmission time send_time_out.

[0085] It can be seen from Figure 3 that compared with the first forwarding scheme, the transmission latency of the second forwarding scheme is reduced. In the first forwarding scheme, the switching fabric is at full bandwidth when the ingress port forwards to it, but there is a disconnection in the switching fabric in the second forwarding scheme.

[0086] In some optional implementation manners, when it is recognized that the input packet is an abnormal packet, if the packet header of the input packet has been forwarded to the switching fabric, the adaptive forwarding module supplements an end - bad - packet flag at the output end of the ingress port and discards the packet content of the input packet that has not been sent out; if the packet header of the input packet has not been forwarded to the switching fabric, the adaptive forwarding module discards the entire input packet.

[0087] Exemplarily, referring to Figure 4 as shown, to reduce the transmission of abnormal packets in the switching network, abnormal packet processing is added. After the ingress port recognizes that the packet is abnormal, if the packet header has been sent to the switching fabric, an ebp (end bad packet) is immediately supplemented at the output end of the ingress port, and the partial packet content in the packet receive buffer rbuf that has not been sent out is immediately discarded. If the packet header has not been sent to the switching fabric, the entire input packet is directly discarded to avoid forwarding the abnormal packet downstream.

[0088] The above is the forwarding device proposed in this application. This device can effectively reduce the packet forwarding delay and improve the packet forwarding efficiency. First of all, this solution can flexibly select the forwarding delay scheme according to the packet priority. For packets with higher priority, the delay is further reduced. For other packets, on the premise of ensuring that the bandwidth of the switching matrix is not wasted, the packet forwarding delay is reduced. The adaptive transmission delay can select the best transmission delay for different packet sizes and different port rates, and improve the transmission rate of small packets. The two forwarding schemes can be configured and can be hardware-adaptive. Select a suitable scheme according to the actual test results and select a suitable scheme for different packets. The abnormal packet processing scheme in the cut-through forwarding mode can reduce the abnormality

[0089] Correspondingly, referring to Figure 5 As shown, this application exemplarily provides a packet forwarding method, including:

[0090] In step S501, after receiving the packet header of the input packet, the preprocessing module determines the packet length of the input packet and the switching matrix to which the input packet is to be forwarded according to the packet header, and starts timing the transmission delay;

[0091] In step S502, the adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to the firmware configuration information or the packet header;

[0092] In step S503, for the input packet that selects to use the first forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input packet or when the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the size relationship between the rate of the switching matrix and the rate of the ingress port of the input packet;

[0093] In step S504, for the input packet that selects to use the second forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input packet or when the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the size relationship between the rate of the egress port of the input packet and the rate of the ingress port of the input packet.

[0094] In some alternative implementation manners, the preprocessing module determines the packet length of the input packet and the switching matrix to which the input packet is to be forwarded according to the packet header, including:

[0095] The preprocessing module determines the switching matrix to which the input packet is to be forwarded by looking up the routing table based on the destination device identifier parsed from the packet header.

[0096] In some alternative implementation manners, the adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to the firmware configuration information or the packet header, including:

[0097] If the firmware configuration information configures a forwarding scheme for the input message, the adaptive forwarding module determines the forwarding scheme for the input message according to the firmware configuration information.

[0098] In some alternative implementation manners, if the firmware configuration information configures a configuration relationship between the message type of the input message and the forwarding scheme, the method further includes:

[0099] The preprocessing module parses the message type of the input message from the message header of the input message;

[0100] The adaptive forwarding module adaptively selects the forwarding scheme for the input message according to the firmware configuration information or the message header, including:

[0101] The adaptive forwarding module determines the forwarding scheme for the input message according to the message type and the firmware configuration information.

[0102] In some alternative implementation manners, if the forwarding scheme for the input message is not configured in the firmware configuration information, the method further includes:

[0103] The preprocessing module parses the field segment content indicating whether the input message is a high-priority message from the message header;

[0104] The adaptive forwarding module adaptively selects the forwarding scheme for the input message according to the firmware configuration information or the message header, including:

[0105] When the adaptive forwarding module determines that the input message is a non-high-priority message according to the field segment content, the adaptive forwarding module selects to forward the input message using a first forwarding scheme;

[0106] When the adaptive forwarding module determines that the input message is a high-priority message according to the field segment content, the adaptive forwarding module selects to forward the input message using a second forwarding scheme.

[0107] In some alternative implementation manners, for the input message selected to use the first forwarding scheme, when the rate of the input port of the input message is less than or equal to the rate of the switching matrix, the forwarding threshold is related to the receiving time and the output time of the input message; for the input message selected to use the second forwarding scheme, when the rate of the input port of the input message is less than or equal to the rate of the output port, the forwarding threshold is related to the receiving time and the output time of the input message; the receiving time is determined based on the length of the input message and the rate of the input port, and the output time is determined based on the length of the input message and the rate of the switching matrix.

[0108] In some alternative implementations, for the input packet that selects to use the first forwarding scheme, when the rate of the ingress port of the input packet is greater than the rate of the switching fabric, the forwarding threshold is 0; for the input packet that selects to use the second forwarding scheme, when the rate of the ingress port of the input packet is greater than the rate of the egress port, the forwarding threshold is 0.

[0109] In some alternative implementations, the method further includes:

[0110] When it is identified that the input packet is an abnormal packet, if the packet header of the input packet has been forwarded to the switching fabric, the adaptive forwarding module supplements a bad packet end flag at the output end of the ingress port and discards the packet content of the input packet that has not been sent out;

[0111] If the packet header of the input packet has not been forwarded to the switching fabric, the adaptive forwarding module discards the entire input packet.

[0112] The above method can be implemented by the packet forwarding device provided in the above embodiments. The specific implementation manner can refer to the description of the packet forwarding device in the above embodiments, and will not be elaborated here.

[0113] It can be understood that the circuit structures, names, and parameters described in the above embodiments are only examples. Those skilled in the art can also easily combine and adjust the structural features of the above multiple embodiments according to the usage needs, and should not limit the concept of the present application to the specific details of the above examples.

[0114] Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A message forwarding device, characterized in that: include: Preprocessing module and adaptive forwarding module; The preprocessing module is used to determine the message length of the input message and the switching matrix to which the input message is to be forwarded according to the message header after receiving the message header of the input message, and start timing the transmission delay; The adaptive forwarding module adaptively selects a forwarding scheme for the input message according to firmware configuration information or the message header; For the input message that uses the first forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input message or the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the relationship between the rate of the switching matrix and the rate of the ingress port of the input message; For input messages that choose to use the second forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input message or the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the relationship between the rate of the egress port of the input message and the rate of the ingress port of the input message.

2. The message forwarding device according to claim 1, characterized in that: If the firmware configuration information is configured with a forwarding scheme for the input message, the adaptive forwarding module determines the forwarding scheme for the input message according to the firmware configuration information.

3. The message forwarding device according to claim 1, characterized in that: If the firmware configuration information is configured with a configuration relationship between the message type of the input message and the forwarding scheme, the preprocessing module parses the message header of the input message to obtain the message type of the input message, and the adaptive forwarding module determines the forwarding scheme of the input message based on the message type and the firmware configuration information.

4. The message forwarding device according to claim 1, characterized in that: If the forwarding scheme of the input message is not configured in the firmware configuration information, the pre-processing module parses the message header to obtain the domain content indicating whether the input message is a high priority message; When the adaptive forwarding module determines that the input message is a non-high priority message based on the domain segment content, it chooses to use the first forwarding scheme to forward the input message. When the adaptive forwarding module determines that the input message is a high priority message based on the domain segment content, it chooses to use the second forwarding scheme to forward the input message.

5. The message forwarding device according to claim 1, characterized in that: For the input message that uses the first forwarding solution, when the rate of the ingress port of the input message is less than or equal to the rate of the switching matrix, the forwarding threshold is related to the receiving time of the input message and the output time of the input message; For the input message that uses the second forwarding solution, when the rate of the ingress port of the input message is less than or equal to the rate of the egress port of the input message, the forwarding threshold is related to the reception time of the input message and the output time of the input message; The receiving time is determined based on the length of the input message and the rate of the ingress port of the input message, and the output time is determined based on the length of the input message and the rate of the switching matrix.

6. The message forwarding device according to claim 5, characterized in that: For the input message that chooses to use the first forwarding scheme, when the rate of the ingress port of the input message is greater than the rate of the switching matrix, the forwarding threshold is 0; for the input message that chooses to use the second forwarding scheme, when the rate of the ingress port of the input message is greater than the rate of the egress port, the forwarding threshold is 0.

7. The message forwarding device according to any one of claims 1 to 6, characterized in that: When the input message is identified as an abnormal message, if the message header of the input message has been forwarded to the switching matrix, the adaptive forwarding module adds a bad packet end marker at the output end of the ingress port and discards the message content of the input message that has not been sent out; if the message header of the input message has not been forwarded to the switching matrix, the adaptive forwarding module discards the entire input message.

8. A message forwarding method, characterized in that: include: After receiving the message header of the input message, the preprocessing module determines the message length of the input message and the switching matrix to which the input message is to be forwarded according to the message header, and starts timing the transmission delay; The adaptive forwarding module adaptively selects a forwarding scheme for the input message according to the firmware configuration information or the message header; For the input message that uses the first forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input message or the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the relationship between the rate of the switching matrix and the rate of the ingress port of the input message; For input messages that choose to use the second forwarding scheme, the adaptive forwarding module starts forwarding after receiving the complete input message or the transmission delay is greater than the forwarding threshold; the forwarding threshold is determined based on the relationship between the rate of the egress port of the input message and the rate of the ingress port of the input message.

9. The message forwarding method according to claim 8, characterized in that: The adaptive forwarding module adaptively selects a forwarding scheme for the input message according to the firmware configuration information or the message header, including: If the firmware configuration information is configured with a forwarding scheme for the input message, the adaptive forwarding module determines the forwarding scheme for the input message according to the firmware configuration information.

10. The message forwarding method according to claim 8, characterized in that: If the firmware configuration information is configured with a configuration relationship between a message type of an input message and a forwarding scheme, the method further includes: The preprocessing module parses the message header of the input message to obtain the message type of the input message; The adaptive forwarding module adaptively selects a forwarding scheme for the input message according to the firmware configuration information or the message header, including: The adaptive forwarding module determines a forwarding scheme for the input message according to the message type and the firmware configuration information.

11. The message forwarding method according to claim 8, characterized in that: If the forwarding scheme of the input message is not configured in the firmware configuration information, the method further includes: The pre-processing module parses the message header to obtain a field content indicating whether the input message is a high priority message; The adaptive forwarding module adaptively selects a forwarding scheme for the input message according to the firmware configuration information or the message header, including: When the adaptive forwarding module determines that the input message is a non-high priority message according to the domain segment content, it selects to use the first forwarding scheme to forward the input message; When the adaptive forwarding module determines that the input message is a high priority message according to the domain content, it selects to use the second forwarding solution to forward the input message.

12. The message forwarding method according to claim 8, characterized in that: For the input message that uses the first forwarding solution, when the rate of the ingress port of the input message is less than or equal to the rate of the switching matrix, the forwarding threshold is related to the receiving time of the input message and the output time of the input message; for the input message that uses the second forwarding solution, when the rate of the ingress port of the input message is less than or equal to the rate of the egress port, the forwarding threshold is related to the receiving time of the input message and the output time of the input message; The receiving time is determined based on the length of the input message and the rate of the ingress port, and the output time is determined based on the length of the input message and the rate of the switching matrix.

13. The message forwarding method according to claim 12, characterized in that: For the input message that chooses to use the first forwarding scheme, when the rate of the ingress port of the input message is greater than the rate of the switching matrix, the forwarding threshold is 0; for the input message that chooses to use the second forwarding scheme, when the rate of the ingress port of the input message is greater than the rate of the egress port, the forwarding threshold is 0.

14. The message forwarding method according to any one of claims 8 to 13, characterized in that: The method further comprises: When the input message is identified as an abnormal message, if the message header of the input message has been forwarded to the switching matrix, the adaptive forwarding module adds a bad packet end marker at the output end of the ingress port and discards the message content of the input message that has not been sent out; If the message header of the input message has not been forwarded to the switching matrix, the adaptive forwarding module discards the entire input message.

Citation Information

Patent Citations

  • Message storing and forwarding method, circuit and device

    CN105635000A

  • Message transmission method and device

    CN115529285A

  • Packet forwarding method supporting cache time delay setting and control device

    CN116566932A

  • Method and device for forwarding IB network direct routing management message

    CN117729166A

  • Methods and apparatus for alleviating congestion at a switch, such as a shallow buffered switch

    US20170289048A1