CN113055301A - Congestion control method and related equipment - Google Patents

Congestion control method and related equipment Download PDF

Info

Publication number
CN113055301A
CN113055301A CN201911378469.8A CN201911378469A CN113055301A CN 113055301 A CN113055301 A CN 113055301A CN 201911378469 A CN201911378469 A CN 201911378469A CN 113055301 A CN113055301 A CN 113055301A
Authority
CN
China
Prior art keywords
data
switching device
input rate
rate
data stream
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
Application number
CN201911378469.8A
Other languages
Chinese (zh)
Inventor
郑晓龙
管紫轩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201911378469.8A priority Critical patent/CN113055301A/en
Publication of CN113055301A publication Critical patent/CN113055301A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/25Flow control; Congestion control with rate being modified by the source upon detecting a change of network conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports

Abstract

The application discloses a congestion control method and related equipment, and belongs to the technical field of communication. In this application, the destination switching device may allocate an appropriate desired input rate to the data flow by actively monitoring the status information of the egress queue corresponding to the data flow. Thus, the source switching device may monitor the current input rate of the data stream to which the received data packet belongs, and if the current input rate is greater than the expected input rate, the source switching device may actively generate a congestion notification packet and send the congestion notification packet to the sending end to instruct the sending end to perform speed reduction. Therefore, the method can control the queue depth stably in time, reduce the transmission delay of the data message in the outlet queue, and simultaneously enable the input rate and the output rate of the message to reach balance more quickly, namely the convergence rate is higher.

Description

