Implementation method and device for triggering ECN mark based on dynamic threshold value, and network equipment

By dynamically calculating and adjusting the ECN marking threshold, the cache resource utilization and packet loss problems of the switch when processing network traffic are solved, achieving more efficient network performance and stability.

CN119232689APending Publication Date: 2024-12-31SUZHOU CENTEC COMM CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411330260.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the prior art, when the switch handles network traffic, the ECN marking timing is improperly caused by the static threshold configuration, which may lead to low cache resource utilization or cache overflow and packet loss, and cannot effectively deal with traffic changes in complex network environments.

Method used

The ECN tagging method based on dynamic threshold is adopted, and the number of cache queues in a congested state and the actual cache resource usage is calculated, and the tag threshold is dynamically adjusted to determine whether to ECN tag the packets, improve cache utilization and reduce the probability of packet loss.

Benefits of technology

It improves chip cache utilization, reduces the probability of packet loss due to untimely ECN marking, adapts to traffic changes in complex network environments, and improves network performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232689A_ABST
    Figure CN119232689A_ABST
Patent Text Reader

Abstract

The invention provides an implementation method and device for triggering an ECN mark based on a dynamic threshold value and network equipment, and the method comprises the steps: obtaining the number of cache queues in a congestion state at present when a switch forwards a message in a target cache queue included in a plurality of cache queues; and calculating a cache threshold based on the number of the cache queues in the congestion state. And calculating a current mark threshold value based on the cache threshold value, obtaining a current actual cache resource occupation condition of the target cache queue, and judging whether to carry out display congestion notification (ECN) marking on the current to-be-sent message based on the occupation condition and the mark threshold value. According to the scheme, the marking threshold value can change along with the dynamic cache threshold value, and the cache threshold value changes based on the current congestion condition, so that the marking threshold value can adapt to the actual cache resource occupation condition, and the probability of packet loss caused by untimely ECN marking is reduced while the chip cache utilization rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method, a device and a network device for realizing ECN marking based on dynamic threshold triggering. Background Art

[0002] In a network with a large amount of data exchange, network traffic is ever-changing. When the traffic increases to exceed the export sending capacity, the message needs to be cached in the forwarding device (such as a switch) and queued for sending. In the case of large traffic, the message to be forwarded may be discarded because the switch cache is full. If some important messages, such as high-priority messages, are discarded, it will affect network performance and stability.

[0003] ECN (Explicit Congestion Notification) is a technology for active congestion control during the exchange of Internet data packets. The switch can mark the message with ECN to notify the receiving end of the current congestion, and then notify the sending end to reduce the message sending rate. The timing of ECN marking has a direct impact on network performance. Marking ECN too early will result in low cache utilization and failure to absorb burst traffic. Marking ECN too late will cause the risk of switch cache overflow and packet loss during the time from the switch marking ECN to the sender's response. The switch's detection of congestion will directly affect the timing of ECN marking. Therefore, the switch's congestion detection method has become a key technology of ECN.

[0004] There are several queues in the switch port. In the prior art, two buffer thresholds THRD1 and THRD2 are set based on the queues. When congestion occurs, the queue buffer occupancy continues to increase. When it exceeds THRD1, the message begins to be marked with ECN. When congestion is relieved, the buffer occupancy decreases. When it is lower than THRD2, the message is no longer marked with ECN.

[0005] Multiple queues in a switch share cache resources. When a large number of queues are congested, each queue can occupy less cache resources. At this time, if the cache threshold is configured to be large, the CEN mark will be triggered only when the cache resources occupied by the queue exceed the cache threshold. Therefore, the cache resources occupied by all queues may not exceed the set cache threshold, so the ECN mark behavior will not be triggered. However, at this time, the overall cache resources of the switch may be exhausted, which may cause packet loss. Therefore, in this scenario, the cache threshold needs to be configured to be small. When a small number of queues are congested, each queue can occupy more cache resources. At this time, if the cache threshold is configured to be small, the ECN mark behavior will be triggered when the queue congestion is very light, resulting in frequent ECN marking, and then the network forwarding efficiency is low. In addition, the cache occupancy is very low at this time, and the cache resources cannot be fully utilized. Therefore, in this case, the cache threshold needs to be configured to be large.

[0006] Traffic conditions in actual networks change frequently, and the congestion conditions of each queue are different at each moment. It can be seen that the static threshold configuration method used in the prior art has poor adaptability to complex network environments. Summary of the invention

[0007] The purpose of the present invention includes, for example, providing a method, apparatus and network device for implementing ECN marking based on dynamic threshold triggering, which can improve chip cache utilization while reducing the probability of packet loss due to untimely ECN marking.

[0008] The embodiments of the present invention can be implemented as follows:

[0009] In a first aspect, the present invention provides a method for implementing ECN marking based on dynamic threshold triggering, which is applied to a switch, wherein the switch is respectively connected to a sending end and a receiving end for communication, and the switch includes multiple cache queues, and the multiple cache queues share cache resources, and the method includes:

[0010] When forwarding a message in a target cache queue included in the multiple cache queues, obtaining the number of cache queues currently in a congested state, and calculating a cache threshold based on the number of cache queues in the congested state;

[0011] Calculate the current marking threshold based on the cache threshold;

[0012] The actual current cache resource occupancy of the target cache queue is obtained, and based on the occupancy and the marking threshold, it is determined whether to perform an explicit congestion notification (ECN) marking on the message currently to be forwarded in the target cache queue.

