CN113783794A - Congestion control method and device - Google Patents
Congestion control method and device Download PDFInfo
- Publication number
- CN113783794A CN113783794A CN202011360712.6A CN202011360712A CN113783794A CN 113783794 A CN113783794 A CN 113783794A CN 202011360712 A CN202011360712 A CN 202011360712A CN 113783794 A CN113783794 A CN 113783794A
- Authority
- CN
- China
- Prior art keywords
- message
- forwarded
- determining
- table entry
- flow
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2441—Traffic characterised by specific attributes, e.g. priority or QoS relying on flow classification, e.g. using integrated services [IntServ]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/32—Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a congestion control method and a congestion control device, and relates to the technical field of computers. One embodiment of the method comprises: determining attribute information and/or data flow rate of a message to be forwarded; determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate; wherein the message types include: rat or elephant flow; and performing congestion control on the message to be forwarded according to the message type of the message to be forwarded. The embodiment can provide more reasonable and effective congestion control for the congested network.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a congestion control method and apparatus.
Background
When data congestion occurs between a data sending end and a receiving end, a switch node with the congested data transmission path can perform congestion control on the congested message, so that the link congestion condition is relieved. However, the congestion control strategy in the prior art can only simply discard the newly arrived packet, and cannot provide more reasonable and effective congestion control.
Disclosure of Invention
In view of this, embodiments of the present invention provide a congestion control method and apparatus, which can provide relatively reasonable and effective congestion control.
In a first aspect, an embodiment of the present invention provides a congestion control method, including:
determining attribute information and/or data flow rate of a message to be forwarded;
determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate; wherein the message types include: rat or elephant flow;
and performing congestion control on the message to be forwarded according to the message type of the message to be forwarded.
Optionally, the attribute information includes: delay sensitivity degree information;
determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate, wherein the determining comprises the following steps:
judging whether the time delay sensitivity degree information is larger than a sensitivity degree threshold value;
if so, determining that the message type of the message to be forwarded is a mouse flow;
if not, determining the message type of the message to be forwarded according to the data flow rate.
Optionally, the determining the packet type of the packet to be forwarded according to the data flow rate includes:
judging whether the data flow rate is greater than a rate threshold value;
if so, determining the message type of the message to be forwarded as the elephant flow;
if not, determining that the message type of the message to be forwarded is the mouse flow.
Optionally, the determining a data flow rate of the packet to be forwarded includes:
determining a corresponding target table entry of a message to be forwarded in a flow matching table; wherein the target table entry comprises at least one of: a source IP address, a destination IP address, a protocol number, a source port number, a destination port number;
updating the byte statistic value corresponding to the target table entry according to the byte number of the message to be forwarded;
determining the data flow rate corresponding to the target table entry according to the difference value of the byte statistic value in the query period;
and determining the data flow rate corresponding to the target table entry as the data flow rate corresponding to the message to be forwarded.
Optionally, the determining a target table entry corresponding to the packet to be forwarded in the flow matching table includes:
analyzing the corresponding table entry of the message to be forwarded;
and determining whether the corresponding table entry exists in the flow matching table, if so, determining the existing table entry as a target table entry corresponding to the message to be forwarded, otherwise, adding the corresponding table entry into the flow matching table, and determining the added table entry as the target table entry corresponding to the message to be forwarded.
Optionally, the method further comprises:
for each entry in the flow matching table: and if the change value of the byte statistical value of the table entry is smaller than a preset difference value in the aging period, deleting the table entry.
Optionally, the performing congestion control on the packet to be forwarded according to the packet type of the packet to be forwarded includes:
and discarding the message to be forwarded with the message type of the elephant flow.
Optionally, the discarding the to-be-forwarded packet whose packet type is the elephant flow includes:
determining the congestion degree of the network;
determining the discarding probability of the elephant flow message according to the congestion degree;
and discarding the message to be forwarded with the message type being the elephant flow according to the discarding probability.
Optionally, the method further comprises:
and if the congestion degree is greater than the preset degree and the discarding probability of the elephant flow message is greater than the preset probability, discarding the message to be forwarded, the message type of which is the mouse flow.
In a second aspect, an embodiment of the present invention provides a congestion control apparatus, including:
the information determining module is used for determining the attribute information and/or the data flow rate of the message to be forwarded;
a type determining module, configured to determine a packet type of the packet to be forwarded according to the attribute information and/or the data flow rate; wherein the message types include: rat or elephant flow;
and the congestion control module is used for carrying out congestion control on the message to be forwarded according to the message type of the message to be forwarded.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of the embodiments described above.
In a fourth aspect, an embodiment of the present invention provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method of any one of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate of the message to be forwarded, wherein the message type comprises: rat or elephant flow; and then according to the message type of the message to be forwarded, performing congestion control on the message to be forwarded. If the network is congested, the elephant flow message with a large data flow rate can be discarded, and mouse flow messages with a small data flow rate or a high delay sensitivity degree do not need to be discarded, so that the network congestion condition can be effectively relieved. And if the elephant flow message is discarded, the mouse flow message is discarded under the condition that the network congestion state is not relieved. Compared with the congestion control method which discards all messages indiscriminately, the method provided by the embodiment of the invention carries out congestion control according to the message types, and is more reasonable and effective.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 2 is a schematic diagram illustrating a flow of a congestion control method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a flow of another congestion control method provided by an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a flow of a method for determining a data flow rate of a packet to be forwarded according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a flow learning and flow aging process provided by one embodiment of the present invention;
fig. 6 is a schematic diagram of a flow of another congestion control method provided by an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a congestion control framework according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a congestion control apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings; various details of embodiments of the invention are included to assist in understanding, and they are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Congestion control can be performed by two congestion control methods: one is Tail Drop (Tail Drop) and Weighted Random Early Detection (WRED).
The principle of tail dropping is that when the link is congested, the output port queue of the congested switch drops all newly arrived messages until the congestion condition of the link is relieved.
The principle of weighted random early detection is that a minimum threshold, a maximum threshold of queue length and a discarding probability are configured for an outgoing port queue of a switch, when the outgoing queue length of the switch exceeds the minimum threshold, the queue is congested, and messages are discarded randomly according to the configured discarding probability. When the output port queue length of the switch exceeds the maximum queue threshold, the message is discarded by a hundred percent. And when the length of the output port queue of the switch is between the minimum queue and the maximum queue threshold, randomly discarding the message according to a fixed discarding probability curve.
The side effect of the congestion Control mode of tail drop is obvious, and a global synchronization phenomenon of a Transmission Control Protocol (TCP) can be caused, so that network traffic is vibrated. In addition, because the congested messages are not classified and discarded indiscriminately, the processing is not friendly to some delay-sensitive services.
The weighted random early detection algorithm is an improvement of a tail drop algorithm, and the tail drop random drop mode can prevent TCP global synchronization and improve the utilization rate of a link. However, the tail drop discards all the traffic in the congestion queue randomly, and due to the undifferentiated traffic drop manner, no corresponding drop adjustment is made based on the characteristics of the traffic itself, so that the optimal network forwarding performance cannot be achieved.
Considering the situation where the switch schedules both data flows sent by server A, B at the same queue at an egress port and congestion occurs at that queue, a sends less traffic but is delay sensitive. And B, the data sent by B has large flow and insensitive time delay. In the existing implementation of congestion avoidance, both the data stream sent by a and the data stream sent by B may be randomly discarded by the weighted random early detection algorithm.
Assuming an extreme case, a message sent by a is largely discarded, the link congestion condition is not relieved, then traffic sent by B starts to be randomly discarded, and the link starts to be relieved, as the case assumed above happens, the discarding order in this case causes the link congestion to be relieved, but the server a increases link delay due to data retransmission, and the retransmitted traffic may still be discarded due to link congestion, and the occurrence of the traffic sensitive to delay is unacceptable. Ideally, for such a situation, the mouse flow packet with a smaller flow and sensitive delay sent by the server a is not discarded when the switch is congested, but only the elephant flow packet is discarded, so that the network congestion condition can be effectively reduced, and the mouse flow packet with sensitive delay is not affected.
On the other hand, the weighted random early detection algorithm can trigger one hundred percent discarding of messages when the queue length of the queue exceeds the configured upper limit of the queue length, the discarding mode is unreasonable for mouse flow messages sensitive to delay, the mouse flow message discarding has little significance for relieving link congestion, and the more effective mode is to discard the elephant flow message firstly, the elephant flow message occupies a large amount of bandwidth of a chip, and the method is very effective for relieving link congestion. The mouse flow message is discarded only when discarding the elephant flow message cannot alleviate congestion.
Meanwhile, due to the development of the 5G technology, data messages generated by some special applications of the 5G technology, such as data messages of real-time high-definition audio and video remote consultation, are very large in flow and sensitive in time delay. In the conventional method, the message generated by the special application is identified as a elephant flow message, but in the practical application, the congestion control is required according to the mouse message flow.
Based on this, the embodiment of the present invention provides a scheme for controlling congestion based on the message type of the message to be forwarded, which can solve the problem of unfriendly processing of the delay sensitive service. Fig. 1 shows an exemplary system architecture 100 to which a congestion control method or congestion control apparatus of an embodiment of the present invention may be applied.
As shown in fig. 1, the system architecture 100 may include communication devices 101, 102, 103, 105, and 106, and a transit node 104. The relay stage 104 is a device for relaying information between the communication devices 101, 102, 103 and 105, 106. Transit node 104 may include various network devices such as switches, routers, and the like.
The terminal devices 101, 102, 103 may be various types of terminal devices or servers, such as a mobile phone, a notebook, a tablet, a laptop, and the like. The communication devices 101, 102, 103, 105, 106 interact through the transit node 104 to receive or transmit messages or the like.
The transit node 104 receives attribute information and/or data flow rate of a message to be forwarded, which are sent by the communication devices 101, 102, 103, 105, and 106; determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate; wherein the message types include: rat or elephant flow; and performing congestion control on the message to be forwarded according to the message type of the message to be forwarded.
It should be noted that the congestion control method provided in the embodiment of the present invention is generally executed by the transit node 104, and accordingly, the congestion control device is generally disposed in the transit node 104.
It should be understood that the number of communication devices, transit nodes in fig. 1 is merely illustrative. There may be any number of communication devices and transit nodes, as desired for the implementation.
Fig. 2 is a schematic diagram illustrating a flow of a congestion control method according to an embodiment of the present invention. An embodiment of the present invention provides a congestion control method, as shown in fig. 2, including:
step 201: and determining the attribute information and/or the data flow rate of the message to be forwarded.
The attribute information of the message to be forwarded is used for representing the message attribute of the message to be forwarded. The attribute information may include: delay sensitivity information, message usage, message version, message length, destination address, etc.
And the data flow rate of the message to be forwarded is the data flow rate of the service to which the message to be forwarded belongs. The service of the message to be forwarded can be determined by at least one of the following attributes of the message to be forwarded: source IP address, destination IP address, protocol number, source port number, destination port number.
Step 202: determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate; wherein, the message types include: rat flow or elephant flow.
There are many ways to determine the packet type of the packet to be forwarded according to the attribute information and/or the data flow rate. For example, if the delay sensitivity information of the packet to be forwarded is greater than the sensitivity threshold, or the data flow rate of the packet to be forwarded is less than the rate threshold, it is determined that the packet type of the packet to be forwarded is the rat flow. And if the data flow rate of the message to be forwarded is greater than or equal to the rate threshold, determining that the message type of the message to be forwarded is the elephant flow. Or if the message purpose of the message to be forwarded is network high-definition video or real-time network conference, determining that the message type of the message to be forwarded is the mouse stream.
Step 203: and performing congestion control on the message to be forwarded according to the message type of the message to be forwarded.
After the message type of the message to be forwarded is identified, congestion control of difference words can be performed on the message to be forwarded according to the message type of the message to be forwarded. For example, when the congestion degree of the network is less than the first congestion degree, only the message to be forwarded with the message type of the elephant flow is discarded. When the congestion degree of the network is larger than a second congestion degree, discarding the message to be forwarded with the message type being the elephant flow according to a first probability, and discarding the message to be forwarded with the message type being the teacher flow according to a second probability, wherein the first probability is larger than the second probability.
In the embodiment of the invention, the message type of the message to be forwarded is determined according to the attribute information and/or the data flow rate of the message to be forwarded, and the message type comprises the following steps: rat or elephant flow; and then according to the message type of the message to be forwarded, performing congestion control on the message to be forwarded. If the network is congested, the elephant flow message with a large data flow rate can be discarded, and mouse flow messages with a small data flow rate or a high delay sensitivity degree do not need to be discarded, so that the network congestion condition can be effectively relieved. And if the elephant flow message is discarded, the mouse flow message is discarded under the condition that the network congestion state is not relieved. Therefore, the problem that congestion control cannot be effectively performed due to indiscriminate discarding of all messages in the prior art can be solved.
Fig. 3 is a schematic diagram of a flow of another congestion control method according to an embodiment of the present invention. An embodiment of the present invention provides a congestion control method, as shown in fig. 3, including:
step 301: and determining the attribute information and/or the data flow rate of the message to be forwarded.
Step 302: and judging whether the time delay sensitivity degree information is larger than the sensitivity degree threshold value.
The sensitivity threshold can be set according to specific requirements and network environments. Judging whether the time delay sensitivity degree information is larger than the sensitivity degree threshold value, if so, executing a step 303; if not, go to step 304.
Step 303: and determining the message type of the message to be forwarded as the mouse flow.
The message to be forwarded with higher delay sensitive information degree can be from data messages of some special applications, such as a message to be forwarded from a real-time network call and a message to be forwarded from a high-definition network conference, because the flow of the data messages is larger, but the delay sensitive degree is higher. If the message type of the message to be forwarded is determined only by the data flow rate, the message is identified as the elephant flow. However, in order to not affect the normal operation of the application with higher delay sensitivity, the message type of the message to be forwarded of the application needs to be determined as the mouse flow.
Step 304: and determining the message type of the message to be forwarded according to the data flow rate.
The message type of the message to be forwarded can be determined based on the following method:
judging whether the data flow rate is greater than a rate threshold value;
if yes, determining the message type of the message to be forwarded as the elephant flow;
if not, determining that the message type of the message to be forwarded is the mouse flow.
The rate threshold may be set according to specific needs and network environment. If the rate threshold is set too large, the congestion condition of the network may not be well alleviated when the network is congested. If the rate threshold is set too small, a larger number of messages to be forwarded may be discarded when the network is congested.
Step 305: and performing congestion control on the message to be forwarded according to the message type of the message to be forwarded.
In the embodiment of the invention, before the message type is determined according to the data flow rate of the message to be forwarded, the message type is determined according to the delay sensitivity information of the message to be forwarded. Therefore, some messages to be forwarded, which have higher data flow rate and higher delay sensitivity, from special applications can be marked as mouse flows, so that the phenomenon that the normal operation of the special applications is influenced because the messages to be forwarded are discarded in a elephant flow discarding mode in the subsequent congestion control process is reduced.
Fig. 4 is a schematic diagram of a flow of a method for determining a data flow rate of a packet to be forwarded according to an embodiment of the present invention. As shown in fig. 4, the method includes:
step 401: determining a corresponding target table entry of a message to be forwarded in a flow matching table; wherein the target table entry comprises at least one of: source IP address, destination IP address, protocol number, source port number, destination port number.
The flow matching table is stored in a storage medium of the transit node. A plurality of entries are stored in the flow matching table, each entry corresponding to one of the following five tuple information: source IP address, destination IP address, protocol number, source port number, destination port number.
And reading quintuple information of the message to be forwarded, matching the extracted quintuple information with each table entry in the flow matching table, and determining a target table entry corresponding to the message to be forwarded according to the matched table entry.
Optionally, determining a target table entry corresponding to the packet to be forwarded in the flow matching table includes:
analyzing the corresponding table entry of the message to be forwarded;
and determining whether a corresponding table entry exists in the flow matching table, if so, determining the existing table entry as a target table entry corresponding to the message to be forwarded, otherwise, adding the corresponding table entry into the flow matching table, and determining the added table entry as the target table entry corresponding to the message to be forwarded.
And if the table entry matched with the message to be forwarded does not exist in the flow matching table, adding the table entry matched with the message to be forwarded in the flow matching table, and determining the added table entry as a target table entry.
Step 402: and updating the byte statistic value corresponding to the target table entry according to the byte number of the message to be forwarded.
The updated byte statistic value of the target table entry is the sum of the original byte statistic value of the target table entry and the byte number of the message to be forwarded. For example, if the original byte statistic of the target table entry is 200 bits, and the byte count of the packet to be forwarded is 100 bits, the byte statistic of the updated target table entry is 300 bits.
Step 403: and determining the data flow rate corresponding to the target table entry according to the difference value of the byte statistic value in the query period.
For example, the query period is 2 seconds, the difference between the byte statistic changes of a certain target entry in the query period is 7200 bits, and the data flow rate corresponding to the target entry is 3600 bits/second.
Step 404: and determining the data flow rate corresponding to the target table entry as the data flow rate corresponding to the message to be forwarded.
Updating the byte statistic value in the target table entry corresponding to the message to be forwarded according to the byte number of the message to be forwarded, and determining the data flow rate corresponding to the message to be forwarded according to the change value of the byte number in the target table entry. The embodiment of the invention provides a method for determining the data flow rate of a message to be forwarded, which is simple and easy to implement.
Optionally, the method further comprises:
for each entry in the flow matching table: and if the change value of the byte statistical value of the table entry is smaller than the preset difference value in the aging period, deleting the table entry.
The aging period can be set according to actual requirements or network conditions. The aging period may be 1 second, 3 seconds, 10 seconds, etc. If the variation value of the byte statistical value of the table entry is smaller than the preset difference value in the aging period, it indicates that no message corresponding to the table entry passes through in a short period, and the table entry is deleted. On one hand, the storage space in the transit node can be saved, and the management cost of the flow matching table is reduced. On the other hand, the aged entries are removed from the flow matching table in time, so that the number of the entries stored in the flow matching table can be reduced, and the speed of searching the target entries of the message to be forwarded in the flow matching table subsequently is increased.
Fig. 5 is an exemplary diagram of a flow learning and flow aging process according to an embodiment of the present invention. The detailed flow learning and flow aging process is shown in the figure, wherein the circle represents the CPU of the switch, and the frame is provided with a flow matching table of the switch chip and other hardware logics. The detailed process is as follows:
step S01: the flow matching table includes a flow matching field and a corresponding matching statistic counter. The flow matching field corresponds to quintuple information. The flow matching table is empty when the chip is started. After the message to be forwarded enters the switch, the flow matching table is queried, and if the target table entry corresponding to the message to be forwarded is not found, the flow specified in step S02 is entered. If the target table entry corresponding to the message to be forwarded is found, the flow specified in step S03 is entered.
Step S02: if the quintuple table entry corresponding to the message to be forwarded is not found in the flow matching table, the message to be forwarded is copied to the CPU by the copy engine of the chip, and then the flow specified in step S06 is executed. A
Step S03: if the packet to be forwarded finds the corresponding quintuple table entry in the flow matching table, the corresponding quintuple table entry is updated by the byte of the packet to be forwarded, and the flow specified in the following step S06 is executed.
Step S04: and the copying engine copies the copied message to be forwarded to the CPU for processing by the CPU.
Step S05: the CPU extracts quintuple information from the message, sends the information to the stream matching table, installs a corresponding data statistic counter for the stream matching table, and counts the corresponding byte number after the subsequent message enters the chip to inquire the stream matching table.
Step S06: and performing other processing on the message to be forwarded, including two-layer and three-layer searching, congestion management, congestion avoidance and the like.
Step S07: the CPU inquires the flow matching table periodically, if the table entry statistic count in the flow matching table in the aging period is not updated, the table entry is deleted by aging, and if the table entry statistic count is updated, the table entry is not processed.
Fig. 6 is a schematic diagram of a flow of another congestion control method according to an embodiment of the present invention. An embodiment of the present invention provides a congestion control method, as shown in fig. 6, including:
step 601: and determining the attribute information and/or the data flow rate of the message to be forwarded.
Step 602: determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate; wherein, the message types include: rat flow or elephant flow.
Step 603: and marking the message to be forwarded with the message type of the elephant flow.
And marking certain bits in the message to be forwarded with the message type of the elephant flow so as to represent that the message type of the message to be forwarded is the elephant flow. For example, a congestion notification field (ECN) is shown in the header of the packet to be forwarded, i.e., the last two bits of the packet header of the packet to be forwarded that distinguish the service field (DS), i.e., the 6 th bit and the 7 th bit, are marked. In the normal state, the values of these two bits are 00, 01, or 10, and the marked 6 th and 7 th bits are 11.
Step 604: determining the congestion degree of the network; and determining the discarding probability of the elephant flow message according to the congestion degree.
The correspondence between the degree of congestion and the drop probability may be pre-stored in the system. Generally, the higher the congestion level, the greater the drop probability; the lower the congestion level, the lower the drop probability.
It should be noted that step 604 may be periodically executed at regular time, and the dropping probability of the elephant flow packet may be adjusted according to the current state of the network, so as to reduce the occurrence of the situation that a large number of packets to be forwarded are continuously dropped under the condition that the network congestion is relieved, or the network does not relieve for a long time, and continues to drop the elephant flow packet with a smaller dropping probability.
Step 605: and discarding the message to be forwarded with the congestion mark according to the discarding probability.
Optionally, the method further comprises:
and if the congestion degree is greater than the preset degree and the discarding probability of the elephant flow message is greater than the preset probability, discarding the message to be forwarded with the type of the mouse flow.
The preset degree and the discarding probability can be set according to actual requirements and network building conditions. For example, under the conditions that the congestion degree is large and the discarding probability of the elephant flow message is greater than 95%, the message to be forwarded with the type of the message being the mouse flow is discarded, so that the network congestion time is reduced, and the larger loss is avoided.
In the embodiment of the invention, according to the congestion degree of the network, the discarding probability of the elephant flow message can be reasonably adjusted so as to reduce the phenomenon that the network is congested for a long time or too many messages to be forwarded are discarded.
Fig. 7 is a schematic structural diagram of a congestion control framework according to an embodiment of the present invention. In fig. 7, the dotted frame portion is a software module operated by the CPU of the switch, and the lower solid frame is the hardware logic of the switch chip. The special flow matching table and the flow matching table are two independent tables, the matching characteristics of the special flow matching table are designated by a user and are used for matching some special flows, and as the flows are very large and sensitive to time delay, once the message is matched with the special flow matching table, the message is not required to be inquired, but is directly marked into a mouse flow and is processed by the congestion control module.
The numbers marked by arrows in fig. 7 correspond to control flows of software and hardware, and details of implementation of congestion control based on message types are described in detail below in conjunction with the control flows. The message types include: elephant flow, rat flow.
Step S11: the message to be forwarded is matched through the exchange chip flow matching logic, the matching condition is that the hardware table entry does not have the table entry corresponding to the message, if the hardware table entry does not match the table entry, the message is copied to the flow learning software module after speed limiting, and the flow learning module analyzes the message. If the matching is achieved, no processing is carried out. The flow learning module refers to the explanation of the embodiment corresponding to fig. 5.
Step S12: the flow learning module analyzes the message from flow matching, analyzes five-tuple information of the message to be forwarded, namely a source IP address, a destination IP address, a protocol number, a source port number and a destination port number, classifies the message based on the five-tuple information, and has the advantages of fine classification granularity, capability of accurately controlling the message, and the defects of consumption of hardware table entries and increase of software query table entry pressure. And classification can be performed only according to the message source IP and the destination IP, so that the method has the advantages of saving hardware table entries and reducing the pressure of software hardware table entries. For how to select the matching items, a proper matching item needs to be selected from the quintuple according to a specific service model. The flow learning module issues the analyzed table items to the chip hardware table through the control flow 2, and then the same message to be forwarded enters the switching chip, because the message to be forwarded exists in the hardware table items, the matching logic cannot copy the message to be forwarded to the flow learning module.
Step S13: the flow learning module registers a table entry for each issued table entry, and a counter is corresponding to each table entry pair. After each message to be forwarded enters the switch, the message to be forwarded is matched with a hardware table issued by the flow learning module, and if the message to be forwarded is matched with a corresponding table entry, the counter counts the byte number of the message to be forwarded into the corresponding table entry for the flow query module to query.
Step S14: the flow inquiry module inquires the items in the hardware table every 1 second to obtain the flow statistic value of each item, and calculates the speed of the message according to the difference between the current statistic and the last statistic.
Step S15: and if the queried table entry finds that the flow does not change in two query periods, the flow is considered to not pass through the switch, and the flow aging module is informed to delete the table entry.
Step S16: and the mouse flow and elephant flow marking module selects the message to be forwarded according with the characteristics of the elephant flow as the elephant flow and the other messages as mouse flows according to the result of the flow query module and the expected set standard for judging the elephant flow. And congestion control marks are only made on the messages to be forwarded of the elephant flow, and random discarding or tail discarding can be carried out on the marked messages to be forwarded when congestion occurs.
Step S17: and the exchange chip stream aging module receives the notice of deleting the hardware table entry, deletes the corresponding table entry, and deletes the counting device corresponding to the table entry at the same time to release resources for the exchange chip. If the exchanger receives the message to be transmitted corresponding to the table item, the learning module adds the table item again.
Step S18: when congestion occurs in the output port queue of the switch, the random discard/tail discard module calculates the corresponding discard probability according to the length of the current queue, and discards the to-be-forwarded blog messages of the elephant flow with the congestion control mark at random. If all the messages to be forwarded of the elephant flow with the marks are discarded and the link congestion condition is still not improved, the messages to be forwarded of the mouse flow are discarded. And if the link is not congested, normally forwarding the message to be forwarded of the elephant flow and the message to be forwarded of the mouse flow.
In the embodiment of the invention, when the port queue of the switching chip is congested, the congestion control algorithm normally forwards the packet to be forwarded of the mouse flow sensitive to time delay according to the self characteristics of the flow, namely, the packet to be forwarded is not discarded. And the message to be forwarded of the elephant flow is randomly discarded or discarded at the tail. When the random discarding probability of the switching chip is one hundred percent or the switching chip is discarded, when the congestion is still not relieved after all the messages to be forwarded of the elephant flow are discarded, the messages to be forwarded of the mouse flow are discarded.
Fig. 8 is a schematic structural diagram of a congestion control apparatus according to an embodiment of the present invention, including:
an information determining module 801, configured to determine attribute information and/or a data flow rate of a packet to be forwarded;
a type determining module 802, configured to determine a packet type of the packet to be forwarded according to the attribute information and/or the data flow rate; wherein, the message types include: rat or elephant flow;
and the congestion control module 803 is configured to perform congestion control on the packet to be forwarded according to the packet type of the packet to be forwarded.
Optionally, the attribute information includes: delay sensitivity degree information;
the type determining module 802 is specifically configured to determine whether the delay sensitivity level information is greater than a sensitivity level threshold;
if so, determining the message type of the message to be forwarded as the mouse flow;
if not, determining the message type of the message to be forwarded according to the data flow rate.
Optionally, the type determining module 802 is specifically configured to determine whether a data stream rate is greater than a rate threshold;
if yes, determining the message type of the message to be forwarded as the elephant flow;
if not, determining that the message type of the message to be forwarded is the mouse flow.
Optionally, the information determining module 801 is specifically configured to determine a target table entry corresponding to the packet to be forwarded in the flow matching table; wherein the target table entry comprises at least one of: a source IP address, a destination IP address, a protocol number, a source port number, a destination port number;
updating a byte statistic value corresponding to the target table entry according to the byte number of the message to be forwarded;
determining the data flow rate corresponding to the target table entry according to the difference value of the byte statistic value in the query period;
and determining the data flow rate corresponding to the target table entry as the data flow rate corresponding to the message to be forwarded.
Optionally, the information determining module 801 is specifically configured to analyze a corresponding entry of the packet to be forwarded;
and determining whether a corresponding table entry exists in the flow matching table, if so, determining the existing table entry as a target table entry corresponding to the message to be forwarded, otherwise, adding the corresponding table entry into the flow matching table, and determining the added table entry as the target table entry corresponding to the message to be forwarded.
Optionally, the apparatus further comprises:
an entry deleting unit 804, configured to, for each entry in the flow matching table: and if the change value of the byte statistical value of the table entry is smaller than the preset difference value in the aging period, deleting the table entry.
Optionally, the congestion control module 803 is configured to discard a to-be-forwarded packet with a packet type of the elephant flow.
Optionally, the congestion control module 803 is specifically configured to determine a congestion degree of the network;
determining the discarding probability of the elephant flow message according to the congestion degree;
and discarding the message to be forwarded with the message type being the elephant flow according to the discarding probability.
Optionally, the congestion control module 803 is specifically configured to discard the to-be-forwarded packet with the packet type of the rat flow if the congestion degree is greater than the preset degree and the discarding probability of the elephant flow packet is greater than the preset probability.
An embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method of any of the embodiments described above.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an information determination module, a type determination unit, and a congestion control module. The names of these modules do not form a limitation on the module itself in some cases, for example, the information determining module may also be described as a "module that determines attribute information and/or data flow rate of a packet to be forwarded".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
determining attribute information and/or data flow rate of a message to be forwarded;
determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate; wherein the message types include: rat or elephant flow;
and performing congestion control on the message to be forwarded according to the message type of the message to be forwarded.
According to the technical scheme of the embodiment of the invention, the message type of the message to be forwarded is determined, and the message type comprises the following steps: rat or elephant flow; and then according to the message type of the message to be forwarded, performing congestion control on the message to be forwarded. When the network is congested, the elephant flow with a high data flow rate can be discarded, and mouse flows with a low data flow rate or a high delay sensitivity degree do not need to be discarded, so that the network congestion condition can be effectively relieved. In another example, the elephant flow may be dropped first, and the rat flow may be dropped again in case the network congestion status is not alleviated. Compared with the congestion control method which discards all messages indiscriminately, the method provided by the embodiment of the invention carries out congestion control according to the message types, and is more reasonable and effective.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (12)
1. A congestion control method, comprising:
determining attribute information and/or data flow rate of a message to be forwarded;
determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate; wherein the message types include: rat or elephant flow;
and performing congestion control on the message to be forwarded according to the message type of the message to be forwarded.
2. The method of claim 1, wherein the attribute information comprises: delay sensitivity degree information;
determining the message type of the message to be forwarded according to the attribute information and/or the data flow rate, wherein the determining comprises the following steps:
judging whether the time delay sensitivity degree information is larger than a sensitivity degree threshold value;
if so, determining that the message type of the message to be forwarded is a mouse flow;
if not, determining the message type of the message to be forwarded according to the data flow rate.
3. The method according to claim 1 or 2, wherein the determining the packet type of the packet to be forwarded according to the data flow rate comprises:
judging whether the data flow rate is greater than a rate threshold value;
if so, determining the message type of the message to be forwarded as the elephant flow;
if not, determining that the message type of the message to be forwarded is the mouse flow.
4. The method of claim 1, wherein the determining the data flow rate of the packet to be forwarded comprises:
determining a corresponding target table entry of a message to be forwarded in a flow matching table; wherein the target table entry comprises at least one of: a source IP address, a destination IP address, a protocol number, a source port number, a destination port number;
updating the byte statistic value corresponding to the target table entry according to the byte number of the message to be forwarded;
determining the data flow rate corresponding to the target table entry according to the difference value of the byte statistic value in the query period;
and determining the data flow rate corresponding to the target table entry as the data flow rate corresponding to the message to be forwarded.
5. The method of claim 4,
the determining of the target table entry corresponding to the message to be forwarded in the flow matching table includes:
analyzing the corresponding table entry of the message to be forwarded;
and determining whether the corresponding table entry exists in the flow matching table, if so, determining the existing table entry as a target table entry corresponding to the message to be forwarded, otherwise, adding the corresponding table entry into the flow matching table, and determining the added table entry as the target table entry corresponding to the message to be forwarded.
6. The method of claim 4, further comprising:
for each entry in the flow matching table: and if the change value of the byte statistical value of the table entry is smaller than a preset difference value in the aging period, deleting the table entry.
7. The method of claim 1,
the performing congestion control on the message to be forwarded according to the message type of the message to be forwarded includes:
and discarding the message to be forwarded with the message type of the elephant flow.
8. The method of claim 7,
the discarding process of the to-be-forwarded message with the message type of the elephant flow comprises the following steps:
determining the congestion degree of the network;
determining the discarding probability of the elephant flow message according to the congestion degree;
and discarding the message to be forwarded with the message type being the elephant flow according to the discarding probability.
9. The method of claim 8, further comprising:
and if the congestion degree is greater than the preset degree and the discarding probability of the elephant flow message is greater than the preset probability, discarding the message to be forwarded, the message type of which is the mouse flow.
10. A congestion control apparatus, comprising:
the information determining module is used for determining the attribute information and/or the data flow rate of the message to be forwarded;
a type determining module, configured to determine a packet type of the packet to be forwarded according to the attribute information and/or the data flow rate; wherein the message types include: rat or elephant flow;
and the congestion control module is used for carrying out congestion control on the message to be forwarded according to the message type of the message to be forwarded.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011360712.6A CN113783794A (en) | 2020-11-27 | 2020-11-27 | Congestion control method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011360712.6A CN113783794A (en) | 2020-11-27 | 2020-11-27 | Congestion control method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113783794A true CN113783794A (en) | 2021-12-10 |
Family
ID=78835234
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011360712.6A Pending CN113783794A (en) | 2020-11-27 | 2020-11-27 | Congestion control method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113783794A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022206187A1 (en) * | 2021-03-29 | 2022-10-06 | 华为技术有限公司 | Packet traffic control method and apparatus, device, and computer-readable storage medium |
CN115801708A (en) * | 2023-02-03 | 2023-03-14 | 中国科学技术大学 | ECN (engineering-simulation-network) waterline self-adaptive configuration method based on reinforcement learning |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140237118A1 (en) * | 2013-02-19 | 2014-08-21 | Broadcom Corporation | Application Aware Elephant Flow Management |
US20190386924A1 (en) * | 2019-07-19 | 2019-12-19 | Intel Corporation | Techniques for congestion management in a network |
CN110808854A (en) * | 2019-10-24 | 2020-02-18 | 新华三信息安全技术有限公司 | Message scheduling method and device and switch |
CN111277467A (en) * | 2020-01-23 | 2020-06-12 | 华为技术有限公司 | Communication device, data stream identification method and related equipment |
CN111385667A (en) * | 2018-12-27 | 2020-07-07 | 中国电信股份有限公司 | Video data processing method, device and computer readable storage medium |
CN111970211A (en) * | 2020-08-13 | 2020-11-20 | 苏州盛科科技有限公司 | Elephant flow processing method and device based on IPFIX |
-
2020
- 2020-11-27 CN CN202011360712.6A patent/CN113783794A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140237118A1 (en) * | 2013-02-19 | 2014-08-21 | Broadcom Corporation | Application Aware Elephant Flow Management |
CN111385667A (en) * | 2018-12-27 | 2020-07-07 | 中国电信股份有限公司 | Video data processing method, device and computer readable storage medium |
US20190386924A1 (en) * | 2019-07-19 | 2019-12-19 | Intel Corporation | Techniques for congestion management in a network |
CN110808854A (en) * | 2019-10-24 | 2020-02-18 | 新华三信息安全技术有限公司 | Message scheduling method and device and switch |
CN111277467A (en) * | 2020-01-23 | 2020-06-12 | 华为技术有限公司 | Communication device, data stream identification method and related equipment |
CN111970211A (en) * | 2020-08-13 | 2020-11-20 | 苏州盛科科技有限公司 | Elephant flow processing method and device based on IPFIX |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022206187A1 (en) * | 2021-03-29 | 2022-10-06 | 华为技术有限公司 | Packet traffic control method and apparatus, device, and computer-readable storage medium |
CN115801708A (en) * | 2023-02-03 | 2023-03-14 | 中国科学技术大学 | ECN (engineering-simulation-network) waterline self-adaptive configuration method based on reinforcement learning |
CN115801708B (en) * | 2023-02-03 | 2023-04-21 | 中国科学技术大学 | ECN waterline self-adaptive configuration method based on reinforcement learning |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109412964B (en) | Message control method and network device | |
US10003544B2 (en) | Method and apparatus for priority flow and congestion control in ethernet network | |
TWI477127B (en) | Computer-implemented method,machine-readable medium and client device for scheduling packet transmission | |
US7782774B2 (en) | TCP optimized single rate policer | |
CN101547159B (en) | Method and device for preventing network congestion | |
US20070226375A1 (en) | Plug-in architecture for a network stack in an operating system | |
KR20070080177A (en) | Apparatus and method of backward congestion notification on network | |
CN113783794A (en) | Congestion control method and device | |
EP3122012B1 (en) | Data processing method and apparatus for openflow network | |
US20220158946A1 (en) | Packet Processing Method and Apparatus | |
CN113765812A (en) | Method and device for marking message | |
CN108243117B (en) | Flow monitoring method and device and electronic equipment | |
WO2016150020A1 (en) | Scheduling flow identifier-based packet scheduling method and device | |
CN116233018A (en) | Message processing method and device, electronic equipment and storage medium | |
CN112104564A (en) | Load sharing method and equipment | |
US7792036B2 (en) | Event processing in rate limited network devices | |
US6754182B1 (en) | Method and apparatus for policing cell-based traffic | |
WO2014201635A1 (en) | Message processing method and base station | |
Tang et al. | TCP-WBQ: a backlog-queue-based congestion control mechanism for heterogeneous wireless networks | |
WO2022152230A1 (en) | Information flow identification method, network chip, and network device | |
JP4276094B2 (en) | Communication apparatus and priority control method for performing priority control of packet | |
Patel et al. | A new active queue management algorithm: Altdrop | |
CN106559351B (en) | Message processing method, SDN controller and network element | |
US20230362099A1 (en) | Managing data traffic congestion in network nodes | |
CN114449046B (en) | Network data processing method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |