A packet forwarding device and method

By combining the preprocessing module and the adaptive forwarding module with the switching matrix and port rate to select an appropriate forwarding strategy, the problems of excessive latency and packet interruption in store-and-forward and cut-through forwarding in the switching chip are solved, achieving more efficient packet forwarding and network bandwidth utilization.

CN120090993BActive Publication Date: 2025-12-26WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing switching chips, store-and-forward and cut-through forwarding suffer from problems such as excessive latency and packet interruption, affecting network response time and data throughput.

Method used

A preprocessing module and an adaptive forwarding module are adopted. Based on the packet header information and firmware configuration, an appropriate forwarding scheme is selected. The forwarding threshold is determined by combining the switching matrix and port rate. Different forwarding strategies are adopted for priority packets and non-high priority packets, and an abnormal packet handling mechanism is added.

Benefits of technology

It effectively reduces packet forwarding latency, improves packet forwarding efficiency, ensures the bandwidth utilization of the switching matrix, has lower latency for priority packets, and reduces network bandwidth waste by handling abnormal packets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120090993B_ABST
    Figure CN120090993B_ABST
Patent Text Reader

Abstract

The application provides a packet forwarding device and method, the device comprising: a preprocessing module and an adaptive forwarding module; the preprocessing module is used for determining the packet length and the switching matrix according to the packet header after receiving the packet header of the input packet, and starting timing transmission delay; the adaptive forwarding module adaptively selects a forwarding scheme according to firmware configuration information or the packet header; 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 related to the length of the input packet, the rate of the switching matrix and the rate of the entry port of the input packet; 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 related to the length of the input packet, the rate of the exit port and the rate of the entry port of the input packet.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the chip technical field, and particularly relates to a message forwarding device and method. BACKGROUND

[0002] In a switching chip, the forwarding delay of a message is an important index for evaluating the performance of the switching chip, and directly affects the network response time and data throughput. In IB and PCIE protocols, a physical link is required to continuously complete the transmission of a message, and there is no interruption in the packet and no flow break. In order to achieve the above two purposes, the common schemes in the industry at present include store-and-forward and cut-through forwarding. SUMMARY

[0003] The present application aims to provide a message forwarding device and method, and aims to solve the problems of too large delay and message flow break in store-and-forward and cut-through forwarding.

[0004] According to a first aspect of the present application, a message forwarding device is provided, comprising a preprocessing module and an adaptive forwarding module.

[0005] The preprocessing module is configured to determine the message length of an input message and a switching matrix to which the input message is to be forwarded according to a message header of the input message after receiving the message header, and start timing a transmission delay.

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

[0007] For an input message selected to use a first forwarding scheme, the adaptive forwarding module starts forwarding after receiving a complete input message or the transmission delay is greater than a 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 message.

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

[0009] In an optional embodiment, if the firmware configuration information is configured with a forwarding scheme of an input message, the adaptive forwarding module determines the forwarding scheme of the input message according to the firmware configuration information.

[0010] In an optional implementation, if the firmware configuration information is configured with a configuration relationship between a message type of the input message and a forwarding scheme, the preprocessing module parses the message type of the input message from a 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 optional implementation, if the firmware configuration information is not configured with a forwarding scheme of an input message, the preprocessing module parses a domain 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 domain segment content, the adaptive forwarding module selects to use a 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 domain segment content, the adaptive forwarding module selects to use a second forwarding scheme to forward the input message.

[0012] In an optional implementation, for the input message selected to use the first forwarding scheme, when a rate of an ingress port of the input message is less than or equal to a rate of the switch matrix, the forwarding threshold is related to a receiving time of the input message and an output time of the input message; for the input message selected to use the second forwarding scheme, when the rate of the ingress port of the input message is less than or equal to a 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 a 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 switch matrix.

[0013] In an optional implementation, for the input message selected to use the first forwarding scheme, when the rate of the ingress port of the input message is greater than the rate of the switch matrix, the forwarding threshold is 0; for the input message selected 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.