Congestion control method and related equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a congestion control method and a related device.
Background
With the development of mature and high-performance computing chips of high-speed storage media, the requirements of some services on network performance are higher and higher. For example, for services such as distributed storage, high performance computing, Artificial Intelligence (AI) distributed training, etc., a Data Center Network (DCN) is required to provide network performance with high bandwidth and low latency. However, network congestion often occurs while network performance is improved. For example, in the process of communication between the sending end and the receiving end through the switching device, when the rate of sending the message to the switching device by the sending end is too high, that is, for the switching device, when the input rate of the message is greater than the output rate, queue accumulation of the message may occur in the switching device, thereby causing network congestion. Network congestion often causes packet loss or increased transmission delay, and therefore, a congestion control method is urgently needed to alleviate network congestion and improve network performance.
Disclosure of Invention
The application provides a congestion control method and related equipment, which can reduce network congestion and improve network performance.
In a first aspect, a congestion control method is provided. And the destination switching equipment acquires the state information of the outlet queue corresponding to the data stream. Wherein the destination switching device is a switching device connected to the receiving end of the data stream. If the destination switching device determines that the status information of the egress queue satisfies the rate assignment condition, the destination switching device may assign a corresponding desired input rate for the data flow. The expected input rate of the data flow is used for indicating a source switching device corresponding to the data flow to perform congestion control according to the expected input rate, and the source switching device is a switching device connected with a sending end of the data flow.
In this application, the sending end may send the data packet to the receiving end, and the data packet is forwarded to the destination switching device through the source switching device and then forwarded to the receiving end by the destination switching device. A datagram may belong to a data stream, which may include one or more datagrams. When the number of the data packets received by the destination switching device is large, data packet accumulation may occur in the cache of the destination switching device, that is, data packets may accumulate in the egress queue of the destination switching device, and if the data packets accumulated in the egress queue are not controlled in time, network congestion may be caused in this case, so congestion control is required.
Based on the above description, the destination switching device may obtain the status information of the egress queue corresponding to the data flow, that is, the destination switching device may monitor the status information of the egress queue corresponding to the data flow to which the received data packet belongs. Wherein the destination switching device is a switching device connected to the receiving end of the data stream.
Optionally, the destination switching device may obtain a queue depth of an egress queue corresponding to the data flow. In this case, the state information may include a queue depth of the egress queue, where the queue depth refers to a data amount (i.e., a total number of bytes) of the data packet included in the egress queue.
Optionally, the destination switching device may obtain the number of active data flows of the egress queue corresponding to the data flow. In this case, the status information may include the number of active data flows of the egress queue.
In this application, there may be various implementations of the destination switch device obtaining the number of active data flows of the egress queue, and three implementations thereof are described next.
In a first implementation manner, the destination switch device may store a flow identifier of an active data flow of the multiple data flows corresponding to the egress queue. The destination switching device may determine the number of active data flows of the egress queue according to the stored flow identification of the active data flows of the corresponding egress queue.
In this implementation, the destination switching device may store the flow identifiers of the active data flows, may count the number of the flow identifiers of the active data flows, and uses the counted number as the number of the active data flows of the egress queue.
In a second implementation manner, the destination switching device may store a flow table, where entries corresponding to data flows of the egress queue are stored in the flow table, and each entry includes a data flow active identifier. The destination switching device may determine, from the flow table, the number of target entries as the number of active data flows of the egress queue, where the target entries are entries that include data flow active identifiers that are valid.
In this application, each data flow in the egress queue may correspond to one entry, and the entry may include a data flow active identifier, where the data flow active identifier may be valid or invalid. That is, the table entry whose data flow active identifier is valid or invalid may be stored in the flow table, and the destination switching device may count the number of the table entries whose data flow active identifier is valid in the flow table, and use the counted number as the number of the active data flows of the egress queue.
In a third implementation manner, the flow tables stored in the destination switching device may include an active flow table in which entries corresponding to active data flows in the multiple data flows of the egress queue are stored, and an aging flow table in which entries corresponding to aging data flows in the multiple data flows of the egress queue are stored. The destination switching device may determine the number of active data flows of the egress queue according to the number of entries in the active flow table.
Optionally, the destination switching device may obtain a bandwidth utilization rate of an egress queue corresponding to the data flow. In this case, the status information may include bandwidth utilization of the egress queues.
In this application, an outlet of the destination switch device corresponds to a port linear speed bandwidth, and a ratio of a bandwidth occupied by all data packets in the outlet queue to the port linear speed bandwidth of the outlet may be used as a bandwidth utilization rate of the outlet queue. Based on this, the destination switch device may obtain the bandwidth utilization of the egress queue corresponding to the data flow. The port linear speed bandwidth refers to the maximum byte amount that can be handled in a unit time of a corresponding outlet, and can be used for representing the forwarding capability of the corresponding outlet.
Optionally, in this application, the status information may also include any two or three of a queue depth of the egress queue, a number of active data flows of the egress queue, and a bandwidth utilization rate of the egress queue, which is not limited in this application. That is, in the present application, the destination switching device may obtain any one or more of a queue depth of an egress queue corresponding to a data flow, a number of active data flows, and a bandwidth utilization rate.
In this application, after the destination switch device obtains the status information of the egress queue corresponding to the data flow, it may determine whether to allocate a corresponding expected input rate to the data flow by determining whether the status information satisfies a rate allocation condition.
Optionally, when the status information includes a queue depth of the egress queue, the destination switching device determines that the status information satisfies a rate allocation condition, including: if the queue depth is greater than the queue depth threshold, the destination switching device determines that the status information satisfies the rate assignment condition.
In this application, if the queue depth of the egress queue is greater than the queue depth threshold, it indicates that the current destination switching device receives more packets, and needs to allocate a corresponding expected input rate to the data stream again.
Optionally, when the status information includes the number of active data flows of the egress queue, the destination switching device determines that the status information satisfies the rate allocation condition, including: and if the number of the active data flows of the exit queue is different from the number of the active data flows of the exit queue stored when the notification message is generated last time, the destination switching equipment determines that the state information meets the rate allocation condition.
In this application, if the number of active data flows of the egress queue is different from the number of active data flows of the egress queue stored when the notification packet was generated last time. That is, if the number of active data flows of the egress queue changes, which indicates that the number of data flows that are currently and normally transmitted increases or decreases, or due to network congestion, the number of aged data flows increases and the corresponding active data flows decrease, at this time, the destination switching device may reallocate the corresponding expected input rate for the data flow.
The notification message is generated by the destination switching device when the state information meets the rate allocation condition, the notification message carries an expected input rate of the data stream, and the notification message is used for instructing the source switching device to perform congestion control according to the expected input rate carried by the notification message.
Optionally, when the status information includes a bandwidth utilization of the egress queue, the destination switching device determines that the status information satisfies a rate allocation condition, including: if the bandwidth utilization is less than the utilization threshold of the egress queue, the destination switching device determines that the state information satisfies the rate allocation condition.
In this application, if the bandwidth utilization is less than the threshold of the egress queue utilization, indicating that the bandwidth utilization of the current egress queue is low, the destination switch device may re-assign the corresponding expected input rate to the data flow.
Optionally, when the status information acquired by the destination switching device includes any two or three of a queue depth of the egress queue, a number of active data flows of the egress queue, and a bandwidth utilization rate of the egress queue, the destination switching device may determine, according to the foregoing related description, that at least one piece of information in the status information satisfies the corresponding rate allocation condition, that is, it may be determined that the status information satisfies the rate allocation condition. That is, in the present application, the three cases of determining whether the state information satisfies the rate assignment condition may be used individually or in combination.
Optionally, a flow table is stored in the destination switching device, and entries corresponding to the data flows of the egress queue are stored in the flow table; the method further comprises the following steps: and the target switching equipment receives the data message of the data flow, and if the table entry corresponding to the data flow exists in the flow table, the target switching equipment executes the step of acquiring the state information of the outlet queue corresponding to the data flow.
Optionally, a flow table is stored in the destination switching device, and entries corresponding to the data flows of the egress queue are stored in the flow table; the method further comprises the following steps: the target exchange equipment receives the data message of the data stream; and if the table entry corresponding to the data flow does not exist in the flow table, the target switching equipment creates the table entry corresponding to the data flow in the flow table and executes the step of acquiring the state information of the exit queue corresponding to the data flow.
In this application, after the destination switching device determines that the status information satisfies the rate assignment condition, the destination switching device may assign a corresponding desired input rate to the data stream. The expected input rate of the data flow is used for indicating the source switching equipment corresponding to the data flow to perform congestion control according to the expected input rate, and the source switching equipment is the switching equipment connected with the sending end of the data flow.
In the present application, the destination switching device may allocate a corresponding desired input rate for the data stream according to a bandwidth allocation algorithm. The bandwidth allocation algorithm can be realized in various ways, and a suitable bandwidth allocation algorithm can be selected according to actual conditions.
Optionally, when the destination switching device and the source switching device are the same switching device, the method further includes: the destination switching device records the desired input rate of the data stream.
Optionally, when the destination switching device and the source switching device are different switching devices, the method further includes: the destination switching equipment sends a notification message to the source switching equipment, the notification message carries the expected input rate of the data stream, and the notification message is used for indicating the source switching equipment to carry out congestion control according to the expected input rate carried by the notification message.
In a second aspect, a congestion control method is provided. And the source switching equipment receives the data message, wherein the source switching equipment is the switching equipment connected with the sending end of the data message. The source switching device may then determine a current input rate of the data stream to which the data packets belong, and determine an expected input rate of the data stream to which the data packets belong from the stored expected input rates of the plurality of data streams. And if the current input rate of the data stream to which the data message belongs is greater than the expected input rate of the data stream to which the data message belongs, the source switching equipment generates a congestion notification message and sends the congestion notification message to the sending end. That is, in the present scheme, the source switching device may actively generate the congestion notification packet, and perform congestion control in time.
Optionally, the source switching device receives a notification packet carrying the expected input rate, where the expected input rate carried by the notification packet corresponds to the first data stream. If the plurality of data streams comprise the first data stream, the source switching equipment updates the stored expected input rate of the first data stream into the expected input rate carried in the notification message; if the first data stream is not included in the plurality of data streams, the source switching device stores the desired input rate for the first data stream.
It should be noted that a source Internet Protocol (IP) address carried in the notification packet generated by the destination switching device is an IP address of the receiving end, and the destination IP address is an IP address of the transmitting end. When the notification message is transmitted to the source switching device, the source switching device may intercept the notification message, that is, although the destination IP address carried by the notification message is the IP address of the transmitting end, the notification message is only transmitted to the source switching device, and is not transmitted to the transmitting end. That is, the notification message generated by the destination switching device is only finally sent to the source switching device in the process of sending the notification message to the sending end.
As can be seen from the foregoing, the notification packet sent by the destination switching device is transmitted to the source switching device, and the source switching device may receive and analyze the notification packet carrying the expected input rate, and obtain the expected input rate carried by the notification packet and the stream identifier of the corresponding data stream.
In the present application, the source switching device may receive one or more notification messages sent by one or more destination switching devices, where one notification message carries an expected input rate of a data stream. Based on this, when the source switching device receives a notification packet, the source switching device may store the expected input rate obtained by analyzing the notification packet and the flow identifier of the corresponding data flow. In this way, the source switching device may have stored thereon desired input rates for a plurality of data streams.
It should be noted that the expected input rate carried by the notification packet corresponds to the first data flow. That is, the first data stream is a data stream corresponding to the expected input rate carried in the notification packet received by the source switching device.
In addition to the congestion control method described above, in the present application, the destination switch device may also monitor the queue depth of the egress queue, and if the queue depth exceeds a certain threshold (for example, a congestion waterline, or referred to as an ECN waterline), the destination switch device may mark the packets in the egress queue with a certain probability according to an Explicit Congestion Notification (ECN) marking mechanism, and send the packets with ECN marks to the receiving end. When receiving the message with the ECN mark, the receiving end can generate a congestion notification message and send the congestion notification message to the corresponding sending end.
That is, the source switching device receives the congestion notification message, where the congestion notification message is used to instruct the source switching device to perform congestion control on the second data flow. The source switching device determines a current input rate for the second data stream and determines a desired input rate for the second data stream from the desired input rates for the plurality of data streams. And if the current input rate of the second data flow is greater than the expected input rate of the second data flow, the source switching equipment sends the congestion notification message to the sending end of the second data flow.
It should be noted that the destination IP address carried in the congestion notification packet generated by the receiving end is the IP address of the transmitting end. In the process of sending the congestion notification message generated by the receiving end to the sending end, when the congestion notification message is transmitted to the source switching device connected with the sending end, the source switching device can analyze and identify the congestion notification message, and determine whether to forward the congestion notification message to the sending end according to the expected input rate of a plurality of data streams stored by the source switching device. That is, the source switching device may receive a congestion notification message, where the congestion notification message is used to instruct the source switching device to perform congestion control on the second data flow.
Optionally, after determining the desired input rate of the second data stream from the desired input rates of the multiple data streams, the source switching device further includes: and if the current input rate of the second data flow is not greater than the expected input rate of the second data flow, the source switching equipment discards the congestion notification message.
In the above-described congestion control method, on one hand, the destination switching device may monitor the status information of the egress queue to allocate an appropriate expected input rate to each data stream, and the source switching device may determine whether to generate a congestion notification message according to the expected input rate to instruct the sending end to perform speed reduction. On the other hand, the destination switching device may also monitor the queue depth of the egress queue to mark the packet in the queue, so as to instruct the receiving end to generate the congestion notification packet, and the source switching device determines whether to forward the congestion notification packet to the sending end according to the expected input rate after receiving the congestion notification packet. That is, the destination switching device may combine the congestion control methods of the two aspects to more efficiently implement congestion control.
In a third aspect, a congestion control device is provided, where the congestion control device has a function of implementing the congestion control method in the first aspect and/or the second aspect. The congestion control apparatus includes at least one module, where the at least one module is configured to implement the congestion control method provided in the first aspect and/or the second aspect.
In a fourth aspect, a network device is provided, which includes a processor and a memory, where the memory is used to store a program for executing the congestion control method provided in the first aspect and/or the second aspect, and to store data involved in implementing the congestion control method provided in the first aspect and/or the second aspect. The processor is configured to execute programs stored in the memory. The network device may further comprise a communication bus for establishing a connection between the processor and the memory.
In a fifth aspect, a computer-readable storage medium is provided, in which a computer program is stored, which, when executed by a processor, causes a computer to perform the congestion control method of the first and/or second aspect.
A sixth aspect provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the congestion control method of the first and/or second aspect.
The technical effects obtained by the third, fourth, fifth and sixth aspects are similar to the technical effects obtained by the corresponding technical means in the first and/or second aspect, and are not described herein again.
The technical scheme provided by the application can at least bring the following beneficial effects:
in this application, the destination switching device may allocate an appropriate desired input rate to the data flow by actively monitoring the status information of the egress queue corresponding to the data flow. Thus, the source switching device may monitor the current input rate of the data stream to which the received data packet belongs, and if the current input rate is greater than the expected input rate, the source switching device may actively generate a congestion notification packet and send the congestion notification packet to the sending end to instruct the sending end to perform speed reduction. Therefore, the scheme can control the queue depth in time, reduce the transmission delay of the data message in the outlet queue, simultaneously enable the input rate and the output rate of the message to be balanced more quickly, and improve the convergence speed.
Drawings
Fig. 1 is a system architecture diagram according to a congestion control method provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 3 is a flowchart of a congestion control method provided in an embodiment of the present application;
fig. 4 is a flowchart of another congestion control method provided in an embodiment of the present application;
fig. 5 is a flowchart of another congestion control method provided in an embodiment of the present application;
fig. 6 is a flowchart of another congestion control method provided in an embodiment of the present application;
fig. 7 is a flowchart of another congestion control method provided in an embodiment of the present application;
fig. 8 is a flowchart of another congestion control method provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a congestion control apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of another congestion control device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a network architecture according to an embodiment of the present application. Referring to fig. 1, the network architecture includes one or more computer devices 101, a plurality of switching devices 102, and a plurality of intermediate devices 103. A communication connection is established between one computer device 101 and one switching device 102 and between each switching device 102 and each intermediate device 103. Optionally, in order to improve the communication reliability between the computer device 101 and the switching device 102, one computer device 101 may also establish a communication connection with two or more switching devices 102, and at this time, the two or more switching devices 102 may be backup nodes for each other. The computer device 101 may be a server, a firewall, a load balancer, or the like, and the server may be a virtual machine or a bare machine, that is, a machine that does not include an operating system. Illustratively, when the network architecture is a spine-leaf structure, the switch device 102 may be a leaf node, and the intermediate device 103 may be a spine node.
In general, the communication mode of any two computer devices 101 through the network architecture is as follows: the first computer device sends a data message to the first switching device. After receiving the data packet, the first switching device may encapsulate the data packet, and then send the encapsulated data packet to an intermediate device 103, where the intermediate device 103 may pass the received data packet through to the second switching device. After receiving the data packet sent by the intermediate device 103, the second switch device may decapsulate the received data packet, and then send the decapsulated data packet to the second computer device, thereby implementing communication between the two computer devices. The first switching device may be a switching device that establishes a communication connection with the first computer device, and the second switching device may be a switching device that establishes a communication connection with the second computer device. When the first computer device serves as a sending end and the second computer device serves as a receiving end, the first switching device may be referred to as a source switching device, and the second switching device may be referred to as a destination switching device. That is, the source switching device is a first-hop switching device with respect to the transmitting end, and the destination switching device is a first-hop switching device with respect to the receiving end.
Optionally, in this embodiment of the present application, the network architecture may not include the intermediate device 103, in which case, the two switching devices 102 may directly perform communication therebetween.
It should be noted that, in the embodiment of the present application, the source switch device and the destination switch device may be the same switch device or different switch devices. When a network congestion situation may occur during a communication process between a sending end and a receiving end through a source switching device and a destination switching device, the network congestion may be reduced according to the congestion control method provided by the embodiment of the present application, so as to improve network performance. The congestion control method provided by the embodiment of the present application will be explained in detail below.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a network device according to an embodiment of the present application, where the network device may be the switching device 102 shown in fig. 1. The network device may include at least one processor 201, a communication bus 202, a memory 203, and at least one communication interface 204.
The processor 201 may be a microprocessor (including a Central Processing Unit (CPU), etc.), a Network Processor (NP), or may be one or more integrated circuits (ASICs), Programmable Logic Devices (PLDs), or a combination thereof, for implementing the present invention. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
A communication bus 202 is used to transfer information between the above components. The communication bus 202 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The memory 203 may be, but is not limited to, a read-only memory (ROM), a Random Access Memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disk (including a CD-ROM), a compact disk, a laser disk, a digital versatile disk, a blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 203 may be separate and coupled to the processor 201 via the communication bus 202. The memory 203 may also be integrated with the processor 201.
The communication interface 204 uses any transceiver or the like for communicating with other devices or communication networks. The communication interface 204 includes a wired communication interface, and may also include a wireless communication interface. The wired communication interface may be an ethernet interface, for example. The ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface may be a Wireless Local Area Network (WLAN) interface, a cellular network communication interface, or a combination thereof.
In some embodiments, the network device may include multiple processors, such as processor 201 and processor 205 shown in fig. 2. Each of these processors may be a single core processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In some embodiments, the memory 203 is used to store program code 210 for performing aspects of the present application, and the processor 201 may execute the program code 210 stored in the memory 203. The program code 210 may include one or more software modules, for example, when the network device is a destination switching device, the program code 210 may include a status information obtaining module configured to obtain status information of an egress queue corresponding to a data flow, and a rate allocating module configured to allocate a corresponding expected input rate to the data flow when it is determined that the status information of the egress queue satisfies a rate allocation condition. When the network device is a source switching device, the program code 210 may include a current rate determining module, an expected rate determining module, and a message generating module, where the current rate determining module is configured to determine a current input rate of a data flow to which a received data message belongs, the expected rate determining module is configured to determine an expected input rate of the data flow to which the data message belongs from stored expected input rates of multiple data flows, and the message generating module is configured to generate a congestion notification message when it is determined that the current input rate of the data flow to which the data message belongs is greater than the expected input rate of the data flow to which the data message belongs.
That is, the network device may implement the congestion control method provided in the embodiments of fig. 3 to 8 below through the processor 201 and the program code 210 in the memory 203.
Since the destination switch device and the source switch device in the embodiments of the present application may be the same switch device or different switch devices, based on this, the congestion control method provided in the embodiments of the present application will be described in detail by dividing into two embodiments.
Fig. 3 is a flowchart of a congestion control method according to an embodiment of the present application. In this embodiment, the destination switching device and the source switching device are different switching devices. Referring to FIG. 3, the method includes steps 301-306.
Step 301: and the destination switching equipment acquires the state information of the outlet queue corresponding to the data stream.
In this embodiment, the sending end may send the data packet to the receiving end, and the data packet is forwarded to the destination switching device through the source switching device and then forwarded to the receiving end by the destination switching device. A datagram may belong to a data stream, which may include one or more datagrams. When the number of the data packets received by the destination switching device is large, data packet accumulation may occur in the cache of the destination switching device, that is, data packets may accumulate in the egress queue of the destination switching device, and if the data packets accumulated in the egress queue are not controlled in time, network congestion may be caused, so congestion control is required.
It should be noted that, in the embodiment of the present application, data flows may be defined according to a quintuple, a duplet, and the like, where the quintuple may include a source port number, a destination port number, a protocol number, a source IP address, and a destination IP address, and data packets carrying the same quintuple belong to the same data flow. The binary group may include a source IP address and a destination IP address, and data packet data carrying the same binary group belong to the same data stream.
Based on the above description, the destination switching device may obtain the status information of the egress queue corresponding to the data flow, that is, the destination switching device may monitor the status information of the egress queue corresponding to the data flow to which the received data packet belongs. Wherein the destination switching device is a switching device connected to the receiving end of the data stream.
In this embodiment of the present application, the destination switching device may obtain the status information of the egress queue corresponding to the data flow in three cases.
In the first case, the destination switch device may obtain the queue depth of the egress queue corresponding to the data flow. That is, in this case, the state information may include a queue depth of the egress queue, where the queue depth refers to a data amount (i.e., a total number of bytes) of the data packet included in the egress queue.
In the second case, the destination switching device may obtain the number of active data flows of the egress queue corresponding to the data flow. That is, in this case, the status information may include the number of active data flows of the egress queue.
In the embodiment of the present application, one data stream may correspond to one aging period and an effective time, and the maximum value of the effective time is equal to the aging period. In the aging period, the effective time of the corresponding data stream is greater than 0, which indicates that the data stream is an active data stream. If the destination switch device does not receive the data packet belonging to the data flow in the aging period, the effective time is gradually reduced to 0, that is, the data flow is gradually changed into an aging data flow. If the destination switch device receives the data packet belonging to the data flow in the aging period, that is, before the effective time is reduced to 0, the destination switch device receives the data packet belonging to the data flow, and can update the effective time of the data flow to the maximum value and restart timing. In this case, the target switch device may obtain the status information of the egress queue corresponding to the data flow, that is, the number of active data flows of the egress queue may be obtained in a variety of ways, and three ways of obtaining the status information of the egress queue are described next.
In a first implementation manner, the destination switch device may store a flow identifier of an active data flow of the multiple data flows corresponding to the egress queue. The destination switching device may determine the number of active data flows of the egress queue according to the stored flow identification of the active data flows of the corresponding egress queue.
In an embodiment of the present application, the destination switching device may store a flow identification of an active data flow of the plurality of data flows of the egress queue. The stream id may be a five-tuple, a two-tuple, etc. as described above. When a data packet is received, the destination switching device may parse the data packet to obtain a flow identifier of a data flow to which the data packet belongs. If the flow identifier of the data flow to which the data packet belongs exists in the flow identifiers of the active data flows stored by the destination switching device, the effective time of the data flow can be updated to the maximum value. If the stream identifier of the data stream to which the data packet belongs does not exist in the stream identifiers of the active data streams stored by the destination switching device, the stream identifier of the data stream may be stored to indicate that the data stream is an active data stream, and the effective time of the data stream is the maximum value at this time. When the effective time of an active data flow is reduced to 0, the data flow becomes an aging data flow, and the destination switching device may delete the stored flow identification of the active data flow.
In this implementation, the destination switching device may store the flow identifiers of the active data flows, may count the number of the flow identifiers of the active data flows, and uses the counted number as the number of the active data flows of the egress queue.
In a second implementation manner, the destination switching device may store a flow table, where entries corresponding to data flows of the egress queue are stored in the flow table, and each entry includes a data flow active identifier. The destination switching device may determine, from the flow table, the number of target entries as the number of active data flows of the egress queue, where the target entries are entries that include data flow active identifiers that are valid.
Based on the foregoing description about active data flows and aged data flows, in this embodiment of the application, each data flow in the egress queue may correspond to one entry, and a data flow active identifier may be included in the entry, and the data flow active identifier may be valid or invalid. That is, the table entry whose data flow active identifier is valid or invalid may be stored in the flow table, and the destination switching device may count the number of the table entries whose data flow active identifier is valid in the flow table, and use the counted number as the number of the active data flows of the egress queue.
It should be noted that, the destination switching device may indicate whether the data stream active flag is valid or not by a number, for example, 1 may indicate valid, and 0 may indicate invalid. Of course, other ways may also be used to indicate whether the data flow active flag is valid, which is not limited in this embodiment of the present application.
In a third implementation manner, the flow tables stored in the destination switching device may include an active flow table in which entries corresponding to active data flows in the multiple data flows of the egress queue are stored, and an aging flow table in which entries corresponding to aging data flows in the multiple data flows of the egress queue are stored. The destination switching device may determine the number of active data flows of the egress queue according to the number of entries in the active flow table.
In this embodiment of the present application, the destination switching device may detect whether the data flow corresponding to the entry in the active flow table is aged, and if the data flow is aged, may move the entry corresponding to the aged data flow in the active flow table to the aged flow table. In addition, if the data packet received by the destination switching device matches one entry in the aging flow table, at this time, the entry corresponding to the data flow in the aging flow table may be moved to the active flow table. That is, the entries corresponding to the data flows are maintained by updating the active flow table and the aging flow table. Based on this, the destination switching device may count the number of entries in the active flow table, and use the counted number as the number of active data flows of the egress queue.
In a third case, the destination switch device may obtain a bandwidth utilization of an egress queue corresponding to the data flow. That is, in this case, the status information may include bandwidth utilization of the egress queues.
In this embodiment, an outlet of the destination switch device corresponds to a port linear speed bandwidth, and a ratio of a bandwidth occupied by all data packets in the outlet queue to the port linear speed bandwidth of the outlet may be used as a bandwidth utilization rate of the outlet queue. Based on this, the destination switch device may obtain the bandwidth utilization of the egress queue corresponding to the data flow. The port linear speed bandwidth refers to the maximum byte amount that can be handled in a unit time of a corresponding outlet, and can be used for representing the forwarding capability of the corresponding outlet.
Optionally, in addition to the three cases described above, in this embodiment of the present application, the status information may also include any two or three of a queue depth of the egress queue, a number of active data flows of the egress queue, and a bandwidth utilization rate of the egress queue, which is not limited in this embodiment of the present application. That is, in this embodiment of the present application, the destination switching device may obtain any one or more of a queue depth of an egress queue corresponding to a data flow, a number of active data flows, and a bandwidth utilization rate.
It should be noted that, in this embodiment of the present application, the destination switching device may receive the data packet of the data flow, and after receiving the data packet of the data flow, perform the step of obtaining the status information of the egress queue corresponding to the data flow. That is, the step of acquiring the state information of the egress queue corresponding to the data flow is performed by using the data packet received from the data flow as a trigger condition. Or, the destination switching device may also periodically traverse each of its own outlets to obtain status information of each of the outlet queues.
In this embodiment of the present application, a flow table may be stored in the destination switching device, and entries corresponding to each data flow of the egress queue are stored in the flow table, so that when the destination switching device receives a data packet of the data flow, the flow table may be queried, and whether an entry corresponding to the data flow exists in the flow table is determined, so as to maintain the flow table. If the table entry corresponding to the data flow exists in the flow table, the destination switching device may perform a step of obtaining status information of an egress queue corresponding to the data flow. If the entry corresponding to the data flow does not exist in the flow table, the destination switching device may create the entry corresponding to the data flow in the flow table, and then perform the step of obtaining the state information of the egress queue corresponding to the data flow.
Optionally, each entry stored in the flow table may include a flow identifier of the data flow, and when receiving the data packet, the destination switching device may analyze the data packet to obtain the flow identifier of the data flow to which the data packet belongs, and determine whether the flow table has the entry corresponding to the data flow to which the corresponding data packet belongs according to the flow identifier.
It should be noted that, as can be seen from the foregoing description, the flow table may include one table, or may include two tables, that is, the active flow table and the aged flow table may also be included, and the implementation manner of the destination switching device maintaining the flow table may refer to the foregoing related description.
Step 302: if the destination switching device determines that the status information satisfies the rate assignment condition, the destination switching device assigns a corresponding desired input rate to the data stream.
In this embodiment of the present application, after the destination switching device obtains the status information of the egress queue corresponding to the data flow, it may determine whether to allocate a corresponding expected input rate to the data flow by determining whether the status information satisfies a rate allocation condition. As can be seen from the foregoing, the status information acquired by the destination switching device may have a plurality of cases, and based on this, the destination switching device determines whether the status information satisfies the rate allocation condition, which will be described in detail below.
In the first case, when the status information includes a queue depth of the egress queue, the destination switching device may determine that the status information satisfies the rate assignment condition if the queue depth is greater than a queue depth threshold.
In this embodiment of the present application, if the queue depth of the egress queue is greater than the queue depth threshold, it indicates that the current destination switching device receives more packets, and needs to allocate a corresponding expected input rate to the data stream again. The queue depth threshold may be a parameter configured for the destination switching device in advance.
In the second case, when the status information includes the number of active data flows of the egress queue, if the number of active data flows of the egress queue is different from the number of active data flows of the egress queue stored in the last generation of the notification packet, the destination switching device may determine that the status information satisfies the rate assignment condition.
In this embodiment of the present application, if the number of active data flows of the egress queue is different from the number of active data flows of the egress queue stored in the last time of generating the notification packet. That is, if the number of active data flows of the egress queue changes, which indicates that the number of data flows that are currently and normally transmitted increases or decreases, or due to network congestion, the number of aged data flows increases and the corresponding active data flows decrease, at this time, the destination switching device may reallocate the corresponding expected input rate for the data flow.
The notification message is generated by the destination switching device when the state information meets the rate allocation condition, the notification message carries an expected input rate of the data stream, and the notification message is used for instructing the source switching device to perform congestion control according to the expected input rate carried by the notification message.
In a third case, the status information includes a bandwidth utilization of the egress queue, and the destination switching device may determine that the status information satisfies the rate allocation condition if the bandwidth utilization is less than a threshold utilization of the egress queue.
In this embodiment, if the bandwidth utilization is less than the threshold of the egress queue utilization, indicating that the bandwidth utilization of the current egress queue is low, the destination switch device may reallocate the corresponding expected input rate for the data flow. The utilization threshold may be a parameter configured for the destination switching device in advance.
Optionally, when the status information acquired by the destination switching device includes any two or three of a queue depth of the egress queue, a number of active data flows of the egress queue, and a bandwidth utilization rate of the egress queue, the destination switching device may determine, according to the foregoing related description, that at least one piece of information in the status information satisfies the corresponding rate allocation condition, that is, it may be determined that the status information satisfies the rate allocation condition. That is, in the embodiment of the present application, the three cases of determining whether the state information satisfies the rate assignment condition may be used alone or in combination.
For example, when the status information acquired by the destination switching device includes a queue depth of the egress queue, a number of active data flows of the egress queue, and a bandwidth utilization rate of the egress queue, if the queue depth is greater than a queue depth threshold, the number of active data flows is unchanged, and the bandwidth utilization rate is less than a utilization rate threshold, the destination switching device may determine that the current status information satisfies a rate allocation condition.
In this embodiment, after the destination switching device determines that the status information satisfies the rate assignment condition, the destination switching device may assign a corresponding desired input rate to the data stream. The expected input rate of the data flow is used for indicating the source switching equipment corresponding to the data flow to perform congestion control according to the expected input rate, and the source switching equipment is the switching equipment connected with the sending end of the data flow.
In this embodiment, the destination switching device may allocate a corresponding desired input rate for the data stream according to a bandwidth allocation algorithm. The bandwidth allocation algorithm can be realized in various ways, and a suitable bandwidth allocation algorithm can be selected according to actual conditions.
In a possible implementation manner, the destination switching device may obtain a port linear speed bandwidth corresponding to the egress queue, a bandwidth utilization rate of the egress queue, a total byte amount (queue depth) of a packet queued in the egress queue, a number of active data streams of the egress queue, and a static baseline round-trip transmission delay of the network, and determine an expected input rate according to formula (1).
TRate=[C+C(1-η)-λ(qLenB/RTT)]/N (1)
Where C is port linear speed bandwidth (also referred to as port linear speed rate), η is bandwidth utilization rate, qLenB is total byte amount of packets queued in the egress queue, the unit may be bit, N is number of active data streams, RTT is static baseline round trip transmission delay of the network, and λ is a preset weight coefficient.
It should be noted that the port linear speed bandwidth and the weighting factor may be configuration parameters of the destination switching device, and the static baseline round trip transmission delay of the network may be parameters of the network where the destination switching device is located. As can be seen from equation (1), the destination switching device can equally allocate bandwidth for the active data streams.
In other possible implementations, the destination switching device may further allocate a higher expected input rate to the data flow with the higher priority and allocate a lower expected input rate to the data flow with the lower priority according to the information of the priority of each data flow.
Step 303: the destination switching equipment sends a notification message carrying the expected input rate to the source switching equipment.
In this embodiment of the present application, after the destination switching device allocates the corresponding expected input rate to the data stream, a notification packet may be generated according to the expected input rate, and the notification packet is sent to the source switching device corresponding to the data stream. The notification message carries an expected input rate of the data flow, and the notification message is used for instructing the source switching device to perform congestion control according to the expected input rate carried by the notification message.
It should be noted that the source IP address carried in the notification packet generated by the destination switching device is the IP address of the receiving end, and the destination IP address is the IP address of the sending end. When the notification message is transmitted to the source switching device, the source switching device may intercept the notification message, that is, although the destination IP address carried by the notification message is the IP address of the transmitting end, the notification message is only transmitted to the source switching device, and is not transmitted to the transmitting end. That is, the notification message generated by the destination switching device is only finally sent to the source switching device in the process of sending the notification message to the sending end.
In this embodiment, the notification message may be a message in various forms. In one possible implementation, the notification packet may be an Acknowledgement (ACK) packet including a header, where the header carries the expected input rate of the data flow. In this implementation manner, a header of the notification message may carry a first type identifier, where the first type identifier may be used to identify the corresponding message as the notification message, and when the source switching device receives a message, if the type identifier in the message header is determined to be the first type identifier after parsing the message header included in the message, the source switching device may determine that the message is the notification message.
It should be noted that the first type identifier may be a predefined type identifier.
Optionally, since the sending end may run multiple application processes, each application process communicates with one or more application processes corresponding to the receiving end through the switching device, in this case, the data packet sent by the sending end may further carry a source application process identifier and a destination application process identifier to indicate that the application process corresponding to the sending end communicates with the application process corresponding to the receiving end. Based on this, each entry of the flow table stored in the destination switching device may further store a source application process identifier and a destination application process identifier carried in the corresponding data packet, and the destination switching device may carry the source application process identifier carried in the data packet in the generated notification packet to instruct the corresponding sending end to perform congestion control on the data packet generated by the corresponding source application process, that is, the congestion control of the sending end may be more targeted, so that the congestion control is more effective.
Illustratively, assuming that the notification message is an ACK message including a header, the first type identifier is defined as Opcode ═ 00011111, the length is one byte (i.e. 8 bits), the last consecutive 3 bytes in the header can be used to carry the desired input rate, the unit can be Mbps (megabits per second), and the application process identifier can also be carried by other consecutive 3 bytes. As shown in the header of the notification message in table 1, the first type identifier Opcode is 00011111, which occupies one byte, DQP _1, DQP _2, and DQP _3 may be combined into an application process identifier, and TRate _1, TRate _2, and TRate _3 may be combined into a desired input rate.
TABLE 1
Figure BDA0002341653520000121
In other possible implementation manners, the notification packet may be a packet defined by changing some information on the basis of other existing types of packets, for example, some identifiers or fields in a packet format of a Congestion Notification Packet (CNP) may be changed, and the changed CNP that may carry an expected input rate is used as a notification packet. Or the notification message can also be a message in any self-defined message format and carrying the expected input rate.
Fig. 4 is a flowchart of another congestion control method provided in an embodiment of the present application, and the method is applied to a destination switching device. Referring to fig. 4, when the destination switching device receives a data packet, it may be determined whether an entry corresponding to the data packet belongs to a stored flow table. If the data flow exists, the data flow active identifier of the data flow may be updated to be valid, the valid time of the data flow is updated to be the maximum value, and then the step of obtaining the status information of the egress queue corresponding to the data flow is performed. And if the data stream does not exist, creating an entry corresponding to the data stream in the flow table, and then executing the step of acquiring the state information of the exit queue corresponding to the data stream. The destination switching device may then determine whether the state information satisfies the rate assignment condition, and if the state information does not satisfy the rate assignment condition, no processing is performed. If the state information meets the rate allocation condition, the destination switching device may allocate a corresponding expected input rate to the data stream according to a bandwidth allocation algorithm, and then the destination switching device may generate a notification message carrying the expected input rate and send the notification message to the source switching device.
Step 304: the source switching device receives the notification message carrying the desired input rate.
As can be seen from the foregoing, the notification packet sent by the destination switching device is transmitted to the source switching device, and the source switching device may receive and analyze the notification packet carrying the expected input rate, and obtain the expected input rate carried by the notification packet and the stream identifier of the corresponding data stream.
In this embodiment, the source switching device may receive one or more notification messages sent by one or more destination switching devices, where one notification message carries an expected input rate of a data stream. Based on this, when the source switching device receives a notification packet, the source switching device may store the expected input rate obtained by analyzing the notification packet and the flow identifier of the corresponding data flow. In this way, the source switching device may have stored thereon desired input rates for a plurality of data streams.
It should be noted that the expected input rate carried by the notification packet corresponds to the first data flow. That is, the first data stream is a data stream corresponding to the expected input rate carried in the notification packet received by the source switching device. In addition, the first data stream may be the data stream mentioned in step 301.
Step 305: if the stored plurality of data streams include the first data stream, the source switching device updates the stored expected input rate of the first data stream to the expected input rate carried in the notification message.
After receiving and parsing the notification message, the source switching device may determine whether the first data stream is included in the plurality of data streams according to the stored expected input rates of the plurality of data streams. If the plurality of data streams includes the first data stream, it may be stated that the expected input rate of the first data stream is locally stored, and at this time, the source switching device may update the stored expected input rate of the first data stream to the expected input rate carried in the notification message.
Step 306: the source switching device stores the desired input rate of the first data stream if the first data stream is not included in the stored plurality of data streams.
If the first data stream is not included in the plurality of data streams, it may be indicated that the expected input rate of the first data stream is not locally stored, and at this time, the source switching device may store the expected input rate of the first data stream.
Optionally, in this embodiment of the present application, the source switching device may store the expected input rates of the multiple data flows in a table, and each entry in the table may store the expected input rate and the flow identification of the corresponding data flow.
After storing the desired input rate of the data flow in the source switching device by the above step 301-. That is, after receiving the data packet sent by the sending end, the source switching device may determine whether to actively generate the congestion notification packet according to the expected input rates of the stored multiple data streams, so as to instruct the sending end to perform speed reduction. This will be described next with reference to fig. 5. Fig. 5 is a flowchart of another congestion control method provided in an embodiment of the present application, and the method is applied to a source switching device. Referring to fig. 5, the method includes steps 501 to 505.
Step 501: and the source switching equipment receives the data message, and is the switching equipment connected with the sending end of the data message.
In this embodiment, the source switching device may receive a data packet sent by a sending end connected to the source switching device. The data packet may belong to a data flow. The data stream may be defined according to the quintuple, the dyad, and the like introduced above.
Step 502: the source switching device determines the current input rate of the data stream to which the data packet belongs.
In this embodiment, the source switching device may count the receiving time interval of two adjacent data packets in the data stream to which the data packet belongs, and determine the current input rate of the data stream to which the data packet belongs according to the receiving time interval.
Step 503: the source switching equipment determines the expected input rate of the data stream to which the data message belongs from the stored expected input rates of the plurality of data streams.
In this embodiment, the source switching device stores expected input rates of multiple data flows via the source switching device, and when receiving the data packet, the source switching device may parse the data packet, determine a flow identifier of a data flow to which the data packet belongs, and then may determine an expected input rate of a data flow to which the data packet belongs from the stored expected input rates of the multiple data flows.
It should be noted that, in this embodiment of the application, if the source switching device does not include the expected input rate of the data stream to which the data packet belongs in the expected input rates of the multiple data streams currently stored in the source switching device after receiving the data packet, the source switching device may directly forward the data packet, that is, forward the data packet to the corresponding receiving end. That is, in this case, the source switching device does not need to perform step 504 and step 505 any more.
Step 504: and if the current input rate of the data flow to which the data message belongs is greater than the expected input rate of the data flow to which the data message belongs, the source switching equipment generates a congestion notification message.
In this embodiment, after the source switching device determines the current input rate of the data flow to which the data packet belongs and the expected input rate of the data flow to which the data packet belongs, by comparing the current input rate with the expected input rate, if the current input rate of the data flow to which the data packet belongs is greater than the expected input rate of the data flow to which the data packet belongs, it indicates that a network congestion may occur currently, and at this time, the source switching device may generate a congestion notification packet. That is, in the present scheme, the source switching device may actively generate the congestion notification packet, and perform congestion control in time.
Step 505: and the source switching equipment sends the congestion notification message to the sending end.
In this embodiment, after generating the congestion notification message, the source switching device may send the congestion notification message to the sending end to instruct the sending end to perform corresponding congestion control.
In addition to the congestion control method described above, in this embodiment, the destination switch device may also monitor a queue depth of the egress queue, and if the queue depth exceeds a certain threshold (for example, a congestion waterline, or referred to as an ECN waterline), the destination switch device may mark the packets in the egress queue with a certain probability according to an ECN marking mechanism, and send the packets with the ECN marks to the receiving end. When receiving the message with the ECN mark, the receiving end can generate a congestion notification message and send the congestion notification message to the corresponding sending end.
The congestion notification message may be a CNP.
It should be noted that the destination IP address carried in the congestion notification packet generated by the receiving end is the IP address of the transmitting end. In the process of sending the congestion notification message generated by the receiving end to the sending end, when the congestion notification message is transmitted to the source switching device connected with the sending end, the source switching device can analyze and identify the congestion notification message, and determine whether to forward the congestion notification message to the sending end according to the expected input rate of a plurality of data streams stored by the source switching device. That is, the source switching device may receive a congestion notification message, where the congestion notification message is used to instruct the source switching device to perform congestion control on the second data flow.
In this embodiment, after receiving the congestion notification packet sent by the receiving end, the source switching device may determine a current input rate of the second data stream, and then, the source switching device may determine an expected input rate of the second data stream from the stored expected input rates of the multiple data streams. The source switching device may send the congestion notification message to the sender of the second data stream if the current input rate of the second data stream is greater than the expected input rate of the second data stream. The source switching device may discard the congestion notification message if the current input rate of the second data flow is not greater than the expected input rate of the second data flow.
The source switching device may count a receiving time interval of two adjacent data packets of the second data stream, and determine a current input rate of the second data stream according to the receiving time interval. The second data stream may be the data stream in step 301.
In the above-described congestion control method, on one hand, the destination switching device may monitor the status information of the egress queue to allocate an appropriate expected input rate to each data stream, and the source switching device may determine whether to generate a congestion notification message according to the expected input rate to instruct the sending end to perform speed reduction. On the other hand, the destination switching device may also monitor the queue depth of the egress queue to mark the packet in the queue, so as to instruct the receiving end to generate the congestion notification packet, and the source switching device determines whether to forward the congestion notification packet to the sending end according to the expected input rate after receiving the congestion notification packet. That is, the destination switching device may combine the congestion control methods of the two aspects to more efficiently implement congestion control.
Fig. 6 is a flowchart of another congestion control method provided in an embodiment of the present application, and may be applied to a source switching device. Referring to fig. 6, it is assumed that the header of the notification packet carries the first type identifier. After receiving a message, the source switching device may analyze the message, and determine whether the message is a notification message carrying an expected input rate according to the type identifier in the message header. If the type identifier in the header of the packet is the first type identifier, it may be determined that the packet is a notification packet carrying an expected input rate, otherwise, it may be determined that the packet is not a notification packet carrying an expected input rate.
If the message is a notification message carrying a desired input rate, the source switching device may update or store the desired input rate for the corresponding data flow. If the message is not a notification message carrying the expected input rate, the source switching device may determine whether the message is a congestion notification message.
If the message is a congestion notification message, determining the current input rate of the corresponding data stream, inquiring the corresponding expected input rate, if the corresponding expected input rate is inquired, judging whether the current input rate is greater than the expected input rate, if so, forwarding the congestion notification message to the corresponding sending end, and if not, discarding the congestion notification message. And if the corresponding expected input rate is not inquired, normally forwarding the congestion notification message to the corresponding sending end.
If the packet is not a congestion notification packet, that is, the packet is a data packet, the source switching device may determine a current input rate of a data stream to which the packet belongs, and query an expected input rate of the data stream to which the packet belongs, and if the expected input rate is queried, then determine whether the current input rate is greater than the expected input rate, if so, generate a congestion notification packet and send the congestion notification packet to a corresponding sending end, and if not, forward the packet to a corresponding receiving end normally. If the corresponding expected input rate is not inquired, the source switching equipment also forwards the message to the corresponding receiving end normally.
In this embodiment of the present application, the manner of congestion control performed by the sending end may be: and the speed is reduced once when a congestion notification message is received, and the speed is increased once at regular time intervals or every time a message with a certain byte amount is sent if the sending end does not receive the congestion notification message. It should be noted that, no matter the congestion notification message received by the sending end is generated by the receiving end or generated by the source switching device, the sending end may take the same congestion control measures.
Fig. 7 is a flowchart of another congestion control method provided in the embodiment of the present application, and is applied to a sending end. Referring to fig. 7, if the sender receives a congestion notification message, the T Timer may be reset to 300 microseconds, the byte counter ByteCounter 2MB, T0, BC 0, and a Timer to 50 microseconds, and query the value of the current speed reduction parameter α, and increase the value of the current α by some, for example, α may be (1024 α +5)/1024, that is, a fixed value may be increased, and then perform a speed reduction on the corresponding data stream according to formula (2) and α after the increase.
Rate_new=Rate_old*(1-α/2) (2)
Wherein, Rate _ old represents the current input Rate, Rate _ new represents the input Rate after the speed reduction, and α is the speed reduction parameter.
Then, before receiving the next congestion notification message, the Timer counts down gradually, the ByteCounter gradually counts down according to the byte amount sent by the sending end, when the Timer counts down to 0, that is, the Timer expires, T increases 1 on the original value, and when the ByteCounter counts down to 0, that is, the ByteCounter count exceeds the value, BC increases 1 on the original value. And every time T or BC is changed, judging whether the maximum value of T and BC is smaller than a preset round number F. If the maximum value of T and BC is less than F, the transmitting end can adopt a fast recovery speed increasing mode. And if the maximum value of the T and the BC is not less than F, judging whether the maximum value of the T and the BC is more than a preset round number F. If the maximum value of the T and the BC is larger than the preset round number F, the sending end can adopt a fast increasing speed increasing mode, and if the maximum value of the T and the BC is not larger than the preset round number F, the sending end can adopt an increasing speed increasing mode. Then, the Timer or ByteCounter is reset and the next cycle starts.
Meanwhile, the timer a is also counting down, and when the timer a is counting down to 0, the value of alpha can be reduced by a certain proportion, for example, by 5 per thousand.
The fast recovery acceleration mode may be an exponential mode, which may accelerate the input rate at the fastest speed, and the fast increase acceleration mode may slow the input rate at a slower speed, and the incremental increase acceleration mode may accelerate the input rate at a certain value increase each time, and may slow the input rate at a slower speed.
It should be noted that, the resetting of the Timer, ByteCounter, and a Timer, 300 microseconds, 2MB, and 50 microseconds are only examples, and do not limit the embodiments of the present application. In addition, the preset round number F may be a preset parameter in the transmitting end.
In summary, in the embodiment of the present application, the destination switch device may allocate an appropriate expected input rate to the data flow by actively monitoring the status information of the egress queue corresponding to the data flow. Thus, the source switching device may monitor the current input rate of the data stream to which the received data packet belongs, and if the current input rate is greater than the expected input rate, the source switching device may actively generate a congestion notification packet and send the congestion notification packet to the sending end to instruct the sending end to perform speed reduction. Therefore, the method can control the queue depth stably in time, reduce the transmission delay of the data message in the outlet queue, and simultaneously enable the input rate and the output rate of the message to reach balance more quickly, namely the convergence rate is higher.
Fig. 8 is a flowchart of another congestion control method according to an embodiment of the present application. In this embodiment, the destination switching device and the source switching device are the same switching device, and in this case, the destination switching device and the source switching device may be referred to as a network device. Referring to fig. 8, the method includes the following steps.
Step 801: the network equipment acquires the state information of an exit queue corresponding to the data stream.
Step 802: if the network device determines that the state information satisfies the rate assignment condition, the network device assigns a corresponding expected input rate to the data stream.
It should be noted that, for specific implementation manners of step 801 and step 802, reference may be made to the related implementation manners in step 301 and step 302, which are not described herein again.
Step 803: the network device records the desired input rate of the data stream.
In this embodiment, the network device may record the desired input rate of the data stream after assigning the corresponding desired input rate to the data stream. It should be noted that the network device stores the expected input rates of the multiple data streams via the network device, and if the data streams are included in the multiple data streams, the network device may update the stored expected input rates of the data streams to the newly determined expected input rates, and if the data streams are not included in the multiple data streams, the network device may store the expected input rates of the data streams.
The network device may store the expected input rates of the respective data flows in a table, and each entry may store the expected input rate and the flow identification of the corresponding data flow.
Step 804: the network device receives the data message.
Step 805: the network device determines a current input rate of a data stream to which the data packet belongs, and determines an expected input rate of the data stream to which the data packet belongs from the stored expected input rates of the plurality of data streams.
Step 806: and if the current input rate of the data flow to which the data message belongs is greater than the expected input rate of the data flow to which the data message belongs, the network equipment generates a congestion notification message.
Step 807: and the network equipment sends the congestion notification message to a sending end.
It should be noted that, the specific implementation manner of the step 804-807 can refer to the related implementation manner of the step 501-505, which is not described herein again.
In summary, in the embodiment of the present application, the network device may allocate an appropriate expected input rate to the data flow by actively monitoring the status information of the egress queue corresponding to the data flow. Then, the network device may monitor the current input rate of the data stream to which the received data packet belongs, and if the current input rate is greater than the expected input rate, the network device may actively generate a congestion notification packet and send the congestion notification packet to the sending end to instruct the sending end to perform speed reduction. Therefore, the method can control the queue depth stably in time, reduce the transmission delay of the data message in the outlet queue, and simultaneously enable the input rate and the output rate of the message to reach balance more quickly, namely the convergence rate is higher.
Fig. 9 is a schematic structural diagram of a congestion control apparatus provided in an embodiment of the present application, where the congestion control apparatus 900 may be implemented by software, hardware, or a combination of the two to be part or all of a network device, where the network device may be the switching device shown in fig. 1, and the apparatus 900 is applied to a destination switching device. Referring to fig. 9, the apparatus 900 includes: a status information acquisition module 901 and a rate assignment module 902.
A status information obtaining module 901, configured to obtain status information of an egress queue corresponding to a data stream, where a destination switching device is a switching device connected to a receiving end of the data stream;
a rate allocating module 902, configured to allocate a corresponding expected input rate to the data stream if it is determined that the state information satisfies a rate allocating condition, where the expected input rate of the data stream is used to indicate a source switching device corresponding to the data stream to perform congestion control according to the expected input rate, and the source switching device is a switching device connected to a sending end of the data stream.
Optionally, when the destination switch device and the source switch device are the same switch device, the apparatus 900 further includes:
a recording module for recording a desired input rate of the data stream.
Optionally, when the destination switching device and the source switching device are different switching devices, the apparatus 900 further includes:
and the sending module is used for sending a notification message to the source switching equipment, wherein the notification message carries the expected input rate of the data stream, and the notification message is used for indicating the source switching equipment to carry out congestion control according to the expected input rate carried by the notification message.
Optionally, the status information includes a queue depth of the egress queue, and the rate assignment module 902 is configured to determine that the status information satisfies the rate assignment condition if the queue depth is greater than a queue depth threshold.
Optionally, the status information includes the number of active data flows of the egress queue, and the rate allocating module 902 is configured to determine that the status information satisfies the rate allocating condition if the number of active data flows of the egress queue is different from the number of active data flows of the egress queue stored when the notification packet was generated last time.
Optionally, the status information includes a bandwidth utilization of the egress queue, and the rate allocation module 902 is configured to determine that the status information satisfies the rate allocation condition if the bandwidth utilization is less than a threshold utilization of the egress queue.
Optionally, a flow table is stored in the destination switching device, and entries corresponding to the data flows of the egress queue are stored in the flow table;
the apparatus 900 further comprises:
the receiving module is used for receiving a data message of the data stream;
the trigger module is used for triggering the state information acquisition module to acquire the state information of the exit queue corresponding to the data flow if the table entry corresponding to the data flow exists in the flow table;
and the creating module is used for creating the table entry corresponding to the data flow in the flow table if the table entry corresponding to the data flow does not exist in the flow table, and triggering the state information acquiring module to acquire the state information of the exit queue corresponding to the data flow.
Fig. 10 is a schematic structural diagram of another congestion control apparatus provided in this embodiment of the present application, where the congestion control apparatus 1000 may be implemented by software, hardware, or a combination of the two to be part or all of a network device, where the network device may be the switching device shown in fig. 1, and the apparatus 1000 is applied to a source switching device. Referring to fig. 10, the apparatus 1000 includes: a first receiving module 1001, a current rate determining module 1002, a desired rate determining module 1003, a message generating module 1004, and a first sending module 1005.
A first receiving module 1001, configured to receive a data packet;
a current rate determining module 1002, configured to determine a current input rate of a data stream to which a data packet belongs;
a desired rate determining module 1003, configured to determine, from stored desired input rates of multiple data streams, a desired input rate of a data stream to which the data packet belongs;
a message generating module 1004, configured to generate a congestion notification message if a current input rate of a data stream to which the data message belongs is greater than an expected input rate of the data stream to which the data message belongs;
a first sending module 1005, configured to send a congestion notification message to a sending end.
Optionally, the apparatus 1000 further comprises:
a second receiving module, configured to receive a notification message carrying an expected input rate, where the expected input rate carried by the notification message corresponds to the first data stream;
an updating module, configured to update the stored expected input rate of the first data flow to an expected input rate carried in the notification message if the plurality of data flows include the first data flow;
a storage module to store the desired input rate of the first data stream if the first data stream is not included in the plurality of data streams.
Optionally, the apparatus 1000 further comprises: a third receiving module, configured to receive a congestion notification message, where the congestion notification message is used to instruct a source switching device to perform congestion control on a second data stream;
the current rate determining module 1002 is further configured to determine a current input rate of the second data stream;
the desired rate determining module 1003 is further configured to determine a desired input rate of the second data stream from the desired input rates of the plurality of data streams;
and the second sending module is used for sending the congestion notification message to the sending end of the second data stream if the current input rate of the second data stream is greater than the expected input rate of the second data stream.
Optionally, the apparatus 1000 further comprises: and the discarding module is used for discarding the congestion notification message if the current input rate of the second data flow is not greater than the expected input rate of the second data flow.
In the congestion control device provided in the above embodiment, only the division of the functional modules is illustrated in the congestion control, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the congestion control device and the congestion control method provided in the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
The above-mentioned embodiments are not intended to limit the present application, and any modifications, equivalents, improvements, etc. made within the principle of the present application should be included in the protection scope of the present application.