[0013] In an optional implementation manner, the step of calculating the cache threshold based on the number of cache queues in a congested state includes:

[0014] Determining a target cache coefficient from a plurality of preset cache coefficients based on the number of cache queues in a congested state;

[0015] The cache threshold is calculated according to the number of cache queues in a congested state and the target cache coefficient.

[0016] In an optional implementation, the step of calculating the current marking threshold based on the cache threshold includes:

[0017] Obtaining a set offset and lower limit value, wherein the offset is an offset of the marking threshold relative to the cache threshold, and the lower limit value is a lower limit of the marking threshold;

[0018] Determine the proportion of currently occupied cache resources based on the relationship between the cache threshold, the offset and the lower limit;

[0019] Based on the proportion of the occupied cache resources, a marking threshold is calculated using a corresponding calculation strategy.

[0020] In an optional implementation, the step of determining the proportion of currently occupied cache resources based on the size relationship between the cache threshold, the offset, and the lower limit value includes:

[0021] When the difference between the cache threshold and the offset is greater than the lower limit, determining that the proportion of currently occupied cache resources is within a first range;

[0022] When the difference between the cache threshold and the offset is less than the lower limit, and the cache threshold is greater than the lower limit, determining that the proportion of currently occupied cache resources is within a second range;

[0023] When the cache threshold is less than the lower limit, determining that the proportion of currently occupied cache resources is within a third range;

[0024] Among them, the first range, the second range and the third range gradually increase in sequence.

[0025] In an optional implementation, the step of calculating the marking threshold using a corresponding calculation strategy based on the proportion of the occupied cache resources includes:

[0026] When the proportion of the occupied cache resources is within a first range, subtracting the offset from the cache threshold to obtain a marking threshold;

[0027] When the proportion of the occupied cache resources is within the second range, setting the marking threshold equal to the lower limit;

[0028] When the proportion of the occupied cache resources is within a third range, the marking threshold is set equal to the cache threshold.

[0029] In an optional implementation manner, the step of determining whether to perform an explicit congestion notification (ECN) marking on the message currently to be forwarded in the target cache queue based on the occupancy status and the marking threshold comprises:

[0030] If the occupancy status indicates that the amount of cache resources occupied by the messages in the target cache queue is less than the marking threshold, it is determined that there is no need to perform ECN marking on the message to be forwarded currently;

[0031] If the occupancy status indicates that the amount of cache resources occupied by the messages in the target cache queue is greater than or equal to the marking threshold, it is determined to perform ECN marking on the message currently to be forwarded.

[0032] In an optional embodiment, the method further comprises:

[0033] After receiving a message each time, obtaining the message level of the message;

[0034] Determining a queue level of each of the plurality of cache queues;

[0035] The message is stored in a cache queue of a queue level corresponding to its message level.

[0036] In an optional embodiment, the method further comprises:

[0037] In the case where it is determined that the message to be forwarded is to be ECN marked, a marking bit is added to the header of the message, and the flag bit is set to indicate the presence of congestion;

[0038] The set message is sent to the receiving end, so that the receiving end parses the flag bit in the message and then sends a congestion notification message CNP to the sending end to notify the sending end to reduce the message sending rate.

[0039] In a second aspect, the present invention provides an implementation device for triggering ECN marking based on a dynamic threshold, which is applied to a switch, wherein the switch is respectively connected to a sending end and a receiving end for communication, and the switch includes a plurality of cache queues, and the plurality of cache queues share cache resources, and the device includes:

[0040] a calculation module, configured to obtain the number of cache queues currently in a congested state when forwarding messages in a target cache queue included in the multiple cache queues, and calculate a cache threshold based on the number of cache queues in a congested state;

[0041] The calculation module is further used to calculate a current marking threshold based on the cache threshold;

[0042] The judgment module is used to obtain the actual current cache resource occupancy of the target cache queue, and judge whether to perform an explicit congestion notification ECN marking on the message currently to be forwarded in the target cache queue based on the occupancy and the marking threshold.

[0043] In a third aspect, the present invention provides a network device, comprising at least one processor and a memory for communicating with the at least one processor, the memory storing instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the method steps described in any one of the aforementioned embodiments.

[0044] The beneficial effects of the embodiments of the present invention include, for example:

[0045] The present invention provides an implementation method, device and network equipment for triggering ECN marking based on dynamic thresholds. When a switch forwards a message in a target cache queue included in multiple cache queues, the number of cache queues currently in a congested state is obtained, and a cache threshold is calculated based on the number of cache queues in a congested state. Then, the current marking threshold is calculated based on the cache threshold, and the actual current cache resource occupancy of the target cache queue is obtained. Based on the occupancy and the marking threshold, it is determined whether to perform a display congestion notification ECN marking on the message currently to be sent. In this solution, the marking threshold can follow the dynamic cache threshold changes, and the cache threshold changes based on the current congestion situation, so that the marking threshold can adapt to the actual cache resource occupancy, while improving the chip cache utilization rate and reducing the probability of packet loss due to untimely ECN marking. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0047] Figure 1 A schematic diagram of an application scenario of a method for implementing an ECN marking triggered based on a dynamic threshold provided in an embodiment of the present invention;

[0048] Figure 2 A flowchart of a method for implementing ECN marking based on dynamic threshold triggering provided by an embodiment of the present invention;

