WO2020063299A1 - 统计活跃流数目的方法、网络设备和*** - Google Patents

统计活跃流数目的方法、网络设备和*** Download PDF

Info

Publication number
WO2020063299A1
WO2020063299A1 PCT/CN2019/104734 CN2019104734W WO2020063299A1 WO 2020063299 A1 WO2020063299 A1 WO 2020063299A1 CN 2019104734 W CN2019104734 W CN 2019104734W WO 2020063299 A1 WO2020063299 A1 WO 2020063299A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packets
network device
group
congestion
active
Prior art date
Application number
PCT/CN2019/104734
Other languages
English (en)
French (fr)
Inventor
刘孟竹
张亚丽
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP19865257.0A priority Critical patent/EP3840299A4/en
Publication of WO2020063299A1 publication Critical patent/WO2020063299A1/zh
Priority to US17/206,804 priority patent/US11489774B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/02Capturing of monitoring data
    • H04L43/026Capturing of monitoring data using flow identification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • H04L43/062Generation of reports related to network traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/11Identifying congestion
    • H04L47/115Identifying congestion using a dedicated packet
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • the present application relates to the field of network technology, and more particularly, to a method, network device, and system for counting the number of active flows.
  • the traditional solution generally determines whether a certain data stream is an active stream according to whether a data packet is received within a fixed time window, and then counts the number of active streams. For example, if a network device receives a packet of a first data stream within a first time window, it is determined that the first data stream is an active stream, and execution is performed by adding one to the number of active streams, that is, counter ++, where counter is the current value of the network device. The number of active streams received; if the network device does not receive a packet of the first data stream within the first time window, it determines that the first data stream is an inactive stream and executes counter--.
  • This application provides a method, network device, and system for counting the number of active flows to more accurately count the number of active flows.
  • a method for counting the number of active flows includes: a first network device receives a first packet of a first group of data packets sent by a second network device, and adds 1 to the current number of active flows to obtain A first number of active flows; the first network device receives a tail packet of the first group of data packets sent by the second network device, and according to the first group of data packets carries data identified by an external congestion notification ECN The number of packets determines a first congestion value; when the first congestion value is less than a congestion threshold, the first network device reduces the first active flow number by one to obtain a second active flow number; when the first When a congestion value is greater than or equal to the congestion threshold, the first network device keeps the first active flow number unchanged.
  • the method is applied to a data center network or a metropolitan area network, and the second network device is configured to send a data packet to the first network device.
  • the above-mentioned first congestion value is used to indicate a degree of congestion of the first network on which the first network device receives a data packet sent by the second network device.
  • the congestion threshold may be a preset threshold, and the congestion threshold may specifically be a threshold estimated according to a network state. For scenarios with low bandwidth utilization, you can set a smaller congestion threshold, and for scenarios with high bandwidth utilization, you can set a larger congestion threshold.
  • the congestion threshold in a scenario with low bandwidth utilization, may be 0.3, 0.4, or 0.5, and in a scenario with high bandwidth utilization, the congestion threshold may be 0.6, 0.7, or 0.8.
  • the current active flow number when receiving the first packet of the first group of data packets, the current active flow number needs to be increased by 1 to obtain the first active flow number.
  • the current number of active flows refers to the number of active flows that the first network device counts before receiving the first packet of the first group of data packets.
  • the number of active flows needs to be updated when the first packet of the first group of data packets is received. That is, the number of active flows that is calculated before the first packet of the first group of data packets is received is increased by one.
  • the number of first active flows After receiving the tail packet of the first group of data packets, the number of first active flows needs to be updated again according to the number of data packets carrying the ECN identifier in the first group of data packets. If the first congestion value is less than the congestion threshold, then , After receiving the tail packet of the first group of data packets, the number of active flows obtained by the first network device is the second number of active flows; if the first congestion value is less than the congestion threshold, then the first group of data packets is received The number of active flows obtained by the first network device after the tail packet is the number of the first active flows.
  • the number of active flows obtained by statistics is the first active flow number (when the first congestion value is greater than or equal to the congestion threshold) or the second active flow number (the first When the congestion value is less than the congestion threshold).
  • the ECN identifier may be a congestion identifier added by another network device (specifically, a switching device) between the first network device and the second network device when receiving a data packet.
  • a congestion identifier added by another network device (specifically, a switching device) between the first network device and the second network device when receiving a data packet.
  • the first packet of the first group of data packets may be the first packet in the first group of data packets received by the first network device, and the tail packet of the first group of data packets may be the first packet received by the first network device.
  • the number of data packets of each group of data packets can be preset.
  • each data packet further includes a data packet identifier, where the data packet identifier is used to indicate a type of the data packet.
  • the value of the identifier may be used to indicate that the data packet is a first packet, a tail packet, or a data packet located between the first packet and the tail packet of a group of data packets.
  • the packet identifier may be carried in a packet header or a payload of the packet, or the packet identifier may also be carried in a field other than the packet to carry the packet identifier
  • the field of is transmitted together with the message, so that the first network device can identify the type of the data packet according to the field.
  • the packet identifier can be carried in the opcode field in the RoCEv2 message, or the data packet The identifier can also be carried in a reserved field (for example, the rsvd7 field) in the RoCEv2 packet.
  • the method for counting active data streams of the present application may perform statistics on any data stream received by the first network device, and then obtain the number of active streams received by the first network device.
  • the congestion situation can be determined according to the number of data packets carrying the ECN identifier in the group of data packets, and the number of active flows can be modified according to the congestion situation. Perform more accurate statistics on the number of active flows to obtain a more accurate number of active flows.
  • the traditional scheme does not take network congestion into consideration when counting the number of active flows.
  • the traditional scheme counts active flows based on the ideal situation of the network without congestion.
  • network congestion occurs, It will affect the number of data packets received by the receiving end within a period of time, which will lead to inaccurate statistics of the number of active flows.
  • statistics on the data packets carrying the ECN identifier in each group of data packets can be used to estimate the network congestion.
  • the number of active flows can be reduced by 1, and when the network congestion is severe It can keep the number of active flows unchanged, which can reduce the impact of network congestion on the number of active flows, and can achieve more accurate statistics.
  • the determining a first congestion value according to the number of data packets carrying an ECN identifier in the first set of data packets includes: changing the first set of data A ratio of the number of data packets carrying the ECN identifier to the number of data packets of the first group of data packets is determined as the first congestion value.
  • determining the ratio of the number of data packets carrying the ECN identifier to the number of data packets of the first group of data packets as the first congestion value includes: A ratio of a total number of data packets carrying an ECN identifier to a first group of data packets and a total number of data packets of the first group of data packets is determined as the first congestion value.
  • the first packet, the tail packet, and the data packets between the first packet and the tail packet in the first group of data packets described above may all carry an ECN identifier.
  • ECN identifier When each packet in the first group of data packets carries the ECN identifier, it means that the network congestion is serious.
  • the first group of data packets that carry the ECN identifier is small, it indicates that the network congestion is low (or that The network is relatively smooth).
  • the ratio of the total number of data packets carrying the ECN identifier in the first group of data packets to the total number of data packets of the first group of data packets may be obtained first, and then the product of the ratio and a correction coefficient is used as The first congestion value.
  • the correction coefficient may be a coefficient set according to the operating conditions of the network.
  • the first congestion value is determined according to the data packet carrying the ECN identifier in the first group of data packets, which can reflect the current congestion situation in real time, and then can make more accurate statistics on the number of active flows according to the current congestion situation.
  • the method before determining the first congestion value, further includes: determining that a data stream in which the first group of data packets is located is a first data stream, The first data stream is a data stream in which the number of data packets received by the second network device is greater than a preset number.
  • the data flow can be divided into a large data flow and a small data flow.
  • the data stream may be considered to be a large data stream, and when the second network device receives a large number of data packets of a data stream, This data stream can be considered a small data stream.
  • the criteria for dividing the size of the data stream can be different. For example, for some traditional web services, a data stream with a data volume greater than 100KB can be regarded as an elephant stream (that is, a large data stream), and a data stream with a data volume less than 100KB can be regarded as a mouse stream (that is, a small data stream) ).
  • the above-mentioned first data stream can be considered as a large data stream.
  • the statistics of the number of active streams is performed only on the first data stream (the large data stream is suitable to use the solution of this application for the number of active streams) to make the statistics of this application
  • the scheme of the number of active streams is more targeted.
  • the program performs statistics on the number of active flows.
  • the method further includes : The first network device receives a first packet of a second group of data packets sent by the second network device, and adds 1 to the number of third active flows to obtain a number of fourth active flows, where the second group The data packet and the first group of data packets belong to the same data flow.
  • the number of the third active flows is equal to the number of the second active flows.
  • the number of third active flows is equal to the number of first active flows; the first network device receives the second group of data packets sent by the second network device And determine the second congestion value of the network according to the number of data packets carrying the ECN identifier in the second group of data packets and the first congestion value; when the second congestion value is less than the When a congestion threshold occurs, the first network The device subtracts 1 from the fourth active flow number to obtain a fifth active flow number; when the second congestion value is greater than or equal to the congestion threshold, the first network device maintains the fourth active flow number constant.
  • processing may be performed in a similar manner as the first packet of the first group of data packets is received, and after the tail packet of the second group of packets is received, the second group is synthesized by
  • the data packet carrying the ECN identifier in the data packet and the above-mentioned first congestion value to comprehensively determine the second congestion value can prevent the second congestion value from changing too much, thereby obtaining a slowly changing congestion value, and making the number of active flows obtained by statistics No mutations occur.
  • the first network device may further determine the number and The number of data packets carrying the ECN identifier in the two groups of data packets is used to comprehensively determine the second congestion value.
  • the ratio of the total number of data packets carrying the ECN identifier in the first group of data packets and the second group of data packets to the total number of data packets included in the first group of data packets and the second group of data packets is determined as the first Second congestion value.
  • the method for counting the number of active flows in the embodiments of the present application may be performed by a network device on the receiving end or by a switch device located between the sending end and the receiving end.
  • the switch device When executed on the switch device, the switch The device can feed back the counted number of active flows to the receiver, and then the receiver to the sender.
  • a network device in a second aspect, includes a module for executing a method in various implementation manners of the first aspect.
  • a network device includes a memory and a processor, and may further include a transceiver.
  • the memory is used to store the program
  • the processor is used to execute the program stored in the memory.
  • the transceiver and the processor are used to execute the methods in the various implementation manners of the first aspect.
  • a system for counting the number of active flows includes a first network device and a second network device.
  • the second network device is configured to send a first group of data packets to the first network device;
  • the first network device is configured to receive a first packet of the first group of data packets, and add 1 to the current active stream number to obtain a first An active flow number;
  • the first network device is configured to receive a tail packet of the first group of data packets, and determine the first congestion according to the number of data packets carrying an external congestion notification ECN identifier in the first group of data packets
  • the first network device is configured to reduce the first active flow number by one to obtain a second active flow number; when the first congestion value is greater than or When equal to the congestion threshold, the first network device is configured to keep the number of the first active flows unchanged.
  • a computer-readable storage medium stores instructions that, when run on a computer, cause the computer to execute the methods in various implementations of the first aspect.
  • a computer program product containing instructions, which when executed on a computer, causes the computer to execute the methods in various implementations of the first aspect.
  • FIG. 1 is a schematic diagram of a possible application scenario according to an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a method for counting the number of active flows according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a method for counting the number of active flows according to an embodiment of the present application
  • FIG. 4 is a schematic block diagram of a network device according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a hardware structure of a network device 400 according to an embodiment of the present application.
  • FIG. 1 is a schematic diagram of a possible application scenario according to an embodiment of the present application.
  • the sending end 1, the sending end 2, and the sending end 3 can send data streams to the receiving end 1 and the receiving end 2 through the switch 1 and the switch 2.
  • Both receiver 1 and receiver 2 can receive the data streams sent by sender 1 to sender 3 through switch 1 and switch 2 (switch 1 and switch 2 forward the data streams sent by sender 1 to sender 3 to the receiver 1 and the receiving end 2).
  • the receiving end 1 can collect statistics on the received data streams. For example, the receiving end 1 can count the number of active data streams received (can be referred to as the number of active streams), and The number of active streams is fed back to sender 1, sender 2, and sender 3 through switch 1 or switch 2, so that sender 1, sender 2, and sender 3 can send data streams based on the number of active streams feedbacked by receiver 1. Adjust the speed.
  • FIG. 1 is only a schematic diagram of a possible application scenario of the embodiment of the present application, and the embodiment of the present application may also be applied to other scenarios similar to FIG. 1.
  • the receiver when counting the number of active flows, the receiver usually determines whether there are active flows based on the data packets received by the receiver within a fixed period of time (fixed time window). The data packet of the first data stream, then the receiving end determines the first data stream as an active data stream, and increases the number of active streams by 1, and if the receiving end does not receive the data of the first data stream within a fixed period of time Packet, then the first data stream is determined to be an inactive data stream, and the receiving end at this time reduces the number of active streams by one.
  • the network is congested, if the number of active flows is counted according to the data packet received within a fixed period of time, the statistics may be inaccurate. This is because when the network is congested, the transmission of the data packet is likely to lag, which may cause the receiving end to fail to receive the data packet for a fixed period of time, which makes the number of active flows calculated by the receiving end inaccurate.
  • the number of active flows needs to be counted in conjunction with the degree of network congestion.
  • the receiving end may not be able to receive packets of the corresponding data flow within the previously fixed time. At this time, it is necessary to maintain the active flow. The number does not change, and the number of active streams cannot be reduced by one.
  • the degree of network congestion is light, it can be considered that the network congestion has little effect on the transmission of the data packet. If the receiving end cannot receive the data packet of the corresponding data stream within the original fixed time, then the receiving end needs to change the current The number of active streams is reduced by one.
  • FIG. 2 is a schematic flowchart of a method for counting the number of active flows according to an embodiment of the present application.
  • the first network device in FIG. 2 is equivalent to the receiving end 1 or the receiving end 2 in FIG. 1 for receiving a data stream
  • the second network device in FIG. 2 is equivalent to the sending end (the sending end 1 or the sending end in FIG. 1). End 2 or Send 3), used to send data stream.
  • the method shown in FIG. 2 may include at least steps 101 to 104. Further, the method shown in FIG. 2 may further include steps 105 to 108. These steps are described in detail below.
  • a first network device receives a first packet of a first group of data packets.
  • each group of data packets includes a certain number of data packets, and each group of data packets includes a first packet and a tail packet.
  • the first network device can identify whether the data packet carries the first packet identifier and the tail packet. Identification to identify whether the data packet is the first packet or the tail packet.
  • the two definition methods are described below.
  • data packets may be grouped according to a message according to the definition of the RoCEv2 protocol.
  • the data packet can be grouped according to a message (the message is a logical grouping of the application layer), the first packet of the message is regarded as the first packet, and the last packet of the message is regarded as the tail packet.
  • the details of the packet and the tail packet may be defined in the opcode field of the base transport header (BTH) of the RoCEv2 message.
  • the data packets can be grouped according to slices or segments. Specifically, the corresponding data packets within a period of feedback based on the initial rate or the number of active flows can be divided into a group, and the first message in the slice or segment can be grouped. It is called the first packet, and the last message of the slice or segment is called the tail packet.
  • These two fields can be defined in the reserved field (for example, the rsvd7 field) of the BTH header, and the label of each field can occupy 1 bit.
  • the first network device adds 1 to the current active flow number to obtain the first active flow number.
  • the current number of active flows in step 102 refers to the number of active flows counted by the first network device before receiving the first packet of the first group of data packets.
  • the active flows need to be updated when the first packet of the first group of data packets is received.
  • the number of active streams that is, the number of active streams calculated before the first packet of the first group of data packets is received, plus one.
  • the first network device receives a tail packet of a first group of data packets.
  • the first packet of the first group of data packets may be the first packet in the first group of data packets received by the first network device, and the tail packet of the first group of data packets may be received by the first network device The last packet in the first group of packets.
  • the number of data packets of each group of data packets can be preset.
  • each data packet further includes a data packet identifier, where the data packet identifier is used to indicate a type of the data packet.
  • the value of the identifier may be used to indicate that the data packet is a first packet, a tail packet, or a data packet located between the first packet and the tail packet of a group of data packets.
  • the packet identifier may be carried in a packet header or a payload of the packet, or the packet identifier may also be carried in a field other than the packet to carry the packet identifier
  • the field of is transmitted together with the message, so that the first network device can identify the type of the data packet according to the field.
  • the packet identifier can be carried in the opcode field in the RoCEv2 message, or the data packet The identifier can also be carried in a reserved field (for example, the rsvd7 field) in the RoCEv2 packet.
  • the first network device determines the first congestion value according to the number of data packets carrying the external congestion notification ECN identifier in the first group of data packets, and updates the number of active flows according to the relationship of the first congestion value range congestion threshold.
  • the number of first active flows needs to be updated again according to the number of data packets carrying the ECN identifier in the first group of data packets. If the first congestion value is less than the congestion threshold, After the tail packet of a group of data packets, the number of active flows counted by the first network device is the number of the second active stream; if the first congestion value is less than the congestion threshold, then after receiving the tail packet of the first group of data packets, The number of active flows calculated by a network device is the number of first active flows.
  • the number of active flows obtained by statistics is the first active flow number (when the first congestion value is greater than or equal to the congestion threshold) or the second active flow number (the first When the congestion value is less than the congestion threshold).
  • the congestion situation can be determined according to the number of data packets carrying the ECN identifier in the group of data packets, and the number of active flows can be modified according to the congestion situation. Perform more accurate statistics on the number of active flows to obtain a more accurate number of active flows.
  • the traditional scheme does not take network congestion into account when counting the number of active streams.
  • the traditional scheme counts the number of active streams based on the ideal situation of the network without congestion.
  • Congestion affects the number of data packets received by the receiving end within a period of time, which leads to inaccurate statistics on the number of active flows.
  • statistics on the data packets carrying the ECN identifier in each group of data packets can be used to estimate the network congestion.
  • the number of active flows can be reduced by 1, and when the network congestion is severe It can keep the number of active flows unchanged, which can reduce the impact of network congestion on the number of active flows, and can achieve more accurate statistics.
  • determining the first congestion value according to the number of data packets carrying the ECN identifier in the first group of data packets includes: comparing the number of data packets carrying the ECN identifier with the first group of data packets to the first group of data packets. A ratio of the number of data packets of a group of data packets is determined as a first congestion value.
  • the ratio of the total number of data packets carrying the ECN identifier to the first group of data packets and the number of data packets of the first group of data packets may be determined as the first congestion value.
  • the first group of data packets includes a total of 10 data packets (including the first packet and the tail packet). Among them, there are 5 data packets carrying the ECN identifier. Then, the first congestion value can be calculated as 0.5.
  • the ratio of the total number of data packets carrying the ECN identifier in the first group of data packets to the total number of data packets of the first group of data packets may be obtained first, and then the product of the ratio and a correction coefficient is used as The first congestion value.
  • the correction coefficient may be a coefficient set according to the operating conditions of the network.
  • the first group of data packets contains a total of 10 data packets (including the first packet and the tail packet). Among them, there are 8 data packets carrying the ECN identifier. Then, the total number of data packets carrying the ECN identifier can be calculated. The ratio of the total number of data packets is 0.8. Assuming the correction coefficient is 0.8, then the product of the ratio and the correction coefficient is 0.64, which is the first congestion value.
  • the method shown in FIG. 2 further includes: determining that the data stream where the first group of data packets are located is the first data stream, where the first data stream is a data packet received by the second network device The number of data streams is greater than a preset number.
  • the above-mentioned first data stream can be considered as a large data stream.
  • the statistics of the number of active streams is performed only on the first data stream (the large data stream is suitable to use the solution of this application for the number of active streams) to make the statistics of this application
  • the scheme of the number of active streams is more targeted.
  • the program performs statistics on the number of active flows.
  • the above steps 101 to 104 only show the case of counting the number of active flows according to a group of data packets.
  • the method for counting the number of active flows in the embodiment of the present application can also count the number of active flows according to multiple groups of data packets. .
  • the first network device after the first network device implements receiving the first group of data packets and updating the number of active flows through steps 101 to 104, it may continue to receive the second group of data. Packet, and update the number of active streams again according to the reception of the second group of data packets.
  • the first network device receives a first packet of a second group of data packets.
  • the second group of data packets and the first group of data packets belong to the same data stream, and the second group of data packets may be a group of data packets received by the first network device after receiving the first group of data packets.
  • the second set of data packets and the first set of data packets may be two consecutive sets of data packets in the data stream (that is, the second set of data packets is that the first network device receives the first set of data packets immediately after receiving the first set of data packets. To the next set of packets).
  • the first network device adds 1 to the current active flow number to obtain a fourth active flow number.
  • the first network device receives a tail packet of the second group of data packets.
  • step 105 to step 107 are similar to the above steps 101 to 103, and are not repeated here.
  • the first network device determines the second congestion value according to the number of data packets carrying the external congestion notification ECN identifier in the second group of data packets, and updates the number of active flows according to the relationship of the congestion threshold in the second congestion value domain.
  • processing may be performed in a similar manner as the first packet of the first group of data packets is received, and after the tail packet of the second group of packets is received, the second group is synthesized by
  • the data packet carrying the ECN identifier in the data packet and the above-mentioned first congestion value to comprehensively determine the second congestion value can prevent the second congestion value from changing too much, thereby obtaining a slowly changing congestion value.
  • the first network device may further determine the number and The number of data packets carrying the ECN identifier in the two groups of data packets is used to comprehensively determine the second congestion value.
  • the ratio of the total number of data packets carrying the ECN identifier in the first group of data packets and the second group of data packets to the total number of data packets included in the first group of data packets and the second group of data packets is determined as the first Second congestion value.
  • the first group of data packets and the second group of data packets each include 10 data packets, of which the number of data packets carrying the ECN identifier in the first group of data packets is four, and the data packets carrying the ECN identifier in the second group of data packets Is 6, then the total number of data packets carrying the ECN identifier in the first group of data packets and the second group of data packets is 10, and the total number of packets of the first group of data packets and the second group of data packets is 20, then,
  • a congestion value can also be obtained according to the number of data packets carrying the ECN identifier in the first group of data packets, and then the number of data packets carrying the ECN identifier in the second group of data packets Another congestion value is obtained. Next, the two congestion values are weighted and summed to obtain a second congestion value.
  • determining the second congestion value of the network according to the number of data packets carrying the ECN identifier and the first congestion value in the second group of data packets includes: according to the ECN carried in the second group of data packets The number of identified data packets determines the third congestion value of the network; the second congestion value is determined according to formula (1).
  • con3 is a third congestion value
  • con1 is a first congestion value
  • con2 is a second congestion value
  • x1 is a preset first weight value
  • x2 is a preset second weight value
  • the first network device each time the first network device receives the first packet of a group of data packets (for example, the first group of data packets and the second group of data packets before), the number of current active streams is increased by one. ;
  • the first network device receives the tail packet of a group of data packets, it needs to adjust the number of active flows according to the number of data packets carrying the ECN identifier in the group of data (reducing the number of active flows by 1 or keeping the same), In order to achieve the real-time update of the number of active streams.
  • the method for counting the number of active data streams in the embodiment of the present application is described from the perspective of a first network device.
  • FIG. 3 is a schematic flowchart of a method for counting the number of active flows according to an embodiment of the present application.
  • the method shown in FIG. 3 may include at least steps 201 to 204. Further, the method shown in FIG. 3 may further include steps 205 to 208. These steps are described in detail below.
  • Step 201 indicates that counting of active flows is started.
  • the first network device receives the first packet of the first group of data packets sent by the second network device, and executes counter ++.
  • counter is the current active flow number obtained by the first network device. Specifically, the counter is the number of currently active data streams obtained by the first network device when the first network device receives the first packet of the first group of data packets sent by the second network device.
  • the counter obtained after counter ++ in step 202 is the number of active streams after receiving the first packet of the first group of data and updating the current number of active streams.
  • the counter after counter ++ is equivalent to the first active obtained in step 102 Number of streams.
  • the first network device receives the tail packet of the first group of data packets, and determines the first congestion value according to the number of data packets carrying the external congestion notification ECN identifier in the first group of data packets.
  • the first congestion value When the first congestion value is less than or equal to the congestion threshold, it indicates that the network is less congested. At this time, the number of current active flows needs to be reduced by 1, that is, step 205 is performed. When the first congestion value is greater than or equal to the congestion threshold, it indicates that Network congestion is severe. At this time, it is necessary to keep the current number of active flows unchanged, that is, step 206 is performed.
  • step 205 a counter is executed—the counter obtained is equivalent to the number of the second active stream mentioned above.
  • step 206 the counter is equal to the number of the first active flows mentioned above.
  • the first network device receives the first packet of the second group of data packets sent by the second network device, and executes counter ++.
  • the counter obtained after executing counter ++ in step 207 is equivalent to the fourth active stream number described above.
  • the first network device receives the tail packet of the second group of data packets, and determines the second packet according to the number of data packets carrying the ECN identifier in the first group of data packets and the number of data packets carrying the ECN identifier in the second group of data packets. Congestion value.
  • the second congestion value When the second congestion value is less than or equal to the congestion threshold, it indicates that the network is less congested. At this time, the number of current active flows needs to be reduced by 1, that is, step 210 is performed. When the second congestion value is greater than or equal to the congestion threshold, it indicates that Network congestion is severe. At this time, it is necessary to keep the current number of active flows unchanged, that is, step 211 is performed.
  • step 210 a counter is executed—the counter obtained is equivalent to the fifth active stream number above.
  • step 206 the counter is equivalent to the fourth active flow number described above.
  • the counters represent the current number of active flows. After different operation steps, the counters need to be added or subtracted, or the counters must be kept unchanged. Real-time statistics of the current number of active streams.
  • the method for counting the number of active flows in the embodiment of the present application is described in detail above with reference to FIGS. 1 to 3.
  • the network device according to the embodiment of the present application is described in detail below with reference to FIGS. 4 to 5. It should be understood that the network device shown in FIGS. 4 to 5 can execute the method for counting the number of active flows in the embodiment of the present application. In introducing the network devices shown in FIG. 4 and FIG. 5, repeated description is appropriately omitted.
  • FIG. 4 is a schematic block diagram of a network device according to an embodiment of the present application.
  • the network device 300 in FIG. 4 includes:
  • a receiving module 301 configured to receive a first packet of a first group of data packets sent by another network device
  • a processing module 302 configured to add 1 to the current number of active flows to obtain a first number of active flows
  • the receiving module 301 is further configured to receive a tail packet of the first group of data packets sent by the other network equipment;
  • the processing module 302 is further configured to determine a first congestion value according to the number of data packets carrying an external congestion notification ECN identifier in the first group of data packets;
  • the processing module 302 is further configured to reduce the number of the first active flow by 1 when the first congestion value is less than a congestion threshold to obtain a second number of active flows;
  • the processing module 302 is further configured to keep the number of the first active flows unchanged when the first congestion value is greater than or equal to the congestion threshold.
  • the congestion situation can be determined according to the number of data packets carrying the ECN identifier in the group of data packets, and the number of active flows can be modified according to the congestion situation. Perform more accurate statistics on the number of active flows to obtain a more accurate number of active flows.
  • the processing module 302 is configured to determine a ratio between the number of data packets carrying the ECN identifier and the number of data packets of the first group of data packets as the first group of data packets. The first congestion value is described.
  • the processing module 302 is further configured to determine that a data stream in which the first group of data packets is located is a first data stream, where the The first data stream is a data stream in which the number of data packets received by the second other network device is greater than a preset number.
  • the receiving module 301 after the receiving module 301 receives a tail packet of the first group of data packets sent by the other network device, the receiving module 301 is further configured to receive the other network device The first packet of the second group of data packets sent; the processing module 302 is further configured to increase the number of third active streams by one to obtain the number of fourth active streams, where the second group of data packets and the first Group data packets belong to the same data flow.
  • the number of third active flows is equal to the number of second active flows.
  • the number of the third active flows is equal to the number of the first active flows; the receiving module 301 is further configured to receive a tail packet of the second group of data packets sent by the other network device; the The processing module 302 is further configured to determine the second congestion value of the network according to the number of data packets carrying the ECN identifier in the second group of data packets and the first congestion value; the processing module 302 is further configured to be The second congestion value is less than When the congestion threshold value is reduced, the fourth active flow number is reduced by 1 to obtain a fifth active flow number; the processing module 302 is further configured to maintain the second congestion value when the second congestion value is greater than or equal to the congestion threshold. The number of the fourth active streams does not change.
  • FIG. 5 is a schematic diagram of a hardware structure of a network device 400 according to an embodiment of the present application.
  • the network device 400 shown in FIG. 5 may perform each step in the method for counting the number of active flows in the embodiment of the present application.
  • the network device 400 includes a processor 401, a memory 402, an interface 403, and a bus 404.
  • the interface 403 may be implemented in a wireless or wired manner, and specifically may be a network card.
  • the processor 401, the memory 402, and the interface 403 are connected through a bus 404.
  • the interface 403 may specifically include a transmitter and a receiver, where the receiver is configured to receive a data stream sent by the second network device, and the transmitter may be configured to send information about the number of active streams to the second network device. Specifically, the interface 403 may be used to perform steps 101 and 103 and steps 105 and 107.
  • the processor 401 is configured to update the number of active flows. Specifically, the processor 401 may be configured to perform steps 102, 104, 106, and 108.
  • the memory 402 includes an operating system 4021 and an application program 4022, which are used to store programs, codes, or instructions. When a processor or a hardware device executes these programs, codes, or instructions, the process of transmitting a packet in the embodiment of the present application can be completed.
  • the memory 402 may include a read-only memory (ROM) and a random access memory (RAM).
  • the ROM includes a basic input / output system (BIOS) or an embedded system; and the RAM includes an application program and an operating system.
  • BIOS basic input / output system
  • the BIOS or the embedded system boot system which is solidified in the ROM, is used to start, and the network device 400 is guided to enter a normal operating state.
  • the application programs and operating system running in the RAM complete the processing process involving the network device in the method embodiment.
  • FIG. 5 only shows a simplified design of the network device.
  • the network device 400 may include any number of interfaces, processors, or memories.
  • the embodiment of the present application further provides a system for counting the number of active flows.
  • the system includes a first network device and a second device.
  • the first network device and the second network device in the system can perform the statistical activity of the embodiment of the application.
  • Each step of the method of the number of streams on the first network and the second network device, and the first network device may further have the functions of the network device of FIG. 4 or FIG. 5.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objective of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of this application is essentially a part that contributes to the existing technology or a part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
  • the aforementioned storage media include: U disks, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks or compact discs and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请提供了一种统计活跃流数目的方法、网络设备和***。该方法包括:第一网络设备接收第二网络设备发送的第一组数据包的首包,并将当前活跃流数目加1,以得到第一活跃流数目;所述第一网络设备接收所述第二网络设备发送的所述第一组数据包的尾包,并根据所述第一组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第一拥塞值;当所述第一拥塞值小于拥塞阈值时,所述第一网络设备将所述第一活跃流数目减1,以得到第二活跃流数目;当所述第一拥塞值大于或者等于所述拥塞阈值时,所述第一网络设备保持所述第一活跃流数目不变。本申请能够更准确地统计活跃流数目。