Claims (25)

1. A method of congestion control, the method comprising:
the method comprises the steps that a target switching device obtains state information of an outlet queue corresponding to a data stream, wherein the target switching device is a switching device connected with a receiving end of the data stream;
if the destination switching device determines that the state information meets a rate allocation condition, the destination switching device allocates a corresponding expected input rate to the data stream, the expected input rate of the data stream is used for indicating a source switching device corresponding to the data stream to perform congestion control according to the expected input rate, and the source switching device is a switching device connected with a sending end of the data stream.
2. The method of claim 1, wherein when the destination switching device and the source switching device are the same switching device, the method further comprises:
the destination switching device records the desired input rate of the data stream.
3. The method of claim 1, wherein when the destination switching device and the source switching device are different switching devices, the method further comprises:
and the destination switching equipment sends a notification message to the source switching equipment, wherein the notification message carries the expected input rate of the data stream, and the notification message is used for indicating the source switching equipment to carry out congestion control according to the expected input rate carried by the notification message.
4. The method of any of claims 1-3, wherein the status information includes a queue depth of the egress queue;
the destination switching device determines that the state information meets a rate allocation condition, and the determining includes:
and if the queue depth is greater than a queue depth threshold value, the destination switching equipment determines that the state information meets the rate allocation condition.
5. The method of any of claims 1-3, wherein the status information includes a number of active data flows of the egress queue;
the destination switching device determines that the state information meets a rate allocation condition, and the determining includes:
and if the number of the active data flows of the exit queue is different from the number of the active data flows of the exit queue stored when the notification message is generated last time, the destination switching equipment determines that the state information meets the rate allocation condition.
6. The method of any of claims 1-3, wherein the status information includes a bandwidth utilization of the egress queue;
the destination switching device determines that the state information meets a rate allocation condition, and the determining includes:
and if the bandwidth utilization rate is smaller than the utilization rate threshold value of the exit queue, the destination switching equipment determines that the state information meets the rate allocation condition.
7. The method according to any one of claims 1 to 6, wherein a flow table is stored in the destination switching device, and entries corresponding to respective data flows of the egress queue are stored in the flow table;
the method further comprises the following steps:
the destination switching equipment receives the data message of the data stream;
and if the table entry corresponding to the data flow exists in the flow table, the target switching equipment executes the step of acquiring the state information of the exit queue corresponding to the data flow.
8. The method according to any one of claims 1 to 6, wherein a flow table is stored in the destination switching device, and entries corresponding to respective data flows of the egress queue are stored in the flow table; the method further comprises the following steps:
the destination switching equipment receives the data message of the data stream;
and if the table entry corresponding to the data flow does not exist in the flow table, the destination switching device creates the table entry corresponding to the data flow in the flow table, and executes the step of acquiring the state information of the exit queue corresponding to the data flow.
9. A method of congestion control, the method comprising:
a source switching device receives a data message, wherein the source switching device is a switching device connected with a sending end of the data message;
the source switching equipment determines the current input rate of the data stream to which the data message belongs;
the source switching equipment determines the expected input rate of the data stream to which the data message belongs from the stored expected input rates of a plurality of data streams;
if the current input rate of the data flow to which the data message belongs is greater than the expected input rate of the data flow to which the data message belongs, the source switching equipment generates a congestion notification message;
and the source switching equipment sends the congestion notification message to the sending end.
10. The method of claim 9, wherein the method further comprises:
the source switching equipment receives a notification message carrying an expected input rate, wherein the expected input rate carried by the notification message corresponds to a first data stream;
if the plurality of data flows comprise the first data flow, the source switching equipment updates the stored expected input rate of the first data flow to the expected input rate carried in the notification message;
the source switching device stores a desired input rate for the first data stream if the first data stream is not included in the plurality of data streams.
11. The method of claim 9 or 10, wherein the method further comprises:
the source switching equipment receives a congestion notification message, wherein the congestion notification message is used for indicating the source switching equipment to carry out congestion control on a second data flow;
the source switching device determining a current input rate of the second data stream;
the source switching device determining a desired input rate for the second data stream from among the desired input rates for the plurality of data streams;
and if the current input rate of the second data flow is greater than the expected input rate of the second data flow, the source switching equipment sends the congestion notification message to the sending end of the second data flow.
12. The method of claim 11, wherein the source switching device, after determining the desired input rate for the second data stream from the desired input rates for the plurality of data streams, further comprises:
and if the current input rate of the second data flow is not greater than the expected input rate of the second data flow, the source switching equipment discards the congestion notification message.
13. A congestion control apparatus, for use in a destination switching device, the apparatus comprising:
a status information obtaining module, configured to obtain status information of an egress queue corresponding to a data stream, where the destination switching device is a switching device connected to a receiving end of the data stream;
a rate allocating module, configured to allocate a corresponding expected input rate to the data flow if it is determined that the state information satisfies a rate allocating condition, where the expected input rate of the data flow is used to indicate a source switching device corresponding to the data flow to perform congestion control according to the expected input rate, and the source switching device is a switching device connected to a sending end of the data flow.
14. The apparatus of claim 13, wherein when the destination switching device and the source switching device are the same switching device, the apparatus further comprises:
a recording module for recording a desired input rate of the data stream.
15. The method of claim 13, wherein when the destination switching device and the source switching device are different switching devices, the apparatus further comprises:
a sending module, configured to send a notification packet to the source switching device, where the notification packet carries an expected input rate of the data flow, and the notification packet is used to instruct the source switching device to perform congestion control according to the expected input rate carried by the notification packet.
16. The apparatus of any of claims 13-15, wherein the status information comprises a queue depth of the egress queue;
the rate allocation module is configured to determine that the status information satisfies the rate allocation condition if the queue depth is greater than a queue depth threshold.
17. The apparatus of any of claims 13-15, wherein the status information comprises a number of active data flows of the egress queue;
the rate allocation module is configured to determine that the state information satisfies the rate allocation condition if the number of active data flows of the egress queue is different from the number of active data flows of the egress queue stored when the notification packet was generated last time.
18. The apparatus of any of claims 13-15, wherein the status information comprises a bandwidth utilization of the egress queue;
the rate allocation module is configured to determine that the status information satisfies the rate allocation condition if the bandwidth utilization is less than a threshold of utilization for the egress queue.
19. The apparatus according to any of claims 13-18, wherein the destination switching device has a flow table stored therein, and the flow table has entries stored therein corresponding to respective data flows of the egress queue;
the device further comprises:
a receiving module, configured to receive a data packet of the data stream;
the triggering module is used for triggering the state information acquisition module to acquire the state information of the exit queue corresponding to the data flow if the table entry corresponding to the data flow exists in the flow table;
a creating module, configured to create, if there is no entry corresponding to the data flow in the flow table, an entry corresponding to the data flow in the flow table, and trigger the state information obtaining module to obtain state information of an exit queue corresponding to the data flow.
20. A congestion control apparatus, which is applied to a source switch device, where the source switch device is a switch device connected to a sending end of a data packet, and the apparatus includes:
the first receiving module is used for receiving the data message;
a current rate determining module, configured to determine a current input rate of a data stream to which the data packet belongs;
the expected rate determining module is used for determining the expected input rate of the data stream to which the data message belongs from the stored expected input rates of a plurality of data streams;
a message generation module, configured to generate a congestion notification message if a current input rate of a data stream to which the data message belongs is greater than an expected input rate of the data stream to which the data message belongs;
and the first sending module is used for sending the congestion notification message to the sending end.
21. The apparatus of claim 20, wherein the apparatus further comprises:
a second receiving module, configured to receive a notification packet carrying an expected input rate, where the expected input rate carried by the notification packet corresponds to a first data stream;
an updating module, configured to update a stored expected input rate of the first data flow to an expected input rate carried in the notification message if the plurality of data flows include the first data flow;
a storage module to store a desired input rate of the first data stream if the first data stream is not included in the plurality of data streams.
22. The apparatus of claim 20 or 21, wherein the apparatus further comprises:
a third receiving module, configured to receive a congestion notification message, where the congestion notification message is used to instruct the source switching device to perform congestion control on a second data flow;
a current rate determination module, further configured to determine a current input rate of the second data stream;
a desired rate determination module further configured to determine a desired input rate for the second data stream from among the desired input rates for the plurality of data streams;
a second sending module, configured to send the congestion notification message to a sending end of the second data flow if the current input rate of the second data flow is greater than the expected input rate of the second data flow.
23. The apparatus of claim 22, wherein the apparatus further comprises:
a discarding module, configured to discard the congestion notification packet if the current input rate of the second data flow is not greater than the expected input rate of the second data flow.
24. A network device, comprising a processor and a memory;
the memory is used for storing a program for executing the method of any one of claims 1 to 8 and data related to implementing the method of any one of claims 1 to 8, or storing a program for executing the method of any one of claims 9 to 12 and data related to implementing the method of any one of claims 9 to 12;
the processor is configured to execute programs stored in the memory.
25. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8 or carries out the steps of the method of any one of claims 9 to 12.
CN201911378469.8A 2019-12-27 2019-12-27 Congestion control method and related equipment Pending CN113055301A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911378469.8A CN113055301A (en) 2019-12-27 2019-12-27 Congestion control method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911378469.8A CN113055301A (en) 2019-12-27 2019-12-27 Congestion control method and related equipment

