CN109787922B - Method and device for acquiring queue length and computer readable storage medium - Google Patents

Method and device for acquiring queue length and computer readable storage medium Download PDF

Info

Publication number
CN109787922B
CN109787922B CN201711117765.3A CN201711117765A CN109787922B CN 109787922 B CN109787922 B CN 109787922B CN 201711117765 A CN201711117765 A CN 201711117765A CN 109787922 B CN109787922 B CN 109787922B
Authority
CN
China
Prior art keywords
queue
openflow switch
switch port
port queue
time period
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711117765.3A
Other languages
Chinese (zh)
Other versions
CN109787922A (en
Inventor
魏冰
李小文
孔令军
韩波
杨帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Chengdu ICT Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201711117765.3A priority Critical patent/CN109787922B/en
Publication of CN109787922A publication Critical patent/CN109787922A/en
Application granted granted Critical
Publication of CN109787922B publication Critical patent/CN109787922B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention discloses a method for acquiring queue length, which comprises the following steps: acquiring enqueue data increment and dequeue data increment of an OpenFlow switch port queue in a first preset time period; the first preset time period refers to the time length between the current time and the previous time; calculating the real-time queue length of the OpenFlow switch port queue by utilizing the enqueue data increment and dequeue data increment of the OpenFlow switch port queue in the first preset time period and the queue length of the OpenFlow switch port queue in the second preset time period; and the second preset time period is a time period before the first preset time period. The method can obtain more accurate real-time queue length, thereby improving the utilization rate of bandwidth resources and the network service quality. Meanwhile, the embodiment of the invention also discloses equipment for acquiring the queue length and a computer readable storage medium.

Description

Method and device for acquiring queue length and computer readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for obtaining a queue length, and a computer-readable storage medium.
Background
In a Software Defined Network (SDN), ports of OpenFlow switches support adding priority queues, as shown in fig. 1, generally, the number of queues of each OpenFlow switch port is 3, each queue allows allocating different bandwidths, the sum of bandwidths of all queues does not exceed the total bandwidth of the port, and the size of the queue bandwidth directly determines the capacity of the queue to forward data. As can be seen from fig. 1, in the data plane, each time a new packet arrives at the switch, the switch matches the destination address of the header of the packet with a flow table entry matching field in a flow table (similar to a routing table in a conventional network device) one by one, and once matching is successful, the packet performs operations such as direct output (output), enqueue (set _ queue), flood (flow), drop (drop) and the like according to an action set specified by the flow table entry. If the enqueue operation is performed, the data packet header contains priority information, and the data packets with different priorities enter queues with different bandwidths, so that the data packets with high priorities still have larger bandwidths when the network is congested, and lower forwarding delay is kept.
Based on this, in order to provide better quality of service and fully utilize port bandwidth resources, a bandwidth allocation policy of each queue on a port of the OpenFlow switch is very important. As known, the basis of the bandwidth allocation strategy is the current queuing delay of the queue, and the current queuing delay of the queue is obtained according to the following formula (1), namely the current queuing delay t of the queue is equal to the current average queue length AvgQ of the queue1And current queue bandwidth bw1The ratio of (A) to (B);
t=AvgQ1/bw1(1)
wherein the current average queue length AvgQ of the queue1The calculation formula is shown in the following formula (2):
AvgQ1=(1-wq)*AvgQ0+wq*qLen1(2) in the formula, AvgQ0Is the average queue length, qLen, of the moment before the queue1The length of the queue (i.e. the length of the real-time queue) is the current queue length of the queue, wq is a weight value used for measuring the length qLen of the real-time queue1Average queue length AvgQ of queue current1The degree of influence of (c) is sized according to the actual network conditions and system characteristics.
As can be seen from the above equation (2), the basis for determining the current average queue length of the queue is the current queue length of the queue, i.e. the real-time queue length qLen1. However, the OpenFlow protocol does not provide an interface method for directly obtaining the length of a real-time queue, which is obtained by indirect calculation in the existing real-time queueIn the column length calculation method, the real-time queue length qLen1Is obtained according to the following formula (3), namely the real-time queue length qLen1Is equal to the accumulated Byte number in _ Byte entering the queue at a certain moment1(namely the accumulated Byte number of enqueue) minus the accumulated Byte number out _ Byte of dequeue at the same moment1(i.e., the number of dequeued accumulated bytes).
qLen1=in_Byte1-out_Byte1(3)
As can be seen from the above equation (3), the conventional real-time queue length calculation method requires that the enqueue accumulated data amount and the dequeue accumulated data amount must be acquired synchronously, i.e., the enqueue accumulated data amount and the dequeue accumulated data amount must be acquired at the same time. However, in practical applications, it is not guaranteed that the obtained enqueue and dequeue data are at the same time, as shown in fig. 2, in one query, the query includes a query of the enqueue accumulated data amount and the dequeue accumulated data amount of the queue, and from the time line shown in the figure, the query time of the enqueue accumulated data amount and the dequeue accumulated data amount inevitably has a certain time difference, so that the queried enqueue accumulated data amount is larger than the actual enqueue accumulated data amount, or the queried dequeue accumulated data amount is smaller than the actual dequeue accumulated data amount, and further, the actually obtained real-time queue length qLen is further made to be the same as the actual dequeue accumulated data amount1With some error. In addition, when congestion occurs in the queue, part of the data packets may be lost, and when the real-time queue length is calculated, the in _ Byte in the above equation (3) is used1And out _ Byte1Is the accumulated value by a certain time, so the missing part will also be calculated in the difference of the in-and-out queue; moreover, the accumulated number of lost packets is accumulated over time, which results in larger and larger errors of the obtained real-time queue length.
From the above three formulas, if the real-time queue length qLen1Inaccurate acquisition directly causes the current queuing delay calculation error of the port queue of the OpenFlow switch, and bandwidth resources cannot be allocated by effectively utilizing a bandwidth allocation strategy on the basis, so that the utilization rate of the bandwidth resources is seriously reduced, and the network service quality is influenced.
Disclosure of Invention
In order to solve the foregoing technical problems, embodiments of the present invention are intended to provide a method, an apparatus, and a computer-readable storage medium for obtaining a queue length, so as to obtain a more accurate real-time queue length, thereby improving the utilization of bandwidth resources and the network quality of service.
The technical scheme of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for obtaining a queue length, where the method includes:
acquiring enqueue data increment and dequeue data increment of an OpenFlow switch port queue in a first preset time period; the first preset time period refers to the time length between the current time and the previous time;
calculating the real-time queue length of the OpenFlow switch port queue by utilizing the enqueue data increment and dequeue data increment of the OpenFlow switch port queue in the first preset time period and the queue length of the OpenFlow switch port queue in the second preset time period; and the second preset time period is a time period before the first preset time period.
In the foregoing scheme, the acquiring enqueue data increment and dequeue data increment of the OpenFlow switch port queue within the first preset time period specifically includes:
acquiring the enqueue accumulated data volume and the dequeue accumulated data volume of the OpenFlow switch port queue at the current moment and the previous moment;
and respectively calculating enqueue data increment and dequeue data increment of the OpenFlow switch port queue in the first preset time period according to the enqueue accumulated data volume and the dequeue accumulated data volume of the OpenFlow switch port queue obtained at the current time and at the previous time.
In the foregoing scheme, the calculating an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue within the first preset time period according to the enqueue accumulated data amount and the dequeue accumulated data amount of the OpenFlow switch port queue obtained at the current time and at the previous time respectively specifically includes:
taking a numerical value obtained by subtracting the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the current moment as an enqueue data increment of the OpenFlow switch port queue within the first preset time period; and the number of the first and second groups,
and taking a numerical value obtained by subtracting the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the current moment as a dequeuing data increment of the OpenFlow switch port queue in the first preset time period.
In the foregoing solution, the calculating a real-time queue length of the OpenFlow switch port queue by using an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue in the first preset time period and a queue length of the OpenFlow switch port queue in the second preset time period specifically includes:
incrementing enqueue data of the OpenFlow switch port queue within the first preset time period
Figure BDA0001466709670000041
And dequeue data increments
Figure BDA0001466709670000042
And the queue length of the OpenFlow switch port queue in a second preset time period
Figure BDA0001466709670000043
Substituting the real-time queue length of the OpenFlow switch port queue into the following formula (4) to obtain the real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000044
Figure BDA0001466709670000045
In the above aspect, the method further includes:
calculating the average queue length of the OpenFlow switch port queue calculated in the second preset time period
Figure BDA0001466709670000046
And real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000047
Substituting the following formula (5) to calculate the current average queue length of the OpenFlow switch port queue
Figure BDA0001466709670000048
Figure BDA0001466709670000049
In the formula, wq is a weight value, and the numeric area is (0, 1);
acquiring the current queue bandwidth of the port queue of the OpenFlow switch;
queuing the OpenFlow switch port queue to a current average queue length
Figure BDA00014667096700000410
And a current queue bandwidth of the OpenFlow switch port queue
Figure BDA00014667096700000411
Substituting the following formula (6) to calculate the current queuing delay t of the port queue of the OpenFlow switch:
Figure BDA0001466709670000051
and reallocating the bandwidth to the OpenFlow switch port queue according to the current queuing delay of the OpenFlow switch port queue.
In a second aspect, an embodiment of the present invention provides an apparatus for obtaining a queue length, where the apparatus includes: the device comprises a data increment acquisition module and a real-time queue length calculation module; wherein the content of the first and second substances,
the data increment obtaining module is configured to obtain enqueue data increments and dequeue data increments of the OpenFlow switch port queue within a first preset time period; the first preset time period refers to the time length between the current time and the previous time;
the real-time queue length calculation module is configured to calculate a real-time queue length of the OpenFlow switch port queue by using an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue in the first preset time period and a queue length of the OpenFlow switch port queue in a second preset time period; and the second preset time period is a time period before the first preset time period.
In the foregoing scheme, the data increment obtaining module specifically includes: the data query submodule and the data increment calculation submodule; wherein the content of the first and second substances,
the data query submodule is configured to acquire enqueue accumulated data volume and dequeue accumulated data volume of the OpenFlow switch port queue at the current moment and the previous moment;
the data increment calculation sub-module is configured to calculate an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue within the first preset time period according to the enqueue accumulated data volume and the dequeue accumulated data volume of the OpenFlow switch port queue acquired at the current time and at the previous time.
In the above scheme, the data increment calculation sub-module is specifically configured to:
taking a numerical value obtained by subtracting the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the current moment as an enqueue data increment of the OpenFlow switch port queue within the first preset time period; and the number of the first and second groups,
and taking a numerical value obtained by subtracting the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the current moment as a dequeuing data increment of the OpenFlow switch port queue in the first preset time period.
In the above scheme, the real-time queue length calculating module is specifically configured to:
incrementing enqueue data of the OpenFlow switch port queue within the first preset time period
Figure BDA0001466709670000061
And dequeue data increments
Figure BDA0001466709670000062
And the queue length of the OpenFlow switch port queue in a second preset time period
Figure BDA0001466709670000063
Substituting the real-time queue length of the OpenFlow switch port queue into the following formula (7) to obtain the real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000064
Figure BDA0001466709670000065
In the above scheme, the apparatus further comprises a queuing delay calculation module and a policy management module; wherein the content of the first and second substances,
the queuing delay calculation module is configured to calculate the average queue length of the port queue of the OpenFlow switch in the second preset time period
Figure BDA0001466709670000066
And real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000067
Substituting the following formula (8) to obtain the OpenFlow switch port queueAverage queue length of current queue
Figure BDA0001466709670000068
Figure BDA0001466709670000069
In the formula, wq is a weight value, and the numeric area is (0, 1);
the queuing delay calculation module is configured to obtain a current queue bandwidth of the port queue of the OpenFlow switch;
the queuing delay calculation module is configured to queue the current average queue length of the port queue of the OpenFlow switch
Figure BDA00014667096700000610
And a current queue bandwidth of the OpenFlow switch port queue
Figure BDA00014667096700000611
And substituting the following formula (9) to calculate the current queuing time delay t of the port queue of the OpenFlow switch:
Figure BDA00014667096700000612
the policy management module is configured to reallocate bandwidth to the OpenFlow switch port queue according to the current queuing delay of the OpenFlow switch port queue.
In a third aspect, an embodiment of the present invention provides an apparatus for obtaining a queue length, where the apparatus includes: a memory, a processor, and a computer program stored on the memory and executable on the processor; wherein, the processor implements the above method steps for obtaining the queue length when executing the program.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement the method steps for obtaining queue length described above.
The embodiment of the invention provides a method for acquiring queue length, which creatively utilizes the data increment of an out/in queue to recursively calculate the current queue length of an OpenFlow switch port queue, namely the real-time queue length, and only needs to ensure that the enqueue data increment and the dequeue data increment are the increment in the same time length without ensuring the synchronism of the queue in and out data; meanwhile, an error caused by packet loss is not an accumulated value any more but a single value within a certain preset time period, and therefore if the set time period is sufficiently small, the error can be ignored. Therefore, by using the method for acquiring the real-time queue length provided by the embodiment of the invention, the more accurate real-time queue length can be acquired, so that the subsequent bandwidth adjustment strategy can exert a better effect, and the utilization rate of bandwidth resources is effectively improved; meanwhile, when the queue is congested, the congestion condition can be timely found, so that higher-quality service is provided for the user. In addition, the embodiment of the invention also provides equipment for acquiring the queue length and a computer readable storage medium.
Drawings
Fig. 1 is a schematic diagram of a port queue of an OpenFlow switch according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a data query according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a method for obtaining a real-time queue length according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a relationship between a real-time queue length and a queue length in a second preset time period according to an embodiment of the present invention;
fig. 5 is a schematic diagram illustrating another method for obtaining a real-time queue length according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a method for obtaining an enqueue data increment and a dequeue data increment according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an apparatus for obtaining a real-time queue length according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of another apparatus for obtaining a real-time queue length according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another apparatus for obtaining a real-time queue length according to an embodiment of the present invention;
fig. 10 is a schematic workflow diagram of an apparatus for obtaining a real-time queue length according to an embodiment of the present invention;
fig. 11 is a schematic diagram of a single-terminal loopback test method according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an apparatus for obtaining a real-time queue length according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Example one
As shown in fig. 3, the figure illustrates a method for obtaining a queue length according to an embodiment of the present invention, and as can be seen from the figure, the method mainly includes the following steps:
s110, acquiring enqueue data increment and dequeue data increment of an OpenFlow switch port queue in a first preset time period; the first preset time period refers to the time length between the current time and the previous time;
it can be understood that the enqueue data increment and dequeue data increment of the OpenFlow switch port queue are increment amounts within the same time length, and it is not necessary to guarantee that the enqueue data amount of the OpenFlow switch port queue is queried at the same time.
S120, calculating the real-time queue length of the OpenFlow switch port queue by utilizing the enqueue data increment and the dequeue data increment of the OpenFlow switch port queue in the first preset time period and the queue length of the OpenFlow switch port queue in the second preset time period; and the second preset time period is a time period before the first preset time period.
It can be understood that, in the step S120, since the enqueue data increment and the dequeue data increment of the OpenFlow switch port queue are used as a basis for calculating the length of the real-time queue, it is not necessary to guarantee the enqueue data amount of the port queue to be queried at the same time, but it is only necessary to guarantee that the enqueue data increment is the data increment acquired within the same time duration, so that the method shown in fig. 3 reduces the real-time queue length acquisition error caused by the asynchronization of data query in the prior art; meanwhile, because the error generated by packet loss is no longer an accumulated value but a single value within a preset time period, if the set time length is small enough, the error can be ignored, and therefore, the method shown in fig. 3 can also effectively reduce the influence of the packet loss on the length of the real-time queue.
For example, for step S110, the obtaining an enqueue data increment and a dequeue data increment of an OpenFlow switch port queue in a first preset time period specifically includes the following steps:
s1101, acquiring enqueue accumulated data volume and dequeue accumulated data volume of the OpenFlow switch port queue at the current moment and at the previous moment;
and S1102, respectively calculating an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue within the first preset time period according to the enqueue accumulated data volume and the dequeue accumulated data volume of the OpenFlow switch port queue acquired at the current time and at the previous time.
Specifically, for step S1102, the calculating an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue within the first preset time period according to the enqueue accumulated data amount and the dequeue accumulated data amount of the OpenFlow switch port queue obtained at the current time and at the previous time may include:
taking a numerical value obtained by subtracting the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the current moment as an enqueue data increment of the OpenFlow switch port queue within the first preset time period; and the number of the first and second groups,
and taking a numerical value obtained by subtracting the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the current moment as a dequeuing data increment of the OpenFlow switch port queue in the first preset time period.
Here, it should be noted that the time points of acquiring the enqueue accumulated data amount and the dequeue accumulated data amount may be different, that is, it is not necessary to guarantee the synchronicity of querying the enqueue accumulated data amount and the dequeue accumulated data amount, as long as the time lengths between the current time and the previous time are equal. In this way, the enqueue data increment and the dequeue data increment in the preset time period are used for calculating the real-time queue length of the port queue of the OpenFlow switch, so that the acquisition error of the real-time queue length caused by the asynchronism of data query in the conventional calculation method (corresponding to the above formula (3)) can be eliminated.
For example, for step S120, the calculating a real-time queue length of the OpenFlow switch port queue by using an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue in the first preset time period and a queue length of the OpenFlow switch port queue in the second preset time period may specifically include:
incrementing enqueue data of the OpenFlow switch port queue within the first preset time period
Figure BDA0001466709670000101
And dequeue data increments
Figure BDA0001466709670000102
And the queue length of the OpenFlow switch port queue in a second preset time period
Figure BDA0001466709670000103
Substituting the real-time queue length of the OpenFlow switch port queue into the following formula (10) to obtain the real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000104
Figure BDA0001466709670000105
It can be understood that, as shown in fig. 4, in a first preset time period, a difference value between an enqueue data increment and a dequeue data increment of an OpenFlow switch port queue is a data amount staying in the OpenFlow switch port queue in the time period, and therefore, adding the data amount staying in the OpenFlow switch port queue in the time period to a queue length of the OpenFlow switch port queue in a second preset time period is a real-time queue length of the OpenFlow switch port queue.
Illustratively, the method shown in fig. 3 further includes:
s130, calculating the current average queue length of the OpenFlow switch port queue according to the following formula (11)
Figure BDA0001466709670000106
Figure BDA0001466709670000107
In the formula (I), the compound is shown in the specification,
Figure BDA0001466709670000108
representing a second preset time period deltat0The calculated average queue length of the OpenFlow switch port queue; wq is weight, and the value range is (0, 1);
Figure BDA0001466709670000109
representing a real-time queue length of the OpenFlow switch port queue;
here, it should be noted that in a real SDN network, data is usually bursty, and a queue may be suddenly filled at a certain time and then be quickly emptied. Therefore, the above equation (11), i.e., the Random Early Detection equation (RED) pair is adoptedReal-time queue length
Figure BDA0001466709670000111
And performing low-pass filtering, ignoring burst characteristics of data, and focusing on long-term change of the queue length, namely the average queue length of the queue, so as to obtain more real and reliable queuing delay.
S140, acquiring the current queue bandwidth of the OpenFlow switch port queue;
s150, calculating a current queuing delay t of the port queue of the OpenFlow switch according to the following formula (12):
Figure BDA0001466709670000112
in the formula (I), the compound is shown in the specification,
Figure BDA0001466709670000113
representing the current average queue length of the OpenFlow switch port queue;
Figure BDA0001466709670000114
representing a current queue bandwidth of the OpenFlow switch port queue;
and S160, reallocating the bandwidth to the OpenFlow switch port queue according to the current queuing delay of the OpenFlow switch port queue.
It can be understood that when the current queuing delay of the OpenFlow switch port queue is large, it indicates that the queue is in a congestion state, and in order to improve the congestion state of the queue, a larger bandwidth may be allocated to the queue, so as to accelerate the data forwarding rate and relieve the data congestion of the queue.
The embodiment of the invention provides a method for acquiring the length of a real-time queue, which mainly utilizes enqueue data increment and dequeue data increment of an OpenFlow switch port queue in a first preset time period and the queue length of the OpenFlow switch port queue in a second preset time period to calculate the length of the real-time queue of the OpenFlow switch port queue. The method comprises the steps that the data increment of an ingress/egress queue is obtained on the basis of obtaining the real-time queue length of an OpenFlow switch port queue, so that the synchronism of inquiring the accumulated data quantity of the ingress/egress queue is not required, and only the enqueue data increment and the dequeue data increment are ensured to be the increment within the same time length; meanwhile, the error caused by packet loss is no longer an accumulated value but a single value within the first preset time period, and therefore, if the set first preset time period is sufficiently small, the error can be ignored. Therefore, the method for obtaining the length of the real-time queue provided by the embodiment of the invention can reduce the calculation error of the length of the real-time queue caused by the asynchronism of data query, and can effectively reduce the error brought by the packet loss of the data to the calculation of the length of the real-time queue, thereby obtaining more accurate queuing delay and effectively improving the utilization rate of bandwidth resources and the network service quality.
Example two
For facilitating understanding of the above technical solution, as shown in fig. 5, this figure shows a specific implementation process for acquiring a queue length and allocating a queue bandwidth by using a real-time queue length according to an embodiment of the present invention, and as can be seen from the figure, this process mainly includes the following implementation steps:
s210, acquiring the enqueue accumulated byte number, the dequeue accumulated byte number and the queue bandwidth of the OpenFlow switch port queue at the current moment and the previous moment;
s220, respectively calculating an enqueue byte number increment and a dequeue byte number increment of the OpenFlow switch port queue within a first preset time period according to the enqueue accumulated byte number and the dequeue accumulated byte number of the OpenFlow switch port queue obtained at the current time and at the previous time; the first preset time period refers to the time length between the current time and the previous time;
it is understood that the data increment refers to an amount of data increase in a certain period of time. Therefore, here, the enqueue byte count increment of the OpenFlow switch port queue in the first preset time period is equal to the enqueue accumulated byte count of the OpenFlow switch port queue acquired at the current time minus the enqueue accumulated byte count of the OpenFlow switch port queue acquired at the previous time. Similarly, the dequeue byte number increment of the OpenFlow switch port queue in the first preset time period is equal to the dequeue accumulated byte number of the OpenFlow switch port queue obtained at the current moment minus the dequeue accumulated byte number of the OpenFlow switch port queue obtained at the previous moment.
As shown in fig. 6, when calculating the enqueue byte number increment and the dequeue byte number increment of the OpenFlow switch port queue in the first preset time period, it is only necessary to ensure that the enqueue data increment and the dequeue data increment are increment amounts within the same time length without ensuring that the time for querying the accumulated enqueue/enqueue data amount is equal.
S230, calculating the real-time queue length of the OpenFlow switch port queue according to the following formula (13)
Figure BDA0001466709670000121
Figure BDA0001466709670000122
In the formula (I), the compound is shown in the specification,
Figure BDA0001466709670000123
and
Figure BDA0001466709670000124
respectively represent the first preset time period deltat1Enqueue byte number increment and dequeue byte number increment of an internal OpenFlow switch port queue;
Figure BDA0001466709670000131
represents the second preset time period deltat0The queue length of the OpenFlow switch port queue is set;
s240, calculating the current average queue length of the OpenFlow switch port queue according to the following formula (14)
Figure BDA0001466709670000132
Figure BDA0001466709670000133
In the formula (I), the compound is shown in the specification,
Figure BDA0001466709670000134
is represented by the second preset time period deltat0The calculated average queue length of the OpenFlow switch port queue; wq is weight, and the value range is (0, 1);
s250, calculating the current queuing delay t of the port queue of the OpenFlow switch according to the following formula (15):
Figure BDA0001466709670000135
in the formula (I), the compound is shown in the specification,
Figure BDA0001466709670000136
a current queue bandwidth of the OpenFlow switch port queue;
and S260, reallocating the bandwidth to the OpenFlow switch port queue according to the current queuing delay of the OpenFlow switch port queue.
EXAMPLE III
Based on the same technical concept as described above, as shown in fig. 7, which illustrates an apparatus 30 for obtaining queue length according to an embodiment of the present invention, as can be seen from the figure, the apparatus 30 may include: a data increment acquisition module 310 and a real-time queue length calculation module 320; wherein the content of the first and second substances,
the data increment obtaining module 310 may be configured to obtain an enqueue data increment and a dequeue data increment of an OpenFlow switch port queue within a first preset time period; the first preset time period refers to the time length between the current time and the previous time;
the real-time queue length calculating module 320 may be configured to calculate a real-time queue length of the OpenFlow switch port queue by using an enqueue data increment and an dequeue data increment of the OpenFlow switch port queue in the first preset time period and a queue length of the OpenFlow switch port queue in a second preset time period; and the second preset time period is a time period before the first preset time period.
In the foregoing scheme, the data increment obtaining module 310, as shown in fig. 8, may specifically include: a data query sub-module 3101 and a data increment calculation sub-module 3102; wherein the content of the first and second substances,
the data query sub-module 3101 may be configured to obtain an enqueue accumulated data volume and a dequeue accumulated data volume of the OpenFlow switch port queue at a current time and a previous time;
the data increment calculation sub-module 3102 may be configured to calculate an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue within the first preset time period according to the enqueue accumulated data amount and the dequeue accumulated data amount of the OpenFlow switch port queue obtained at the current time and at the previous time.
In the above scheme, the data increment calculation sub-module 3102 may be specifically configured to:
taking a numerical value obtained by subtracting the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the current moment as an enqueue data increment of the OpenFlow switch port queue within the first preset time period; and the number of the first and second groups,
and taking a numerical value obtained by subtracting the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the current moment as a dequeuing data increment of the OpenFlow switch port queue in the first preset time period.
In the above scheme, the real-time queue length calculating module 320 may be specifically configured to:
incrementing enqueue data of the OpenFlow switch port queue within the first preset time period
Figure BDA0001466709670000141
And dequeue data increments
Figure BDA0001466709670000142
And the queue length of the OpenFlow switch port queue in a second preset time period
Figure BDA0001466709670000143
Substituting the real-time queue length of the OpenFlow switch port queue into the following formula (16) to obtain the real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000144
Figure BDA0001466709670000145
In the above solution, as shown in fig. 9, the apparatus 30 may further include a queuing delay calculation module 330 and a policy management module 340; wherein the content of the first and second substances,
the queuing delay calculation module 330 is configured to calculate the average queue length of the port queue of the OpenFlow switch in the second preset time period
Figure BDA0001466709670000146
And real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000151
Calculating the current average queue length of the OpenFlow switch port queue by substituting the following formula (17)
Figure BDA0001466709670000152
Figure BDA0001466709670000153
In the formula, wq is a weight value, and the numeric area is (0, 1);
the queuing delay calculation module 330 is configured to obtain a current queue bandwidth of the port queue of the OpenFlow switch;
the queuing delay calculation module 330 is configured to queue the current average queue length of the OpenFlow switch port queue
Figure BDA0001466709670000154
And a current queue bandwidth of the OpenFlow switch port queue
Figure BDA0001466709670000155
Substituting the following formula (18) to calculate the current queuing delay t of the port queue of the OpenFlow switch:
Figure BDA0001466709670000156
the policy management module 340 is configured to reallocate bandwidth to the OpenFlow switch port queue according to the current queuing delay of the OpenFlow switch port queue.
Example four
In order to facilitate understanding of the above technical solution, in the embodiment of the present invention, a work flow of the apparatus in practical application will be described in conjunction with the apparatus 30, specifically referring to fig. 10, and as can be seen from the figure, the work flow mainly includes the following steps:
s410, the data query sub-module 3101 is connected with the OpenFlow switch;
s420, the module sends inquiry commands of enqueuing and dequeuing accumulated data volume to the OpenFlow switch through the connection between the module and the OpenFlow switch;
here, it should be noted that, in practical applications, the connection between the data query sub-module 3101 and the OpenFlow switch may be a Secure Shell Protocol (SSH) connection based on a Transmission Control Protocol (TCP). Since a certain time is required for initially establishing the connection, a static long connection may be used in order to avoid the need to re-establish the connection every data query.
S430, when the OpenFlow switch receives the query command issued by the module 3101, the OpenFlow switch sends the current enqueue cumulative data amount, dequeue cumulative data amount, and queue bandwidth of the port queue to the module 3101;
s440, after receiving the enqueue accumulated data amount, the dequeue accumulated data amount, and the queue bandwidth of the port queue sent by the OpenFlow switch, the module 3101 calls the data increment calculation sub-module 3102, the real-time queue length calculation module 320, and the queuing delay calculation module 330 in sequence, so as to calculate the current queuing delay of the port queue;
s450, the module 3101 sends the current queuing delay of the port queue to the policy management module 340;
s460, when the policy management module 340 receives the current queuing delay of the port queue, generating a bandwidth allocation policy according to the current queuing delay of each port queue;
s470, the policy management module 340 issues the policy to the OpenFlow switch;
s480, the OpenFlow switch allocates bandwidth for each port queue again according to the strategy;
s490, the OpenFlow switch feeds back the adjusted queue bandwidth of the port queue to the module 3101.
Here, it should be noted that the workflow shown in fig. 10 is only for explaining a specific cooperation flow between the OpenFlow switch and each of the virtual modules for implementing the above technical solution, and the apparatus 30 may be a terminal independent from the OpenFlow switch, such as a Personal Computer (PC), or a Computer-readable storage medium inserted in the OpenFlow switch, where the device implementation of the apparatus 30 is not limited herein.
In order to verify the technical effect obtained by the above technical solution, assuming that the apparatus 30 is a terminal independent from an OpenFlow switch, as shown in fig. 11, this figure shows a flowchart of testing the actual queuing delay of each port queue by a single-terminal loopback test method, and the main principle of the test is as follows: the terminal realizes the mutual communication between the path 1 and the path 3 shown in fig. 11, after the communication is successful, the terminal starts a data receiving program for monitoring whether data is transmitted, starts a data sending program, and continuously sends data packets to the OpenFlow switch, and each data packet carries a unique sequence number and a unique timestamp (i.e., system time when sending the packet). For each data packet, the data receiving program of the terminal may monitor that the terminal receives the same data packet twice in sequence: the first time is as follows: the data packet is directly captured by a data receiving program locally, and the data receiving program records the time delay of receiving the data packet at this time; the second time is that: the data packet is transmitted back to the terminal along the direction of the path 1- > path 2- > path 3 shown in fig. 11 and received by the data receiving program, and the data receiving program records the time delay of receiving the data packet this time. Since the transmission time of the data packet on the path 1 and the path 3 is very long, the difference value of the receiving delay of the two data packets is the actual queuing delay of the data packet in the port queue.
In fact, a method for obtaining the length of the real-time queue according to the embodiment of the present invention has performed a large number of tests on an entity OpenFlow switch, and test results thereof are shown in table 1 below, which shows queuing delays of queues with different bandwidths obtained by the following three methods when a transmission frequency of a packet is 10000 packets/sec and a size of each packet is 1KB, where queuing delay 1 shown in table 1 is an actual queuing delay obtained by a single-terminal loopback test method shown in fig. 11, queuing delay 2 is a queuing delay obtained by using the method for obtaining the length of the real-time queue according to the embodiment of the present invention, and queuing delay 3 is a queuing delay obtained by using the method described in the background art.
TABLE 1 queuing delay (unit: ms) for queues with different bandwidths
Queue 0 (Bandwidth 60M) Queue 1 (Bandwidth 30M) Queue 2 (Bandwidth 10M)
Queuing delay 1 123 248 746
Queuing delay 2 114 234 739
Time delay in queuing 3 142 275 760
As can be seen from the test results shown in table 1 above, the queuing delay obtained by using the method for obtaining the length of the real-time queue according to the embodiment of the present invention is closer to the actual queuing delay of the port queue.
EXAMPLE five
Based on the same technical concept as described above, as shown in fig. 12, the figure illustrates an apparatus 60 for obtaining queue length according to an embodiment of the present invention, and as can be seen from the figure, the apparatus 60 may include: a memory 610, a processor 620 and a computer program 630 stored on the memory 610 and executable on the processor 620, the processor 620 implementing the following steps when executing the program 630:
acquiring enqueue data increment and dequeue data increment of an OpenFlow switch port queue in a first preset time period; the first preset time period refers to the time length between the current time and the previous time;
calculating the real-time queue length of the OpenFlow switch port queue by utilizing the enqueue data increment and dequeue data increment of the OpenFlow switch port queue in the first preset time period and the queue length of the OpenFlow switch port queue in the second preset time period; and the second preset time period is a time period before the first preset time period.
In practical applications, the Memory 610 may be a volatile Memory (volatile Memory), such as a Random-Access Memory (RAM); or a non-volatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a hard disk (HDD), or a Solid-State Drive (SSD); or a combination of the above types of memories and provides a computer program to the processor 620.
The Processor 620 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It will be appreciated that the electronic devices used to implement the processor functions described above may be other devices, and embodiments of the present invention are not limited in particular.
For example, the obtaining of the enqueue data increment and the dequeue data increment of the OpenFlow switch port queue in the first preset time period may be further executed by the processor 620, so as to implement the following steps:
acquiring the enqueue accumulated data volume and the dequeue accumulated data volume of the OpenFlow switch port queue at the current moment and the previous moment;
and respectively calculating enqueue data increment and dequeue data increment of the OpenFlow switch port queue in the first preset time period according to the enqueue accumulated data volume and the dequeue accumulated data volume of the OpenFlow switch port queue obtained at the current time and at the previous time.
Specifically, the enqueue data increment and the dequeue data increment of the OpenFlow switch port queue in the first preset time period are respectively calculated according to the enqueue accumulated data amount and the dequeue accumulated data amount of the OpenFlow switch port queue acquired at the current time and at the previous time, and the method can be further executed by the processor 620 to implement the following steps:
taking a numerical value obtained by subtracting the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the current moment as an enqueue data increment of the OpenFlow switch port queue within the first preset time period; and the number of the first and second groups,
and taking a numerical value obtained by subtracting the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the current moment as a dequeuing data increment of the OpenFlow switch port queue in the first preset time period.
Illustratively, the calculating a real-time queue length of the OpenFlow switch port queue by using an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue in the first preset time period and a queue length of the OpenFlow switch port queue in the second preset time period may be further executed by the processor 620, so as to implement the following steps:
incrementing enqueue data of the OpenFlow switch port queue within the first preset time period
Figure BDA0001466709670000191
And dequeue data increments
Figure BDA0001466709670000192
And within a second preset time periodQueue length of the OpenFlow switch port queue
Figure BDA0001466709670000193
Substituting the following formula (19) to calculate the real-time queue length of the port queue of the OpenFlow switch
Figure BDA0001466709670000194
Figure BDA0001466709670000195
Illustratively, the processor 620 may also implement the following steps when executing the program 630:
calculating the average queue length of the OpenFlow switch port queue calculated in the second preset time period
Figure BDA0001466709670000196
And real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000197
Substituting the following formula (20) to calculate the current average queue length of the OpenFlow switch port queue
Figure BDA0001466709670000198
Figure BDA0001466709670000199
In the formula, wq is a weight value, and the numeric area is (0, 1);
acquiring the current queue bandwidth of the port queue of the OpenFlow switch;
queuing the OpenFlow switch port queue to a current average queue length
Figure BDA00014667096700001910
And a current queue bandwidth of the OpenFlow switch port queue
Figure BDA00014667096700001911
Substituting the following formula (21) to calculate the current queuing delay t of the port queue of the OpenFlow switch:
Figure BDA0001466709670000201
and reallocating the bandwidth to the OpenFlow switch port queue according to the current queuing delay of the OpenFlow switch port queue.
EXAMPLE six
The technical solution of any of the above embodiments essentially or partially contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a computer-readable storage medium, which includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method described in this embodiment. And the aforementioned computer-readable storage media comprise: a U-disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Specifically, the computer program instructions corresponding to the method for obtaining queue length in this embodiment may be stored in a computer-readable storage medium such as an optical disc, a hard disk, a usb disk, or the like, where the computer-readable storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the following steps:
acquiring enqueue data increment and dequeue data increment of an OpenFlow switch port queue in a first preset time period; the first preset time period refers to the time length between the current time and the previous time;
calculating the real-time queue length of the OpenFlow switch port queue by utilizing the enqueue data increment and dequeue data increment of the OpenFlow switch port queue in the first preset time period and the queue length of the OpenFlow switch port queue in the second preset time period; and the second preset time period is a time period before the first preset time period.
For example, the obtaining of the enqueue data increment and the dequeue data increment of the OpenFlow switch port queue within the first preset time period may be executed by the one or more processors to implement the following steps:
acquiring the enqueue accumulated data volume and the dequeue accumulated data volume of the OpenFlow switch port queue at the current moment and the previous moment;
and respectively calculating enqueue data increment and dequeue data increment of the OpenFlow switch port queue in the first preset time period according to the enqueue accumulated data volume and the dequeue accumulated data volume of the OpenFlow switch port queue obtained at the current time and at the previous time.
Specifically, the one or more processors may be configured to calculate an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue within the first preset time period according to the enqueue accumulated data amount and the dequeue accumulated data amount of the OpenFlow switch port queue obtained at the current time and at the previous time, and implement the following steps:
taking a numerical value obtained by subtracting the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the current moment as an enqueue data increment of the OpenFlow switch port queue within the first preset time period; and the number of the first and second groups,
and taking a numerical value obtained by subtracting the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the current moment as a dequeuing data increment of the OpenFlow switch port queue in the first preset time period.
Illustratively, the calculating a real-time queue length of the OpenFlow switch port queue by using an enqueue data increment and a dequeue data increment of the OpenFlow switch port queue in the first preset time period and a queue length of the OpenFlow switch port queue in the second preset time period may be executed by the one or more processors to implement the following steps:
incrementing enqueue data of the OpenFlow switch port queue within the first preset time period
Figure BDA0001466709670000211
And dequeue data increments
Figure BDA0001466709670000212
And the queue length of the OpenFlow switch port queue in a second preset time period
Figure BDA0001466709670000213
Substituting the real-time queue length of the OpenFlow switch port queue into the following formula (22) to obtain the real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000214
Figure BDA0001466709670000215
Illustratively, the one or more programs described above are also executable by the one or more processors to perform the steps of:
calculating the average queue length of the OpenFlow switch port queue calculated in the second preset time period
Figure BDA0001466709670000221
And real-time queue length of the OpenFlow switch port queue
Figure BDA0001466709670000222
Substituting the following formula (23) to calculate the current average queue length of the OpenFlow switch port queue
Figure BDA0001466709670000223
Figure BDA0001466709670000224
In the formula, wq is a weight value, and the numeric area is (0, 1);
acquiring the current queue bandwidth of the port queue of the OpenFlow switch;
queuing the OpenFlow switch port queue to a current average queue length
Figure BDA0001466709670000225
And a current queue bandwidth of the OpenFlow switch port queue
Figure BDA0001466709670000226
And substituting the following formula (24) to calculate the current queuing delay t of the port queue of the OpenFlow switch:
Figure BDA0001466709670000227
and reallocating the bandwidth to the OpenFlow switch port queue according to the current queuing delay of the OpenFlow switch port queue.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (6)

1. A method for obtaining queue length, the method comprising:
acquiring the enqueue accumulated data volume and the dequeue accumulated data volume of the OpenFlow switch port queue at the current moment and the previous moment;
taking a numerical value obtained by subtracting the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the enqueue accumulated data volume of the OpenFlow switch port queue obtained at the current moment as an enqueue data increment of the OpenFlow switch port queue within the first preset time period;
taking a numerical value obtained by subtracting the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the dequeuing accumulated data volume of the OpenFlow switch port queue obtained at the current moment as a dequeuing data increment of the OpenFlow switch port queue in the first preset time period;
incrementing enqueue data of the OpenFlow switch port queue within the first preset time period
Figure FDA0002466341370000011
And dequeue data increments
Figure FDA0002466341370000012
And the queue length of the OpenFlow switch port queue in a second preset time period
Figure FDA0002466341370000013
Substituting the real-time queue length of the OpenFlow switch port queue into the following formula (1) to obtain the real-time queue length of the OpenFlow switch port queue
Figure FDA0002466341370000014
Figure FDA0002466341370000015
And the second preset time period is a time period before the first preset time period.
2. The method of claim 1, further comprising:
calculating the average queue length of the OpenFlow switch port queue calculated in the second preset time period
Figure FDA0002466341370000016
And real-time queue length of the OpenFlow switch port queue
Figure FDA0002466341370000017
Substituting the average queue length of the OpenFlow switch port queue into the following formula (2) to obtain the current average queue length of the OpenFlow switch port queue
Figure FDA0002466341370000018
Figure FDA0002466341370000019
In the formula, wq is a weight value, and the numeric area is (0, 1);
acquiring the current queue bandwidth of the port queue of the OpenFlow switch;
queuing the OpenFlow switch port queue to a current average queue length
Figure FDA0002466341370000021
And a current queue bandwidth of the OpenFlow switch port queue
Figure FDA0002466341370000022
Substituting the following formula (3) to calculate the current queuing delay t of the port queue of the OpenFlow switch:
Figure FDA0002466341370000023
and reallocating the bandwidth to the OpenFlow switch port queue according to the current queuing delay of the OpenFlow switch port queue.
3. An apparatus for obtaining queue length, the apparatus comprising: the device comprises a data increment acquisition module and a real-time queue length calculation module; wherein the content of the first and second substances,
the data increment acquisition module comprises: the data query submodule and the data increment calculation submodule;
the data query submodule is configured to acquire enqueue accumulated data volume and dequeue accumulated data volume of the OpenFlow switch port queue at the current moment and the previous moment;
the data increment calculation sub-module is configured to take a numerical value obtained by subtracting the enqueue accumulated data amount of the OpenFlow switch port queue obtained at the previous moment from the enqueue accumulated data amount of the OpenFlow switch port queue obtained at the current moment as the enqueue data increment of the OpenFlow switch port queue within the first preset time period; and a value obtained by subtracting the dequeue accumulated data volume of the OpenFlow switch port queue obtained at the previous moment from the dequeue accumulated data volume of the OpenFlow switch port queue obtained at the current moment is used as a dequeue data increment of the OpenFlow switch port queue in the first preset time period, where the first preset time period is a time length between the current moment and the previous moment;
the real-time queue length calculation module is configured to increment enqueue data of the port queue of the OpenFlow switch within the first preset time period
Figure FDA0002466341370000024
And dequeue data increments
Figure FDA0002466341370000025
And the queue length of the OpenFlow switch port queue in a second preset time period
Figure FDA0002466341370000026
Substituting the real-time queue length of the OpenFlow switch port queue into the following formula (4) to obtain the real-time queue length of the OpenFlow switch port queue
Figure FDA0002466341370000027
Figure FDA0002466341370000028
And the second preset time period is a time period before the first preset time period.
4. The apparatus of claim 3, further comprising a queuing delay calculation module and a policy management module; wherein the content of the first and second substances,
the queuing delay calculation module is configured to calculate the average queue length of the port queue of the OpenFlow switch in the second preset time period
Figure FDA0002466341370000031
And real-time queue length of the OpenFlow switch port queue
Figure FDA0002466341370000032
Substituting the following formula (5) to calculate the current average queue length of the OpenFlow switch port queue
Figure FDA0002466341370000033
Figure FDA0002466341370000034
In the formula, wq is a weight value, and the numeric area is (0, 1);
the queuing delay calculation module is configured to obtain a current queue bandwidth of the port queue of the OpenFlow switch;
the queuing delay calculation module is configured to queue the current average queue length of the port queue of the OpenFlow switch
Figure FDA0002466341370000035
And a current queue bandwidth of the OpenFlow switch port queue
Figure FDA0002466341370000036
Substituting the following formula (6) to calculate the current queuing delay t of the port queue of the OpenFlow switch:
Figure FDA0002466341370000037
the policy management module is configured to reallocate bandwidth to the OpenFlow switch port queue according to the current queuing delay of the OpenFlow switch port queue.
5. An apparatus for obtaining queue length, the apparatus comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor; wherein the processor implements the method steps of obtaining queue length of claim 1 or 2 when executing the program.
6. A computer readable storage medium, storing one or more programs, the one or more programs being executable by one or more processors to perform the method steps of obtaining queue lengths of claim 1 or 2.
CN201711117765.3A 2017-11-13 2017-11-13 Method and device for acquiring queue length and computer readable storage medium Active CN109787922B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711117765.3A CN109787922B (en) 2017-11-13 2017-11-13 Method and device for acquiring queue length and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711117765.3A CN109787922B (en) 2017-11-13 2017-11-13 Method and device for acquiring queue length and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109787922A CN109787922A (en) 2019-05-21
CN109787922B true CN109787922B (en) 2020-08-21

Family

ID=66493262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711117765.3A Active CN109787922B (en) 2017-11-13 2017-11-13 Method and device for acquiring queue length and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109787922B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110493658A (en) * 2019-08-20 2019-11-22 武汉兴图新科电子股份有限公司 A kind of network bandwidth method for detecting, equipment and storage equipment
CN114244852B (en) * 2021-11-09 2024-01-30 北京罗克维尔斯科技有限公司 Data transmission method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7139281B1 (en) * 1999-04-07 2006-11-21 Teliasonera Ab Method, system and router providing active queue management in packet transmission systems
CN102202348A (en) * 2010-03-22 2011-09-28 华为技术有限公司 Data packet sending method and access point
CN102932840A (en) * 2012-11-14 2013-02-13 浙江大学 Wireless router active queue management method based on rates and queue length
CN103220229A (en) * 2001-04-09 2013-07-24 艾利森电话股份有限公司 Method of controlling a queue buffer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7139281B1 (en) * 1999-04-07 2006-11-21 Teliasonera Ab Method, system and router providing active queue management in packet transmission systems
CN103220229A (en) * 2001-04-09 2013-07-24 艾利森电话股份有限公司 Method of controlling a queue buffer
CN102202348A (en) * 2010-03-22 2011-09-28 华为技术有限公司 Data packet sending method and access point
CN102932840A (en) * 2012-11-14 2013-02-13 浙江大学 Wireless router active queue management method based on rates and queue length

Also Published As

Publication number Publication date
CN109787922A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
EP3275140B1 (en) Technique for achieving low latency in data center network environments
CN116018790A (en) Receiver-based precise congestion control
EP4024778A1 (en) Method for determining required bandwidth for data stream transmission, and devices and system
US20220191140A1 (en) Data transmission control method, apparatus, and storage medium
US11095674B2 (en) DDoS attack detection method and device
US20220038374A1 (en) Microburst detection and management
WO2017112260A1 (en) Technologies for sideband performance tracing of network traffic
US11653251B2 (en) Packet forwarding method and apparatus
CN112737914B (en) Message processing method and device, network equipment and readable storage medium
US10389636B2 (en) Technologies for adaptive routing using network traffic characterization
EP2670085A1 (en) System for performing Data Cut-Through
US20220116304A1 (en) Methods, systems and computer readable media for active queue management
US10536385B2 (en) Output rates for virtual output queses
CN109787922B (en) Method and device for acquiring queue length and computer readable storage medium
WO2011049850A1 (en) Aggregate policing applying max-min fairness for each data source based on probabilistic filtering
DE102022121268A1 (en) CONGESTION CONTROL BASED ON NETWORK TELEMETRY
CN104580008A (en) Method and device for improving multi-queue random message discarding accuracy based on hardware
CN113055301A (en) Congestion control method and related equipment
US11646970B2 (en) Method and apparatus for determining packet dequeue rate
CN109995608B (en) Network rate calculation method and device
CN113453285B (en) Resource adjusting method, device and storage medium
CN111641698B (en) Data statistical method, system, equipment and storage medium
US9379993B1 (en) Network control protocol
Karpukhin et al. Mathematical modelling of infocommunication systems by means of chaos theory methods
US11258712B2 (en) Resource efficient forwarding of guaranteed and non-guaranteed data packets

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 100032 No. 29, Finance Street, Beijing, Xicheng District

Patentee after: CHINA MOBILE COMMUNICATIONS GROUP Co.,Ltd.

Address before: 100032 No. 29, Finance Street, Beijing, Xicheng District

Patentee before: CHINA MOBILE COMMUNICATIONS Corp.

CP01 Change in the name or title of a patent holder
TR01 Transfer of patent right

Effective date of registration: 20220708

Address after: 610041 China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan

Patentee after: China Mobile (Chengdu) information and Communication Technology Co.,Ltd.

Patentee after: CHINA MOBILE COMMUNICATIONS GROUP Co.,Ltd.

Address before: 100032 No. 29, Finance Street, Beijing, Xicheng District

Patentee before: CHINA MOBILE COMMUNICATIONS GROUP Co.,Ltd.

TR01 Transfer of patent right