Description

统计活跃流数目的方法、网络设备和***
本申请要求于2018年9月25日提交中国知识产权局、申请号为201811119974.6、申请名称为“统计活跃流数目的方法、网络设备和***”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及网络技术领域,并且更具体地,涉及一种统计活跃流数目的方法、网络设备和***。
背景技术
在很多场景下,为了了解网络设备接收数据流的情况,常常需要对网络设备接收到的活跃数据流的数目进行统计。例如,在拥塞控制和带宽分配领域,需要对网络中的活跃流数目进行统计,进而根据活跃流数目进行拥塞控制或者带宽分配。
传统方案一般是根据一段固定的时间窗口内是否接收到数据包来确定某个数据流是否为活跃流,进而对活跃流的数目进行统计。例如,如果网络设备在第一时间窗口内接收到第一数据流的数据包,则确定第一数据流就是活跃流,并执行将活跃流数目加1,即counter++,其中,counter为网络设备当前接收到的活跃流的数目;如果网络设备在第一时间窗口内未接收到第一数据流的数据包,则确定第一数据流为非活跃流,并执行counter--。
但是在不同的场景下,例如,在不同的组网方式,不同的流量模型以及可能出现拥塞的网格架构中,如果仍采用传统方案中基于固定时间窗口的方式来统计活跃流的数目,很有可能导致活跃流的数目统计不准,使得统计得到的活跃流的数目无法反映网络传输数据流的真实情况。因此,如何更好地进行活跃流数目的统计是一个需要解决的问题。
发明内容
本申请提供一种统计活跃流数目的方法、网络设备和***,以更准确地统计活跃流数目。
第一方面,提供了一种统计活跃流数目的方法,该方法包括:第一网络设备接收第二网络设备发送的第一组数据包的首包,并将当前活跃流数目加1,以得到第一活跃流数目;所述第一网络设备接收所述第二网络设备发送的所述第一组数据包的尾包,并根据所述第一组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第一拥塞值;当所述第一拥塞值小于拥塞阈值时,所述第一网络设备将所述第一活跃流数目减1,以得到第二活跃流数目;当所述第一拥塞值大于或者等于所述拥塞阈值时,所述第一网络设备保持所述第一活跃流数目不变。
可选地,所述方法应用于数据中心网络或者城域网,所述第二网络设备用于向所述第一网络设备发送数据包。
可选地,上述第一拥塞值用于指示第一网络设备接收到第二网络设备发送的数据包的第一网络的拥塞程度。
应理解,上述第一拥塞值越大,第一网络的拥塞程度越严重。
上述拥塞阈值可以是预先设置好的一个阈值,该拥塞阈值具体可以是根据网络状态估计的一个阈值。对于宽带利用率较低的场景,可以设置一下较小的拥塞阈值,而对于宽带利用率较高的场景,可以设置一个较大的拥塞阈值。
例如,在宽带利用率较低的场景下,拥塞阈值具体可以是0.3、0.4或者0.5等等,而在宽带利用率较高的场景下,拥塞阈值具体可以是0.6、0.7或者0.8等等。
应理解,在接收到第一组数据包的首包时需要将当前活跃流数目加1,以得到第一活跃流数目。这里的当前活跃流数目是指第一网络设备在接收到第一组数据包的首包之前统计得到的活跃流的数目,在接收到第一组数据包的首包时需要更新活跃流的数目,也就是将接收到第一组数据包的首包之前统计得到的活跃流的数目加1。
而在接收到第一组数据包的尾包之后,需要根据第一组数据包中携带ECN标识的数据包的数量对第一活跃流数目进行再次更新,如果第一拥塞值小于拥塞阈值,那么,在接收到第一组数据包的尾包后第一网络设备统计得到的活跃流的数目为第二活跃流数目;如果第一拥塞值小于拥塞阈值,那么,在接收到第一组数据包的尾包后第一网络设备统计得到的活跃流的数目为第一活跃流数目。也就是说,在接收到第一组数据包的尾包后,统计得到的活跃流数目为第一活跃流数目(第一拥塞值大于或者等于拥塞阈值时)或者第二活跃流数目(第一拥塞值小于拥塞阈值时)。
上述ECN标识可以是第一网络设备和第二网络设备之间的其它网络设备(具体可以是交换设备)在接收到数据包时添加的一个拥塞标识。
上述第一组数据包的首包可以是第一网络设备接收到的第一组数据包中的第一个数据包,第一组数据包的尾包可以是第一网络设备接收到的第一组数据包中的最后一个数据包。每组数据包的数据包数量可以是预先设置好的。
可选地,每个数据包还包括数据包标识,该数据包标识用于指示数据包的类型。具体地,该标识的取值可以用于指示该数据包是一组数据包的首包、尾包或者位于首包和尾包之间的数据包。
具体地,上述数据包标识可以携带在报文的报文头或者报文的有效载荷(payload)中,或者,上述数据包标识还可以携带在报文之外的字段中,携带该数据包标识的字段与报文一起传输,使得第一网络设备能够根据该字段识别数据包的类型。
例如,在基于融合以太的远程内存直接访问协议版本2(remote direct memory access over converged ethernet version 2,RoCEv2)的场景下,数据包标识可以携带在RoCEv2报文中的opcode字段中,或者,数据包标识还可以携带的RoCEv2报文中的保留字段(例如,rsvd7字段)中。
还应理解,上述第一组数据包中的数据包均属于同一个数据流。本申请的统计活跃数据流的方法可以对第一网络设备接收到的任意一个数据流进行统计,进而得到第一网络设备接收到的活跃流的数目。
本申请中,在接收到一组数据包的尾包时,可以根据该组数据包中携带ECN标识的数据包的个数来确定拥塞情况,进而可以根据拥塞情况对活跃流数目进行修正,能 够对活跃流数目进行更精准的统计,进而得到更准确的活跃流数目。
具体地,传统方案在统计活跃流数目时并未考虑到网络拥塞情况,事实上,传统方案在进行活跃流数目统计是基于网络不出现拥塞的理想情况对活跃流进行统计的,当网络出现拥塞时会影响接收端在一段时间内接收到的数据包的数目,进而导致活跃流的数目统计不准。本申请中通过对每组数据包中携带ECN标识的数据包进行统计,能够实现对网络拥塞的估计,当网络拥塞程度较轻时,可以将活跃流数目减1,而当网络拥塞程度比较严重时可以保持活跃流数目不变,能够减少由于网络拥塞对活跃流数目统计的影响,能够实现更准确的统计。
结合第一方面,在第一方面的某些实现方式中,所述根据所述第一组数据包中携带ECN标识的数据包的数量确定第一拥塞值,包括:将所述第一组数据包携带有ECN标识的数据包的数量与所述第一组数据包的数据包数量的比值确定为所述第一拥塞值。
可选地,将所述第一组数据包携带有ECN标识的数据包的数量与所述第一组数据包的数据包数量的比值确定为所述第一拥塞值,包括:将所述第一组数据包携带有ECN标识的数据包的总数量与所述第一组数据包的数据包总数量的比值确定为所述第一拥塞值。
应理解,上述第一组数据包中的首包、尾包以及首包和尾包之间的数据包均可能携带ECN标识。当第一组数据包中的每个数据包均携带ECN标识时,说明网络拥塞比较严重,当第一组数据包中的携带ECN标识的数据包较小时,说明网络拥塞程度较低(或者说网络比较畅通)。
另外,也可以先得到第一组数据包中携带有ECN标识的数据包的总数量与所述第一组数据包的数据包总数量的比值,然后再将该比值与一个修正系数的乘积作为第一拥塞值。该修正系数可以是根据网络的运行情况设置的一个系数。
本申请中,根据第一组数据包中携带ECN标识的数据包来确定第一拥塞值,能够实时的反映当前的拥塞情况,进而可以根据当前拥塞情况对活跃流数目作出较为准确的统计。
结合第一方面,在第一方面的某些实现方式中,在确定所述第一拥塞值之前,所述方法还包括:确定所述第一组数据包所在的数据流为第一数据流,其中,所述第一数据流为所述第二网络设备在接收的数据包的数量大于预设数量的数据流。
按照数据包的数据量的大小,可以将数据流划分成大数据流和小数据流。当第二网络设备接收到某个数据流的数据包的数量较多时,可以认为该数据流是大数据流,而当第二网络设备接收到的某个数据流的数据包的数量较多时,可以认为该数据流是小数据流。
在不同的应用场景下,划分大小数据流的标准可以有所不同。例如,针对某些传统的web业务,数据量大于100KB的数据流可以视为大象流(也就是大数据流),而数据量小于100KB的数据流可以视为老鼠流(也就是小数据流)。
上述第一数据流可以认为是大数据流,本申请中,通过仅对第一数据流进行活跃流数目的统计(大数据流适合采用本申请方案进行活跃流数目统计),使得本申请的统计活跃流数目的方案更有针对性。
具体地,由于小数据流中的数据包的数量较少,当网络发生拥塞时,小数据流受 到的影响较小,而大数据流中的数据包的数量较多,当网络发生拥塞时,受到的影响较大。因此,对于小数据流,不统计活跃流(也就是说,对于小数据流来说即便是能够接收到数据包,也不将其视为活跃流),而对于大数据流,可以采用本申请的方案进行活跃流数目的统计。
结合第一方面,在第一方面的某些实现方式中,在所述第一网络设备接收到所述第二网络设备发送的所述第一组数据包的尾包之后,所述方法还包括:所述第一网络设备接收所述第二网络设备发送的第二组数据包的首包,并将第三活跃流数目加1,以得到第四活跃流数目,其中,所述第二组数据包与所述第一组数据包属于同一个数据流,当所述第一拥塞值小于所述拥塞阈值时,所述第三活跃流数目等于所述第二活跃流数目,当所述第一拥塞值大于或者等于所述拥塞阈值时,所述第三活跃流数目等于所述第一活跃流数目;所述第一网络设备接收所述第二网络设备发送的所述第二组数据包的尾包,并根据所述第二组数据包中携带ECN标识的数据包的数量和所述第一拥塞值,确定所述网络的第二拥塞值;当所述第二拥塞值小于所述拥塞阈值时,所述第一网络设备将所述第四活跃流数目减1,以得到第五活跃流数目;当所述第二拥塞值大于或者等于所述拥塞阈值时,所述第一网络设备保持所述第四活跃流数目不变。
当接收到第二组数据包的首包之后,可以按照接收到第一组数据包的首包的类似的方式进行处理,而在接收到第二数据包的尾包之后,通过综合第二组数据包中携带ECN标识的数据包以及上述第一拥塞值来综合确定第二拥塞值,能够使得第二拥塞值不至于变化过大,从而得到缓慢变化的拥塞值,使得统计得到的活跃流数目不会产生突变。
可选地,当第一网络设备接收到所述第二网络设备发送的所述第二组数据包的尾包之后,还可以根据第一组数据包中携带ECN标识的数据包的数量和第二组数据包中携带ECN标识的数据包的数量来综合确定第二拥塞值。
可选地,将第一组数据包和第二组数据包中携带ECN标识的数据包的总数量与第一组数据包和第二组数据包包含的数据包的总数量的比值确定为第二拥塞值。
结合第一方面,在第一方面的某些实现方式中,所述根据所述第二组数据包中携带ECN标识的数据包的数量和所述第一拥塞值,确定所述网络的第二拥塞值,包括:根据所述第二组数据包中携带的ECN标识的数据包的数量确定所述网络的第三拥塞值;根据公式con2=x1*con3+x2*con1确定所述第二拥塞值;其中,con3为所述第三拥塞值,con1为所述第一拥塞值,con2为所述第二拥塞值,x1为预设的第一权重值,x2为预设的第二权重值。
应理解,本申请实施例中的活跃流数目的统计方法既可以由接收端的网络设备执行,也可以由位于发送端和接收端之间的交换机设备上执行,当在交换机设备上执行时,交换机设备可以将统计得到的活跃流数目反馈给接收端,然后再由接收端给发送端。
第二方面,提供了一种网络设备,所述网络设备包含用于执行第一方面的各种实现方式中的方法的模块。
第三方面,提供了一种网络设备,所述网络设备包括存储器和处理器,还可以包括收发器。其中,存储器用于存储程序,处理器用于执行存储器存储的程序,当存储 器存储的程序被处理器执行时,收发器和处理器用于执行第一方面的各种实现方式中的方法。
第四方面,提供了一种统计活跃流数目的***,该***包括第一网络设备和第二网络设备。第二网络设备用于向第一网络设备发送第一组数据包;所述第一网络设备用于接收所述第一组数据包的首包,并将当前活跃流数目加1,以得到第一活跃流数目;所述第一网络设备用于接收所述第一组数据包的尾包,并根据所述第一组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第一拥塞值;当所述第一拥塞值小于拥塞阈值时,所述第一网络设备用于将所述第一活跃流数目减1,以得到第二活跃流数目;当所述第一拥塞值大于或者等于所述拥塞阈值时,所述第一网络设备用于保持所述第一活跃流数目不变。
第五方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行第一方面的各种实现方式中的方法。
第六方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行第一方面的各种实现方式中的方法。
附图说明
图1是本申请实施例的一种可能的应用场景的示意图;
图2是本申请实施例的统计活跃流数目的方法的示意性流程图;
图3是本申请实施例的统计活跃流数目的方法的示意性流程图;
图4是本申请实施例的网络设备的示意性框图;
图5为本申请实施例的网络设备400的硬件结构示意图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
图1是本申请实施例的一种可能的应用场景的示意图。
如图1所示,发送端1、发送端2和发送端3可以通过交换机1和交换机2向接收端1和接收端2发送数据流。接收端1和接收端2均可以通过交换机1和交换机2接收到发送端1至发送端3发送的数据流(交换机1和交换机2将发送端1至发送端3发送的数据流转发给接收端1和接收端2)。
以接收端1为例,接收端1可以对接收到的数据流的情况进行统计,例如,接收端1可以对接收到的活跃数据流的数目(可以简称为活跃流数目)进行统计,并将活跃流数目通过交换机1或者交换机2反馈给发送端1、发送端2和发送端3,使得发送端1、发送端2和发送端3可以根据接收端1反馈的活跃流数目对发送的数据流的速度进行调整。应理解,图1只是本申请实施例一种可能的应用场景的示意图,本申请实施例还可以应用到其他与图1类似的场景中。
传统方案在统计活跃流数目时,往往是根据接收端在一段固定的时间内(固定时间窗)接收到的数据包的情况来确定是否存在活跃流,如果接收端在一段固定的时间内接收到了第一数据流的数据包,那么接收端就将第一数据流确定为活跃数据流,并将活跃流数目加1,而如果接收端在一段固定的时间内没有接收到第一数据流的数据 包,那么就确定第一数据流为非活跃数据流,此时接收端将活跃流数目减1。但是当网络出现拥塞时,如果再根据一段固定的时间内接收到的数据包的情况来统计活跃流数目就可能出现统计不准确的情况。这是由于网络拥塞时很可能导致数据包的传输滞后,进而可能导致接收端在一段固定的时间内仍然无法接收到数据包,使得接收端统计得到的活跃流数目不够准确。
因此,需要结合网络的拥塞程度来统计活跃流的数目,当网络拥塞比较严重时,可能会导致接收端无法在原先固定的时间内接收到相应数据流的数据包,此时就需要保持活跃流数目不变,而不能将活跃流数目减1。而当网络拥塞程度较轻时,此时可以认为网络拥塞对数据包的传输影响不大,如果接受端无法在原先固定的时间内接收到相应数据流的数据包,那么,接收端需要将当前活跃流数目减1。
下面结合图2至图4对本申请实施例的统计活跃流数目的方法进行详细的介绍。
图2是本申请实施例的统计活跃流数目的方法的示意性流程图。图2中的第一网络设备相当于图1中的接收端1或者接收端2,用于接收数据流,图2中的第二网络设备相当于图1中的发送端(发送端1或者发送端2或者发送端3),用于发送数据流。图2所示的方法至少可以包括步骤101至步骤104,进一步地,图2所示的方法还可以包括步骤105至步骤108,下面对这些步骤进行详细的介绍。
101、第一网络设备接收第一组数据包的首包。
本申请中,每组数据包包含一定数量的数据包,每组数据包包含首包和尾包,第一网络设备在接收到数据包之后可以通过识别该数据包是否携带首包标识和尾包标识来识别该数据包是否为首包或者尾包。
其中,首包标识和尾包标识的定义方式有两种,下面对这两种定义方式进行介绍。
第一种方式:
当本申请应用在RoCEv2场景下时,可以根据RoCEv2协议定义,将数据包按照消息(message)来分组。具体地,可以将数据包按照消息(Message)来分组(该消息是应用层的逻辑分组),将消息的第一个报文视为首包,将消息的最后一个报文视为尾包,首包和尾包的具体可以定义在RoCEv2报文的基础传输头(base transport header,BTH)的opcode字段中。
第二种方式:
可以根据片或段(segment)对数据包进行分组,具体地,可以将根据初始速率或者活跃流数目反馈的一个周期内对应的数据包分成一组,将片或段中的第一个报文称为首包,将片或段的最后一个报文称为尾包,这两个字段可以定义在BTH头的保留字段(例如,rsvd7字段)中,每个字段的标记可以占用1bit。
102、第一网络设备将当前活跃流数目加1,得到第一活跃流数目。
步骤102中的当前活跃流数目是指第一网络设备在接收到第一组数据包的首包之前统计得到的活跃流的数目,在接收到第一组数据包的首包时需要更新活跃流的数目,也就是将接收到第一组数据包的首包之前统计得到的活跃流的数目加1。
103、第一网络设备接收第一组数据包的尾包。
应理解,上述第一组数据包的首包可以是第一网络设备接收到的第一组数据包中的第一个数据包,第一组数据包的尾包可以是第一网络设备接收到的第一组数据包中 的最后一个数据包。每组数据包的数据包数量可以是预先设置好的。
可选地,每个数据包还包括数据包标识,该数据包标识用于指示数据包的类型。具体地,该标识的取值可以用于指示该数据包是一组数据包的首包、尾包或者位于首包和尾包之间的数据包。
具体地,上述数据包标识可以携带在报文的报文头或者报文的有效载荷(payload)中,或者,上述数据包标识还可以携带在报文之外的字段中,携带该数据包标识的字段与报文一起传输,使得第一网络设备能够根据该字段识别数据包的类型。
例如,在基于融合以太的远程内存直接访问协议版本2(remote direct memory access over converged ethernet version 2,RoCEv2)的场景下,数据包标识可以携带在RoCEv2报文中的opcode字段中,或者,数据包标识还可以携带的RoCEv2报文中的保留字段(例如,rsvd7字段)中。
应理解,上述第一组数据包中的数据包均属于同一个数据流。
104、第一网络设备根据第一组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第一拥塞值,并根据第一拥塞值域拥塞阈值的关系对活跃流数目进行更新。
可选地,在步骤104中,需要根据第一组数据包中携带ECN标识的数据包的数量对第一活跃流数目进行再次更新,如果第一拥塞值小于拥塞阈值,那么,在接收到第一组数据包的尾包后第一网络设备统计得到的活跃流的数目为第二活跃流数目;如果第一拥塞值小于拥塞阈值,那么,在接收到第一组数据包的尾包后第一网络设备统计得到的活跃流的数目为第一活跃流数目。也就是说,在接收到第一组数据包的尾包后,统计得到的活跃流数目为第一活跃流数目(第一拥塞值大于或者等于拥塞阈值时)或者第二活跃流数目(第一拥塞值小于拥塞阈值时)。
本申请中,在接收到一组数据包的尾包时,可以根据该组数据包中携带ECN标识的数据包的个数来确定拥塞情况,进而可以根据拥塞情况对活跃流数目进行修正,能够对活跃流数目进行更精准的统计,进而得到更准确的活跃流数目。
具体而言,传统方案在统计活跃流数目时并未考虑到网络拥塞情况,事实上,传统方案在进行活跃流数目统计是基于网络不出现拥塞的理想情况对活跃流进行统计的,当网络出现拥塞时会影响接收端在一段时间内接收到的数据包的数目,进而导致活跃流的数目统计不准。本申请中通过对每组数据包中携带ECN标识的数据包进行统计,能够实现对网络拥塞的估计,当网络拥塞程度较轻时,可以将活跃流数目减1,而当网络拥塞程度比较严重时可以保持活跃流数目不变,能够减少由于网络拥塞对活跃流数目统计的影响,能够实现更准确的统计。
可选地,作为一个是实施例,根据第一组数据包中携带ECN标识的数据包的数量确定第一拥塞值,包括:将第一组数据包携带有ECN标识的数据包的数量与第一组数据包的数据包数量的比值确定为第一拥塞值。
具体地,可以将第一组数据包携带有ECN标识的数据包的总数量与所述第一组数据包的数据包数量的比值确定为第一拥塞值。
例如,第一组数据包共包含10个数据包(包括首包和尾包),其中,携带ECN标识的数据包共有5个,那么,可以计算出第一拥塞值为0.5。
另外,还可以先得到第一组数据包中携带有ECN标识的数据包的总数量与所述第 一组数据包的数据包总数量的比值,然后再将该比值与一个修正系数的乘积作为第一拥塞值。该修正系数可以是根据网络的运行情况设置的一个系数。
例如,第一组数据包共包含10个数据包(包括首包和尾包),其中,携带ECN标识的数据包共有8个,那么,可以计算出携带有ECN标识的数据包的总数量与数据包的总数量的比值为0.8,假设修正系数为0.8,那么,该比值与修正系数的乘积0.64就是第一拥塞值。
可选地,在上述步骤102之前,图2所示的方法还包括:确定第一组数据包所在的数据流为第一数据流,其中,第一数据流为第二网络设备接收的数据包的数量大于预设数量的数据流。
上述第一数据流可以认为是大数据流,本申请中,通过仅对第一数据流进行活跃流数目的统计(大数据流适合采用本申请方案进行活跃流数目统计),使得本申请的统计活跃流数目的方案更有针对性。
具体地,由于小数据流中的数据包的数量较少,当网络发生拥塞时,小数据流受到的影响较小,而大数据流中的数据包的数量较多,当网络发生拥塞时,受到的影响较大。因此,对于小数据流,不统计活跃流(也就是说,对于小数据流来说即便是能够接收到数据包,也不将其视为活跃流),而对于大数据流,可以采用本申请的方案进行活跃流数目的统计。
上述步骤101至104仅示出了对根据一组数据包对活跃流数目进行统计的情况,事实上,本申请实施例的活跃流数目统计方法还可以根据多组数据包对活跃流数目进行统计。
可选地,在图2所示的方法中,当第一网络设备通过步骤101至步骤104实现了对第一组数据包的接收以及活跃流数目的更新后,还可以继续接收第二组数据包,并根据第二组数据包的接收情况对活跃流数目再次更新。
105、第一网络设备接收第二组数据包的首包。
应理解,第二组数据包和第一组数据包属于同一数据流,第二组数据包可以是第一网络设备在接收到第一组数据包之后接收到的一组数据包,具体地,第二组数据包和第一组数据包可以是数据流中连续的两组数据包(也就是说,第二组数据包是第一网络设备在接收到第一组数据包之后紧接着又接收到的下一组数据包)。
106、第一网络设备将当前活跃流数目加1,得到第四活跃流数目。
107、第一网络设备接收第二组数据包的尾包。
上述步骤105至步骤107与上文中的步骤101至步骤103的具体过程类似,这里不再赘述。
108、第一网络设备根据第二组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第二拥塞值,并根据第二拥塞值域拥塞阈值的关系对活跃流数目进行更新。
当接收到第二组数据包的首包之后,可以按照接收到第一组数据包的首包的类似的方式进行处理,而在接收到第二数据包的尾包之后,通过综合第二组数据包中携带ECN标识的数据包以及上述第一拥塞值来综合确定第二拥塞值,能够使得第二拥塞值不至于变化过大,从而得到缓慢变化的拥塞值。
可选地,当第一网络设备接收到所述第二网络设备发送的所述第二组数据包的尾 包之后,还可以根据第一组数据包中携带ECN标识的数据包的数量和第二组数据包中携带ECN标识的数据包的数量来综合确定第二拥塞值。
可选地,将第一组数据包和第二组数据包中携带ECN标识的数据包的总数量与第一组数据包和第二组数据包包含的数据包的总数量的比值确定为第二拥塞值。
例如,第一组数据包和第二组数据包均包含10个数据包,其中,第一组数据包中携带ECN标识的数据包为4个,第二组数据包中携带ECN标识的数据包为6个,那么,第一组数据包和第二组数据包携带ECN标识的数据包总数为10个,第一组数据包和第二组数据包的数据包总数量为20个,那么,得到第二拥塞值为10/20=0.5。
应理解,在确定第二拥塞值时,还可以根据第一组数据包中携带ECN标识的数据包的数量得到一个拥塞值,然后再根据第二组数据包中携带ECN标识的数据包的数量得到另一个拥塞值,接下来,将这两个拥塞值进行加权求和得到第二拥塞值。
可选地,作为一个实施例,根据第二组数据包中携带ECN标识的数据包的数量和第一拥塞值,确定网络的第二拥塞值,包括:根据第二组数据包中携带的ECN标识的数据包的数量确定网络的第三拥塞值;根据公式(1)确定第二拥塞值。
con2=x1*con3+x2*con1       (1)
在上述公式(1)中,con3为第三拥塞值,con1为第一拥塞值,con2为第二拥塞值,x1为预设的第一权重值,x2为预设的第二权重值。
应理解,在本申请中,第一网络设备每接收到一组数据包(例如,前面的第一组数据包和第二组数据包)的首包时都要将当前活跃流的数目加1;当第一网络设备每接收到一组数据包的尾包时要根据该组数据中携带ECN标识的数据包的数量对活跃流数目进行调整(将活跃流数目减1或者保持不变),以实现对活跃流数目的实时更新。
为了更好地理解本申请实施例的统计活跃流数目的方法,下面从第一网络设备的角度对本申请实施例的统计活跃数据流数目的方法进行介绍。
图3是本申请实施例的统计活跃流数目的方法的示意性流程图。图3所示的方法至少可以包括步骤201至步骤204,进一步地,图3所示的方法还可以包括步骤205至步骤208,下面对这些步骤进行详细的介绍。
201、开始统计活跃流数目。
步骤201表示开始统计活跃流数目。
202、第一网络设备接收第二网络设备发送的第一组数据包的首包,并执行counter++。
其中,counter是第一网络设备统计得到的当前活跃流数目。具体地,counter是第一网络设备在接收到第二网络设备发送的第一组数据包的首包时第一网络设备统计得到的当前活跃的数据流的数目。
步骤202中的counter++之后得到的counter是接收到第一组数据包的首包,并对当前活跃流数目进行更新后的活跃流的数目,counter++之后的counter相当于步骤102中得到的第一活跃流数目。
203、第一网络设备接收第一组数据包的尾包,并根据第一组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第一拥塞值。
204、确定第一拥塞值是否大于拥塞阈值。
当第一拥塞值小于或者等于拥塞阈值时,说明网络拥塞程度较轻,此时需要将当前活跃流数目减1,也就是执行步骤205;而当第一拥塞值大于或者等于拥塞阈值时,说明网络拥塞较为严重,此时需要保持当前活跃流数目不变,也就是执行步骤206。
205、执行couner--。
在步骤205中,执行counter—得到的counter相当于上文中的第二活跃流数目。
206、保持counter不变。
步骤206中,counter相当于上文中的第一活跃流数目。
207、第一网络设备接收第二网络设备发送的第二组数据包的首包,并执行counter++。
步骤207中执行counter++之后得到的counter相当于上文中的第四活跃流数目。
208、第一网络设备接收第二组数据包的尾包,并根据第一组数据包中携带ECN标识的数据包的数量和第二组数据包中携带ECN标识的数据包的数量确定第二拥塞值。
209、确定第二拥塞值是否大于拥塞阈值。
当第二拥塞值小于或者等于拥塞阈值时,说明网络拥塞程度较轻,此时需要将当前活跃流数目减1,也就是执行步骤210;而当第二拥塞值大于或者等于拥塞阈值时,说明网络拥塞较为严重,此时需要保持当前活跃流数目不变,也就是执行步骤211。
210、执行couner--。
在步骤210中,执行counter—得到的counter相当于上文中的第五活跃流数目。
211、保持counter不变。
步骤206中,counter相当于上文中的第四活跃流数目。
应理解,在图3所示的方法中的步骤201至步骤211中,counter均表示当前的活跃流数目,经过不同的操作步骤需要对counter进行加操作或者减操作,或者保持counter不变,以实时的统计出当前活跃流数目。
上文结合图1至图3对本申请实施例的统计活跃流数目的方法进行了详细的描述。下面结合图4至图5对本申请实施例的网络设备进行详细的描述,应理解,图4至图5所示的网络设备能够执行本申请实施例的统计活跃流数目的方法,为了简洁,下面在介绍图4和图5所示的网络设备时,适当省略重复的描述。
图4是本申请实施例的网络设备的示意性框图。图4中的网络设备300包括:
接收模块301,用于接收其它网络设备发送的第一组数据包的首包;
处理模块302,用于将当前活跃流数目加1,以得到第一活跃流数目;
所述接收模块301还用于接收所述其它网络设备发送的所述第一组数据包的尾包;
所述处理模块302还用于根据所述第一组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第一拥塞值;
所述处理模块302还用于当所述第一拥塞值小于拥塞阈值时,将所述第一活跃流数目减1,以得到第二活跃流数目;
所述处理模块302还用于当所述第一拥塞值大于或者等于所述拥塞阈值时,保持所述第一活跃流数目不变。
本申请中,在接收到一组数据包的尾包时,可以根据该组数据包中携带ECN标识的数据包的个数来确定拥塞情况,进而可以根据拥塞情况对活跃流数目进行修正,能够对活跃流数目进行更精准的统计,进而得到更准确的活跃流数目。
可选地,作为一个实施例,所述处理模块302用于将所述第一组数据包携带有ECN标识的数据包的数量与所述第一组数据包的数据包数量的比值确定为所述第一拥塞值。
可选地,作为一个实施例,在确定所述第一拥塞值之前,所述处理模块302还用于:确定所述第一组数据包所在的数据流为第一数据流,其中,所述第一数据流为所述第其它网络设备接收的数据包的数量大于预设数量的数据流。
可选地,作为一个实施例,在所述接收模块301接收到所述其它网络设备发送的所述第一组数据包的尾包之后,所述接收模块301还用于接收所述其它网络设备发送的第二组数据包的首包;所述处理模块302还用于将第三活跃流数目加1,以得到第四活跃流数目,其中,所述第二组数据包与所述第一组数据包属于同一个数据流,当所述第一拥塞值小于所述拥塞阈值时,所述第三活跃流数目等于所述第二活跃流数目,当所述第一拥塞值大于或者等于所述拥塞阈值时,所述第三活跃流数目等于所述第一活跃流数目;所述接收模块301还用于接收所述其它网络设备发送的所述第二组数据包的尾包;所述处理模块302还用于根据所述第二组数据包中携带ECN标识的数据包的数量和所述第一拥塞值,确定所述网络的第二拥塞值;所述处理模块302还用于当所述第二拥塞值小于所述拥塞阈值时,将所述第四活跃流数目减1,以得到第五活跃流数目;所述处理模块302还用于当所述第二拥塞值大于或者等于所述拥塞阈值时,保持所述第四活跃流数目不变。
可选地,作为一个实施例,所述处理模块302用于:根据所述第二组数据包中携带的ECN标识的数据包的数量确定第三拥塞值;根据公式con2=x1*con3+x2*con1确定所述第二拥塞值,其中,con3为所述第三拥塞值,con1为所述第一拥塞值,con2为所述第二拥塞值,x1为预设的第一权重值,x2为预设的第二权重值。
图5为本申请实施例的网络设备400的硬件结构示意图。图5所示的网络设备400可以执行本申请实施例的统计活跃流数目的方法中的各个步骤。
如图5所示,所述网络设备400包括处理器401、存储器402、接口403和总线404。其中接口403可以通过无线或有线的方式实现,具体来讲可以是网卡。上述处理器401、存储器402和接口403通过总线404连接。
所述接口403具体可以包括发送器和接收器,其中,接收器用于接收第二网络设备发送的数据流,发送器可以用于向第二网络设备发送活跃流数目信息。具体地,接口403可以用于执行步骤101和步骤103以及步骤105和步骤107。
处理器401用于对活跃流数目进行更新,具体地,处理器401可用于执行步骤102、步骤104、步骤106和步骤108。
存储器402包括操作***4021和应用程序4022,用于存储程序、代码或指令,当处理器或硬件设备执行这些程序、代码或指令时可以完成本申请实施例的传输报文的过程。
可选的,所述存储器402可以包括只读存储器(read-only memory,ROM)和随机存取存储器(random access memory,RAM)。其中,所述ROM包括基本输入/输 出***(basic input/output system,BIOS)或嵌入式***;所述RAM包括应用程序和操作***。当需要运行网络设备400时,通过固化在ROM中的BIOS或者嵌入式***引导***进行启动,引导网络设备400进入正常运行状态。在网络设备400进入正常运行状态后,运行在RAM中的应用程序和操作***,从而,完成方法实施例中涉及网络设备的处理过程。
可以理解的是,图5仅仅示出了网络设备的简化设计。在实际应用中,网络设备400可以包含任意数量的接口,处理器或者存储器。
本申请实施例还提供了一种统计活跃流数目的***,该***包括第一网络设备和第二设备,该***中的第一网络设备和第二网络设备可以执行本申请实施例的统计活跃流数目的方法中第一网络上和第二网络设备的各个步骤以及第一网络设备还可以具备图4或图5的网络设备的功能。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的***、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的***、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任 何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (12)

  1. 一种统计活跃流数目的方法,其特征在于,包括:
    第一网络设备接收第二网络设备发送的第一组数据包的首包,并将当前活跃流数目加1,以得到第一活跃流数目;
    所述第一网络设备接收所述第二网络设备发送的所述第一组数据包的尾包,并根据所述第一组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第一拥塞值;
    当所述第一拥塞值小于拥塞阈值时,所述第一网络设备将所述第一活跃流数目减1,以得到第二活跃流数目;
    当所述第一拥塞值大于或者等于所述拥塞阈值时,所述第一网络设备保持所述第一活跃流数目不变。
  2. 如权利要求1所述的方法,其特征在于,所述根据所述第一组数据包中携带ECN标识的数据包的数量确定第一拥塞值,包括:
    将所述第一组数据包携带有ECN标识的数据包的数量与所述第一组数据包的数据包数量的比值确定为所述第一拥塞值。
  3. 如权利要求1或2所述的方法,其特征在于,在确定所述第一拥塞值之前,所述方法还包括:
    确定所述第一组数据包所在的数据流为第一数据流,其中,所述第一数据流为所述第第二网络设备接收的数据包的数量大于预设数量的数据流。
  4. 如权利要求1-3中任一项所述的方法,其特征在于,在所述第一网络设备接收到所述第二网络设备发送的所述第一组数据包的尾包之后,所述方法还包括:
    所述第一网络设备接收所述第二网络设备发送的第二组数据包的首包,并将第三活跃流数目加1,以得到第四活跃流数目,其中,所述第二组数据包与所述第一组数据包属于同一个数据流,当所述第一拥塞值小于所述拥塞阈值时,所述第三活跃流数目等于所述第二活跃流数目,当所述第一拥塞值大于或者等于所述拥塞阈值时,所述第三活跃流数目等于所述第一活跃流数目;
    所述第一网络设备接收所述第二网络设备发送的所述第二组数据包的尾包,并根据所述第二组数据包中携带ECN标识的数据包的数量和所述第一拥塞值,确定所述网络的第二拥塞值;
    当所述第二拥塞值小于所述拥塞阈值时,所述第一网络设备将所述第四活跃流数目减1,以得到第五活跃流数目;
    当所述第二拥塞值大于或者等于所述拥塞阈值时,所述第一网络设备保持所述第四活跃流数目不变。
  5. 如权利要求4所述的方法,其特征在于,所述根据所述第二组数据包中携带ECN标识的数据包的数量和所述第一拥塞值,确定所述网络的第二拥塞值,包括:
    根据所述第二组数据包中携带的ECN标识的数据包的数量确定第三拥塞值;
    根据公式con2=x1*con3+x2*con1确定所述第二拥塞值,其中,con3为所述第三拥塞值,con1为所述第一拥塞值,con2为所述第二拥塞值,x1为预设的第一权重值,x2为预设的第二权重值。
  6. 一种网络设备,其特征在于,包括:
    接收模块,用于接收其它网络设备发送的第一组数据包的首包;
    处理模块,用于将当前活跃流数目加1,以得到第一活跃流数目;
    所述接收模块还用于接收所述其它网络设备发送的所述第一组数据包的尾包;
    所述处理模块还用于根据所述第一组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第一拥塞值;
    所述处理模块还用于当所述第一拥塞值小于拥塞阈值时,将所述第一活跃流数目减1,以得到第二活跃流数目;
    所述处理模块还用于当所述第一拥塞值大于或者等于所述拥塞阈值时,保持所述第一活跃流数目不变。
  7. 如权利要求6所述的网络设备,其特征在于,所述处理模块用于将所述第一组数据包携带有ECN标识的数据包的数量与所述第一组数据包的数据包数量的比值确定为所述第一拥塞值。
  8. 如权利要求6或7所述的网络设备,其特征在于,在确定所述第一拥塞值之前,所述处理模块还用于:
    确定所述第一组数据包所在的数据流为第一数据流,其中,所述第一数据流为所述第其它网络设备接收的数据包的数量大于预设数量的数据流。
  9. 如权利要求6-8中任一项所述的网络设备,其特征在于,在所述接收模块接收到所述其它网络设备发送的所述第一组数据包的尾包之后,所述接收模块还用于接收所述其它网络设备发送的第二组数据包的首包;
    所述处理模块还用于将第三活跃流数目加1,以得到第四活跃流数目,其中,所述第二组数据包与所述第一组数据包属于同一个数据流,当所述第一拥塞值小于所述拥塞阈值时,所述第三活跃流数目等于所述第二活跃流数目,当所述第一拥塞值大于或者等于所述拥塞阈值时,所述第三活跃流数目等于所述第一活跃流数目;
    所述接收模块还用于接收所述其它网络设备发送的所述第二组数据包的尾包;
    所述处理模块还用于根据所述第二组数据包中携带ECN标识的数据包的数量和所述第一拥塞值,确定所述网络的第二拥塞值;
    所述处理模块还用于当所述第二拥塞值小于所述拥塞阈值时,将所述第四活跃流数目减1,以得到第五活跃流数目;
    所述处理模块还用于当所述第二拥塞值大于或者等于所述拥塞阈值时,保持所述第四活跃流数目不变。
  10. 如权利要求9所述的网络设备,其特征在于,所述处理模块用于:
    根据所述第二组数据包中携带的ECN标识的数据包的数量确定第三拥塞值;
    根据公式con2=x1*con3+x2*con1确定所述第二拥塞值,其中,con3为所述第三拥塞值,con1为所述第一拥塞值,con2为所述第二拥塞值,x1为预设的第一权重值,x2为预设的第二权重值。
  11. 一种网络设备,其特征在于,包括:
    存储器,用于存储程序;
    处理器,用于执行所述存储器存储的程序,当所述存储器存储的程序被执行时,所述处理器用于执行如权利要求1-5中任一项所述的方法。
  12. 一种统计活跃流数目的***,所述***包括第一网络设备和第二网络设备, 其特征在于,包括:
    所述第二网络设备向所述第一网络设备发送第一组数据包;
    所述第一网络设备接收所述第一组数据包的首包,并将当前活跃流数目加1,以得到第一活跃流数目;
    所述第一网络设备接收所述第一组数据包的尾包,并根据所述第一组数据包中携带外部拥塞通知ECN标识的数据包的数量确定第一拥塞值;
    当所述第一拥塞值小于拥塞阈值时,所述第一网络设备将所述第一活跃流数目减1,以得到第二活跃流数目;
    当所述第一拥塞值大于或者等于所述拥塞阈值时,所述第一网络设备保持所述第一活跃流数目不变。