[0049] Figure 3 A flow chart of a message receiving method in the implementation method of triggering ECN marking based on dynamic threshold provided in an embodiment of the present invention;

[0050] Figure 4 for Figure 2 A flowchart of the sub-steps included in S11;

[0051] Figure 5 A schematic diagram of the relationship between a cache threshold and the number of cache queues in a congested state in an embodiment of the present invention;

[0052] Figure 6 for Figure 2 A flowchart of the sub-steps included in S12;

[0053] Figure 7 for Figure 6 A flowchart of the sub-steps included in S122;

[0054] Figure 8 for Figure 6 A flowchart of the sub-steps included in S123;

[0055] Fig. 9 A schematic diagram of changes in the cache threshold, the flag threshold, and the actual cache resource occupancy at each moment in an embodiment of the present invention;

[0056] Fig.10 A flowchart of a message sending method in a method for implementing ECN marking triggered based on a dynamic threshold provided in an embodiment of the present invention;

[0057] Fig.11 A functional module block diagram of a device for implementing ECN marking based on dynamic threshold triggering provided by an embodiment of the present invention;

[0058] Fig.12 A structural block diagram of a network device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0060] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0062] In the description of the present invention, it should be noted that the terms "first", "second", "third", etc., if used, are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0063] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.

[0064] See also Figure 1 , is a schematic diagram of an application scenario of an implementation method of an ECN marking based on dynamic threshold triggering provided by an embodiment of the present invention, wherein the application scenario includes a switch, a transmitter and a receiver, wherein the switch is respectively connected to the transmitter and the receiver in communication, and the message sent by the transmitter to the receiver is forwarded via the switch. The network environment where the switch, the transmitter and the receiver are located is an Ethernet environment, such as a data center network, an industrial network, etc.

[0065] The switch may be a network switch, a multi-port router, a stacked switch, a virtual switch, etc.

[0066] The message sent by the sender first arrives at the switch. The switch can determine the destination address by searching the forwarding table, and then forward the message to the corresponding receiving end. When the switch receives a large number of messages, the switch will cache the messages in the queue, and then forward the messages in the queue in sequence. When the switch uses the cache queue to cache messages, it needs to use the switch's cache resources to achieve caching.

[0067] A switch generally has multiple cache queues, which can share cache resources. During implementation, cache resources can be allocated to each cache queue according to the situation of cached messages in each cache queue. For example, if some cache queues need to cache a large amount of messages, more cache resources may be allocated, while some cache queues need to cache a small amount of messages, so less cache resources may be allocated. In fact, some cache queues may not receive any messages, so there is no need to allocate cache resources to these cache queues.

[0068] The switch can determine whether to perform ECN marking on the message according to the situation of the cached message. For example, when the cached message volume is large and the cache resources are fully occupied, ECN marking is performed to prevent packet loss. After the receiving end receives the message with ECN marking, it can send information to the sending end to notify the sending end to reduce the message sending rate, thereby alleviating network congestion.

[0069] In this embodiment, the switch can set a dynamic cache threshold according to actual changes in congestion conditions, and the mark threshold follows the changes in the dynamic cache threshold. Therefore, the mark threshold can adapt to the actual cache resource occupancy, while improving the chip cache utilization rate, and can reduce the probability of packet loss due to untimely ECN marking.

[0070] See also Figure 2 , is a flow chart of an implementation method of triggering ECN marking based on dynamic thresholds provided by an embodiment of the present invention. The implementation method of triggering ECN marking based on dynamic thresholds can be executed by an implementation device of triggering ECN marking based on dynamic thresholds. The implementation device of triggering ECN marking based on dynamic thresholds can be implemented by software and / or hardware and can be configured in a network device. The network device can be the above-mentioned switch. The detailed steps of the implementation method of triggering ECN marking based on dynamic thresholds are described as follows.

[0071] S11, when forwarding a message in a target cache queue included in the multiple cache queues, obtaining the number of cache queues currently in a congested state, and calculating a cache threshold based on the number of cache queues in a congested state.

[0072] S12: Calculate a current marking threshold based on the cache threshold.

[0073] S13, obtaining the actual current cache resource occupancy of the target cache queue, and determining whether to perform an explicit congestion notification (ECN) marking on the message currently to be forwarded in the target cache queue based on the occupancy and the marking threshold.

[0074] In this embodiment, after receiving a message sent by the sender, the switch can parse the message to obtain information such as the source MAC address and the destination MAC address carried in the message. The switch maintains a forwarding table, which includes the correspondence between different ports of the switch and different source MAC addresses and destination MAC addresses. The switch searches the forwarding table based on the destination MAC address of the message to determine the corresponding port, and then forwards the message from the found port to the receiving end.

[0075] The switch includes multiple cache queues. Each time the switch receives a message, it caches the received message into one of the cache queues. The cache queue to be stored can be selected based on the number of messages cached in each cache queue, or can be selected based on the priority of the message.

[0076] In one possible implementation, see Figure 3 The method provided in this embodiment may further include the following steps:

[0077] S01, after receiving a message each time, obtaining the message level of the message.

[0078] S02: Determine a queue level of each of the multiple cache queues.

[0079] S03, storing the message in a cache queue of a queue level corresponding to its message level.