[0014] In an optional implementation, when the input message is identified as an abnormal message, if a message header of the input message has been forwarded to the switch matrix, the adaptive forwarding module supplements an end-of-bad-packet identifier at an 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 switch matrix, the adaptive forwarding module discards the entire input message.

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

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

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

[0018] 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 size relationship between the rate of the switch matrix and the rate of the ingress port of the input packet;

[0019] 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 size relationship between the rate of the egress port of the input packet and the rate of the ingress port of the input packet.

[0020] In an optional embodiment, the adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to the firmware configuration information or the packet header, comprising:

[0021] If the firmware configuration information is configured with 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.

[0022] In an optional embodiment, if the firmware configuration information is configured with the configuration relationship between the packet type of the input packet and the forwarding scheme, the method further comprises:

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

[0024] The adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to the firmware configuration information or the packet header, comprising:

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

[0026] In an optional embodiment, if the firmware configuration information is not configured with the forwarding scheme of the input packet, the method further comprises:

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

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

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

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

[0031] In an optional implementation, for the input packet selected 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 switch matrix, the forwarding threshold is related to the receiving time of the input packet and the output time of the input packet; for the input packet selected 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 receiving time of the input packet and the output time of the input packet; the receiving time is determined based on the length of the input packet and the rate of the ingress port, and the output time is determined based on the length of the input packet and the rate of the switch matrix.

[0032] In an optional implementation, for the input packet selected to use the first forwarding scheme, when the rate of the ingress port of the input packet is greater than the rate of the switch matrix, the forwarding threshold is 0; for the input packet selected 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.

[0033] In an optional implementation, the method further comprises:

[0034] When the input packet is identified as an abnormal packet, if the packet header of the input packet has been forwarded to the switch matrix, the adaptive forwarding module supplements an end-of-bad packet identifier at an output end of the ingress 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 switch matrix, the adaptive forwarding module discards the entire input packet.

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

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

[0038] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. The objects and other advantages of the present application can be realized and obtained by the structure and process indicated in the specification and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiment or related art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creating any creative labor.

[0040] Figure 1 is a structure schematic diagram of a message forwarding device according to an exemplary embodiment of the present application.

[0041] Figure 2 is a flowchart of a message forwarding timing determination process according to an exemplary embodiment of the present application.

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

[0043] Figure 4 is an abnormal message processing effect schematic diagram according to an exemplary embodiment of the present application.

[0044] Figure 5 is a flowchart of a message forwarding method according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of the present application.

[0046] Store-and-forward is to wait for all the messages to be received, store the completed packet into the on-chip cache, and then perform message checking and retransmit the message. Cut-through forwarding is to retransmit the message immediately after receiving the message, that is, without waiting for the entire message to be received, the message is directly retransmitted.

[0047] If store-and-forward is used, the switch chip first receives the complete message and stores it in a cache, and then performs message checking. If the checking is passed, the message is retransmitted to the target port, and if the checking is not passed, that is, an exception is found, the message is discarded. Therefore, the retransmission delay in this mode is large. Since store-and-forward receives the complete message before processing the message, the message retransmitted by the switch chip is definitely passed through all checks and has no abnormal message. Generally, store-and-forward is suitable for scenarios with high requirements for data accuracy.

[0048] If cut-through forwarding is used, the message is retransmitted to the target port after receiving the message header and some important information, without waiting for the complete message to be received, thereby reducing the retransmission delay of the message. However, since the complete message is not received, the message checking is not sufficient, and an error message may be retransmitted. This results in the transmission of an error message in the switch chip, and a mechanism for processing the error message needs to be set in the switch chip. Cut-through forwarding is generally applied to application scenarios with high requirements for delay.