PCT/CN2019/104734 2018-09-25 2019-09-06 统计活跃流数目的方法、网络设备和*** WO2020063299A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19865257.0A EP3840299A4 (en) 2018-09-25 2019-09-06 METHOD AND SYSTEM FOR COLLECTING STATISTICS ON THE NUMBER OF ACTIVE FLOWS AND NETWORK DEVICE
US17/206,804 US11489774B2 (en) 2018-09-25 2021-03-19 Method and system for counting quantity of active flows and network device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811119974.6 2018-09-25
CN201811119974.6A CN109245959B (zh) 2018-09-25 2018-09-25 统计活跃流数目的方法、网络设备和***

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/206,804 Continuation US11489774B2 (en) 2018-09-25 2021-03-19 Method and system for counting quantity of active flows and network device

Publications (1)

Publication Number Publication Date
WO2020063299A1 true WO2020063299A1 (zh) 2020-04-02

Family

ID=65057527

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/104734 WO2020063299A1 (zh) 2018-09-25 2019-09-06 统计活跃流数目的方法、网络设备和***

Country Status (4)

Country Link
US (1) US11489774B2 (zh)
EP (1) EP3840299A4 (zh)
CN (1) CN109245959B (zh)
WO (1) WO2020063299A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109245959B (zh) * 2018-09-25 2021-09-03 华为技术有限公司 统计活跃流数目的方法、网络设备和***
CN116527584B (zh) 2019-06-17 2024-04-12 华为技术有限公司 拥塞控制方法及装置、通信网络、计算机存储介质
CN111865812B (zh) * 2020-07-06 2023-04-07 北京合众方达科技有限公司 一种分布式网络中sdn支撑高性能业务混传的方法
CN113746724B (zh) * 2021-11-05 2022-04-12 阿里云计算有限公司 消息传输方法、装置、电子设备及介质
CN114095364B (zh) * 2021-11-29 2024-02-27 新华三大数据技术有限公司 网络拥塞控制方法及装置
CN114363227B (zh) * 2021-12-29 2023-08-08 中国信息通信研究院 用于确定ecn性能的方法及装置、电子设备、存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050111367A1 (en) * 2003-11-26 2005-05-26 Hung-Hsiang Jonathan Chao Distributed architecture for statistical overload control against distributed denial of service attacks
CN103916329A (zh) * 2014-03-21 2014-07-09 中国科学院计算技术研究所 一种命名数据网络传输控制方法及***
CN106533970A (zh) * 2016-11-02 2017-03-22 重庆大学 面向云计算数据中心网络的差分流传输控制方法及装置
CN107078967A (zh) * 2014-09-16 2017-08-18 华为技术有限公司 调度器、发送器、接收器、网络节点及其方法
CN109067665A (zh) * 2018-09-25 2018-12-21 华为技术有限公司 拥塞控制方法和网络设备
CN109245959A (zh) * 2018-09-25 2019-01-18 华为技术有限公司 统计活跃流数目的方法、网络设备和***

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0321570D0 (en) * 2003-09-15 2003-10-15 British Telecomm Inter-domain congestion charging
US9001663B2 (en) * 2010-02-26 2015-04-07 Microsoft Corporation Communication transport optimized for data center environment
US8982694B2 (en) * 2010-09-01 2015-03-17 Telefonaktiebolaget L M Ericsson (Publ) Localized congestion exposure
CN102546202A (zh) * 2010-12-17 2012-07-04 无锡江南计算技术研究所 一种无限带宽网络流量监控方法、装置及***
CN104303465A (zh) * 2013-03-29 2015-01-21 华为技术有限公司 网络拥塞处理方法、网络节点以及网络***
CN104734905B (zh) * 2013-12-24 2018-05-11 华为技术有限公司 检测数据流的方法及装置
US9350672B2 (en) * 2014-03-13 2016-05-24 Cisco Technology, Inc. Performance enhancement and congestion control of multipath protocol packets in a heterogeneous network environment with multipath transport protocols
US9985898B2 (en) * 2015-02-26 2018-05-29 Citrix Systems, Inc. System for bandwidth optimization with traffic priority determination
US9559968B2 (en) * 2015-03-23 2017-01-31 Cisco Technology, Inc. Technique for achieving low latency in data center network environments
US20180069786A1 (en) * 2016-09-02 2018-03-08 Argela Yazilim ve Bilisim Teknolojileri San. ve Tic. A.S. Randomized route hopping in software defined networks

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050111367A1 (en) * 2003-11-26 2005-05-26 Hung-Hsiang Jonathan Chao Distributed architecture for statistical overload control against distributed denial of service attacks
CN103916329A (zh) * 2014-03-21 2014-07-09 中国科学院计算技术研究所 一种命名数据网络传输控制方法及***
CN107078967A (zh) * 2014-09-16 2017-08-18 华为技术有限公司 调度器、发送器、接收器、网络节点及其方法
CN106533970A (zh) * 2016-11-02 2017-03-22 重庆大学 面向云计算数据中心网络的差分流传输控制方法及装置
CN109067665A (zh) * 2018-09-25 2018-12-21 华为技术有限公司 拥塞控制方法和网络设备
CN109245959A (zh) * 2018-09-25 2019-01-18 华为技术有限公司 统计活跃流数目的方法、网络设备和***

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3840299A4