Publications (1)

Publication Number Publication Date
CN113055301A true CN113055301A (en) 2021-06-29

Family

ID=76506832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911378469.8A Pending CN113055301A (en) 2019-12-27 2019-12-27 Congestion control method and related equipment

Country Status (1)

Country Link
CN (1) CN113055301A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115514708A (en) * 2022-11-23 2022-12-23 江苏为是科技有限公司 Congestion control method and device
CN116032852A (en) * 2023-03-28 2023-04-28 新华三工业互联网有限公司 Flow control method, device, system, equipment and storage medium based on session
CN116723133A (en) * 2023-06-29 2023-09-08 无锡芯光互连技术研究院有限公司 Data transmitting and receiving equipment, network state information extraction method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115514708A (en) * 2022-11-23 2022-12-23 江苏为是科技有限公司 Congestion control method and device
CN116032852A (en) * 2023-03-28 2023-04-28 新华三工业互联网有限公司 Flow control method, device, system, equipment and storage medium based on session
CN116032852B (en) * 2023-03-28 2023-06-02 新华三工业互联网有限公司 Flow control method, device, system, equipment and storage medium based on session
CN116723133A (en) * 2023-06-29 2023-09-08 无锡芯光互连技术研究院有限公司 Data transmitting and receiving equipment, network state information extraction method and device
CN116723133B (en) * 2023-06-29 2024-03-22 无锡芯光互连技术研究院有限公司 Data transmitting and receiving equipment, network state information extraction method and device