[0049] In some related technologies, to improve the network transmission quality of the switch chip, when the delay requirement is not high, all messages are waited to be received, stored in a cache, and checked before being retransmitted. However, the switch chip supports multiple rates for each physical port. Taking an IB switch chip as an example, the link width has x8, x4, x2, and x1, and the link rate has 100G, 50G, 25G, etc. Therefore, at different rates, the time for receiving the entire message is quite different. At the lowest rate, for example, the link width is x1 and the link rate is 2.5G, the time for receiving a complete maximum message is about 1320ns, which greatly affects the retransmission delay of the message.

[0050] In some related technologies, in order to reduce the network transmission delay of the switching chip, pass-through forwarding is directly used, and after receiving some important information such as the message header, the data is directly forwarded to the target port. However, this method will waste the bandwidth utilization rate of the switching matrix crossbar, and when an abnormal message is output, it will not only affect the current switching chip, but also due to the transmission of the abnormal message, it may affect the bandwidth utilization rate of the entire network.

[0051] In order to solve the problems of too large delay and message flow interruption existing in the store-and-forward and pass-through forwarding, the two are combined. First, a forwarding delay is set for the message, and the message is forwarded after a delay. Second, in order to improve the bandwidth utilization rate of the switching matrix crossbar, the switching matrix is used as the output port, which not only avoids the problem of multiple rates of the output port, but also ensures the bandwidth utilization rate of the switching matrix crossbar.

[0052] In addition, for high-priority packets, the application also provides a mechanism for further reducing the forwarding delay. In order to ensure the continuous flow of the output port, a forwarding delay is set, and the hardware layer can calculate an optimal forwarding delay cut_level according to the rate of the output port, the rate of the input port, and the packet length. After the optimal forwarding delay cut_level is met, the message is forwarded. Whether the packet is a high-priority packet can be configured by the user through software, and the hardware layer determines whether the current packet is a high-priority packet by analyzing the corresponding field in the header field of the data packet.

[0053] In order to reduce the possibility of abnormal packets being transmitted in the switching chip caused by efficient pass-through forwarding, the application also adds an exception handling mechanism, that is, when an exception is found at the receiving port, the abnormal message is immediately truncated to avoid the transmission of abnormal messages in the switching network, thereby improving the bandwidth utilization rate of the switching network.

[0054] Based on the above analysis, referring to Figure 1 The application exemplarily provides a message forwarding device, which comprises a preprocessing module and an adaptive forwarding module.

[0055] 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.

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

[0057] 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 size relationship between the rate of the switch matrix and the rate of the ingress port of the input packet.

[0058] 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 size 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 arranged at the ingress port of the input packet of the switch chip. The pre-processing module can pre-acquire the rate of each physical port of the switch chip and the rate of the switch matrix, facilitating subsequent calculation of the transmission delay, which is the time between receiving the packet header of the input packet and starting forwarding the packet header to the switch matrix.

[0060] Exemplarily, after the ingress port receives the packet header of the input packet, the packet header can be parsed, and the pre-processing module can acquire the length and other related information of the input packet from the packet header. The packet header can record the length pktlen of the input packet, the packet type, the device ID of the packet destination, etc. The pre-processing module can obtain the routing information corresponding to the destination device ID by querying the routing table Routing_info, and then acquire the egress port to which the input packet is to be forwarded, so as to determine the rate of the egress port of the input packet according to the pre-acquired rate of the physical port of the switch chip (Export: rate). After receiving the packet header, the pre-processing module can also start timing to monitor the transmission delay.

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

[0062] In the first forwarding scheme, the low occupation of the switch matrix crossbar can be guaranteed, and the actual rate of the switch matrix is equal to the design rate of the switch matrix, which is the rate of the switch matrix obtained by the pre-processing module in advance, wherein the rate of the switch matrix is related to the application scenario. Under the first forwarding scheme, the transmission delay of the switch matrix is small, the bandwidth occupation rate is low, and the bandwidth of the switch matrix can be guaranteed without waste.

[0063] In the second forwarding scheme, the minimum transmission delay can be guaranteed, the packet in the egress port is guaranteed to be uninterrupted, and the transmission delay is smaller, but the packet transmission in the switch matrix exists discontinuity.

[0064] Based on this, after the first forwarding scheme is selected, and the transmission delay after the packet header of the input packet is received 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 switch matrix, so that the transmission of the packet in the switch matrix is uninterrupted, and the bandwidth occupancy rate is low. In the first forwarding scheme, the forwarding threshold is determined based on the rate of the switch matrix and the rate of the ingress port of the input packet. For example, when the rate of the switch matrix is greater than or equal to the rate of the ingress port, a forwarding threshold can be determined, and when the rate of the switch matrix is less than the rate of the ingress port, another forwarding threshold can be determined. The forwarding threshold of the former is greater than that of the latter, so that the data at the egress is uninterrupted.

[0065] After the second forwarding scheme is selected, when the transmission delay after the packet header of the input packet is received 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 egress port, so that the forwarding delay of the input packet is minimized, and the input packet in the egress port is uninterrupted after being forwarded from the switch matrix to the egress port. The transmission delay of the input packet from the egress 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 egress port of the input packet and the rate of the ingress port of the input packet. For example, when the rate of the egress port is greater than or equal to the rate of the ingress port, a forwarding threshold can be determined, and when the rate of the egress port is less than the rate of the ingress port, another forwarding threshold can be determined. The forwarding threshold of the former is greater than that of the latter, so that the data at the egress is uninterrupted.

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

[0067] For example, the destination device identifier of the input packet can be parsed from the packet header of the input packet, and the switch chip internally stores a packet forwarding routing table. By querying the forwarding routing table, the egress port of the destination device corresponding to the destination device identifier can be determined, so that the rate of the egress port can be determined.

[0068] In some optional implementations, if the firmware configuration information configures a 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, the firmware configuration information can be pre-configured to configure all input packets to use the first forwarding scheme or the second forwarding scheme. The adaptive forwarding module determines whether the currently received input packet uses the first forwarding scheme or the second forwarding scheme based on the configuration in the firmware configuration information.

[0070] In some optional implementations, if the firmware configuration information is configured with a configuration relationship between the packet type of an input packet and the forwarding scheme, the preprocessing module parses the packet type of the input packet from the packet header of the input packet, and the adaptive forwarding module determines the forwarding scheme of the input packet according to the packet type and the firmware configuration information.

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

[0072] In some optional implementations, if the firmware configuration information is not configured with the forwarding scheme of an input packet, the preprocessing module parses the domain segment content indicating whether the input packet is a high-priority packet from the packet header; the adaptive forwarding module selects to use the first forwarding scheme to forward the input packet when it is determined that the input packet is a non-high-priority packet according to the domain segment content, and selects to use the second forwarding scheme to forward the input packet when it is determined that the input packet is a high-priority packet according to the domain segment content.

[0073] Exemplarily, the firmware configuration information can also not be configured with the forwarding scheme of an input packet, in which case the forwarding scheme of the currently received input packet can be selected by a hardware adaptive manner. That is, the adaptive forwarding module can first determine whether the input packet is a high-priority packet according to the domain segment content corresponding to one or more pre-set domain segments in the packet header, and if it is a high-priority packet, the second forwarding scheme is used because high-priority packets require lower transmission delay, and if it is a non-high-priority packet, the first forwarding scheme is used.

[0074] Exemplarily, the high-priority packet includes a management packet, a response packet, a specific sl (service level) / vl (virtual lane), a self-defined packet, a specific egress packet, etc. Whether it is a high-priority packet can be determined by a corresponding domain segment content in a LRH (Local Route Header) or a BTH (Base Transport Header) of an input packet. The corresponding domain segment content of the high-priority packet can be formed into configuration information in advance. After receiving the packet header, the corresponding domain segment content in the packet header is matched with the pre-configured domain segment. If the matching is successful, it is indicated that the current input packet is a high-priority packet. If the matching fails, it is indicated that the current input packet is a non-high-priority packet.