Also Published As

Publication number Publication date
CN109245959B (zh) 2021-09-03
CN109245959A (zh) 2019-01-18
EP3840299A1 (en) 2021-06-23
US20210211379A1 (en) 2021-07-08
EP3840299A4 (en) 2021-11-03
US11489774B2 (en) 2022-11-01

Similar Documents

Publication Publication Date Title
WO2020063299A1 (zh) 统计活跃流数目的方法、网络设备和***
US11350318B2 (en) Multichannel data transmission method and apparatus
US11316795B2 (en) Network flow control method and network device
KR102478440B1 (ko) 혼잡 제어 방법 및 네트워크 디바이스
US11032205B2 (en) Flow control method and switching device
US8509074B1 (en) System, method, and computer program product for controlling the rate of a network flow and groups of network flows
TWI486042B (zh) 對資料中心環境最佳化之通信傳輸
WO2019033857A1 (zh) 报文控制方法及网络装置
US11272396B2 (en) Frame aggregation method, network setting frame sending method, and device
US20080298248A1 (en) Method and Apparatus For Computer Network Bandwidth Control and Congestion Management
US20220191140A1 (en) Data transmission control method, apparatus, and storage medium
EP4024778A1 (en) Method for determining required bandwidth for data stream transmission, and devices and system
EP3547623B1 (en) Method and device for selecting forwarding path
CN110943933A (zh) 一种实现数据传输的方法、装置和***
WO2021103706A1 (zh) 控制数据包发送方法、模型训练方法、装置及***
US8989011B2 (en) Communication over multiple virtual lanes using a shared buffer
CN104734985A (zh) 数据接收流量控制方法及其***
CN112242956A (zh) 流速控制方法和装置
US20210036942A1 (en) Systems and methods for identifying persistently congested queues
WO2023125380A1 (zh) 一种数据管理的方法及相应装置
US11516145B2 (en) Packet control method, flow table update method, and node device
CN117014967A (zh) 移动通信***、方法和用户面节点
US20230216809A1 (en) Congestion control method and apparatus
WO2023280004A1 (zh) 一种网络配置方法、设备和***
CN118282967A (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: 19865257

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019865257

Country of ref document: EP

Effective date: 20210318

NENP Non-entry into the national phase

Ref country code: DE