[0080] Messages in an Ethernet environment can be prioritized based on their type. For example, real-time video traffic and voice communication traffic can be given higher priorities, while email traffic and file transfer traffic can be given lower priorities. Messages with higher priorities are forwarded earlier than messages with lower priorities, thus ensuring that some traffic with higher real-time requirements can be forwarded in a timely manner.

[0081] In this embodiment, the switch may determine the priority of the message based on information carried in the message, for example, the switch may determine the priority of the message based on an 802.1Q VLAN tag, a differentiated services code point (DSCP), etc. in the message.

[0082] In addition, in order to manage the forwarding of messages between different priorities and within the same priority, different priorities can be set for multiple cache queues. The priority of the cache queue can correspond to the priority of the message. For example, a certain priority of the message can correspond to the priority of one or more cache queues. That is, a cache queue of a certain priority can cache messages of one or more priorities.

[0083] The correspondence between the priority of the message and the priority of the cache queue can be stored in the switch in the form of a correspondence table. In this way, after the switch receives the message and determines the priority of the message, it can search the correspondence table based on the priority of the message to determine the priority of the cache queue corresponding to the priority of the message. Then, the message can be stored in the cache queue found.

[0084] After the switch stores the message in the cache queue, it can forward the message in the cache queue in a first-in-first-out manner when it needs to forward the message. The cache queue that needs to forward the message is called the target cache queue in this embodiment, and the target cache queue can be any cache queue in multiple cache queues in the switch.

[0085] When the switch forwards the message in the target cache queue, it needs to determine whether the message to be forwarded needs to be ECN marked. In this embodiment, it can be determined whether each cache queue in the current switch is in a congested state. Optionally, it can be determined that the cache queue is in a congested state when the cache queue occupies cache resources to cache messages, or it can be determined that the cache queue is in a congested state when the amount or proportion of cache resources occupied by the cache queue exceeds a set value.

[0086] The number of cache queues in a congested state can be counted, and the cache threshold can be calculated based on the number of cache queues in a congested state. Since the number of cache queues in a congested state affects the amount of cache resources that can actually be occupied by each cache queue, specifically, if the number of cache queues in a congested state is large, the cache resources that can actually be occupied by each cache queue are small, and if the number of cache queues in a congested state is small, the cache resources that can actually be occupied by each cache queue are large.

[0087] Therefore, in this embodiment, the cache threshold is calculated based on the number of cache queues in a congested state, so that the cache threshold can be adapted to the amount of cache resources that each cache queue can actually occupy. Specifically, when the number of cache queues in a congested state is large, the calculated cache threshold is small, and when the number of cache queues in a congested state is small, the calculated cache threshold is large, that is, the cache threshold changes dynamically and negatively with the number of cache queues in a congested state.

[0088] In this way, there will be no problem that the cache queue actually occupies less cache resources while the cache threshold is configured to be larger, resulting in the cache queue not triggering the ECN mark, and the overall cache of the switch is exhausted, causing packet loss; there will also be no problem that the cache queue actually occupies more cache resources while the cache threshold is configured to be smaller, resulting in frequent triggering of the ECN mark, and then resulting in low network forwarding efficiency.

[0089] On this basis, a marking threshold is calculated based on a dynamic buffer threshold, and the marking threshold can be used as a standard for triggering ECN marking when forwarding packets in each buffer queue currently in a congested state in the switch.

[0090] Specifically, when the switch forwards the to-be-forwarded message in the target cache queue, it can obtain the actual current cache resource occupancy of the target cache queue, where the occupancy may refer to the size of the cache resource actually occupied by the message in the target cache queue. For example, assuming that there are five messages cached in the target cache queue, and the size of each message is 1M, the size of the cache resource actually occupied by the target cache queue is 5M.

[0091] The cache threshold calculated above can be a percentage, and then multiplied by the total cache resources, and the marking threshold can be an offset of the cache threshold. For example, assuming that the cache threshold is 1 / 2 and the total cache resources are 100M, the final cache threshold is 50M.

[0092] On the basis of the above, it can be determined whether to perform ECN marking on the message to be forwarded based on the current occupancy of the target cache queue and the current marking threshold.

[0093] Specifically, in this embodiment, if the occupancy of the target cache queue indicates that the amount of cache resources occupied by the message in the target cache queue is less than the marking threshold, it is determined that there is no need to perform ECN marking on the message to be forwarded. If the occupancy indicates that the amount of cache resources occupied by the message in the target cache queue is greater than or equal to the marking threshold, it is determined that the message to be forwarded is to be ECN marked.

[0094] The implementation method of triggering ECN marking based on dynamic thresholds provided in this embodiment, the marking threshold can follow the dynamic cache threshold changes, and the cache threshold changes based on the current congestion situation, so that the marking threshold can adapt to the actual cache resource occupancy situation, while improving the chip cache utilization rate, reducing the probability of packet loss due to untimely ECN marking.

[0095] See also Figure 4 In this embodiment, when the cache threshold is calculated based on the number of cache queues in the congestion state, it can be implemented in the following way:

[0096] S111 : determining a target cache coefficient from a plurality of preset cache coefficients based on the number of cache queues in a congested state.

[0097] S112: Calculate a cache threshold according to the number of cache queues in a congested state and the target cache coefficient.

[0098] In this embodiment, multiple optional cache coefficients are configured, for example, the cache coefficient can be -1, 0, 1, 7, etc. Since the more cache queues in the congested state, the less cache resources each cache queue can occupy, in order to avoid the cache threshold being configured too large, resulting in the ECN mark being unable to be triggered, the cache threshold at this time should be smaller. When the number of cache queues in the congested state is small, each cache queue can occupy more cache resources. In order to avoid frequent triggering of the ECN mark, the cache threshold at this time should be configured larger.