Similar Documents

Publication Publication Date Title
US20220217078A1 (en) System and method for facilitating tracer packets in a data-driven intelligent network
CN111654447B (en) Message transmission method and device
US7359321B1 (en) Systems and methods for selectively performing explicit congestion notification
CN110932989B (en) Elephant flow path monitoring and scheduling method based on SDN data center network
US9596182B2 (en) Controlling non-congestion controlled flows
CN113055301A (en) Congestion control method and related equipment
CN109547341B (en) Load sharing method and system for link aggregation
CN111316605A (en) Layer 3 fair rate congestion control notification
WO2021227947A1 (en) Network control method and device
CN113225253B (en) Message forwarding method and device
CN112242965A (en) Telemetry event aggregation
EP4149066A1 (en) Communication method and apparatus
US7684422B1 (en) Systems and methods for congestion control using random early drop at head of buffer
JP7103883B2 (en) Communication systems, communication control methods, and communication devices
CN109995608B (en) Network rate calculation method and device
CN110324255B (en) Data center network coding oriented switch/router cache queue management method
CN113518037A (en) Congestion information synchronization method and related device
CN111464453A (en) Message forwarding method and device
CN109787922B (en) Method and device for acquiring queue length and computer readable storage medium
US20220124036A1 (en) Network congestion handling method and related apparatus
Yang et al. Crsp: Network congestion control through credit reservation
JP4838739B2 (en) Router buffer management method and router using the management method
CN111917624B (en) Method and system for transmitting control information in VXLAN transmission
CN110086680B (en) AFDX (avionics full Duplex switched Ethernet) network configuration generation method, device and system
Irawan et al. Performance evaluation of queue algorithms for video-on-demand application

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