[0075] In some optional implementations, for the input packet selected 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 matrix, the forwarding threshold is related to the receiving time of the input packet and the output time of the input packet; for the input packet selected 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 receiving time of the input packet and the output time of the input packet; the receiving time is determined based on the length of the input packet and the rate of the ingress port, and the output time is determined based on the length of the input packet and the rate of the switching matrix.

[0076] Exemplarily, as shown in Figure 1 When the first forwarding scheme is selected, the forwarding rate is the rate csb_rate of the switching matrix, and when the second forwarding scheme is selected, the forwarding rate is not the rate of the switching matrix, but the rate of the egress port, which is usually smaller than the rate of the switching matrix. Regardless of 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 receiving time of the input packet, and send_time is the transmission time of the input packet, that is, the forwarding time to the switching matrix. 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 end pkt_end(n), the packet transmission request is initiated, that is, the input packet starts to be forwarded.

[0077] Exemplarily, the receiving 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 switch matrix. It should be noted that the width of the ingress port is added in the above formula, and the purpose is to avoid the situation that the calculated receiving time or transmission time is less than one time unit and is taken as 0.

[0081] In some optional implementations, for the input packet selected to use the first forwarding scheme, when the rate of the ingress port of the input packet is greater than the rate of the switch matrix, the forwarding threshold is 0; for the input packet selected 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 rate of the forwarding, the forwarding threshold is 0, in which case, after receiving the packet header of the input packet, the input packet is directly forwarded without delay, regardless of whether the first forwarding scheme or the second forwarding scheme is selected. However, as described above, under the first forwarding scheme, the rate of the forwarding is the rate of the switch matrix, and under the second forwarding scheme, the rate of the forwarding is the rate of the egress port. The rate of the switch matrix is mostly greater than the rate of the egress port and the rate of the ingress port, so the forwarding threshold is not 0 in most cases under the first forwarding scheme, and therefore the forwarding threshold is 0 in more cases under the second forwarding scheme than under the first forwarding scheme.

[0083] Referring to Figure 3 Exemplarily, in the first forwarding scheme, the ingress port receives the input packet from d-f, sdp is the packet header of the input packet, egp is the packet tail of the input packet, dat1-dat4 is the content of the input packet, after receiving the packet header, the ingress port starts to forward the input packet to the switch matrix after a-b, i.e., after the forwarding threshold cut_level, and the forwarding is completed after the transmission time send_time_csb, and there is no flow interruption in the process of forwarding the input packet to the switch matrix, i.e., the switch matrix CSB transmits full bandwidth. The switch matrix forwards the input packet to the egress port from g-h, and the forwarding is completed after the transmission time send_time_out.

[0084] Exemplarily, in the second forwarding scheme, the input packet is received by the ingress port from d-f, sdp is the packet header of the input packet, egp is the packet tail of the input packet, and dat1-dat4 is the content of the input packet. If the rate of the ingress port is greater than the forwarding rate, the forwarding threshold is 0, and thus there is no a-b in the first forwarding scheme. Instead, the input packet is directly forwarded from the ingress port to the switch matrix, and the forwarding is completed after the transmission time send_time_csb. The adaptive module forwards the output packet to the switch matrix from b-c. The input packet can be forwarded to the egress port at a lower delay. The switch matrix forwards the input packet to the egress port from g-h, and the forwarding is completed after the transmission time send_time_out.

[0085] From Figure 3 It can be seen that, compared with the first forwarding scheme, the transmission delay of the second forwarding scheme is reduced, and the switch matrix is full bandwidth when the ingress port forwards to the switch matrix in the first forwarding scheme, but the switch matrix is interrupted in the second forwarding scheme.

[0086] In some optional implementations, 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 switch matrix, the adaptive forwarding module supplements an end bad packet (ebp) 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 switch matrix, the adaptive forwarding module discards the entire input packet.

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