[0099] Therefore, the cache threshold is negatively correlated with the number of cache queues in the congested state, that is, the fewer the cache queues in the congested state, the larger the cache threshold, and the more the cache queues in the congested state, the smaller the cache threshold. Different cache coefficients affect the degree of negative correlation between the cache threshold and the number of cache queues in the congested state.

[0100] like Figure 5 As shown in the figure, it schematically shows the change of the cache threshold with the number of cache queues in the congested state under different cache coefficients (the cache coefficient from left to right corresponds to the curve from top to bottom). It can be seen from the figure that the larger the cache coefficient, the faster the cache threshold changes with the cache queue in the congested state, and the smaller the cache coefficient, the slower the cache threshold changes with the cache queue in the congested state.

[0101] In this embodiment, the cache coefficient can be selected based on the network status, and the number of cache queues currently in a congested state can reflect the network status to a certain extent. Therefore, the target cache coefficient can be determined from the preset cache coefficients based on the number of cache queues currently in a congested state. For example, if the number of cache queues in a congested state is large, a larger cache coefficient can be selected, so that the cache threshold can be quickly changed based on the change in the number of cache queues in a congested state. If the data of the cache queues in a congested state is small, a smaller cache coefficient can be selected.

[0102] When the target cache coefficient is determined, the cache threshold may be calculated according to the following formula based on the number of cache queues in the congested state and the target cache coefficient:

[0103]

[0104] Where n represents the number of cache queues in a congested state, f represents the target cache coefficient, and buf_thrd represents the cache threshold.

[0105] Although the cache threshold can be used as a criterion for determining whether the network is congested and whether ECN marking is required, the marking threshold should deviate from the cache threshold to avoid packet loss before triggering ECN marking, or the marking threshold is too small or even less than 0.

[0106] Based on this, see Figure 6 In this embodiment, when the current marking threshold is calculated based on the cache threshold, it can be implemented in the following way:

[0107] S121, obtaining a set offset and a lower limit value, wherein the offset is an offset of the marking threshold relative to the cache threshold, and the lower limit value is a lower limit of the marking threshold.

[0108] S122: Determine the proportion of currently occupied cache resources based on the relationship between the cache threshold, the offset, and the lower limit.

[0109] S123: Based on the proportion of the occupied cache resources, a marking threshold is calculated using a corresponding calculation strategy.

[0110] In this embodiment, the offset of the marking threshold relative to the cache threshold and the lower limit value can be set based on experience. By comparing the size relationship between the cache threshold, the offset and the lower limit value, the current cache resource occupancy can be determined, for example, the cache resources are sufficient (i.e., less occupied), the cache resources are relatively tight (i.e., more occupied), the cache resources are very tight (i.e., a lot of occupied), etc. The size relationship between the cache threshold, the offset and the lower limit value can include, for example, the size relationship between the difference between the cache threshold and the offset and the lower limit value, the size relationship between the cache threshold and the lower limit value, etc.

[0111] By analyzing the relationship between the cache threshold, offset and lower limit, the resource occupancy can be determined. Here, the resource occupancy can be characterized as the proportion of occupied cache resources. Then, under different resource occupancy conditions, different calculation strategies are used to calculate the marking threshold.

[0112] In this embodiment, the cache resource occupancy situation may be divided into a plurality of different situations. Accordingly, the proportion of the occupied cache resources may be divided into a plurality of ranges. In situations belonging to different ranges, different calculation strategies are adopted to calculate the marking threshold.

[0113] Specifically, see Figure 7 , the range division of the proportion of occupied cache resources can be achieved in the following ways:

[0114] S1221: When the difference between the cache threshold and the offset is greater than the lower limit, determine that the proportion of currently occupied cache resources is within a first range.

[0115] S1222. When the difference between the cache threshold and the offset is less than the lower limit value and the cache threshold is greater than the lower limit value, determine that the proportion of the currently occupied cache resources is within a second range.

[0116] S1223. When the cache threshold is less than the lower limit value, determine that the proportion of the currently occupied cache resources is within a third range.

[0117] In this embodiment, the above-mentioned first range, second range, and third range gradually increase in sequence. That is, when the proportion of the occupied cache resources is within the first range, the second range, and the third range respectively, the situation of cache resource occupation gradually becomes tense.

[0118] Specifically, the cache threshold is denoted as buf_thrd, the offset is denoted as offset, and the lower limit value is denoted as ecn_floor. There are the following situations regarding the magnitude relationship among the cache threshold, the offset, and the lower limit value:

[0119] When buf_thrd - offset > ecn_floor, it can be determined that the current cache resources are sufficient. That is, it can be determined that the proportion of the occupied cache resources is within the first range.

[0120] When buf_thrd - offset < ecn_floor and buf_thrd > ecn_floor, it can be determined that the current cache resources are relatively tense. That is, it can be determined that the proportion of the occupied cache resources is within the second range.

[0121] When buf_thrd < ecn_floor, it can be determined that the current cache resources are very tense. That is, it can be determined that the proportion of the occupied cache resources is within the third range.

