WO2020200307A1 - 数据包标记方法及设备、数据传输系统 - Google Patents
数据包标记方法及设备、数据传输系统 Download PDFInfo
- Publication number
- WO2020200307A1 WO2020200307A1 PCT/CN2020/083193 CN2020083193W WO2020200307A1 WO 2020200307 A1 WO2020200307 A1 WO 2020200307A1 CN 2020083193 W CN2020083193 W CN 2020083193W WO 2020200307 A1 WO2020200307 A1 WO 2020200307A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data stream
- level
- target
- transmission rate
- queue
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/31—Flow control; Congestion control by tagging of packets, e.g. using discard eligibility [DE] bits
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/142—Network analysis or design using statistical or mathematical methods
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/02—Capturing of monitoring data
- H04L43/026—Capturing of monitoring data using flow identification
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/11—Identifying congestion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2425—Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2483—Traffic characterised by specific attributes, e.g. priority or QoS involving identification of individual flows
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/29—Flow control; Congestion control using a combination of thresholds
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/33—Flow control; Congestion control using forward notification
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
- H04L47/621—Individual queue per connection or flow, e.g. per VC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
- H04L47/625—Queue scheduling characterised by scheduling criteria for service slots or service orders
- H04L47/6255—Queue scheduling characterised by scheduling criteria for service slots or service orders queue load conditions, e.g. longest queue first
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
- H04L43/0894—Packet rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/16—Threshold monitoring
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/25—Flow control; Congestion control with rate being modified by the source upon detecting a change of network conditions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/50—Overload detection or protection within a single switching element
- H04L49/501—Overload detection
Definitions
- This application relates to the field of communication technology, and in particular to a data packet marking method and equipment, and a data transmission system.
- the data transmission system includes: switching equipment and its upstream and downstream equipment.
- the upstream device may send a data stream to the downstream device through the switching device for data transmission.
- the switching device can receive the data stream sent by the upstream device, and can buffer the data packet in the first data stream in the sending queue in the switching device, and then send the data packet in the sending queue to the downstream device. It should be noted that the switching device will also detect the length of the sending queue. When the length of the sending queue is greater than the length threshold, the switching device may display the congestion notification (Explicit Congestion) of the data packets in each data stream in the sending queue. Notification, ECN) mark. When the downstream device receives the ECN-marked data stream, it will instruct the upstream device to reduce the sending rate of the data stream where the ECN-marked data packet is located.
- the switching device may mark the data packets in each data stream in the sending queue. Therefore, the upstream device sends each data stream at a lower rate, resulting in The latency of each data stream is relatively high.
- This application provides a data packet marking method and device, and a data transmission system, which can solve the problem of high delay of each data stream.
- the technical solution is as follows:
- a data packet marking method for use in a switching device, the method comprising: collecting statistics on target parameters of a first data stream, wherein the target queue of the switching device is used to buffer at least one data stream
- the first data stream is one of the at least one data stream
- the target parameter is used to reflect the data volume of the first data stream
- the length of the target queue satisfies the first Under the length condition
- the marking probability corresponding to the first data stream is determined according to at least one of the target parameter and the auxiliary parameter of the first data stream, wherein the auxiliary parameter of the first data stream is the same as that of the first data stream.
- the target parameter of the data stream is related; the data packet in the first data stream is marked for congestion according to the marking probability corresponding to the first data stream.
- the switching device may determine the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, so as to realize the combination of at least one of the target parameter and auxiliary parameter of the first data stream.
- Data packets in a data stream are marked for congestion. Reduce the probability that all data streams are marked for congestion, so as to avoid reducing the transmission efficiency of all data streams and avoid causing delays to all data streams.
- the auxiliary parameter includes the level of the first data stream.
- the auxiliary parameter may also include other parameters that are different from the first data stream and are related to the target parameter of the first data stream.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream includes: determining the marking probability according to the target parameter of the first data stream The marking probability corresponding to the first data stream; wherein, when the marking probability determined according to the second target parameter is greater than the marking probability determined according to the first target parameter, the second target parameter is greater than the first target parameter. That is, when determining the marking probability corresponding to the first data stream, a more appropriate marking probability may be determined only according to the target parameter of the first data stream.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream includes: determining the first data stream according to the level of the first data stream A marking probability corresponding to a data stream; wherein, when the marking probability determined according to the second stream level is greater than the marking probability determined according to the first stream level, the second stream level is greater than the first stream level. That is, when determining the marking probability corresponding to the first data stream, a more appropriate marking probability may be determined only according to the level of the first data stream.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary of the first data stream includes: determining the marking probability according to the target parameter and level of the first data stream The marking probability corresponding to the first data stream; wherein, when the level of the first data stream remains unchanged, the marking probability corresponding to the first data stream increases as the target parameter of the first data stream increases Or, the marking probability corresponding to the first data stream remains unchanged as the target parameter of the first data stream increases. That is, when determining the marking probability corresponding to the first data stream, not only the target parameter of the first data stream, but also the level of the first data stream may be considered to determine a more appropriate marking probability.
- the second target parameter is greater than the first target parameter. That is, when the data flow level is larger, the target parameter related to the data flow level is larger. However, when one target parameter is greater than another target parameter, the data flow level related to the one target parameter is not necessarily greater than the data flow level related to the other target parameter.
- the target parameter of the first data stream is located within a target parameter range among multiple target parameter ranges, and the multiple target parameter ranges correspond to multiple data stream levels one-to-one, and the first data stream The level of is: the data flow level corresponding to the one target parameter range among the multiple data flow levels.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream includes: according to the target parameter and level of the first data stream At least one, and at least one of the length and level of the target queue, determine the marking probability corresponding to the first data stream; wherein the level of the target queue is related to the length of the target queue. That is, when determining the marking probability corresponding to the first data stream, not only can it be based on at least one of the target parameter and level of the first data stream, but also can consider at least one of the length and level of the target queue to determine one More appropriate marking probability.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and level of the first data stream, and at least one of the length and level of the target queue includes: The level of the first data stream and the length of the target queue determine the marking probability corresponding to the first data stream; wherein, if the level of the first data stream does not change, it is determined according to the length of the second queue When the marking probability of is greater than the marking probability determined according to the first queue length, the second queue length is greater than the first queue length. That is, when determining the marking probability corresponding to the first data stream, not only the level of the first data stream can be considered, but also the length of the target queue can be considered to determine a more appropriate marking probability.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and level of the first data stream, and at least one of the length and level of the target queue includes: The level of the first data stream and the level of the target queue are used to determine the marking probability corresponding to the first data stream; wherein, if the level of the first data stream remains the same, it is determined according to the level of the second queue When the marking probability of is greater than the marking probability determined according to the first queue level, the second queue level is greater than the first queue level. That is, when determining the marking probability corresponding to the first data stream, not only the level of the first data stream, but also the level of the target queue may be considered to determine a more appropriate marking probability.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and level of the first data stream, and at least one of the length and level of the target queue includes: The target parameter and level of the first data stream, and the length and level of the target queue are used to determine the marking probability corresponding to the first data stream; wherein, at the level of the first data stream and the target queue When the levels of the first data stream are unchanged, the relationship between the marking probability corresponding to the first data stream, the target parameter of the first data stream, and the length of the target queue satisfies at least one of the following: If the target parameter does not change, the marking probability corresponding to the first data stream increases as the length of the target queue increases; if the length of the target queue does not change, the marking probability corresponding to the first data stream Increase as the target parameter of the first data stream increases; if the target parameter of the first data stream does not change, the marking probability corresponding to the first data stream increases as the length of the target queue increases Keep unchanged; if the length of the target
- the marking probability corresponding to the first data stream not only the target parameter and level of the first data stream, but also the length and level of the target queue may be considered to determine a more appropriate marking probability.
- the second queue length related to the second queue length is greater than the first queue length. That is, when the queue level is larger, the queue length related to the queue level is larger.
- the length of the target queue is within a length range of multiple length ranges, and the multiple length ranges correspond to multiple queue levels one-to-one, and the level of the target queue is: the multiple queues The queue level corresponding to the one length range in the level.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream includes: according to the target parameter and level of the first data stream At least one, and at least one of the transmission rate of the first data stream and the level of the transmission rate of the first data stream, determine the marking probability corresponding to the first data stream; wherein, the first data stream The level of the transmission rate is related to the transmission rate. That is, when determining the marking probability corresponding to the first data stream, not only can it be based on at least one of the target parameter and level of the first data stream, but also the transmission rate of the first data stream and the first data stream can be considered. At least one of the transmission rate levels to determine a more appropriate marking probability.
- determine the The marking probability corresponding to the first data stream includes: determining the marking probability corresponding to the first data stream according to the target parameter of the first data stream and the transmission rate of the first data stream; wherein, if the If the target parameter of the first data stream is unchanged, when the marking probability determined according to the second transmission rate is greater than the marking probability determined according to the first transmission rate, the second transmission rate is greater than the first transmission rate. That is, when determining the marking probability corresponding to the first data stream, not only the target parameter of the first data stream, but also the transmission rate of the first data stream may be considered to determine a more appropriate marking probability.
- determine the The marking probability corresponding to the first data stream includes: determining the marking probability corresponding to the first data stream according to the level of the first data stream and the level of the transmission rate of the first data stream; wherein, if If the level of the first data stream remains unchanged, when the marking probability determined according to the second transmission rate level is greater than the marking probability determined according to the first transmission rate level, the second transmission rate is greater than the first transmission rate. That is, when determining the marking probability corresponding to the first data stream, not only the level of the first data stream, but also the level of the transmission rate of the first data stream may be considered to determine a more appropriate marking probability.
- the marking probability corresponding to the first data stream includes: determining the target parameter and level of the first data stream, and the transmission rate of the first data stream and the level of the transmission rate of the first data stream.
- the marking probability corresponding to the first data stream that is, when determining the marking probability corresponding to the first data stream, not only the target parameters and levels of the first data stream, but also the transmission rate and the transmission rate of the first data stream can be considered.
- the level of the transmission rate of the first data stream is used to determine a more appropriate marking probability.
- the marking probability corresponding to the first data stream, the target parameter of the first data stream and the transmission rate satisfies at least one of the following: if the target parameter of the first data stream remains unchanged, the marking probability corresponding to the first data stream increases as the transmission rate of the first data stream increases; If the transmission rate of the first data stream remains unchanged, the marking probability corresponding to the first data stream increases as the target parameter of the first data stream increases; if the target parameter of the first data stream increases Is unchanged, the marking probability corresponding to the first data stream remains unchanged as the transmission rate of the first data stream increases; if the transmission rate of the first data stream does not change, then the first data stream The marking probability corresponding to the data stream remains unchanged as the target parameter of the first data stream increases.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and level of the first data stream, and at least one of the length and level of the target queue includes: At least one of the target parameter and level of the first data stream, at least one of the length and level of the target queue, and the transmission rate of the first data stream and the transmission rate of the first data stream At least one of the levels determines the marking probability corresponding to the first data flow; wherein the level of the target queue is related to the length of the target queue, and the transmission rate level of the first data flow is related to the transmission rate.
- the marking probability corresponding to the first data stream when determining the marking probability corresponding to the first data stream, it may not only be based on at least one of the target parameter and level of the first data stream, but also at least one of the length and level of the target queue, and At least one of the transmission rate of the first data stream and the level of the transmission rate of the first data stream is used to determine a more appropriate marking probability.
- determining the marking probability corresponding to the first data stream includes: according to the target parameter of the first data stream, the length of the target queue, and the value of the first data stream
- the transmission rate determines the marking probability corresponding to the first data stream; that is, when determining the marking probability corresponding to the first data stream, not only the target parameters of the first data stream, but also the target queue's Length, and the transmission rate of the first data stream to determine a more appropriate marking probability.
- the second The transmission rate is greater than the first transmission rate; if the target parameter of the first data stream and the transmission rate of the first data stream are both unchanged, the marking probability determined according to the second queue length is greater than according to the first queue When the marking probability is determined by the length, the length of the second queue is greater than the length of the first queue.
- determining the marking probability corresponding to the first data stream includes: according to the level of the first data stream, the level of the target queue, and the transmission of the first data stream The rate level determines the marking probability corresponding to the first data stream; that is, when determining the marking probability corresponding to the first data stream, not only the level of the first data stream, but also the target queue’s Level, and the level of the transmission rate of the first data stream to determine a more appropriate marking probability.
- the first transmission rate level is greater than the first transmission rate level; if both the level of the first data stream and the transmission rate level of the first data stream are unchanged, the marking probability determined according to the second queue level is greater than When the marking probability is determined according to the first queue level, the second queue level is greater than the first queue level.
- determining the marking probability corresponding to the first data stream includes: according to the target parameter and level of the first data stream, the length and level of the target queue, and the The transmission rate of the first data stream and the level of the transmission rate of the first data stream are used to determine the marking probability corresponding to the first data stream; that is, when determining the marking probability corresponding to the first data stream, it is not only possible to determine the marking probability corresponding to the first data stream.
- the target parameters and levels of a data stream the length and level of the target queue, and the transmission rate of the first data stream and the level of the transmission rate of the first data stream can also be considered to determine a more appropriate Mark the probability.
- the marking probability corresponding to the first data stream, the target queue The relationship between the length of the first data stream, the target parameter of the first data stream and the transmission rate satisfies at least one of the following: if the target parameter of the first data stream and the length of the target queue remain unchanged, the first data stream The corresponding marking probability increases as the transmission rate of the first data stream increases; if the target parameter of the first data stream and the transmission rate of the first data stream remain unchanged, then the first data stream The marking probability corresponding to the stream increases as the length of the target queue increases; if the transmission rate of the first data stream and the length of the target queue remain unchanged, the marking probability corresponding to the first data stream Increases as the target parameter of the first data stream increases; if the target parameter of the first data stream and the length of the target queue do not change, the marking probability corresponding to the first data stream varies with the The transmission rate of the first data stream.
- the second transmission rate level is greater than the first transmission rate level
- the second transmission rate is greater than the first transmission rate. That is, when the transmission rate level is greater, the transmission rate related to the transmission rate level is greater.
- the transmission rate of the first data stream is within a transmission rate range of multiple transmission rate ranges, and the multiple transmission rate ranges correspond to multiple transmission rate levels one to one, and the first data stream
- the transmission rate level of is: the transmission rate level corresponding to the one transmission rate range among the multiple transmission rate levels.
- determining the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream includes: when the first data stream meets the marking condition, according to the At least one of the target parameter and the auxiliary parameter of the first data stream determines the marking probability corresponding to the first data stream.
- the marking condition includes: the level of the first data stream does not belong to the lower q levels among the multiple designated data stream levels, and q ⁇ 1.
- the marking condition is met, it indicates that the data volume of the first data stream is small, and the first data stream is not a data stream that causes congestion of the switching device. At this time, there is no need to mark the first data stream to reduce the data flow of the first data stream. Time delay.
- the marking condition includes: the transmission rate of the first data stream is greater than a transmission rate threshold, wherein the transmission rate threshold is a constant or a variable.
- the marking condition is met, it means that the transmission rate of the first data stream is low, and the first data stream is not a data stream that causes congestion in the switching device. At this time, there is no need to mark the first data stream to reduce the transmission rate of the first data stream. Time delay.
- the target parameter includes: the number of bytes, or the number of data packets.
- a data packet marking method for a switching device.
- the method includes: collecting statistics on target parameters of a first data stream, wherein the target queue of the switching device is used to buffer at least one data stream
- the first data stream is any data stream in the at least one data stream, the target queue includes: a receiving queue or a sending queue, and the target parameter is used to reflect the value of the first data stream Data volume; when the length of the target queue meets the first length condition, determine whether the first data stream meets the marking condition according to the target parameter of the first data stream, where the first length condition includes: The length of the target queue is greater than a first length threshold, the target parameter of the data stream that meets the marking condition is greater than the first target parameter threshold, and the first length threshold and the first target parameter threshold are both greater than zero; When the first data stream meets the marking condition, perform a display congestion notification ECN mark on at least one data packet in the first data stream; when the first data stream does not meet the marking condition, perform a display congestion notification ECN mark; Each data packet in the
- the switching device determines that the first data flow meets the marking condition, it means that the target queue is longer at this time and the data flow causing congestion of the switching device includes the first data flow. At this time, the data packets in the first data stream need to be ECN marked to reduce the transmission rate of the first data stream, eliminate congestion on the switching device, and improve the transmission efficiency of other data streams. In addition, when the switching device determines that the first data flow does not meet the marking condition, it indicates that although the entire target queue is longer at this time, the data flow causing congestion of the switching device does not include the first data flow. At this time, there is no need to perform ECN marking on the data packets in the first data stream.
- the target parameter includes: the number of bytes, and the first target parameter threshold includes: the number of bytes threshold; or, the target parameter includes: the number of data packets, and the first target parameter threshold includes : Threshold for the number of packets.
- the target parameter is the number of bytes or the number of data packets as an example.
- the target parameter may also be other parameters related to the amount of data, which is not limited in the embodiment of the present application.
- the first length condition further includes: the length of the target queue is less than or equal to a second length threshold, and the second length threshold is less than infinity. This is equivalent to when the length of the target queue is greater than the first length threshold and less than or equal to the second length threshold, it can be determined that the length of the target queue meets the first length condition.
- the method further includes: when the length of the target queue meets the first length condition, determining according to the target parameter of the first data stream The level of the first data stream among the multiple data stream levels; wherein the level of the data stream is positively correlated with the target parameter of the data stream, and the marking condition includes: the level of the data stream is one of the multiple data stream levels Not the lowest level.
- the marking condition is set as a condition related to the level of the data stream. In this way, it is possible to determine whether the data stream meets the marking by determining whether the level of the data stream is a non-lowest level among multiple data stream levels. condition.
- determining the level of the first data stream among multiple data stream levels according to the target parameter of the first data stream includes: according to the target parameter of the first data stream, and m+1 targets
- the one-to-one correspondence between the parameter range and the multiple data stream levels determines the level of the first data stream; where m ⁇ 1, the m+1 target parameter ranges are divided by m target parameter thresholds, The minimum target parameter threshold in the m target parameter thresholds is the first target parameter threshold, and the data flow level corresponding to the target parameter range is positively correlated with the target parameter in the target parameter range.
- m+1 target parameter ranges correspond to multiple data stream levels one by one as an example, or m+1 target parameter ranges correspond to q data stream levels, and q is less than m +1 (equivalent to at least two target parameter ranges corresponding to the same data stream level).
- performing a display congestion notification ECN mark on at least one data packet in the first data flow includes: determining a mark probability corresponding to the first data flow, wherein the mark probability corresponding to the data flow is the same as that of the data flow. Positive level correlation; according to the marking probability corresponding to the first data stream, perform the ECN marking on at least one data packet in the first data stream.
- the method before performing ECN marking on the data packet in the first data stream, the method further includes: when the first data stream satisfies the marking condition, determining all the data in the n+1 length range The target length range in which the length of the target queue is located; where n ⁇ 1, the n+1 length ranges are divided by n length thresholds, and the minimum length threshold of the n length thresholds is the first length Threshold, the maximum length threshold of the n length thresholds is the second length threshold; the tag probability corresponding to the data stream is positively correlated with the length in the target length range.
- determining the marking probability corresponding to the first data stream includes: determining the marking probability corresponding to the first data stream according to a first formula, the level of the first data stream, and the target length range;
- L j represents The jth length threshold value arranged from small to large among the n length thresholds, 1 ⁇ j ⁇ n;
- L j+1 represents the j+ 1th length threshold value arranged from small to large among the n length thresholds;
- P(j,i) represents the marking probability corresponding to the i-th level data stream in the at least one data stream when the L is within (L j , L j+1 ], 1 ⁇ i ⁇ m+1; when j-1>0, P(j-1,i) means that when the L is within (L j-1 , L
- the marking condition further includes: the transmission rate of the data stream is greater than the fair bandwidth, the fair bandwidth is positively correlated with the bandwidth of the target port, and when the target queue is a sending queue, the transmission rate is the exchange rate The rate at which the device sends the data stream; the target port is the sending port of the switching device for sending data packets buffered in the target queue; when the target queue is a receiving queue, the transmission rate Is the rate at which the switching device receives the data stream, and the target port is a receiving port in the switching device for receiving data packets buffered in the target queue
- the switching device determines that the first data stream does not meet the marking condition, it means that although the entire target queue is longer at this time, most of the data in the target queue is not the data of the first data stream (and/or the first data stream is in The bandwidth of the target port occupies less), therefore, the data flow that causes congestion of the switching device does not include the first data flow. At this time, there is no need to perform ECN marking on the data packets in the first data stream. In this way, it can be realized that when the length of the target queue is long, the ECN marking of the data stream with a small amount of data can be avoided, so that the transmission efficiency of the data stream with a small amount of data will not be reduced, and the Data flow with less data causes time delay.
- the fair bandwidth is negatively correlated with a target number
- the target number is: the number of data streams whose levels belong to a level set in the at least one data flow, and the level set includes multiple data flow levels
- the level of the data stream is positively correlated with the target parameter of the data stream, 1 ⁇ p.
- the fair bandwidth is equal to the ratio of the bandwidth of the target port to the target number.
- each data packet in the first data stream is marked with the ECN, and the second length condition includes: the target queue The length of is greater than the second length threshold.
- each data packet of each data stream needs to be ECN marked to quickly reduce the transmission of each data stream Rate, and then quickly reduce the length of the target queue to avoid packet loss.
- a data packet marking device for use in a switching device, and the data packet marking device includes various modules for executing the data packet marking method described in the first aspect or the second aspect.
- a data packet marking device in a fourth aspect, includes: at least one processor, at least one port, memory, and at least one communication bus, and the processor is configured to execute a program stored in the memory , To implement the data packet marking method described in the first aspect or the second aspect.
- a data transmission system includes: a switching device, the switching device includes: the data packet marking device according to the third aspect, or the data packet marking device according to the fourth aspect .
- a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium.
- the computer-readable storage medium runs on a computer, the computer executes operations such as the first aspect or the second aspect.
- the data packet marking method described in the aspect is provided.
- a computer program product containing instructions, which when the computer program product runs on a computer, causes the computer to execute the data packet marking method described in the first aspect or the second aspect.
- FIG. 1 is a schematic structural diagram of a data transmission system provided by an embodiment of this application.
- FIG. 2 is a schematic structural diagram of a switching device provided by an embodiment of this application.
- FIG. 3 is a schematic diagram of a partial structure of a switching device provided by an embodiment of the application.
- FIG. 4 is a flowchart of a data packet marking method provided by an embodiment of the application.
- FIG. 5 is a flowchart of another data packet marking method provided by an embodiment of the application.
- FIG. 6 is a schematic diagram of data stream transmission provided by an embodiment of this application.
- FIG. 7 is a schematic diagram of another data stream transmission provided by an embodiment of this application.
- FIG. 8 is a schematic diagram of another data stream transmission provided by an embodiment of this application.
- FIG. 9 is a schematic diagram of another data stream transmission provided by an embodiment of this application.
- FIG. 10 is a schematic diagram of another data stream transmission provided by an embodiment of this application.
- FIG. 11 is a flowchart of yet another data packet marking method provided by an embodiment of this application.
- FIG. 12 is a schematic structural diagram of a data packet marking device provided by an embodiment of this application.
- FIG. 13 is a schematic structural diagram of another data packet marking device provided by an embodiment of this application.
- FIG. 14 is a schematic structural diagram of a first marking module provided by an embodiment of the application.
- 15 is a schematic structural diagram of yet another data packet marking device provided by an embodiment of this application.
- 16 is a schematic structural diagram of a determining module provided by an embodiment of the application.
- FIG. 17 is a schematic structural diagram of another determining module provided by an embodiment of the application.
- FIG. 18 is a schematic structural diagram of a first determining unit provided by an embodiment of this application.
- FIG. 1 is a schematic structural diagram of a data transmission system provided by an embodiment of the application.
- the data transmission system 0 may include: an upstream device 01, at least one switching device 02, and a downstream device 03.
- the upstream device 01 establishes a communication connection with the downstream device 03 through the aforementioned at least one switching device 02.
- the data transmission system 0 includes one switching device 02 as an example.
- the data transmission system 0 may also include multiple switching devices 02.
- the data stream received by the switching device 02 comes from the upstream device of the switching device 02, and the data stream sent by the switching device 02 flows to the downstream device of the switching device 02.
- the embodiments of this application do not limit this.
- the above-mentioned upstream device 01 may be a device with a data sending function, such as a user equipment, a server, a server cluster, or a base station.
- the aforementioned downstream device 03 may also be a device with a data receiving function, such as a user equipment, a server, a server cluster, or a base station.
- the aforementioned switching device 02 may be a device having a data forwarding function such as a switch, a gateway, a server, or a server cluster.
- FIG. 2 is a schematic structural diagram of a switching device provided by an embodiment of the application.
- the switching device 02 may include: a processor 0201, a memory 0202, a communication port 0203, and a bus 0204.
- the processor 0201, the memory 0202, and the communication port 0203 are communicatively connected via the bus 0204.
- the communication port 0203 is used to communicate with other devices under the control of the processor 0201.
- the memory 0203 stores a program 0205, and the program 0205 can be executed by the processor 0201 to implement the data packet marking method provided in the embodiments of the present application.
- FIG. 3 is a schematic diagram of a partial structure of a switching device provided by an embodiment of the application.
- the communication port of each switching device 02 may include: at least one receiving port A1 and/or at least one sending port A2.
- the communication port includes a receiving port A1 and a sending port A2 as an example.
- the communication port may also include only a receiving port or a sending port; and when the communication port only includes a receiving port, in Figure 1
- the data transmission system may also include only upstream equipment, but not downstream equipment; when the communication port only includes the sending port, the data transmission system in Figure 1 may also include only downstream equipment but not upstream equipment. There is no restriction on this.
- the switching device 02 can communicate with an upstream device through the receiving port A1 (for example, receiving a data stream sent by an upstream device), and communicate with a downstream device through a sending port A2 (for example, sending a data stream to a downstream device).
- Each receiving port A1 of the switching device 02 corresponds to a receiving queue
- each sending port A2 of the switching device 02 corresponds to a sending queue.
- the switching device 02 sends a data stream from each sending port A2 to a downstream device, it may send the data packet of the first data stream in the sending queue corresponding to the sending port A2.
- the switching device detects the length of the sending queue (that is, the number of bytes in the sending queue). When the length of the sending queue is greater than the length threshold, the switching device may detect the data in each data stream in the sending queue. At least part of the data packets are marked with ECN, so that the rate at which the upstream device sends each data stream will be reduced, resulting in a higher delay of each data stream.
- the embodiment of the present application provides a data packet marking method, which does not cause the delay of each data stream to be high.
- FIG. 4 is a flowchart of a data packet marking method provided by an embodiment of the application.
- the method may be used in the switching device 02 in the data transmission system shown in FIG. 1.
- the data packet Marking methods can include:
- Step 301 Calculate the target parameters of the first data stream, where the target queue of the switching device is used to buffer data packets of at least one data stream, and the first data stream is any data stream in the at least one data stream, and the target queue Including: receiving queue or sending queue, the target parameter is used to reflect the data volume of the first data stream.
- the target queue may include: a receiving queue or a sending queue.
- the target queue includes the receiving queue.
- the target queue includes the sending queue.
- the target queue in the embodiment of the present application may also be any other queue in the switching device that is different from the sending queue and the receiving queue, which is not limited in the embodiment of the present application.
- the target parameter of the first data stream can be used to reflect the data volume of the first data stream.
- the target parameter of the first data stream may be the number of bytes of the first data stream, or the number of data packets.
- the target parameter of the first data stream may also be other parameters of the first data stream, which is not limited in this embodiment of the application.
- the target queue is used to buffer data packets in at least one data stream, and the first data stream is any data stream in the at least one data stream (the first data stream can also be a specific data stream in the at least one data stream). data flow). It should be noted that the first data stream may include at least one data packet, each data packet may be buffered in the target queue, and each data packet may also be deleted from the target queue. In step 301, it is necessary to perform statistics on the target parameters of the first data stream based on all the data packets of the first data stream.
- the switching device needs to count the target parameters of the first data stream based on the data packets in the first data stream that are not cached in the target queue, the data packets that have been cached in the target queue, and the data packets deleted from the target queue. .
- Step 302 When the length of the target queue meets the first length condition, determine whether the first data stream meets the marking condition according to the target parameters of the first data stream, where the first length condition includes: the length of the target queue is greater than the first length Threshold, the target parameter of the data stream that meets the marking condition is greater than the first target parameter threshold, and both the first length threshold and the first target parameter threshold are greater than zero.
- the switching device can detect the length of the target queue in real time or at regular intervals. When it is detected that the length of the target queue meets the first length condition, it can perform judgment based on the target parameters of the first data stream counted in step 301 The step of whether the first data stream meets the marking condition.
- the first length condition includes: the length of the target queue is greater than the first length threshold as an example.
- the first length condition may also be: the length of the target queue is greater than or equal to the first length threshold.
- Step 303 When the first data stream meets the marking condition, perform ECN marking on at least one data packet in the first data stream.
- the length of the target queue When the length of the target queue is greater than the first length threshold, it indicates that there are too many data packets in the target queue and data transmission congestion occurs at the switching device. Moreover, at this time, the length of the target queue is about to reach the upper limit of length, and if data packets continue to be transmitted at the current rate, packet loss will occur. Therefore, when the length of the target queue is greater than the first length threshold,
- the first data flow meets the marking condition, it means that the entire target queue is longer at this time, and the data flow that causes congestion of the switching device includes the first data flow. At this time, it is necessary to perform ECN marking on at least one data packet in the first data stream to reduce the transmission rate of the first data stream, eliminate congestion on the switching device, and improve the transmission efficiency of other data streams.
- the first data stream does not meet the marking condition, it means that although the entire target queue is longer at this time, the amount of data in the first data stream is small, and most of the data in the target queue is not the data of the first data stream. , The data flow causing the congestion of the switching device does not include the first data flow. Therefore, at this time, there is no need to perform ECN marking on the data packet in the first data stream. In this way, it can be realized that when the length of the target queue is long, it is possible to avoid ECN marking the data stream with a small amount of data, so as to not reduce the transmission of the data stream with a small amount of data (which can be called a mouse stream) Efficiency, will not cause delay to the data stream with less data volume.
- the switching device determines that the first data stream meets the marking condition, it means that the target queue is longer at this time, and most of the data in the target queue is the first.
- the data of the data stream therefore, the data stream causing congestion of the switching device includes the first data stream.
- the data packets in the first data stream need to be ECN marked to reduce the transmission rate of the first data stream, eliminate congestion on the switching device, and improve the transmission efficiency of other data streams.
- the switching device determines that the first data stream does not meet the marking condition, it means that although the entire target queue is longer at this time, most of the data in the target queue is not the data of the first data stream, thus causing congestion of the switching device
- the data stream does not include the first data stream.
- the length of the target queue is long, the ECN marking of the data stream with a small amount of data can be avoided, so that the transmission efficiency of the data stream with a small amount of data will not be reduced, and it will not be affected. Data flow with less data causes time delay.
- FIG. 5 is a flowchart of another data packet marking method provided by an embodiment of the application.
- the method can be used in the switching device 02 in the data transmission system shown in FIG. 1.
- the data Packet marking methods can include:
- Step 401 The switching device buffers the first data stream in its target queue.
- the target queue in step 401 may be any queue (such as a receiving queue or a sending queue) in the switching device.
- queues such as flow queues, user queues, group queues, etc.
- the target queue in the embodiment of the present application may also be any other queue in the switching device that is different from the sending queue and the receiving queue, which is not limited in the embodiment of the present application.
- the length of the target queue gradually becomes longer. It should be noted that the target queue has an upper limit of length, and when the length of the target queue reaches the upper limit of length, if the switching device still buffers a data packet in the target queue, the data packet will be lost. Therefore, in the embodiment of the present application, the switching device needs to monitor the length of the target queue to avoid the phenomenon of packet loss.
- the data stream received by the switching device includes not only the first data stream in which the data packet is buffered in the target queue, but also the data stream in which the data packet is buffered in other queues, which is not limited in this embodiment of the application.
- Step 402 The switching device performs statistics on the target parameter of the first data stream.
- step 402 reference may be made to the explanation of step 301 in the embodiment shown in FIG. 4, and details are not described in the embodiment of the present application.
- Step 403 The switching device judges whether the length of the target queue meets the first length condition and the second length condition. When the length of the target queue meets the first length condition, go to step 404; when the length of the target queue meets the second length condition, go to step 409; when the length of the target queue does not meet the first length condition and does not meet the second length If conditions are met, step 410 is executed.
- the first length condition may include: the length of the target queue is greater than a first length threshold and less than or equal to a second length threshold.
- the second length condition may include: the length of the target queue is greater than the second length threshold. Wherein, the first length threshold is greater than zero, and the second length threshold is less than infinity.
- the first length condition may also include: the length of the target queue is greater than or equal to the first length threshold and less than the second length threshold.
- the second length condition may include: the length of the target queue is greater than or equal to the second length threshold. Wherein, the first length threshold is greater than zero, and the second length threshold is less than infinity.
- the length conditions can be adjusted according to needs (such as changing the length condition from greater than to greater than or equal to, changing the length condition from less than to less than or equal to, and changing the length condition to greater than or equal to greater than, or , Change the length condition from less than or equal to less than).
- the embodiments of this application do not limit this.
- n length thresholds may be pre-stored on the switching device, and the n length thresholds are different from each other, and n ⁇ 1.
- the smallest length threshold among the n length thresholds is the first length threshold
- the largest length threshold among the n length thresholds is the second length threshold.
- the first length threshold is greater than zero, and the second length threshold is less than infinity.
- the n length thresholds may include: 100 kilobytes and 300 kilobytes, then the first length threshold is 100 kilobytes, and the second length threshold is 300 kilobytes.
- the n length thresholds may include: 100 kilobytes, 300 kilobytes, and 500 kilobytes, then the first length threshold is 100 kilobytes, and the second length threshold is 500 kilobytes.
- the switching device may determine the length of the target queue in real time or periodically, and each time the length of the target queue is determined, step 403 may be executed based on the length of the target queue. For example, each time the switching device determines the length of the target queue, it may compare the length of the target queue with the first length threshold to determine the size relationship between the length of the target queue and the first length threshold. Each time the switching device determines the length of the target queue, it may also compare the length of the target queue with the second length threshold to determine the size relationship between the length of the target queue and the second length threshold.
- the length of the target queue is greater than the first length threshold (for example, the length of the target queue is greater than the first length threshold and less than or equal to the second length threshold, or the length of the target queue is greater than the second length threshold), it indicates that the target queue is in the target queue at this time There are too many data packets, and data transmission congestion occurs at the switching equipment. Moreover, at this time, the length of the target queue is about to reach the upper limit of length, and if data packets continue to be transmitted at the current rate, packet loss will occur.
- the first length threshold for example, the length of the target queue is greater than the first length threshold and less than or equal to the second length threshold, or the length of the target queue is greater than the second length threshold
- the switching device determines that the length of the target queue satisfies the first length condition or the second length condition, and needs to perform step 404 to step 408, or perform step 409 to request the switching device. At least part of the data packets in the transmitted data stream are ECN marked.
- the switching device determines that the length of the target queue does not meet the first length condition and the second length condition, indicating that there are fewer data packets in the target queue at this time, and the switching device does not Data transmission congestion occurs, therefore, step 410 can be performed without ECN marking the data packets in the data stream.
- the first length condition is used as an example: the length of the target queue is greater than the first length threshold and less than or equal to the second length threshold.
- the first length condition may also be: the length of the target queue is greater than the first length threshold.
- Step 404 The switching device determines the level of the first data stream among the multiple data stream levels according to the target parameter of the first data stream. Step 405 is executed.
- the level of the data stream is related to the target parameter of the data stream.
- the second flow level related to the second target parameter may be greater than the first flow level related to the first target parameter.
- the second stream level related to the second target parameter may be smaller than the first stream level related to the first target parameter, which is not limited in the embodiment of the present application.
- step 404 After determining the target parameter of the first data stream, the switching device can determine the level of the first data stream according to the target parameter of the first data stream. It should be noted that step 404 has multiple achievable manners, and three of these achievable manners will be used as an example for description.
- the switching device may substitute the target parameter of the first data stream into the preset formula to obtain the level of the first data stream among the multiple data stream levels.
- the input of the preset formula is the target parameter of the data stream
- the output of the preset formula is the level of the first data stream among the multiple data stream levels.
- the target parameter of the first data stream is located within one target parameter range among the multiple target parameter ranges, and the multiple target parameter ranges correspond to multiple data stream levels one-to-one.
- the level of the data stream may be: a data stream level corresponding to the foregoing one target parameter range (that is, the target parameter range in which the target parameter of the first data stream is located) among the multiple data stream levels.
- the switching device may also determine the level of the first data stream according to the target parameter of the first data stream and the one-to-one correspondence between m+1 target parameter ranges and multiple data stream levels.
- the switching device may store m target parameter thresholds, and the smallest target parameter threshold among the m target parameter thresholds is the first target parameter threshold, m ⁇ 1.
- the switching device may also store m+1 target parameter ranges divided by the m target parameter thresholds, and the one-to-one correspondence between the m+1 target parameter ranges and multiple data stream levels, where the target parameter The larger the data stream level corresponding to the range, the larger the target parameter in the target parameter range.
- m target parameter thresholds include: 2 megabytes and 5 megabytes
- the first target parameter threshold is 2 megabytes
- the m+1 target parameter ranges obtained by dividing the m target parameter thresholds are: (0 megabytes, 2 megabytes], (2 megabytes, 5 megabytes), and (5 megabytes, + ⁇ megabytes).
- ⁇ means infinity.
- (0 megabytes, 2 Megabytes], (2 megabytes, 5 megabytes), and (5 megabytes, + ⁇ megabytes) corresponding data stream levels can be shown in Table 1 below, where the "level one" in the data stream level "Is the lowest level, and "level three" is the highest level.
- Table 1 the larger the target parameter in the target parameter range, the larger the data stream level corresponding to the target parameter range; the smaller the target parameter in the target parameter range , The smaller the data stream level corresponding to the target parameter range.
- Target parameter range Data flow level (0 megabytes, 2 megabytes] First level (2 megabytes, 5 megabytes] Level 2 (5 megabytes, + ⁇ megabytes) Level 3
- the switching device determines in step 403 that the length of the target queue is greater than the first length threshold and less than or equal to the second length threshold, the switching device needs to calculate the target parameters of the first data stream obtained by statistics in step 402 and the above m+
- the one-to-one correspondence between a target parameter range and multiple data stream levels determines the level of the first data stream.
- the switching device can determine the data stream level "1" corresponding to the target parameter range (0 megabytes, 2 megabytes) as the level of the first data stream.
- the switching device can According to the above corresponding relationship, the data stream level "secondary" corresponding to the target parameter range (2 megabytes, 5 megabytes) can be determined as the level of the first data stream.
- the switching device may also determine the level of the first data stream based on the target parameter of the first data stream and the correspondence between m+1 target parameter ranges and multiple data stream levels. . Among them, in the correspondence between m+1 target parameter ranges and multiple data stream levels, there may be multiple target parameter ranges corresponding to the same data stream level.
- Step 405 The switching device judges whether the first data stream meets the marking condition. When the first data stream meets the marking condition, step 406 is executed. When the first data stream does not meet the marking condition, step 410 is executed.
- the marking condition can have two achievable ways, and the two achievable ways will be described separately as follows:
- the marking condition may include: the level of the data stream is a non-lowest level among the multiple data stream levels (equivalent to that the target parameter of the data stream is greater than the first target parameter threshold).
- the switching device may determine whether the level of the first data stream is the aforementioned non-lowest level based on the level of the first data stream determined in step 404. For example, for the three data stream levels shown in Table 1, the switching device can determine whether the level of the first data stream is "level two" or "level three" among the three data stream levels. When it is determined that the level of the first data stream (which can be referred to as the first data stream) is the above non-minimum level, the switching device can determine that the first data stream meets the marking condition; when the level of the first data stream is not the non-minimum level ( That is, when it is the lowest level), the switching device can determine that the first data stream does not meet the marking condition.
- step 406 to step 408 need to be executed to mark the data packets in the first data stream to reduce the transmission rate of the first data stream, eliminate congestion on the switching equipment, and improve the transmission of other data streams. effectiveness.
- the switching device determines that the first data flow does not meet the marking condition, it means that although the entire target queue is longer at this time, most of the data in the target queue is not the data of the first data flow.
- step 410 can be directly executed without ECN marking the data packet in the first data stream.
- step 410 can be directly executed without ECN marking the data packet in the first data stream.
- ECN marking the data stream with a small amount of data so as to not reduce the transmission of the data stream with a small amount of data (which can be called a mouse stream) Efficiency, will not cause delay to the data stream with less data volume.
- the marking condition may include: the level of the data stream is a non-lowest level among multiple data stream levels, and the transmission rate of the data stream is greater than the fair bandwidth.
- the transmission rate is the rate at which the switching device sends data streams
- the target port is a sending port in the switching device for sending data packets buffered in the target queue
- the transmission rate is the rate at which the switching device receives the data stream
- the target port is the receiving port of the switching device for receiving the data packet buffered in the target queue.
- the switching device can also count the transmission rate of the first data stream. Assume that the aforementioned target port is a receiving port, and the aforementioned target queue is a sending queue. On the one hand, after the switching device receives a data packet of the first data stream, the target parameter of the first data stream calculated by the switching device will accumulate the target parameter of the data packet.
- the transmission rate of the data stream includes: when the switching device receives the rate at which the first data stream is received, the switching device can determine the target parameter S1 that the statistical target parameter of the first data stream increases within the time period T, and compare the value of S1 with T The ratio is used as the transmission rate of the first data stream.
- the switching device will continue to send data packets in the first data stream to downstream devices, and after the switching device sends the data packets of the first data stream, the target parameters of the first data stream will reduce the data packet Target parameters.
- the transmission rate of the data stream includes: the rate at which the switching device sends the first data stream
- the switching device can determine the target parameter S2 that the statistical target parameter of the first data stream decreases within the time period T, and compare the value of S2 with T The ratio is used as the transmission rate of the first data stream.
- the fair bandwidth may also be negatively related to the target number (for example, the fair bandwidth is equal to the ratio of the bandwidth of the target port to the target number, or the fair bandwidth is equal to twice the ratio of the bandwidth of the target port to the target number).
- the target number is: the number of data streams whose levels belong to the level set in at least one data stream used by the target queue for buffering, the level set includes: the higher p levels among multiple data stream levels, 1 ⁇ p ⁇ m+1.
- the multiple data stream levels may be the same as or different from the multiple data stream levels in step 404, which is not limited in the embodiment of the present application.
- the fair bandwidth is equal to the ratio of the bandwidth of the sending port to the target number.
- p can be 1, or any value greater than 1 and less than or equal to m+1, for example, p is 2 or 3.
- the switching device needs to count the target parameters of each data stream used by the target queue for buffering, and needs to determine the level of each data stream based on the target parameter of each data stream, and then determine the above-mentioned target number according to the level of each data stream . Finally, the fair bandwidth can be determined based on the target number and the bandwidth of the target port.
- the switching device may use the ratio of the bandwidth of the sending port to the number of data streams of the highest level as the fair bandwidth. For example, assuming that the bandwidth of the sending port is 100 megabits per second, and the number of data streams of the highest level described above is 2, it can be determined that the ratio of 100 megabits per second to 2 50 megabits per second is the fair bandwidth.
- the switching device can also determine the fair bandwidth in other ways. For example, the switching device can use the ratio of half of the bandwidth of the sending port to the number of data streams of the highest level as the fair bandwidth, which is not discussed in this embodiment of the application. limited.
- the switching device After the switching device determines the rate at which it sends the first data stream and the fair bandwidth, it can compare the rate at which the switching device sends the first data stream with the fair bandwidth to determine whether the rate at which the switching device sends the first data stream is greater than the fair bandwidth . On the one hand, when the rate at which the switching device sends the first data stream is greater than the fair bandwidth, and the level of the first data stream is the above non-lowest level, the switching device can determine that the first data stream meets the marking condition. On the other hand, when the rate at which the switching device sends the first data stream is less than or equal to the fair bandwidth, and the level of the first data stream is the above non-lowest level, the switching device may determine that the first data stream does not meet the marking condition.
- the switching device may determine that the first data stream does not meet the marking condition.
- the rate at which the switching device sends the first data stream is less than or equal to the fair bandwidth, and the level of the first data stream is not the above non-lowest level, the switching device may determine that the first data stream does not meet the marking condition.
- the rate at which the switching device sends the first data stream is greater than the fair bandwidth, and the level of the first data stream is not the aforementioned non-lowest level, the switching device may determine that the first data stream does not meet the marking condition.
- the switching device can determine whether the first data stream meets the marking condition according to the following steps: the switching device first determines whether the level of the first data stream is not the lowest level; when the first data stream is not When the lowest level (that is, the lowest level), the switching device can determine that the first data stream does not meet the marking condition; when the level of the first data stream is not the lowest level, the switching device can then determine whether the switching device sends the first data stream.
- the switching device can determine that the first data stream meets the marking condition; when the switching device sends the first data stream at a rate less than or equal to the fair bandwidth, The switching device may determine that the first data stream does not meet the marking condition.
- step 406 to step 408 need to be executed to mark the data packets in the first data stream to reduce the transmission rate of the first data stream, eliminate congestion on the switching equipment, and improve the transmission of other data streams. effectiveness.
- the switching device determines that the first data stream does not meet the marking condition, it means that although the entire target queue is longer at this time, most of the data in the target queue is not the data of the first data stream (and/or the first data stream is in The bandwidth of the sending port occupies less), therefore, the data stream causing congestion of the switching device does not include the first data stream.
- step 410 may be directly executed. In this way, it can be achieved that when the length of the target queue is long, the ECN marking of the data stream with a small amount of data can be avoided, so that the transmission efficiency of the data stream with a small amount of data will not be reduced, and the data will not be affected. Less data flow causes time delay.
- the condition related to the data flow level in the marking condition is: the data flow level is a non-lowest level among multiple data flow levels as an example, and the marking condition is related to the data flow level
- Step 406 The switching device determines the target length range in which the length of the target queue is located in the n+1 length ranges. Go to step 407.
- n length thresholds may be pre-stored on the switching device, the minimum length threshold of the n length thresholds is the aforementioned first length threshold, and the maximum length threshold of the n length thresholds is the aforementioned second length threshold, n ⁇ 1.
- the switching device may also store n+1 length ranges obtained by dividing the foregoing n length thresholds.
- the n length thresholds may include: 100 kilobytes and 300 kilobytes, then the first length threshold is 100 kilobytes, and the second length threshold is 300 kilobytes.
- the n+1 length ranges may include: (0 kilobytes, 100 kilobytes], (100 kilobytes, 300 kilobytes], and (300 kilobytes, + ⁇ kilobytes).
- the n length thresholds may include: 100 kilobytes, 300 kilobytes, and 500 kilobytes, then the first length threshold is 100 kilobytes, and the second length threshold is 500 kilobytes.
- the n+1 The length range can include: (0 kilobytes, 100 kilobytes], (100 kilobytes, 300 kilobytes), (300 kilobytes, 500 kilobytes) and (500 kilobytes, + ⁇ kilobytes) byte].
- the switching device needs to find the target length range in which the length of the target queue is located among the aforementioned n+1 length ranges according to the length of the target queue. For example, suppose the n+1 length ranges include: (0 kilobytes, 100 kilobytes], (100 kilobytes, 300 kilobytes], and (300 kilobytes, + ⁇ kilobytes), the target The length of the queue is 200 kilobytes, then the target length range can be determined as (100 kilobytes, 300 kilobytes).
- Step 407 The switching device determines the marking probability corresponding to the first data stream according to the level of the first data stream and the target length range. Step 408 is executed.
- the switching device can determine the first data stream according to the level and target length range of the first data stream.
- the marking probability corresponding to the first data stream is also: the probability that the data packet in the first data stream is marked by the ECN.
- the marking probability corresponding to the first data stream is greater; when the level of the first data stream is unchanged, if the target length range (also That is, the greater the length within the length range of the target queue is, the greater the marking probability corresponding to the first data stream.
- the target length range also That is, the greater the length within the length range of the target queue is, the greater the marking probability corresponding to the first data stream.
- the higher the level of the first data stream the greater the data volume of the first data stream.
- the greater the degree of association between the first data stream and the transmission congestion the more data packets in the first data stream need to be ECN Marking greatly reduces the transmission rate of the first data stream, thereby reducing the length of the target queue and reducing the congestion of the switching device.
- the above-mentioned at least one data stream includes data stream 1, data stream 2, and data stream 3.
- the target parameter of data stream 1, the target parameter of data stream 2, and the target parameter of data stream 3 are sequentially Increase, and the target parameter of data stream 1 is less than the first target parameter threshold, and the target parameters of data stream 2 and data stream 3 are both greater than the first target parameter threshold.
- the tag probabilities corresponding to the three data streams are all zero. At this time, none of the data packets in the three data streams will be marked by ECN.
- the level of data stream 1 is "level one", so the marking probability corresponding to data stream 1 is zero, and the data packets in data stream 1 will not be marked by ECN.
- the levels of data streams 2 and 3 are both greater than "first level”, therefore, the marking probabilities corresponding to data streams 2 and 3 are both greater than zero.
- the marking probability corresponding to data stream 2 is smaller than the marking probability corresponding to data stream 3.
- one data packet in data stream 2 is marked with ECN and is marked with a mark E, and two data packets in data flow 3 are marked with ECN and marked with two marks E.
- the level of data stream 1 is "level one", so the marking probability corresponding to data stream 1 is zero, and the data packets in data stream 1 will not be marked by ECN.
- the levels of data streams 2 and 3 are both greater than "first level”, so the tag probabilities corresponding to data streams 2 and 3 are both greater than zero, and since the target parameter of data stream 2 is smaller than the target parameter of data stream 3, data stream 2 corresponds to The marking probability of is smaller than the marking probability corresponding to data stream 3.
- two data packets in data flow 2 are marked with ECN and marked with two marks E, and four data packets in data flow 3 are marked with ECN.
- the ECN mark was marked with four E marks.
- the switching device can determine the marking probability corresponding to the first data stream in a variety of ways according to the level and target length range of the first data stream. For example, the switching device may combine the first formula to determine the marking probability corresponding to the first data stream according to the level of the first data stream and the target length range.
- Step 408 The switching device performs ECN marking on the data packet in the first data stream according to the marking probability corresponding to the first data stream.
- the switching device can perform ECN marking on the data packets in the first data stream according to the marking probability. For example, the greater the marking probability corresponding to the first data stream, the more ECN-marked data packets in the first data stream; the lower the marking probability corresponding to the first data stream, the more ECN-marked packets in the first data stream The fewer packets.
- the marking probability corresponding to the first data stream is zero, the data packets in the first data stream may not be ECN marking; when the marking probability corresponding to the first data stream is greater than zero, the corresponding marking probability of the first data stream may be The marking probability of is ECN marking the data packet in the first data stream.
- Step 409 The switching device performs ECN marking on each data packet in the first data stream.
- each data packet of the first data stream needs to be ECN marked to quickly reduce the first data stream. Transmission rate, and then quickly reduce the length of the target queue to avoid packet loss.
- the ECN marking is performed on each data packet of the first data stream in step 409 as an example (equivalent to the marking probability corresponding to the first data stream being 100%).
- the marking probability corresponding to the first data stream is not 100%, but is a greater probability, such as a probability of 90% to 99%, or a probability of 85% to 99%
- the data packets in the first data stream are ECN marked according to the marking probability corresponding to the first data stream, which is not limited in the embodiment of the present application.
- Step 410 The switching device does not perform ECN marking on the data packet in the first data stream.
- the switching device determines that the length of the target queue is less than the first length threshold, it can be determined that the length of the target queue neither satisfies the first length condition nor the second length condition. At this time, it indicates that the length of the target queue is small and the target queue Congestion does not occur, therefore, the switching device does not need to perform ECN marking on the data packet in the first data stream.
- the switching device determines that the target queue meets the first length condition and the first data stream does not meet the marking condition, it indicates that the length of the target queue is relatively large, but more data in the target queue is not the data in the first data stream. Therefore, the first data flow is not a data flow that causes congestion in the target queue, and the switching device does not need to perform ECN marking on the data packets in the first data flow.
- the ECN marking is not performed on each data packet of the first data stream in step 410 as an example (equivalent to the marking probability corresponding to the first data stream being zero).
- the marking probability corresponding to the first data stream is not 0, but is a relatively small probability, such as a probability of 1% to 10%, or a probability of 2% to 20%, etc. , And then perform ECN marking on the data packet in the first data stream according to the marking probability corresponding to the first data stream, which is not limited in this embodiment of the application.
- the switching device determines that the first data stream meets the marking condition, it means that the target queue is longer at this time, and most of the data in the target queue is the first.
- the data of the data stream therefore, the data stream causing congestion of the switching device includes the first data stream.
- the data packets in the first data stream need to be ECN marked to reduce the transmission rate of the first data stream, eliminate congestion on the switching device, and improve the transmission efficiency of other data streams.
- the switching device determines that the first data stream does not meet the marking condition, it means that although the entire target queue is longer at this time, most of the data in the target queue is not the data of the first data stream, thus causing congestion of the switching device
- the data stream does not include the first data stream.
- the length of the target queue is long, the ECN marking of the data stream with a small amount of data can be avoided, so that the transmission efficiency of the data stream with a small amount of data will not be reduced, and it will not be affected.
- Data flow with less data causes time delay.
- the first example takes the above marking condition including: the level of the data stream is not the lowest level as an example.
- FIG. 7 is a schematic diagram of another data stream transmission provided by an embodiment of the application. As shown in FIG. 7, it is assumed that at least one data stream buffered in the target queue includes: data stream 1, data stream 2, and data stream 3.
- the length threshold includes: 100 kilobytes (first length threshold) and 300 kilobytes (second length threshold), and n target parameter thresholds include: 2 megabytes (first target parameter threshold).
- first target parameter threshold Assume that the length of the target queue determined by the switching device is 200 kilobytes, and the switching device counts that the target parameter of data stream 1 is 500 kilobytes, the target parameter of data stream 2 is 1.5 megabytes, and data stream 3 The target parameter is 6 megabytes.
- the switching device may determine that the length of the target queue is greater than the first length threshold (100 kilobytes) and less than or equal to the second length threshold (300 kilobytes). After that, the switching device may compare the target parameters of data stream 1, data stream 2, and data stream 3 with the first target parameter threshold respectively.
- the switching device can determine: the target parameter of data stream 1 (500 kilobytes) is less than the first target parameter threshold (2 megabytes), so the level of data stream 1 is "level one"; the level of data stream 2 The target parameter (1.5 megabytes) is less than the first target parameter threshold (2 megabytes), so the level of data stream 2 is "level one”; the target parameter (6 megabytes) of data stream 3 is greater than the first target parameter The threshold (2 megabytes), so the level of data stream 3 is "secondary".
- the switching device can determine the first The level of data stream 1 and the level of data stream 2 are both the lowest level, and the level of data stream 3 is not the lowest level. Furthermore, the switching device can determine that data stream 1 and data stream 2 do not meet the marking condition, and does not perform ECN marking on the data packets in data stream 1 and data stream 2. The switching device can also determine that the data stream 3 meets the marking condition.
- both data stream 1 and data stream 2 with a small amount of data may be ECN marked.
- data stream 1 and data stream 2 with a small amount of data are protected without ECN marking, which reduces the delay of data stream 1 and data stream 2.
- the second example takes the above marking condition including: the level of the data stream is not the lowest level as an example.
- Fig. 8 is a schematic diagram of another data stream transmission provided by an embodiment of the application. As shown in Fig. 8, it is assumed that the above-mentioned at least one data stream includes: data stream 1, data stream 2, and data stream 3.
- the m length thresholds include: 100 kilobytes (first length threshold) and 300 kilobytes (second length threshold), n target parameter thresholds include: 2 megabytes (first target parameter threshold) and 5 megabytes.
- the length of the target queue determined by the switching device is 200 kilobytes, and the switching device counts that the target parameter of data stream 1 is 500 kilobytes, the target parameter of data stream 2 is 2.5 megabytes, and data stream 3
- the target parameter is 6 megabytes.
- the switching device may determine that the length of the target queue is greater than the first length threshold (100 kilobytes) and less than or equal to the second length threshold (300 kilobytes). After that, the switching device may compare the target parameters of data stream 1, data stream 2, and data stream 3 with the first target parameter threshold respectively.
- the switching device can determine: the target parameter of data stream 1 (500 kilobytes) is less than the first target parameter threshold (2 megabytes), so the level of data stream 1 is "level one"; the level of data stream 2 The target parameter (1.5 megabytes) is less than the first target parameter threshold (2 megabytes), so the level of data stream 2 is "level one”; the target parameter (6 megabytes) of data stream 3 is greater than the first target parameter The threshold (2 megabytes), so the level of data stream 3 is "secondary".
- the exchange The device may determine that the level of the first data stream 1 is the lowest level, and the levels of the data stream 2 and the data stream 3 are not the lowest level. Furthermore, the switching device can determine that data stream 1 does not meet the marking condition, and does not perform ECN marking on the data packets in data stream 1. The switching device may also determine that data stream 2 and data stream 3 meet the marking conditions.
- the marking method in the related art is used to perform ECN marking on the data packet, the data stream 1 with a small amount of data may be ECN marked. However, in this embodiment of the present application, data stream 1 with a small amount of data is protected, and ECN marking is not performed, which reduces the delay of data stream 1.
- the third example takes the above marking condition including: the level of the data stream is not the lowest level as an example.
- Fig. 9 is a schematic diagram of another data stream transmission provided by an embodiment of the application. As shown in Fig. 9, it is assumed that the above at least one data stream includes: data stream 1, data stream 2, and data stream 3.
- the m length thresholds include: 100 kilobytes (first length threshold), 300 kilobytes, and 500 kilobytes (second length threshold), n target parameter thresholds include: 1 megabyte (first target parameter threshold) and 5 megabytes .
- the length of the target queue determined by the switching device is 400 kilobytes, and the switching device counts that the target parameter of data stream 1 is 500 kilobytes, the target parameter of data stream 2 is 3 megabytes, and data stream 3
- the target parameter is 8 megabytes.
- the switching device may determine that the length of the target queue is greater than 300 kilobytes and less than or equal to 500 kilobytes (the length of the target queue is also greater than the first length threshold and less than or equal to the second length threshold). After that, the switching device may compare the target parameters of data stream 1, data stream 2, and data stream 3 with the first target parameter threshold respectively.
- the switching device can determine: the target parameter (500 kilobytes) of data stream 1 is less than the first target parameter threshold (1 megabyte), so the level of data stream 1 is "level one"; the level of data stream 2 The target parameter (3 megabytes) is greater than the first target parameter threshold (1 megabyte) but less than 5 megabytes, so the level of data stream 2 is "secondary”; the target parameter of data stream 3 (8 megabytes) Section) is greater than 5 megabytes (the target parameter of data stream 3 is also greater than the first target parameter threshold), so the level of data stream 3 is "level three".
- the exchange The device may determine that the level of the first data stream 1 is the lowest level, and the levels of the data stream 2 and the data stream 3 are not the lowest level. Furthermore, the switching device can determine that data stream 1 does not meet the marking condition, and does not perform ECN marking on the data packets in data stream 1. The switching device may also determine that data stream 2 and data stream 3 meet the marking conditions.
- the data packet in is ECN marked.
- the marking method in the related art is used to perform ECN marking on the data packet, the data stream 1 with a small amount of data may be ECN marked. However, in this embodiment of the present application, data stream 1 with a small amount of data is protected, and ECN marking is not performed, which reduces the delay of data stream 1.
- the fourth example uses the above marking conditions to include: the level of the data stream is not the lowest level, and the rate at which the switching device sends the data stream is greater than the fair bandwidth.
- Fig. 10 is a schematic diagram of another data stream transmission provided by an embodiment of the application. As shown in Fig. 10, it is assumed that the above at least one data stream includes: data stream 1, data stream 2, and data stream 3.
- the m length thresholds include: 100 kilobytes (first length threshold) and 300 kilobytes (second length threshold), the n target parameter thresholds include: 5 megabytes (first target parameter threshold).
- the switching device counts that the target parameter of data stream 1 is 500 kilobytes, and the rate at which the switching device sends data streams is 0.01 times the sending port ( At this time, take the target port as the sending port as an example) bandwidth, the target parameter of data stream 2 is 8 megabytes, and the rate at which the switching device sends the data stream is 0.2 times the bandwidth of the sending port, and the target parameter of data stream 3 is 10 megabytes, and the data flow rate of the switching device is 0.8 times the bandwidth of the sending port.
- the switching device may determine that the length of the target queue is greater than 100 kilobytes and less than or equal to 300 kilobytes (the length of the target queue is also greater than the first length threshold and less than or equal to the second length threshold). After that, the switching device may compare the target parameters of data stream 1, data stream 2, and data stream 3 with the first target parameter threshold respectively.
- the switching device can determine: the target parameter (500 kilobytes) of data stream 1 is less than the first target parameter threshold (5 megabytes), so the level of data stream 1 is "level one"; the level of data stream 2 The target parameter (8 megabytes) is greater than the first target parameter threshold (5 megabytes) but less than 5 megabytes, so the level of data stream 2 is "secondary”; the target parameter of data stream 3 (10 megabytes) Section) is greater than the first target parameter threshold (5 megabytes), so the level of data stream 3 is "secondary".
- the switching device can determine the first The level of data stream 1 is the lowest level, and the levels of data stream 2 and data stream 3 are not the lowest level. Furthermore, the switching device can determine that data stream 1 does not meet the marking condition, and does not perform ECN marking on the data packets in data stream 1.
- the switching device can also compare the rate at which the switching device sends data stream 2 and data stream 3 with the fair bandwidth to draw the following conclusion: the rate at which the switching device sends data stream 2 (0.2 times the bandwidth of the sending port) is less than The fair bandwidth (0.5 times the bandwidth of the sending port), the rate at which the switching device sends data stream 3 (0.8 times the bandwidth of the sending port) is greater than the fair bandwidth (0.5 times the bandwidth of the sending port). Furthermore, the switching device can determine that the data stream 2 does not meet the marking condition, and the data stream 3 meets the marking condition. Therefore, the data stream 2 does not need to be ECN marked, but the data stream 3 needs to be ECN marked.
- the marking method in the related art is used to mark the data packet with ECN, the data stream 1 with less data volume and the data stream 2 with lower transmission rate may be ECN marked.
- data stream 1 with a small amount of data and data stream 2 with a small transmission rate are protected without ECN marking, which reduces the delay of data stream 1 and data stream 2.
- the switching device determines the level of the first data stream according to the target parameters of the first data stream, and then determines the marking probability corresponding to the first data stream according to the level of the first data stream and the target length range.
- the marking probability corresponding to the first data stream may be determined in other ways, and several other implementations for determining the marking probability corresponding to the first data stream will be explained as examples below.
- the switching device may also directly determine the marking probability corresponding to the first data stream according to the target parameter of the first data stream. That is, when determining the marking probability corresponding to the first data stream, a more appropriate marking probability may be determined based on only the target parameter.
- the marking probability determined according to the second target parameter when the marking probability determined according to the second target parameter is greater than the marking probability determined according to the first target parameter, it indicates that the second target parameter is greater than the first target parameter.
- the marking probability determined according to the first target parameter may be 20%
- the marking probability determined according to the second target parameter may be 40%.
- the marking probability determined according to the one target parameter is not necessarily greater than the marking probability determined according to the other target parameter.
- the marking probability determined according to the target parameter of 500 kilobytes may be 20%
- the marking probability determined according to the target parameter of 600 kilobytes may also be 20%.
- the marking probability determined according to the one target parameter can also be greater than the marking probability determined according to the other target parameter, that is, the target parameter of the data stream can also be the same as the data
- the tag probability of the stream is positively correlated, which is not limited in the embodiment of the present application.
- the switching device may first determine the level of the first data stream according to the target parameters of the first data stream, and then according to the target parameters and levels of the first data stream (or only according to the first data stream Stream level) to determine the marking probability corresponding to the first data stream. That is, when determining the marking probability corresponding to the first data stream, not only the target parameter of the first data stream, but also the level of the first data stream may be considered to determine a more appropriate marking probability. Alternatively, when determining the marking probability corresponding to the first data stream, a more appropriate marking probability may be determined based on only the level of the first data stream.
- the level of the first data stream may be related to the target parameter of the first data stream.
- the second stream level (one data stream level) related to the second target parameter is greater than the first stream level (another data stream level) related to the first target parameter
- the second target parameter is greater than the first target parameter. That is, when the data flow level is larger, the target parameter related to the data flow level is larger.
- the data flow level related to the one target parameter is not necessarily greater than the data flow level related to the other target parameter.
- the target parameter of the first data stream is located in one target parameter range among the multiple target parameter ranges, and the multiple target parameter ranges correspond to multiple data stream levels one-to-one, and the level of the first data stream is: multiple data The data stream level corresponding to the above-mentioned one target parameter range (that is, the target parameter range where the target parameter of the first data stream is located) in the stream level.
- the switching device may first find a target parameter range in which the target parameter of the first data stream is located among the multiple target parameter ranges.
- the switching device may search for the data flow level corresponding to the one target parameter range in the one-to-one correspondence between the multiple target parameter ranges and the multiple data flow levels, and determine the data flow level as the level of the first data flow. .
- the process of determining the level of the first data stream reference may be made to the description in the embodiment shown in FIG. 5, and details are not described in the embodiment of the present application.
- the data flow level related to the one target parameter may also be greater than the data flow level related to the other target parameter, that is, the target parameter of the data flow is also It can be positively correlated with the level of the data stream, which is not limited in the embodiment of the present application.
- the switching device determines the marking probability corresponding to the first data stream according to the level of the first data stream
- the marking probability determined according to the second stream level one data stream level
- the first stream level the other Data stream level
- the marking probability determined according to the one data flow level may also be greater than the marking probability determined according to the other data flow level, that is, the target level of the data flow It may also be positively correlated with the marking probability of the data stream, which is not limited in the embodiment of the present application.
- the switching device determines the marking probability corresponding to the first data stream according to the target parameter and level of the first data stream
- the determined marking corresponding to the first data stream The probability may increase as the target parameter of the first data stream increases. That is, when the level of the first data stream is unchanged, the marking probability corresponding to the first data stream may be positively correlated with the target parameter of the first data stream. The marking probability corresponding to the first data stream may also be positively correlated with the level of the first data stream.
- the switching device determines the marking probability corresponding to the first data stream according to at least one of the target parameter and the level of the first data stream.
- the switching device may also determine the marking probability corresponding to the first data stream according to at least one of the target parameter and other parameters of the first data stream.
- the other parameter is also related to the target parameter of the first data stream.
- the other parameter may be: the difference between the target parameter of the first data stream and a target parameter threshold.
- the switching device can determine the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, and the auxiliary parameter can be related to the target parameter of the first data stream (such as The auxiliary parameter is the level of the first data stream, etc.).
- the switching device determines the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, it can also be combined with that the target parameter and auxiliary parameter are different.
- the parameter to determine the marking probability corresponding to the first data stream may determine the marking probability corresponding to the first data stream according to at least one of the target parameter and auxiliary parameter (such as level) of the first data stream, and at least one of the length and level of the target queue.
- the level of the target queue is related to the length of the target queue. For example, when the second queue level related to the second queue length is greater than the first queue level related to the first queue length, the second queue length is greater than the first queue length. That is, when the queue level is larger, the queue length related to the queue level is larger.
- the length of the target queue may be within a length range of multiple length ranges, and the multiple length ranges correspond to multiple queue levels one-to-one.
- the level of the target queue is: the multiple queue levels and the one length range ( That is, the length range of the length of the target queue) corresponds to the queue level. That is, when the queue level is larger, the queue length associated with the queue level is larger.
- the switching device may first search for a length range where the length of the target queue is located among multiple length ranges. After that, the switching device may find the queue level corresponding to the one length range in the one-to-one correspondence between the multiple length ranges and the multiple queue levels, and use the queue level as the level of the target queue.
- the queue level related to the length of the one queue is not necessarily greater than the queue level related to the length of the other queue.
- the queue level related to the length of the one queue must also be greater than the queue level related to the length of the other queue.
- the rank of the queue is positively related to the length of the queue, which is not limited in the embodiment of the present application.
- other methods may also be used to determine the level of the target queue according to the length of the target queue, which is not limited in the embodiment of the present application.
- the switching device can substitute the length of the target queue into a certain formula to obtain the level of the target queue.
- the input of the formula is the length of the queue
- the output of the formula is the rank of the queue.
- the third achievable manner may also have solutions different from the solutions mentioned in the following aspects.
- the embodiments of this application will not repeat them here. .
- the switching device may determine the marking probability corresponding to the first data flow according to the level of the first data flow and the length of the target queue. Wherein, if the level of the first data flow remains unchanged, when the marking probability determined according to the second queue length is greater than the marking probability determined according to the first queue length, it indicates that the second queue length is greater than the first queue length. It should be noted that if the level of the first data flow remains unchanged, when the length of one queue is greater than the length of another queue, the marking probability determined according to the length of the one queue may not be greater than the marking probability determined according to the length of the other queue.
- the marking probability determined according to the length of the one queue may also be greater than the marking probability determined according to the length of the other queue, that is Yes, the length of the target queue may also be positively correlated with the marking probability of the data stream, which is not limited in the embodiment of the present application.
- the switching device may determine the marking probability corresponding to the first data stream according to the level of the first data stream and the level of the target queue. Wherein, if the level of the first data stream remains unchanged, when the marking probability determined according to the second queue level is greater than the marking probability determined according to the first queue level, it indicates that the second queue level is greater than the first queue level. It should be noted that if the level of the first data flow remains unchanged, when one queue level is greater than another queue level, the marking probability determined according to the one queue level is not necessarily greater than the marking probability determined according to the other queue level.
- the marking probability determined according to the one queue level may also be greater than the marking probability determined according to the other queue level, that is Yes, the level of the target queue may also be positively correlated with the marking probability of the data stream, which is not limited in the embodiment of the present application.
- the switching device can determine the marking probability corresponding to the first data stream according to the target parameter and level of the first data stream, and the length and level of the target queue.
- the relationship between the marking probability corresponding to the first data stream, the target parameter of the first data stream, and the length of the target queue satisfies at least one of the following:
- the marking probability corresponding to the first data stream increases as the length of the target queue increases; if the length of the target queue does not change, the marking probability corresponding to the first data stream increases with the first data stream.
- the target parameter of a data stream increases as it increases; if the target parameter of the first data stream remains unchanged, the marking probability corresponding to the first data stream remains unchanged as the length of the target queue increases; if the length of the target queue does not change If it changes, the marking probability corresponding to the first data stream remains unchanged as the target parameter of the first data stream increases.
- the switching device determines the marking probability corresponding to the first data stream according to the target parameter and level of the first data stream, and the length and level of the target queue, it can determine the corresponding value of the first data stream in combination with a formula Mark the probability.
- this formula can be set from the first formula in the embodiment shown in FIG. 5 to set Q(i,j) to be
- the target parameter of a data stream and the length of the target queue are obtained by a positive correlation function.
- this formula can be set to Q(i,j) as the first formula in the embodiment shown in FIG. 5 Constant get.
- the switching device determines the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, it can also be combined with that the target parameter and auxiliary parameter are different.
- the parameter to determine the marking probability corresponding to the first data stream may determine the first data stream according to at least one of the target parameter and auxiliary parameter (such as level) of the first data stream, and at least one of the transmission rate of the first data stream and the level of the transmission rate of the first data stream.
- the marking probability corresponding to a data stream may be determined the first data stream according to at least one of the target parameter and auxiliary parameter (such as level) of the first data stream, and at least one of the transmission rate of the first data stream and the level of the transmission rate of the first data stream.
- the level of the transmission rate of the first data stream is related to the transmission rate. For example, when the second transmission rate level is greater than the first transmission rate level, it indicates that the second transmission rate is greater than the first transmission rate. That is, when the transmission rate level is larger, the transmission rate related to the transmission rate level is greater. However, when one transmission rate is greater than another transmission rate, the transmission rate level related to the one transmission rate is not necessarily greater than the transmission rate level related to the other transmission rate.
- the transmission rate of the first data stream is within one transmission rate range of the multiple transmission rate ranges, and the multiple transmission rate ranges correspond to multiple transmission rate levels one-to-one, and the transmission rate levels of the first data stream are: The transmission rate level corresponding to the one transmission rate range among the multiple transmission rate levels.
- the switching device may first search for a transmission rate range in which the transmission rate of the first data stream is located among multiple transmission rate ranges. After that, the switching device can search for the transmission rate level corresponding to the one transmission rate range in the one-to-one correspondence between the multiple transmission rate ranges and the multiple transmission rate levels, and use the transmission rate level as the transmission of the first data stream.
- the rate level is positively correlated with the transmission rate, which is not limited in the embodiment of the present application.
- the switching device may substitute the transmission rate of the first data stream into a certain formula to obtain the level of the transmission rate of the first data stream.
- the input of the formula is the transmission rate of the data stream
- the output of the formula is the level of the transmission rate of the first data stream of the data stream.
- the fourth achievable manner may also have solutions different from the solutions mentioned in the following aspects.
- the embodiments of the application will not repeat them here. .
- the switching device may determine the marking probability corresponding to the first data stream according to the target parameter of the first data stream and the transmission rate of the first data stream. Wherein, if the target parameter of the first data stream remains unchanged, when the marking probability determined according to the second transmission rate is greater than the marking probability determined according to the first transmission rate, it indicates that the second transmission rate is greater than the first transmission rate. It should be noted that if the target parameter of the first data stream remains unchanged, when one transmission rate is greater than another transmission rate, the marking probability determined according to the one transmission rate is not necessarily greater than the marking probability determined according to the other transmission rate .
- the marking probability determined according to the one transmission rate may also be greater than the marking probability determined according to the other transmission rate. That is, the transmission rate may also be positively correlated with the marking probability of the data stream, which is not limited in the embodiment of the present application.
- the switching device may determine the marking probability corresponding to the first data stream according to the level of the first data stream and the level of the transmission rate of the first data stream. Wherein, if the level of the first data stream remains unchanged, when the marking probability determined according to the second transmission rate level is greater than the marking probability determined according to the first transmission rate level, it indicates that the second transmission rate is greater than the first transmission rate. It should be noted that if the level of the first data stream remains unchanged, when one transmission rate level is greater than another transmission rate level, the marking probability determined according to the one transmission rate level is not necessarily greater than that determined according to the other transmission rate level. The probability of marking.
- the transmission rate level determined according to the one transmission rate level may also be greater than the transmission rate level determined according to the other transmission rate level.
- the transmission rate level that is, the transmission rate level may also be positively related to the marking probability of the data stream, which is not limited in the embodiment of the present application.
- the switching device may determine the marking probability corresponding to the first data stream according to the target parameter and level of the first data stream, and the transmission rate of the first data stream and the level of the transmission rate of the first data stream.
- the relationship between the marking probability corresponding to the first data stream, the target parameter of the first data stream and the transmission rate satisfies at least one of the following :
- the marking probability corresponding to the first data stream increases as the transmission rate of the first data stream increases; if the transmission rate of the first data stream remains unchanged, the first data stream The tag probability corresponding to the stream increases as the target parameter of the first data stream increases; if the target parameter of the first data stream remains unchanged, the tag probability corresponding to the first data stream increases with the transmission rate of the first data stream It remains unchanged; if the transmission rate of the first data stream does not change, the marking probability corresponding to the first data stream remains unchanged as the target parameter of the first data stream increases.
- the switching device determines the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, it may also be combined with that the target parameter and auxiliary parameter are different.
- the parameter to determine the marking probability corresponding to the first data stream can be based on at least one of the target parameter and auxiliary parameter (such as level) of the first data stream, at least one of the length and level of the target queue, and the transmission rate of the first data stream and the value of the first data stream. At least one of the transmission rate levels determines the marking probability corresponding to the first data stream.
- the relationship between the level of the target queue and the length of the target queue can be detailed in the explanation in the third achievable manner, and the relationship between the level of the transmission rate of the first data stream and the transmission rate can be detailed in the fourth achievable manner.
- the explanation of the embodiments of this application will not be repeated here.
- the fifth achievable manner may also have solutions that are different from the solutions mentioned in the following aspects.
- the embodiments of the application will not repeat them here. .
- the switching device may determine the marking probability corresponding to the first data stream according to the target parameter of the first data stream, the length of the target queue, and the transmission rate of the first data stream.
- the marking probability determined according to the second transmission rate is greater than the marking probability determined according to the first transmission rate, it indicates that the second transmission rate is greater than the The first transmission rate. It should be noted that if the target parameter of the first data stream and the length of the target queue are both unchanged, when one transmission rate is greater than the other transmission rate, the marking probability determined according to the one transmission rate is not necessarily greater than that according to the other transmission rate. Marking probability determined by transmission rate. Of course, if the target parameter of the first data stream and the length of the target queue are unchanged, when one transmission rate is greater than the other transmission rate, the marking probability determined according to the one transmission rate may also be greater than that according to the other transmission rate. The determined marking probability, that is, the transmission rate may also be positively correlated with the marking probability of the data stream, which is not limited in the embodiment of the present application.
- the marking probability determined according to the second queue length is greater than the marking probability determined according to the first queue length, it indicates that the second queue length is greater than all The length of the first queue. It should be noted that if the target parameter of the first data stream and the transmission rate of the first data stream are both unchanged, when the length of one queue is greater than the length of another queue, the marking probability determined according to the length of the one queue is not necessarily greater than that according to Marking probability determined by the length of this other queue.
- the marking probability determined according to the length of the one queue can also be greater than that according to the other.
- the marking probability determined by a queue length that is, the queue length may also be positively correlated with the marking probability of the data stream, which is not limited in the embodiment of the present application.
- the switching device may determine the marking probability corresponding to the first data stream according to the level of the first data stream, the level of the target queue, and the level of the transmission rate of the first data stream.
- the second transmission rate level is greater than the first transmission rate level.
- a transmission rate level if both the level of the first data stream and the level of the target queue remain unchanged, when one transmission rate level is greater than another transmission rate level, the marking probability determined according to the one transmission rate level is not necessarily greater than that according to the transmission rate level. Marking probability determined by another transmission rate level.
- the transmission rate level determined according to the one transmission rate level may also be greater than that according to the other transmission rate level.
- a transmission rate level determined by the transmission rate level that is, the transmission rate level may also be positively correlated with the marking probability of the data stream, which is not limited in the embodiment of the present application.
- the second queue level is greater than the first queue level.
- One queue level if the level of the first data stream and the level of the transmission rate of the first data stream are both unchanged, when one queue level is greater than another queue level, the marking probability determined according to the one queue level is not necessarily greater than The marking probability determined according to the other queue level.
- the transmission rate level determined according to the one queue level can also be greater than according to The transmission rate level determined by the other queue level, that is, the queue level may also be positively correlated with the marking probability of the data stream, which is not limited in this embodiment of the application.
- the switching device may determine the first data according to the target parameter and level of the first data stream, the length and level of the target queue, and the transmission rate of the first data stream and the level of the transmission rate of the first data stream.
- the marking probability corresponding to the first data stream, the length of the target queue, and the target parameter of the first data stream satisfies at least one of the following:
- the marking probability corresponding to the first data stream increases as the transmission rate of the first data stream increases; if the target parameter of the first data stream and the first data stream increase If the transmission rate of a data stream remains unchanged, the marking probability corresponding to the first data stream increases as the length of the target queue increases; if the transmission rate of the first data stream and the length of the target queue remain unchanged, the first data stream The tag probability corresponding to the stream increases with the increase of the target parameter of the first data stream; if the target parameter of the first data stream and the length of the target queue remain unchanged, the tag probability corresponding to the first data stream increases with the first data stream.
- the transmission rate of the first data stream increases and remains unchanged; if the target parameter of the first data stream and the transmission rate of the first data stream remain unchanged, the marking probability corresponding to the first data stream remains unchanged as the length of the target queue increases. Change; if the transmission rate of the first data stream and the length of the target queue remain unchanged, the marking probability corresponding to the first data stream remains unchanged as the target parameter of the first data stream increases.
- the marking probability corresponding to the first data stream before determining the marking probability corresponding to the first data stream, it is also possible to first determine whether the first data stream meets the marking condition. For example, before determining the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, it is determined whether the first data stream meets the marking condition. Or, before determining the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, and at least one parameter different from the target parameter and the auxiliary parameter, the first data stream is determined Whether the marking conditions are met. By judging the marking conditions, it is possible to reduce the probability of marking the data packets in the first data stream for congestion in some cases where the marking conditions are met, thereby reducing the delay of the first data stream.
- the marking condition may be any condition related to the condition for marking the data packet.
- the marking condition may include: the level of the first data stream does not belong to the lower q levels among the designated multiple data stream levels, and q ⁇ 1.
- the specified multiple data stream levels may be the same as or different from the multiple data stream levels in step 404, which is not limited in this embodiment of the application.
- the marking condition may include: the transmission rate of the first data stream is greater than the transmission rate threshold.
- the transmission rate threshold is a constant or variable, that is, the transmission rate can be a fixed value or a variable related to certain parameters (such as the number of target ports, etc.).
- the transmission rate threshold may be the fair bandwidth in the embodiment shown in FIG. 5.
- the transmission rate threshold can support the staff to change the transmission rate threshold.
- FIG. 11 is a flowchart of another data packet marking method provided by an embodiment of the application.
- the method can be used in the switching device 02 in the data transmission system shown in FIG. 1.
- Packet marking methods can include:
- Step 1001 Calculate the target parameters of the first data stream, where the target queue of the switching device is used to buffer data packets of at least one data stream, the first data stream is one data stream in at least one data stream, and the target parameter is used To reflect the data volume of the first data stream.
- step 1101 can refer to step 301, and the description of the embodiment of the present application is not repeated here.
- Step 1102 When the length of the target queue meets the first length condition, determine the marking probability corresponding to the first data stream according to at least one of the target parameter and auxiliary parameter of the first data stream, where the auxiliary parameter of the first data stream Related to the target parameter of the first data stream.
- the switching device may determine the marking probability corresponding to the first data stream based on at least one of the target parameter and the auxiliary parameter of the first data stream. It should be noted that the marking probability corresponding to the first data stream determined in step 1102 may be 0 or greater than 0, which is not limited in this embodiment of the application.
- Step 303 Mark the data packets in the first data stream for congestion according to the marking probability corresponding to the first data stream.
- the switching device may mark the data packets in the first data stream for congestion according to the marking probability corresponding to the first data stream.
- the probability that the data packet in the first data stream is marked by congestion may be equal to the marking probability corresponding to the first data stream.
- the switching device may not mark the data packets in the first data flow for congestion.
- the switching device when the switching device determines that the length of the target queue meets the first length condition, it indicates that the target queue is longer at this time. At this time, the switching device may determine the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, so as to realize the combination of at least one of the target parameter and auxiliary parameter of the first data stream. Data packets in a data stream are marked for congestion. Reduce the probability that all data streams are marked for congestion, so as to avoid reducing the transmission efficiency of all data streams and avoid causing delays to all data streams.
- marking the data packets in the first data stream for congestion in this application may include: marking the data packets in the first data stream with ECN marking, or recording a data packet in the first data stream that reflects The congestion value of the congestion degree may also be recorded in the data packet of the first data stream, and other information reflecting congestion is recorded.
- FIG. 12 is a schematic structural diagram of a data packet marking device provided by an embodiment of the application.
- the data packet marking device may be used in the switching device in FIG. 1.
- the data packet marking device 10 may include:
- the statistics module 101 is configured to perform statistics on the target parameters of the first data flow, wherein the target queue of the switching device is used to buffer data packets of at least one data flow, and the first data flow is any data flow in the at least one data flow ,
- the target queue includes: a receiving queue or a sending queue, and the target parameter is used to reflect the data volume of the first data stream;
- the determining module 102 is configured to determine whether the first data stream meets the marking condition according to the target parameter of the first data stream when the length of the target queue meets the first length condition, wherein the first length condition includes: the length of the target queue is greater than The first length threshold, the target parameter of the data stream meeting the marking condition is greater than the first target parameter threshold, and the first length threshold and the first target parameter threshold are both greater than zero;
- the first marking module 103 is configured to perform a display congestion notification ECN mark on at least one data packet in the first data stream when the first data stream meets the marking condition.
- the judgment module determines that the first data stream meets the marking condition, it means that the target queue is longer at this time, and most of the data in the target queue is the first The data of the data stream, therefore, the data stream causing congestion of the switching device includes the first data stream.
- the first marking module needs to perform ECN marking on the data packets in the first data stream to reduce the transmission rate of the first data stream, eliminate congestion on the switching device, and improve the transmission efficiency of other data streams.
- the switching device determines that the first data stream does not meet the marking condition, it means that although the entire target queue is longer at this time, most of the data in the target queue is not the data of the first data stream, thus causing congestion of the switching device
- the data stream does not include the first data stream.
- the length of the target queue is long, the ECN marking of the data stream with a small amount of data can be avoided, so that the transmission efficiency of the data stream with a small amount of data will not be reduced, and it will not be affected.
- Data flow with less data causes time delay.
- the target parameter includes: the number of bytes, and the first target parameter threshold includes: the number of bytes threshold; or, the target parameter includes: the number of data packets, and the first target parameter threshold includes: the number of data packets threshold.
- the first length condition further includes: the length of the target queue is less than or equal to a second length threshold, and the second length threshold is less than infinity.
- FIG. 13 is a schematic structural diagram of another data packet marking device provided by an embodiment of the application. As shown in FIG. 13, based on FIG. 12, the data packet marking device 10 may further include:
- the first determining module 104 is configured to determine the level of the first data stream among the multiple data stream levels when the length of the target queue meets the first length condition, according to the target parameter of the first data stream;
- the level of the data stream is positively related to the target parameter of the data stream, and the marking condition includes: the level of the data stream is a non-lowest level among multiple data stream levels.
- the first determining module 104 is configured to: determine the level of the first data stream according to the target parameter of the first data stream, and the one-to-one correspondence between m+1 target parameter ranges and multiple data stream levels; where , M ⁇ 1, m+1 target parameter ranges are divided by m target parameter thresholds, the smallest target parameter threshold among the m target parameter thresholds is the first target parameter threshold, and the data stream level and target parameter corresponding to the target parameter range
- the target parameters in the range are positively correlated.
- FIG. 14 is a schematic structural diagram of a first marking module provided by an embodiment of the application.
- the first marking module 103 may include:
- the determining unit 1031 is configured to determine the marking probability corresponding to the first data stream, where the marking probability corresponding to the data stream is positively correlated with the level of the data stream;
- the marking unit 1032 is configured to perform ECN marking on the data packet in the first data stream according to the marking probability corresponding to the first data stream.
- the data packet marking device 10 may further include:
- the second determining module 105 is configured to determine the target length range in which the length of the target queue in the n+1 length ranges is located when the first data stream meets the marking condition;
- n ⁇ 1, n+1 length ranges are obtained by dividing n length thresholds, the minimum length threshold among the n length thresholds is the first length threshold, and the maximum length threshold among the n length thresholds is the second length threshold;
- the tag probability corresponding to the data stream is positively correlated with the length in the target length range.
- the determining unit 1031 in FIG. 14 may be used to:
- the marking condition further includes: the transmission rate of the data stream is greater than the fair bandwidth, and the fair bandwidth is positively correlated with the bandwidth of the target port,
- the transmission rate is the rate at which the switching device sends data streams
- the target port is a sending port in the switching device that is used to send data packets buffered in the target queue
- the transmission rate is the rate at which the switching device receives the data stream
- the target port is the receiving port of the switching device for receiving data packets buffered in the target queue.
- the fair bandwidth is negatively related to the target number
- the target number is: the number of data streams whose levels belong to a level set in at least one data stream, and the level set includes the higher p levels among multiple data flow levels,
- the level of the data stream is positively correlated with the target parameter of the data stream, 1 ⁇ p.
- the fair bandwidth is equal to the ratio of the bandwidth of the target port to the target number.
- the data packet marking device 10 may further include: a second marking module 106, which is configured to perform an evaluation of each data packet in the first data stream when the length of the target queue meets the second length condition Both perform ECN marking, and the second length condition includes: the length of the target queue is greater than the second length threshold.
- a second marking module 106 which is configured to perform an evaluation of each data packet in the first data stream when the length of the target queue meets the second length condition Both perform ECN marking, and the second length condition includes: the length of the target queue is greater than the second length threshold.
- the judgment module determines that the first data stream meets the marking condition, it means that the target queue is longer at this time, and most of the data in the target queue is the first The data of the data stream, therefore, the data stream causing congestion of the switching device includes the first data stream.
- the first marking module needs to perform ECN marking on the data packets in the first data stream to reduce the transmission rate of the first data stream, eliminate congestion on the switching device, and improve the transmission efficiency of other data streams.
- the switching device determines that the first data stream does not meet the marking condition, it means that although the entire target queue is longer at this time, most of the data in the target queue is not the data of the first data stream, thus causing congestion of the switching device
- the data stream does not include the first data stream.
- the length of the target queue is long, the ECN marking of the data stream with a small amount of data can be avoided, so that the transmission efficiency of the data stream with a small amount of data will not be reduced, and it will not be affected.
- Data flow with less data causes time delay.
- FIG. 15 is a schematic structural diagram of another data packet marking device provided by an embodiment of the application.
- the data packet marking device may be used in the switching device in FIG. 1.
- the data packet marking device 130 may include:
- the statistics module 1301 is configured to perform statistics on the target parameters of the first data flow, where the target queue of the switching device is used to buffer data packets of at least one data flow, and the first data flow is one data flow in the at least one data flow, The target parameter is used to reflect the data volume of the first data stream;
- the determining module 1302 is configured to determine the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream when the length of the target queue meets the first length condition, wherein the first data stream
- the auxiliary parameter of is related to the target parameter of the first data stream
- the marking module 1303 is configured to mark the data packets in the first data stream for congestion according to the marking probability corresponding to the first data stream.
- the determining module determines that the length of the target queue meets the first length condition, it indicates that the target queue is longer at this time.
- the determining module can determine the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, so as to realize the combination of at least one of the target parameter and the auxiliary parameter of the first data stream.
- Data packets in a data stream are marked for congestion. Reduce the probability that all data streams are marked for congestion, so as to avoid reducing the transmission efficiency of all data streams and avoid causing delays to all data streams.
- the auxiliary parameter includes the level of the first data stream.
- the determining module 1302 is configured to: determine the marking probability corresponding to the first data stream according to the target parameter of the first data stream; wherein the marking probability determined according to the second target parameter is greater than the marking probability determined according to the first target parameter In the case of probability, the second target parameter is greater than the first target parameter.
- the determining module 1302 is configured to: determine the marking probability corresponding to the first data stream according to the level of the first data stream; wherein, when the marking probability determined according to the second stream level is greater than the marking probability determined according to the first stream level , The second stream level is greater than the first stream level.
- the determining module 1302 is configured to: determine the marking probability corresponding to the first data stream according to the target parameter and level of the first data stream; wherein, when the level of the first data stream remains unchanged, The marking probability increases as the target parameter of the first data stream increases, or the marking probability corresponding to the first data stream remains unchanged as the target parameter of the first data stream increases.
- the second target parameter is greater than the first target parameter
- the target parameter of the first data stream is located within a target parameter range of the multiple target parameter ranges, and the multiple target parameter ranges correspond to multiple data stream levels one-to-one, and the levels of the first data stream are: multiple The data flow level corresponding to a target parameter range in the data flow level.
- the determining module 1302 includes: a first determining unit 13021, configured to determine at least one of the target parameters and levels of the first data stream, and the length and level of the target queue. Determine the marking probability corresponding to the first data stream; wherein the level of the target queue is related to the length of the target queue.
- the first determining unit 13021 is configured to: determine the marking probability corresponding to the first data stream according to the level of the first data stream and the length of the target queue; wherein, if the level of the first data stream remains unchanged, When the marking probability determined by the second queue length is greater than the marking probability determined according to the first queue length, the second queue length is greater than the first queue length.
- the first determining unit 13021 is configured to: determine the marking probability corresponding to the first data stream according to the level of the first data stream and the level of the target queue; wherein, if the level of the first data stream remains unchanged, When the marking probability determined by the second queue level is greater than the marking probability determined according to the first queue level, the second queue level is greater than the first queue level.
- the first determining unit 13021 is configured to: determine the marking probability corresponding to the first data stream according to the target parameter and level of the first data stream, and the length and level of the target queue; wherein, at the level of the first data stream When the levels of the target queue and the target queue are both unchanged, the relationship between the marking probability corresponding to the first data stream, the target parameter of the first data stream, and the length of the target queue satisfies at least one of the following: if the target parameter of the first data stream remains unchanged, Then the marking probability corresponding to the first data stream increases as the length of the target queue increases; if the length of the target queue does not change, the marking probability corresponding to the first data stream increases as the target parameter of the first data stream increases ;
- the relationship between the marking probability corresponding to the first data stream, the target parameter of the first data stream, and the length of the target queue satisfies at least one of the following: If the target parameter of a data stream does not change, the marking probability corresponding to the first data stream will remain unchanged as the length of the target queue increases; if the length of the target queue does not change, the marking probability corresponding to the first data stream will increase with the first data stream. The target parameter of the data stream increases and remains unchanged.
- the second queue length is greater than the first queue length
- the length of the target queue is within a length range of multiple length ranges, and the multiple length ranges correspond to multiple queue levels one-to-one, and the level of the target queue is: one of multiple queue levels corresponding to one length range Queue level.
- the determining module 1302 includes: a second determining unit 13022, configured to perform according to at least one of the target parameter and level of the first data stream, and the transmission rate of the first data stream And at least one of the levels of the transmission rate of the first data stream to determine the marking probability corresponding to the first data stream; wherein the level of the transmission rate of the first data stream is related to the transmission rate.
- the second determining unit 13022 is configured to: determine the marking probability corresponding to the first data stream according to the target parameter of the first data stream and the transmission rate of the first data stream; wherein, if the target parameter of the first data stream is not If the marking probability determined according to the second transmission rate is greater than the marking probability determined according to the first transmission rate, the second transmission rate is greater than the first transmission rate.
- the second determining unit 13022 is configured to: determine the marking probability corresponding to the first data stream according to the level of the first data stream and the level of the transmission rate of the first data stream; wherein, if the level of the first data stream is No change, when the marking probability determined according to the second transmission rate level is greater than the marking probability determined according to the first transmission rate level, the second transmission rate is greater than the first transmission rate.
- the second determining unit 13022 is configured to: based on the target parameter and level of the first data stream, and the transmission rate of the first data stream and the level of the transmission rate of the first data stream, determine the data corresponding to the first data stream. Mark probability
- the relationship between the marking probability corresponding to the first data stream, the target parameter of the first data stream and the transmission rate satisfies at least one of the following : If the target parameter of the first data stream does not change, the marking probability corresponding to the first data stream increases as the transmission rate of the first data stream increases; if the transmission rate of the first data stream does not change, the first The marking probability corresponding to the data stream increases as the target parameter of the first data stream increases;
- the relationship between the marking probability corresponding to the first data stream, the target parameter of the first data stream and the transmission rate satisfies at least one of the following : If the target parameter of the first data stream does not change, the marking probability corresponding to the first data stream remains unchanged as the transmission rate of the first data stream increases; if the transmission rate of the first data stream does not change, then the first data stream The marking probability corresponding to a data stream remains unchanged as the target parameter of the first data stream increases.
- the first determining unit 13021 includes: a determining subunit 130211, configured to determine according to at least one of the target parameter and level of the first data stream, the length and level of the target queue And at least one of the transmission rate of the first data stream and the level of the transmission rate of the first data stream to determine the marking probability corresponding to the first data stream; wherein the level of the target queue is related to the length of the target queue, The level of the transmission rate of the first data stream is related to the transmission rate.
- the determining subunit 139211 is configured to: determine the marking probability corresponding to the first data stream according to the target parameter of the first data stream, the length of the target queue, and the transmission rate of the first data stream; where, if the first data stream If the target parameter and the length of the target queue are unchanged, when the marking probability determined according to the second transmission rate is greater than the marking probability determined according to the first transmission rate, the second transmission rate is greater than the first transmission rate; if the first data stream The target parameter and the transmission rate of the first data stream are both unchanged, and when the marking probability determined according to the second queue length is greater than the marking probability determined according to the first queue length, the second queue length is greater than the first queue length.
- the determining subunit 139211 is configured to determine the marking probability corresponding to the first data stream according to the level of the first data stream, the level of the target queue, and the level of the transmission rate of the first data stream; wherein, if the first data stream If the level of the flow and the level of the target queue are unchanged, when the marking probability determined according to the second transmission rate level is greater than the marking probability determined according to the first transmission rate level, the second transmission rate level is greater than the first transmission rate level; if The level of the first data stream and the level of the transmission rate of the first data stream are both unchanged. When the marking probability determined according to the second queue level is greater than the marking probability determined according to the first queue level, the second queue level is greater than the first queue level. Queue level.
- the determining subunit 139211 is configured to determine the first data stream according to the target parameter and level of the first data stream, the length and level of the target queue, and the transmission rate of the first data stream and the level of the transmission rate of the first data stream.
- the marking probability corresponding to a data stream
- the marking probability corresponding to the first data stream, the length of the target queue, and the target parameter of the first data stream The relationship with the transmission rate satisfies at least one of the following: if the target parameter of the first data stream and the length of the target queue remain unchanged, the marking probability corresponding to the first data stream increases as the transmission rate of the first data stream increases ; If the target parameter of the first data stream and the transmission rate of the first data stream remain unchanged, the marking probability corresponding to the first data stream increases as the length of the target queue increases; if the transmission rate of the first data stream and If the length of the target queue remains unchanged, the marking probability corresponding to the first data stream increases as the target parameter of the first data stream increases;
- the marking probability corresponding to the first data stream, the length of the target queue, and the target parameter of the first data stream satisfies at least one of the following: if the target parameter of the first data stream and the length of the target queue remain unchanged, the marking probability corresponding to the first data stream remains unchanged as the transmission rate of the first data stream increases.
- the marking probability corresponding to the first data stream remains unchanged as the length of the target queue increases; if the transmission of the first data stream If the rate and the length of the target queue remain unchanged, the marking probability corresponding to the first data stream remains unchanged as the target parameter of the first data stream increases.
- the second transmission rate level is greater than the first transmission rate level
- the second transmission rate is greater than the first transmission rate
- the transmission rate of the first data stream is within a transmission rate range of multiple transmission rate ranges, and the multiple transmission rate ranges correspond to multiple transmission rate levels one-to-one, and the transmission rate level of the first data stream is : The transmission rate level corresponding to a transmission rate range among multiple transmission rate levels.
- the determining module 1302 is configured to: when the first data stream meets the marking condition, determine the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream.
- the marking condition includes: the level of the first data stream does not belong to the lower q levels among the designated multiple data stream levels, and q ⁇ 1.
- the marking condition includes: the transmission rate of the first data stream is greater than a transmission rate threshold, where the transmission rate threshold is a constant or a variable.
- the target parameter includes: the number of bytes, or the number of data packets.
- the determining module determines that the length of the target queue meets the first length condition, it indicates that the target queue is longer at this time.
- the determining module can determine the marking probability corresponding to the first data stream according to at least one of the target parameter and the auxiliary parameter of the first data stream, so as to realize the combination of at least one of the target parameter and the auxiliary parameter of the first data stream.
- Data packets in a data stream are marked for congestion. Reduce the probability that all data streams are marked for congestion, so as to avoid reducing the transmission efficiency of all data streams and avoid causing delays to all data streams.
- the above-mentioned embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
- software When implemented using software, it may be implemented in the form of a computer program product in whole or in part, and the computer program product includes one or more computer instructions.
- the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part.
- the computer may be a general-purpose computer, a computer network, or other programmable devices.
- the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions may be transmitted from a website, computer, server, or data.
- the center transmits to another website, computer, server, or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.).
- the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media.
- the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium, or a semiconductor medium (for example, a solid state hard disk).
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Algebra (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Pure & Applied Mathematics (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请公开了一种数据包标记方法及设备、数据传输系统,属于通信技术领域。所述方法包括:对第一数据流的目标参数进行统计,其中,交换设备的目标队列用于缓存至少一个数据流的数据包,第一数据流为至少一个数据流中的一个数据流,目标参数用于反映第一数据流的数据量;在目标队列的长度满足第一长度条件时,根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率,其中,第一数据流的辅助参数与第一数据流的目标参数相关;根据第一数据流对应的标记概率对第一数据流中的数据包进行拥塞标记。本申请解决了每个数据流的时延均较高的问题,避免了每个数据流的时延均较高,本申请用于数据包标记。
Description
本申请要求于2019年4月4日提交的申请号为201910271733.1、发明名称为“数据包标记方法及设备、数据传输系统”的中国专利申请的优先权,以及于2019年4月26日提交的申请号为201910345779.3、发明名称为“数据包标记方法及设备、数据传输系统”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
本申请涉及通信技术领域,特别涉及一种数据包标记方法及设备、数据传输系统。
数据传输系统包括:交换设备及其上游设备和下游设备。该上游设备可以通过交换设备向该下游设备发送数据流,以进行数据的传输。
交换设备可以接收到上游设备发送的数据流,并可以将第一数据流中的数据包向交换设备中的发送队列中缓存,之后,再向下游设备发送该发送队列中的数据包。需要说明的是,交换设备还会检测发送队列的长度,当该发送队列的长度大于长度阈值时,交换设备可能会对发送队列中的每个数据流中的数据包进行显示拥塞通知(Explicit Congestion Notification,ECN)标记。下游设备在接收到该带有ECN标记的数据流时,会指示上游设备降低带有ECN标记的数据包所在的数据流的发送速率。
由于在发送队列的长度大于长度阈值时,交换设备可能会对发送队列中的每个数据流中的数据包都进行ECN标记,因此,上游设备发送每个数据流的速率均会降低,导致每个数据流的时延均较高。
发明内容
本申请提供了一种数据包标记方法及设备、数据传输系统,可以解决每个数据流的时延均较高的问题,所述技术方案如下:
第一方面,提供了一种数据包标记方法,用于交换设备,所述方法包括:对第一数据流的目标参数进行统计,其中,所述交换设备的目标队列用于缓存至少一个数据流的数据包,所述第一数据流为所述至少一个数据流中的一个数据流,所述目标参数用于反映所述第一数据流的数据量;在所述目标队列的长度满足第一长度条件时,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,其中,所述第一数据流的辅助参数与所述第一数据流的目标参数相关;根据所述第一数据流对应的标记概率对所述第一数据流中的数据包进行拥塞标记。
当交换设备确定目标队列的长度满足第一长度条件时,说明此时目标队列较长。此时交换设备可以根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率,从而实现结合第一数据流的目标参数和辅助参数中的至少一个对第一数据流中的数据包进行拥塞标记。减小将全部数据流均进行拥塞标记的概率,从而能够实现避免降低全部数据流的传输效率,以及避免对全部数据流均造成时延。
可选地,所述辅助参数包括所述第一数据流的等级。辅助参数也可以包括其他与第一数据流的等级不同,且与第一数据流的目标参数相关的参数。
可选地,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数,确定所述第一数据流对应的标记概率;其中,在根据第二目标参数确定的标记概率大于根据第一目标参数确定的标记概率时,所述第二目标参数大于所述第一目标参数。也即是,在确定第一数据流对应的标记概率时,可以仅根据第一数据流的目标参数,确定一个较为合适的标记概率。
可选地,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级,确定所述第一数据流对应的标记概率;其中,在根据第二流等级确定的标记概率大于根据第一流等级确定的标记概率时,所述第二流等级大于所述第一流等级。也即是,在确定第一数据流对应的标记概率时,可以仅根据第一数据流的等级,确定一个较为合适的标记概率。
可选地,根据所述第一数据流的目标参数和辅助中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级,确定所述第一数据流对应的标记概率;其中,在所述第一数据流的等级不变时,所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而增大,或者,所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而保持不变。也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的目标参数,还可以考虑第一数据流的等级,以确定一个较为合适的标记概率。
可选地,在与第二目标参数相关的第二流等级大于与第一目标参数相关的第一流等级时,所述第二目标参数大于所述第一目标参数。也即是,当数据流等级越大时,数据流等级相关的目标参数越大。但是,当一个目标参数大于另一个目标参数时,与该一个目标参数相关的数据流等级并不一定大于该另一个目标参数相关的数据流等级。
可选地,所述第一数据流的目标参数位于多个目标参数范围中的一个目标参数范围内,所述多个目标参数范围与多个数据流等级一一对应,所述第一数据流的等级为:所述多个数据流等级中与所述一个目标参数范围对应的数据流等级。
可选地,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率;其中,所述目标队列的等级与所述目标队列的长度相关。也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的目标参数和等级中的至少一个,还可以考虑目标队列的长度和等级中的至少一个,以确定一个较为合适的标记概率。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级和所述目标队列的长度,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的等级不变,则在根据第二队列长度确定的标记概率大于根据第一队列长度确定的标记概率时,所述第二队列长度大于所述第一队列长度。也即是,在确定第一数据流对应的标记概率时,不仅可以考虑第一数据流的等级,还可以考虑目标队列的长度,以确定一个较为合适的标记概率。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级和所述目标队列的等级,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的等级不变,则在根据第二队列等级确定的标记概率大于根据第一队列等级确定的标记概率时,所述第二队列等级大于所述第一队列等级。也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的等级,还可以考虑目标队列的等级,以确定一个较为合适的标记概率。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级,以及所述目标队列的长度和等级,确定所述第一数据流对应的标记概率;其中,在所述第一数据流的等级和所述目标队列的等级均不变时,所述第一数据流对应的标记概率、所述第一数据流的目标参数以及所述目标队列的长度的关系满足以下至少一种:若所述第一数据流的目标参数不变,则所述第一数据流对应的标记概率随所述目标队列的长度增大而增大;若所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而增大;若所述第一数据流的目标参数不变,则所述第一数据流对应的标记概率随所述目标队列的长度增大而保持不变;若所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而保持不变。
也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的目标参数和等级,还可以考虑目标队列的长度和等级,以确定一个较为合适的标记概率。
可选地,在与第二队列长度相关的第二队列等级大于与第一队列长度相关的第一队列等级时,所述第二队列长度大于所述第一队列长度。也即是,当队列等级越大时,与队列等级相关的队列长度越大。
可选地,所述目标队列的长度位于多个长度范围中的一个长度范围内,所述多个长度范围与多个队列等级一一对应,所述目标队列的等级为:所述多个队列等级中与所述一个长度范围对应的队列等级。
可选地,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率;其中,所述第一数据流的传输速率的等级与所述传输速率相关。也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的目标参数和等级中的至少一个,还可以考虑第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,以确定一个较为合适的标记概率。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和所述第一数据流的传输速率,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的目标参数不变,则在根据第二传输速率确定的标记概率大于根据第一传输速率确定的标记概率时,所述第二传输速率大于所述第一传输速率。也即是,在确定第一数据流对应的标记概率时,可以不仅根据第 一数据流的目标参数,还可以考虑第一数据流的传输速率,以确定一个较为合适的标记概率。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级和所述第一数据流的传输速率的等级,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的等级不变,则在根据第二传输速率等级确定的标记概率大于根据第一传输速率等级确定的标记概率时,所述第二传输速率大于所述第一传输速率。也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的等级,还可以考虑第一数据流的传输速率的等级,以确定一个较为合适的标记概率。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级,确定所述第一数据流对应的标记概率;也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的目标参数和等级,还可以考虑第一数据流的传输速率和所述第一数据流的传输速率的等级,以确定一个较为合适的标记概率。
其中,在所述第一数据流的等级和所述第一数据流的传输速率的等级均不变时,所述第一数据流对应的标记概率、所述第一数据流的目标参数和传输速率的关系满足以下至少一种:若所述第一数据流的目标参数不变,则所述第一数据流对应的标记概率随所述第一数据流的传输速率的增大而增大;若所述第一数据流的传输速率不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而增大;若所述第一数据流的目标参数不变,则所述第一数据流对应的标记概率随所述第一数据流的传输速率的增大而保持不变;若所述第一数据流的传输速率不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而保持不变。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级中的至少一个,所述目标队列的长度和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率;其中,所述目标队列的等级与所述目标队列的长度相关,第一数据流的传输速率的等级与传输速率相关。也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的目标参数和等级中的至少一个,还可以考虑所述目标队列的长度和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,以确定一个较为合适的标记概率。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,所述目标队列的长度和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数、所述目标队列的长度和所述第一数据流的传输速率,确定所述第一数据流对应的标记概率;也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的目 标参数,还可以考虑所述目标队列的长度,以及所述第一数据流的传输速率,以确定一个较为合适的标记概率。
其中,若所述第一数据流的目标参数和所述目标队列的长度均不变,则在根据第二传输速率确定的标记概率大于根据第一传输速率确定的标记概率时,所述第二传输速率大于所述第一传输速率;若所述第一数据流的目标参数和所述第一数据流的传输速率均不变,则在根据第二队列长度确定的标记概率大于根据第一队列长度确定的标记概率时,所述第二队列长度大于所述第一队列长度。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,所述目标队列的长度和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级、所述目标队列的等级以及所述第一数据流的传输速率的等级,确定所述第一数据流对应的标记概率;也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的等级,还可以考虑所述目标队列的等级,以及所述第一数据流的传输速率的等级,以确定一个较为合适的标记概率。其中,若所述第一数据流的等级和所述目标队列的等级均不变,则在根据第二传输速率等级确定的标记概率大于根据第一传输速率等级确定的标记概率时,所述第二传输速率等级大于所述第一传输速率等级;若所述第一数据流的等级和所述第一数据流的传输速率的等级均不变,则在根据第二队列等级确定的标记概率大于根据第一队列等级确定的标记概率时,所述第二队列等级大于所述第一队列等级。
可选地,根据所述第一数据流的目标参数和等级中的至少一个,所述目标队列的长度和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级,所述目标队列的长度和等级,以及所述第一数据流的传输速率和第一数据流的传输速率的等级,确定所述第一数据流对应的标记概率;也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的目标参数和等级,还可以考虑所述目标队列的长度和等级,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级,以确定一个较为合适的标记概率。
其中,在所述第一数据流的等级、所述目标队列的等级以及所述第一数据流的传输速率的等级均不变时,所述第一数据流对应的标记概率、所述目标队列的长度、所述第一数据流的目标参数和传输速率的关系满足以下至少一种:若所述第一数据流的目标参数和所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的传输速率的增大而增大;若所述第一数据流的目标参数和所述第一数据流的传输速率不变,则所述第一数据流对应的标记概率随所述目标队列的长度的增大而增大;若所述第一数据流的传输速率和所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而增大;若所述第一数据流的目标参数和所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的传输速率的增大而保持不变;若所述第一数据流的目标参数和所述第一数据流的传输速率不变,则所述第一数据流对应的标记概率随所述目标队列的长度的增大而保持不变;若所述第一数据流的传输速率和所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而保持不变。
可选地,在第二传输速率等级大于第一传输速率等级时,所述第二传输速率大于所述第一传输速率。也即是,在传输速率等级越大时,传输速率等级相关的传输速率越大。
可选地,所述第一数据流的传输速率位于多个传输速率范围中的一个传输速率范围内,所述多个传输速率范围与多个传输速率等级一一对应,所述第一数据流的传输速率的等级为:所述多个传输速率等级中与所述一个传输速率范围对应的传输速率等级。
可选地,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:在所述第一数据流满足标记条件时,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率。通过标记条件的判断,能够在一些满足标记条件的情况下,不对第一数据流中的数据包进行拥塞标记,从而减小第一数据流的时延。
可选地,所述标记条件包括:所述第一数据流的等级不属于指定的多个数据流等级中较低的q个等级,q≥1。在该标记条件满足时,说明第一数据流的数据量较小,第一数据流并不是引起交换设备拥塞的数据流,此时无需对第一数据流进行标记,以降低第一数据流的时延。
可选地,所述标记条件包括:所述第一数据流的传输速率大于传输速率阈值,其中,所述传输速率阈值为常量或变量。在该标记条件满足时,说明第一数据流的传输速率较低,第一数据流并不是引起交换设备拥塞的数据流,此时无需对第一数据流进行标记,以降低第一数据流的时延。
可选地,所述目标参数包括:字节数,或数据包个数。
第二方面,提供了一种数据包标记方法,用于交换设备,所述方法包括:对第一数据流的目标参数进行统计,其中,所述交换设备的目标队列用于缓存至少一个数据流的数据包,所述第一数据流为所述至少一个数据流中的任一数据流,所述目标队列包括:接收队列或发送队列,所述目标参数用于反映所述第一数据流的数据量;当所述目标队列的长度满足第一长度条件时,根据所述第一数据流的目标参数,判断所述第一数据流是否满足标记条件,其中,所述第一长度条件包括:所述目标队列的长度大于第一长度阈值,满足所述标记条件的数据流的目标参数大于第一目标参数阈值,所述第一长度阈值和所述第一目标参数阈值均大于零;当所述第一数据流满足所述标记条件时,对所述第一数据流中的至少一个数据包进行显示拥塞通知ECN标记;当所述第一数据流不满足所述标记条件时,对所述第一数据流中的每个数据包均不进行ECN标记。
当交换设备确定第一数据流满足标记条件时,说明此时目标队列较长,且造成交换设备拥塞的数据流包括第一数据流。此时,需要对第一数据流中的数据包进行ECN标记,以降低第一数据流的传输速率,并能够消除交换设备上的拥塞,提高其他数据流的传输效率。另外,当交换设备确定第一数据流不满足标记条件时,说明虽然此时整个目标队列较长,但造成交换设备拥塞的数据流并不包括第一数据流。此时,无需对第一数据流中的数据包进行ECN标记。这样一来,就能够实现在目标队列的长度较长时,可以避免对数据量较少的数据流进行ECN标记,从而并不会降低数据量较少的数据流的传输效率,也不会对数据量较少的数据流造成时延。
可选地,所述目标参数包括:字节数,且所述第一目标参数阈值包括:字节数阈值;或者,所述目标参数包括:数据包个数,所述第一目标参数阈值包括:数据包个数阈值。 本申请实施例中仅以目标参数为字节数或数据包个数为例,目标参数也可以为与数据量相关的其他参数,本申请实施例对此不作限定。
可选地,所述第一长度条件还包括:所述目标队列的长度小于或等于第二长度阈值,所述第二长度阈值小于无穷大。相当于在目标队列的长度大于第一长度阈值,且小于或等于第二长度阈值时,才能够确定该目标队列的长度满足第一长度条件。
可选地,在判断所述第一数据流是否满足标记条件之前,所述方法还包括:当所述目标队列的长度满足第一长度条件时,根据所述第一数据流的目标参数,确定多个数据流等级中所述第一数据流的等级;其中,数据流的等级与数据流的目标参数正相关,所述标记条件包括:数据流的等级为所述多个数据流等级中的非最低等级。本申请实施例中将标记条件设置为与数据流的等级相关的条件,这样一来,可以通过确定数据流的等级是否为多个数据流等级中的非最低等级,来确定数据流是否满足标记条件。
可选地,根据所述第一数据流的目标参数,确定多个数据流等级中所述第一数据流的等级,包括:根据所述第一数据流的目标参数,以及m+1个目标参数范围与所述多个数据流等级的一一对应关系,确定所述第一数据流的等级;其中,m≥1,所述m+1个目标参数范围由m个目标参数阈值划分得到,所述m个目标参数阈值中的最小目标参数阈值为所述第一目标参数阈值,目标参数范围对应的数据流等级与目标参数范围中的目标参数正相关。需要说明的是,本申请实施例中以m+1个目标参数范围一一对应多个数据流等级为例,也可以是m+1个目标参数范围对应q个数据流等级,且q小于m+1(相当于至少有两个目标参数范围对应了同一个数据流等级)。
可选地,对所述第一数据流中的至少一个数据包进行显示拥塞通知ECN标记,包括:确定所述第一数据流对应的标记概率,其中,数据流对应的标记概率与数据流的等级正相关;根据所述第一数据流对应的标记概率,对所述第一数据流中的至少一个数据包进行所述ECN标记。
第一数据流的等级越高,表明第一数据流的数据量越大,此时该第一数据流与传输拥塞的关联程度越大,需要对第一数据流中的较多数据包进行ECN标记,以大幅度的减小第一数据流的传输速率,进而减小目标队列的长度,减缓交换设备的拥塞程度。
可选地,在对所述第一数据流中的数据包进行ECN标记之前,所述方法还包括:当所述第一数据流满足所述标记条件时,确定n+1个长度范围中所述目标队列的长度所在的目标长度范围;其中,n≥1,所述n+1个长度范围由n个长度阈值划分得到,所述n个长度阈值中的最小长度阈值为所述第一长度阈值,所述n个长度阈值中的最大长度阈值为所述第二长度阈值;数据流对应的标记概率与所述目标长度范围中的长度正相关。
目标长度范围中的长度越大,表明目标队列的长度越大,此时需要对第一数据流中较多的数据包进行ECN标记,以大幅度减小第一数据流的传输速率,进而减小目标队列的长度,减缓交换设备的拥塞程度。
可选地,确定所述第一数据流对应的标记概率,包括:根据第一公式、所述第一数据流的等级和所述目标长度范围,确定所述第一数据流对应的标记概率;其中,所述第一公式包括:P(j,i)=P(j-1,i)+Q(i,j)*(L-L
j)/(L
j+1-L
j);L
j表示所述n个长度阈值中从小到大排列的第j个长度阈值,1≤j≤n;L
j+1表示所述n个长度阈值中从小到大排列的第j+1个长度阈值;L表示所述目标队列的长度;P(j,i)表示在所述L位于(L
j,L
j+1]内时,所述至 少一个数据流中第i等级的数据流对应的标记概率,1≤i≤m+1;当j-1>0时,P(j-1,i)表示在所述L位于(L
j-1,L
j]内时,所述至少一个数据流中第i等级的数据流对应的标记概率;当j-1=0时,P(j-1,i)=0;Q(i,j)表示在所述L位于(L
j,L
j+1]内时,所述第i等级的数据流的标记系数;Q(1,j)=0,且
可选地,所述标记条件还包括:数据流的传输速率大于公平带宽,所述公平带宽与目标端口的带宽正相关,当所述目标队列为发送队列时,所述传输速率为所述交换设备发送所述数据流的速率;所述目标端口为所述交换设备中用于发送缓存在所述目标队列中的数据包的发送端口;当所述目标队列为接收队列时,所述传输速率为所述交换设备接收所述数据流的速率,所述目标端口为所述交换设备中用于接收缓存在所述目标队列中的数据包的接收端口
当交换设备确定第一数据流不满足标记条件时,说明虽然此时整个目标队列较长,但目标队列中的大部分数据并不是第一数据流的数据(和/或,第一数据流在目标端口的带宽中占用较少),因此,造成交换设备拥塞的数据流并不包括第一数据流。此时,无需对第一数据流中的数据包进行ECN标记。这样一来,就能够实现在目标队列的长度较长时,可以避免对数据量较少的数据流进行ECN标记,从而并不会降低数据量较少的数据流的传输效率,从而不会对数据量较少的数据流造成时延。
可选地,所述公平带宽与目标个数负相关,所述目标个数为:所述至少一个数据流中等级属于等级集合的数据流的个数,所述等级集合包括多个数据流等级中较高的p个等级,数据流的等级与数据流的目标参数正相关,1≤p。
可选地,所述公平带宽等于所述目标端口的带宽与所述目标个数之比。
可选地,当所述目标队列的长度满足第二长度条件时,对所述第一数据流中的每个数据包均进行所述ECN标记,所述第二长度条件包括:所述目标队列的长度大于所述第二长度阈值。
当目标队列的长度大于第二长度阈值时,表明目标队列的长度马上就要达到长度上限,此时,需要对各个数据流的各个数据包均进行ECN标记,以快速降低每个数据流的传输速率,进而快速的减小目标队列的长度,避免数据包的丢失。
第三方面,提供了一种数据包标记设备,用于交换设备,所述数据包标记设备包括用于执行第一方面或第二方面所述的数据包标记方法的各个模块。
第四方面,提供了一种数据包标记设备,所述数据包标记设备包括:至少一个处理器、至少一个端口、存储器和至少一个通信总线,所述处理器用于执行所述存储器中存储的程序,以实现第一方面或第二方面所述的数据包标记方法。
第五方面,提供了一种数据传输系统,所述数据传输系统包括:交换设备,所述交换设备包括:第三方面所述的数据包标记设备,或第四方面所述的数据包标记设备。
第六方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述计算机可读存储介质在计算机上运行时,使得计算机执行如第一方面或第二方面所述的数据包标记方法。
第七方面,提供了一种包含指令的计算机程序产品,当所述计算机程序产品在计算机上运行时,使得计算机执行第一方面或第二方面所述的数据包标记方法。
图1为本申请实施例提供的一种数据传输系统的结构示意图;
图2为本申请实施例提供的一种交换设备的结构示意图;
图3为本申请实施例提供的一种交换设备的局部结构示意图;
图4为本申请实施例提供的一种数据包标记方法的流程图;
图5为本申请实施例提供的另一种数据包标记方法的流程图;
图6为本申请实施例提供的一种数据流传输示意图;
图7为本申请实施例提供的另一种数据流的传输示意图;
图8为本申请实施例提供的另一种数据流的传输示意图;
图9为本申请实施例提供的另一种数据流的传输示意图;
图10为本申请实施例提供的另一种数据流的传输示意图;
图11为本申请实施例提供的又一种数据包标记方法的流程图;
图12为本申请实施例提供的一种数据包标记设备的结构示意图;
图13为本申请实施例提供的另一种数据包标记设备的结构示意图;
图14为本申请实施例提供的一种第一标记模块的结构示意图;
图15为本申请实施例提供的又一种数据包标记设备的结构示意图;
图16为本申请实施例提供的一种确定模块的结构示意图;
图17为本申请实施例提供的另一种确定模块的结构示意图;
图18为本申请实施例提供的一种第一确定单元的结构示意图。
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
图1为本申请实施例提供的一种数据传输系统的结构示意图,如图1所示,该数据传输系统0可以包括:上游设备01、至少一个交换设备02和下游设备03。其中,上游设备01通过上述至少一个交换设备02与下游设备03建立有通信连接。
需要说明的是,图1中仅以该数据传输系统0包括一个交换设备02为例,可选地,该数据传输系统0也可以包括多个交换设备02,此时,对于每个交换设备02,该交换设备02接收到的数据流来自该交换设备02的上游设备,该交换设备02发送出去的数据流流向该交换设备02的下游设备。本申请实施例对此不作限定。
上述上游设备01可以为用户设备、服务器、服务器集群或基站等具有发送数据功能的设备。上述下游设备03也可以为用户设备、服务器、服务器集群或基站等具有接收数据功能的设备。上述交换设备02可以为交换机、网关、服务器或服务器集群等具有转发数据功能的设备。
示例地,图2为本申请实施例提供的一种交换设备的结构示意图,如图2所示,该交换设备02可以包括:处理器0201、存储器0202、通信端口0203和总线0204。该处理器0201、存储器0202、通信端口0203通过总线0204通信连接。其中,通信端口0203用于在处理器0201的控制下与其他设备通信。在一些实施方式中,存储器0203存储了程序0205, 程序0205能够被处理器0201执行以实现本申请实施例提供的数据包标记方法。
进一步的,图3为本申请实施例提供的一种交换设备的局部结构示意图,如图3所示,每个交换设备02的通信端口可以包括:至少一个接收端口A1和/或至少一个发送端口A2,图3中以通信端口包括一个接收端口A1和一个发送端口A2为例,可选的,通信端口也可以仅包括接收端口或发送端口;并且在通信端口仅包括接收端口时,图1中的数据传输系统也可以仅包括上游设备,而不包括下游设备;在通信端口仅包括发送端口时,图1中的数据传输系统也可以仅包括下游设备,而不包括上游设备,本申请实施例对此不作限定。
该交换设备02可以通过接收端口A1与上游设备通信(比如接收上游设备发送的数据流),以及通过发送端口A2与下游设备通信(比如向下游设备发送数据流)。交换设备02的每个接收端口A1对应有一个接收队列,交换设备02的每个发送端口A2对应有一个发送队列。每个交换设备02在接收到数据流后,可以先将数据流缓存在接收队列。之后,交换设备02需要在交换设备02的至少一个发送端口A2中选择一个发送端口A2,并将第一数据流中的数据包向该发送端口A2对应的发送队列中缓存。交换设备02在从每个发送端口A2向下游设备发送数据流时,可以发送该发送端口A2对应的发送队列中第一数据流的数据包。
相关技术中,交换设备会检测发送队列的长度(也即发送队列中的字节数),当该发送队列的长度大于长度阈值时,交换设备可能会对发送队列中的每个数据流中的至少部分数据包进行ECN标记,进而使得上游设备发送每个数据流的速率均会降低,导致每个数据流的时延均较高。本申请实施例提供了一种数据包标记方法,该方法不会导致每个数据流的时延均较高。
示例地,图4为本申请实施例提供的一种数据包标记方法的流程图,该方法可以用于图1所示的数据传输系统中的交换设备02,如图4所示,该数据包标记方法可以包括:
步骤301、对第一数据流的目标参数进行统计,其中,交换设备的目标队列用于缓存至少一个数据流的数据包,第一数据流为至少一个数据流中的任一数据流,目标队列包括:接收队列或发送队列,目标参数用于反映第一数据流的数据量。
需要说明的是,当交换设备具有接收端口和发送端口时,目标队列可以包括:接收队列或发送队列。当交换设备仅具有接收端口时,目标队列包括接收队列。当交换设备仅具有发送端口时,目标队列包括发送队列。可选地,交换设备内部还可以有除发送队列和接收队列之外的其他队列,如流队列、用户队列、组队列等。本申请实施例中的目标队列也可以为交换设备中与发送队列和接收队列不同的任一其他队列,本申请实施例对此不作限定。
第一数据流的目标参数可以用于反映第一数据流的数据量。比如,第一数据流的目标参数可以为第一数据流的字节数,或者数据包个数。可选地,第一数据流的目标参数也可以为第一数据流的其他参数,本申请实施例对此不作限定。
目标队列用于缓存至少一个数据流中的数据包,该第一数据流为该至少一个数据流中的任一数据流(第一数据流也可以是该至少一个数据流中的某一特定的数据流)。需要说明的是,第一数据流可以包括至少一个数据包,每个数据包均可以缓存在目标队列中,每个数据包也可能被从目标队列中删除。在步骤301中需要基于第一数据流的所有数据包,对 第一数据流的目标参数进行统计。相当于,交换设备需要基于第一数据流中未缓存至目标队列中的数据包、已缓存至目标队列的数据包以及从目标队列中删除的数据包,对第一数据流的目标参数进行统计。
步骤302、当目标队列的长度满足第一长度条件时,根据第一数据流的目标参数,判断第一数据流是否满足标记条件,其中,第一长度条件包括:目标队列的长度大于第一长度阈值,满足标记条件的数据流的目标参数大于第一目标参数阈值,第一长度阈值和第一目标参数阈值均大于零。
交换设备可以实时的或每隔一段时间对目标队列的长度进行检测,当检测到目标队列的长度满足第一长度条件时,可以基于步骤301中统计到的第一数据流的目标参数,执行判断第一数据流是否满足标记条件的步骤。
本申请实施例中以第一长度条件包括:目标队列的长度大于第一长度阈值为例,可选地,第一长度条件也可以是:目标队列的长度大于或等于第一长度阈值。
步骤303、当第一数据流满足标记条件时,对第一数据流中的至少一个数据包进行ECN标记。
当目标队列的长度大于第一长度阈值时,表明目标队列中的数据包较多,交换设备处发生了数据传输拥塞。并且,此时目标队列的长度即将到达长度上限,若继续按照当前的速率传输数据包,则会发生数据包丢失的情况。因此,当目标队列的长度大于第一长度阈值时,
若第一数据流满足标记条件,则说明此时整个目标队列较长,且造成交换设备拥塞的数据流包括该第一数据流。此时,需要对该第一数据流中的至少一个数据包进行ECN标记,以降低该第一数据流的传输速率,并能够消除交换设备上的拥塞,提高其他数据流的传输效率。
若第一数据流不满足标记条件,则说明虽然此时整个目标队列较长,但第一数据流的数据量较少,目标队列中的大部分数据并不是该第一数据流的数据,因此,造成交换设备拥塞的数据流并不包括该第一数据流。所以此时,无需对该第一数据流中的数据包进行ECN标记。这样一来,就能够实现在目标队列的长度较长时,避免对数据量较少的数据流进行ECN标记,从而并不会降低数据量较少的数据流(可以称为老鼠流)的传输效率,不会对数据量较少的数据流造成时延。
综上所述,由于本申请实施例提供的数据包标记方法中,当交换设备确定第一数据流满足标记条件时,说明此时目标队列较长,且目标队列中的大部分数据为第一数据流的数据,因此,造成交换设备拥塞的数据流包括该第一数据流。此时,需要对该第一数据流中的数据包进行ECN标记,以降低该第一数据流的传输速率,并能够消除交换设备上的拥塞,提高其他数据流的传输效率。另外,当交换设备确定第一数据流不满足标记条件时,说明虽然此时整个目标队列较长,但目标队列中的大部分数据并不是第一数据流的数据,因此,造成交换设备拥塞的数据流并不包括该第一数据流。此时,无需对该第一数据流中的数据包进行ECN标记。这样一来,就能够实现在目标队列的长度较长时,可以避免对数据量较少的数据流进行ECN标记,从而并不会降低数据量较少的数据流的传输效率,也不会对数据量较少的数据流造成时延。
示例地,图5为本申请实施例提供的另一种数据包标记方法的流程图,该方法可以用于图1所示的数据传输系统中的交换设备02,如图5所示,该数据包标记方法可以包括:
步骤401、交换设备在其目标队列中缓存第一数据流。
示例地,步骤401中的目标队列可以为交换设备中的任一队列(如接收队列或发送队列)。可选地,交换设备内部还可以有除发送队列和接收队列之外的其他队列,如流队列、用户队列、组队列等。本申请实施例中的目标队列也可以为交换设备中与发送队列和接收队列不同的任一其他队列,本申请实施例对此不作限定。
随着交换设备向目标队列中缓存的数据包的增多,目标队列的长度会逐渐变长。需要说明的是,目标队列具有长度上限,当目标队列的长度达到该长度上限时,若交换设备仍然向目标队列中缓存数据包,则该数据包会丢失。因此,本申请实施例中,交换设备需要对目标队列的长度进行监控,以避免出现数据包丢失的现象。
另外,交换设备接收到的数据流除了包括数据包在目标队列中缓存的第一数据流之外,还可以包括数据包在其他队列中缓存的数据流,本申请实施例对此不作限定。
步骤402、交换设备对第一数据流的目标参数进行统计。
步骤402可以参考图4所示的实施例中步骤301的解释,本申请实施例在此不做赘述。
步骤403、交换设备判断目标队列的长度是否满足第一长度条件和第二长度条件。当目标队列的长度满足第一长度条件时,执行步骤404;当目标队列的长度满足第二长度条件时,执行步骤409;当目标队列的长度不满足第一长度条件,且不满足第二长度条件时,执行步骤410。
示例地,该第一长度条件可以包括:目标队列的长度大于第一长度阈值,且小于或等于第二长度阈值。第二长度条件可以包括:目标队列的长度大于第二长度阈值。其中,第一长度阈值大于零,第二长度阈值小于无穷大。
可选地,第一长度条件也可以包括:目标队列的长度大于或等于第一长度阈值,且小于第二长度阈值。第二长度条件可以包括:目标队列的长度大于或等于第二长度阈值。其中,第一长度阈值大于零,第二长度阈值小于无穷大。本申请中可以根据需要对长度条件进行调整(如将长度条件中的大于改为大于或等于,将长度条件中的小于改为小于或等于,将长度条件中的大于或等于改为大于,或者,将长度条件中的小于或等于改为小于)。本申请实施例对此不作限定。
可选地,交换设备上可以预先存储有n个长度阈值,该n个长度阈值互不相同,n≥1。并且,该n个长度阈值中最小的长度阈值为该第一长度阈值,n个长度阈值中最大的长度阈值为第二长度阈值。第一长度阈值大于零,且第二长度阈值小于无穷大。例如,该n个长度阈值可以包括:100千字节和300千字节,则该第一长度阈值为100千字节,第二长度阈值为300千字节。又示例地,该n个长度阈值可以包括:100千字节、300千字节和500千字节,则该第一长度阈值为100千字节,第二长度阈值为500千字节。
交换设备可以实时地或周期性地确定目标队列的长度,且在每次确定出目标队列的长度时,可以基于该目标队列的长度,执行步骤403。示例地,交换设备在每次确定出目标队列的长度时,可以将该目标队列的长度与第一长度阈值进行比较,以确定该目标队列的长度与第一长度阈值的大小关系。交换设备在每次确定出目标队列的长度时,还可以将该目标队列的长度与第二长度阈值进行比较,以确定该目标队列的长度与第二长度阈值的大小 关系。
当目标队列的长度大于第一长度阈值时(如目标队列的长度大于第一长度阈值且小于或等于第二长度阈值,或者,目标队列的长度大于第二长度阈值),表明此时目标队列中的数据包较多,交换设备处发生了数据传输拥塞。并且,此时目标队列的长度即将到达长度上限,若继续按照当前的速率传输数据包,则会发生数据包丢失的情况。因此,当目标队列的长度大于第一长度阈值时,交换设备确定目标队列的长度满足第一长度条件或第二长度条件,需要执行步骤404至步骤408,或者执行步骤409,以对交换设备需要传输的至少部分数据流中的数据包进行ECN标记。而当目标队列的长度小于或等于第一长度阈值时,交换设备确定目标队列的长度不满足第一长度条件和第二长度条件,表明此时目标队列中的数据包较少,交换设备处未发生数据传输拥塞,因此,可以执行步骤410,无需对数据流中的数据包进行ECN标记。
需要说明的是,本申请实施例中以该第一长度条件为:目标队列的长度大于第一长度阈值,且小于或等于第二长度阈值为例。可选地,第一长度条件也可以为:目标队列的长度大于第一长度阈值,此时,在步骤403中交换设备无需判断目标队列的长度是否满足第二长度条件。并且,在确定目标队列的长度满足第一长度条件时,执行步骤404。
步骤404、交换设备根据第一数据流的目标参数,确定多个数据流等级中该第一数据流的等级。执行步骤405。
本申请实施例中,数据流的等级与数据流的目标参数相关。示例地,假设第一目标参数大于第二目标参数,则与第二目标参数相关的第二流等级可以大于与第一目标参数相关的第一流等级。当然,也可以是与第二目标参数相关的第二流等级可以小于与第一目标参数相关的第一流等级,本申请实施例对此不作限定。
交换设备在确定出第一数据流的目标参数后,便可以根据该第一数据流的目标参数,确定第一数据流的等级。需要说明的是,步骤404具有多种可实现方式,以下将以其中的三种可实现方式为例进行说明。
在步骤404的第一种可实现方式中,交换设备可以将第一数据流的目标参数代入预设公式,以得到多个数据流等级中第一数据流的等级。其中,该预设公式的输入为数据流的目标参数,且该预设公式的输出为该多个数据流等级中第一数据流的等级。
在步骤404的第二种可实现方式中,第一数据流的目标参数位于多个目标参数范围中的一个目标参数范围内,多个目标参数范围与多个数据流等级一一对应,第一数据流的等级可以为:多个数据流等级中与上述一个目标参数范围(也即第一数据流的目标参数所在的目标参数范围)对应的数据流等级。
示例地,交换设备也可以根据第一数据流的目标参数,以及m+1个目标参数范围与多个数据流等级的一一对应关系,确定第一数据流的等级。
交换设备上可以存储有m个目标参数阈值,该m个目标参数阈值中的最小目标参数阈值为第一目标参数阈值,m≥1。交换设备上还可以存储有由该m个目标参数阈值划分得到的m+1个目标参数范围,以及该m+1个目标参数范围与多个数据流等级的一一对应关系,其中,目标参数范围对应的数据流等级越大,目标参数范围中的目标参数越大。
假设m个目标参数阈值包括:2兆字节和5兆字节,则该第一目标参数阈值为2兆字节,由m个目标参数阈值划分得到的m+1个目标参数范围分别为:(0兆字节,2兆字节]、 (2兆字节,5兆字节]以及(5兆字节,+∞兆字节)。其中,∞表示无穷大。(0兆字节,2兆字节]、(2兆字节,5兆字节]以及(5兆字节,+∞兆字节)对应的数据流等级可以如下表1所示,其中数据流等级中的“一级”为最低等级,“三级”为最高等级。从表1可以看出,目标参数范围中的目标参数越大,目标参数范围对应的数据流等级越大;目标参数范围中的目标参数越小,目标参数范围对应的数据流等级越小。
表1
目标参数范围 | 数据流等级 |
(0兆字节,2兆字节] | 一级 |
(2兆字节,5兆字节] | 二级 |
(5兆字节,+∞兆字节) | 三级 |
当交换设备在步骤403中确定目标队列的长度大于第一长度阈值,且小于或等于第二长度阈值时,交换设备需要根据步骤402中统计得到的第一数据流的目标参数,以及上述m+1个目标参数范围与多个数据流等级的一一对应关系,确定第一数据流的等级。
例如,假设步骤402中统计到的第一数据流的目标参数为2兆字节,可以看出该目标参数位于目标参数范围(0兆字节,2兆字节]内,则交换设备可以根据上述对应关系可以将目标参数范围(0兆字节,2兆字节]对应的数据流等级“一级”确定为第一数据流的等级。
又例如,假设步骤402中统计到的第一数据流的目标参数为3兆字节,可以看出该目标参数位于目标参数范围(2兆字节,5兆字节]内,则交换设备可以根据上述对应关系可以将目标参数范围(2兆字节,5兆字节]对应的数据流等级“二级”确定为第一数据流的等级。
在步骤404的第三种可实现方式中,交换设备也可以根据第一数据流的目标参数,以及m+1个目标参数范围与多个数据流等级的对应关系,确定第一数据流的等级。其中,m+1个目标参数范围与多个数据流等级的对应关系中,可以存在多个目标参数范围对应同一数据流等级。
步骤405、交换设备判断第一数据流是否满足标记条件。当该第一数据流满足标记条件时,执行步骤406。当第一数据流不满足标记条件时,执行步骤410。
在本申请实施例中,标记条件可以有两种可实现方式,以下将对这两种可实现方式分别进行说明:
在标记条件的第一种可实现方式中,标记条件可以包括:数据流的等级为多个数据流等级中的非最低等级(相当于数据流的目标参数大于第一目标参数阈值)。
此时,在步骤405中,交换设备可以基于步骤404中确定出的第一数据流的等级,判断第一数据流的等级是否为上述非最低等级。比如,对于表1所示的三个数据流等级,交换设备可以判断第一数据流的等级是否为这三个数据流等级中的等级“二级”或“三级”。当确定第一数据流(可以称为第一数据流)的等级为上述非最低等级时,交换设备可以确定该第一数据流满足标记条件;当第一数据流的等级不为非最低等级(也即为最低等级)时,交换设备可以确定第一数据流不满足标记条件。
当交换设备确定第一数据流满足标记条件时,说明此时整个目标队列较长,且目标队列中的大部分数据为第一数据流的数据,因此,造成交换设备拥塞的数据流包括第一数据流。此时,需要执行步骤406至步骤408,以对第一数据流中的数据包进行ECN标记,以 降低第一数据流的传输速率,并能够消除交换设备上的拥塞,提高其他数据流的传输效率。当交换设备确定第一数据流不满足标记条件时,说明虽然此时整个目标队列较长,但目标队列中的大部分数据并不是第一数据流的数据,因此,造成交换设备拥塞的数据流并不包括第一数据流。此时,可以直接执行步骤410,无需对第一数据流中的数据包进行ECN标记。这样一来,就能够实现在目标队列的长度较长时,避免对数据量较少的数据流进行ECN标记,从而并不会降低数据量较少的数据流(可以称为老鼠流)的传输效率,不会对数据量较少的数据流造成时延。
在标记条件的第二种可实现方式中,标记条件可以包括:数据流的等级为多个数据流等级中的非最低等级,且数据流的传输速率大于公平带宽。其中,当目标队列为发送队列时,传输速率为交换设备发送数据流的速率;目标端口为交换设备中用于发送缓存在目标队列中的数据包的发送端口;当目标队列为接收队列时,传输速率为交换设备接收数据流的速率,目标端口为交换设备中用于接收缓存在目标队列中的数据包的接收端口。
交换设备还可以统计第一数据流的传输速率。假设上述目标端口为接收端口,上述目标队列为发送队列。一方面,交换设备在每接收到第一数据流的一个数据包后,交换设备统计到的第一数据流的目标参数会累加该数据包的目标参数。当数据流的传输速率包括:交换设备接收第一数据流的速率时,交换设备可以确定统计到的第一数据流的目标参数在时间周期T内增加的目标参数S1,并将S1与T的比值作为第一数据流的传输速率。另一方面,交换设备还会持续向下游设备发送第一数据流中的数据包,且在交换设备发送第一数据流的数据包后,第一数据流的目标参数又会减少该数据包的目标参数。当数据流的传输速率包括:交换设备发送第一数据流的速率时,交换设备可以确定统计到的第一数据流的目标参数在时间周期T内减少的目标参数S2,并将S2与T的比值作为第一数据流的传输速率。
可选地,公平带宽也可以与目标个数负相关(比如公平带宽等于目标端口的带宽与目标个数之比,或者,公平带宽等于目标端口的带宽与目标个数之比的2倍)。该目标个数为:目标队列用于缓存的至少一个数据流中等级属于等级集合的数据流的个数,该等级集合包括:多个数据流等级中较高的p个等级,1≤p≤m+1。其中,该多个数据流等级可以与步骤404中的多个数据流等级相同或不同,本申请实施例对此不作限定。示例地,公平带宽等于发送端口的带宽与目标个数之比。p可以为1,或者大于1且小于或等于m+1的任意数值,如p为2或3等。交换设备需要统计目标队列用于缓存的每个数据流的目标参数,并且需要基于每个数据流的目标参数,确定每个数据流的等级,进而根据每个数据流的等级确定上述目标个数。最后,才可以基于上述目标个数和目标端口的带宽,确定公平带宽。
例如,交换设备可以将上述发送端口的带宽与最高等级的数据流的个数之比作为上述公平带宽。示例地,假设发送端口的带宽为100兆比特每秒,且上述最高等级的数据流的个数为2,则可以确定100兆比特每秒与2的比值50兆比特每秒为上述公平带宽。当然,交换设备还可以通过其他方式确定公平带宽,比如,交换设备可以将上述发送端口的带宽的一半与该最高等级的数据流的个数之比作为上述公平带宽,本申请实施例对此不作限定。
交换设备在确定其发送第一数据流的速率以及上述公平带宽后,可以将交换设备发送第一数据流的速率与公平带宽进行比较,以确定交换设备发送第一数据流的速率是否大于公平带宽。一方面,当交换设备发送第一数据流的速率大于公平带宽,且第一数据流的等 级为上述非最低等级时,交换设备可以确定第一数据流满足标记条件。另一方面,当交换设备发送第一数据流的速率小于或等于公平带宽,且第一数据流的等级为上述非最低等级时,交换设备可以确定第一数据流不满足标记条件。又一方面,当交换设备发送第一数据流的速率小于或等于公平带宽,且第一数据流的等级不为上述非最低等级时,交换设备可以确定第一数据流不满足标记条件。再一方面,当交换设备发送第一数据流的速率大于公平带宽,且第一数据流的等级不为上述非最低等级时,交换设备可以确定第一数据流不满足标记条件。
在该第二种可实现方式中,交换设备可以按照以下步骤判断第一数据流是否满足标记条件:交换设备首先判断第一数据流的等级是否为非最低等级;当第一数据流不为非最低等级(也即为最低等级)时,交换设备可以确定第一数据流不满足标记条件;当第一数据流的等级为非最低等级时,交换设备可以再判断交换设备发送第一数据流的速率是否大于公平带宽;当交换设备发送第一数据流的速率大于公平带宽时,交换设备可以确定第一数据流满足标记条件;当交换设备发送第一数据流的速率小于或等于公平带宽时,交换设备可以确定第一数据流不满足标记条件。
当交换设备确定第一数据流满足标记条件时,说明此时整个目标队列较长,且目标队列中的大部分数据为第一数据流的数据,并且第一数据流在发送端口的带宽中占用较多,因此,造成交换设备拥塞的数据流包括第一数据流。此时,需要执行步骤406至步骤408,以对第一数据流中的数据包进行ECN标记,以降低第一数据流的传输速率,并能够消除交换设备上的拥塞,提高其他数据流的传输效率。当交换设备确定第一数据流不满足标记条件时,说明虽然此时整个目标队列较长,但目标队列中的大部分数据并不是第一数据流的数据(和/或,第一数据流在发送端口的带宽中占用较少),因此,造成交换设备拥塞的数据流并不包括第一数据流。此时,无需对第一数据流中的数据包进行ECN标记,并可以直接执行步骤410。这样一来,就能够实现在目标队列的长度较长时,避免对数据量较少的数据流进行ECN标记,从而并不会降低数据量较少的数据流的传输效率,从而不会对数据量较少的数据流造成时延。
需要说明的是,本申请实施例中以标记条件中与数据流等级相关的条件为:数据流的等级为多个数据流等级中的非最低等级为例,标记条件中与数据流等级相关的条件也可以是:数据流的等级不属于多个数据流等级中较低的q个等级,q≥1,如q=1、2或3等,本申请实施例对此不作限定。
步骤406、交换设备确定n+1个长度范围中目标队列的长度所在的目标长度范围。执行步骤407。
需要说明的是,交换设备上可以预先存储有n个长度阈值,该n个长度阈值中的最小长度阈值为上述第一长度阈值,n个长度阈值中的最大长度阈值为上述第二长度阈值,n≥1。交换设备上还可以存储有由上述n个长度阈值划分得到的n+1个长度范围。
例如,该n个长度阈值可以包括:100千字节和300千字节,则该第一长度阈值为100千字节,第二长度阈值为300千字节。该n+1个长度范围可以包括:(0千字节,100千字节]、(100千字节,300千字节]和(300千字节,+∞千字节]。又例如,该n个长度阈值可以包括:100千字节、300千字节和500千字节,则该第一长度阈值为100千字节,第二长度阈值为500千字节。该n+1个长度范围可以包括:(0千字节,100千字节]、(100千字节, 300千字节]、(300千字节,500千字节]和(500千字节,+∞千字节]。
在步骤406中,交换设备需要根据目标队列的长度,在上述n+1个长度范围中查找该目标队列的长度所在的目标长度范围。例如,假设该n+1个长度范围包括:(0千字节,100千字节]、(100千字节,300千字节]和(300千字节,+∞千字节],目标队列的长度为200千字节,则可以确定该目标长度范围为(100千字节,300千字节]。
步骤407、交换设备根据第一数据流的等级和目标长度范围,确定第一数据流对应的标记概率。执行步骤408。
示例地,交换设备在确定第一数据流满足上述标记条件,且确定出第一数据流的等级,以及上述目标长度范围后,便可以根据该第一数据流的等级和目标长度范围,确定第一数据流对应的标记概率。第一数据流对应的标记概率也即是:第一数据流中的数据包被ECN标记的概率。
其中,当目标队列的长度不变时,若第一数据流的等级越大,则第一数据流对应的标记概率越大;当第一数据流的等级不变时,若目标长度范围(也即目标队列的长度所在的长度范围)内的长度越大,则第一数据流对应的标记概率越大。第一数据流的等级越高,表明第一数据流的数据量越大,此时该第一数据流与传输拥塞的关联程度越大,需要对第一数据流中的较多数据包进行ECN标记,以大幅度的减小第一数据流的传输速率,进而减小目标队列的长度,减缓交换设备的拥塞程度。目标长度范围中的长度越大,表明目标队列的长度越大,此时需要对第一数据流中较多的数据包进行ECN标记,以大幅度减小第一数据流的传输速率,进而减小目标队列的长度,减缓交换设备的拥塞程度。
示例地,请参考图6,假设上述至少一个数据流包括数据流1、数据流2和数据流3,其中,数据流1的目标参数、数据流2的目标参数和数据流3的目标参数依次增大,且数据流1的目标参数小于第一目标参数阈值,数据流2和数据流3的目标参数均大于第一目标参数阈值。
当目标队列的长度位于L1(Lj表示n个长度阈值中从小到大排列的第j个长度阈值,1≤j≤n)至L2之间时,三个数据流对应的标记概率均为零,此时,三个数据流中的数据包都不会被ECN标记。
当目标队列的长度位于L1至L2之间时,数据流1的等级为“一级”,因此数据流1对应的标记概率为零,数据流1中的数据包不会被ECN标记。数据流2和3的等级均大于“一级”,因此,数据流2和3对应的标记概率均大于零。且由于数据流2的目标参数小于数据流3的目标参数,因此数据流2对应的标记概率小于数据流3对应的标记概率。如图6所示,数据流2中的一个数据包进行了ECN标记,被打上一个标记E,数据流3中的两个数据包进行了ECN标记,被打上了两个标记E。
当目标队列的长度位于L2至Ln之间时,数据流1的等级为“一级”,因此数据流1对应的标记概率为零,数据流1中的数据包不会被ECN标记。数据流2和3的等级均大于“一级”,因此,数据流2和3对应的标记概率均大于零,且由于数据流2的目标参数小于数据流3的目标参数,因此数据流2对应的标记概率小于数据流3对应的标记概率。并且,由于此时目标队列的长度较大,因此,如图6中,数据流2中的两个数据包进行了ECN标记,被打上两个标记E,数据流3中的四个数据包进行了ECN标记,被打上了四个标记E。
交换设备可以根据第一数据流的等级和目标长度范围采用多种方式确定第一数据流对 应的标记概率。示例地,交换设备可以结合第一公式,根据第一数据流的等级和目标长度范围,确定第一数据流对应的标记概率。
其中,所述第一公式包括:P(j,i)=P(j-1,i)+Q(i,j)*(L-L
j)/(L
j+1-L
j);
L
j表示所述n个长度阈值中从小到大排列的第j个长度阈值,1≤j≤n;L
j+1表示所述n个长度阈值中从小到大排列的第j+1个长度阈值;L表示所述目标队列的长度;P(j,i)表示在所述L位于(L
j,L
j+1]内时,所述至少一个数据流中第i等级的数据流对应的标记概率,1≤i≤m+1;当j-1>0时,P(j-1,i)表示在所述L位于(L
j-1,L
j]内时,所述至少一个数据流中第i等级的数据流对应的标记概率;当j-1=0时,P(j-1,i)=0;Q(i,j)表示在所述L位于(L
j,L
j+1]内时,所述第i等级的数据流的标记系数;Q(1,j)=0,且
步骤408、交换设备根据第一数据流对应的标记概率,对第一数据流中的数据包进行ECN标记。
交换设备在确定第一数据流对应的标记概率后,便可以根据该标记概率,对第一数据流中的数据包进行ECN标记。示例地,第一数据流对应的标记概率越大,第一数据流中被打上ECN标记的数据包越多;第一数据流对应的标记概率越小,第一数据流中被打上ECN标记的数据包越少。其中,当第一数据流对应的标记概率为零时,可以不对第一数据流中的数据包进行ECN标记;当第一数据流对应的标记概率大于零时,可以根据该第一数据流对应的标记概率对第一数据流中的数据包进行ECN标记。
步骤409、交换设备对第一数据流中的每个数据包均进行ECN标记。
当目标队列的长度大于第二长度阈值时,表明目标队列的长度马上就要达到长度上限,此时,需要对第一数据流的各个数据包均进行ECN标记,以快速降低第一数据流的传输速率,进而快速的减小目标队列的长度,避免数据包的丢失。
需要说明的是,本申请实施例中以步骤409中对第一数据流的每个数据包均进行ECN标记为例(相当于第一数据流对应的标记概率为100%)。可选地,步骤409中也可以确定第一数据流对应的标记概率不为100%,但为较大的概率,如90%~99%中的概率,或者85%~99%之间的概率等,之后再根据该第一数据流对应的标记概率,对第一数据流中的数据包进行ECN标记,本申请实施例对此不作限定。
步骤410、交换设备不对第一数据流中的数据包进行ECN标记。
当交换设备确定目标队列的长度小于第一长度阈值时,可以确定目标队列的长度既不满足第一长度条件,也不满足第二长度条件,此时,表明目标队列长度较小,目标队列中并未发生拥塞,因此,交换设备无需对第一数据流中的数据包进行ECN标记。
当交换设备确定目标队列满足第一长度条件时,且第一数据流不满足标记条件时,表明目标队列的长度较大,但目标队列中的较多数据并不是第一数据流中的数据,因此,第一数据流并不是造成目标队列拥塞的数据流,交换设备也无需对第一数据流中的数据包进行ECN标记。
需要说明的是,本申请实施例中以步骤410中不对第一数据流的每个数据包进行ECN标记为例(相当于第一数据流对应的标记概率为零)。可选地,步骤410中也可以确定第一数据流对应的标记概率不为0,但为较小的概率,如1%~10%中的概率,或者2%~20%之间 的概率等,之后再根据该第一数据流对应的标记概率,对第一数据流中的数据包进行ECN标记,本申请实施例对此不作限定。
综上所述,由于本申请实施例提供的数据包标记方法中,当交换设备确定第一数据流满足标记条件时,说明此时目标队列较长,且目标队列中的大部分数据为第一数据流的数据,因此,造成交换设备拥塞的数据流包括第一数据流。此时,需要对第一数据流中的数据包进行ECN标记,以降低第一数据流的传输速率,并能够消除交换设备上的拥塞,提高其他数据流的传输效率。另外,当交换设备确定第一数据流不满足标记条件时,说明虽然此时整个目标队列较长,但目标队列中的大部分数据并不是第一数据流的数据,因此,造成交换设备拥塞的数据流并不包括第一数据流。此时,无需对第一数据流中的数据包进行ECN标记。这样一来,就能够实现在目标队列的长度较长时,可以避免对数据量较少的数据流进行ECN标记,从而并不会降低数据量较少的数据流的传输效率,也不会对数据量较少的数据流造成时延。
以下将通过几个示例,对本申请实施例提供的数据包标记方法进行举例说明。
第一个示例以上述标记条件包括:数据流的等级为非最低等级为例。
图7为本申请实施例提供的另一种数据流的传输示意图,如图7所示,假设目标队列中缓存的至少一个数据流包括:数据流1、数据流2和数据流3,m个长度阈值包括:100千字节(第一长度阈值)和300千字节(第二长度阈值),n个目标参数阈值包括:2兆字节(第一目标参数阈值)。假设交换设备确定出的目标队列的长度为200千字节,且此时交换设备统计到数据流1的目标参数为500千字节,数据流2的目标参数为1.5兆字节,数据流3的目标参数为6兆字节。
交换设备可以确定该目标队列的长度大于第一长度阈值(100千字节),且小于或等于第二长度阈值(300千字节)。之后,交换设备可以将数据流1、数据流2和数据流3的目标参数分别与第一目标参数阈值进行比较。经过比较后,交换设备可以确定:数据流1的目标参数(500千字节)小于第一目标参数阈值(2兆字节),因此数据流1的等级为“一级”;数据流2的目标参数(1.5兆字节)小于第一目标参数阈值(2兆字节),因此数据流2的等级为“一级”;数据流3的目标参数(6兆字节)大于第一目标参数阈值(2兆字节),因此数据流3的等级为“二级”。
由于根据目标参数阈值2兆字节所划分得到两个目标参数范围,且这两个目标参数范围对应的两个数据流等级中的最低等级为“一级”,因此,交换设备可以确定第一数据流1的等级和数据流2的等级均为最低等级,且数据流3的等级为非最低等级。进而交换设备可以确定数据流1和数据流2不满足标记条件,不对数据流1和数据流2中的数据包进行ECN标记。交换设备还可以确定数据流3满足标记条件。
假设Q(2,1)=0.5,交换设备还可以根据第一公式确定标记概率P(1,2)=P(0,2)+Q(2,1)*(L-L1)/(L2-L1)=0+0.5*(200-100)/(300-100)=0.25,并基于该标记概率0.25对数据流3中的数据包进行ECN标记。
若采用相关技术中的打标方法对数据包进行ECN标记,则数据量较少的数据流1和数据流2都有可能被进行ECN标记。但是在本申请实施例中,对数据量较少的数据流1和数据流2进行了保护,未进行ECN标记,降低了数据流1和数据流2的时延。
第二个示例以上述标记条件包括:数据流的等级为非最低等级为例。
图8为本申请实施例提供的另一种数据流的传输示意图,如图8所示,假设上述至少一个数据流包括:数据流1、数据流2和数据流3,m个长度阈值包括:100千字节(第一长度阈值)和300千字节(第二长度阈值),n个目标参数阈值包括:2兆字节(第一目标参数阈值)和5兆字节。假设交换设备确定出的目标队列的长度为200千字节,且此时交换设备统计到数据流1的目标参数为500千字节,数据流2的目标参数为2.5兆字节,数据流3的目标参数为6兆字节。
交换设备可以确定该目标队列的长度大于第一长度阈值(100千字节),且小于或等于第二长度阈值(300千字节)。之后,交换设备可以将数据流1、数据流2和数据流3的目标参数分别与第一目标参数阈值进行比较。经过比较后,交换设备可以确定:数据流1的目标参数(500千字节)小于第一目标参数阈值(2兆字节),因此数据流1的等级为“一级”;数据流2的目标参数(1.5兆字节)小于第一目标参数阈值(2兆字节),因此数据流2的等级为“一级”;数据流3的目标参数(6兆字节)大于第一目标参数阈值(2兆字节),因此数据流3的等级为“二级”。
由于根据目标参数阈值2兆字节和5兆字节所划分得到三个目标参数范围,且这三个目标参数范围对应的三个数据流等级中的最低等级为“一级”,因此,交换设备可以确定第一数据流1的等级的等级为最低等级,且数据流2和数据流3的等级为非最低等级。进而交换设备可以确定数据流1不满足标记条件,不对数据流1中的数据包进行ECN标记。交换设备还可以确定数据流2和数据流3满足标记条件。
假设Q(2,1)=0.2,交换设备还可以根据第一公式确定标记概率P(1,2)=P(0,2)+Q(2,1)*(L-L1)/(L2-L1)=0+0.2*(200-100)/(300-100)=0.1,并基于该标记概率0.1对数据流2中的数据包进行ECN标记。又示例的,假设Q(3,1)=0.8,交换设备还可以根据第一公式确定标记概率P(1,3)=P(0,3)+Q(3,1)*(L-L1)/(L2-L1)=0+0.8*(200-100)/(300-100)=0.4,并基于该标记概率0.4对数据流3中的数据包进行ECN标记。
若采用相关技术中的打标方法对数据包进行ECN标记,则数据量较少的数据流1有可能被进行ECN标记。但是在本申请实施例中,对数据量较少的数据流1进行了保护,未进行ECN标记,降低了数据流1的时延。
第三个示例以上述标记条件包括:数据流的等级为非最低等级为例。
图9为本申请实施例提供的另一种数据流的传输示意图,如图9所示,假设上述至少一个数据流包括:数据流1、数据流2和数据流3,m个长度阈值包括:100千字节(第一长度阈值)、300千字节和500千字节(第二长度阈值),n个目标参数阈值包括:1兆字节(第一目标参数阈值)和5兆字节。假设交换设备确定出的目标队列的长度为400千字节,且此时交换设备统计到数据流1的目标参数为500千字节,数据流2的目标参数为3兆字节,数据流3的目标参数为8兆字节。
交换设备可以确定该目标队列的长度大于300千字节,且小于或等于500千字节(目标队列的长度也大于第一长度阈值且小于或等于第二长度阈值)。之后,交换设备可以将数据流1、数据流2和数据流3的目标参数分别与第一目标参数阈值进行比较。经过比较后, 交换设备可以确定:数据流1的目标参数(500千字节)小于第一目标参数阈值(1兆字节),因此数据流1的等级为“一级”;数据流2的目标参数(3兆字节)大于第一目标参数阈值(1兆字节),但小于5兆字节,因此数据流2的等级为“二级”;数据流3的目标参数(8兆字节)大于5兆字节(数据流3的目标参数也大于第一目标参数阈值),因此数据流3的等级为“三级”。
由于根据目标参数阈值1兆字节和5兆字节所划分得到三个目标参数范围,且这三个目标参数范围对应的三个数据流等级中的最低等级为“一级”,因此,交换设备可以确定第一数据流1的等级的等级为最低等级,且数据流2和数据流3的等级为非最低等级。进而交换设备可以确定数据流1不满足标记条件,不对数据流1中的数据包进行ECN标记。交换设备还可以确定数据流2和数据流3满足标记条件。
假设Q(2,1)=0.2,Q(2,2)=0.4,交换设备还可以根据第一公式确定标记概率P(2,2)=P(1,2)+Q(2,2)*(L-L2)/(L3-L2)=0.4,其中P(1,2)=P(0,2)+Q(2,1)*(L2-L1)/(L2-L1)=0.2,并基于该标记概率0.4对数据流2中的数据包进行ECN标记。
假设Q(3,1)=0.4,Q(3,2)=0.6,交换设备还可以根据第一公式确定标记概率P(2,3)=P2*(L-L2)/(L3-L2)=0.7,其中,P(1,3)=P(0,3)+Q(3,1)*(L2-L1)/(L2-L1)=0.4,并基于该标记概率0.7对数据流3中的数据包进行ECN标记。
若采用相关技术中的打标方法对数据包进行ECN标记,则数据量较少的数据流1有可能被进行ECN标记。但是在本申请实施例中,对数据量较少的数据流1进行了保护,未进行ECN标记,降低了数据流1的时延。
第四个示例以上述标记条件包括:数据流的等级为非最低等级,且交换设备发送数据流的速率大于公平带宽。
图10为本申请实施例提供的另一种数据流的传输示意图,如图10所示,假设上述至少一个数据流包括:数据流1、数据流2和数据流3,m个长度阈值包括:100千字节(第一长度阈值)和300千字节(第二长度阈值),n个目标参数阈值包括:5兆字节(第一目标参数阈值)。假设交换设备确定出的目标队列的长度为200千字节,且此时交换设备统计到数据流1的目标参数为500千字节,且交换设备发送数据流的速率为0.01倍的发送端口(此时以目标端口为发送端口为例)的带宽,数据流2的目标参数为8兆字节,且交换设备发送数据流的速率为0.2倍的发送端口的带宽,数据流3的目标参数为10兆字节,且交换设备发送数据流的速率为0.8倍的发送端口的带宽。
交换设备可以确定该目标队列的长度大于100千字节,且小于或等于300千字节(目标队列的长度也大于第一长度阈值且小于或等于第二长度阈值)。之后,交换设备可以将数据流1、数据流2和数据流3的目标参数分别与第一目标参数阈值进行比较。经过比较后,交换设备可以确定:数据流1的目标参数(500千字节)小于第一目标参数阈值(5兆字节),因此数据流1的等级为“一级”;数据流2的目标参数(8兆字节)大于第一目标参数阈值(5兆字节),但小于5兆字节,因此数据流2的等级为“二级”;数据流3的目标参数(10兆字节)大于第一目标参数阈值(5兆字节),因此数据流3的等级为“二级”。
由于根据目标参数阈值5兆字节所划分得到两个目标参数范围,且这两个目标参数范围对应的两个数据流等级中的最低等级为“一级”,因此,交换设备可以确定第一数据流1 的等级的等级为最低等级,且数据流2和数据流3的等级为非最低等级。进而交换设备可以确定数据流1不满足标记条件,不对数据流1中的数据包进行ECN标记。
假设公平带宽为:发送端口的带宽/第2级流的数量(也即2)=0.5倍的发送端口的带宽。交换设备还可以将,且交换设备发送数据流2和数据流3的速率与该公平带宽进行比较,以得出以下结论:交换设备发送数据流2的速率(0.2倍的发送端口的带宽)小于公平带宽(0.5倍的发送端口的带宽),交换设备发送数据流3的速率(0.8倍的发送端口的带宽)大于公平带宽(0.5倍的发送端口的带宽)。进而交换设备可以确定数据流2也不满足标记条件,且数据流3满足标记条件,因此,不需要对数据流2进行ECN标记,而需要对数据流3进行ECN标记。
之后,假设Q(2,1)=0.5,交换设备还可以根据第一公式确定第三数据流对应的标记概率P(1,2)=Q(2,1)*(L-L1)/(L2-L1)=0.25,并基于该标记概率0.25对数据流3中的数据包进行ECN标记。
若采用相关技术中的打标方法对数据包进行ECN标记,则数据量较少的数据流1以及传输速率较小的数据流2均有可能被进行ECN标记。但是在本申请实施例中,对数据量较少的数据流1以及传输速率较小的数据流2进行了保护,未进行ECN标记,降低了数据流1和数据流2的时延。
图5中交换设备根据第一数据流的目标参数确定第一数据流的等级,之后再根据第一数据流的等级和目标长度范围确定第一数据流对应的标记概率。可选地,确定第一数据流对应的标记概率还可以是其他方式,以下将以确定第一数据流对应的标记概率的几种其他的实现方式为例进行讲解。
在第一种可实现方式中,交换设备还可以直接根据第一数据流的目标参数,确定第一数据流对应的标记概率。也即是,在确定第一数据流对应的标记概率时,可以仅根据目标参数,确定一个较为合适的标记概率。
其中,在根据第二目标参数确定的标记概率大于根据第一目标参数确定的标记概率时,表明第二目标参数大于第一目标参数。示例地,假设第一目标参数为500千字节,第二目标参数为1000千字节,则根据第一目标参数确定的标记概率可以为20%,根据第二目标参数确定的标记概率可以为40%。
需要说明的是,当一个目标参数大于另一个目标参数时,根据该一个目标参数确定的标记概率不一定大于根据该另一个目标参数确定的标记概率。示例地,根据500千字节的目标参数确定的标记概率可以为20%,根据600千字节的目标参数确定的标记概率也可以为20%。当然,当一个目标参数大于另一个目标参数时,根据该一个目标参数确定的标记概率也可以一定大于根据该另一个目标参数确定的标记概率,也即是,数据流的目标参数也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
在第二种可实现方式中,交换设备还可以首先根据第一数据流的目标参数,确定第一数据流的等级,之后再根据第一数据流的目标参数和等级(或者只根据第一数据流的等级),确定第一数据流对应的标记概率。也即是,在确定第一数据流对应的标记概率时,可以不仅根据第一数据流的目标参数,还可以考虑第一数据流的等级,以确定一个较为合适的标 记概率。或者,在确定第一数据流对应的标记概率时,可以仅根据第一数据流的等级,以确定一个较为合适的标记概率。
其中,交换设备根据第一数据流的目标参数确定第一数据流的等级的过程,可以参考图5所示的实施例中的相关过程。需要说明的是,第一数据流的等级可以与第一数据流的目标参数相关。在与第二目标参数相关的第二流等级(一个数据流等级)大于与第一目标参数相关的第一流等级(另一数据流等级)时,第二目标参数大于第一目标参数。也即是,当数据流等级越大时,数据流等级相关的目标参数越大。但是,当一个目标参数大于另一个目标参数时,与该一个目标参数相关的数据流等级并不一定大于该另一个目标参数相关的数据流等级。
示例地,第一数据流的目标参数位于多个目标参数范围中的一个目标参数范围内,多个目标参数范围与多个数据流等级一一对应,第一数据流的等级为:多个数据流等级中与上述一个目标参数范围(也即第一数据流的目标参数所在的目标参数范围)对应的数据流等级。交换设备在根据第一数据流的目标参数确定第一数据流的等级时,可以首先在该多个目标参数范围中找到第一数据流的目标参数所在的一个目标参数范围。之后,交换设备可以在多个目标参数范围与多个数据流等级的一一对应关系中,查找该一个目标参数范围对应的数据流等级,并将该数据流等级确定为第一数据流的等级。确定第一数据流的等级的过程可以参考图5所示的实施例中的描述,本申请实施例在此不做赘述。
可选地,当一个目标参数大于另一个目标参数时,与该一个目标参数相关的数据流等级也可以一定大于该另一个目标参数相关的数据流等级,也即是,数据流的目标参数也可以与数据流的等级正相关,本申请实施例对此不作限定。
以下将对第三种可实现方式中的两个方面进行解释说明。
一方面,当交换设备根据第一数据流的等级确定第一数据流对应的标记概率时,若根据第二流等级(一种数据流等级)确定的标记概率大于根据第一流等级(另一种数据流等级)确定的标记概率,则可以表明第二流等级大于第一流等级。也即是,当第一数据流的标记概率越大时,与该标记概率相关的第一数据流的等级越大。需要说明的是,当一个数据流等级大于另一个数据流等级时,根据该一个数据流等级确定的标记概率不一定大于根据该另一个数据流等级确定的标记概率。当然,当一个数据流等级大于另一个数据流等级时,根据该一个数据流等级确定的标记概率也可以一定大于根据该另一个数据流等级确定的标记概率,也即是,数据流的目标等级也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
另一方面,当交换设备根据第一数据流的目标参数和等级,确定第一数据流对应的标记概率时,在第一数据流的等级不变时,确定出的第一数据流对应的标记概率可以随着第一数据流的目标参数的增大而增大。也即是,在第一数据流的等级不变时,该第一数据流对应的标记概率可以与第一数据流的目标参数正相关。该第一数据流对应的标记概率也可以与该第一数据流的等级正相关。
本申请实施例中以交换设备根据第一数据流的目标参数和等级中的至少一个,确定第一数据流对应的标记概率为例。可选地,交换设备还可以根据第一数据流的目标参数和其他参数中的至少一个,确定第一数据流对应的标记概率。其中,该其他参数也与第一数据流的目标参数相关,比如,该其他参数可以为:第一数据流的目标参数与一个目标参数阈 值之间的差值。总的来说,交换设备可以根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率,该辅助参数与第一数据流的目标参数相关即可(如辅助参数为上述第一数据流的等级等)。
在第三种可实现方式中,在交换设备根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率时,还可以结合与目标参数和辅助参数均不同的参数,确定该第一数据流对应的标记概率。比如,交换设备可以根据第一数据流的目标参数和辅助参数(如等级)中的至少一个,以及目标队列的长度和等级中的至少一个,确定第一数据流对应的标记概率。
其中,目标队列的等级与目标队列的长度相关。比如,在与第二队列长度相关的第二队列等级大于与第一队列长度相关的第一队列等级时,第二队列长度大于第一队列长度。也即是,当队列等级越大时,与队列等级相关的队列长度越大。示例地,目标队列的长度可以位于多个长度范围中的一个长度范围内,多个长度范围与多个队列等级一一对应,目标队列的等级为:多个队列等级中与该一个长度范围(也即目标队列的长度所在的长度范围)对应的队列等级。也即是,当队列等级越大时,与该队列等级相关的队列长度越大。交换设备在确定目标队列的等级时,可以首先在多个长度范围中查找目标队列的长度所在的一个长度范围。之后,交换设备可以在多个长度范围与多个队列等级的一一对应关系中,查找该一个长度范围所对应的队列等级,并将该队列等级作为目标队列的等级。
但当一个队列长度大于另一个队列长度时,与该一个队列长度相关的队列等级不一定大于与该另一个队列长度相关的队列等级。当然,当一个队列长度大于另一个队列长度时,与该一个队列长度相关的队列等级也可以一定大于与该另一个队列长度相关的队列等级。相当于,队列的等级与队列的长度正相关,本申请实施例对此不作限定。可选地,也可以采用其他方式根据目标队列的长度确定目标队列的等级,本申请实施例对此不作限定。比如交换设备可以将目标队列的长度代入某一公式,以得到目标队列的等级。其中,该公式的输入为队列的长度,且该公式的输出为该队列的等级。
以下将对第三种可实现方式中的几个不同方面进行解释说明,第三种可实现方式也可以存在与以下几个方面提到的方案不同的方案,本申请实施例在此不做赘述。
第一方面,交换设备可以根据第一数据流的等级和目标队列的长度,确定第一数据流对应的标记概率。其中,若第一数据流的等级不变,则在根据第二队列长度确定的标记概率大于根据第一队列长度确定的标记概率时,表明第二队列长度大于第一队列长度。需要说明的是,若第一数据流的等级不变,则当一个队列长度大于另一个队列长度时,根据该一个队列长度确定的标记概率不一定大于根据该另一个队列长度确定的标记概率。当然,若第一数据流的等级不变,则当一个队列长度大于另一个队列长度时,根据该一个队列长度确定的标记概率也可以一定大于根据该另一个队列长度确定的标记概率,也即是,目标队列的长度也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
第二方面,交换设备可以根据第一数据流的等级和目标队列的等级,确定第一数据流对应的标记概率。其中,若第一数据流的等级不变,则在根据第二队列等级确定的标记概率大于根据第一队列等级确定的标记概率时,表明第二队列等级大于第一队列等级。需要说明的是,若第一数据流的等级不变,则当一个队列等级大于另一个队列等级时,根据该 一个队列等级确定的标记概率不一定大于根据该另一个队列等级确定的标记概率。当然,若第一数据流的等级不变,则当一个队列等级大于另一个队列等级时,根据该一个队列等级确定的标记概率也可以一定大于根据该另一个队列等级确定的标记概率,也即是,目标队列的等级也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
第三方面,交换设备可以根据第一数据流的目标参数和等级,以及目标队列的长度和等级,确定第一数据流对应的标记概率。
其中,在第一数据流的等级和目标队列的等级均不变时,第一数据流对应的标记概率、第一数据流的目标参数以及目标队列的长度的关系满足以下至少一种:
若第一数据流的目标参数不变,则第一数据流对应的标记概率随目标队列的长度增大而增大;若目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而增大;若第一数据流的目标参数不变,则第一数据流对应的标记概率随目标队列的长度增大而保持不变;若目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而保持不变。
以上罗列了第一数据流对应的标记概率、第一数据流的目标参数和传输速率的四种关系,还可以在逻辑正确的情况下,将这四种关系中任意两种关系进行组合,本申请实施例在此不做赘述。
需要说明的是,交换设备在根据第一数据流的目标参数和等级,以及目标队列的长度和等级,确定第一数据流对应的标记概率时,可以结合一个公式确定该第一数据流对应的标记概率。当第一数据流的目标参数以及目标队列的长度中的至少一个正相关时,该一个公式可以由图5所示的实施例中的第一公式,将Q(i,j)设置为与第一数据流的目标参数以及目标队列的长度中的至少一个正相关的函数得到。当第一数据流的打标概率不随目标参数和目标队列的长度的变化而变化时,该一个公式可以由图5所示的实施例中的第一公式,将Q(i,j)设置为常数得到。
在第四种可实现方式中,在交换设备根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率时,还可以结合与目标参数和辅助参数均不同的参数,确定该第一数据流对应的标记概率。比如,交换设备可以根据第一数据流的目标参数和辅助参数(如等级)中的至少一个,以及第一数据流的传输速率和第一数据流的传输速率的等级中的至少一个,确定第一数据流对应的标记概率。
其中,第一数据流的传输速率的等级与传输速率相关。比如,在第二传输速率等级大于第一传输速率等级时,表明第二传输速率大于第一传输速率。也即是,当传输速率等级越大时,与该传输速率等级相关的传输速率越大。但当一个传输速率大于另一个传输速率时,与该一个传输速率相关的传输速率等级不一定大于与该另一个传输速率相关的传输速率等级。示例地,第一数据流的传输速率位于多个传输速率范围中的一个传输速率范围内,多个传输速率范围与多个传输速率等级一一对应,第一数据流的传输速率的等级为:多个传输速率等级中与该一个传输速率范围对应的传输速率等级。
交换设备在确定第一数据流的传输速率的等级时,可以首先在多个传输速率范围中查找第一数据流的传输速率所在的一个传输速率范围。之后,交换设备可以在多个传输速率范围与多个传输速率等级的一一对应关系中,查找该一个传输速率范围所对应的传输速率 等级,并将该传输速率等级作为第一数据流的传输速率的等级。当然,当一个传输速率大于另一个传输速率时,与该一个传输速率相关的传输速率等级也可以一定大于与该另一个传输速率相关的传输速率等级。相当于,传输速率等级与传输速率正相关,本申请实施例对此不作限定。
可选地,也可以采用其他方式根据第一数据流的传输速率确定第一数据流的传输速率的等级,本申请实施例对此不作限定。比如交换设备可以将第一数据流的传输速率代入某一公式,以得到第一数据流的传输速率的等级。其中,该公式的输入为数据流的传输速率,且该公式的输出为数据流的第一数据流的传输速率的等级。
以下将对第四种可实现方式中的几个不同方面进行解释说明,第四种可实现方式也可以存在与以下几个方面提到的方案不同的方案,本申请实施例在此不做赘述。
第一方面,交换设备可以根据第一数据流的目标参数和第一数据流的传输速率,确定第一数据流对应的标记概率。其中,若第一数据流的目标参数不变,则在根据第二传输速率确定的标记概率大于根据第一传输速率确定的标记概率时,表明第二传输速率大于第一传输速率。需要说明的是,若第一数据流的目标参数不变,则当一个传输速率大于另一个传输速率时,根据该一个传输速率确定的标记概率不一定大于根据该另一个传输速率确定的标记概率。当然,若第一数据流的目标参数不变,则当一个传输速率大于另一个传输速率时,根据该一个传输速率确定的标记概率也可以一定大于根据该另一个传输速率确定的标记概率,也即是,传输速率也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
第二方面,交换设备可以根据第一数据流的等级和第一数据流的传输速率的等级,确定第一数据流对应的标记概率。其中,若第一数据流的等级不变,则在根据第二传输速率等级确定的标记概率大于根据第一传输速率等级确定的标记概率时,表明第二传输速率大于第一传输速率。需要说明的是,若第一数据流的等级不变,则当一个传输速率等级大于另一个传输速率等级时,根据该一个传输速率等级确定的标记概率不一定大于根据该另一个传输速率等级确定的标记概率。当然,若第一数据流的等级不变,则当一个传输速率等级大于另一个传输速率等级时,根据该一个传输速率等级确定的传输速率等级也可以一定大于根据该另一个传输速率等级确定的传输速率等级,也即是,传输速率等级也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
第三方面,交换设备可以根据第一数据流的目标参数和等级,以及第一数据流的传输速率和第一数据流的传输速率的等级,确定第一数据流对应的标记概率。
其中,在第一数据流的等级和第一数据流的传输速率的等级均不变时,第一数据流对应的标记概率、第一数据流的目标参数和传输速率的关系满足以下至少一种:
若第一数据流的目标参数不变,则第一数据流对应的标记概率随第一数据流的传输速率的增大而增大;若第一数据流的传输速率不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而增大;若第一数据流的目标参数不变,则第一数据流对应的标记概率随第一数据流的传输速率的增大而保持不变;若第一数据流的传输速率不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而保持不变。
以上罗列了第一数据流对应的标记概率、第一数据流的目标参数和传输速率的四种关系,还可以在逻辑正确的情况下,将这四种关系中任意两种关系进行组合,本申请实施例 在此不做赘述。
在第五种可实现方式中,在交换设备根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率时,还可以结合与目标参数和辅助参数均不同的参数,确定该第一数据流对应的标记概率。比如,交换设备可以根据第一数据流的目标参数和辅助参数(如等级)中的至少一个,目标队列的长度和等级中的至少一个,以及第一数据流的传输速率和第一数据流的传输速率的等级中的至少一个,确定第一数据流对应的标记概率。
其中,目标队列的等级与目标队列的长度的关系可以详见第三种可实现方式中的解释,第一数据流的传输速率的等级与传输速率的关系可以详见第四种可实现方式中的解释,本申请实施例在此不做赘述。
以下将对第五种可实现方式中的几个不同方面进行解释说明,第五种可实现方式也可以存在与以下几个方面提到的方案不同的方案,本申请实施例在此不做赘述。
第一方面,交换设备可以根据第一数据流的目标参数、目标队列的长度和第一数据流的传输速率,确定第一数据流对应的标记概率。
其中,若第一数据流的目标参数和目标队列的长度均不变,则在根据第二传输速率确定的标记概率大于根据第一传输速率确定的标记概率时,表明第二传输速率大于所述第一传输速率。需要说明的是,若第一数据流的目标参数和目标队列的长度均不变,则当一个传输速率大于另一个传输速率时,根据该一个传输速率确定的标记概率不一定大于根据该另一个传输速率确定的标记概率。当然,若第一数据流的目标参数和目标队列的长度均不变,则当一个传输速率大于另一个传输速率时,根据该一个传输速率确定的标记概率也可以一定大于根据该另一个传输速率确定的标记概率,也即是,传输速率也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
若第一数据流的目标参数和第一数据流的传输速率均不变,则在根据第二队列长度确定的标记概率大于根据第一队列长度确定的标记概率时,表明第二队列长度大于所述第一队列长度。需要说明的是,若第一数据流的目标参数和第一数据流的传输速率均不变,则当一个队列长度大于另一个队列长度时,根据该一个队列长度确定的标记概率不一定大于根据该另一个队列长度确定的标记概率。当然,若第一数据流的目标参数和第一数据流的传输速率均不变,则当一个队列长度大于另一个队列长度时,根据该一个队列长度确定的标记概率也可以一定大于根据该另一个队列长度确定的标记概率,也即是,队列长度也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
第二方面,交换设备可以根据第一数据流的等级、所述目标队列的等级以及第一数据流的传输速率的等级,确定第一数据流对应的标记概率。
其中,若第一数据流的等级和目标队列的等级均不变,则在根据第二传输速率等级确定的标记概率大于根据第一传输速率等级确定的标记概率时,第二传输速率等级大于第一传输速率等级。需要说明的是,若第一数据流的等级和目标队列的等级均不变,则当一个传输速率等级大于另一个传输速率等级时,根据该一个传输速率等级确定的标记概率不一定大于根据该另一个传输速率等级确定的标记概率。当然,若第一数据流的等级和目标队列的等级均不变,则当一个传输速率等级大于另一个传输速率等级时,根据该一个传输速 率等级确定的传输速率等级也可以一定大于根据该另一个传输速率等级确定的传输速率等级,也即是,传输速率等级也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
若第一数据流的等级和第一数据流的传输速率的等级均不变,则在根据第二队列等级确定的标记概率大于根据第一队列等级确定的标记概率时,第二队列等级大于第一队列等级。需要说明的是,若第一数据流的等级和第一数据流的传输速率的等级均不变,则当一个队列等级大于另一个队列等级时,根据该一个队列等级确定的标记概率不一定大于根据该另一个队列等级确定的标记概率。当然,若第一数据流的等级和第一数据流的传输速率的等级均不变,则当一个队列等级大于另一个队列等级时,根据该一个队列等级确定的传输速率等级也可以一定大于根据该另一个队列等级确定的传输速率等级,也即是,队列等级也可以与数据流的标记概率正相关,本申请实施例对此不作限定。
第三方面,交换设备可以根据第一数据流的目标参数和等级,目标队列的长度和等级,以及第一数据流的传输速率和第一数据流的传输速率的等级,确定所述第一数据流对应的标记概率。
其中,在第一数据流的等级、目标队列的等级以及第一数据流的传输速率的等级均不变时,第一数据流对应的标记概率、目标队列的长度、第一数据流的目标参数和传输速率的关系满足以下至少一种:
若第一数据流的目标参数和目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的传输速率的增大而增大;若第一数据流的目标参数和第一数据流的传输速率不变,则第一数据流对应的标记概率随目标队列的长度的增大而增大;若第一数据流的传输速率和目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的目标参数的增大而增大;若第一数据流的目标参数和目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的传输速率的增大而保持不变;若第一数据流的目标参数和第一数据流的传输速率不变,则第一数据流对应的标记概率随目标队列的长度的增大而保持不变;若第一数据流的传输速率和目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而保持不变。
以上罗列了第一数据流对应的标记概率、目标队列的长度、第一数据流的目标参数和传输速率的六种关系,还可以在逻辑正确的情况下,将这六种关系中任意多种关系(如任意两种关系,或任意三种关系)进行组合,本申请实施例在此不做赘述。
另外,本申请实施例中,在确定第一数据流对应的标记概率前,还可以首先判断第一数据流是否满足标记条件。比如,在根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率前,判断第一数据流是否满足标记条件。或者是,在根据第一数据流的目标参数和辅助参数中的至少一个,以及与目标参数和辅助参数均不同的至少一个参数,确定第一数据流对应的标记概率前,判断第一数据流是否满足标记条件。通过标记条件的判断,能够在一些满足标记条件的情况下,减小对第一数据流中的数据包进行拥塞标记的概率,从而减小第一数据流的时延。
示例地,该标记条件可以为与对数据包进行标记的条件相关的任意条件。
比如,标记条件可以包括:第一数据流的等级不属于指定的多个数据流等级中较低的q 个等级,q≥1。其中,该指定的多个数据流等级可以与步骤404中的多个数据流等级相同或不同,本申请实施例对此不作限定。在该标记条件满足时,说明第一数据流的数据量较小,第一数据流并不是引起交换设备拥塞的数据流,此时无需对第一数据流进行标记,以降低第一数据流的时延。
又比如,标记条件可以包括:第一数据流的传输速率大于传输速率阈值。其中,该传输速率阈值为常量或变量,也即是,该传输速率可以为固定的数值,或者与某些参数(如目标端口的个数等)相关的变量。可选地,该传输速率阈值可以为图5所示的实施例中的公平带宽。另外,当该传输速率阈值为常量时,传输速率阈值可以支持工作人员对该传输速率阈值进行更改。在该标记条件满足时,说明第一数据流的传输速率较低,第一数据流并不是引起交换设备拥塞的数据流,此时无需对第一数据流进行标记,以降低第一数据流的时延。
示例地,图11为本申请实施例提供的又一种数据包标记方法的流程图,该方法可以用于图1所示的数据传输系统中的交换设备02,如图11所示,该数据包标记方法可以包括:
步骤1001、对第一数据流的目标参数进行统计,其中,交换设备的目标队列用于缓存至少一个数据流的数据包,第一数据流为至少一个数据流中的一个数据流,目标参数用于反映第一数据流的数据量。
本申请实施例中,步骤1101可以参考步骤301,本申请实施例在此不做赘述。
步骤1102、在目标队列的长度满足第一长度条件时,根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率,其中,第一数据流的辅助参数与第一数据流的目标参数相关。
本申请实施例中,第一长度条件的解释可以参考图4或图5所示实施例中对第一长度条件的解释,本申请实施例在此不做赘述。
在确定目标队列的长度满足第一长度条件时,交换设备可以基于第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率。需要说明的是,步骤1102中确定出的第一数据流对应的标记概率可以为0也可以大于0,本申请实施例对此不作限定。
步骤303、根据第一数据流对应的标记概率对第一数据流中的数据包进行拥塞标记。
需要说明的是,当第一数据流对应的标记概率大于零时,交换设备可以根据第一数据流对应的标记概率对第一数据流中的数据包进行拥塞标记。并且,第一数据流中的数据包被拥塞标记的概率可以等于第一数据流对应的标记概率。当第一数据流对应的标记概率为零时,交换设备可以不对第一数据流中的数据包进行拥塞标记。
综上所述,由于本申请实施例提供的数据包标记方法中,当交换设备确定目标队列的长度满足第一长度条件时,说明此时目标队列较长。此时交换设备可以根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率,从而实现结合第一数据流的目标参数和辅助参数中的至少一个对第一数据流中的数据包进行拥塞标记。减小将全部数据流均进行拥塞标记的概率,从而能够实现避免降低全部数据流的传输效率,以及避免对全部数据流均造成时延。
另外,本申请中对第一数据流中的数据包进行拥塞标记可以包括:对第一数据流中的 数据包进行ECN标记,也可以是在第一数据流中的数据包中记录一个可反映拥塞程度的拥塞值,也可以是在第一数据流的数据包中记录其他体现拥塞的信息。
图12为本申请实施例提供的一种数据包标记设备的结构示意图,该数据包标记设备可以用于图1中的交换设备,如图12所示,数据包标记设备10可以包括:
统计模块101,用于对第一数据流的目标参数进行统计,其中,交换设备的目标队列用于缓存至少一个数据流的数据包,第一数据流为至少一个数据流中的任一数据流,目标队列包括:接收队列或发送队列,目标参数用于反映第一数据流的数据量;
判断模块102,用于当目标队列的长度满足第一长度条件时,根据第一数据流的目标参数,判断第一数据流是否满足标记条件,其中,第一长度条件包括:目标队列的长度大于第一长度阈值,满足标记条件的数据流的目标参数大于第一目标参数阈值,第一长度阈值和第一目标参数阈值均大于零;
第一标记模块103,用于当第一数据流满足标记条件时,对第一数据流中的至少一个数据包进行显示拥塞通知ECN标记。
综上所述,由于本申请实施例提供的数据包标记设备中,当判断模块确定第一数据流满足标记条件时,说明此时目标队列较长,且目标队列中的大部分数据为第一数据流的数据,因此,造成交换设备拥塞的数据流包括第一数据流。此时,第一标记模块需要对第一数据流中的数据包进行ECN标记,以降低第一数据流的传输速率,并能够消除交换设备上的拥塞,提高其他数据流的传输效率。另外,当交换设备确定第一数据流不满足标记条件时,说明虽然此时整个目标队列较长,但目标队列中的大部分数据并不是第一数据流的数据,因此,造成交换设备拥塞的数据流并不包括第一数据流。此时,无需对第一数据流中的数据包进行ECN标记。这样一来,就能够实现在目标队列的长度较长时,可以避免对数据量较少的数据流进行ECN标记,从而并不会降低数据量较少的数据流的传输效率,也不会对数据量较少的数据流造成时延。
可选地,目标参数包括:字节数,且第一目标参数阈值包括:字节数阈值;或者,目标参数包括:数据包个数,第一目标参数阈值包括:数据包个数阈值。
可选地,第一长度条件还包括:目标队列的长度小于或等于第二长度阈值,第二长度阈值小于无穷大。
图13为本申请实施例提供的另一种数据包标记设备的结构示意图,如图13所示,在图12的基础上,数据包标记设备10还可以包括:
第一确定模块104,用于用于当目标队列的长度满足第一长度条件时,根据第一数据流的目标参数,确定多个数据流等级中第一数据流的等级;
其中,数据流的等级与数据流的目标参数正相关,标记条件包括:数据流的等级为多个数据流等级中的非最低等级。
可选地,第一确定模块104用于:根据第一数据流的目标参数,以及m+1个目标参数范围与多个数据流等级的一一对应关系,确定第一数据流的等级;其中,m≥1,m+1个目标参数范围由m个目标参数阈值划分得到,m个目标参数阈值中的最小目标参数阈值为第一目标参数阈值,目标参数范围对应的数据流等级与目标参数范围中的目标参数正相关。
可选地,图14为本申请实施例提供的一种第一标记模块的结构示意图,如图14所示, 第一标记模块103可以包括:
确定单元1031,用于确定第一数据流对应的标记概率,其中,数据流对应的标记概率与数据流的等级正相关;
标记单元1032,用于根据第一数据流对应的标记概率,对第一数据流中的数据包进行ECN标记。
可选地,请继续参考图13,该数据包标记设备10还可以包括:
第二确定模块105,用于当第一数据流满足标记条件时,确定n+1个长度范围中目标队列的长度所在的目标长度范围;
其中,n≥1,n+1个长度范围由n个长度阈值划分得到,n个长度阈值中的最小长度阈值为第一长度阈值,n个长度阈值中的最大长度阈值为第二长度阈值;数据流对应的标记概率与目标长度范围中的长度正相关。
可选地,图14中的确定单元1031可以用于:
根据第一公式、第一数据流的等级和目标长度范围,确定第一数据流对应的标记概率;其中,第一公式包括:P(j,i)=P(j-1,i)+Q(i,j)*(L-L
j)/(L
j+1-L
j);
L
j表示n个长度阈值中从小到大排列的第j个长度阈值,1≤j≤n;L
j+1表示n个长度阈值中从小到大排列的第j+1个长度阈值;L表示目标队列的长度;P(j,i)表示在L位于(L
j,L
j+1]内时,至少一个数据流中第i等级的数据流对应的标记概率,1≤i≤m+1;当j-1>0时,P(j-1,i)表示在L位于(L
j-1,L
j]内时,至少一个数据流中第i等级的数据流对应的标记概率;当j-1=0时,P(j-1,i)=0;Q(i,j)表示在L位于(L
j,L
j+1]内时,第i等级的数据流的标记系数;Q(1,j)=0,且
可选地,标记条件还包括:数据流的传输速率大于公平带宽,公平带宽与目标端口的带宽正相关,
当目标队列为发送队列时,传输速率为交换设备发送数据流的速率;目标端口为交换设备中用于发送缓存在目标队列中的数据包的发送端口;
当目标队列为接收队列时,传输速率为交换设备接收数据流的速率,目标端口为交换设备中用于接收缓存在目标队列中的数据包的接收端口。
可选地,公平带宽与目标个数负相关,目标个数为:至少一个数据流中等级属于等级集合的数据流的个数,等级集合包括多个数据流等级中较高的p个等级,数据流的等级与数据流的目标参数正相关,1≤p。
可选地,公平带宽等于目标端口的带宽与目标个数之比。
可选地,请继续参考图13,数据包标记设备10还可以包括:第二标记模块106,用于当目标队列的长度满足第二长度条件时,对第一数据流中的每个数据包均进行ECN标记,第二长度条件包括:目标队列的长度大于第二长度阈值。
综上所述,由于本申请实施例提供的数据包标记设备中,当判断模块确定第一数据流满足标记条件时,说明此时目标队列较长,且目标队列中的大部分数据为第一数据流的数据,因此,造成交换设备拥塞的数据流包括第一数据流。此时,第一标记模块需要对第一数据流中的数据包进行ECN标记,以降低第一数据流的传输速率,并能够消除交换设备上 的拥塞,提高其他数据流的传输效率。另外,当交换设备确定第一数据流不满足标记条件时,说明虽然此时整个目标队列较长,但目标队列中的大部分数据并不是第一数据流的数据,因此,造成交换设备拥塞的数据流并不包括第一数据流。此时,无需对第一数据流中的数据包进行ECN标记。这样一来,就能够实现在目标队列的长度较长时,可以避免对数据量较少的数据流进行ECN标记,从而并不会降低数据量较少的数据流的传输效率,也不会对数据量较少的数据流造成时延。
图15为本申请实施例提供的又一种数据包标记设备的结构示意图,该数据包标记设备可以用于图1中的交换设备,如图15所示,数据包标记设备130可以包括:
统计模块1301,用于对第一数据流的目标参数进行统计,其中,交换设备的目标队列用于缓存至少一个数据流的数据包,第一数据流为至少一个数据流中的一个数据流,目标参数用于反映第一数据流的数据量;
确定模块1302,用于在目标队列的长度满足第一长度条件时,根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率,其中,第一数据流的辅助参数与第一数据流的目标参数相关;
标记模块1303,用于根据第一数据流对应的标记概率对第一数据流中的数据包进行拥塞标记。
综上所述,由于本申请实施例提供的数据包标记设备中,当确定模块确定目标队列的长度满足第一长度条件时,说明此时目标队列较长。此时确定模块可以根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率,从而实现结合第一数据流的目标参数和辅助参数中的至少一个对第一数据流中的数据包进行拥塞标记。减小将全部数据流均进行拥塞标记的概率,从而能够实现避免降低全部数据流的传输效率,以及避免对全部数据流均造成时延。
可选地,辅助参数包括第一数据流的等级。
可选地,确定模块1302用于:根据第一数据流的目标参数,确定第一数据流对应的标记概率;其中,在根据第二目标参数确定的标记概率大于根据第一目标参数确定的标记概率时,第二目标参数大于第一目标参数。
可选地,确定模块1302用于:根据第一数据流的等级,确定第一数据流对应的标记概率;其中,在根据第二流等级确定的标记概率大于根据第一流等级确定的标记概率时,第二流等级大于第一流等级。
可选地,确定模块1302用于:根据第一数据流的目标参数和等级,确定第一数据流对应的标记概率;其中,在第一数据流的等级不变时,第一数据流对应的标记概率随第一数据流的目标参数增大而增大,或者,第一数据流对应的标记概率随第一数据流的目标参数增大而保持不变。
可选地,在与第二目标参数相关的第二流等级大于与第一目标参数相关的第一流等级时,第二目标参数大于第一目标参数。
可选地,第一数据流的目标参数位于多个目标参数范围中的一个目标参数范围内,多个目标参数范围与多个数据流等级一一对应,第一数据流的等级为:多个数据流等级中与一个目标参数范围对应的数据流等级。
在一种可实现方式中,如图16所示,确定模块1302包括:第一确定单元13021,用于根据第一数据流的目标参数和等级中的至少一个,以及目标队列的长度和等级中的至少一个,确定第一数据流对应的标记概率;其中,目标队列的等级与目标队列的长度相关。
可选地,第一确定单元13021用于:根据第一数据流的等级和目标队列的长度,确定第一数据流对应的标记概率;其中,若第一数据流的等级不变,则在根据第二队列长度确定的标记概率大于根据第一队列长度确定的标记概率时,第二队列长度大于第一队列长度。
可选地,第一确定单元13021用于:根据第一数据流的等级和目标队列的等级,确定第一数据流对应的标记概率;其中,若第一数据流的等级不变,则在根据第二队列等级确定的标记概率大于根据第一队列等级确定的标记概率时,第二队列等级大于第一队列等级。
可选地,第一确定单元13021用于:根据第一数据流的目标参数和等级,以及目标队列的长度和等级,确定第一数据流对应的标记概率;其中,在第一数据流的等级和目标队列的等级均不变时,第一数据流对应的标记概率、第一数据流的目标参数以及目标队列的长度的关系满足以下至少一种:若第一数据流的目标参数不变,则第一数据流对应的标记概率随目标队列的长度增大而增大;若目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而增大;
或者,在第一数据流的等级和目标队列的等级均不变时,第一数据流对应的标记概率、第一数据流的目标参数以及目标队列的长度的关系满足以下至少一种:若第一数据流的目标参数不变,则第一数据流对应的标记概率随目标队列的长度增大而保持不变;若目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而保持不变。
可选地,在与第二队列长度相关的第二队列等级大于与第一队列长度相关的第一队列等级时,第二队列长度大于第一队列长度。
可选地,目标队列的长度位于多个长度范围中的一个长度范围内,多个长度范围与多个队列等级一一对应,目标队列的等级为:多个队列等级中与一个长度范围对应的队列等级。
在一种可实现方式中,如图17所示,确定模块1302包括:第二确定单元13022,用于根据第一数据流的目标参数和等级中的至少一个,以及第一数据流的传输速率和第一数据流的传输速率的等级中的至少一个,确定第一数据流对应的标记概率;其中,第一数据流的传输速率的等级与传输速率相关。
可选地,第二确定单元13022用于:根据第一数据流的目标参数和第一数据流的传输速率,确定第一数据流对应的标记概率;其中,若第一数据流的目标参数不变,则在根据第二传输速率确定的标记概率大于根据第一传输速率确定的标记概率时,第二传输速率大于第一传输速率。
可选地,第二确定单元13022用于:根根据第一数据流的等级和第一数据流的传输速率的等级,确定第一数据流对应的标记概率;其中,若第一数据流的等级不变,则在根据第二传输速率等级确定的标记概率大于根据第一传输速率等级确定的标记概率时,第二传输速率大于第一传输速率。
可选地,第二确定单元13022用于:根根据第一数据流的目标参数和等级,以及第一数据流的传输速率和第一数据流的传输速率的等级,确定第一数据流对应的标记概率;
其中,在第一数据流的等级和第一数据流的传输速率的等级均不变时,第一数据流对 应的标记概率、第一数据流的目标参数和传输速率的关系满足以下至少一种:若第一数据流的目标参数不变,则第一数据流对应的标记概率随第一数据流的传输速率的增大而增大;若第一数据流的传输速率不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而增大;
或者,在第一数据流的等级和第一数据流的传输速率的等级均不变时,第一数据流对应的标记概率、第一数据流的目标参数和传输速率的关系满足以下至少一种:若第一数据流的目标参数不变,则第一数据流对应的标记概率随第一数据流的传输速率的增大而保持不变;若第一数据流的传输速率不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而保持不变。
在一种可实现方式中,如图18所示,第一确定单元13021包括:确定子单元130211,用于根据第一数据流的目标参数和等级中的至少一个,目标队列的长度和等级中的至少一个,以及第一数据流的传输速率和第一数据流的传输速率的等级中的至少一个,确定第一数据流对应的标记概率;其中,目标队列的等级与目标队列的长度相关,第一数据流的传输速率的等级与传输速率相关。
可选地,确定子单元139211用于:根据第一数据流的目标参数、目标队列的长度和第一数据流的传输速率,确定第一数据流对应的标记概率;其中,若第一数据流的目标参数和目标队列的长度均不变,则在根据第二传输速率确定的标记概率大于根据第一传输速率确定的标记概率时,第二传输速率大于第一传输速率;若第一数据流的目标参数和第一数据流的传输速率均不变,则在根据第二队列长度确定的标记概率大于根据第一队列长度确定的标记概率时,第二队列长度大于第一队列长度。
可选地,确定子单元139211用于:根据第一数据流的等级、目标队列的等级以及第一数据流的传输速率的等级,确定第一数据流对应的标记概率;其中,若第一数据流的等级和目标队列的等级均不变,则在根据第二传输速率等级确定的标记概率大于根据第一传输速率等级确定的标记概率时,第二传输速率等级大于第一传输速率等级;若第一数据流的等级和第一数据流的传输速率的等级均不变,则在根据第二队列等级确定的标记概率大于根据第一队列等级确定的标记概率时,第二队列等级大于第一队列等级。
可选地,确定子单元139211用于:根据第一数据流的目标参数和等级,目标队列的长度和等级,以及第一数据流的传输速率和第一数据流的传输速率的等级,确定第一数据流对应的标记概率;
其中,在第一数据流的等级、目标队列的等级以及第一数据流的传输速率的等级均不变时,第一数据流对应的标记概率、目标队列的长度、第一数据流的目标参数和传输速率的关系满足以下至少一种:若第一数据流的目标参数和目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的传输速率的增大而增大;若第一数据流的目标参数和第一数据流的传输速率不变,则第一数据流对应的标记概率随目标队列的长度的增大而增大;若第一数据流的传输速率和目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而增大;
或者,在第一数据流的等级、目标队列的等级以及第一数据流的传输速率的等级均不变时,第一数据流对应的标记概率、目标队列的长度、第一数据流的目标参数和传输速率的关系满足以下至少一种:若第一数据流的目标参数和目标队列的长度不变,则第一数据 流对应的标记概率随第一数据流的传输速率的增大而保持不变;若第一数据流的目标参数和第一数据流的传输速率不变,则第一数据流对应的标记概率随目标队列的长度的增大而保持不变;若第一数据流的传输速率和目标队列的长度不变,则第一数据流对应的标记概率随第一数据流的目标参数增大而保持不变。
可选地,在第二传输速率等级大于第一传输速率等级时,第二传输速率大于第一传输速率。
可选地,第一数据流的传输速率位于多个传输速率范围中的一个传输速率范围内,多个传输速率范围与多个传输速率等级一一对应,第一数据流的传输速率的等级为:多个传输速率等级中与一个传输速率范围对应的传输速率等级。
可选地,确定模块1302用于:在第一数据流满足标记条件时,根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率。
可选地,标记条件包括:第一数据流的等级不属于指定的多个数据流等级中较低的q个等级,q≥1。
可选地,标记条件包括:第一数据流的传输速率大于传输速率阈值,其中,传输速率阈值为常量或变量。
可选地,目标参数包括:字节数,或数据包个数。
综上所述,由于本申请实施例提供的数据包标记设备中,当确定模块确定目标队列的长度满足第一长度条件时,说明此时目标队列较长。此时确定模块可以根据第一数据流的目标参数和辅助参数中的至少一个,确定第一数据流对应的标记概率,从而实现结合第一数据流的目标参数和辅助参数中的至少一个对第一数据流中的数据包进行拥塞标记。减小将全部数据流均进行拥塞标记的概率,从而能够实现避免降低全部数据流的传输效率,以及避免对全部数据流均造成时延。
上述实施例可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现,所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机的可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心传输。所述计算机可读存储介质可以是计算机可以存取的任何可用介质或者包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质,或者半导体介质(例如固态硬盘)等。
除非另作定义,此处使用的技术术语或者科学术语应当为本申请所属领域内具有一般技能的人士所理解的通常意义。本申请专利申请说明书以及权利要求书中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的概念。术语“多个”指两个或两个以上,除非另有明确的限定。
本申请中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系, 例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
需要说明的是,本申请实施例提供的方法实施例能够与相应的设备实施例相互参考,本申请实施例对此不做限定。本申请实施例提供的方法实施例步骤的先后顺序能够进行适当调整,步骤也能够根据情况进行相应增减,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,因此不再赘述。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
Claims (31)
- 一种数据包标记方法,其特征在于,用于交换设备,所述方法包括:对第一数据流的目标参数进行统计,其中,所述交换设备的目标队列用于缓存至少一个数据流的数据包,所述第一数据流为所述至少一个数据流中的一个数据流,所述目标参数用于反映所述第一数据流的数据量;在所述目标队列的长度满足第一长度条件时,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,其中,所述第一数据流的辅助参数与所述第一数据流的目标参数相关;根据所述第一数据流对应的标记概率对所述第一数据流中的数据包进行拥塞标记。
- 根据权利要求1所述的方法,其特征在于,所述辅助参数包括所述第一数据流的等级。
- 根据权利要求2所述的方法,其特征在于,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数,确定所述第一数据流对应的标记概率;其中,在根据第二目标参数确定的标记概率大于根据第一目标参数确定的标记概率时,所述第二目标参数大于所述第一目标参数。
- 根据权利要求2所述的方法,其特征在于,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级,确定所述第一数据流对应的标记概率;其中,在根据第二流等级确定的标记概率大于根据第一流等级确定的标记概率时,所述第二流等级大于所述第一流等级。
- 根据权利要求2所述的方法,其特征在于,根据所述第一数据流的目标参数和辅助中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级,确定所述第一数据流对应的标记概率;其中,在所述第一数据流的等级不变时,所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而增大,或者,所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而保持不变。
- 根据权利要求2、4或5所述的方法,其特征在于,在与第二目标参数相关的第二流等级大于与第一目标参数相关的第一流等级时,所述第二目标参数大于所述第一目标参数。
- 根据权利要求6所述的方法,其特征在于,所述第一数据流的目标参数位于多个目标参数范围中的一个目标参数范围内,所述多个目标参数范围与多个数据流等级一一对应,所述第一数据流的等级为:所述多个数据流等级 中与所述一个目标参数范围对应的数据流等级。
- 根据权利要求2至7任一所述的方法,其特征在于,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率;其中,所述目标队列的等级与所述目标队列的长度相关。
- 根据权利要求8所述的方法,其特征在于,根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级和所述目标队列的长度,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的等级不变,则在根据第二队列长度确定的标记概率大于根据第一队列长度确定的标记概率时,所述第二队列长度大于所述第一队列长度。
- 根据权利要求8所述的方法,其特征在于,根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级和所述目标队列的等级,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的等级不变,则在根据第二队列等级确定的标记概率大于根据第一队列等级确定的标记概率时,所述第二队列等级大于所述第一队列等级。
- 根据权利要求8所述的方法,其特征在于,根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级,以及所述目标队列的长度和等级,确定所述第一数据流对应的标记概率;其中,在所述第一数据流的等级和所述目标队列的等级均不变时,所述第一数据流对应的标记概率、所述第一数据流的目标参数以及所述目标队列的长度的关系满足以下至少一种:若所述第一数据流的目标参数不变,则所述第一数据流对应的标记概率随所述目标队列的长度增大而增大;若所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而增大;若所述第一数据流的目标参数不变,则所述第一数据流对应的标记概率随所述目标队列的长度增大而保持不变;若所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而保持不变。
- 根据权利要求8、10或11所述的方法,其特征在于,在与第二队列长度相关的第二队列等级大于与第一队列长度相关的第一队列等级时,所述第二队列长度大于所述第一队列 长度。
- 根据权利要求12所述的方法,其特征在于,所述目标队列的长度位于多个长度范围中的一个长度范围内,所述多个长度范围与多个队列等级一一对应,所述目标队列的等级为:所述多个队列等级中与所述一个长度范围对应的队列等级。
- 根据权利要求2至7任一所述的方法,其特征在于,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率;其中,所述第一数据流的传输速率的等级与所述第一数据流的传输速率相关。
- 根据权利要求14所述的方法,其特征在于,根据所述第一数据流的目标参数和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和所述第一数据流的传输速率,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的目标参数不变,则在根据第二传输速率确定的标记概率大于根据第一传输速率确定的标记概率时,所述第二传输速率大于所述第一传输速率。
- 根据权利要求14所述的方法,其特征在于,根据所述第一数据流的目标参数和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级和所述第一数据流的传输速率的等级,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的等级不变,则在根据第二传输速率等级确定的标记概率大于根据第一传输速率等级确定的标记概率时,所述第二传输速率大于所述第一传输速率。
- 根据权利要求14所述的方法,其特征在于,根据所述第一数据流的目标参数和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级,确定所述第一数据流对应的标记概率;其中,在所述第一数据流的等级和所述第一数据流的传输速率的等级均不变时,所述第一数据流对应的标记概率、所述第一数据流的目标参数和传输速率的关系满足以下至少一种:若所述第一数据流的目标参数不变,则所述第一数据流对应的标记概率随所述第一数据流的传输速率的增大而增大;若所述第一数据流的传输速率不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而增大;若所述第一数据流的目标参数不变,则所述第一数据流对应的标记概率随所述第一数据流的传输速率的增大而保持不变;若所述第 一数据流的传输速率不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而保持不变。
- 根据权利要求8至13任一所述的方法,其特征在于,根据所述第一数据流的目标参数和等级中的至少一个,以及所述目标队列的长度和等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级中的至少一个,所述目标队列的长度和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率;其中,所述目标队列的等级与所述目标队列的长度相关,第一数据流的传输速率的等级与第一数据流的传输速率相关。
- 根据权利要求18所述的方法,其特征在于,根据所述第一数据流的目标参数和等级中的至少一个,所述目标队列的长度和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数、所述目标队列的长度和所述第一数据流的传输速率,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的目标参数和所述目标队列的长度均不变,则在根据第二传输速率确定的标记概率大于根据第一传输速率确定的标记概率时,所述第二传输速率大于所述第一传输速率;若所述第一数据流的目标参数和所述第一数据流的传输速率均不变,则在根据第二队列长度确定的标记概率大于根据第一队列长度确定的标记概率时,所述第二队列长度大于所述第一队列长度。
- 根据权利要求18所述的方法,其特征在于,根据所述第一数据流的目标参数和等级中的至少一个,所述目标队列的长度和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的等级、所述目标队列的等级以及所述第一数据流的传输速率的等级,确定所述第一数据流对应的标记概率;其中,若所述第一数据流的等级和所述目标队列的等级均不变,则在根据第二传输速率等级确定的标记概率大于根据第一传输速率等级确定的标记概率时,所述第二传输速率等级大于所述第一传输速率等级;若所述第一数据流的等级和所述第一数据流的传输速率的等级均不变,则在根据第二队列等级确定的标记概率大于根据第一队列等级确定的标记概率时,所述第二队列等级大于所述第一队列等级。
- 根据权利要求18所述的方法,其特征在于,根据所述第一数据流的目标参数和等级 中的至少一个,所述目标队列的长度和等级中的至少一个,以及所述第一数据流的传输速率和所述第一数据流的传输速率的等级中的至少一个,确定所述第一数据流对应的标记概率,包括:根据所述第一数据流的目标参数和等级,所述目标队列的长度和等级,以及所述第一数据流的传输速率和第一数据流的传输速率的等级,确定所述第一数据流对应的标记概率;其中,在所述第一数据流的等级、所述目标队列的等级以及所述第一数据流的传输速率的等级均不变时,所述第一数据流对应的标记概率、所述目标队列的长度、所述第一数据流的目标参数和传输速率的关系满足以下至少一种:若所述第一数据流的目标参数和所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的传输速率的增大而增大;若所述第一数据流的目标参数和所述第一数据流的传输速率不变,则所述第一数据流对应的标记概率随所述目标队列的长度的增大而增大;若所述第一数据流的传输速率和所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而增大;若所述第一数据流的目标参数和所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的传输速率的增大而保持不变;若所述第一数据流的目标参数和所述第一数据流的传输速率不变,则所述第一数据流对应的标记概率随所述目标队列的长度的增大而保持不变;若所述第一数据流的传输速率和所述目标队列的长度不变,则所述第一数据流对应的标记概率随所述第一数据流的目标参数增大而保持不变。
- 根据权利要求14、16、17、18、20或21所述的方法,其特征在于,在第二传输速率等级大于第一传输速率等级时,所述第二传输速率大于所述第一传输速率。
- 根据权利要求22所述的方法,其特征在于,所述第一数据流的传输速率位于多个传输速率范围中的一个传输速率范围内,所述多个传输速率范围与多个传输速率等级一一对应,所述第一数据流的传输速率的等级为:所述多个传输速率等级中与所述一个传输速率范围对应的传输速率等级。
- 根据权利要求1至23任一所述的方法,其特征在于,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率,包括:在所述第一数据流满足标记条件时,根据所述第一数据流的目标参数和辅助参数中的至少一个,确定所述第一数据流对应的标记概率。
- 根据权利要求24所述的方法,其特征在于,所述标记条件包括:所述第一数据流的等级不属于指定的多个数据流等级中较低的q个等级,q≥1。
- 根据权利要求24或25所述的方法,其特征在于,所述标记条件包括:所述第一数据流的传输速率大于传输速率阈值,其中,所述传输速率阈值为常量或变量。
- 根据权利要求1至26任一所述的方法,其特征在于,所述目标参数包括:字节数, 或数据包个数。
- 一种数据包标记设备,其特征在于,用于交换设备,所述数据包标记设备包括:所述数据包标记设备包括用于执行权利要求1至27任一所述的数据包标记方法的各个模块。
- 一种数据包标记设备,其特征在于,所述数据包标记设备包括:至少一个处理器、至少一个端口、存储器和至少一个通信总线,所述处理器用于执行所述存储器中存储的程序,以实现权利要求1至27任一所述的数据包标记方法。
- 一种数据传输系统,其特征在于,所述数据传输系统包括:交换设备,所述交换设备包括:权利要求28所述的数据包标记设备,或权利要求29所述的数据包标记设备。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,在所述计算机可读存储介质在计算机上运行时,使得计算机执行如权利要求1至27任一所述的数据包标记方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP20784034.9A EP3934184A4 (en) | 2019-04-04 | 2020-04-03 | DATA PACKET MARKING METHOD AND DEVICE, DATA TRANSMISSION SYSTEM |
US17/492,395 US11991085B2 (en) | 2019-04-04 | 2021-10-01 | Data packet marking method and device, and data transmission system |
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910271733 | 2019-04-04 | ||
CN201910271733.1 | 2019-04-04 | ||
CN201910345779.3 | 2019-04-26 | ||
CN201910345779.3A CN111786902A (zh) | 2019-04-04 | 2019-04-26 | 数据包标记方法及设备、数据传输系统 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/492,395 Continuation US11991085B2 (en) | 2019-04-04 | 2021-10-01 | Data packet marking method and device, and data transmission system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020200307A1 true WO2020200307A1 (zh) | 2020-10-08 |
Family
ID=72664645
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/083193 WO2020200307A1 (zh) | 2019-04-04 | 2020-04-03 | 数据包标记方法及设备、数据传输系统 |
Country Status (3)
Country | Link |
---|---|
US (1) | US11991085B2 (zh) |
EP (1) | EP3934184A4 (zh) |
WO (1) | WO2020200307A1 (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020236272A1 (en) * | 2019-05-23 | 2020-11-26 | Cray Inc. | System and method for facilitating fine-grain flow control in a network interface controller (nic) |
CN116366553B (zh) * | 2023-03-08 | 2023-11-10 | 杭州流形新网络科技有限公司 | 一种自适应网络拥塞控制方法 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090190486A1 (en) * | 2008-01-30 | 2009-07-30 | Lavigne Bruce E | System and methods for distributed output packet metering using input lookups |
CN104272680A (zh) * | 2012-03-09 | 2015-01-07 | 英国电讯有限公司 | 用信号通知拥塞 |
CN105827540A (zh) * | 2016-05-30 | 2016-08-03 | 清华大学深圳研究生院 | 一种基于优先级的数据中心网络传输层数据流传输方法 |
CN108449279A (zh) * | 2016-12-13 | 2018-08-24 | 中国移动通信有限公司研究院 | 拥塞控制方法及装置 |
CN109391558A (zh) * | 2017-08-02 | 2019-02-26 | 东软集团股份有限公司 | 一种队列的控制方法及控制装置 |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB0031535D0 (en) * | 2000-12-22 | 2001-02-07 | Nokia Networks Oy | Traffic congestion |
US20080298248A1 (en) * | 2007-05-28 | 2008-12-04 | Guenter Roeck | Method and Apparatus For Computer Network Bandwidth Control and Congestion Management |
US8565092B2 (en) * | 2010-11-18 | 2013-10-22 | Cisco Technology, Inc. | Dynamic flow redistribution for head of line blocking avoidance |
US9350631B2 (en) * | 2013-09-30 | 2016-05-24 | Broadcom Corporation | Identifying flows causing undesirable network events |
US9705808B2 (en) * | 2014-03-21 | 2017-07-11 | Cisco Technology, Inc. | Flow aware buffer management for data center switches |
US10084716B2 (en) * | 2016-03-20 | 2018-09-25 | Mellanox Technologies Tlv Ltd. | Flexible application of congestion control measures |
WO2017199208A1 (en) * | 2016-05-18 | 2017-11-23 | Marvell Israel (M.I.S.L) Ltd. | Congestion avoidance in a network device |
KR102128015B1 (ko) * | 2018-11-20 | 2020-07-09 | 울산과학기술원 | 네트워크 스위칭 장치 및 이를 이용한 마킹 수행 방법 |
-
2020
- 2020-04-03 WO PCT/CN2020/083193 patent/WO2020200307A1/zh unknown
- 2020-04-03 EP EP20784034.9A patent/EP3934184A4/en active Pending
-
2021
- 2021-10-01 US US17/492,395 patent/US11991085B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090190486A1 (en) * | 2008-01-30 | 2009-07-30 | Lavigne Bruce E | System and methods for distributed output packet metering using input lookups |
CN104272680A (zh) * | 2012-03-09 | 2015-01-07 | 英国电讯有限公司 | 用信号通知拥塞 |
CN105827540A (zh) * | 2016-05-30 | 2016-08-03 | 清华大学深圳研究生院 | 一种基于优先级的数据中心网络传输层数据流传输方法 |
CN108449279A (zh) * | 2016-12-13 | 2018-08-24 | 中国移动通信有限公司研究院 | 拥塞控制方法及装置 |
CN109391558A (zh) * | 2017-08-02 | 2019-02-26 | 东软集团股份有限公司 | 一种队列的控制方法及控制装置 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3934184A4 |
Also Published As
Publication number | Publication date |
---|---|
EP3934184A1 (en) | 2022-01-05 |
US20220045960A1 (en) | 2022-02-10 |
EP3934184A4 (en) | 2022-04-20 |
US11991085B2 (en) | 2024-05-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5340186B2 (ja) | パケット中継装置及びパケットを中継する方法 | |
US20220303217A1 (en) | Data Forwarding Method, Data Buffering Method, Apparatus, and Related Device | |
US9112784B2 (en) | Hierarchical occupancy-based congestion management | |
WO2020134425A1 (zh) | 一种数据处理方法、装置、设备及存储介质 | |
WO2020200307A1 (zh) | 数据包标记方法及设备、数据传输系统 | |
US9055009B2 (en) | Hybrid arrival-occupancy based congestion management | |
WO2021047404A1 (zh) | 一种网络参数配置方法及装置 | |
CN110730142B (zh) | 一种信息不可知情况下的数据中心流自适应调度方法 | |
US8929213B2 (en) | Buffer occupancy based random sampling for congestion management | |
US20230269192A1 (en) | Automatic flow management | |
CN112995048B (zh) | 数据中心网络的阻塞控制与调度融合方法及终端设备 | |
CN111131075A (zh) | 一种高并发数据包缓冲方法 | |
CN112104562A (zh) | 拥塞控制方法及装置、通信网络、计算机存储介质 | |
WO2021143913A1 (zh) | 拥塞控制方法、装置及系统、存储介质 | |
CN116980342B (zh) | 一种多链路聚合传输数据的方法和系统 | |
US20240064109A1 (en) | Method and system for dynamic quota-based congestion management | |
JP4648290B2 (ja) | パケット転送装置、パケット分配方法、グループ所属プロセッサ変更方法、およびコンピュータプログラム | |
CN102340442B (zh) | 调整接口接收队列长度的方法及装置 | |
CN116827867A (zh) | 一种基于数据中心网络的低延时拥塞流识别方法 | |
CN111786902A (zh) | 数据包标记方法及设备、数据传输系统 | |
JP7251060B2 (ja) | 情報処理装置、情報処理システム及び情報処理プログラム | |
US11924106B2 (en) | Method and system for granular dynamic quota-based congestion management | |
WO2023193689A1 (zh) | 报文传输方法、装置、设备及计算机可读存储介质 | |
CN116566923A (zh) | 一种基于隐式优先级的数据中心网络传输系统 | |
CN118301082A (zh) | 一种为业务流实现优先级流量控制的方法及设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20784034 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 2020784034 Country of ref document: EP Effective date: 20211001 |