[0088] The above is the forwarding device proposed in the application, which can effectively reduce the message forwarding delay and improve the packet forwarding efficiency. First, the scheme can flexibly select the forwarding delay scheme according to the message priority. For the message with high priority, the delay is further reduced, and for other messages, the message forwarding delay is reduced on the premise of ensuring that the bandwidth of the switching matrix is not wasted. The adaptive transmission delay can select the optimal transmission delay for different sizes of messages and different port rates, and improve the small packet transmission rate. The two forwarding schemes can be configured, and the appropriate scheme can be selected according to the actual test effect, and the appropriate scheme can be selected for different messages. The abnormal message processing scheme in the pass-through forwarding mode can reduce the abnormal

[0089] Correspondingly, referring to Figure 5 The application exemplarily provides a message forwarding method, which comprises the following steps:

[0090] In step S501, 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;

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

[0092] In step S503, for the input message selected to use 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 size relationship between the rate of the switching matrix and the rate of the ingress port of the input message;

[0093] In step S504, for the input message selected 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 size relationship between the rate of the egress port of the input message and the rate of the ingress port of the input message.

[0094] In some optional implementation manners, 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, which comprises:

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

[0096] In some optional implementation manners, the adaptive forwarding module adaptively selects the forwarding scheme of the input message according to the firmware configuration information or the message header, which comprises:

[0097] If the firmware configuration information is configured with 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.

[0098] In some optional implementation manners, if the firmware configuration information is configured with the configuration relationship between the packet type and the forwarding scheme of the input packet, the method further comprises:

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

[0100] The adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to the firmware configuration information or the packet header, comprising:

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

[0102] In some optional implementation manners, if the firmware configuration information is not configured with the forwarding scheme of the input packet, the method further comprises:

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

[0104] The adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to the firmware configuration information or the packet header, comprising:

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

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

[0107] In some optional implementation manners, for the input packet selected 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 matrix, the forwarding threshold is related to the receiving time of the input packet and the output time of the input packet; for the input packet selected 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 receiving time of the input packet and the output time of the input packet; the receiving time is determined based on the length of the input packet and the rate of the ingress port, and the output time is determined based on the length of the input packet and the rate of the switching matrix.

[0108] In some optional implementations, for the input packet selected to use the first forwarding scheme, when the rate of the ingress port of the input packet is greater than the rate of the switch matrix, the forwarding threshold is 0; for the input packet selected 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 optional implementations, the method further comprises:

[0110] When the input packet is identified as an abnormal packet, if the packet header of the input packet has been forwarded to the switch matrix, the adaptive forwarding module supplements an end-of-bad-packet identifier 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 switch matrix, 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, and the specific implementation can refer to the description of the packet forwarding device in the above embodiments, which will not be repeated here.

[0113] It can be understood that the circuit structure, name and parameter 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 use needs, and the concept of the present application should not be limited 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 skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A packet forwarding device, characterized by, The packet forwarding device comprises a preprocessing module and an adaptive forwarding module. The preprocessing module is configured to determine the length of the input packet and the switch matrix to which the input packet is to be forwarded according to the packet header of the input packet after receiving the packet header, and start timing the transmission delay. The adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to the firmware configuration information or the packet header. 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, which is determined based on the size relationship between the rate of the switch matrix and the rate of the ingress port of the input packet. 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, which 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. If the firmware configuration information is configured with 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. If the forwarding scheme of the input packet is not configured in the firmware configuration information, the preprocessing module parses the domain segment content from the packet header to indicate whether the input packet is a high-priority packet. When the adaptive forwarding module determines that the input packet is a non-high-priority packet according to the domain segment content, it selects to use the first forwarding scheme to forward the input packet, and when it determines that the input packet is a high-priority packet according to the domain segment content, it selects to use the second forwarding scheme to forward the input packet. If the firmware configuration information is configured with the configuration relationship between the packet type and the forwarding scheme of the input packet, the preprocessing module parses the packet type of the input packet from the packet header of the input packet, and the adaptive forwarding module determines the forwarding scheme of the input packet according to the packet type and the firmware configuration information.