[0122] In this embodiment, through the specific magnitude relationship among the cache threshold, the offset, and the lower limit value, the situation of cache resource occupation can be determined, and then it is specifically reflected by converting it into the range where the proportion of the occupied cache resources is located. Based on accurately judging the situation of cache resource occupation, the occupation situation can be reflected in a numerical form.

[0123] On this basis, please refer to Figure 8 , the step of calculating the marking threshold by adopting a corresponding calculation strategy based on the numerically represented proportion of the occupied cache resources can be implemented in the following manner:

[0124] S1231. When the proportion of the occupied cache resources is within the first range, subtract the offset from the cache threshold to obtain the marking threshold.

[0125] S1232: When the proportion of the occupied cache resources is within a second range, set the marking threshold to be equal to the lower limit.

[0126] S1233: When the proportion of the occupied cache resources is within a third range, set a marking threshold equal to the cache threshold.

[0127] When the proportion of occupied cache resources is within the first range, the current cache resources are sufficient, and the marking threshold can change dynamically with the cache threshold. Therefore, the marking threshold can be obtained by subtracting the offset from the cache threshold: ecn_thrd=buf_thrd−offset.

[0128] When the proportion of occupied cache resources is in the second range, the current cache resources are relatively tight. In order to prevent the marking threshold from being too small and frequently triggering ECN marking, or even the marking threshold being negative, the marking threshold is set to the configured lower limit: ecn_thrd=ecn_floor.

[0129] When the proportion of occupied cache resources is in the third range, the current cache resources are very tight. To prevent the marking threshold from being greater than the cache threshold, the marking threshold is set to the cache threshold: ecn_thrd=buf_thrd.

[0130] In this embodiment, through the above method, different strategies are adopted to set the marking threshold under different congestion conditions in the network, so that the marking threshold can be suitable for the actual network conditions. When the cache resources are sufficient, the marking threshold is increased, which can effectively improve the chip cache utilization rate, and when the cache resources are tight, the marking threshold is lowered, which greatly reduces the probability of packet loss due to failure to mark ECN in time.

[0131] On the basis of the above, for the message to be forwarded in the target cache queue, it can be determined whether to trigger the ECN mark based on the actual current cache resource occupancy of the target cache queue and the current mark threshold.

[0132] Please refer to Fig. 9 As shown in Fig. 9 The horizontal axis represents time, and the vertical axis represents the cache resource amount (the cache threshold, marking threshold, and cache resource occupancy can all be converted into corresponding cache resource amounts). Among them, the curves from top to bottom at time t0 represent the cache threshold buf_thrd, the marking threshold ecn_thrd, and the actual cache resource occupancy que_buf respectively.

[0133] At time t0, no cache queue in the switch is in a congested state, so the cache threshold and the marking threshold remain unchanged (the difference between the two is offset offset).

[0134] Congestion begins at time t1. There is a buffer queue in the congested state. The buffer threshold of the queue starts to decrease, and the marking threshold decreases synchronously. At this time, the actual buffer resource occupancy of the buffer queue is less than the marking threshold, and ECN marking is not triggered at this time.

[0135] At time t2, the actual buffer resource occupancy of the buffer queue begins to be greater than or equal to the marking threshold, and ECN marking is triggered.

[0136] At time t3, the congestion condition begins to ease, and the buffer threshold begins to rise.

[0137] At time t4, the actual buffer resource occupancy of the buffer queue is less than the marking threshold, and ECN marking is no longer performed.

[0138] At time t5, network congestion worsens again.

[0139] From time t0 to t5 above, buf_thrd - offset > ecn_floor, that is, the buffer resources are relatively sufficient. Therefore, during this period, the calculation method of the marking threshold is: ecn_thrd = buf_thrd - offset.

[0140] At time t6, network congestion gradually becomes severe. At this time, buf_thrd - offset < ecn_floor. To prevent the marking threshold from being too small or even less than 0, at this time, ecn_thrd = ecn_floor.

[0141] At time t7, network congestion is already very severe, and the queue buffer threshold is less than the lower limit value. At this time, if the marking threshold is set to the lower limit value, it will cause the marking threshold to be greater than the buffer threshold, and packet loss may occur before ECN marking is triggered. Therefore, set ecn_thrd = buf_thrd.

[0142] Please refer to Fig.10 , in this embodiment, in the case of determining that an ECN mark needs to be applied to a packet, the marking can be achieved through the following method:

[0143] S14, in the case of determining that an ECN mark needs to be applied to the packet to be forwarded, add a mark bit to the header of the packet and set the flag bit to indicate the existence of congestion.

[0144] S15, send the packet after setting to the receiving end, so that after the receiving end parses the flag bit in the packet, it sends a congestion notification packet CNP to the sending end to notify the sending end to reduce the packet sending rate.

[0145] In this embodiment, the switch can add a mark bit to the header of the message to be forwarded. The mark bit can be two bits, and different combinations of the two bits can represent the network situation. For example, if the two bits are 00, it means that the ECN function is not supported, if the two bits are 01 or 10, it means that the ECN function is supported and there is no network congestion, and if the two bits are 11, it means that the ECN function is supported and there is network congestion.

[0146] Therefore, when it is determined that the message to be forwarded is marked with ECN, the mark bit in the message header is 11, indicating that there is network congestion. The switch forwards the message to the receiving end. After receiving the message, the receiving end parses the mark bit in the message header. If it is determined that there is congestion in the current network after parsing, a CNP message can be sent to the sending end. After receiving the CNP message, the sending end can reduce the message sending rate, so as to alleviate the network congestion.

[0147] Based on the same inventive concept, please refer to Fig.11 , shows a functional module schematic diagram of an implementation device based on dynamic threshold triggering ECN marking provided by an embodiment of the present invention. This embodiment can divide the functional modules of the implementation device according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic, which is only a logical function division. There may be other division methods in actual implementation.

[0148] For example, when each functional module is divided into corresponding functional modules, Fig.11 The implementation device shown is only a schematic diagram of a device, wherein the implementation device may include a calculation module and a judgment module, and the functions of each functional module of the implementation device are respectively described in detail below.

[0149] a calculation module, configured to obtain the number of cache queues currently in a congested state when forwarding messages in a target cache queue included in the multiple cache queues, and calculate a cache threshold based on the number of cache queues in a congested state;

[0150] The calculation module is further used to calculate a current marking threshold based on the cache threshold;

[0151] The judgment module is used to obtain the actual current cache resource occupancy of the target cache queue, and judge whether to perform an explicit congestion notification ECN marking on the message currently to be forwarded in the target cache queue based on the occupancy and the marking threshold.

[0152] It can be understood that the above-mentioned calculation module and judgment module can be used to execute the above-mentioned S11 to S13. The detailed implementation of the calculation module and the judgment module can refer to the relevant contents of the above-mentioned S11 to S13.

[0153] In a possible implementation, the above-mentioned calculation module may be used to:

[0154] Determining a target cache coefficient from a plurality of preset cache coefficients based on the number of cache queues in a congested state;

[0155] The cache threshold is calculated according to the number of cache queues in a congested state and the target cache coefficient.

[0156] In a possible implementation, the above-mentioned calculation module may be used to:

[0157] Obtaining a set offset and lower limit value, wherein the offset is an offset of the marking threshold relative to the cache threshold, and the lower limit value is a lower limit of the marking threshold;

[0158] Determine the proportion of currently occupied cache resources based on the relationship between the cache threshold, the offset and the lower limit;

[0159] Based on the proportion of the occupied cache resources, a marking threshold is calculated using a corresponding calculation strategy.

[0160] In a possible implementation, the above-mentioned calculation module may be used to:

[0161] When the difference between the cache threshold and the offset is greater than the lower limit, determining that the proportion of currently occupied cache resources is within a first range;

[0162] When the difference between the cache threshold and the offset is less than the lower limit, and the cache threshold is greater than the lower limit, determining that the proportion of currently occupied cache resources is within a second range;

[0163] When the cache threshold is less than the lower limit, determining that the proportion of currently occupied cache resources is within a third range;

[0164] Among them, the first range, the second range and the third range gradually increase in sequence.

[0165] In a possible implementation, the above-mentioned calculation module may be used to:

[0166] When the proportion of the occupied cache resources is within a first range, subtracting the offset from the cache threshold to obtain a marking threshold;

[0167] When the proportion of the occupied cache resources is within the second range, setting the marking threshold equal to the lower limit;

[0168] When the proportion of the occupied cache resources is within a third range, the marking threshold is set equal to the cache threshold.

[0169] In a possible implementation, the above-mentioned determination module may be used to:

[0170] If the occupancy status indicates that the amount of cache resources occupied by the messages in the target cache queue is less than the marking threshold, it is determined that there is no need to perform ECN marking on the message to be forwarded currently;

[0171] If the occupancy status indicates that the amount of cache resources occupied by the messages in the target cache queue is greater than or equal to the marking threshold, it is determined to perform ECN marking on the message currently to be forwarded.

[0172] In a possible implementation manner, the implementation device may further include a receiving module, and the receiving module may be used to:

[0173] After receiving a message each time, obtaining the message level of the message;

[0174] Determining a queue level of each of the plurality of cache queues;

[0175] The message is stored in a cache queue of a queue level corresponding to its message level.

[0176] In a possible implementation manner, the implementation device may further include a sending module, and the sending module may be used to:

[0177] In the case where it is determined that the message to be forwarded is to be ECN marked, a marking bit is added to the header of the message, and the flag bit is set to indicate the presence of congestion;

[0178] The set message is sent to the receiving end, so that the receiving end parses the flag bit in the message and then sends a congestion notification message CNP to the sending end to notify the sending end to reduce the message sending rate.

[0179] Fig.12 The embodiment of the present invention provides a network device provided by the embodiment of the present invention. The network device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is used to execute the above-mentioned implementation method based on dynamic threshold triggering ECN marking when running.

[0180] The processor and the memory may be connected via a bus or other means.

[0181] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs, such as the implementation device for triggering ECN marking based on dynamic thresholds described in the embodiments of the present invention. The processor implements the above-mentioned implementation method for triggering ECN marking based on dynamic thresholds by running the non-transitory software programs and instructions stored in the memory.

[0182] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store and execute the above-mentioned implementation method of triggering ECN marking based on dynamic thresholds. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the network device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0183] The non-transient software program and instructions required to implement the above-mentioned method for triggering ECN marking based on dynamic threshold are stored in the memory, and when executed by one or more processors, the above-mentioned method for triggering ECN marking based on dynamic threshold is executed.

[0184] The embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the above-mentioned method for implementing the ECN marking triggered based on the dynamic threshold.