2. The packet forwarding device of claim 1, wherein, 3. The packet forwarding device according to claim 1, wherein For the input packet selected 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 switch matrix, the forwarding threshold is related to the receiving time of the input packet and the output time of the input packet. For the input packet selected 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 of the input packet, the forwarding threshold is related to the receiving time of the input packet and the output time of the input packet. The receiving time is determined based on the length of the input packet and the rate of the ingress port of the input packet, and the output time is determined based on the length of the input packet and the rate of the switch matrix. ​ 4. The packet forwarding device of claim 3, wherein, For the input packet selected to use the first forwarding scheme, the forwarding threshold is 0 when the rate of the ingress port of the input packet is greater than the rate of the switch matrix; for the input packet selected to use the second forwarding scheme, the forwarding threshold is 0 when the rate of the ingress port of the input packet is greater than the rate of the egress port.

5. The packet forwarding device according to any of claims 1-4, characterized by When the input packet is identified as an abnormal packet, if the packet header of the input packet has been forwarded to the switch matrix, the adaptive forwarding module supplements an end-of-bad-packet identifier 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 switch matrix, the adaptive forwarding module discards the entire input packet.

6. A message forwarding method characterized by, Comprising: After receiving the packet header of the input packet, the preprocessing module determines the packet length of the input packet and the switch matrix to which the input packet is to be forwarded according to the packet header, and starts timing the transmission delay; The adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to firmware configuration information or the packet header; 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 size relationship between the rate of the switch matrix and the rate of the ingress port of the input packet; 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 size relationship between the rate of the egress port of the input packet and the rate of the ingress port of the input packet; The adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to firmware configuration information or the packet header, comprising: If the firmware configuration information is configured with 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; If the firmware configuration information is not configured with the forwarding scheme of the input packet, the method further comprises: The preprocessing module parses the domain segment content from the packet header to indicate whether the input packet is a high-priority packet; The adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to firmware configuration information or the packet header, comprising: When the adaptive forwarding module determines that the input packet is a non-high-priority packet according to the domain segment content, the adaptive forwarding module selects to use the first forwarding scheme to forward the input packet; When the adaptive forwarding module determines that the input packet is a high-priority packet according to the domain segment content, the adaptive forwarding module selects to use the second forwarding scheme to forward the input packet.

7. The packet forwarding method of claim 6, wherein, If the firmware configuration information is configured with the configuration relationship between the packet type of the input packet and the forwarding scheme, the method further comprises; The preprocessing module parses the packet type of the input packet from the packet header of the input packet; The adaptive forwarding module adaptively selects the forwarding scheme of the input packet according to firmware configuration information or the packet header, comprising: The adaptive forwarding module determines a forwarding scheme of the input packet according to the packet type and the firmware configuration information.

8. The packet forwarding method of claim 6, wherein, For the input packet selected 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 switch matrix, the forwarding threshold is related to the receiving time of the input packet and the output time of the input packet; for the input packet selected 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 receiving time of the input packet and the output time of the input packet; The receiving time is determined based on the length of the input packet and the rate of the ingress port, and the output time is determined based on the length of the input packet and the rate of the switch matrix.

9. The packet forwarding method of claim 8, wherein, For the input packet selected to use the first forwarding scheme, when the rate of the ingress port of the input packet is greater than the rate of the switch matrix, the forwarding threshold is 0; for the input packet selected 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.

10. The message forwarding method according to any of claims 6-9, characterized by, The method further comprises: When the input packet is identified as an abnormal packet, if the packet header of the input packet has been forwarded to the switch matrix, the adaptive forwarding module supplements an end-of-bad-packet identifier 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 switch matrix, the adaptive forwarding module discards the entire input packet.

Citation Information

Patent Citations

  • Message transmission method and device

    CN115529285A

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

    CN116566932A