[0185] In one embodiment, the computer-readable storage medium stores computer-executable instructions, which are executed by one or more control processors, for example, by a processor in the above-mentioned network device, so that the above-mentioned one or more processors can execute the above-mentioned implementation method of triggering ECN marking based on dynamic threshold.

[0186] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0187] It will be appreciated by those skilled in the art that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transient medium).

[0188] As is well known to those skilled in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer-readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.

[0189] Furthermore, it is well known to those skilled in the art that communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0190] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A method for implementing ECN marking based on dynamic threshold triggering, characterized in that: Applied to a switch, the switch is respectively connected to a sending end and a receiving end for communication, the switch includes a plurality of cache queues, the plurality of cache queues share cache resources, and the method includes: When forwarding a message in a target cache queue included in the multiple cache queues, obtaining the number of cache queues currently in a congested state, and calculating a cache threshold based on the number of cache queues in the congested state; Calculate the current marking threshold based on the cache threshold; The actual current cache resource occupancy of the target cache queue is obtained, and based on the occupancy and the marking threshold, it is determined whether to perform an explicit congestion notification (ECN) marking on the message currently to be forwarded in the target cache queue.

2. The method for implementing ECN marking based on dynamic threshold triggering according to claim 1, characterized in that: The step of calculating the cache threshold based on the number of cache queues in a congested state includes: Determining a target cache coefficient from a plurality of preset cache coefficients based on the number of cache queues in a congested state; The cache threshold is calculated according to the number of cache queues in a congested state and the target cache coefficient.

3. The method for implementing ECN marking based on dynamic threshold triggering according to claim 1, characterized in that: The step of calculating the current marking threshold based on the cache threshold comprises: Obtaining a set offset and lower limit value, wherein the offset is an offset of the marking threshold relative to the cache threshold, and the lower limit value is a lower limit of the marking threshold; Determine the proportion of currently occupied cache resources based on the relationship between the cache threshold, the offset and the lower limit; Based on the proportion of the occupied cache resources, a marking threshold is calculated using a corresponding calculation strategy.

4. The method for implementing ECN marking based on dynamic threshold triggering according to claim 3, characterized in that: The step of determining the proportion of currently occupied cache resources based on the size relationship between the cache threshold, the offset and the lower limit value includes: When the difference between the cache threshold and the offset is greater than the lower limit, determining that the proportion of currently occupied cache resources is within a first range; When the difference between the cache threshold and the offset is less than the lower limit, and the cache threshold is greater than the lower limit, determining that the proportion of currently occupied cache resources is within a second range; When the cache threshold is less than the lower limit, determining that the proportion of currently occupied cache resources is within a third range; Among them, the first range, the second range and the third range gradually increase in sequence.

5. The method for implementing ECN marking based on dynamic threshold triggering according to claim 4, characterized in that: The step of calculating the marking threshold using a corresponding calculation strategy based on the proportion of the occupied cache resources includes: When the proportion of the occupied cache resources is within a first range, subtracting the offset from the cache threshold to obtain a marking threshold; When the proportion of the occupied cache resources is within the second range, setting the marking threshold equal to the lower limit; When the proportion of the occupied cache resources is within a third range, the marking threshold is set equal to the cache threshold.

6. The method for implementing ECN marking based on dynamic threshold triggering according to claim 1, characterized in that: The step of judging whether to perform an ECN marking on the message currently to be forwarded in the target cache queue based on the occupancy status and the marking threshold comprises: If the occupancy status indicates that the amount of cache resources occupied by the messages in the target cache queue is less than the marking threshold, it is determined that there is no need to perform ECN marking on the message to be forwarded currently; If the occupancy status indicates that the amount of cache resources occupied by the messages in the target cache queue is greater than or equal to the marking threshold, it is determined to perform ECN marking on the message currently to be forwarded.

7. The method for implementing ECN marking based on dynamic threshold triggering according to claim 1, characterized in that: The method further comprises: After receiving a message each time, obtaining the message level of the message; Determining a queue level of each of the plurality of cache queues; The message is stored in a cache queue of a queue level corresponding to its message level.

8. The method for implementing ECN marking based on dynamic threshold triggering according to any one of claims 1 to 7, characterized in that: The method further comprises: In the case where it is determined that the message to be forwarded is to be ECN marked, a marking bit is added to the header of the message, and the flag bit is set to indicate the presence of congestion; The set message is sent to the receiving end, so that the receiving end parses the flag bit in the message and then sends a congestion notification message CNP to the sending end to notify the sending end to reduce the message sending rate.

9. A device for implementing ECN marking based on dynamic threshold triggering, characterized in that: Applied to a switch, the switch is respectively connected to a sending end and a receiving end for communication, the switch includes a plurality of cache queues, the plurality of cache queues share cache resources, and the device includes: a calculation module, configured to obtain the number of cache queues currently in a congested state when forwarding messages in a target cache queue included in the multiple cache queues, and calculate a cache threshold based on the number of cache queues in a congested state; The calculation module is further used to calculate a current marking threshold based on the cache threshold; The judgment module is used to obtain the actual current cache resource occupancy of the target cache queue, and judge whether to perform an explicit congestion notification ECN marking on the message currently to be forwarded in the target cache queue based on the occupancy and the marking threshold.

10. A network device, characterized in that: It includes at least one processor and a memory for communicating with the at least one processor, the memory storing instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method steps as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Dynamic ECN threshold adjustment method and system based on queue water level

    CN121462501A